diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..d28041d --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,25 @@ +#!/usr/bin/env sh +# +# DCP pre-push guard. +# +# OSS must never push private/premium code (one-way dependency: private -> OSS). +# This runs the publish guard, which (a) verifies package publish config and +# (b) scans tracked files for premium markers. A non-zero exit blocks the push. +# +# Bypass (use only when you are SURE): git push --no-verify + +set -e + +echo "[pre-push] Running DCP publish guard (premium-leak + publish-config check)..." + +# Resolve repo root so the hook works regardless of CWD. +ROOT="$(git rev-parse --show-toplevel)" + +if ! node "$ROOT/scripts/publish-guard.mjs"; then + echo "" + echo "[pre-push] BLOCKED: publish guard failed. Fix the issues above before pushing." + echo "[pre-push] (Override only if you are certain: git push --no-verify)" + exit 1 +fi + +echo "[pre-push] Publish guard passed." diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1edd56a..506cd90 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,17 +23,6 @@ updates: interval: monthly open-pull-requests-limit: 1 - - package-ecosystem: cargo - directory: /packages/dcp-desktop/src-tauri - schedule: - interval: monthly - open-pull-requests-limit: 2 - groups: - cargo-minor-and-patch: - update-types: - - minor - - patch - - package-ecosystem: pip directory: /sdks/python schedule: diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml deleted file mode 100644 index f3fded2..0000000 --- a/.github/workflows/build-desktop.yml +++ /dev/null @@ -1,172 +0,0 @@ -name: Build Desktop Apps - -on: - push: - tags: - - 'v*' - workflow_dispatch: - -permissions: - contents: write - -jobs: - build: - strategy: - fail-fast: false - matrix: - include: - - platform: 'macos-latest' - args: '--target aarch64-apple-darwin' - name: 'macOS Apple Silicon' - - platform: 'macos-latest' - args: '--target x86_64-apple-darwin' - name: 'macOS Intel' - - platform: 'ubuntu-22.04' - args: '' - name: 'Linux' - - platform: 'windows-latest' - args: '' - name: 'Windows' - - runs-on: ${{ matrix.platform }} - name: Build ${{ matrix.name }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.15.0 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '22.22.2' - cache: 'pnpm' - - - name: Install Rust stable - uses: dtolnay/rust-toolchain@stable - with: - targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - - - name: Install Linux dependencies - if: matrix.platform == 'ubuntu-22.04' - run: | - sudo apt-get update - sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Build all packages - run: pnpm run build - - - name: Build Desktop App - run: pnpm --filter @dcprotocol/desktop exec tauri build ${{ matrix.args }} - env: - TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} - TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - - - name: Upload macOS Apple Silicon artifacts - if: matrix.platform == 'macos-latest' && contains(matrix.args, 'aarch64') - uses: actions/upload-artifact@v4 - with: - name: macos-aarch64 - path: | - packages/dcp-desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg - packages/dcp-desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/macos/*.app - - - name: Upload macOS Intel artifacts - if: matrix.platform == 'macos-latest' && contains(matrix.args, 'x86_64') - uses: actions/upload-artifact@v4 - with: - name: macos-x86_64 - path: | - packages/dcp-desktop/src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg - packages/dcp-desktop/src-tauri/target/x86_64-apple-darwin/release/bundle/macos/*.app - - - name: Upload Linux artifacts - if: matrix.platform == 'ubuntu-22.04' - uses: actions/upload-artifact@v4 - with: - name: linux-x86_64 - path: | - packages/dcp-desktop/src-tauri/target/release/bundle/deb/*.deb - packages/dcp-desktop/src-tauri/target/release/bundle/rpm/*.rpm - - - name: Upload Windows artifacts - if: matrix.platform == 'windows-latest' - uses: actions/upload-artifact@v4 - with: - name: windows-x86_64 - path: | - packages/dcp-desktop/src-tauri/target/release/bundle/msi/*.msi - packages/dcp-desktop/src-tauri/target/release/bundle/nsis/*.exe - - release: - needs: build - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' - - steps: - - name: Download all artifacts - uses: actions/download-artifact@v4 - - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - files: | - macos-aarch64/**/*.dmg - macos-aarch64/**/*.app - macos-x86_64/**/*.dmg - macos-x86_64/**/*.app - linux-x86_64/**/*.deb - linux-x86_64/**/*.rpm - windows-x86_64/**/*.msi - windows-x86_64/**/*.exe - tag_name: ${{ github.event_name == 'workflow_dispatch' && format('dev-{0}', github.sha) || github.ref_name }} - name: ${{ github.event_name == 'workflow_dispatch' && format('Development Build ({0})', github.sha) || github.ref_name }} - body: | - ## DCP Desktop ${{ github.event_name == 'workflow_dispatch' && format('Development Build ({0})', github.sha) || github.ref_name }} - - Cross-platform desktop application for DCP - connect AI agents to your Solana wallet and personal vault with local approval. - - ### Release notes - - - Fixed auto-approved budget accounting for `sign_x402` and `/v1/vault/sign`. - - Kept internal budget ledger sessions hidden from user-facing agent lists. - - Added regression coverage for repeated under-threshold spend reaching the daily budget limit. - - Updated the bundled vault runtime used by the Desktop app. - - Thanks to @TateLyman for the community contribution behind this fix. - - ### Downloads - - **macOS:** - - Apple Silicon (M1/M2/M3): Download the `aarch64` DMG - - Intel: Download the `x86_64` DMG - - **Windows:** - - Download the `.msi` installer or `.exe` installer - - **Linux:** - - Download the `.deb` package (Debian/Ubuntu) - - Download the `.rpm` package (Fedora/RHEL) - - ### Installation - - - **macOS**: Open the DMG file and drag DCP to your Applications folder. If macOS blocks the app because this build is not notarized yet, run `xattr -cr /Applications/DCP.app` once, then open DCP again. - - **Windows**: Run the MSI or EXE installer - - **Linux**: Install the DEB or RPM package using your package manager - - ### Features - - - Secure local data storage with encryption - - System tray integration - - Auto-start on system boot - - Cross-platform support (macOS, Windows, Linux) - draft: false - prerelease: ${{ github.event_name == 'workflow_dispatch' }} - overwrite_files: true diff --git a/.gitignore b/.gitignore index eafd767..ce4980b 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,8 @@ temp/ # Local test configs (may contain secrets) test-*.json *.local.json + +# Operator-specific deployment configs (our hosted infra — not part of OSS). +# Self-hosters: copy fly.toml.example / fly.telegram.toml.example and set your own app name. +fly.toml +fly.telegram.toml diff --git a/fly.telegram.toml b/fly.telegram.toml.example similarity index 50% rename from fly.telegram.toml rename to fly.telegram.toml.example index 28bea7c..a1db961 100644 --- a/fly.telegram.toml +++ b/fly.telegram.toml.example @@ -1,4 +1,14 @@ -app = 'telegram-dcp-1lystore' +# fly.telegram.toml — example Fly.io config for self-hosting the DCP Telegram service. +# +# Copy to `fly.telegram.toml`, set your own `app` name, then deploy with: +# fly deploy -c fly.telegram.toml +# `fly.telegram.toml` is gitignored so your deployment config stays private. +# +# Bring your OWN Telegram bot token (from @BotFather): +# fly secrets set DCP_TELEGRAM_BOT_TOKEN=123456:ABC-DEF... +# See https://fly.io/docs/reference/configuration/ + +app = 'your-dcp-telegram-app' primary_region = 'iad' [build] diff --git a/fly.toml b/fly.toml deleted file mode 100644 index d86e916..0000000 --- a/fly.toml +++ /dev/null @@ -1,23 +0,0 @@ -# fly.toml app configuration file generated for relay-dcp-1lystore on 2026-03-18T18:25:53Z -# -# See https://fly.io/docs/reference/configuration/ for information about how to use this file. -# - -app = 'relay-dcp-1lystore' -primary_region = 'iad' - -[build] - -[http_service] - internal_port = 8422 - force_https = true - auto_stop_machines = 'stop' - auto_start_machines = true - min_machines_running = 0 - processes = ['app'] - -[[vm]] - memory = '1gb' - cpu_kind = 'shared' - cpus = 1 - memory_mb = 1024 diff --git a/fly.toml.example b/fly.toml.example new file mode 100644 index 0000000..775a895 --- /dev/null +++ b/fly.toml.example @@ -0,0 +1,24 @@ +# fly.toml — example Fly.io config for self-hosting the DCP relay. +# +# Copy to `fly.toml`, set your own `app` name, then `fly deploy`. +# `fly.toml` is gitignored so your deployment config stays private. +# See https://fly.io/docs/reference/configuration/ + +app = 'your-dcp-relay-app' +primary_region = 'iad' + +[build] + +[http_service] + internal_port = 8422 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1 + memory_mb = 1024 diff --git a/package.json b/package.json index 4fe13da..fdaf9e9 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "packageManager": "pnpm@9.15.0", "scripts": { "preinstall": "node scripts/check-node-version.mjs && npx only-allow pnpm", + "prepare": "git config core.hooksPath .githooks || true", "build": "pnpm -r --filter @dcprotocol/core run build && pnpm -r run build", "dev:cli": "pnpm -r --filter @dcprotocol/core run build && pnpm --filter @dcprotocol/vault run dev --", "test": "pnpm -r run test", diff --git a/packages/dcp-agent/package.json b/packages/dcp-agent/package.json index e41bd97..8e84d19 100644 --- a/packages/dcp-agent/package.json +++ b/packages/dcp-agent/package.json @@ -55,16 +55,19 @@ "author": "DCP Protocol", "license": "Apache-2.0", "dependencies": { - "@dcprotocol/core": "^2.0.1", "@dcprotocol/client": "^2.0.1", + "@dcprotocol/core": "^2.0.1", "@modelcontextprotocol/sdk": "^1.0.0", "@noble/curves": "^1.4.0", + "@solana/web3.js": "^1.98.0", "chalk": "^5.3.0", "commander": "^12.1.0", - "ora": "^8.0.1" + "ora": "^8.0.1", + "qrcode-terminal": "^0.12.0" }, "devDependencies": { "@types/node": "^22.10.2", + "@types/qrcode-terminal": "^0.12.2", "tsup": "^8.3.5", "tsx": "^4.19.2", "typescript": "^5.7.2", diff --git a/packages/dcp-agent/src/config.ts b/packages/dcp-agent/src/config.ts index cf07bbb..0d570ed 100644 --- a/packages/dcp-agent/src/config.ts +++ b/packages/dcp-agent/src/config.ts @@ -13,7 +13,7 @@ import { generateSigningKeyPair, type SignedPairingGrant, } from '@dcprotocol/core'; -import { AgentConfig, AgentError } from './types.js'; +import { AgentConfig, AgentError, type MobilePairingApprovalStatus, type MobilePendingConfig } from './types.js'; // ============================================================================ // Constants @@ -151,6 +151,56 @@ export function saveConfig(config: AgentConfig): void { fs.writeFileSync(configPath, JSON.stringify(config, null, 2), { mode: 0o600 }); } +/** + * Save pending mobile pairing material. + * + * This is not a usable AgentConfig yet. The mobile vault must approve the + * invite and return vault identity before this can be promoted to a runtime + * agent config. + */ +export function saveMobilePendingConfig(config: MobilePendingConfig): void { + ensureConfigDir(); + const safeInviteId = config.invite_id.replace(/[^a-zA-Z0-9_-]/g, '_'); + const configPath = path.join(CONFIG_DIR, `${safeInviteId}.mobile-pending.json`); + fs.writeFileSync(configPath, JSON.stringify(config, null, 2), { mode: 0o600 }); +} + +export function promoteMobilePendingConfig( + pending: MobilePendingConfig, + approval: MobilePairingApprovalStatus +): AgentConfig { + if ( + approval.status !== 'approved' || + !approval.agent_id || + !approval.vault_id || + !approval.vault_hpke_public_key || + !approval.vault_signing_public_key + ) { + throw new AgentError('INVALID_GRANT', 'Mobile pairing approval is incomplete'); + } + + const config: AgentConfig = { + agent_id: approval.agent_id, + agent_name: pending.invite.agent_name, + vault_id: approval.vault_id, + mode: 'mcp', + vault_hpke_public_key: approval.vault_hpke_public_key, + vault_signing_public_key: approval.vault_signing_public_key, + relay_url: pending.invite.relay_url, + service_keypair: pending.service_keypair, + paired_at: new Date().toISOString(), + grant_expires_at: pending.invite.expires_at, + }; + + saveConfig(config); + const safeInviteId = pending.invite_id.replace(/[^a-zA-Z0-9_-]/g, '_'); + const pendingPath = path.join(CONFIG_DIR, `${safeInviteId}.mobile-pending.json`); + if (fs.existsSync(pendingPath)) { + fs.unlinkSync(pendingPath); + } + return config; +} + /** * Load agent configuration * diff --git a/packages/dcp-agent/src/index.ts b/packages/dcp-agent/src/index.ts index e15b89a..48f328b 100644 --- a/packages/dcp-agent/src/index.ts +++ b/packages/dcp-agent/src/index.ts @@ -21,13 +21,18 @@ import chalk from 'chalk'; import ora, { type Ora } from 'ora'; import * as fs from 'node:fs'; import * as path from 'node:path'; +import * as os from 'node:os'; import { spawn } from 'node:child_process'; import { fileURLToPath } from 'node:url'; +import qrcode from 'qrcode-terminal'; +import { Keypair, LAMPORTS_PER_SOL, PublicKey, SystemProgram, Transaction } from '@solana/web3.js'; import { parseAndVerifyGrant, createConfigFromGrant, exchangePairingGrant, saveConfig, + saveMobilePendingConfig, + promoteMobilePendingConfig, loadConfig, listConfigs, deleteConfig, @@ -35,16 +40,25 @@ import { findAgent, } from './config.js'; import { AgentProxy } from './proxy.js'; +import { AgentConnection } from './connection.js'; import { runMcpServer } from './mcp.js'; import { runHttpMcpServer } from './http-mcp.js'; import { AgentError } from './types.js'; import { processSecretsRequest, fetchSecret, fetchSecrets } from './secrets.js'; +import { createMobilePairingInvite, publishMobilePairingInvite, waitForMobilePairingApproval } from './mobile-pairing.js'; import { configureOpenClawCommand, installServiceCommand, uninstallServiceCommand, } from './commands/install-service.js'; -import type { PairOptions, RunOptions, StatusOptions } from './types.js'; +import type { + MobileAgentClient, + MobileAgentEnvironment, + MobileDcpScope, + PairOptions, + RunOptions, + StatusOptions, +} from './types.js'; // ============================================================================ // Helpers @@ -201,11 +215,408 @@ async function pairCommand(grantToken: string, options: PairOptions): Promise = { + 'claude-desktop': 'Claude Desktop', + cursor: 'Cursor', + vscode: 'VS Code', + hermes: 'Hermes', + openclaw: 'OpenClaw', + mcp: 'MCP Agent', + custom: 'Custom Agent', + hosted: 'Hosted Agent', + }; + return names[client] || 'DCP Agent'; +} + +function mcpServerConfig(agentId: string): { command: string; args: string[] } { + return { + command: 'npx', + args: ['-y', '@dcprotocol/agent', 'run', '--mode', 'mcp', '--agent', agentId, '--force-relay'], + }; +} + +function claudeDesktopConfigPath(): string | null { + const home = os.homedir(); + if (process.platform === 'darwin') { + return path.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'); + } + if (process.platform === 'win32') { + const appData = process.env.APPDATA; + return appData ? path.join(appData, 'Claude', 'claude_desktop_config.json') : null; + } + return path.join(home, '.config', 'Claude', 'claude_desktop_config.json'); +} + +function readJsonFile(filePath: string): Record { + if (!fs.existsSync(filePath)) return {}; + try { + const raw = fs.readFileSync(filePath, 'utf8'); + return raw.trim() ? JSON.parse(raw) as Record : {}; + } catch { + throw new Error(`Could not parse existing MCP config: ${filePath}`); + } +} + +function upsertClaudeDesktopMcp(agentId: string): string { + const configPath = claudeDesktopConfigPath(); + if (!configPath) { + throw new Error('Could not locate Claude Desktop config path on this OS'); + } + + const config = readJsonFile(configPath); + const mcpServers = config.mcpServers && typeof config.mcpServers === 'object' + ? config.mcpServers as Record + : {}; + mcpServers.dcp = mcpServerConfig(agentId); + config.mcpServers = mcpServers; + + fs.mkdirSync(path.dirname(configPath), { recursive: true, mode: 0o700 }); + fs.writeFileSync(configPath, JSON.stringify(config, null, 2), { mode: 0o600 }); + return configPath; +} + +function printMcpInstallHelp(client: MobileAgentClient, agentId: string): void { + const serverConfig = mcpServerConfig(agentId); + if (client === 'cursor') { + const deepLink = `cursor://anysphere.cursor-deeplink/mcp/install?name=dcp&config=${Buffer.from(JSON.stringify(serverConfig)).toString('base64')}`; + console.log(); + console.log(chalk.bold('Cursor MCP install link:')); + console.log(deepLink); + return; + } + + console.log(); + console.log(chalk.bold('MCP config:')); + console.log(JSON.stringify({ mcpServers: { dcp: serverConfig } }, null, 2)); +} + +function configureMcpForClient(client: MobileAgentClient, agentId: string): void { + if (client === 'claude-desktop') { + const configPath = upsertClaudeDesktopMcp(agentId); + success('Claude Desktop MCP config updated'); + console.log(` ${dim('Config:')} ${configPath}`); + console.log(dim('Restart Claude Desktop to load the DCP mobile-backed server.')); + return; + } + + printMcpInstallHelp(client, agentId); +} + +async function mobilePairCommand(options: MobilePairOptions): Promise { + try { + const client = options.client || 'custom'; + const environment = options.environment || (client === 'hermes' || client === 'openclaw' ? 'vps' : 'local'); + const scopes = (options.scope?.length ? options.scope : []) as MobileDcpScope[]; + const daily = parseNumberOption(options.dailyBudget, 0, '--daily-budget'); + const approvalThreshold = parseNumberOption(options.approvalThreshold, 0, '--approval-threshold'); + const ttlSeconds = parseNumberOption(options.ttlSeconds, 10 * 60, '--ttl-seconds'); + + const created = createMobilePairingInvite({ + client, + environment, + agentName: options.name || defaultAgentName(client), + agentId: options.agentId, + relayUrl: options.relayUrl, + requestedScopes: scopes, + requestedBudget: { + daily, + currency: options.currency || 'SOL', + approval_threshold: approvalThreshold, + }, + ttlSeconds, + }); + + await publishMobilePairingInvite(created.invite); + saveMobilePendingConfig(created.pendingConfig); + + if (options.json) { + console.log(JSON.stringify({ + invite: created.invite, + invite_url: created.inviteUrl, + short_invite_url: created.shortInviteUrl, + }, null, 2)); + return; + } + + console.log(); + console.log(chalk.bold('DCP Mobile Pairing')); + console.log(dim('Scan this QR with DCP Mobile, or paste the pairing URL into the app.')); + console.log(); + + if (!options.noQr) { + qrcode.generate(created.shortInviteUrl, { small: !options.largeQr }); + console.log(); + } + + console.log(` ${dim('Agent:')} ${created.invite.agent_name}`); + console.log(` ${dim('Agent ID:')} ${created.invite.requested_agent_id}`); + console.log(` ${dim('Client:')} ${created.invite.agent_client}`); + console.log(` ${dim('Environment:')} ${created.invite.environment}`); + console.log(` ${dim('Invite ID:')} ${created.invite.invite_id}`); + console.log(` ${dim('Expires:')} ${created.invite.expires_at}`); + console.log(); + console.log(chalk.bold('Pairing URL:')); + console.log(created.shortInviteUrl); + console.log(dim('Full signed invite is stored on relay and verified by the mobile app.')); + console.log(); + console.log(dim('Pending agent key material was saved locally with 0600 permissions.')); + console.log(dim('The mobile vault must approve the invite before this agent can request DCP actions.')); + + if (options.wait) { + const waitSeconds = parseNumberOption(options.waitSeconds, ttlSeconds, '--wait-seconds'); + console.log(); + console.log(dim(`Waiting up to ${waitSeconds}s for DCP Mobile approval...`)); + const status = await waitForMobilePairingApproval( + created.invite.relay_url, + created.invite.invite_id, + { timeoutMs: waitSeconds * 1000 } + ); + + if (status.status !== 'approved') { + error(`Mobile pairing ${status.status}${status.error ? `: ${status.error}` : ''}`); + process.exit(1); + } + + success('Mobile pairing approved'); + console.log(` ${dim('Agent ID:')} ${status.agent_id}`); + console.log(` ${dim('Vault ID:')} ${status.vault_id}`); + const config = promoteMobilePendingConfig(created.pendingConfig, status); + console.log(dim(`Saved agent config: ${config.agent_id}`)); + if (options.configureMcp) { + configureMcpForClient(client, config.agent_id); + } else { + console.log(dim(`Next: run "dcp-agent run --agent ${config.agent_id} --mode mcp --force-relay" from your MCP host.`)); + } + } + } catch (err) { + error(err instanceof Error ? err.message : 'Failed to create mobile pairing invite'); + process.exit(1); + } +} + +async function mobileInstallCommand(options: MobilePairOptions): Promise { + await mobilePairCommand({ + ...options, + wait: true, + configureMcp: options.configureMcp ?? true, + }); +} + function getAgentDataDir(): string { const homeDir = process.env.HOME || process.env.USERPROFILE || '.'; return path.join(homeDir, '.dcp', 'agents'); } +function loadAgentForCommand(agentIdOrName?: string) { + if (agentIdOrName) { + const config = findAgent(agentIdOrName); + if (!config) { + error(`Agent not found: ${agentIdOrName}`); + console.log(dim('Available agents:')); + listConfigs().forEach((c) => console.log(dim(` - ${c.agent_name} (${c.agent_id})`))); + process.exit(1); + } + return config; + } + + const config = getDefaultAgent(); + if (!config) { + error('No agent configured. Run "dcp-agent mobile pair --wait" first.'); + process.exit(1); + } + return config; +} + +function buildSmokeTransferTx(fromAddress: string, destinationAddress: string, amountSol: number): string { + if (!Number.isFinite(amountSol) || amountSol <= 0) { + throw new Error('--sign-tx-amount must be a positive SOL amount'); + } + + const fromPubkey = new PublicKey(fromAddress); + const toPubkey = new PublicKey(destinationAddress); + const lamports = Math.max(1, Math.round(amountSol * LAMPORTS_PER_SOL)); + const tx = new Transaction({ + feePayer: fromPubkey, + recentBlockhash: Keypair.generate().publicKey.toBase58(), + }).add( + SystemProgram.transfer({ + fromPubkey, + toPubkey, + lamports, + }) + ); + + return tx.serialize({ requireAllSignatures: false, verifySignatures: false }).toString('base64'); +} + +async function smokeCommand(options: SmokeOptions): Promise { + const config = loadAgentForCommand(options.agent); + const connection = new AgentConnection(config, { forceRelay: options.forceRelay ?? true }); + + try { + if (!options.json) { + console.log(); + console.log(chalk.bold('DCP Agent Smoke Test')); + console.log(dim('─'.repeat(50))); + console.log(` ${dim('Agent:')} ${config.agent_name} (${config.agent_id})`); + console.log(` ${dim('Vault:')} ${config.vault_id}`); + console.log(` ${dim('Relay:')} ${config.relay_url}`); + console.log(); + } + + await connection.connect(); + const result: Record = {}; + + const needsAddress = !options.skipAddress || Boolean(options.signTxAmount); + const address = needsAddress ? await connection.getAddress('solana') : null; + if (address) { + result.address = address; + + if (!options.json) { + success(`Wallet address: ${address.address}`); + } + } + + if (options.signMessage) { + if (!options.json) { + console.log(dim('Waiting for mobile approval of sign_message...')); + } + const signed = await connection.signMessage({ + chain: 'solana', + message: options.signMessage, + encoding: 'utf8', + description: 'DCP mobile smoke test', + }); + result.signature = signed; + if (!options.json) { + success(`Signature: ${signed.signature}`); + } + } + + if (options.signTxAmount) { + if (!address) { + throw new Error('Wallet address is required to build the smoke transaction'); + } + const amount = parseNumberOption(options.signTxAmount, Number.NaN, '--sign-tx-amount'); + const currency = (options.signTxCurrency || 'SOL').toUpperCase(); + if (currency !== 'SOL') { + throw new Error('--sign-tx-currency currently supports SOL for generated smoke transactions'); + } + const destination = options.signTxDestination || Keypair.generate().publicKey.toBase58(); + const unsignedTx = buildSmokeTransferTx(address.address, destination, amount); + + if (!options.json) { + console.log(dim(`Waiting for mobile approval of vault_sign_tx ${amount} SOL...`)); + console.log(dim(`Destination: ${destination}`)); + } + + const signedTx = await connection.signTx({ + chain: 'solana', + unsignedTx, + amount, + currency, + destination, + description: `DCP mobile smoke test transfer (${amount} SOL)`, + idempotencyKey: `smoke-${Date.now()}`, + }); + result.sign_tx = signedTx; + if (!options.json) { + success(`Transaction signed: ${signedTx.signature}`); + if (signedTx.remaining_daily !== undefined) { + success(`Remaining daily budget: ${signedTx.remaining_daily} ${currency}`); + } + } + } + + if (options.writeScope) { + if (!options.writeValue) { + throw new Error('--write-value is required with --write-scope'); + } + if (!options.json) { + console.log(dim(`Waiting for mobile approval of vault_write ${options.writeScope}...`)); + } + const written = await connection.writeCredential(options.writeScope, { + name: options.writeName || options.writeScope.split('.').at(-1) || options.writeScope, + value: options.writeValue, + }); + result.write = written; + if (!options.json) { + success(`Write approved: ${written.scope}`); + } + } + + if (options.readScope) { + if (!options.json) { + console.log(dim(`Waiting for mobile approval of vault_read ${options.readScope}...`)); + } + const read = await connection.readCredential(options.readScope); + result.read = read; + if (!options.json) { + const keys = read.data ? Object.keys(read.data).join(', ') : 'no data'; + success(`Read approved: ${read.scope} (${keys})`); + } + } + + await connection.close(); + + if (options.json) { + console.log(JSON.stringify(result, null, 2)); + } + } catch (err) { + await connection.close().catch(() => undefined); + if (options.json) { + console.log(JSON.stringify({ error: err instanceof Error ? err.message : 'Smoke test failed' }, null, 2)); + } else { + error(err instanceof Error ? err.message : 'Smoke test failed'); + } + process.exit(1); + } +} + async function runCommand(options: RunOptions): Promise { // Get agent config let config; @@ -550,6 +961,52 @@ program .option('-n, --name ', 'Override agent name') .action(pairCommand); +const mobileCommand = program + .command('mobile') + .description('DCP Mobile pairing commands'); + +mobileCommand + .command('pair') + .description('Create a DCP Mobile pairing invite') + .option('--client ', 'Agent client: claude-desktop, cursor, vscode, hermes, openclaw, mcp, custom, hosted', 'custom') + .option('--environment ', 'Environment: local, vps, hosted, dev') + .option('-n, --name ', 'Agent display name') + .option('--agent-id ', 'Agent ID to request. Defaults to canonical DCP ID for known clients.') + .option('--relay-url ', 'Mobile relay API/base URL') + .option('--scope ', 'Requested scope. Repeat for multiple scopes.', (value, previous: string[] = []) => [...previous, value]) + .option('--daily-budget ', 'Requested daily budget', '0') + .option('--currency ', 'Budget currency: SOL, USDC, or 1LY', 'SOL') + .option('--approval-threshold ', 'Auto-approval threshold', '0') + .option('--ttl-seconds ', 'Invite lifetime in seconds', '600') + .option('--json', 'Print machine-readable JSON') + .option('--no-qr', 'Do not print terminal QR') + .option('--large-qr', 'Print a larger terminal QR for difficult scanners') + .option('--wait', 'Wait until DCP Mobile approves or denies the pairing') + .option('--wait-seconds ', 'How long --wait should poll for approval') + .option('--configure-mcp', 'After approval, configure the local MCP client when supported') + .action(mobilePairCommand); + +mobileCommand + .command('install') + .description('Pair DCP Mobile and configure this MCP client when supported') + .option('--client ', 'Agent client: claude-desktop, cursor, vscode, hermes, openclaw, mcp, custom, hosted', 'claude-desktop') + .option('--environment ', 'Environment: local, vps, hosted, dev') + .option('-n, --name ', 'Agent display name') + .option('--agent-id ', 'Agent ID to request. Defaults to canonical DCP ID for known clients.') + .option('--relay-url ', 'Mobile relay API/base URL') + .option('--scope ', 'Requested scope. Repeat for multiple scopes.', (value, previous: string[] = []) => [...previous, value]) + .option('--daily-budget ', 'Requested daily budget', '0') + .option('--currency ', 'Budget currency: SOL, USDC, or 1LY', 'SOL') + .option('--approval-threshold ', 'Auto-approval threshold', '0') + .option('--ttl-seconds ', 'Invite lifetime in seconds', '600') + .option('--json', 'Print machine-readable JSON') + .option('--no-qr', 'Do not print terminal QR') + .option('--large-qr', 'Print a larger terminal QR for difficult scanners') + .option('--wait-seconds ', 'How long to wait for approval') + .option('--configure-mcp', 'Configure the local MCP client when supported', true) + .option('--no-configure-mcp', 'Do not write MCP client config; print next steps only') + .action(mobileInstallCommand); + program .command('run') .description('Run the agent') @@ -562,6 +1019,23 @@ program .option('--force-relay', 'Force relay mode (skip local vault detection)') .action(runCommand); +program + .command('smoke') + .description('Test a paired agent against the vault/relay without configuring Claude') + .option('-a, --agent ', 'Agent ID or name to test (default: first configured)') + .option('--sign-message ', 'Request a Solana message signature for login/auth challenge testing') + .option('--sign-tx-amount ', 'Generate and request signing for a smoke-test SOL transfer amount') + .option('--sign-tx-currency ', 'Currency for --sign-tx-amount (currently SOL)', 'SOL') + .option('--sign-tx-destination
', 'Destination public key for generated smoke-test transfer') + .option('--read-scope ', 'Also request a mobile-approved vault_read for a scope, e.g. credentials.api.openai') + .option('--write-scope ', 'Also request a mobile-approved vault_write for a scope, e.g. credentials.api.openai') + .option('--write-name ', 'Display name to store with --write-scope') + .option('--write-value ', 'Secret value to store with --write-scope') + .option('--skip-address', 'Skip the initial wallet address check') + .option('--force-relay', 'Force relay mode (default for smoke)', true) + .option('-j, --json', 'Output as JSON') + .action(smokeCommand); + program .command('status') .description('Show agent status') diff --git a/packages/dcp-agent/src/mobile-pairing.ts b/packages/dcp-agent/src/mobile-pairing.ts new file mode 100644 index 0000000..4a99c9f --- /dev/null +++ b/packages/dcp-agent/src/mobile-pairing.ts @@ -0,0 +1,228 @@ +import { randomUUID } from 'node:crypto'; +import { canonicalJson, signMessage, generateSigningKeyPair } from '@dcprotocol/core'; +import type { + MobileAgentClient, + MobileAgentEnvironment, + MobileDcpScope, + MobilePairingApprovalStatus, + MobilePairingBudget, + MobilePairingInvite, + MobilePendingConfig, +} from './types.js'; + +export const MOBILE_PAIRING_TYPE = 'dcp_agent_pairing'; +export const MOBILE_PAIRING_VERSION = '1.0'; +// No hosted default in OSS — configure via DCP_MOBILE_RELAY_URL / DCP_RELAY_URL or +// pass relayUrl explicitly. Empty means "relay not configured". +export const DEFAULT_MOBILE_RELAY_URL = + process.env.DCP_MOBILE_RELAY_URL || process.env.DCP_RELAY_URL || ''; + +const SUPPORTED_CLIENTS = new Set([ + 'claude-desktop', + 'cursor', + 'vscode', + 'hermes', + 'openclaw', + 'mcp', + 'custom', + 'hosted', +]); + +const SUPPORTED_ENVIRONMENTS = new Set([ + 'local', + 'vps', + 'hosted', + 'dev', +]); + +const SUPPORTED_SCOPES = new Set([ + 'read:wallet.address', + 'sign:solana', + 'vault_get_address', + 'vault_budget_check', + 'vault_sign_tx', + 'vault_sign_message', +]); + +function isSupportedMobileScope(scope: string): scope is MobileDcpScope { + return ( + SUPPORTED_SCOPES.has(scope as MobileDcpScope) || + scope.startsWith('read:credentials.api.') || + scope.startsWith('write:credentials.api.') + ); +} + +export interface CreateMobilePairingInviteInput { + client: MobileAgentClient; + environment: MobileAgentEnvironment; + agentName: string; + agentId?: string; + relayUrl?: string; + requestedScopes?: MobileDcpScope[]; + requestedBudget?: MobilePairingBudget; + ttlSeconds?: number; +} + +export interface CreatedMobilePairingInvite { + invite: MobilePairingInvite; + inviteUrl: string; + shortInviteUrl: string; + pendingConfig: MobilePendingConfig; +} + +export { canonicalJson }; + +function encodeMobilePairingInvite(invite: MobilePairingInvite): string { + return `dcp://pair?invite=${encodeURIComponent(JSON.stringify(invite))}`; +} + +function encodeShortMobilePairingInvite(invite: MobilePairingInvite): string { + const params = new URLSearchParams({ + relay: invite.relay_url, + invite_id: invite.invite_id, + }); + return `dcp://pair?${params.toString()}`; +} + +export function canonicalMobileAgentId(client: MobileAgentClient): string { + const ids: Record = { + 'claude-desktop': 'agent_claude_desktop', + cursor: 'agent_cursor', + vscode: 'agent_vscode', + hermes: 'agent_hermes_local', + openclaw: 'agent_openclaw_local', + mcp: 'agent_local_mcp', + custom: `agent_mobile_${randomUUID().replace(/-/g, '').slice(0, 12)}`, + hosted: `agent_hosted_${randomUUID().replace(/-/g, '').slice(0, 12)}`, + }; + return ids[client]; +} + +function assertSupported(input: CreateMobilePairingInviteInput): void { + if (!SUPPORTED_CLIENTS.has(input.client)) { + throw new Error(`Unsupported mobile agent client: ${input.client}`); + } + if (!SUPPORTED_ENVIRONMENTS.has(input.environment)) { + throw new Error(`Unsupported mobile agent environment: ${input.environment}`); + } + for (const scope of input.requestedScopes || []) { + if (!isSupportedMobileScope(scope)) { + throw new Error(`Unsupported mobile MVP scope: ${scope}`); + } + } +} + +export function createMobilePairingInvite( + input: CreateMobilePairingInviteInput +): CreatedMobilePairingInvite { + assertSupported(input); + + const keypair = generateSigningKeyPair(); + const createdAt = new Date(); + const ttlSeconds = input.ttlSeconds ?? 10 * 60; + const expiresAt = new Date(createdAt.getTime() + ttlSeconds * 1000); + const inviteId = `mob_${randomUUID().replace(/-/g, '').slice(0, 16)}`; + const requestedAgentId = input.agentId?.trim() || canonicalMobileAgentId(input.client); + const requestedBudget = input.requestedBudget ?? { + daily: 0, + currency: 'SOL', + approval_threshold: 0, + }; + + const unsignedInvite: Omit = { + type: MOBILE_PAIRING_TYPE, + version: MOBILE_PAIRING_VERSION, + relay_url: (input.relayUrl || process.env.DCP_MOBILE_RELAY_URL || DEFAULT_MOBILE_RELAY_URL).replace(/\/$/, ''), + invite_id: inviteId, + requested_agent_id: requestedAgentId, + agent_public_key: keypair.publicKey.toString('base64'), + agent_name: input.agentName.trim(), + agent_client: input.client, + environment: input.environment, + requested_scopes: input.requestedScopes ?? [], + requested_budget: requestedBudget, + created_at: createdAt.toISOString(), + expires_at: expiresAt.toISOString(), + nonce: randomUUID(), + }; + + const signature = Buffer.from( + signMessage(Buffer.from(canonicalJson(unsignedInvite), 'utf8'), keypair.privateKey) + ).toString('base64'); + + const invite: MobilePairingInvite = { + ...unsignedInvite, + signature, + }; + const inviteUrl = encodeMobilePairingInvite(invite); + const shortInviteUrl = encodeShortMobilePairingInvite(invite); + + return { + invite, + inviteUrl, + shortInviteUrl, + pendingConfig: { + invite_id: inviteId, + invite_url: inviteUrl, + invite, + service_keypair: { + public: keypair.publicKey.toString('base64'), + private: keypair.privateKey.toString('base64'), + }, + pairing_status: 'pending_mobile_approval', + created_at: createdAt.toISOString(), + }, + }; +} + +export async function publishMobilePairingInvite(invite: MobilePairingInvite): Promise { + const response = await fetch(`${invite.relay_url.replace(/\/$/, '')}/v1/mobile/pairings`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ invite }), + }); + + if (!response.ok) { + const text = await response.text().catch(() => ''); + throw new Error(`Failed to publish mobile pairing invite (${response.status})${text ? `: ${text}` : ''}`); + } +} + +export async function getMobilePairingStatus( + relayUrl: string, + inviteId: string +): Promise { + const response = await fetch( + `${relayUrl.replace(/\/$/, '')}/v1/mobile/pairings/${encodeURIComponent(inviteId)}/status` + ); + + if (!response.ok) { + throw new Error(`Failed to fetch mobile pairing status (${response.status})`); + } + + return (await response.json()) as MobilePairingApprovalStatus; +} + +export async function waitForMobilePairingApproval( + relayUrl: string, + inviteId: string, + options: { timeoutMs?: number; pollIntervalMs?: number } = {} +): Promise { + const timeoutMs = options.timeoutMs ?? 10 * 60 * 1000; + const pollIntervalMs = options.pollIntervalMs ?? 2000; + const deadline = Date.now() + timeoutMs; + + while (Date.now() < deadline) { + const status = await getMobilePairingStatus(relayUrl, inviteId); + if (status.status !== 'pending') { + return status; + } + await new Promise((resolve) => setTimeout(resolve, pollIntervalMs)); + } + + return { + status: 'expired', + invite_id: inviteId, + error: 'Timed out waiting for mobile approval', + }; +} diff --git a/packages/dcp-agent/src/types.ts b/packages/dcp-agent/src/types.ts index 34ba059..a9f492f 100644 --- a/packages/dcp-agent/src/types.ts +++ b/packages/dcp-agent/src/types.ts @@ -102,6 +102,76 @@ export interface VpsPendingConfig { agent_name?: string; } +export type MobileAgentClient = + | 'claude-desktop' + | 'cursor' + | 'vscode' + | 'hermes' + | 'openclaw' + | 'mcp' + | 'custom' + | 'hosted'; + +export type MobileAgentEnvironment = 'local' | 'vps' | 'hosted' | 'dev'; + +export type MobileDcpScope = + | 'read:wallet.address' + | 'sign:solana' + | 'vault_get_address' + | 'vault_budget_check' + | 'vault_sign_tx' + | 'vault_sign_message' + | `read:credentials.api.${string}` + | `write:credentials.api.${string}`; + +export interface MobilePairingBudget { + daily: number; + currency: 'SOL' | 'USDC' | '1LY'; + approval_threshold: number; +} + +export interface MobilePairingInvite { + type: 'dcp_agent_pairing'; + version: '1.0'; + relay_url: string; + invite_id: string; + requested_agent_id: string; + agent_public_key: string; + agent_name: string; + agent_client: MobileAgentClient; + environment: MobileAgentEnvironment; + requested_scopes: MobileDcpScope[]; + requested_budget: MobilePairingBudget; + created_at: string; + expires_at: string; + nonce: string; + signature?: string; +} + +export interface MobilePendingConfig { + invite_id: string; + invite_url: string; + invite: MobilePairingInvite; + service_keypair: { + public: string; + private: string; + }; + pairing_status: 'pending_mobile_approval'; + created_at: string; +} + +export interface MobilePairingApprovalStatus { + status: 'pending' | 'approved' | 'denied' | 'expired' | 'not_found'; + invite_id?: string; + agent_id?: string; + vault_id?: string; + vault_hpke_public_key?: string; + vault_signing_public_key?: string; + approved_scopes?: MobileDcpScope[]; + approved_budget?: MobilePairingBudget; + error?: string; +} + /** * Check if a config is a VPS pending config (not yet approved) */ diff --git a/packages/dcp-agent/tests/mobile-pairing.test.ts b/packages/dcp-agent/tests/mobile-pairing.test.ts new file mode 100644 index 0000000..459e363 --- /dev/null +++ b/packages/dcp-agent/tests/mobile-pairing.test.ts @@ -0,0 +1,109 @@ +import { describe, expect, it } from 'vitest'; +import { verifySignature } from '@dcprotocol/core'; +import { canonicalJson, createMobilePairingInvite } from '../src/mobile-pairing.js'; + +function canonicalInvitePayload(invite: Record): string { + const { signature: _signature, ...unsigned } = invite; + return canonicalJson(unsigned); +} + +describe('mobile pairing', () => { + it('creates a signed DCP Mobile pairing invite URL', () => { + const { invite, inviteUrl, pendingConfig } = createMobilePairingInvite({ + client: 'claude-desktop', + environment: 'local', + agentName: 'Claude Desktop', + relayUrl: 'https://relay.example.test/', + requestedScopes: ['read:wallet.address', 'sign:solana'], + requestedBudget: { + daily: 5, + currency: 'USDC', + approval_threshold: 0.01, + }, + ttlSeconds: 300, + }); + + expect(invite.type).toBe('dcp_agent_pairing'); + expect(invite.version).toBe('1.0'); + expect(invite.relay_url).toBe('https://relay.example.test'); + expect(invite.requested_agent_id).toBe('agent_claude_desktop'); + expect(invite.agent_client).toBe('claude-desktop'); + expect(invite.environment).toBe('local'); + expect(invite.requested_scopes).toEqual(['read:wallet.address', 'sign:solana']); + expect(invite.signature).toBeTruthy(); + expect(inviteUrl.startsWith('dcp://pair?invite=')).toBe(true); + expect(pendingConfig.service_keypair.private).toBeTruthy(); + expect(pendingConfig.invite_id).toBe(invite.invite_id); + }); + + it('signs the invite with the generated agent public key', () => { + const { invite } = createMobilePairingInvite({ + client: 'custom', + environment: 'dev', + agentName: 'Test Agent', + agentId: 'agent_custom_test', + }); + + expect(invite.requested_agent_id).toBe('agent_custom_test'); + expect(invite.requested_scopes).toEqual([]); + + const valid = verifySignature( + Buffer.from(canonicalInvitePayload(invite), 'utf8'), + Buffer.from(invite.signature!, 'base64'), + Buffer.from(invite.agent_public_key, 'base64') + ); + + expect(valid).toBe(true); + }); + + it('covers nested budget fields in the invite signature', () => { + const { invite } = createMobilePairingInvite({ + client: 'custom', + environment: 'dev', + agentName: 'Budget Integrity Agent', + requestedBudget: { + daily: 1, + currency: 'USDC', + approval_threshold: 0, + }, + }); + + const tampered = { + ...invite, + requested_budget: { + ...invite.requested_budget, + daily: 999, + }, + }; + + const valid = verifySignature( + Buffer.from(canonicalInvitePayload(tampered), 'utf8'), + Buffer.from(invite.signature!, 'base64'), + Buffer.from(invite.agent_public_key, 'base64') + ); + + expect(valid).toBe(false); + }); + + it('allows mobile API credential read and write scopes', () => { + const { invite } = createMobilePairingInvite({ + client: 'custom', + environment: 'dev', + agentName: 'Credential Agent', + requestedScopes: ['read:credentials.api.openai', 'write:credentials.api.openai'], + }); + + expect(invite.requested_scopes).toEqual(['read:credentials.api.openai', 'write:credentials.api.openai']); + }); + + it('rejects unsupported MVP scopes', () => { + expect(() => + createMobilePairingInvite({ + client: 'custom', + environment: 'dev', + agentName: 'Bad Scope Agent', + requestedScopes: ['read:api.key' as never], + }) + ).toThrow('Unsupported mobile MVP scope'); + }); +}); diff --git a/packages/dcp-client/src/relay-transport.ts b/packages/dcp-client/src/relay-transport.ts index 9be1493..e102821 100644 --- a/packages/dcp-client/src/relay-transport.ts +++ b/packages/dcp-client/src/relay-transport.ts @@ -401,6 +401,8 @@ export class RelayTransport implements Transport { const data = response as { scope?: string; data?: Record; + name?: string; + value?: unknown; sensitivity?: 'standard' | 'sensitive' | 'critical'; is_reference?: boolean; requires_consent?: boolean; @@ -428,7 +430,7 @@ export class RelayTransport implements Transport { return { scope: data.scope || scope, - data: data.data ?? null, + data: data.data ?? (data.value !== undefined ? { name: data.name, value: data.value } : null), sensitivity: data.sensitivity, isReference: data.is_reference, sessionId: data.session_id, @@ -445,9 +447,19 @@ export class RelayTransport implements Transport { ): Promise { const sessionId = this.getSessionId(scope); + const secretValue = typeof data.value === 'string' + ? data.value + : typeof data.api_key === 'string' + ? data.api_key + : typeof data.token === 'string' + ? data.token + : undefined; + const params = { scope, data, + name: typeof data.name === 'string' ? data.name : undefined, + value: secretValue, session_id: sessionId, }; @@ -457,6 +469,7 @@ export class RelayTransport implements Transport { scope?: string; created?: boolean; updated?: boolean; + ok?: boolean; sensitivity?: 'standard' | 'sensitive' | 'critical'; requires_consent?: boolean; consent_id?: string; @@ -483,7 +496,7 @@ export class RelayTransport implements Transport { return { scope: result.scope || scope, - created: result.created ?? false, + created: result.created ?? result.ok === true, updated: result.updated ?? false, sensitivity: result.sensitivity, sessionId: result.session_id, diff --git a/packages/dcp-client/src/types.ts b/packages/dcp-client/src/types.ts index b7709d6..bbeebae 100644 --- a/packages/dcp-client/src/types.ts +++ b/packages/dcp-client/src/types.ts @@ -25,7 +25,7 @@ export interface DcpClientConfig { /** Vault ID for relay mode (required for relay, can be from env DCP_VAULT_ID) */ vaultId?: string; - /** Relay server URL (default: from env DCP_RELAY_URL or wss://relay.dcp.1ly.store) */ + /** Relay server URL (from env DCP_RELAY_URL, or pass explicitly; no hosted default in OSS) */ relayUrl?: string; /** Vault HPKE public key for relay encryption (from env DCP_VAULT_HPKE_PUBLIC_KEY) */ @@ -373,7 +373,11 @@ export interface EnvelopeAad { // ============================================================================ export const DEFAULT_LOCAL_URL = 'http://127.0.0.1:8420'; -export const DEFAULT_RELAY_URL = 'wss://relay.dcp.1ly.store'; +// No hosted default in OSS — configure via DCP_RELAY_URL or pass relayUrl explicitly. +// Empty means "relay not configured"; callers must supply a URL. +// Guarded for browser bundles where `process` is undefined. +export const DEFAULT_RELAY_URL = + (typeof process !== 'undefined' && process.env?.DCP_RELAY_URL) || ''; export const DEFAULT_TIMEOUT_MS = 30000; export const DEFAULT_LOCAL_CHECK_TIMEOUT_MS = 100; export const RELAY_VERSION = '1'; diff --git a/packages/dcp-core/src/services.ts b/packages/dcp-core/src/services.ts index 2874370..d1ca579 100644 --- a/packages/dcp-core/src/services.ts +++ b/packages/dcp-core/src/services.ts @@ -140,14 +140,19 @@ export function isValidPublicKey(key: string): boolean { // ============================================================================ /** - * Default relay URL for DCP + * Default relay URL for DCP. + * + * Open source ships with NO hosted default — self-hosters point this at their + * OWN relay via the `DCP_RELAY_URL` env var (or pass an explicit URL at the call + * site). Managed products configure this explicitly. Empty string means + * "relay not configured" and callers should require an explicit URL. */ -export const DEFAULT_RELAY_URL = 'wss://relay.dcp.1ly.store'; +export const DEFAULT_RELAY_URL = process.env.DCP_RELAY_URL || ''; /** - * Alternative relay URLs + * Alternative relay URLs (env-configurable; no hosted defaults in OSS). */ export const RELAY_URLS = { - primary: 'wss://relay.dcp.1ly.store', - fallback: 'wss://relay.dcprotocol.org', + primary: process.env.DCP_RELAY_URL || '', + fallback: process.env.DCP_RELAY_FALLBACK_URL || '', }; diff --git a/packages/dcp-core/tests/services.test.ts b/packages/dcp-core/tests/services.test.ts index 4a926ff..aa595dd 100644 --- a/packages/dcp-core/tests/services.test.ts +++ b/packages/dcp-core/tests/services.test.ts @@ -412,7 +412,10 @@ describe('Public Key Utilities', () => { }); describe('Relay Constants', () => { - it('should have default relay URL', () => { - expect(DEFAULT_RELAY_URL).toBe('wss://relay.dcp.1ly.store'); + it('should default to no hosted relay in OSS (configure via DCP_RELAY_URL)', () => { + // OSS ships without a hosted default so it never freeloads managed infra. + // Value comes from DCP_RELAY_URL at import time; unset in tests => ''. + expect(DEFAULT_RELAY_URL).toBe(process.env.DCP_RELAY_URL || ''); + expect(DEFAULT_RELAY_URL).not.toContain('1ly.store'); }); }); diff --git a/packages/dcp-desktop/.gitignore b/packages/dcp-desktop/.gitignore deleted file mode 100644 index 8fcc0a7..0000000 --- a/packages/dcp-desktop/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules/ -dist/ -target/ -*.log -.DS_Store diff --git a/packages/dcp-desktop/README.md b/packages/dcp-desktop/README.md deleted file mode 100644 index 97d3a8e..0000000 --- a/packages/dcp-desktop/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# @dcprotocol/desktop - -DCP Desktop is the user app for the vault. - -Use it to create and unlock the vault, approve agent requests, manage agents, pair Telegram, create remote-agent invites, and review audit history. - -## What Users Do Here - -- create or unlock a vault -- add identity data and wallets -- connect local MCP agents such as Claude Desktop, Cursor, and Hermes -- create remote-agent invites for VPS OpenClaw and Hermes installs -- approve or deny requests -- connect Telegram approvals -- revoke agents -- view audit events - -## Connect Agents - -Use the **Connect** screen for local agents. Desktop writes the right MCP config for supported clients, including Hermes at `~/.hermes/config.yaml`. - -Use the remote invite flow for agents running on a VPS. The generated curl command installs the DCP service, pairs it with this Desktop vault, starts HTTP MCP on the VPS, and configures OpenClaw or Hermes when detected. - -## Source Build - -Desktop uses Tauri, so local builds need Node, Rust, and the Tauri system prerequisites. - -```bash -pnpm install -pnpm --filter @dcprotocol/desktop run build -pnpm --filter @dcprotocol/desktop run tauri:dev -``` - -Create a desktop app bundle: - -```bash -pnpm --filter @dcprotocol/desktop run tauri:build -``` - -The desktop app packages a local vault runtime. After changing vault/runtime code, rebuild the app bundle from source before testing Desktop again. diff --git a/packages/dcp-desktop/index.html b/packages/dcp-desktop/index.html deleted file mode 100644 index 6a5ee72..0000000 --- a/packages/dcp-desktop/index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - DCP - - - -
- - - diff --git a/packages/dcp-desktop/package.json b/packages/dcp-desktop/package.json deleted file mode 100644 index 7b6da72..0000000 --- a/packages/dcp-desktop/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@dcprotocol/desktop", - "version": "2.0.4", - "description": "DCP Desktop - Cross-platform desktop app for DCP", - "private": true, - "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc && vite build", - "preview": "vite preview", - "tauri": "tauri", - "tauri:dev": "tauri dev", - "tauri:build": "tauri build", - "bundle:node": "node scripts/fetch-node.mjs", - "bundle:helper": "node scripts/bundle-helper.mjs", - "bundle": "npm run bundle:node && npm run bundle:helper", - "test": "vitest run --passWithNoTests", - "typecheck": "tsc --noEmit" - }, - "dependencies": { - "@tauri-apps/api": "^2.10.1", - "@tauri-apps/plugin-autostart": "^2.2.0", - "@tauri-apps/plugin-notification": "^2.2.1", - "@tauri-apps/plugin-shell": "^2.2.1", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "react-router-dom": "^7.4.0" - }, - "devDependencies": { - "@tauri-apps/cli": "^2.10.1", - "@types/node": "^22.13.10", - "@types/react": "^19.0.10", - "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react": "^4.3.4", - "esbuild": "^0.20.2", - "typescript": "^5.8.2", - "vite": "^6.2.2", - "vitest": "^3.0.7" - }, - "engines": { - "node": ">=22 <23" - } -} diff --git a/packages/dcp-desktop/public/vault.svg b/packages/dcp-desktop/public/vault.svg deleted file mode 100644 index 6fa52a7..0000000 --- a/packages/dcp-desktop/public/vault.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packages/dcp-desktop/scripts/bundle-helper.mjs b/packages/dcp-desktop/scripts/bundle-helper.mjs deleted file mode 100644 index c2000b8..0000000 --- a/packages/dcp-desktop/scripts/bundle-helper.mjs +++ /dev/null @@ -1,523 +0,0 @@ -#!/usr/bin/env node -/** - * Bundle the DCP desktop helper and server with all JS dependencies. - * Native addons are kept external and copied separately so their .node - * binaries continue to work inside the packaged app. - */ - -import { build } from 'esbuild'; -import { execFileSync } from 'child_process'; -import { readFileSync, writeFileSync, mkdirSync, existsSync, cpSync, rmSync, readdirSync } from 'fs'; -import { dirname, join, relative } from 'path'; -import { createRequire } from 'module'; -import { fileURLToPath } from 'url'; - -const __dirname = dirname(fileURLToPath(import.meta.url)); -const require = createRequire(import.meta.url); -const outDir = join(__dirname, '..', 'src-tauri', 'resources'); -const helperOutFile = join(outDir, 'dcp-helper-bundle.cjs'); -const serverOutFile = join(outDir, 'dcp-vault-bundle.cjs'); -const nodeModulesOut = join(outDir, 'node_modules'); -const serverRuntimeDir = join(outDir, 'dcp-vault-runtime'); -const serverRuntimeAppDir = join(serverRuntimeDir, 'app'); -const serverRuntimeNodeModulesDir = join(serverRuntimeDir, 'node_modules'); -const monorepoRoot = join(__dirname, '..', '..', '..'); -const monorepoNodeModules = join(monorepoRoot, 'node_modules'); -const serverEntry = join(monorepoRoot, 'packages', 'dcp-vault', 'dist', 'index.js'); -const serverPackageDir = join(monorepoRoot, 'packages', 'dcp-vault'); -const workspacePackages = { - '@dcprotocol/core': join(monorepoRoot, 'packages', 'dcp-core', 'dist', 'index.js'), - '@dcprotocol/client': join(monorepoRoot, 'packages', 'dcp-client', 'dist', 'index.js'), - '@dcprotocol/relay': join(monorepoRoot, 'packages', 'dcp-relay', 'dist', 'index.js'), - '@dcprotocol/relay-client': join(monorepoRoot, 'packages', 'dcp-relay-client', 'dist', 'index.js'), -}; - -const workspacePackagePlugin = { - name: 'dcp-workspace-packages', - setup(build) { - build.onResolve({ filter: /^@dcprotocol\/(core|client|relay|relay-client)$/ }, (args) => ({ - path: workspacePackages[args.path], - })); - }, -}; - -// Native modules that can't be bundled - need their .node binaries -const NATIVE_MODULES = [ - 'better-sqlite3', - 'sodium-native', - 'keytar', - // Transitive native deps - 'node-gyp-build', - 'require-addon', // Required by sodium-native to load .node binaries -]; - -// Native modules that must stay external. -const EXTERNAL_MODULES = [ - ...NATIVE_MODULES, - 'bindings', - 'file-uri-to-path', - // @hpke packages have UMD builds that require at runtime - '@hpke/common', - '@hpke/core', - '@hpke/chacha20poly1305', - '@hpke/dhkem-x25519', - // Pino logger transport - 'pino-pretty', -]; - -// Root runtime modules for the helper bundle. Their full dependency closure -// must be copied into resources/node_modules because the packaged app no longer -// resolves against the monorepo's node_modules. -const HELPER_RUNTIME_ROOTS = [...EXTERNAL_MODULES]; - -// The helper source code -const helperSource = ` -const { - VaultStorage, - generateRecoveryMnemonic, - deriveKeyFromMnemonic, - zeroize, - createWallet, - exportWalletPrivateKey, - isChainSupported, -} = require('@dcprotocol/core'); - -function readStdin() { - return new Promise((resolve, reject) => { - let data = ''; - process.stdin.setEncoding('utf8'); - process.stdin.on('data', chunk => (data += chunk)); - process.stdin.on('end', () => resolve(data)); - process.stdin.on('error', reject); - }); -} - -function reply(obj) { - process.stdout.write(JSON.stringify(obj)); -} - -function fail(message) { - reply({ ok: false, error: message }); - process.exit(1); -} - -async function main() { - const raw = await readStdin(); - if (!raw) fail('No input provided'); - - let input; - try { - input = JSON.parse(raw); - } catch { - fail('Invalid JSON input'); - } - - const action = input.action; - const passphrase = input.passphrase || ''; - const chains = Array.isArray(input.chains) ? input.chains : []; - const vaultDir = input.vault_dir || process.env.VAULT_DIR; - - if (!action) fail('Missing action'); - - if (action === 'init') { - if (passphrase.length < 8) fail('Passphrase must be at least 8 characters'); - const storage = new VaultStorage(vaultDir); - if (await storage.isProvisioned()) fail('Vault already initialized'); - - const recoveryPhrase = generateRecoveryMnemonic(); - const masterKey = deriveKeyFromMnemonic(recoveryPhrase); - try { - storage.initializeSchema(); - await storage.storeMasterKeyWithPassphrase(masterKey, passphrase); - } catch (err) { - fail(err?.message || 'Failed to initialize vault'); - } finally { - zeroize(masterKey); - } - - reply({ ok: true, recovery_phrase: recoveryPhrase.split(' ') }); - process.exit(0); - } - - if (action === 'create_wallets') { - if (passphrase.length < 8) fail('Passphrase must be at least 8 characters'); - const storage = new VaultStorage(vaultDir); - if (!(await storage.isProvisioned())) fail('Vault not initialized'); - - try { - await storage.unlock(passphrase); - } catch (err) { - fail(err?.message || 'Failed to unlock vault'); - } - - const wallets = []; - try { - for (const chainRaw of chains) { - const chain = String(chainRaw).toLowerCase(); - if (!isChainSupported(chain)) fail(\`Unsupported chain: \${chain}\`); - const scope = \`crypto.wallet.\${chain}\`; - const existing = storage.getRecord(scope); - if (existing?.public_address) { - wallets.push({ chain, address: existing.public_address }); - continue; - } - const masterKey = storage.getMasterKey(); - const { encrypted, info } = createWallet(chain, masterKey); - storage.createRecord({ - scope, - item_type: 'WALLET_KEY', - sensitivity: 'critical', - data: encrypted, - chain, - public_address: info.public_address, - }); - wallets.push({ chain, address: info.public_address }); - } - } catch (err) { - fail(err?.message || 'Failed to create wallets'); - } finally { - storage.lock(); - } - - reply({ ok: true, wallets }); - process.exit(0); - } - - if (action === 'export_wallet_private_key') { - if (passphrase.length < 8) fail('Passphrase must be at least 8 characters'); - if (input.confirmation !== 'EXPORT') fail('Type EXPORT to confirm'); - - const chain = String(input.chain || 'solana').toLowerCase(); - if (!isChainSupported(chain)) fail(\`Unsupported chain: \${chain}\`); - - const storage = new VaultStorage(vaultDir); - if (!(await storage.isProvisioned())) fail('Vault not initialized'); - - try { - await storage.unlock(passphrase); - } catch (err) { - fail(err?.message || 'Failed to unlock vault'); - } - - try { - const scope = \`crypto.wallet.\${chain}\`; - const record = storage.getRecord(scope); - const encrypted = storage.getEncryptedPayload(scope); - if (!record || !encrypted || record.item_type !== 'WALLET_KEY') { - fail(\`No \${chain} wallet found\`); - } - - const masterKey = storage.getMasterKey(); - const privateKey = exportWalletPrivateKey(encrypted, masterKey, chain); - storage.logAudit('EXECUTE', 'success', { - agentName: 'desktop-owner', - scope, - operation: 'wallet_export', - details: JSON.stringify({ chain, address: record.public_address }), - }); - reply({ - ok: true, - chain, - address: record.public_address, - private_key: privateKey, - }); - process.exit(0); - } catch (err) { - fail(err?.message || 'Failed to export wallet'); - } finally { - storage.lock(); - } - } - - if (action === 'replace_wallet') { - if (passphrase.length < 8) fail('Passphrase must be at least 8 characters'); - if (input.confirmation !== 'REPLACE') fail('Type REPLACE to confirm'); - - const chain = String(input.chain || 'solana').toLowerCase(); - if (!isChainSupported(chain)) fail(\`Unsupported chain: \${chain}\`); - - const storage = new VaultStorage(vaultDir); - if (!(await storage.isProvisioned())) fail('Vault not initialized'); - - try { - await storage.unlock(passphrase); - } catch (err) { - fail(err?.message || 'Failed to unlock vault'); - } - - try { - const scope = \`crypto.wallet.\${chain}\`; - const existing = storage.getRecord(scope); - if (existing && existing.item_type !== 'WALLET_KEY') { - fail(\`Existing \${scope} record is not a wallet\`); - } - const oldAddress = existing?.public_address || null; - const masterKey = storage.getMasterKey(); - const { encrypted, info } = createWallet(chain, masterKey); - - if (existing) { - storage.updateWalletRecord(existing.id, encrypted, chain, info.public_address); - } else { - storage.createRecord({ - scope, - item_type: 'WALLET_KEY', - sensitivity: 'critical', - data: encrypted, - chain, - public_address: info.public_address, - }); - } - - storage.logAudit('CONFIG', 'success', { - agentName: 'desktop-owner', - scope, - operation: 'wallet_replace', - details: JSON.stringify({ chain, old_address: oldAddress, new_address: info.public_address }), - }); - reply({ - ok: true, - chain, - old_address: oldAddress, - new_address: info.public_address, - }); - process.exit(0); - } catch (err) { - fail(err?.message || 'Failed to replace wallet'); - } finally { - storage.lock(); - } - } - - fail(\`Unknown action: \${action}\`); -} - -main().catch(err => fail(err?.message || 'Unexpected error')); -`; - -// Write temp source file -const tempSource = join(__dirname, '.helper-temp.js'); -writeFileSync(tempSource, helperSource); - -// Ensure output directory exists -if (!existsSync(outDir)) { - mkdirSync(outDir, { recursive: true }); -} - -function listServerRuntimePaths() { - let stdout = ''; - try { - stdout = execFileSync( - 'npm', - ['ls', '--omit=dev', '--all', '--parseable', '-w', '@dcprotocol/vault'], - { cwd: monorepoRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] } - ); - } catch (err) { - stdout = String(err.stdout || ''); - } - - return stdout - .split('\n') - .map((line) => line.trim()) - .filter((line) => line.startsWith(monorepoRoot) && line !== monorepoRoot); -} - -function destinationForRuntimePath(srcPath) { - if (srcPath === serverPackageDir) { - return serverRuntimeAppDir; - } - - if (srcPath.startsWith(`${monorepoNodeModules}/`)) { - return join(serverRuntimeDir, relative(monorepoRoot, srcPath)); - } - - const packageJsonPath = join(srcPath, 'package.json'); - if (!existsSync(packageJsonPath)) { - return null; - } - - const packageName = JSON.parse(readFileSync(packageJsonPath, 'utf8')).name; - if (!packageName) { - return null; - } - - return join(serverRuntimeNodeModulesDir, ...packageName.split('/')); -} - -function stageServerRuntime() { - if (existsSync(serverRuntimeDir)) { - rmSync(serverRuntimeDir, { recursive: true }); - } - - mkdirSync(serverRuntimeDir, { recursive: true }); - mkdirSync(serverRuntimeNodeModulesDir, { recursive: true }); - - const copied = new Set(); - for (const srcPath of listServerRuntimePaths()) { - const destPath = destinationForRuntimePath(srcPath); - if (!destPath || copied.has(destPath)) { - continue; - } - - mkdirSync(dirname(destPath), { recursive: true }); - cpSync(srcPath, destPath, { recursive: true, dereference: true }); - copied.add(destPath); - } - - console.log(`[bundle-helper] Server runtime staged in ${serverRuntimeDir}`); -} - -function resolvePackageDir(name) { - let entry; - try { - entry = require.resolve(name, { - paths: [ - monorepoRoot, - monorepoNodeModules, - serverPackageDir, - join(monorepoRoot, 'packages', 'dcp-core'), - join(monorepoRoot, 'packages', 'dcp-client'), - join(monorepoRoot, 'packages', 'dcp-relay'), - join(monorepoRoot, 'packages', 'dcp-relay-client'), - ], - }); - } catch { - // Fallback: search in pnpm's .pnpm directory structure - const pnpmDir = join(monorepoNodeModules, '.pnpm'); - if (existsSync(pnpmDir)) { - try { - const entries = readdirSync(pnpmDir); - for (const entry of entries) { - if (entry.startsWith(`${name}@`) || entry.startsWith(`${name.replace('/', '+')}@`)) { - const candidatePath = join(pnpmDir, entry, 'node_modules', name); - if (existsSync(candidatePath)) { - return candidatePath; - } - } - } - } catch { - // ignore - } - } - return null; - } - let cursor = dirname(entry); - - while (cursor !== dirname(cursor)) { - const packageJsonPath = join(cursor, 'package.json'); - if (existsSync(packageJsonPath)) { - const pkg = JSON.parse(readFileSync(packageJsonPath, 'utf8')); - if (pkg.name === name) { - return cursor; - } - } - cursor = dirname(cursor); - } - - return null; -} - -function collectRuntimeDependencyClosure(rootModules) { - const queue = [...rootModules]; - const seen = new Set(); - const ordered = []; - - while (queue.length > 0) { - const name = queue.shift(); - if (!name || seen.has(name)) { - continue; - } - - const packageDir = resolvePackageDir(name); - if (!packageDir) { - console.warn(`[bundle-helper] WARNING: Runtime dependency not found: ${name}`); - continue; - } - - seen.add(name); - ordered.push({ name, packageDir }); - - const packageJson = JSON.parse(readFileSync(join(packageDir, 'package.json'), 'utf8')); - const runtimeDeps = { - ...(packageJson.dependencies || {}), - ...(packageJson.optionalDependencies || {}), - }; - - for (const depName of Object.keys(runtimeDeps)) { - if (!seen.has(depName)) { - queue.push(depName); - } - } - } - - return ordered; -} - -console.log('[bundle-helper] Bundling DCP helper with @dcprotocol/core...'); -console.log('[bundle-helper] Native modules will be copied separately:', NATIVE_MODULES.join(', ')); - -try { - // Step 1: Bundle the helper, keeping native modules external - await build({ - entryPoints: [tempSource], - bundle: true, - platform: 'node', - target: 'node18', - format: 'cjs', - outfile: helperOutFile, - minify: false, - external: EXTERNAL_MODULES, - mainFields: ['module', 'main'], - nodePaths: [monorepoNodeModules], - plugins: [workspacePackagePlugin], - }); - - console.log(`[bundle-helper] Helper bundle created: ${helperOutFile}`); - - if (!existsSync(serverEntry)) { - throw new Error(`Server bundle input not found: ${serverEntry}. Run npm -w @dcprotocol/vault run build first.`); - } - - await build({ - entryPoints: [serverEntry], - bundle: true, - platform: 'node', - target: 'node18', - format: 'cjs', - outfile: serverOutFile, - minify: false, - external: EXTERNAL_MODULES, - mainFields: ['module', 'main'], - nodePaths: [monorepoNodeModules], - plugins: [workspacePackagePlugin], - }); - - console.log(`[bundle-helper] Server bundle created: ${serverOutFile}`); - - // Step 2: Copy the full helper runtime dependency tree to resources/node_modules. - // The onboarding helper uses native modules (sodium-native, better-sqlite3, - // keytar) plus their transitive JS dependencies. Missing any of those causes - // packaged desktop startup/create-vault flows to fail at runtime. - if (existsSync(nodeModulesOut)) { - rmSync(nodeModulesOut, { recursive: true }); - } - mkdirSync(nodeModulesOut, { recursive: true }); - - for (const { name, packageDir } of collectRuntimeDependencyClosure(HELPER_RUNTIME_ROOTS)) { - const destPath = join(nodeModulesOut, ...name.split('/')); - console.log(`[bundle-helper] Copying helper runtime module: ${name}`); - mkdirSync(dirname(destPath), { recursive: true }); - cpSync(packageDir, destPath, { recursive: true, dereference: true }); - } - - // Step 3: Stage an exact runtime copy of the server dependency tree. - stageServerRuntime(); - - console.log(`[bundle-helper] SUCCESS: Bundle and native modules ready in ${outDir}`); - - // Clean up temp file - const { unlinkSync } = await import('fs'); - unlinkSync(tempSource); -} catch (err) { - console.error('[bundle-helper] FAILED:', err.message); - process.exit(1); -} diff --git a/packages/dcp-desktop/scripts/fetch-node.mjs b/packages/dcp-desktop/scripts/fetch-node.mjs deleted file mode 100644 index dfc755a..0000000 --- a/packages/dcp-desktop/scripts/fetch-node.mjs +++ /dev/null @@ -1,97 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import os from 'node:os'; -import https from 'node:https'; -import { pipeline } from 'node:stream/promises'; -import { spawnSync } from 'node:child_process'; - -const VERSION = process.env.DCP_NODE_VERSION || '22.22.2'; -const platform = process.platform; -const arch = process.arch; - -const isWin = platform === 'win32'; -const ext = isWin ? 'zip' : 'tar.gz'; - -function mapPlatform(p) { - if (p === 'darwin') return 'darwin'; - if (p === 'linux') return 'linux'; - if (p === 'win32') return 'win'; - throw new Error(`Unsupported platform: ${p}`); -} - -function mapArch(a) { - if (a === 'arm64') return 'arm64'; - if (a === 'x64') return 'x64'; - throw new Error(`Unsupported architecture: ${a}`); -} - -const plat = mapPlatform(platform); -const archId = mapArch(arch); -const filename = `node-v${VERSION}-${plat}-${archId}.${ext}`; -const url = `https://nodejs.org/dist/v${VERSION}/${filename}`; - -const root = path.resolve(process.cwd()); -const binDir = path.join(root, 'src-tauri', 'bin'); -const outPath = path.join(binDir, isWin ? 'node.exe' : 'node'); - -if (fs.existsSync(outPath)) { - const existing = spawnSync(outPath, ['-v'], { encoding: 'utf8' }); - const existingVersion = existing.stdout.trim().replace(/^v/, ''); - if (existing.status === 0 && existingVersion === VERSION) { - console.log(`[bundle:node] Node ${VERSION} already present at ${outPath}`); - process.exit(0); - } - console.log(`[bundle:node] Replacing Node ${existingVersion || 'unknown'} with ${VERSION}`); -} - -fs.mkdirSync(binDir, { recursive: true }); - -const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'dcp-node-')); -const archivePath = path.join(tmpDir, filename); - -console.log(`[bundle:node] Downloading ${url}`); -await new Promise((resolve, reject) => { - https.get(url, (res) => { - if (res.statusCode !== 200) { - reject(new Error(`Download failed: ${res.statusCode}`)); - return; - } - const file = fs.createWriteStream(archivePath); - pipeline(res, file).then(resolve, reject); - }).on('error', reject); -}); - -console.log('[bundle:node] Extracting...'); -if (ext === 'tar.gz') { - const tar = spawnSync('tar', ['-xzf', archivePath, '-C', tmpDir]); - if (tar.status !== 0) { - throw new Error(`tar failed: ${tar.stderr?.toString() || 'unknown error'}`); - } -} else { - // Use PowerShell's Expand-Archive on Windows (no unzip available by default) - const ps = spawnSync('powershell', [ - '-NoProfile', - '-Command', - `Expand-Archive -Path '${archivePath}' -DestinationPath '${tmpDir}' -Force` - ]); - if (ps.status !== 0) { - throw new Error(`PowerShell Expand-Archive failed: ${ps.stderr?.toString() || 'unknown error'}`); - } -} - -const extractedDir = path.join(tmpDir, `node-v${VERSION}-${plat}-${archId}`); -// Windows puts node.exe in root, Unix puts it in bin/ -const nodePath = isWin - ? path.join(extractedDir, 'node.exe') - : path.join(extractedDir, 'bin', 'node'); - -if (!fs.existsSync(nodePath)) { - throw new Error(`Node binary not found after extraction: ${nodePath}`); -} - -fs.copyFileSync(nodePath, outPath); -if (!isWin) { - fs.chmodSync(outPath, 0o755); -} - -console.log(`[bundle:node] Node bundled at ${outPath}`); diff --git a/packages/dcp-desktop/src-tauri/Cargo.lock b/packages/dcp-desktop/src-tauri/Cargo.lock deleted file mode 100644 index e566085..0000000 --- a/packages/dcp-desktop/src-tauri/Cargo.lock +++ /dev/null @@ -1,5957 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "aho-corasick" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" -dependencies = [ - "memchr", -] - -[[package]] -name = "alloc-no-stdlib" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" - -[[package]] -name = "alloc-stdlib" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" -dependencies = [ - "alloc-no-stdlib", -] - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - -[[package]] -name = "async-broadcast" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" -dependencies = [ - "event-listener", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-channel" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "pin-project-lite", - "slab", -] - -[[package]] -name = "async-io" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" -dependencies = [ - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-lock" -version = "3.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" -dependencies = [ - "event-listener", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" -dependencies = [ - "async-channel", - "async-io", - "async-lock", - "async-signal", - "async-task", - "blocking", - "cfg-if", - "event-listener", - "futures-lite", - "rustix", -] - -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "async-signal" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485" -dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix", - "signal-hook-registry", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - -[[package]] -name = "async-trait" -version = "0.1.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "atk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241b621213072e993be4f6f3a9e4b45f65b7e6faad43001be957184b7bb1824b" -dependencies = [ - "atk-sys", - "glib", - "libc", -] - -[[package]] -name = "atk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e48b684b0ca77d2bbadeef17424c2ea3c897d44d566a1617e7e8f30614d086" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "auto-launch" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f012b8cc0c850f34117ec8252a44418f2e34a2cf501de89e29b241ae5f79471" -dependencies = [ - "dirs 4.0.0", - "thiserror 1.0.69", - "winreg 0.10.1", -] - -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" - -[[package]] -name = "bit-set" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" -dependencies = [ - "serde_core", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" -dependencies = [ - "objc2", -] - -[[package]] -name = "blocking" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" -dependencies = [ - "async-channel", - "async-task", - "futures-io", - "futures-lite", - "piper", -] - -[[package]] -name = "brotli" -version = "8.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd8b9603c7aa97359dbd97ecf258968c95f3adddd6db2f7e7a5bef101c84560" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", - "brotli-decompressor", -] - -[[package]] -name = "brotli-decompressor" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03" -dependencies = [ - "alloc-no-stdlib", - "alloc-stdlib", -] - -[[package]] -name = "bumpalo" -version = "3.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" - -[[package]] -name = "bytemuck" -version = "1.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" -dependencies = [ - "serde", -] - -[[package]] -name = "cairo-rs" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" -dependencies = [ - "bitflags 2.11.1", - "cairo-sys-rs", - "glib", - "libc", - "once_cell", - "thiserror 1.0.69", -] - -[[package]] -name = "cairo-sys-rs" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "camino" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629a66d692cb9ff1a1c664e41771b3dcaf961985a9774c0eb0bd1b51cf60a48" -dependencies = [ - "serde_core", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror 2.0.18", -] - -[[package]] -name = "cargo_toml" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" -dependencies = [ - "serde", - "toml 0.9.12+spec-1.1.0", -] - -[[package]] -name = "cc" -version = "1.2.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" -dependencies = [ - "find-msvc-tools", - "shlex", -] - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cfb" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" -dependencies = [ - "byteorder", - "fnv", - "uuid", -] - -[[package]] -name = "cfg-expr" -version = "0.15.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" -dependencies = [ - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "chrono" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" -dependencies = [ - "iana-time-zone", - "num-traits", - "serde", - "windows-link 0.2.1", -] - -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "cookie" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" -dependencies = [ - "time", - "version_check", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "core-graphics" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.10.1", - "core-graphics-types", - "foreign-types 0.5.0", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.10.1", - "libc", -] - -[[package]] -name = "cpufeatures" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crypto-common" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "cssparser" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" -dependencies = [ - "cssparser-macros", - "dtoa-short", - "itoa", - "phf 0.13.1", - "smallvec", -] - -[[package]] -name = "cssparser-macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" -dependencies = [ - "quote", - "syn 2.0.117", -] - -[[package]] -name = "ctor" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "352d39c2f7bef1d6ad73db6f5160efcaed66d94ef8c6c573a8410c00bf909a98" -dependencies = [ - "ctor-proc-macro", - "dtor", -] - -[[package]] -name = "ctor-proc-macro" -version = "0.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" - -[[package]] -name = "curve25519-dalek" -version = "4.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" -dependencies = [ - "cfg-if", - "cpufeatures", - "curve25519-dalek-derive", - "digest", - "fiat-crypto", - "rustc_version", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "darling" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" -dependencies = [ - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.117", -] - -[[package]] -name = "darling_macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "dbus" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b942602992bb7acfd1f51c49811c58a610ef9181b6e66f3e519d79b540a3bf73" -dependencies = [ - "libc", - "libdbus-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "dcp" -version = "0.1.0" -dependencies = [ - "base64 0.22.1", - "dirs 6.0.0", - "ed25519-dalek", - "keyring", - "rand 0.8.6", - "reqwest 0.12.28", - "serde", - "serde_json", - "tauri", - "tauri-build", - "tauri-plugin-autostart", - "tauri-plugin-notification", - "tauri-plugin-shell", - "tokio", - "uuid", -] - -[[package]] -name = "der" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" -dependencies = [ - "powerfmt", - "serde_core", -] - -[[package]] -name = "derive_more" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" -dependencies = [ - "proc-macro2", - "quote", - "rustc_version", - "syn 2.0.117", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys 0.3.7", -] - -[[package]] -name = "dirs" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" -dependencies = [ - "dirs-sys 0.5.0", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users 0.4.6", - "winapi", -] - -[[package]] -name = "dirs-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" -dependencies = [ - "libc", - "option-ext", - "redox_users 0.5.2", - "windows-sys 0.61.2", -] - -[[package]] -name = "dispatch2" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" -dependencies = [ - "bitflags 2.11.1", - "block2", - "libc", - "objc2", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "dlopen2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" -dependencies = [ - "dlopen2_derive", - "libc", - "once_cell", - "winapi", -] - -[[package]] -name = "dlopen2_derive" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbbb781877580993a8707ec48672673ec7b81eeba04cfd2310bd28c08e47c8f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "dom_query" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521e380c0c8afb8d9a1e83a1822ee03556fc3e3e7dbc1fd30be14e37f9cb3f89" -dependencies = [ - "bit-set", - "cssparser", - "foldhash 0.2.0", - "html5ever", - "precomputed-hash", - "selectors", - "tendril", -] - -[[package]] -name = "dpi" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76" -dependencies = [ - "serde", -] - -[[package]] -name = "dtoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" - -[[package]] -name = "dtoa-short" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" -dependencies = [ - "dtoa", -] - -[[package]] -name = "dtor" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1057d6c64987086ff8ed0fd3fbf377a6b7d205cc7715868cd401705f715cbe4" -dependencies = [ - "dtor-proc-macro", -] - -[[package]] -name = "dtor-proc-macro" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5" - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "dyn-clone" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" - -[[package]] -name = "ed25519" -version = "2.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" -dependencies = [ - "pkcs8", - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" -dependencies = [ - "curve25519-dalek", - "ed25519", - "rand_core 0.6.4", - "serde", - "sha2", - "subtle", - "zeroize", -] - -[[package]] -name = "embed-resource" -version = "3.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31a88c8d26de40ed18fe748c547845aa39de1db3afd958f8cb91579f3644bcb" -dependencies = [ - "cc", - "memchr", - "rustc_version", - "toml 1.1.2+spec-1.1.0", - "vswhom", - "winreg 0.55.0", -] - -[[package]] -name = "embed_plist" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" - -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "endi" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099" - -[[package]] -name = "enumflags2" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "erased-serde" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2add8a07dd6a8d93ff627029c51de145e12686fbc36ecb298ac22e74cf02dec" -dependencies = [ - "serde", - "serde_core", - "typeid", -] - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "event-listener" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" -dependencies = [ - "event-listener", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" - -[[package]] -name = "fdeflate" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "fiat-crypto" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" - -[[package]] -name = "field-offset" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" -dependencies = [ - "memoffset", - "rustc_version", -] - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "flate2" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared 0.1.1", -] - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared 0.3.1", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures-channel" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" - -[[package]] -name = "futures-executor" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" - -[[package]] -name = "futures-lite" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "futures-sink" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" - -[[package]] -name = "futures-task" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" - -[[package]] -name = "futures-util" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" -dependencies = [ - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "slab", -] - -[[package]] -name = "gdk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f245958c627ac99d8e529166f9823fb3b838d1d41fd2b297af3075093c2691" -dependencies = [ - "cairo-rs", - "gdk-pixbuf", - "gdk-sys", - "gio", - "glib", - "libc", - "pango", -] - -[[package]] -name = "gdk-pixbuf" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" -dependencies = [ - "gdk-pixbuf-sys", - "gio", - "glib", - "libc", - "once_cell", -] - -[[package]] -name = "gdk-pixbuf-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gdk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c2d13f38594ac1e66619e188c6d5a1adb98d11b2fcf7894fc416ad76aa2f3f7" -dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkwayland-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140071d506d223f7572b9f09b5e155afbd77428cd5cc7af8f2694c41d98dfe69" -dependencies = [ - "gdk-sys", - "glib-sys", - "gobject-sys", - "libc", - "pkg-config", - "system-deps", -] - -[[package]] -name = "gdkx11" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3caa00e14351bebbc8183b3c36690327eb77c49abc2268dd4bd36b856db3fbfe" -dependencies = [ - "gdk", - "gdkx11-sys", - "gio", - "glib", - "libc", - "x11", -] - -[[package]] -name = "gdkx11-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e7445fe01ac26f11601db260dd8608fe172514eb63b3b5e261ea6b0f4428d" -dependencies = [ - "gdk-sys", - "glib-sys", - "libc", - "system-deps", - "x11", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "libc", - "r-efi 5.3.0", - "wasip2", -] - -[[package]] -name = "getrandom" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" -dependencies = [ - "cfg-if", - "libc", - "r-efi 6.0.0", - "wasip2", - "wasip3", -] - -[[package]] -name = "gio" -version = "0.18.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fc8f532f87b79cbc51a79748f16a6828fb784be93145a322fa14d06d354c73" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-util", - "gio-sys", - "glib", - "libc", - "once_cell", - "pin-project-lite", - "smallvec", - "thiserror 1.0.69", -] - -[[package]] -name = "gio-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", - "winapi", -] - -[[package]] -name = "glib" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233daaf6e83ae6a12a52055f568f9d7cf4671dabb78ff9560ab6da230ce00ee5" -dependencies = [ - "bitflags 2.11.1", - "futures-channel", - "futures-core", - "futures-executor", - "futures-task", - "futures-util", - "gio-sys", - "glib-macros", - "glib-sys", - "gobject-sys", - "libc", - "memchr", - "once_cell", - "smallvec", - "thiserror 1.0.69", -] - -[[package]] -name = "glib-macros" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb0228f477c0900c880fd78c8759b95c7636dbd7842707f49e132378aa2acdc" -dependencies = [ - "heck 0.4.1", - "proc-macro-crate 2.0.2", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "glib-sys" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" -dependencies = [ - "libc", - "system-deps", -] - -[[package]] -name = "glob" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" - -[[package]] -name = "gobject-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" -dependencies = [ - "glib-sys", - "libc", - "system-deps", -] - -[[package]] -name = "gtk" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56fb197bfc42bd5d2751f4f017d44ff59fbb58140c6b49f9b3b2bdab08506a" -dependencies = [ - "atk", - "cairo-rs", - "field-offset", - "futures-channel", - "gdk", - "gdk-pixbuf", - "gio", - "glib", - "gtk-sys", - "gtk3-macros", - "libc", - "pango", - "pkg-config", -] - -[[package]] -name = "gtk-sys" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f29a1c21c59553eb7dd40e918be54dccd60c52b049b75119d5d96ce6b624414" -dependencies = [ - "atk-sys", - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "pango-sys", - "system-deps", -] - -[[package]] -name = "gtk3-macros" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ff3c5b21f14f0736fed6dcfc0bfb4225ebf5725f3c0209edeec181e4d73e9d" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "h2" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap 2.14.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash 0.1.5", -] - -[[package]] -name = "hashbrown" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "html5ever" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2" -dependencies = [ - "log", - "markup5ever", -] - -[[package]] -name = "http" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "hyper" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" -dependencies = [ - "http", - "hyper", - "hyper-util", - "rustls", - "tokio", - "tokio-rustls", - "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "ipnet", - "libc", - "percent-encoding", - "pin-project-lite", - "socket2", - "system-configuration", - "tokio", - "tower-service", - "tracing", - "windows-registry", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core 0.62.2", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ico" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" -dependencies = [ - "byteorder", - "png 0.17.16", -] - -[[package]] -name = "icu_collections" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" -dependencies = [ - "displaydoc", - "potential_utf", - "utf8_iter", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" -dependencies = [ - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" - -[[package]] -name = "icu_properties" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" -dependencies = [ - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" - -[[package]] -name = "icu_provider" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" -dependencies = [ - "displaydoc", - "icu_locale_core", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" -dependencies = [ - "equivalent", - "hashbrown 0.17.0", - "serde", - "serde_core", -] - -[[package]] -name = "infer" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a588916bfdfd92e71cacef98a63d9b1f0d74d6599980d11894290e7ddefffcf7" -dependencies = [ - "cfb", -] - -[[package]] -name = "ipnet" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" - -[[package]] -name = "iri-string" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "is-docker" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" -dependencies = [ - "once_cell", -] - -[[package]] -name = "is-wsl" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" -dependencies = [ - "is-docker", - "once_cell", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - -[[package]] -name = "javascriptcore-rs" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5671e9ffce8ffba57afc24070e906da7fc4b1ba66f2cabebf61bf2ea257fcc" -dependencies = [ - "bitflags 1.3.2", - "glib", - "javascriptcore-rs-sys", -] - -[[package]] -name = "javascriptcore-rs-sys" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1be78d14ffa4b75b66df31840478fef72b51f8c2465d4ca7c194da9f7a5124" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys 0.3.1", - "log", - "thiserror 1.0.69", - "walkdir", - "windows-sys 0.45.0", -] - -[[package]] -name = "jni-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" -dependencies = [ - "jni-sys 0.4.1", -] - -[[package]] -name = "jni-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" -dependencies = [ - "jni-sys-macros", -] - -[[package]] -name = "jni-sys-macros" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" -dependencies = [ - "quote", - "syn 2.0.117", -] - -[[package]] -name = "js-sys" -version = "0.3.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf" -dependencies = [ - "cfg-if", - "futures-util", - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "json-patch" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863726d7afb6bc2590eeff7135d923545e5e964f004c2ccf8716c25e70a86f08" -dependencies = [ - "jsonptr", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "jsonptr" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dea2b27dd239b2556ed7a25ba842fe47fd602e7fc7433c2a8d6106d4d9edd70" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "keyboard-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" -dependencies = [ - "bitflags 2.11.1", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "keyring" -version = "3.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebcc3aff044e5944a8fbaf69eb277d11986064cba30c468730e8b9909fb551c" -dependencies = [ - "log", - "zeroize", -] - -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - -[[package]] -name = "libappindicator" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" -dependencies = [ - "glib", - "gtk", - "gtk-sys", - "libappindicator-sys", - "log", -] - -[[package]] -name = "libappindicator-sys" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9ec52138abedcc58dc17a7c6c0c00a2bdb4f3427c7f63fa97fd0d859155caf" -dependencies = [ - "gtk-sys", - "libloading", - "once_cell", -] - -[[package]] -name = "libc" -version = "0.2.186" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" - -[[package]] -name = "libdbus-sys" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328c4789d42200f1eeec05bd86c9c13c7f091d2ba9a6ea35acdf51f31bc0f043" -dependencies = [ - "pkg-config", -] - -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "libredox" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" -dependencies = [ - "libc", -] - -[[package]] -name = "linux-raw-sys" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" - -[[package]] -name = "litemap" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" - -[[package]] -name = "lock_api" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" - -[[package]] -name = "mac-notification-sys" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a16783dd1a47849b8c8133c9cd3eb2112cfbc6901670af3dba47c8bbfb07d3" -dependencies = [ - "cc", - "objc2", - "objc2-foundation", - "time", -] - -[[package]] -name = "markup5ever" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862" -dependencies = [ - "log", - "tendril", - "web_atoms", -] - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - -[[package]] -name = "muda" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae8844f63b5b118e334e205585b8c5c17b984121dbdb179d44aeb087ffad3cb" -dependencies = [ - "crossbeam-channel", - "dpi", - "gtk", - "keyboard-types", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", - "once_cell", - "png 0.18.1", - "serde", - "thiserror 2.0.18", - "windows-sys 0.61.2", -] - -[[package]] -name = "native-tls" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "ndk" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4" -dependencies = [ - "bitflags 2.11.1", - "jni-sys 0.3.1", - "log", - "ndk-sys", - "num_enum", - "raw-window-handle", - "thiserror 1.0.69", -] - -[[package]] -name = "ndk-sys" -version = "0.6.0+11769913" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873" -dependencies = [ - "jni-sys 0.3.1", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "notify-rust" -version = "4.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdaf6120b9df005d37e58f6b75329be6255450453fbeba9ce4192324f921fb9" -dependencies = [ - "futures-lite", - "log", - "mac-notification-sys", - "serde", - "tauri-winrt-notification", - "zbus", -] - -[[package]] -name = "num-conv" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" -dependencies = [ - "num_enum_derive", - "rustversion", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" -dependencies = [ - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "objc2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" -dependencies = [ - "objc2-encode", - "objc2-exception-helper", -] - -[[package]] -name = "objc2-app-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c" -dependencies = [ - "bitflags 2.11.1", - "block2", - "objc2", - "objc2-core-foundation", - "objc2-foundation", -] - -[[package]] -name = "objc2-cloud-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ad74d880bb43877038da939b7427bba67e9dd42004a18b809ba7d87cee241c" -dependencies = [ - "bitflags 2.11.1", - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-data" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b402a653efbb5e82ce4df10683b6b28027616a2715e90009947d50b8dd298fa" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" -dependencies = [ - "bitflags 2.11.1", - "dispatch2", - "objc2", -] - -[[package]] -name = "objc2-core-graphics" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" -dependencies = [ - "bitflags 2.11.1", - "dispatch2", - "objc2", - "objc2-core-foundation", - "objc2-io-surface", -] - -[[package]] -name = "objc2-core-image" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d563b38d2b97209f8e861173de434bd0214cf020e3423a52624cd1d989f006" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-location" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca347214e24bc973fc025fd0d36ebb179ff30536ed1f80252706db19ee452009" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-text" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde0dfb48d25d2b4862161a4d5fcc0e3c24367869ad306b0c9ec0073bfed92d" -dependencies = [ - "bitflags 2.11.1", - "objc2", - "objc2-core-foundation", - "objc2-core-graphics", -] - -[[package]] -name = "objc2-encode" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" - -[[package]] -name = "objc2-exception-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7a1c5fbb72d7735b076bb47b578523aedc40f3c439bea6dfd595c089d79d98a" -dependencies = [ - "cc", -] - -[[package]] -name = "objc2-foundation" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" -dependencies = [ - "bitflags 2.11.1", - "block2", - "libc", - "objc2", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-io-surface" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d" -dependencies = [ - "bitflags 2.11.1", - "objc2", - "objc2-core-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f" -dependencies = [ - "bitflags 2.11.1", - "objc2", - "objc2-core-foundation", - "objc2-foundation", -] - -[[package]] -name = "objc2-ui-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87d638e33c06f577498cbcc50491496a3ed4246998a7fbba7ccb98b1e7eab22" -dependencies = [ - "bitflags 2.11.1", - "block2", - "objc2", - "objc2-cloud-kit", - "objc2-core-data", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-core-image", - "objc2-core-location", - "objc2-core-text", - "objc2-foundation", - "objc2-quartz-core", - "objc2-user-notifications", -] - -[[package]] -name = "objc2-user-notifications" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df9128cbbfef73cda168416ccf7f837b62737d748333bfe9ab71c245d76613e" -dependencies = [ - "objc2", - "objc2-foundation", -] - -[[package]] -name = "objc2-web-kit" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e5aaab980c433cf470df9d7af96a7b46a9d892d521a2cbbb2f8a4c16751e7f" -dependencies = [ - "bitflags 2.11.1", - "block2", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", -] - -[[package]] -name = "once_cell" -version = "1.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" - -[[package]] -name = "open" -version = "5.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3bab717c29a857abf75fcef718d441ec7cb2725f937343c734740a985d37fd" -dependencies = [ - "dunce", - "is-wsl", - "libc", - "pathdiff", -] - -[[package]] -name = "openssl" -version = "0.10.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38c4372413cdaaf3cc79dd92d29d7d9f5ab09b51b10dded508fb90bb70b9222" -dependencies = [ - "bitflags 2.11.1", - "cfg-if", - "foreign-types 0.3.2", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - -[[package]] -name = "openssl-sys" -version = "0.9.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13ce1245cd07fcc4cfdb438f7507b0c7e4f3849a69fd84d52374c66d83741bb6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "ordered-stream" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" -dependencies = [ - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "os_pipe" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8fae84b431384b68627d0f9b3b1245fcf9f46f6c0e3dc902e9dce64edd1967" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "pango" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" -dependencies = [ - "gio", - "glib", - "libc", - "once_cell", - "pango-sys", -] - -[[package]] -name = "pango-sys" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" -dependencies = [ - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - -[[package]] -name = "parking_lot" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-link 0.2.1", -] - -[[package]] -name = "pathdiff" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_macros 0.11.3", - "phf_shared 0.11.3", -] - -[[package]] -name = "phf" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" -dependencies = [ - "phf_macros 0.13.1", - "phf_shared 0.13.1", - "serde", -] - -[[package]] -name = "phf_codegen" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" -dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared 0.11.3", - "rand 0.8.6", -] - -[[package]] -name = "phf_generator" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" -dependencies = [ - "fastrand", - "phf_shared 0.13.1", -] - -[[package]] -name = "phf_macros" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" -dependencies = [ - "phf_generator 0.11.3", - "phf_shared 0.11.3", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "phf_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" -dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - -[[package]] -name = "phf_shared" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" - -[[package]] -name = "piper" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" - -[[package]] -name = "plist" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092791278e026273c1b65bbdcfbba3a300f2994c896bd01ab01da613c29c46f1" -dependencies = [ - "base64 0.22.1", - "indexmap 2.14.0", - "quick-xml 0.39.2", - "serde", - "time", -] - -[[package]] -name = "png" -version = "0.17.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "png" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" -dependencies = [ - "bitflags 2.11.1", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "polling" -version = "3.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "potential_utf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" -dependencies = [ - "zerovec", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn 2.0.117", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" -dependencies = [ - "toml_datetime 0.6.3", - "toml_edit 0.20.2", -] - -[[package]] -name = "proc-macro-crate" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" -dependencies = [ - "toml_edit 0.25.11+spec-1.1.0", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quick-xml" -version = "0.37.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" -dependencies = [ - "memchr", -] - -[[package]] -name = "quick-xml" -version = "0.39.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958f21e8e7ceb5a1aa7fa87fab28e7c75976e0bfe7e23ff069e0a260f894067d" -dependencies = [ - "memchr", -] - -[[package]] -name = "quote" -version = "1.0.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - -[[package]] -name = "rand" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.17", -] - -[[package]] -name = "rand_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom 0.3.4", -] - -[[package]] -name = "raw-window-handle" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" - -[[package]] -name = "redox_syscall" -version = "0.5.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags 2.11.1", -] - -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 1.0.69", -] - -[[package]] -name = "redox_users" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac" -dependencies = [ - "getrandom 0.2.17", - "libredox", - "thiserror 2.0.18", -] - -[[package]] -name = "ref-cast" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" -dependencies = [ - "ref-cast-impl", -] - -[[package]] -name = "ref-cast-impl" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "regex" -version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" - -[[package]] -name = "reqwest" -version = "0.12.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" -dependencies = [ - "base64 0.22.1", - "bytes", - "encoding_rs", - "futures-core", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-tls", - "hyper-util", - "js-sys", - "log", - "mime", - "native-tls", - "percent-encoding", - "pin-project-lite", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-native-tls", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "reqwest" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e0021ea2c22aed41653bc7e1419abb2c97e038ff2c33d0e1309e49a97deec0" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "js-sys", - "log", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "sync_wrapper", - "tokio", - "tokio-util", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", -] - -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.17", - "libc", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustc-hash" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" -dependencies = [ - "bitflags 2.11.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "rustls" -version = "0.23.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" -dependencies = [ - "once_cell", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pki-types" -version = "1.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" -dependencies = [ - "zeroize", -] - -[[package]] -name = "rustls-webpki" -version = "0.103.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "schemars" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" -dependencies = [ - "dyn-clone", - "indexmap 1.9.3", - "schemars_derive", - "serde", - "serde_json", - "url", - "uuid", -] - -[[package]] -name = "schemars" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" -dependencies = [ - "dyn-clone", - "ref-cast", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.117", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "security-framework" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.10.1", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "selectors" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" -dependencies = [ - "bitflags 2.11.1", - "cssparser", - "derive_more", - "log", - "new_debug_unreachable", - "phf 0.13.1", - "phf_codegen", - "precomputed-hash", - "rustc-hash", - "servo_arc", - "smallvec", -] - -[[package]] -name = "semver" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" -dependencies = [ - "serde", - "serde_core", -] - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde-untagged" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9faf48a4a2d2693be24c6289dbe26552776eb7737074e6722891fadbe6c5058" -dependencies = [ - "erased-serde", - "serde", - "serde_core", - "typeid", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "serde_repr" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serde_spanned" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_spanned" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" -dependencies = [ - "serde_core", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd5414fad8e6907dbdd5bc441a50ae8d6e26151a03b1de04d89a5576de61d01f" -dependencies = [ - "base64 0.22.1", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.14.0", - "schemars 0.9.0", - "schemars 1.2.1", - "serde_core", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3db8978e608f1fe7357e211969fd9abdcae80bac1ba7a3369bb7eb6b404eb65" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "serialize-to-javascript" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" -dependencies = [ - "serde", - "serde_json", - "serialize-to-javascript-impl", -] - -[[package]] -name = "serialize-to-javascript-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "servo_arc" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" -dependencies = [ - "stable_deref_trait", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shared_child" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e362d9935bc50f019969e2f9ecd66786612daae13e8f277be7bfb66e8bed3f7" -dependencies = [ - "libc", - "sigchld", - "windows-sys 0.60.2", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "sigchld" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47106eded3c154e70176fc83df9737335c94ce22f821c32d17ed1db1f83badb1" -dependencies = [ - "libc", - "os_pipe", - "signal-hook", -] - -[[package]] -name = "signal-hook" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "rand_core 0.6.4", -] - -[[package]] -name = "simd-adler32" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" - -[[package]] -name = "siphasher" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e" - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "socket2" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "softbuffer" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3" -dependencies = [ - "bytemuck", - "js-sys", - "ndk", - "objc2", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation", - "objc2-quartz-core", - "raw-window-handle", - "redox_syscall", - "tracing", - "wasm-bindgen", - "web-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "soup3" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471f924a40f31251afc77450e781cb26d55c0b650842efafc9c6cbd2f7cc4f9f" -dependencies = [ - "futures-channel", - "gio", - "glib", - "libc", - "soup3-sys", -] - -[[package]] -name = "soup3-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebe8950a680a12f24f15ebe1bf70db7af98ad242d9db43596ad3108aab86c27" -dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", - "libc", - "system-deps", -] - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "string_cache" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared 0.13.1", - "precomputed-hash", -] - -[[package]] -name = "string_cache_codegen" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" -dependencies = [ - "phf_generator 0.13.1", - "phf_shared 0.13.1", - "proc-macro2", - "quote", -] - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "swift-rs" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057c98e2e852d51fdcfca832aac7b571f6b351ad159f9eda5db1655f8d0c4d7" -dependencies = [ - "base64 0.21.7", - "serde", - "serde_json", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.117" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "system-configuration" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" -dependencies = [ - "bitflags 2.11.1", - "core-foundation 0.9.4", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "system-deps" -version = "6.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" -dependencies = [ - "cfg-expr", - "heck 0.5.0", - "pkg-config", - "toml 0.8.2", - "version-compare", -] - -[[package]] -name = "tao" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cf65722394c2ac443e80120064987f8914ee1d4e4e36e63cdf10f2990f01159" -dependencies = [ - "bitflags 2.11.1", - "block2", - "core-foundation 0.10.1", - "core-graphics", - "crossbeam-channel", - "dbus", - "dispatch2", - "dlopen2", - "dpi", - "gdkwayland-sys", - "gdkx11-sys", - "gtk", - "jni", - "libc", - "log", - "ndk", - "ndk-sys", - "objc2", - "objc2-app-kit", - "objc2-foundation", - "objc2-ui-kit", - "once_cell", - "parking_lot", - "percent-encoding", - "raw-window-handle", - "tao-macros", - "unicode-segmentation", - "url", - "windows", - "windows-core 0.61.2", - "windows-version", - "x11-dl", -] - -[[package]] -name = "tao-macros" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - -[[package]] -name = "tauri" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d059f2527558d9dba6f186dec4772610e1aecfd3f94002397613e7e648752b66" -dependencies = [ - "anyhow", - "bytes", - "cookie", - "dirs 6.0.0", - "dunce", - "embed_plist", - "getrandom 0.3.4", - "glob", - "gtk", - "heck 0.5.0", - "http", - "jni", - "libc", - "log", - "mime", - "muda", - "objc2", - "objc2-app-kit", - "objc2-foundation", - "objc2-ui-kit", - "objc2-web-kit", - "percent-encoding", - "plist", - "raw-window-handle", - "reqwest 0.13.3", - "serde", - "serde_json", - "serde_repr", - "serialize-to-javascript", - "swift-rs", - "tauri-build", - "tauri-macros", - "tauri-runtime", - "tauri-runtime-wry", - "tauri-utils", - "thiserror 2.0.18", - "tokio", - "tray-icon", - "url", - "webkit2gtk", - "webview2-com", - "window-vibrancy", - "windows", -] - -[[package]] -name = "tauri-build" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be9aa8c59a894f76c29a002501c589de5eb4987a5913d62a6e0a47f320901988" -dependencies = [ - "anyhow", - "cargo_toml", - "dirs 6.0.0", - "glob", - "heck 0.5.0", - "json-patch", - "schemars 0.8.22", - "semver", - "serde", - "serde_json", - "tauri-utils", - "tauri-winres", - "walkdir", -] - -[[package]] -name = "tauri-codegen" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e4e8230d565106aa19dfbaa01a7ed01abf78047fe0577a83377224bd1bf20e" -dependencies = [ - "base64 0.22.1", - "brotli", - "ico", - "json-patch", - "plist", - "png 0.17.16", - "proc-macro2", - "quote", - "semver", - "serde", - "serde_json", - "sha2", - "syn 2.0.117", - "tauri-utils", - "thiserror 2.0.18", - "time", - "url", - "uuid", - "walkdir", -] - -[[package]] -name = "tauri-macros" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc8de2cddbbc33dbdf4c84f170121886595efdbcc9cb4b3d76342b79d082cedc" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", - "tauri-codegen", - "tauri-utils", -] - -[[package]] -name = "tauri-plugin" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8d5f58bfd0cdcfdbc0a68dc08b354eea2afc551b421de91b07b69e0dd769d57" -dependencies = [ - "anyhow", - "glob", - "plist", - "schemars 0.8.22", - "serde", - "serde_json", - "tauri-utils", - "walkdir", -] - -[[package]] -name = "tauri-plugin-autostart" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459383cebc193cdd03d1ba4acc40f2c408a7abce419d64bdcd2d745bc2886f70" -dependencies = [ - "auto-launch", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", -] - -[[package]] -name = "tauri-plugin-notification" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fc2c5ff41105bd1f7242d8201fdf3efd70749b82fa013a17f2126357d194cc" -dependencies = [ - "log", - "notify-rust", - "rand 0.9.4", - "serde", - "serde_json", - "serde_repr", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "time", - "url", -] - -[[package]] -name = "tauri-plugin-shell" -version = "2.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8457dbf9e2bab1edd8df22bb2c20857a59a9868e79cb3eac5ed639eec4d0c73b" -dependencies = [ - "encoding_rs", - "log", - "open", - "os_pipe", - "regex", - "schemars 0.8.22", - "serde", - "serde_json", - "shared_child", - "tauri", - "tauri-plugin", - "thiserror 2.0.18", - "tokio", -] - -[[package]] -name = "tauri-runtime" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e42bbcb76237351fbaa02f08d808c537dc12eb5a6eabbf3e517b50056334d95" -dependencies = [ - "cookie", - "dpi", - "gtk", - "http", - "jni", - "objc2", - "objc2-ui-kit", - "objc2-web-kit", - "raw-window-handle", - "serde", - "serde_json", - "tauri-utils", - "thiserror 2.0.18", - "url", - "webkit2gtk", - "webview2-com", - "windows", -] - -[[package]] -name = "tauri-runtime-wry" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cadb13dad0c681e1e0a2c49ae488f0e2906ded3d57e7a0017f4aaf46e387117" -dependencies = [ - "gtk", - "http", - "jni", - "log", - "objc2", - "objc2-app-kit", - "once_cell", - "percent-encoding", - "raw-window-handle", - "softbuffer", - "tao", - "tauri-runtime", - "tauri-utils", - "url", - "webkit2gtk", - "webview2-com", - "windows", - "wry", -] - -[[package]] -name = "tauri-utils" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f61d2bf7188fbcf2b0ed095b67a6bc498f713c939314bb19eb700118a573b7" -dependencies = [ - "anyhow", - "brotli", - "cargo_metadata", - "ctor", - "dom_query", - "dunce", - "glob", - "http", - "infer", - "json-patch", - "log", - "memchr", - "phf 0.11.3", - "plist", - "proc-macro2", - "quote", - "regex", - "schemars 0.8.22", - "semver", - "serde", - "serde-untagged", - "serde_json", - "serde_with", - "swift-rs", - "thiserror 2.0.18", - "toml 1.1.2+spec-1.1.0", - "url", - "urlpattern", - "uuid", - "walkdir", -] - -[[package]] -name = "tauri-winres" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc65d45c68858bfe420dd29e834b5d15dbecf8a07a8a16cf4d532c7b1f69d4b6" -dependencies = [ - "dunce", - "embed-resource", - "toml 1.1.2+spec-1.1.0", -] - -[[package]] -name = "tauri-winrt-notification" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1e66e07de489fe43a46678dd0b8df65e0c973909df1b60ba33874e297ba9b9" -dependencies = [ - "quick-xml 0.37.5", - "thiserror 2.0.18", - "windows", - "windows-version", -] - -[[package]] -name = "tempfile" -version = "3.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" -dependencies = [ - "fastrand", - "getrandom 0.4.2", - "once_cell", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "tendril" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24" -dependencies = [ - "new_debug_unreachable", - "utf-8", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" -dependencies = [ - "thiserror-impl 2.0.18", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "time" -version = "0.3.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde_core", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" - -[[package]] -name = "time-macros" -version = "0.2.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinystr" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tokio" -version = "1.52.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" -dependencies = [ - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-macros" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" -dependencies = [ - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "toml_edit 0.20.2", -] - -[[package]] -name = "toml" -version = "0.9.12+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" -dependencies = [ - "indexmap 2.14.0", - "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 0.7.5+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 0.7.15", -] - -[[package]] -name = "toml" -version = "1.1.2+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" -dependencies = [ - "indexmap 2.14.0", - "serde_core", - "serde_spanned 1.1.1", - "toml_datetime 1.1.1+spec-1.1.0", - "toml_parser", - "toml_writer", - "winnow 1.0.2", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_datetime" -version = "0.7.5+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_datetime" -version = "1.1.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" -dependencies = [ - "serde_core", -] - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" -dependencies = [ - "indexmap 2.14.0", - "serde", - "serde_spanned 0.6.9", - "toml_datetime 0.6.3", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.25.11+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" -dependencies = [ - "indexmap 2.14.0", - "toml_datetime 1.1.1+spec-1.1.0", - "toml_parser", - "winnow 1.0.2", -] - -[[package]] -name = "toml_parser" -version = "1.1.2+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" -dependencies = [ - "winnow 1.0.2", -] - -[[package]] -name = "toml_writer" -version = "1.1.1+spec-1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" - -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-http" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" -dependencies = [ - "bitflags 2.11.1", - "bytes", - "futures-util", - "http", - "http-body", - "iri-string", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "tray-icon" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15edbb0d80583e85ee8df283410038e17314df5cba30da2087a54a85216c0773" -dependencies = [ - "crossbeam-channel", - "dirs 6.0.0", - "libappindicator", - "muda", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-core-graphics", - "objc2-foundation", - "once_cell", - "png 0.18.1", - "serde", - "thiserror 2.0.18", - "windows-sys 0.61.2", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typeid" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" - -[[package]] -name = "typenum" -version = "1.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" - -[[package]] -name = "uds_windows" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e" -dependencies = [ - "memoffset", - "tempfile", - "windows-sys 0.61.2", -] - -[[package]] -name = "unic-char-property" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" -dependencies = [ - "unic-char-range", -] - -[[package]] -name = "unic-char-range" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" - -[[package]] -name = "unic-common" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" - -[[package]] -name = "unic-ucd-ident" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e230a37c0381caa9219d67cf063aa3a375ffed5bf541a452db16e744bdab6987" -dependencies = [ - "unic-char-property", - "unic-char-range", - "unic-ucd-version", -] - -[[package]] -name = "unic-ucd-version" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" -dependencies = [ - "unic-common", -] - -[[package]] -name = "unicode-ident" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" - -[[package]] -name = "unicode-segmentation" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", - "serde_derive", -] - -[[package]] -name = "urlpattern" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70acd30e3aa1450bc2eece896ce2ad0d178e9c079493819301573dae3c37ba6d" -dependencies = [ - "regex", - "serde", - "unic-ucd-ident", - "url", -] - -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "uuid" -version = "1.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" -dependencies = [ - "getrandom 0.4.2", - "js-sys", - "serde_core", - "wasm-bindgen", -] - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version-compare" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "vswhom" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" -dependencies = [ - "libc", - "vswhom-sys", -] - -[[package]] -name = "vswhom-sys" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasip2" -version = "1.0.3+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" -dependencies = [ - "wit-bindgen 0.57.1", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen 0.51.0", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af934872acec734c2d80e6617bbb5ff4f12b052dd8e6332b0817bce889516084" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn 2.0.117", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap 2.14.0", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasm-streams" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags 2.11.1", - "hashbrown 0.15.5", - "indexmap 2.14.0", - "semver", -] - -[[package]] -name = "web-sys" -version = "0.3.97" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eadbac71025cd7b0834f20d1fe8472e8495821b4e9801eb0a60bd1f19827602" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web_atoms" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff6eef815df1834fd250e3a2ff436044d82a9f1bc1980ca1dbdf07effc538" -dependencies = [ - "phf 0.13.1", - "phf_codegen", - "string_cache", - "string_cache_codegen", -] - -[[package]] -name = "webkit2gtk" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" -dependencies = [ - "bitflags 1.3.2", - "cairo-rs", - "gdk", - "gdk-sys", - "gio", - "gio-sys", - "glib", - "glib-sys", - "gobject-sys", - "gtk", - "gtk-sys", - "javascriptcore-rs", - "libc", - "once_cell", - "soup3", - "webkit2gtk-sys", -] - -[[package]] -name = "webkit2gtk-sys" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" -dependencies = [ - "bitflags 1.3.2", - "cairo-sys-rs", - "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", - "gtk-sys", - "javascriptcore-rs-sys", - "libc", - "pkg-config", - "soup3-sys", - "system-deps", -] - -[[package]] -name = "webview2-com" -version = "0.38.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7130243a7a5b33c54a444e54842e6a9e133de08b5ad7b5861cd8ed9a6a5bc96a" -dependencies = [ - "webview2-com-macros", - "webview2-com-sys", - "windows", - "windows-core 0.61.2", - "windows-implement", - "windows-interface", -] - -[[package]] -name = "webview2-com-macros" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a921c1b6914c367b2b823cd4cde6f96beec77d30a939c8199bb377cf9b9b54" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "webview2-com-sys" -version = "0.38.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381336cfffd772377d291702245447a5251a2ffa5bad679c99e61bc48bacbf9c" -dependencies = [ - "thiserror 2.0.18", - "windows", - "windows-core 0.61.2", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "window-vibrancy" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bec5a31f3f9362f2258fd0e9c9dd61a9ca432e7306cc78c444258f0dce9a9c" -dependencies = [ - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", - "raw-window-handle", - "windows-sys 0.59.0", - "windows-version", -] - -[[package]] -name = "windows" -version = "0.61.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" -dependencies = [ - "windows-collections", - "windows-core 0.61.2", - "windows-future", - "windows-link 0.1.3", - "windows-numerics", -] - -[[package]] -name = "windows-collections" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" -dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", -] - -[[package]] -name = "windows-core" -version = "0.62.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-future" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", - "windows-threading", -] - -[[package]] -name = "windows-implement" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-interface" -version = "0.59.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-numerics" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" -dependencies = [ - "windows-core 0.61.2", - "windows-link 0.1.3", -] - -[[package]] -name = "windows-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" -dependencies = [ - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-result" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-strings" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", -] - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link 0.2.1", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", -] - -[[package]] -name = "windows-threading" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" -dependencies = [ - "windows-link 0.1.3", -] - -[[package]] -name = "windows-version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" -dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" - -[[package]] -name = "winnow" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" -dependencies = [ - "memchr", -] - -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] - -[[package]] -name = "winreg" -version = "0.55.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb5a765337c50e9ec252c2069be9bf91c7df47afb103b642ba3a53bf8101be97" -dependencies = [ - "cfg-if", - "windows-sys 0.59.0", -] - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck 0.5.0", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck 0.5.0", - "indexmap 2.14.0", - "prettyplease", - "syn 2.0.117", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn 2.0.117", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags 2.11.1", - "indexmap 2.14.0", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.14.0", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - -[[package]] -name = "writeable" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" - -[[package]] -name = "wry" -version = "0.55.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3013fd6116aac351dd2e18f349b28b2cfef3a5ff3253a9d0ce2d7193bb1b4429" -dependencies = [ - "base64 0.22.1", - "block2", - "cookie", - "crossbeam-channel", - "dirs 6.0.0", - "dom_query", - "dpi", - "dunce", - "gdkx11", - "gtk", - "http", - "javascriptcore-rs", - "jni", - "libc", - "ndk", - "objc2", - "objc2-app-kit", - "objc2-core-foundation", - "objc2-foundation", - "objc2-ui-kit", - "objc2-web-kit", - "once_cell", - "percent-encoding", - "raw-window-handle", - "sha2", - "soup3", - "tao-macros", - "thiserror 2.0.18", - "url", - "webkit2gtk", - "webkit2gtk-sys", - "webview2-com", - "windows", - "windows-core 0.61.2", - "windows-version", - "x11-dl", -] - -[[package]] -name = "x11" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "x11-dl" -version = "2.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" -dependencies = [ - "libc", - "once_cell", - "pkg-config", -] - -[[package]] -name = "yoke" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" -dependencies = [ - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "synstructure", -] - -[[package]] -name = "zbus" -version = "5.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bcbf15c8708d7fc1be0c993622e0a5cbd5e8b52bfa40afa4c3e0cd8d724ac1" -dependencies = [ - "async-broadcast", - "async-executor", - "async-io", - "async-lock", - "async-process", - "async-recursion", - "async-task", - "async-trait", - "blocking", - "enumflags2", - "event-listener", - "futures-core", - "futures-lite", - "hex", - "libc", - "ordered-stream", - "rustix", - "serde", - "serde_repr", - "tracing", - "uds_windows", - "uuid", - "windows-sys 0.61.2", - "winnow 1.0.2", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "5.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51fa5406ad9175a8c825a931f8cf347116b531b3634fcb0b627c290f1f2516ff" -dependencies = [ - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", - "zbus_names", - "zvariant", - "zvariant_utils", -] - -[[package]] -name = "zbus_names" -version = "4.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7074f3e50b894eac91750142016d30d0a89be8e67dbfd9704fb875825760e52d" -dependencies = [ - "serde", - "winnow 1.0.2", - "zvariant", -] - -[[package]] -name = "zerocopy" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "zerofrom" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" - -[[package]] -name = "zerotrie" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", -] - -[[package]] -name = "zmij" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" - -[[package]] -name = "zvariant" -version = "5.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db0ecb8987cf5e92653c57c098f7f0e39a03112edb796f4fe089fb7eaa14ff" -dependencies = [ - "endi", - "enumflags2", - "serde", - "winnow 1.0.2", - "zvariant_derive", - "zvariant_utils", -] - -[[package]] -name = "zvariant_derive" -version = "5.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b949b639ab1b4bed763aa7481ba0e368af68d8b55532f8ed4bec86a59f2ca98" -dependencies = [ - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", - "zvariant_utils", -] - -[[package]] -name = "zvariant_utils" -version = "3.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d464f5733ffa07a3164d656f18533caace9d0638596721355d73256a410d691" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "syn 2.0.117", - "winnow 1.0.2", -] diff --git a/packages/dcp-desktop/src-tauri/Cargo.toml b/packages/dcp-desktop/src-tauri/Cargo.toml deleted file mode 100644 index 7bde325..0000000 --- a/packages/dcp-desktop/src-tauri/Cargo.toml +++ /dev/null @@ -1,37 +0,0 @@ -[package] -name = "dcp" -version = "0.1.0" -description = "DCP Desktop" -authors = ["DCP Protocol"] -edition = "2021" -license = "Apache-2.0" - -[lib] -name = "dcp_lib" -crate-type = ["staticlib", "cdylib", "rlib"] - -[build-dependencies] -tauri-build = { version = "2", features = [] } - -[dependencies] -tauri = { version = "2", features = ["tray-icon"] } -tauri-plugin-notification = "2" -tauri-plugin-autostart = "2" -tauri-plugin-shell = "2" -serde = { version = "1", features = ["derive"] } -serde_json = "1" -tokio = { version = "1", features = ["full"] } -reqwest = { version = "0.12", features = ["json"] } -dirs = "6" -ed25519-dalek = { version = "2", features = ["rand_core"] } -keyring = "3" -uuid = { version = "1", features = ["v4"] } -base64 = "0.22" -rand = "0.8" - -[profile.release] -panic = "abort" -codegen-units = 1 -lto = true -opt-level = "z" -strip = true diff --git a/packages/dcp-desktop/src-tauri/bin/.gitkeep b/packages/dcp-desktop/src-tauri/bin/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/packages/dcp-desktop/src-tauri/build.rs b/packages/dcp-desktop/src-tauri/build.rs deleted file mode 100644 index d860e1e..0000000 --- a/packages/dcp-desktop/src-tauri/build.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - tauri_build::build() -} diff --git a/packages/dcp-desktop/src-tauri/capabilities/default.json b/packages/dcp-desktop/src-tauri/capabilities/default.json deleted file mode 100644 index 7a8ae47..0000000 --- a/packages/dcp-desktop/src-tauri/capabilities/default.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "https://schema.tauri.app/config/2/capability", - "identifier": "default", - "description": "Default capability for DCP", - "windows": ["main"], - "permissions": [ - "core:default", - "notification:default", - "autostart:default", - "shell:default", - { - "identifier": "shell:allow-open", - "allow": [ - { "url": "https://*" }, - { "url": "http://*" }, - { "url": "cursor://*" }, - { "url": "vscode://*" }, - { "url": "vscode:*" } - ] - } - ] -} diff --git a/packages/dcp-desktop/src-tauri/gen/schemas/acl-manifests.json b/packages/dcp-desktop/src-tauri/gen/schemas/acl-manifests.json deleted file mode 100644 index 8fe3240..0000000 --- a/packages/dcp-desktop/src-tauri/gen/schemas/acl-manifests.json +++ /dev/null @@ -1 +0,0 @@ -{"autostart":{"default_permission":{"identifier":"default","description":"This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n","permissions":["allow-enable","allow-disable","allow-is-enabled"]},"permissions":{"allow-disable":{"identifier":"allow-disable","description":"Enables the disable command without any pre-configured scope.","commands":{"allow":["disable"],"deny":[]}},"allow-enable":{"identifier":"allow-enable","description":"Enables the enable command without any pre-configured scope.","commands":{"allow":["enable"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"deny-disable":{"identifier":"deny-disable","description":"Denies the disable command without any pre-configured scope.","commands":{"allow":[],"deny":["disable"]}},"deny-enable":{"identifier":"deny-enable","description":"Denies the enable command without any pre-configured scope.","commands":{"allow":[],"deny":["enable"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}}},"permission_sets":{},"global_scope_schema":null},"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener","allow-supports-multiple-windows"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-supports-multiple-windows":{"identifier":"allow-supports-multiple-windows","description":"Enables the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":["supports_multiple_windows"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_data_store"]}},"deny-remove-listener":{"identifier":"deny-remove-listener","description":"Denies the remove_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_listener"]}},"deny-set-app-theme":{"identifier":"deny-set-app-theme","description":"Denies the set_app_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_app_theme"]}},"deny-set-dock-visibility":{"identifier":"deny-set-dock-visibility","description":"Denies the set_dock_visibility command without any pre-configured scope.","commands":{"allow":[],"deny":["set_dock_visibility"]}},"deny-supports-multiple-windows":{"identifier":"deny-supports-multiple-windows","description":"Denies the supports_multiple_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["supports_multiple_windows"]}},"deny-tauri-version":{"identifier":"deny-tauri-version","description":"Denies the tauri_version command without any pre-configured scope.","commands":{"allow":[],"deny":["tauri_version"]}},"deny-version":{"identifier":"deny-version","description":"Denies the version command without any pre-configured scope.","commands":{"allow":[],"deny":["version"]}}},"permission_sets":{},"global_scope_schema":null},"core:event":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-listen","allow-unlisten","allow-emit","allow-emit-to"]},"permissions":{"allow-emit":{"identifier":"allow-emit","description":"Enables the emit command without any pre-configured scope.","commands":{"allow":["emit"],"deny":[]}},"allow-emit-to":{"identifier":"allow-emit-to","description":"Enables the emit_to command without any pre-configured scope.","commands":{"allow":["emit_to"],"deny":[]}},"allow-listen":{"identifier":"allow-listen","description":"Enables the listen command without any pre-configured scope.","commands":{"allow":["listen"],"deny":[]}},"allow-unlisten":{"identifier":"allow-unlisten","description":"Enables the unlisten command without any pre-configured scope.","commands":{"allow":["unlisten"],"deny":[]}},"deny-emit":{"identifier":"deny-emit","description":"Denies the emit command without any pre-configured scope.","commands":{"allow":[],"deny":["emit"]}},"deny-emit-to":{"identifier":"deny-emit-to","description":"Denies the emit_to command without any pre-configured scope.","commands":{"allow":[],"deny":["emit_to"]}},"deny-listen":{"identifier":"deny-listen","description":"Denies the listen command without any pre-configured scope.","commands":{"allow":[],"deny":["listen"]}},"deny-unlisten":{"identifier":"deny-unlisten","description":"Denies the unlisten command without any pre-configured scope.","commands":{"allow":[],"deny":["unlisten"]}}},"permission_sets":{},"global_scope_schema":null},"core:image":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-from-bytes","allow-from-path","allow-rgba","allow-size"]},"permissions":{"allow-from-bytes":{"identifier":"allow-from-bytes","description":"Enables the from_bytes command without any pre-configured scope.","commands":{"allow":["from_bytes"],"deny":[]}},"allow-from-path":{"identifier":"allow-from-path","description":"Enables the from_path command without any pre-configured scope.","commands":{"allow":["from_path"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-rgba":{"identifier":"allow-rgba","description":"Enables the rgba command without any pre-configured scope.","commands":{"allow":["rgba"],"deny":[]}},"allow-size":{"identifier":"allow-size","description":"Enables the size command without any pre-configured scope.","commands":{"allow":["size"],"deny":[]}},"deny-from-bytes":{"identifier":"deny-from-bytes","description":"Denies the from_bytes command without any pre-configured scope.","commands":{"allow":[],"deny":["from_bytes"]}},"deny-from-path":{"identifier":"deny-from-path","description":"Denies the from_path command without any pre-configured scope.","commands":{"allow":[],"deny":["from_path"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-rgba":{"identifier":"deny-rgba","description":"Denies the rgba command without any pre-configured scope.","commands":{"allow":[],"deny":["rgba"]}},"deny-size":{"identifier":"deny-size","description":"Denies the size command without any pre-configured scope.","commands":{"allow":[],"deny":["size"]}}},"permission_sets":{},"global_scope_schema":null},"core:menu":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-append","allow-prepend","allow-insert","allow-remove","allow-remove-at","allow-items","allow-get","allow-popup","allow-create-default","allow-set-as-app-menu","allow-set-as-window-menu","allow-text","allow-set-text","allow-is-enabled","allow-set-enabled","allow-set-accelerator","allow-set-as-windows-menu-for-nsapp","allow-set-as-help-menu-for-nsapp","allow-is-checked","allow-set-checked","allow-set-icon"]},"permissions":{"allow-append":{"identifier":"allow-append","description":"Enables the append command without any pre-configured scope.","commands":{"allow":["append"],"deny":[]}},"allow-create-default":{"identifier":"allow-create-default","description":"Enables the create_default command without any pre-configured scope.","commands":{"allow":["create_default"],"deny":[]}},"allow-get":{"identifier":"allow-get","description":"Enables the get command without any pre-configured scope.","commands":{"allow":["get"],"deny":[]}},"allow-insert":{"identifier":"allow-insert","description":"Enables the insert command without any pre-configured scope.","commands":{"allow":["insert"],"deny":[]}},"allow-is-checked":{"identifier":"allow-is-checked","description":"Enables the is_checked command without any pre-configured scope.","commands":{"allow":["is_checked"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-items":{"identifier":"allow-items","description":"Enables the items command without any pre-configured scope.","commands":{"allow":["items"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-popup":{"identifier":"allow-popup","description":"Enables the popup command without any pre-configured scope.","commands":{"allow":["popup"],"deny":[]}},"allow-prepend":{"identifier":"allow-prepend","description":"Enables the prepend command without any pre-configured scope.","commands":{"allow":["prepend"],"deny":[]}},"allow-remove":{"identifier":"allow-remove","description":"Enables the remove command without any pre-configured scope.","commands":{"allow":["remove"],"deny":[]}},"allow-remove-at":{"identifier":"allow-remove-at","description":"Enables the remove_at command without any pre-configured scope.","commands":{"allow":["remove_at"],"deny":[]}},"allow-set-accelerator":{"identifier":"allow-set-accelerator","description":"Enables the set_accelerator command without any pre-configured scope.","commands":{"allow":["set_accelerator"],"deny":[]}},"allow-set-as-app-menu":{"identifier":"allow-set-as-app-menu","description":"Enables the set_as_app_menu command without any pre-configured scope.","commands":{"allow":["set_as_app_menu"],"deny":[]}},"allow-set-as-help-menu-for-nsapp":{"identifier":"allow-set-as-help-menu-for-nsapp","description":"Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_help_menu_for_nsapp"],"deny":[]}},"allow-set-as-window-menu":{"identifier":"allow-set-as-window-menu","description":"Enables the set_as_window_menu command without any pre-configured scope.","commands":{"allow":["set_as_window_menu"],"deny":[]}},"allow-set-as-windows-menu-for-nsapp":{"identifier":"allow-set-as-windows-menu-for-nsapp","description":"Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":["set_as_windows_menu_for_nsapp"],"deny":[]}},"allow-set-checked":{"identifier":"allow-set-checked","description":"Enables the set_checked command without any pre-configured scope.","commands":{"allow":["set_checked"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-text":{"identifier":"allow-set-text","description":"Enables the set_text command without any pre-configured scope.","commands":{"allow":["set_text"],"deny":[]}},"allow-text":{"identifier":"allow-text","description":"Enables the text command without any pre-configured scope.","commands":{"allow":["text"],"deny":[]}},"deny-append":{"identifier":"deny-append","description":"Denies the append command without any pre-configured scope.","commands":{"allow":[],"deny":["append"]}},"deny-create-default":{"identifier":"deny-create-default","description":"Denies the create_default command without any pre-configured scope.","commands":{"allow":[],"deny":["create_default"]}},"deny-get":{"identifier":"deny-get","description":"Denies the get command without any pre-configured scope.","commands":{"allow":[],"deny":["get"]}},"deny-insert":{"identifier":"deny-insert","description":"Denies the insert command without any pre-configured scope.","commands":{"allow":[],"deny":["insert"]}},"deny-is-checked":{"identifier":"deny-is-checked","description":"Denies the is_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["is_checked"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-items":{"identifier":"deny-items","description":"Denies the items command without any pre-configured scope.","commands":{"allow":[],"deny":["items"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-popup":{"identifier":"deny-popup","description":"Denies the popup command without any pre-configured scope.","commands":{"allow":[],"deny":["popup"]}},"deny-prepend":{"identifier":"deny-prepend","description":"Denies the prepend command without any pre-configured scope.","commands":{"allow":[],"deny":["prepend"]}},"deny-remove":{"identifier":"deny-remove","description":"Denies the remove command without any pre-configured scope.","commands":{"allow":[],"deny":["remove"]}},"deny-remove-at":{"identifier":"deny-remove-at","description":"Denies the remove_at command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_at"]}},"deny-set-accelerator":{"identifier":"deny-set-accelerator","description":"Denies the set_accelerator command without any pre-configured scope.","commands":{"allow":[],"deny":["set_accelerator"]}},"deny-set-as-app-menu":{"identifier":"deny-set-as-app-menu","description":"Denies the set_as_app_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_app_menu"]}},"deny-set-as-help-menu-for-nsapp":{"identifier":"deny-set-as-help-menu-for-nsapp","description":"Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_help_menu_for_nsapp"]}},"deny-set-as-window-menu":{"identifier":"deny-set-as-window-menu","description":"Denies the set_as_window_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_window_menu"]}},"deny-set-as-windows-menu-for-nsapp":{"identifier":"deny-set-as-windows-menu-for-nsapp","description":"Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.","commands":{"allow":[],"deny":["set_as_windows_menu_for_nsapp"]}},"deny-set-checked":{"identifier":"deny-set-checked","description":"Denies the set_checked command without any pre-configured scope.","commands":{"allow":[],"deny":["set_checked"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-text":{"identifier":"deny-set-text","description":"Denies the set_text command without any pre-configured scope.","commands":{"allow":[],"deny":["set_text"]}},"deny-text":{"identifier":"deny-text","description":"Denies the text command without any pre-configured scope.","commands":{"allow":[],"deny":["text"]}}},"permission_sets":{},"global_scope_schema":null},"core:path":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-resolve-directory","allow-resolve","allow-normalize","allow-join","allow-dirname","allow-extname","allow-basename","allow-is-absolute"]},"permissions":{"allow-basename":{"identifier":"allow-basename","description":"Enables the basename command without any pre-configured scope.","commands":{"allow":["basename"],"deny":[]}},"allow-dirname":{"identifier":"allow-dirname","description":"Enables the dirname command without any pre-configured scope.","commands":{"allow":["dirname"],"deny":[]}},"allow-extname":{"identifier":"allow-extname","description":"Enables the extname command without any pre-configured scope.","commands":{"allow":["extname"],"deny":[]}},"allow-is-absolute":{"identifier":"allow-is-absolute","description":"Enables the is_absolute command without any pre-configured scope.","commands":{"allow":["is_absolute"],"deny":[]}},"allow-join":{"identifier":"allow-join","description":"Enables the join command without any pre-configured scope.","commands":{"allow":["join"],"deny":[]}},"allow-normalize":{"identifier":"allow-normalize","description":"Enables the normalize command without any pre-configured scope.","commands":{"allow":["normalize"],"deny":[]}},"allow-resolve":{"identifier":"allow-resolve","description":"Enables the resolve command without any pre-configured scope.","commands":{"allow":["resolve"],"deny":[]}},"allow-resolve-directory":{"identifier":"allow-resolve-directory","description":"Enables the resolve_directory command without any pre-configured scope.","commands":{"allow":["resolve_directory"],"deny":[]}},"deny-basename":{"identifier":"deny-basename","description":"Denies the basename command without any pre-configured scope.","commands":{"allow":[],"deny":["basename"]}},"deny-dirname":{"identifier":"deny-dirname","description":"Denies the dirname command without any pre-configured scope.","commands":{"allow":[],"deny":["dirname"]}},"deny-extname":{"identifier":"deny-extname","description":"Denies the extname command without any pre-configured scope.","commands":{"allow":[],"deny":["extname"]}},"deny-is-absolute":{"identifier":"deny-is-absolute","description":"Denies the is_absolute command without any pre-configured scope.","commands":{"allow":[],"deny":["is_absolute"]}},"deny-join":{"identifier":"deny-join","description":"Denies the join command without any pre-configured scope.","commands":{"allow":[],"deny":["join"]}},"deny-normalize":{"identifier":"deny-normalize","description":"Denies the normalize command without any pre-configured scope.","commands":{"allow":[],"deny":["normalize"]}},"deny-resolve":{"identifier":"deny-resolve","description":"Denies the resolve command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve"]}},"deny-resolve-directory":{"identifier":"deny-resolve-directory","description":"Denies the resolve_directory command without any pre-configured scope.","commands":{"allow":[],"deny":["resolve_directory"]}}},"permission_sets":{},"global_scope_schema":null},"core:resources":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-close"]},"permissions":{"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}}},"permission_sets":{},"global_scope_schema":null},"core:tray":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin, which enables all commands.","permissions":["allow-new","allow-get-by-id","allow-remove-by-id","allow-set-icon","allow-set-menu","allow-set-tooltip","allow-set-title","allow-set-visible","allow-set-temp-dir-path","allow-set-icon-as-template","allow-set-icon-with-as-template","allow-set-show-menu-on-left-click"]},"permissions":{"allow-get-by-id":{"identifier":"allow-get-by-id","description":"Enables the get_by_id command without any pre-configured scope.","commands":{"allow":["get_by_id"],"deny":[]}},"allow-new":{"identifier":"allow-new","description":"Enables the new command without any pre-configured scope.","commands":{"allow":["new"],"deny":[]}},"allow-remove-by-id":{"identifier":"allow-remove-by-id","description":"Enables the remove_by_id command without any pre-configured scope.","commands":{"allow":["remove_by_id"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-icon-as-template":{"identifier":"allow-set-icon-as-template","description":"Enables the set_icon_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_as_template"],"deny":[]}},"allow-set-icon-with-as-template":{"identifier":"allow-set-icon-with-as-template","description":"Enables the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":["set_icon_with_as_template"],"deny":[]}},"allow-set-menu":{"identifier":"allow-set-menu","description":"Enables the set_menu command without any pre-configured scope.","commands":{"allow":["set_menu"],"deny":[]}},"allow-set-show-menu-on-left-click":{"identifier":"allow-set-show-menu-on-left-click","description":"Enables the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":["set_show_menu_on_left_click"],"deny":[]}},"allow-set-temp-dir-path":{"identifier":"allow-set-temp-dir-path","description":"Enables the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":["set_temp_dir_path"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-tooltip":{"identifier":"allow-set-tooltip","description":"Enables the set_tooltip command without any pre-configured scope.","commands":{"allow":["set_tooltip"],"deny":[]}},"allow-set-visible":{"identifier":"allow-set-visible","description":"Enables the set_visible command without any pre-configured scope.","commands":{"allow":["set_visible"],"deny":[]}},"deny-get-by-id":{"identifier":"deny-get-by-id","description":"Denies the get_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["get_by_id"]}},"deny-new":{"identifier":"deny-new","description":"Denies the new command without any pre-configured scope.","commands":{"allow":[],"deny":["new"]}},"deny-remove-by-id":{"identifier":"deny-remove-by-id","description":"Denies the remove_by_id command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_by_id"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-icon-as-template":{"identifier":"deny-set-icon-as-template","description":"Denies the set_icon_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_as_template"]}},"deny-set-icon-with-as-template":{"identifier":"deny-set-icon-with-as-template","description":"Denies the set_icon_with_as_template command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon_with_as_template"]}},"deny-set-menu":{"identifier":"deny-set-menu","description":"Denies the set_menu command without any pre-configured scope.","commands":{"allow":[],"deny":["set_menu"]}},"deny-set-show-menu-on-left-click":{"identifier":"deny-set-show-menu-on-left-click","description":"Denies the set_show_menu_on_left_click command without any pre-configured scope.","commands":{"allow":[],"deny":["set_show_menu_on_left_click"]}},"deny-set-temp-dir-path":{"identifier":"deny-set-temp-dir-path","description":"Denies the set_temp_dir_path command without any pre-configured scope.","commands":{"allow":[],"deny":["set_temp_dir_path"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-tooltip":{"identifier":"deny-set-tooltip","description":"Denies the set_tooltip command without any pre-configured scope.","commands":{"allow":[],"deny":["set_tooltip"]}},"deny-set-visible":{"identifier":"deny-set-visible","description":"Denies the set_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible"]}}},"permission_sets":{},"global_scope_schema":null},"core:webview":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-webviews","allow-webview-position","allow-webview-size","allow-internal-toggle-devtools"]},"permissions":{"allow-clear-all-browsing-data":{"identifier":"allow-clear-all-browsing-data","description":"Enables the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":["clear_all_browsing_data"],"deny":[]}},"allow-create-webview":{"identifier":"allow-create-webview","description":"Enables the create_webview command without any pre-configured scope.","commands":{"allow":["create_webview"],"deny":[]}},"allow-create-webview-window":{"identifier":"allow-create-webview-window","description":"Enables the create_webview_window command without any pre-configured scope.","commands":{"allow":["create_webview_window"],"deny":[]}},"allow-get-all-webviews":{"identifier":"allow-get-all-webviews","description":"Enables the get_all_webviews command without any pre-configured scope.","commands":{"allow":["get_all_webviews"],"deny":[]}},"allow-internal-toggle-devtools":{"identifier":"allow-internal-toggle-devtools","description":"Enables the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":["internal_toggle_devtools"],"deny":[]}},"allow-print":{"identifier":"allow-print","description":"Enables the print command without any pre-configured scope.","commands":{"allow":["print"],"deny":[]}},"allow-reparent":{"identifier":"allow-reparent","description":"Enables the reparent command without any pre-configured scope.","commands":{"allow":["reparent"],"deny":[]}},"allow-set-webview-auto-resize":{"identifier":"allow-set-webview-auto-resize","description":"Enables the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":["set_webview_auto_resize"],"deny":[]}},"allow-set-webview-background-color":{"identifier":"allow-set-webview-background-color","description":"Enables the set_webview_background_color command without any pre-configured scope.","commands":{"allow":["set_webview_background_color"],"deny":[]}},"allow-set-webview-focus":{"identifier":"allow-set-webview-focus","description":"Enables the set_webview_focus command without any pre-configured scope.","commands":{"allow":["set_webview_focus"],"deny":[]}},"allow-set-webview-position":{"identifier":"allow-set-webview-position","description":"Enables the set_webview_position command without any pre-configured scope.","commands":{"allow":["set_webview_position"],"deny":[]}},"allow-set-webview-size":{"identifier":"allow-set-webview-size","description":"Enables the set_webview_size command without any pre-configured scope.","commands":{"allow":["set_webview_size"],"deny":[]}},"allow-set-webview-zoom":{"identifier":"allow-set-webview-zoom","description":"Enables the set_webview_zoom command without any pre-configured scope.","commands":{"allow":["set_webview_zoom"],"deny":[]}},"allow-webview-close":{"identifier":"allow-webview-close","description":"Enables the webview_close command without any pre-configured scope.","commands":{"allow":["webview_close"],"deny":[]}},"allow-webview-hide":{"identifier":"allow-webview-hide","description":"Enables the webview_hide command without any pre-configured scope.","commands":{"allow":["webview_hide"],"deny":[]}},"allow-webview-position":{"identifier":"allow-webview-position","description":"Enables the webview_position command without any pre-configured scope.","commands":{"allow":["webview_position"],"deny":[]}},"allow-webview-show":{"identifier":"allow-webview-show","description":"Enables the webview_show command without any pre-configured scope.","commands":{"allow":["webview_show"],"deny":[]}},"allow-webview-size":{"identifier":"allow-webview-size","description":"Enables the webview_size command without any pre-configured scope.","commands":{"allow":["webview_size"],"deny":[]}},"deny-clear-all-browsing-data":{"identifier":"deny-clear-all-browsing-data","description":"Denies the clear_all_browsing_data command without any pre-configured scope.","commands":{"allow":[],"deny":["clear_all_browsing_data"]}},"deny-create-webview":{"identifier":"deny-create-webview","description":"Denies the create_webview command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview"]}},"deny-create-webview-window":{"identifier":"deny-create-webview-window","description":"Denies the create_webview_window command without any pre-configured scope.","commands":{"allow":[],"deny":["create_webview_window"]}},"deny-get-all-webviews":{"identifier":"deny-get-all-webviews","description":"Denies the get_all_webviews command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_webviews"]}},"deny-internal-toggle-devtools":{"identifier":"deny-internal-toggle-devtools","description":"Denies the internal_toggle_devtools command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_devtools"]}},"deny-print":{"identifier":"deny-print","description":"Denies the print command without any pre-configured scope.","commands":{"allow":[],"deny":["print"]}},"deny-reparent":{"identifier":"deny-reparent","description":"Denies the reparent command without any pre-configured scope.","commands":{"allow":[],"deny":["reparent"]}},"deny-set-webview-auto-resize":{"identifier":"deny-set-webview-auto-resize","description":"Denies the set_webview_auto_resize command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_auto_resize"]}},"deny-set-webview-background-color":{"identifier":"deny-set-webview-background-color","description":"Denies the set_webview_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_background_color"]}},"deny-set-webview-focus":{"identifier":"deny-set-webview-focus","description":"Denies the set_webview_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_focus"]}},"deny-set-webview-position":{"identifier":"deny-set-webview-position","description":"Denies the set_webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_position"]}},"deny-set-webview-size":{"identifier":"deny-set-webview-size","description":"Denies the set_webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_size"]}},"deny-set-webview-zoom":{"identifier":"deny-set-webview-zoom","description":"Denies the set_webview_zoom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_webview_zoom"]}},"deny-webview-close":{"identifier":"deny-webview-close","description":"Denies the webview_close command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_close"]}},"deny-webview-hide":{"identifier":"deny-webview-hide","description":"Denies the webview_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_hide"]}},"deny-webview-position":{"identifier":"deny-webview-position","description":"Denies the webview_position command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_position"]}},"deny-webview-show":{"identifier":"deny-webview-show","description":"Denies the webview_show command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_show"]}},"deny-webview-size":{"identifier":"deny-webview-size","description":"Denies the webview_size command without any pre-configured scope.","commands":{"allow":[],"deny":["webview_size"]}}},"permission_sets":{},"global_scope_schema":null},"core:window":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-get-all-windows","allow-scale-factor","allow-inner-position","allow-outer-position","allow-inner-size","allow-outer-size","allow-is-fullscreen","allow-is-minimized","allow-is-maximized","allow-is-focused","allow-is-decorated","allow-is-resizable","allow-is-maximizable","allow-is-minimizable","allow-is-closable","allow-is-visible","allow-is-enabled","allow-title","allow-current-monitor","allow-primary-monitor","allow-monitor-from-point","allow-available-monitors","allow-cursor-position","allow-theme","allow-is-always-on-top","allow-activity-name","allow-scene-identifier","allow-internal-toggle-maximize"]},"permissions":{"allow-activity-name":{"identifier":"allow-activity-name","description":"Enables the activity_name command without any pre-configured scope.","commands":{"allow":["activity_name"],"deny":[]}},"allow-available-monitors":{"identifier":"allow-available-monitors","description":"Enables the available_monitors command without any pre-configured scope.","commands":{"allow":["available_monitors"],"deny":[]}},"allow-center":{"identifier":"allow-center","description":"Enables the center command without any pre-configured scope.","commands":{"allow":["center"],"deny":[]}},"allow-close":{"identifier":"allow-close","description":"Enables the close command without any pre-configured scope.","commands":{"allow":["close"],"deny":[]}},"allow-create":{"identifier":"allow-create","description":"Enables the create command without any pre-configured scope.","commands":{"allow":["create"],"deny":[]}},"allow-current-monitor":{"identifier":"allow-current-monitor","description":"Enables the current_monitor command without any pre-configured scope.","commands":{"allow":["current_monitor"],"deny":[]}},"allow-cursor-position":{"identifier":"allow-cursor-position","description":"Enables the cursor_position command without any pre-configured scope.","commands":{"allow":["cursor_position"],"deny":[]}},"allow-destroy":{"identifier":"allow-destroy","description":"Enables the destroy command without any pre-configured scope.","commands":{"allow":["destroy"],"deny":[]}},"allow-get-all-windows":{"identifier":"allow-get-all-windows","description":"Enables the get_all_windows command without any pre-configured scope.","commands":{"allow":["get_all_windows"],"deny":[]}},"allow-hide":{"identifier":"allow-hide","description":"Enables the hide command without any pre-configured scope.","commands":{"allow":["hide"],"deny":[]}},"allow-inner-position":{"identifier":"allow-inner-position","description":"Enables the inner_position command without any pre-configured scope.","commands":{"allow":["inner_position"],"deny":[]}},"allow-inner-size":{"identifier":"allow-inner-size","description":"Enables the inner_size command without any pre-configured scope.","commands":{"allow":["inner_size"],"deny":[]}},"allow-internal-toggle-maximize":{"identifier":"allow-internal-toggle-maximize","description":"Enables the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":["internal_toggle_maximize"],"deny":[]}},"allow-is-always-on-top":{"identifier":"allow-is-always-on-top","description":"Enables the is_always_on_top command without any pre-configured scope.","commands":{"allow":["is_always_on_top"],"deny":[]}},"allow-is-closable":{"identifier":"allow-is-closable","description":"Enables the is_closable command without any pre-configured scope.","commands":{"allow":["is_closable"],"deny":[]}},"allow-is-decorated":{"identifier":"allow-is-decorated","description":"Enables the is_decorated command without any pre-configured scope.","commands":{"allow":["is_decorated"],"deny":[]}},"allow-is-enabled":{"identifier":"allow-is-enabled","description":"Enables the is_enabled command without any pre-configured scope.","commands":{"allow":["is_enabled"],"deny":[]}},"allow-is-focused":{"identifier":"allow-is-focused","description":"Enables the is_focused command without any pre-configured scope.","commands":{"allow":["is_focused"],"deny":[]}},"allow-is-fullscreen":{"identifier":"allow-is-fullscreen","description":"Enables the is_fullscreen command without any pre-configured scope.","commands":{"allow":["is_fullscreen"],"deny":[]}},"allow-is-maximizable":{"identifier":"allow-is-maximizable","description":"Enables the is_maximizable command without any pre-configured scope.","commands":{"allow":["is_maximizable"],"deny":[]}},"allow-is-maximized":{"identifier":"allow-is-maximized","description":"Enables the is_maximized command without any pre-configured scope.","commands":{"allow":["is_maximized"],"deny":[]}},"allow-is-minimizable":{"identifier":"allow-is-minimizable","description":"Enables the is_minimizable command without any pre-configured scope.","commands":{"allow":["is_minimizable"],"deny":[]}},"allow-is-minimized":{"identifier":"allow-is-minimized","description":"Enables the is_minimized command without any pre-configured scope.","commands":{"allow":["is_minimized"],"deny":[]}},"allow-is-resizable":{"identifier":"allow-is-resizable","description":"Enables the is_resizable command without any pre-configured scope.","commands":{"allow":["is_resizable"],"deny":[]}},"allow-is-visible":{"identifier":"allow-is-visible","description":"Enables the is_visible command without any pre-configured scope.","commands":{"allow":["is_visible"],"deny":[]}},"allow-maximize":{"identifier":"allow-maximize","description":"Enables the maximize command without any pre-configured scope.","commands":{"allow":["maximize"],"deny":[]}},"allow-minimize":{"identifier":"allow-minimize","description":"Enables the minimize command without any pre-configured scope.","commands":{"allow":["minimize"],"deny":[]}},"allow-monitor-from-point":{"identifier":"allow-monitor-from-point","description":"Enables the monitor_from_point command without any pre-configured scope.","commands":{"allow":["monitor_from_point"],"deny":[]}},"allow-outer-position":{"identifier":"allow-outer-position","description":"Enables the outer_position command without any pre-configured scope.","commands":{"allow":["outer_position"],"deny":[]}},"allow-outer-size":{"identifier":"allow-outer-size","description":"Enables the outer_size command without any pre-configured scope.","commands":{"allow":["outer_size"],"deny":[]}},"allow-primary-monitor":{"identifier":"allow-primary-monitor","description":"Enables the primary_monitor command without any pre-configured scope.","commands":{"allow":["primary_monitor"],"deny":[]}},"allow-request-user-attention":{"identifier":"allow-request-user-attention","description":"Enables the request_user_attention command without any pre-configured scope.","commands":{"allow":["request_user_attention"],"deny":[]}},"allow-scale-factor":{"identifier":"allow-scale-factor","description":"Enables the scale_factor command without any pre-configured scope.","commands":{"allow":["scale_factor"],"deny":[]}},"allow-scene-identifier":{"identifier":"allow-scene-identifier","description":"Enables the scene_identifier command without any pre-configured scope.","commands":{"allow":["scene_identifier"],"deny":[]}},"allow-set-always-on-bottom":{"identifier":"allow-set-always-on-bottom","description":"Enables the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":["set_always_on_bottom"],"deny":[]}},"allow-set-always-on-top":{"identifier":"allow-set-always-on-top","description":"Enables the set_always_on_top command without any pre-configured scope.","commands":{"allow":["set_always_on_top"],"deny":[]}},"allow-set-background-color":{"identifier":"allow-set-background-color","description":"Enables the set_background_color command without any pre-configured scope.","commands":{"allow":["set_background_color"],"deny":[]}},"allow-set-badge-count":{"identifier":"allow-set-badge-count","description":"Enables the set_badge_count command without any pre-configured scope.","commands":{"allow":["set_badge_count"],"deny":[]}},"allow-set-badge-label":{"identifier":"allow-set-badge-label","description":"Enables the set_badge_label command without any pre-configured scope.","commands":{"allow":["set_badge_label"],"deny":[]}},"allow-set-closable":{"identifier":"allow-set-closable","description":"Enables the set_closable command without any pre-configured scope.","commands":{"allow":["set_closable"],"deny":[]}},"allow-set-content-protected":{"identifier":"allow-set-content-protected","description":"Enables the set_content_protected command without any pre-configured scope.","commands":{"allow":["set_content_protected"],"deny":[]}},"allow-set-cursor-grab":{"identifier":"allow-set-cursor-grab","description":"Enables the set_cursor_grab command without any pre-configured scope.","commands":{"allow":["set_cursor_grab"],"deny":[]}},"allow-set-cursor-icon":{"identifier":"allow-set-cursor-icon","description":"Enables the set_cursor_icon command without any pre-configured scope.","commands":{"allow":["set_cursor_icon"],"deny":[]}},"allow-set-cursor-position":{"identifier":"allow-set-cursor-position","description":"Enables the set_cursor_position command without any pre-configured scope.","commands":{"allow":["set_cursor_position"],"deny":[]}},"allow-set-cursor-visible":{"identifier":"allow-set-cursor-visible","description":"Enables the set_cursor_visible command without any pre-configured scope.","commands":{"allow":["set_cursor_visible"],"deny":[]}},"allow-set-decorations":{"identifier":"allow-set-decorations","description":"Enables the set_decorations command without any pre-configured scope.","commands":{"allow":["set_decorations"],"deny":[]}},"allow-set-effects":{"identifier":"allow-set-effects","description":"Enables the set_effects command without any pre-configured scope.","commands":{"allow":["set_effects"],"deny":[]}},"allow-set-enabled":{"identifier":"allow-set-enabled","description":"Enables the set_enabled command without any pre-configured scope.","commands":{"allow":["set_enabled"],"deny":[]}},"allow-set-focus":{"identifier":"allow-set-focus","description":"Enables the set_focus command without any pre-configured scope.","commands":{"allow":["set_focus"],"deny":[]}},"allow-set-focusable":{"identifier":"allow-set-focusable","description":"Enables the set_focusable command without any pre-configured scope.","commands":{"allow":["set_focusable"],"deny":[]}},"allow-set-fullscreen":{"identifier":"allow-set-fullscreen","description":"Enables the set_fullscreen command without any pre-configured scope.","commands":{"allow":["set_fullscreen"],"deny":[]}},"allow-set-icon":{"identifier":"allow-set-icon","description":"Enables the set_icon command without any pre-configured scope.","commands":{"allow":["set_icon"],"deny":[]}},"allow-set-ignore-cursor-events":{"identifier":"allow-set-ignore-cursor-events","description":"Enables the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":["set_ignore_cursor_events"],"deny":[]}},"allow-set-max-size":{"identifier":"allow-set-max-size","description":"Enables the set_max_size command without any pre-configured scope.","commands":{"allow":["set_max_size"],"deny":[]}},"allow-set-maximizable":{"identifier":"allow-set-maximizable","description":"Enables the set_maximizable command without any pre-configured scope.","commands":{"allow":["set_maximizable"],"deny":[]}},"allow-set-min-size":{"identifier":"allow-set-min-size","description":"Enables the set_min_size command without any pre-configured scope.","commands":{"allow":["set_min_size"],"deny":[]}},"allow-set-minimizable":{"identifier":"allow-set-minimizable","description":"Enables the set_minimizable command without any pre-configured scope.","commands":{"allow":["set_minimizable"],"deny":[]}},"allow-set-overlay-icon":{"identifier":"allow-set-overlay-icon","description":"Enables the set_overlay_icon command without any pre-configured scope.","commands":{"allow":["set_overlay_icon"],"deny":[]}},"allow-set-position":{"identifier":"allow-set-position","description":"Enables the set_position command without any pre-configured scope.","commands":{"allow":["set_position"],"deny":[]}},"allow-set-progress-bar":{"identifier":"allow-set-progress-bar","description":"Enables the set_progress_bar command without any pre-configured scope.","commands":{"allow":["set_progress_bar"],"deny":[]}},"allow-set-resizable":{"identifier":"allow-set-resizable","description":"Enables the set_resizable command without any pre-configured scope.","commands":{"allow":["set_resizable"],"deny":[]}},"allow-set-shadow":{"identifier":"allow-set-shadow","description":"Enables the set_shadow command without any pre-configured scope.","commands":{"allow":["set_shadow"],"deny":[]}},"allow-set-simple-fullscreen":{"identifier":"allow-set-simple-fullscreen","description":"Enables the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":["set_simple_fullscreen"],"deny":[]}},"allow-set-size":{"identifier":"allow-set-size","description":"Enables the set_size command without any pre-configured scope.","commands":{"allow":["set_size"],"deny":[]}},"allow-set-size-constraints":{"identifier":"allow-set-size-constraints","description":"Enables the set_size_constraints command without any pre-configured scope.","commands":{"allow":["set_size_constraints"],"deny":[]}},"allow-set-skip-taskbar":{"identifier":"allow-set-skip-taskbar","description":"Enables the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":["set_skip_taskbar"],"deny":[]}},"allow-set-theme":{"identifier":"allow-set-theme","description":"Enables the set_theme command without any pre-configured scope.","commands":{"allow":["set_theme"],"deny":[]}},"allow-set-title":{"identifier":"allow-set-title","description":"Enables the set_title command without any pre-configured scope.","commands":{"allow":["set_title"],"deny":[]}},"allow-set-title-bar-style":{"identifier":"allow-set-title-bar-style","description":"Enables the set_title_bar_style command without any pre-configured scope.","commands":{"allow":["set_title_bar_style"],"deny":[]}},"allow-set-visible-on-all-workspaces":{"identifier":"allow-set-visible-on-all-workspaces","description":"Enables the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":["set_visible_on_all_workspaces"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"allow-start-dragging":{"identifier":"allow-start-dragging","description":"Enables the start_dragging command without any pre-configured scope.","commands":{"allow":["start_dragging"],"deny":[]}},"allow-start-resize-dragging":{"identifier":"allow-start-resize-dragging","description":"Enables the start_resize_dragging command without any pre-configured scope.","commands":{"allow":["start_resize_dragging"],"deny":[]}},"allow-theme":{"identifier":"allow-theme","description":"Enables the theme command without any pre-configured scope.","commands":{"allow":["theme"],"deny":[]}},"allow-title":{"identifier":"allow-title","description":"Enables the title command without any pre-configured scope.","commands":{"allow":["title"],"deny":[]}},"allow-toggle-maximize":{"identifier":"allow-toggle-maximize","description":"Enables the toggle_maximize command without any pre-configured scope.","commands":{"allow":["toggle_maximize"],"deny":[]}},"allow-unmaximize":{"identifier":"allow-unmaximize","description":"Enables the unmaximize command without any pre-configured scope.","commands":{"allow":["unmaximize"],"deny":[]}},"allow-unminimize":{"identifier":"allow-unminimize","description":"Enables the unminimize command without any pre-configured scope.","commands":{"allow":["unminimize"],"deny":[]}},"deny-activity-name":{"identifier":"deny-activity-name","description":"Denies the activity_name command without any pre-configured scope.","commands":{"allow":[],"deny":["activity_name"]}},"deny-available-monitors":{"identifier":"deny-available-monitors","description":"Denies the available_monitors command without any pre-configured scope.","commands":{"allow":[],"deny":["available_monitors"]}},"deny-center":{"identifier":"deny-center","description":"Denies the center command without any pre-configured scope.","commands":{"allow":[],"deny":["center"]}},"deny-close":{"identifier":"deny-close","description":"Denies the close command without any pre-configured scope.","commands":{"allow":[],"deny":["close"]}},"deny-create":{"identifier":"deny-create","description":"Denies the create command without any pre-configured scope.","commands":{"allow":[],"deny":["create"]}},"deny-current-monitor":{"identifier":"deny-current-monitor","description":"Denies the current_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["current_monitor"]}},"deny-cursor-position":{"identifier":"deny-cursor-position","description":"Denies the cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["cursor_position"]}},"deny-destroy":{"identifier":"deny-destroy","description":"Denies the destroy command without any pre-configured scope.","commands":{"allow":[],"deny":["destroy"]}},"deny-get-all-windows":{"identifier":"deny-get-all-windows","description":"Denies the get_all_windows command without any pre-configured scope.","commands":{"allow":[],"deny":["get_all_windows"]}},"deny-hide":{"identifier":"deny-hide","description":"Denies the hide command without any pre-configured scope.","commands":{"allow":[],"deny":["hide"]}},"deny-inner-position":{"identifier":"deny-inner-position","description":"Denies the inner_position command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_position"]}},"deny-inner-size":{"identifier":"deny-inner-size","description":"Denies the inner_size command without any pre-configured scope.","commands":{"allow":[],"deny":["inner_size"]}},"deny-internal-toggle-maximize":{"identifier":"deny-internal-toggle-maximize","description":"Denies the internal_toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["internal_toggle_maximize"]}},"deny-is-always-on-top":{"identifier":"deny-is-always-on-top","description":"Denies the is_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["is_always_on_top"]}},"deny-is-closable":{"identifier":"deny-is-closable","description":"Denies the is_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_closable"]}},"deny-is-decorated":{"identifier":"deny-is-decorated","description":"Denies the is_decorated command without any pre-configured scope.","commands":{"allow":[],"deny":["is_decorated"]}},"deny-is-enabled":{"identifier":"deny-is-enabled","description":"Denies the is_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["is_enabled"]}},"deny-is-focused":{"identifier":"deny-is-focused","description":"Denies the is_focused command without any pre-configured scope.","commands":{"allow":[],"deny":["is_focused"]}},"deny-is-fullscreen":{"identifier":"deny-is-fullscreen","description":"Denies the is_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["is_fullscreen"]}},"deny-is-maximizable":{"identifier":"deny-is-maximizable","description":"Denies the is_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximizable"]}},"deny-is-maximized":{"identifier":"deny-is-maximized","description":"Denies the is_maximized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_maximized"]}},"deny-is-minimizable":{"identifier":"deny-is-minimizable","description":"Denies the is_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimizable"]}},"deny-is-minimized":{"identifier":"deny-is-minimized","description":"Denies the is_minimized command without any pre-configured scope.","commands":{"allow":[],"deny":["is_minimized"]}},"deny-is-resizable":{"identifier":"deny-is-resizable","description":"Denies the is_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["is_resizable"]}},"deny-is-visible":{"identifier":"deny-is-visible","description":"Denies the is_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["is_visible"]}},"deny-maximize":{"identifier":"deny-maximize","description":"Denies the maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["maximize"]}},"deny-minimize":{"identifier":"deny-minimize","description":"Denies the minimize command without any pre-configured scope.","commands":{"allow":[],"deny":["minimize"]}},"deny-monitor-from-point":{"identifier":"deny-monitor-from-point","description":"Denies the monitor_from_point command without any pre-configured scope.","commands":{"allow":[],"deny":["monitor_from_point"]}},"deny-outer-position":{"identifier":"deny-outer-position","description":"Denies the outer_position command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_position"]}},"deny-outer-size":{"identifier":"deny-outer-size","description":"Denies the outer_size command without any pre-configured scope.","commands":{"allow":[],"deny":["outer_size"]}},"deny-primary-monitor":{"identifier":"deny-primary-monitor","description":"Denies the primary_monitor command without any pre-configured scope.","commands":{"allow":[],"deny":["primary_monitor"]}},"deny-request-user-attention":{"identifier":"deny-request-user-attention","description":"Denies the request_user_attention command without any pre-configured scope.","commands":{"allow":[],"deny":["request_user_attention"]}},"deny-scale-factor":{"identifier":"deny-scale-factor","description":"Denies the scale_factor command without any pre-configured scope.","commands":{"allow":[],"deny":["scale_factor"]}},"deny-scene-identifier":{"identifier":"deny-scene-identifier","description":"Denies the scene_identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["scene_identifier"]}},"deny-set-always-on-bottom":{"identifier":"deny-set-always-on-bottom","description":"Denies the set_always_on_bottom command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_bottom"]}},"deny-set-always-on-top":{"identifier":"deny-set-always-on-top","description":"Denies the set_always_on_top command without any pre-configured scope.","commands":{"allow":[],"deny":["set_always_on_top"]}},"deny-set-background-color":{"identifier":"deny-set-background-color","description":"Denies the set_background_color command without any pre-configured scope.","commands":{"allow":[],"deny":["set_background_color"]}},"deny-set-badge-count":{"identifier":"deny-set-badge-count","description":"Denies the set_badge_count command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_count"]}},"deny-set-badge-label":{"identifier":"deny-set-badge-label","description":"Denies the set_badge_label command without any pre-configured scope.","commands":{"allow":[],"deny":["set_badge_label"]}},"deny-set-closable":{"identifier":"deny-set-closable","description":"Denies the set_closable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_closable"]}},"deny-set-content-protected":{"identifier":"deny-set-content-protected","description":"Denies the set_content_protected command without any pre-configured scope.","commands":{"allow":[],"deny":["set_content_protected"]}},"deny-set-cursor-grab":{"identifier":"deny-set-cursor-grab","description":"Denies the set_cursor_grab command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_grab"]}},"deny-set-cursor-icon":{"identifier":"deny-set-cursor-icon","description":"Denies the set_cursor_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_icon"]}},"deny-set-cursor-position":{"identifier":"deny-set-cursor-position","description":"Denies the set_cursor_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_position"]}},"deny-set-cursor-visible":{"identifier":"deny-set-cursor-visible","description":"Denies the set_cursor_visible command without any pre-configured scope.","commands":{"allow":[],"deny":["set_cursor_visible"]}},"deny-set-decorations":{"identifier":"deny-set-decorations","description":"Denies the set_decorations command without any pre-configured scope.","commands":{"allow":[],"deny":["set_decorations"]}},"deny-set-effects":{"identifier":"deny-set-effects","description":"Denies the set_effects command without any pre-configured scope.","commands":{"allow":[],"deny":["set_effects"]}},"deny-set-enabled":{"identifier":"deny-set-enabled","description":"Denies the set_enabled command without any pre-configured scope.","commands":{"allow":[],"deny":["set_enabled"]}},"deny-set-focus":{"identifier":"deny-set-focus","description":"Denies the set_focus command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focus"]}},"deny-set-focusable":{"identifier":"deny-set-focusable","description":"Denies the set_focusable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_focusable"]}},"deny-set-fullscreen":{"identifier":"deny-set-fullscreen","description":"Denies the set_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_fullscreen"]}},"deny-set-icon":{"identifier":"deny-set-icon","description":"Denies the set_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_icon"]}},"deny-set-ignore-cursor-events":{"identifier":"deny-set-ignore-cursor-events","description":"Denies the set_ignore_cursor_events command without any pre-configured scope.","commands":{"allow":[],"deny":["set_ignore_cursor_events"]}},"deny-set-max-size":{"identifier":"deny-set-max-size","description":"Denies the set_max_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_max_size"]}},"deny-set-maximizable":{"identifier":"deny-set-maximizable","description":"Denies the set_maximizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_maximizable"]}},"deny-set-min-size":{"identifier":"deny-set-min-size","description":"Denies the set_min_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_min_size"]}},"deny-set-minimizable":{"identifier":"deny-set-minimizable","description":"Denies the set_minimizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_minimizable"]}},"deny-set-overlay-icon":{"identifier":"deny-set-overlay-icon","description":"Denies the set_overlay_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["set_overlay_icon"]}},"deny-set-position":{"identifier":"deny-set-position","description":"Denies the set_position command without any pre-configured scope.","commands":{"allow":[],"deny":["set_position"]}},"deny-set-progress-bar":{"identifier":"deny-set-progress-bar","description":"Denies the set_progress_bar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_progress_bar"]}},"deny-set-resizable":{"identifier":"deny-set-resizable","description":"Denies the set_resizable command without any pre-configured scope.","commands":{"allow":[],"deny":["set_resizable"]}},"deny-set-shadow":{"identifier":"deny-set-shadow","description":"Denies the set_shadow command without any pre-configured scope.","commands":{"allow":[],"deny":["set_shadow"]}},"deny-set-simple-fullscreen":{"identifier":"deny-set-simple-fullscreen","description":"Denies the set_simple_fullscreen command without any pre-configured scope.","commands":{"allow":[],"deny":["set_simple_fullscreen"]}},"deny-set-size":{"identifier":"deny-set-size","description":"Denies the set_size command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size"]}},"deny-set-size-constraints":{"identifier":"deny-set-size-constraints","description":"Denies the set_size_constraints command without any pre-configured scope.","commands":{"allow":[],"deny":["set_size_constraints"]}},"deny-set-skip-taskbar":{"identifier":"deny-set-skip-taskbar","description":"Denies the set_skip_taskbar command without any pre-configured scope.","commands":{"allow":[],"deny":["set_skip_taskbar"]}},"deny-set-theme":{"identifier":"deny-set-theme","description":"Denies the set_theme command without any pre-configured scope.","commands":{"allow":[],"deny":["set_theme"]}},"deny-set-title":{"identifier":"deny-set-title","description":"Denies the set_title command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title"]}},"deny-set-title-bar-style":{"identifier":"deny-set-title-bar-style","description":"Denies the set_title_bar_style command without any pre-configured scope.","commands":{"allow":[],"deny":["set_title_bar_style"]}},"deny-set-visible-on-all-workspaces":{"identifier":"deny-set-visible-on-all-workspaces","description":"Denies the set_visible_on_all_workspaces command without any pre-configured scope.","commands":{"allow":[],"deny":["set_visible_on_all_workspaces"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}},"deny-start-dragging":{"identifier":"deny-start-dragging","description":"Denies the start_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_dragging"]}},"deny-start-resize-dragging":{"identifier":"deny-start-resize-dragging","description":"Denies the start_resize_dragging command without any pre-configured scope.","commands":{"allow":[],"deny":["start_resize_dragging"]}},"deny-theme":{"identifier":"deny-theme","description":"Denies the theme command without any pre-configured scope.","commands":{"allow":[],"deny":["theme"]}},"deny-title":{"identifier":"deny-title","description":"Denies the title command without any pre-configured scope.","commands":{"allow":[],"deny":["title"]}},"deny-toggle-maximize":{"identifier":"deny-toggle-maximize","description":"Denies the toggle_maximize command without any pre-configured scope.","commands":{"allow":[],"deny":["toggle_maximize"]}},"deny-unmaximize":{"identifier":"deny-unmaximize","description":"Denies the unmaximize command without any pre-configured scope.","commands":{"allow":[],"deny":["unmaximize"]}},"deny-unminimize":{"identifier":"deny-unminimize","description":"Denies the unminimize command without any pre-configured scope.","commands":{"allow":[],"deny":["unminimize"]}}},"permission_sets":{},"global_scope_schema":null},"notification":{"default_permission":{"identifier":"default","description":"This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n","permissions":["allow-is-permission-granted","allow-request-permission","allow-notify","allow-register-action-types","allow-register-listener","allow-cancel","allow-get-pending","allow-remove-active","allow-get-active","allow-check-permissions","allow-show","allow-batch","allow-list-channels","allow-delete-channel","allow-create-channel","allow-permission-state"]},"permissions":{"allow-batch":{"identifier":"allow-batch","description":"Enables the batch command without any pre-configured scope.","commands":{"allow":["batch"],"deny":[]}},"allow-cancel":{"identifier":"allow-cancel","description":"Enables the cancel command without any pre-configured scope.","commands":{"allow":["cancel"],"deny":[]}},"allow-check-permissions":{"identifier":"allow-check-permissions","description":"Enables the check_permissions command without any pre-configured scope.","commands":{"allow":["check_permissions"],"deny":[]}},"allow-create-channel":{"identifier":"allow-create-channel","description":"Enables the create_channel command without any pre-configured scope.","commands":{"allow":["create_channel"],"deny":[]}},"allow-delete-channel":{"identifier":"allow-delete-channel","description":"Enables the delete_channel command without any pre-configured scope.","commands":{"allow":["delete_channel"],"deny":[]}},"allow-get-active":{"identifier":"allow-get-active","description":"Enables the get_active command without any pre-configured scope.","commands":{"allow":["get_active"],"deny":[]}},"allow-get-pending":{"identifier":"allow-get-pending","description":"Enables the get_pending command without any pre-configured scope.","commands":{"allow":["get_pending"],"deny":[]}},"allow-is-permission-granted":{"identifier":"allow-is-permission-granted","description":"Enables the is_permission_granted command without any pre-configured scope.","commands":{"allow":["is_permission_granted"],"deny":[]}},"allow-list-channels":{"identifier":"allow-list-channels","description":"Enables the list_channels command without any pre-configured scope.","commands":{"allow":["list_channels"],"deny":[]}},"allow-notify":{"identifier":"allow-notify","description":"Enables the notify command without any pre-configured scope.","commands":{"allow":["notify"],"deny":[]}},"allow-permission-state":{"identifier":"allow-permission-state","description":"Enables the permission_state command without any pre-configured scope.","commands":{"allow":["permission_state"],"deny":[]}},"allow-register-action-types":{"identifier":"allow-register-action-types","description":"Enables the register_action_types command without any pre-configured scope.","commands":{"allow":["register_action_types"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-active":{"identifier":"allow-remove-active","description":"Enables the remove_active command without any pre-configured scope.","commands":{"allow":["remove_active"],"deny":[]}},"allow-request-permission":{"identifier":"allow-request-permission","description":"Enables the request_permission command without any pre-configured scope.","commands":{"allow":["request_permission"],"deny":[]}},"allow-show":{"identifier":"allow-show","description":"Enables the show command without any pre-configured scope.","commands":{"allow":["show"],"deny":[]}},"deny-batch":{"identifier":"deny-batch","description":"Denies the batch command without any pre-configured scope.","commands":{"allow":[],"deny":["batch"]}},"deny-cancel":{"identifier":"deny-cancel","description":"Denies the cancel command without any pre-configured scope.","commands":{"allow":[],"deny":["cancel"]}},"deny-check-permissions":{"identifier":"deny-check-permissions","description":"Denies the check_permissions command without any pre-configured scope.","commands":{"allow":[],"deny":["check_permissions"]}},"deny-create-channel":{"identifier":"deny-create-channel","description":"Denies the create_channel command without any pre-configured scope.","commands":{"allow":[],"deny":["create_channel"]}},"deny-delete-channel":{"identifier":"deny-delete-channel","description":"Denies the delete_channel command without any pre-configured scope.","commands":{"allow":[],"deny":["delete_channel"]}},"deny-get-active":{"identifier":"deny-get-active","description":"Denies the get_active command without any pre-configured scope.","commands":{"allow":[],"deny":["get_active"]}},"deny-get-pending":{"identifier":"deny-get-pending","description":"Denies the get_pending command without any pre-configured scope.","commands":{"allow":[],"deny":["get_pending"]}},"deny-is-permission-granted":{"identifier":"deny-is-permission-granted","description":"Denies the is_permission_granted command without any pre-configured scope.","commands":{"allow":[],"deny":["is_permission_granted"]}},"deny-list-channels":{"identifier":"deny-list-channels","description":"Denies the list_channels command without any pre-configured scope.","commands":{"allow":[],"deny":["list_channels"]}},"deny-notify":{"identifier":"deny-notify","description":"Denies the notify command without any pre-configured scope.","commands":{"allow":[],"deny":["notify"]}},"deny-permission-state":{"identifier":"deny-permission-state","description":"Denies the permission_state command without any pre-configured scope.","commands":{"allow":[],"deny":["permission_state"]}},"deny-register-action-types":{"identifier":"deny-register-action-types","description":"Denies the register_action_types command without any pre-configured scope.","commands":{"allow":[],"deny":["register_action_types"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-active":{"identifier":"deny-remove-active","description":"Denies the remove_active command without any pre-configured scope.","commands":{"allow":[],"deny":["remove_active"]}},"deny-request-permission":{"identifier":"deny-request-permission","description":"Denies the request_permission command without any pre-configured scope.","commands":{"allow":[],"deny":["request_permission"]}},"deny-show":{"identifier":"deny-show","description":"Denies the show command without any pre-configured scope.","commands":{"allow":[],"deny":["show"]}}},"permission_sets":{},"global_scope_schema":null},"shell":{"default_permission":{"identifier":"default","description":"This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n","permissions":["allow-open"]},"permissions":{"allow-execute":{"identifier":"allow-execute","description":"Enables the execute command without any pre-configured scope.","commands":{"allow":["execute"],"deny":[]}},"allow-kill":{"identifier":"allow-kill","description":"Enables the kill command without any pre-configured scope.","commands":{"allow":["kill"],"deny":[]}},"allow-open":{"identifier":"allow-open","description":"Enables the open command without any pre-configured scope.","commands":{"allow":["open"],"deny":[]}},"allow-spawn":{"identifier":"allow-spawn","description":"Enables the spawn command without any pre-configured scope.","commands":{"allow":["spawn"],"deny":[]}},"allow-stdin-write":{"identifier":"allow-stdin-write","description":"Enables the stdin_write command without any pre-configured scope.","commands":{"allow":["stdin_write"],"deny":[]}},"deny-execute":{"identifier":"deny-execute","description":"Denies the execute command without any pre-configured scope.","commands":{"allow":[],"deny":["execute"]}},"deny-kill":{"identifier":"deny-kill","description":"Denies the kill command without any pre-configured scope.","commands":{"allow":[],"deny":["kill"]}},"deny-open":{"identifier":"deny-open","description":"Denies the open command without any pre-configured scope.","commands":{"allow":[],"deny":["open"]}},"deny-spawn":{"identifier":"deny-spawn","description":"Denies the spawn command without any pre-configured scope.","commands":{"allow":[],"deny":["spawn"]}},"deny-stdin-write":{"identifier":"deny-stdin-write","description":"Denies the stdin_write command without any pre-configured scope.","commands":{"allow":[],"deny":["stdin_write"]}}},"permission_sets":{},"global_scope_schema":{"$schema":"http://json-schema.org/draft-07/schema#","anyOf":[{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"cmd":{"description":"The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.","type":"string"},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"}},"required":["cmd","name"],"type":"object"},{"additionalProperties":false,"properties":{"args":{"allOf":[{"$ref":"#/definitions/ShellScopeEntryAllowedArgs"}],"description":"The allowed arguments for the command execution."},"name":{"description":"The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.","type":"string"},"sidecar":{"description":"If this command is a sidecar command.","type":"boolean"}},"required":["name","sidecar"],"type":"object"}],"definitions":{"ShellScopeEntryAllowedArg":{"anyOf":[{"description":"A non-configurable argument that is passed to the command in the order it was specified.","type":"string"},{"additionalProperties":false,"description":"A variable that is set while calling the command from the webview API.","properties":{"raw":{"default":false,"description":"Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.","type":"boolean"},"validator":{"description":"[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ","type":"string"}},"required":["validator"],"type":"object"}],"description":"A command argument allowed to be executed by the webview API."},"ShellScopeEntryAllowedArgs":{"anyOf":[{"description":"Use a simple boolean to allow all or disable all arguments to this command configuration.","type":"boolean"},{"description":"A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.","items":{"$ref":"#/definitions/ShellScopeEntryAllowedArg"},"type":"array"}],"description":"A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration."}},"description":"Shell scope entry.","title":"ShellScopeEntry"}}} \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/gen/schemas/capabilities.json b/packages/dcp-desktop/src-tauri/gen/schemas/capabilities.json deleted file mode 100644 index 3abab4c..0000000 --- a/packages/dcp-desktop/src-tauri/gen/schemas/capabilities.json +++ /dev/null @@ -1 +0,0 @@ -{"default":{"identifier":"default","description":"Default capability for DCP","local":true,"windows":["main"],"permissions":["core:default","notification:default","autostart:default","shell:default",{"identifier":"shell:allow-open","allow":[{"url":"https://*"},{"url":"http://*"},{"url":"cursor://*"},{"url":"vscode://*"},{"url":"vscode:*"}]}]}} \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/gen/schemas/desktop-schema.json b/packages/dcp-desktop/src-tauri/gen/schemas/desktop-schema.json deleted file mode 100644 index ff1e793..0000000 --- a/packages/dcp-desktop/src-tauri/gen/schemas/desktop-schema.json +++ /dev/null @@ -1,2852 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CapabilityFile", - "description": "Capability formats accepted in a capability file.", - "anyOf": [ - { - "description": "A single capability.", - "allOf": [ - { - "$ref": "#/definitions/Capability" - } - ] - }, - { - "description": "A list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - }, - { - "description": "A list of capabilities.", - "type": "object", - "required": [ - "capabilities" - ], - "properties": { - "capabilities": { - "description": "The list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - } - } - } - ], - "definitions": { - "Capability": { - "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```", - "type": "object", - "required": [ - "identifier", - "permissions" - ], - "properties": { - "identifier": { - "description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`", - "type": "string" - }, - "description": { - "description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.", - "default": "", - "type": "string" - }, - "remote": { - "description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```", - "anyOf": [ - { - "$ref": "#/definitions/CapabilityRemote" - }, - { - "type": "null" - } - ] - }, - "local": { - "description": "Whether this capability is enabled for local app URLs or not. Defaults to `true`.", - "default": true, - "type": "boolean" - }, - "windows": { - "description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nIf a window label matches any of the patterns in this list, the capability will be enabled on all the webviews of that window, regardless of the value of [`Self::webviews`].\n\nOn multiwebview windows, prefer specifying [`Self::webviews`] and omitting [`Self::windows`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "webviews": { - "description": "List of webviews that are affected by this capability. Can be a glob pattern.\n\nThe capability will be enabled on all the webviews whose label matches any of the patterns in this list, regardless of whether the webview's window label matches a pattern in [`Self::windows`].\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "permissions": { - "description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"core:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ] ```", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionEntry" - }, - "uniqueItems": true - }, - "platforms": { - "description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Target" - } - } - } - }, - "CapabilityRemote": { - "description": "Configuration for remote URLs that are associated with the capability.", - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "PermissionEntry": { - "description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.", - "anyOf": [ - { - "description": "Reference a permission or permission set by identifier.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - { - "description": "Reference a permission or permission set by identifier and extends its scope.", - "type": "object", - "allOf": [ - { - "if": { - "properties": { - "identifier": { - "anyOf": [ - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - } - } - }, - "then": { - "properties": { - "allow": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - }, - "deny": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - } - } - }, - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - } - } - }, - { - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - "allow": { - "description": "Data that defines what is allowed by the scope.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - }, - "deny": { - "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - } - } - } - ], - "required": [ - "identifier" - ] - } - ] - }, - "Identifier": { - "description": "Permission identifier", - "oneOf": [ - { - "description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`", - "type": "string", - "const": "autostart:default", - "markdownDescription": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`" - }, - { - "description": "Enables the disable command without any pre-configured scope.", - "type": "string", - "const": "autostart:allow-disable", - "markdownDescription": "Enables the disable command without any pre-configured scope." - }, - { - "description": "Enables the enable command without any pre-configured scope.", - "type": "string", - "const": "autostart:allow-enable", - "markdownDescription": "Enables the enable command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "autostart:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the disable command without any pre-configured scope.", - "type": "string", - "const": "autostart:deny-disable", - "markdownDescription": "Denies the disable command without any pre-configured scope." - }, - { - "description": "Denies the enable command without any pre-configured scope.", - "type": "string", - "const": "autostart:deny-enable", - "markdownDescription": "Denies the enable command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "autostart:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`", - "type": "string", - "const": "core:default", - "markdownDescription": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`" - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`", - "type": "string", - "const": "core:app:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`" - }, - { - "description": "Enables the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-hide", - "markdownDescription": "Enables the app_hide command without any pre-configured scope." - }, - { - "description": "Enables the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-show", - "markdownDescription": "Enables the app_show command without any pre-configured scope." - }, - { - "description": "Enables the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-bundle-type", - "markdownDescription": "Enables the bundle_type command without any pre-configured scope." - }, - { - "description": "Enables the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-default-window-icon", - "markdownDescription": "Enables the default_window_icon command without any pre-configured scope." - }, - { - "description": "Enables the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-fetch-data-store-identifiers", - "markdownDescription": "Enables the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Enables the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-identifier", - "markdownDescription": "Enables the identifier command without any pre-configured scope." - }, - { - "description": "Enables the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-name", - "markdownDescription": "Enables the name command without any pre-configured scope." - }, - { - "description": "Enables the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-register-listener", - "markdownDescription": "Enables the register_listener command without any pre-configured scope." - }, - { - "description": "Enables the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-data-store", - "markdownDescription": "Enables the remove_data_store command without any pre-configured scope." - }, - { - "description": "Enables the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-listener", - "markdownDescription": "Enables the remove_listener command without any pre-configured scope." - }, - { - "description": "Enables the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-app-theme", - "markdownDescription": "Enables the set_app_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-dock-visibility", - "markdownDescription": "Enables the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Enables the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-supports-multiple-windows", - "markdownDescription": "Enables the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Enables the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-tauri-version", - "markdownDescription": "Enables the tauri_version command without any pre-configured scope." - }, - { - "description": "Enables the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-version", - "markdownDescription": "Enables the version command without any pre-configured scope." - }, - { - "description": "Denies the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-hide", - "markdownDescription": "Denies the app_hide command without any pre-configured scope." - }, - { - "description": "Denies the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-show", - "markdownDescription": "Denies the app_show command without any pre-configured scope." - }, - { - "description": "Denies the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-bundle-type", - "markdownDescription": "Denies the bundle_type command without any pre-configured scope." - }, - { - "description": "Denies the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-default-window-icon", - "markdownDescription": "Denies the default_window_icon command without any pre-configured scope." - }, - { - "description": "Denies the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-fetch-data-store-identifiers", - "markdownDescription": "Denies the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Denies the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-identifier", - "markdownDescription": "Denies the identifier command without any pre-configured scope." - }, - { - "description": "Denies the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-name", - "markdownDescription": "Denies the name command without any pre-configured scope." - }, - { - "description": "Denies the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-register-listener", - "markdownDescription": "Denies the register_listener command without any pre-configured scope." - }, - { - "description": "Denies the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-data-store", - "markdownDescription": "Denies the remove_data_store command without any pre-configured scope." - }, - { - "description": "Denies the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-listener", - "markdownDescription": "Denies the remove_listener command without any pre-configured scope." - }, - { - "description": "Denies the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-app-theme", - "markdownDescription": "Denies the set_app_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-dock-visibility", - "markdownDescription": "Denies the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Denies the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-supports-multiple-windows", - "markdownDescription": "Denies the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Denies the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-tauri-version", - "markdownDescription": "Denies the tauri_version command without any pre-configured scope." - }, - { - "description": "Denies the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-version", - "markdownDescription": "Denies the version command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`", - "type": "string", - "const": "core:event:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`" - }, - { - "description": "Enables the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit", - "markdownDescription": "Enables the emit command without any pre-configured scope." - }, - { - "description": "Enables the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit-to", - "markdownDescription": "Enables the emit_to command without any pre-configured scope." - }, - { - "description": "Enables the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-listen", - "markdownDescription": "Enables the listen command without any pre-configured scope." - }, - { - "description": "Enables the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-unlisten", - "markdownDescription": "Enables the unlisten command without any pre-configured scope." - }, - { - "description": "Denies the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit", - "markdownDescription": "Denies the emit command without any pre-configured scope." - }, - { - "description": "Denies the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit-to", - "markdownDescription": "Denies the emit_to command without any pre-configured scope." - }, - { - "description": "Denies the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-listen", - "markdownDescription": "Denies the listen command without any pre-configured scope." - }, - { - "description": "Denies the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-unlisten", - "markdownDescription": "Denies the unlisten command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`", - "type": "string", - "const": "core:image:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`" - }, - { - "description": "Enables the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-bytes", - "markdownDescription": "Enables the from_bytes command without any pre-configured scope." - }, - { - "description": "Enables the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-path", - "markdownDescription": "Enables the from_path command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-rgba", - "markdownDescription": "Enables the rgba command without any pre-configured scope." - }, - { - "description": "Enables the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-size", - "markdownDescription": "Enables the size command without any pre-configured scope." - }, - { - "description": "Denies the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-bytes", - "markdownDescription": "Denies the from_bytes command without any pre-configured scope." - }, - { - "description": "Denies the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-path", - "markdownDescription": "Denies the from_path command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-rgba", - "markdownDescription": "Denies the rgba command without any pre-configured scope." - }, - { - "description": "Denies the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-size", - "markdownDescription": "Denies the size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`", - "type": "string", - "const": "core:menu:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`" - }, - { - "description": "Enables the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-append", - "markdownDescription": "Enables the append command without any pre-configured scope." - }, - { - "description": "Enables the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-create-default", - "markdownDescription": "Enables the create_default command without any pre-configured scope." - }, - { - "description": "Enables the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-get", - "markdownDescription": "Enables the get command without any pre-configured scope." - }, - { - "description": "Enables the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-insert", - "markdownDescription": "Enables the insert command without any pre-configured scope." - }, - { - "description": "Enables the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-checked", - "markdownDescription": "Enables the is_checked command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-items", - "markdownDescription": "Enables the items command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-popup", - "markdownDescription": "Enables the popup command without any pre-configured scope." - }, - { - "description": "Enables the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-prepend", - "markdownDescription": "Enables the prepend command without any pre-configured scope." - }, - { - "description": "Enables the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove", - "markdownDescription": "Enables the remove command without any pre-configured scope." - }, - { - "description": "Enables the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove-at", - "markdownDescription": "Enables the remove_at command without any pre-configured scope." - }, - { - "description": "Enables the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-accelerator", - "markdownDescription": "Enables the set_accelerator command without any pre-configured scope." - }, - { - "description": "Enables the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-app-menu", - "markdownDescription": "Enables the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-help-menu-for-nsapp", - "markdownDescription": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-window-menu", - "markdownDescription": "Enables the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-windows-menu-for-nsapp", - "markdownDescription": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-checked", - "markdownDescription": "Enables the set_checked command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-text", - "markdownDescription": "Enables the set_text command without any pre-configured scope." - }, - { - "description": "Enables the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-text", - "markdownDescription": "Enables the text command without any pre-configured scope." - }, - { - "description": "Denies the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-append", - "markdownDescription": "Denies the append command without any pre-configured scope." - }, - { - "description": "Denies the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-create-default", - "markdownDescription": "Denies the create_default command without any pre-configured scope." - }, - { - "description": "Denies the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-get", - "markdownDescription": "Denies the get command without any pre-configured scope." - }, - { - "description": "Denies the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-insert", - "markdownDescription": "Denies the insert command without any pre-configured scope." - }, - { - "description": "Denies the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-checked", - "markdownDescription": "Denies the is_checked command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-items", - "markdownDescription": "Denies the items command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-popup", - "markdownDescription": "Denies the popup command without any pre-configured scope." - }, - { - "description": "Denies the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-prepend", - "markdownDescription": "Denies the prepend command without any pre-configured scope." - }, - { - "description": "Denies the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove", - "markdownDescription": "Denies the remove command without any pre-configured scope." - }, - { - "description": "Denies the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove-at", - "markdownDescription": "Denies the remove_at command without any pre-configured scope." - }, - { - "description": "Denies the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-accelerator", - "markdownDescription": "Denies the set_accelerator command without any pre-configured scope." - }, - { - "description": "Denies the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-app-menu", - "markdownDescription": "Denies the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-help-menu-for-nsapp", - "markdownDescription": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-window-menu", - "markdownDescription": "Denies the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-windows-menu-for-nsapp", - "markdownDescription": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-checked", - "markdownDescription": "Denies the set_checked command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-text", - "markdownDescription": "Denies the set_text command without any pre-configured scope." - }, - { - "description": "Denies the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-text", - "markdownDescription": "Denies the text command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`", - "type": "string", - "const": "core:path:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`" - }, - { - "description": "Enables the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-basename", - "markdownDescription": "Enables the basename command without any pre-configured scope." - }, - { - "description": "Enables the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-dirname", - "markdownDescription": "Enables the dirname command without any pre-configured scope." - }, - { - "description": "Enables the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-extname", - "markdownDescription": "Enables the extname command without any pre-configured scope." - }, - { - "description": "Enables the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-is-absolute", - "markdownDescription": "Enables the is_absolute command without any pre-configured scope." - }, - { - "description": "Enables the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-join", - "markdownDescription": "Enables the join command without any pre-configured scope." - }, - { - "description": "Enables the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-normalize", - "markdownDescription": "Enables the normalize command without any pre-configured scope." - }, - { - "description": "Enables the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve", - "markdownDescription": "Enables the resolve command without any pre-configured scope." - }, - { - "description": "Enables the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve-directory", - "markdownDescription": "Enables the resolve_directory command without any pre-configured scope." - }, - { - "description": "Denies the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-basename", - "markdownDescription": "Denies the basename command without any pre-configured scope." - }, - { - "description": "Denies the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-dirname", - "markdownDescription": "Denies the dirname command without any pre-configured scope." - }, - { - "description": "Denies the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-extname", - "markdownDescription": "Denies the extname command without any pre-configured scope." - }, - { - "description": "Denies the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-is-absolute", - "markdownDescription": "Denies the is_absolute command without any pre-configured scope." - }, - { - "description": "Denies the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-join", - "markdownDescription": "Denies the join command without any pre-configured scope." - }, - { - "description": "Denies the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-normalize", - "markdownDescription": "Denies the normalize command without any pre-configured scope." - }, - { - "description": "Denies the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve", - "markdownDescription": "Denies the resolve command without any pre-configured scope." - }, - { - "description": "Denies the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve-directory", - "markdownDescription": "Denies the resolve_directory command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`", - "type": "string", - "const": "core:resources:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`" - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`", - "type": "string", - "const": "core:tray:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`" - }, - { - "description": "Enables the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-get-by-id", - "markdownDescription": "Enables the get_by_id command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-remove-by-id", - "markdownDescription": "Enables the remove_by_id command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-as-template", - "markdownDescription": "Enables the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-with-as-template", - "markdownDescription": "Enables the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-menu", - "markdownDescription": "Enables the set_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-show-menu-on-left-click", - "markdownDescription": "Enables the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Enables the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-temp-dir-path", - "markdownDescription": "Enables the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-tooltip", - "markdownDescription": "Enables the set_tooltip command without any pre-configured scope." - }, - { - "description": "Enables the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-visible", - "markdownDescription": "Enables the set_visible command without any pre-configured scope." - }, - { - "description": "Denies the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-get-by-id", - "markdownDescription": "Denies the get_by_id command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-remove-by-id", - "markdownDescription": "Denies the remove_by_id command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-as-template", - "markdownDescription": "Denies the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-with-as-template", - "markdownDescription": "Denies the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-menu", - "markdownDescription": "Denies the set_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-show-menu-on-left-click", - "markdownDescription": "Denies the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Denies the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-temp-dir-path", - "markdownDescription": "Denies the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-tooltip", - "markdownDescription": "Denies the set_tooltip command without any pre-configured scope." - }, - { - "description": "Denies the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-visible", - "markdownDescription": "Denies the set_visible command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`", - "type": "string", - "const": "core:webview:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`" - }, - { - "description": "Enables the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-clear-all-browsing-data", - "markdownDescription": "Enables the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Enables the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview", - "markdownDescription": "Enables the create_webview command without any pre-configured scope." - }, - { - "description": "Enables the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview-window", - "markdownDescription": "Enables the create_webview_window command without any pre-configured scope." - }, - { - "description": "Enables the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-get-all-webviews", - "markdownDescription": "Enables the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-internal-toggle-devtools", - "markdownDescription": "Enables the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Enables the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-print", - "markdownDescription": "Enables the print command without any pre-configured scope." - }, - { - "description": "Enables the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-reparent", - "markdownDescription": "Enables the reparent command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-auto-resize", - "markdownDescription": "Enables the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-background-color", - "markdownDescription": "Enables the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-focus", - "markdownDescription": "Enables the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-position", - "markdownDescription": "Enables the set_webview_position command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-size", - "markdownDescription": "Enables the set_webview_size command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-zoom", - "markdownDescription": "Enables the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Enables the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-close", - "markdownDescription": "Enables the webview_close command without any pre-configured scope." - }, - { - "description": "Enables the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-hide", - "markdownDescription": "Enables the webview_hide command without any pre-configured scope." - }, - { - "description": "Enables the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-position", - "markdownDescription": "Enables the webview_position command without any pre-configured scope." - }, - { - "description": "Enables the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-show", - "markdownDescription": "Enables the webview_show command without any pre-configured scope." - }, - { - "description": "Enables the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-size", - "markdownDescription": "Enables the webview_size command without any pre-configured scope." - }, - { - "description": "Denies the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-clear-all-browsing-data", - "markdownDescription": "Denies the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Denies the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview", - "markdownDescription": "Denies the create_webview command without any pre-configured scope." - }, - { - "description": "Denies the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview-window", - "markdownDescription": "Denies the create_webview_window command without any pre-configured scope." - }, - { - "description": "Denies the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-get-all-webviews", - "markdownDescription": "Denies the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-internal-toggle-devtools", - "markdownDescription": "Denies the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Denies the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-print", - "markdownDescription": "Denies the print command without any pre-configured scope." - }, - { - "description": "Denies the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-reparent", - "markdownDescription": "Denies the reparent command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-auto-resize", - "markdownDescription": "Denies the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-background-color", - "markdownDescription": "Denies the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-focus", - "markdownDescription": "Denies the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-position", - "markdownDescription": "Denies the set_webview_position command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-size", - "markdownDescription": "Denies the set_webview_size command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-zoom", - "markdownDescription": "Denies the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Denies the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-close", - "markdownDescription": "Denies the webview_close command without any pre-configured scope." - }, - { - "description": "Denies the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-hide", - "markdownDescription": "Denies the webview_hide command without any pre-configured scope." - }, - { - "description": "Denies the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-position", - "markdownDescription": "Denies the webview_position command without any pre-configured scope." - }, - { - "description": "Denies the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-show", - "markdownDescription": "Denies the webview_show command without any pre-configured scope." - }, - { - "description": "Denies the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-size", - "markdownDescription": "Denies the webview_size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`", - "type": "string", - "const": "core:window:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`" - }, - { - "description": "Enables the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-activity-name", - "markdownDescription": "Enables the activity_name command without any pre-configured scope." - }, - { - "description": "Enables the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-available-monitors", - "markdownDescription": "Enables the available_monitors command without any pre-configured scope." - }, - { - "description": "Enables the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-center", - "markdownDescription": "Enables the center command without any pre-configured scope." - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Enables the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-create", - "markdownDescription": "Enables the create command without any pre-configured scope." - }, - { - "description": "Enables the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-current-monitor", - "markdownDescription": "Enables the current_monitor command without any pre-configured scope." - }, - { - "description": "Enables the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-cursor-position", - "markdownDescription": "Enables the cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-destroy", - "markdownDescription": "Enables the destroy command without any pre-configured scope." - }, - { - "description": "Enables the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-get-all-windows", - "markdownDescription": "Enables the get_all_windows command without any pre-configured scope." - }, - { - "description": "Enables the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-hide", - "markdownDescription": "Enables the hide command without any pre-configured scope." - }, - { - "description": "Enables the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-position", - "markdownDescription": "Enables the inner_position command without any pre-configured scope." - }, - { - "description": "Enables the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-size", - "markdownDescription": "Enables the inner_size command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-internal-toggle-maximize", - "markdownDescription": "Enables the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-always-on-top", - "markdownDescription": "Enables the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-closable", - "markdownDescription": "Enables the is_closable command without any pre-configured scope." - }, - { - "description": "Enables the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-decorated", - "markdownDescription": "Enables the is_decorated command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-focused", - "markdownDescription": "Enables the is_focused command without any pre-configured scope." - }, - { - "description": "Enables the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-fullscreen", - "markdownDescription": "Enables the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximizable", - "markdownDescription": "Enables the is_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximized", - "markdownDescription": "Enables the is_maximized command without any pre-configured scope." - }, - { - "description": "Enables the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimizable", - "markdownDescription": "Enables the is_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimized", - "markdownDescription": "Enables the is_minimized command without any pre-configured scope." - }, - { - "description": "Enables the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-resizable", - "markdownDescription": "Enables the is_resizable command without any pre-configured scope." - }, - { - "description": "Enables the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-visible", - "markdownDescription": "Enables the is_visible command without any pre-configured scope." - }, - { - "description": "Enables the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-maximize", - "markdownDescription": "Enables the maximize command without any pre-configured scope." - }, - { - "description": "Enables the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-minimize", - "markdownDescription": "Enables the minimize command without any pre-configured scope." - }, - { - "description": "Enables the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-monitor-from-point", - "markdownDescription": "Enables the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Enables the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-position", - "markdownDescription": "Enables the outer_position command without any pre-configured scope." - }, - { - "description": "Enables the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-size", - "markdownDescription": "Enables the outer_size command without any pre-configured scope." - }, - { - "description": "Enables the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-primary-monitor", - "markdownDescription": "Enables the primary_monitor command without any pre-configured scope." - }, - { - "description": "Enables the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-request-user-attention", - "markdownDescription": "Enables the request_user_attention command without any pre-configured scope." - }, - { - "description": "Enables the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scale-factor", - "markdownDescription": "Enables the scale_factor command without any pre-configured scope." - }, - { - "description": "Enables the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scene-identifier", - "markdownDescription": "Enables the scene_identifier command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-bottom", - "markdownDescription": "Enables the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-top", - "markdownDescription": "Enables the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-background-color", - "markdownDescription": "Enables the set_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-count", - "markdownDescription": "Enables the set_badge_count command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-label", - "markdownDescription": "Enables the set_badge_label command without any pre-configured scope." - }, - { - "description": "Enables the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-closable", - "markdownDescription": "Enables the set_closable command without any pre-configured scope." - }, - { - "description": "Enables the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-content-protected", - "markdownDescription": "Enables the set_content_protected command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-grab", - "markdownDescription": "Enables the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-icon", - "markdownDescription": "Enables the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-position", - "markdownDescription": "Enables the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-visible", - "markdownDescription": "Enables the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Enables the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-decorations", - "markdownDescription": "Enables the set_decorations command without any pre-configured scope." - }, - { - "description": "Enables the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-effects", - "markdownDescription": "Enables the set_effects command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focus", - "markdownDescription": "Enables the set_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focusable", - "markdownDescription": "Enables the set_focusable command without any pre-configured scope." - }, - { - "description": "Enables the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-fullscreen", - "markdownDescription": "Enables the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-ignore-cursor-events", - "markdownDescription": "Enables the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Enables the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-max-size", - "markdownDescription": "Enables the set_max_size command without any pre-configured scope." - }, - { - "description": "Enables the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-maximizable", - "markdownDescription": "Enables the set_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-min-size", - "markdownDescription": "Enables the set_min_size command without any pre-configured scope." - }, - { - "description": "Enables the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-minimizable", - "markdownDescription": "Enables the set_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-overlay-icon", - "markdownDescription": "Enables the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-position", - "markdownDescription": "Enables the set_position command without any pre-configured scope." - }, - { - "description": "Enables the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-progress-bar", - "markdownDescription": "Enables the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Enables the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-resizable", - "markdownDescription": "Enables the set_resizable command without any pre-configured scope." - }, - { - "description": "Enables the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-shadow", - "markdownDescription": "Enables the set_shadow command without any pre-configured scope." - }, - { - "description": "Enables the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-simple-fullscreen", - "markdownDescription": "Enables the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size", - "markdownDescription": "Enables the set_size command without any pre-configured scope." - }, - { - "description": "Enables the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size-constraints", - "markdownDescription": "Enables the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Enables the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-skip-taskbar", - "markdownDescription": "Enables the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Enables the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-theme", - "markdownDescription": "Enables the set_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title-bar-style", - "markdownDescription": "Enables the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Enables the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-visible-on-all-workspaces", - "markdownDescription": "Enables the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Enables the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-show", - "markdownDescription": "Enables the show command without any pre-configured scope." - }, - { - "description": "Enables the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-dragging", - "markdownDescription": "Enables the start_dragging command without any pre-configured scope." - }, - { - "description": "Enables the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-resize-dragging", - "markdownDescription": "Enables the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Enables the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-theme", - "markdownDescription": "Enables the theme command without any pre-configured scope." - }, - { - "description": "Enables the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-title", - "markdownDescription": "Enables the title command without any pre-configured scope." - }, - { - "description": "Enables the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-toggle-maximize", - "markdownDescription": "Enables the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unmaximize", - "markdownDescription": "Enables the unmaximize command without any pre-configured scope." - }, - { - "description": "Enables the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unminimize", - "markdownDescription": "Enables the unminimize command without any pre-configured scope." - }, - { - "description": "Denies the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-activity-name", - "markdownDescription": "Denies the activity_name command without any pre-configured scope." - }, - { - "description": "Denies the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-available-monitors", - "markdownDescription": "Denies the available_monitors command without any pre-configured scope." - }, - { - "description": "Denies the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-center", - "markdownDescription": "Denies the center command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Denies the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-create", - "markdownDescription": "Denies the create command without any pre-configured scope." - }, - { - "description": "Denies the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-current-monitor", - "markdownDescription": "Denies the current_monitor command without any pre-configured scope." - }, - { - "description": "Denies the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-cursor-position", - "markdownDescription": "Denies the cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-destroy", - "markdownDescription": "Denies the destroy command without any pre-configured scope." - }, - { - "description": "Denies the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-get-all-windows", - "markdownDescription": "Denies the get_all_windows command without any pre-configured scope." - }, - { - "description": "Denies the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-hide", - "markdownDescription": "Denies the hide command without any pre-configured scope." - }, - { - "description": "Denies the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-position", - "markdownDescription": "Denies the inner_position command without any pre-configured scope." - }, - { - "description": "Denies the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-size", - "markdownDescription": "Denies the inner_size command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-internal-toggle-maximize", - "markdownDescription": "Denies the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-always-on-top", - "markdownDescription": "Denies the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-closable", - "markdownDescription": "Denies the is_closable command without any pre-configured scope." - }, - { - "description": "Denies the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-decorated", - "markdownDescription": "Denies the is_decorated command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-focused", - "markdownDescription": "Denies the is_focused command without any pre-configured scope." - }, - { - "description": "Denies the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-fullscreen", - "markdownDescription": "Denies the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximizable", - "markdownDescription": "Denies the is_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximized", - "markdownDescription": "Denies the is_maximized command without any pre-configured scope." - }, - { - "description": "Denies the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimizable", - "markdownDescription": "Denies the is_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimized", - "markdownDescription": "Denies the is_minimized command without any pre-configured scope." - }, - { - "description": "Denies the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-resizable", - "markdownDescription": "Denies the is_resizable command without any pre-configured scope." - }, - { - "description": "Denies the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-visible", - "markdownDescription": "Denies the is_visible command without any pre-configured scope." - }, - { - "description": "Denies the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-maximize", - "markdownDescription": "Denies the maximize command without any pre-configured scope." - }, - { - "description": "Denies the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-minimize", - "markdownDescription": "Denies the minimize command without any pre-configured scope." - }, - { - "description": "Denies the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-monitor-from-point", - "markdownDescription": "Denies the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Denies the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-position", - "markdownDescription": "Denies the outer_position command without any pre-configured scope." - }, - { - "description": "Denies the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-size", - "markdownDescription": "Denies the outer_size command without any pre-configured scope." - }, - { - "description": "Denies the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-primary-monitor", - "markdownDescription": "Denies the primary_monitor command without any pre-configured scope." - }, - { - "description": "Denies the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-request-user-attention", - "markdownDescription": "Denies the request_user_attention command without any pre-configured scope." - }, - { - "description": "Denies the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scale-factor", - "markdownDescription": "Denies the scale_factor command without any pre-configured scope." - }, - { - "description": "Denies the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scene-identifier", - "markdownDescription": "Denies the scene_identifier command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-bottom", - "markdownDescription": "Denies the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-top", - "markdownDescription": "Denies the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-background-color", - "markdownDescription": "Denies the set_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-count", - "markdownDescription": "Denies the set_badge_count command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-label", - "markdownDescription": "Denies the set_badge_label command without any pre-configured scope." - }, - { - "description": "Denies the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-closable", - "markdownDescription": "Denies the set_closable command without any pre-configured scope." - }, - { - "description": "Denies the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-content-protected", - "markdownDescription": "Denies the set_content_protected command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-grab", - "markdownDescription": "Denies the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-icon", - "markdownDescription": "Denies the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-position", - "markdownDescription": "Denies the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-visible", - "markdownDescription": "Denies the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Denies the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-decorations", - "markdownDescription": "Denies the set_decorations command without any pre-configured scope." - }, - { - "description": "Denies the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-effects", - "markdownDescription": "Denies the set_effects command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focus", - "markdownDescription": "Denies the set_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focusable", - "markdownDescription": "Denies the set_focusable command without any pre-configured scope." - }, - { - "description": "Denies the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-fullscreen", - "markdownDescription": "Denies the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-ignore-cursor-events", - "markdownDescription": "Denies the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Denies the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-max-size", - "markdownDescription": "Denies the set_max_size command without any pre-configured scope." - }, - { - "description": "Denies the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-maximizable", - "markdownDescription": "Denies the set_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-min-size", - "markdownDescription": "Denies the set_min_size command without any pre-configured scope." - }, - { - "description": "Denies the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-minimizable", - "markdownDescription": "Denies the set_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-overlay-icon", - "markdownDescription": "Denies the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-position", - "markdownDescription": "Denies the set_position command without any pre-configured scope." - }, - { - "description": "Denies the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-progress-bar", - "markdownDescription": "Denies the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Denies the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-resizable", - "markdownDescription": "Denies the set_resizable command without any pre-configured scope." - }, - { - "description": "Denies the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-shadow", - "markdownDescription": "Denies the set_shadow command without any pre-configured scope." - }, - { - "description": "Denies the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-simple-fullscreen", - "markdownDescription": "Denies the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size", - "markdownDescription": "Denies the set_size command without any pre-configured scope." - }, - { - "description": "Denies the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size-constraints", - "markdownDescription": "Denies the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Denies the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-skip-taskbar", - "markdownDescription": "Denies the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Denies the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-theme", - "markdownDescription": "Denies the set_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title-bar-style", - "markdownDescription": "Denies the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Denies the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-visible-on-all-workspaces", - "markdownDescription": "Denies the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Denies the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-show", - "markdownDescription": "Denies the show command without any pre-configured scope." - }, - { - "description": "Denies the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-dragging", - "markdownDescription": "Denies the start_dragging command without any pre-configured scope." - }, - { - "description": "Denies the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-resize-dragging", - "markdownDescription": "Denies the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Denies the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-theme", - "markdownDescription": "Denies the theme command without any pre-configured scope." - }, - { - "description": "Denies the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-title", - "markdownDescription": "Denies the title command without any pre-configured scope." - }, - { - "description": "Denies the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-toggle-maximize", - "markdownDescription": "Denies the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unmaximize", - "markdownDescription": "Denies the unmaximize command without any pre-configured scope." - }, - { - "description": "Denies the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unminimize", - "markdownDescription": "Denies the unminimize command without any pre-configured scope." - }, - { - "description": "This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n\n#### This default permission set includes:\n\n- `allow-is-permission-granted`\n- `allow-request-permission`\n- `allow-notify`\n- `allow-register-action-types`\n- `allow-register-listener`\n- `allow-cancel`\n- `allow-get-pending`\n- `allow-remove-active`\n- `allow-get-active`\n- `allow-check-permissions`\n- `allow-show`\n- `allow-batch`\n- `allow-list-channels`\n- `allow-delete-channel`\n- `allow-create-channel`\n- `allow-permission-state`", - "type": "string", - "const": "notification:default", - "markdownDescription": "This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n\n#### This default permission set includes:\n\n- `allow-is-permission-granted`\n- `allow-request-permission`\n- `allow-notify`\n- `allow-register-action-types`\n- `allow-register-listener`\n- `allow-cancel`\n- `allow-get-pending`\n- `allow-remove-active`\n- `allow-get-active`\n- `allow-check-permissions`\n- `allow-show`\n- `allow-batch`\n- `allow-list-channels`\n- `allow-delete-channel`\n- `allow-create-channel`\n- `allow-permission-state`" - }, - { - "description": "Enables the batch command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-batch", - "markdownDescription": "Enables the batch command without any pre-configured scope." - }, - { - "description": "Enables the cancel command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-cancel", - "markdownDescription": "Enables the cancel command without any pre-configured scope." - }, - { - "description": "Enables the check_permissions command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-check-permissions", - "markdownDescription": "Enables the check_permissions command without any pre-configured scope." - }, - { - "description": "Enables the create_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-create-channel", - "markdownDescription": "Enables the create_channel command without any pre-configured scope." - }, - { - "description": "Enables the delete_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-delete-channel", - "markdownDescription": "Enables the delete_channel command without any pre-configured scope." - }, - { - "description": "Enables the get_active command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-get-active", - "markdownDescription": "Enables the get_active command without any pre-configured scope." - }, - { - "description": "Enables the get_pending command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-get-pending", - "markdownDescription": "Enables the get_pending command without any pre-configured scope." - }, - { - "description": "Enables the is_permission_granted command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-is-permission-granted", - "markdownDescription": "Enables the is_permission_granted command without any pre-configured scope." - }, - { - "description": "Enables the list_channels command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-list-channels", - "markdownDescription": "Enables the list_channels command without any pre-configured scope." - }, - { - "description": "Enables the notify command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-notify", - "markdownDescription": "Enables the notify command without any pre-configured scope." - }, - { - "description": "Enables the permission_state command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-permission-state", - "markdownDescription": "Enables the permission_state command without any pre-configured scope." - }, - { - "description": "Enables the register_action_types command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-register-action-types", - "markdownDescription": "Enables the register_action_types command without any pre-configured scope." - }, - { - "description": "Enables the register_listener command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-register-listener", - "markdownDescription": "Enables the register_listener command without any pre-configured scope." - }, - { - "description": "Enables the remove_active command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-remove-active", - "markdownDescription": "Enables the remove_active command without any pre-configured scope." - }, - { - "description": "Enables the request_permission command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-request-permission", - "markdownDescription": "Enables the request_permission command without any pre-configured scope." - }, - { - "description": "Enables the show command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-show", - "markdownDescription": "Enables the show command without any pre-configured scope." - }, - { - "description": "Denies the batch command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-batch", - "markdownDescription": "Denies the batch command without any pre-configured scope." - }, - { - "description": "Denies the cancel command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-cancel", - "markdownDescription": "Denies the cancel command without any pre-configured scope." - }, - { - "description": "Denies the check_permissions command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-check-permissions", - "markdownDescription": "Denies the check_permissions command without any pre-configured scope." - }, - { - "description": "Denies the create_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-create-channel", - "markdownDescription": "Denies the create_channel command without any pre-configured scope." - }, - { - "description": "Denies the delete_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-delete-channel", - "markdownDescription": "Denies the delete_channel command without any pre-configured scope." - }, - { - "description": "Denies the get_active command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-get-active", - "markdownDescription": "Denies the get_active command without any pre-configured scope." - }, - { - "description": "Denies the get_pending command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-get-pending", - "markdownDescription": "Denies the get_pending command without any pre-configured scope." - }, - { - "description": "Denies the is_permission_granted command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-is-permission-granted", - "markdownDescription": "Denies the is_permission_granted command without any pre-configured scope." - }, - { - "description": "Denies the list_channels command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-list-channels", - "markdownDescription": "Denies the list_channels command without any pre-configured scope." - }, - { - "description": "Denies the notify command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-notify", - "markdownDescription": "Denies the notify command without any pre-configured scope." - }, - { - "description": "Denies the permission_state command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-permission-state", - "markdownDescription": "Denies the permission_state command without any pre-configured scope." - }, - { - "description": "Denies the register_action_types command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-register-action-types", - "markdownDescription": "Denies the register_action_types command without any pre-configured scope." - }, - { - "description": "Denies the register_listener command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-register-listener", - "markdownDescription": "Denies the register_listener command without any pre-configured scope." - }, - { - "description": "Denies the remove_active command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-remove-active", - "markdownDescription": "Denies the remove_active command without any pre-configured scope." - }, - { - "description": "Denies the request_permission command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-request-permission", - "markdownDescription": "Denies the request_permission command without any pre-configured scope." - }, - { - "description": "Denies the show command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-show", - "markdownDescription": "Denies the show command without any pre-configured scope." - }, - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, - "Target": { - "description": "Platform target.", - "oneOf": [ - { - "description": "MacOS.", - "type": "string", - "enum": [ - "macOS" - ] - }, - { - "description": "Windows.", - "type": "string", - "enum": [ - "windows" - ] - }, - { - "description": "Linux.", - "type": "string", - "enum": [ - "linux" - ] - }, - { - "description": "Android.", - "type": "string", - "enum": [ - "android" - ] - }, - { - "description": "iOS.", - "type": "string", - "enum": [ - "iOS" - ] - } - ] - }, - "ShellScopeEntryAllowedArg": { - "description": "A command argument allowed to be executed by the webview API.", - "anyOf": [ - { - "description": "A non-configurable argument that is passed to the command in the order it was specified.", - "type": "string" - }, - { - "description": "A variable that is set while calling the command from the webview API.", - "type": "object", - "required": [ - "validator" - ], - "properties": { - "raw": { - "description": "Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.", - "default": false, - "type": "boolean" - }, - "validator": { - "description": "[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ", - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "ShellScopeEntryAllowedArgs": { - "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", - "anyOf": [ - { - "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", - "type": "boolean" - }, - { - "description": "A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.", - "type": "array", - "items": { - "$ref": "#/definitions/ShellScopeEntryAllowedArg" - } - } - ] - } - } -} \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/gen/schemas/macOS-schema.json b/packages/dcp-desktop/src-tauri/gen/schemas/macOS-schema.json deleted file mode 100644 index ff1e793..0000000 --- a/packages/dcp-desktop/src-tauri/gen/schemas/macOS-schema.json +++ /dev/null @@ -1,2852 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "CapabilityFile", - "description": "Capability formats accepted in a capability file.", - "anyOf": [ - { - "description": "A single capability.", - "allOf": [ - { - "$ref": "#/definitions/Capability" - } - ] - }, - { - "description": "A list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - }, - { - "description": "A list of capabilities.", - "type": "object", - "required": [ - "capabilities" - ], - "properties": { - "capabilities": { - "description": "The list of capabilities.", - "type": "array", - "items": { - "$ref": "#/definitions/Capability" - } - } - } - } - ], - "definitions": { - "Capability": { - "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```", - "type": "object", - "required": [ - "identifier", - "permissions" - ], - "properties": { - "identifier": { - "description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`", - "type": "string" - }, - "description": { - "description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.", - "default": "", - "type": "string" - }, - "remote": { - "description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```", - "anyOf": [ - { - "$ref": "#/definitions/CapabilityRemote" - }, - { - "type": "null" - } - ] - }, - "local": { - "description": "Whether this capability is enabled for local app URLs or not. Defaults to `true`.", - "default": true, - "type": "boolean" - }, - "windows": { - "description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nIf a window label matches any of the patterns in this list, the capability will be enabled on all the webviews of that window, regardless of the value of [`Self::webviews`].\n\nOn multiwebview windows, prefer specifying [`Self::webviews`] and omitting [`Self::windows`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "webviews": { - "description": "List of webviews that are affected by this capability. Can be a glob pattern.\n\nThe capability will be enabled on all the webviews whose label matches any of the patterns in this list, regardless of whether the webview's window label matches a pattern in [`Self::windows`].\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`", - "type": "array", - "items": { - "type": "string" - } - }, - "permissions": { - "description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"core:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ] ```", - "type": "array", - "items": { - "$ref": "#/definitions/PermissionEntry" - }, - "uniqueItems": true - }, - "platforms": { - "description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Target" - } - } - } - }, - "CapabilityRemote": { - "description": "Configuration for remote URLs that are associated with the capability.", - "type": "object", - "required": [ - "urls" - ], - "properties": { - "urls": { - "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "PermissionEntry": { - "description": "An entry for a permission value in a [`Capability`] can be either a raw permission [`Identifier`] or an object that references a permission and extends its scope.", - "anyOf": [ - { - "description": "Reference a permission or permission set by identifier.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - { - "description": "Reference a permission or permission set by identifier and extends its scope.", - "type": "object", - "allOf": [ - { - "if": { - "properties": { - "identifier": { - "anyOf": [ - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - } - } - }, - "then": { - "properties": { - "allow": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - }, - "deny": { - "items": { - "title": "ShellScopeEntry", - "description": "Shell scope entry.", - "anyOf": [ - { - "type": "object", - "required": [ - "cmd", - "name" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "cmd": { - "description": "The command name. It can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", - "type": "string" - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "name", - "sidecar" - ], - "properties": { - "args": { - "description": "The allowed arguments for the command execution.", - "allOf": [ - { - "$ref": "#/definitions/ShellScopeEntryAllowedArgs" - } - ] - }, - "name": { - "description": "The name for this allowed shell command configuration.\n\nThis name will be used inside of the webview API to call this command along with any specified arguments.", - "type": "string" - }, - "sidecar": { - "description": "If this command is a sidecar command.", - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - } - } - } - }, - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - } - } - }, - { - "properties": { - "identifier": { - "description": "Identifier of the permission or permission set.", - "allOf": [ - { - "$ref": "#/definitions/Identifier" - } - ] - }, - "allow": { - "description": "Data that defines what is allowed by the scope.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - }, - "deny": { - "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/definitions/Value" - } - } - } - } - ], - "required": [ - "identifier" - ] - } - ] - }, - "Identifier": { - "description": "Permission identifier", - "oneOf": [ - { - "description": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`", - "type": "string", - "const": "autostart:default", - "markdownDescription": "This permission set configures if your\napplication can enable or disable auto\nstarting the application on boot.\n\n#### Granted Permissions\n\nIt allows all to check, enable and\ndisable the automatic start on boot.\n\n\n#### This default permission set includes:\n\n- `allow-enable`\n- `allow-disable`\n- `allow-is-enabled`" - }, - { - "description": "Enables the disable command without any pre-configured scope.", - "type": "string", - "const": "autostart:allow-disable", - "markdownDescription": "Enables the disable command without any pre-configured scope." - }, - { - "description": "Enables the enable command without any pre-configured scope.", - "type": "string", - "const": "autostart:allow-enable", - "markdownDescription": "Enables the enable command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "autostart:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the disable command without any pre-configured scope.", - "type": "string", - "const": "autostart:deny-disable", - "markdownDescription": "Denies the disable command without any pre-configured scope." - }, - { - "description": "Denies the enable command without any pre-configured scope.", - "type": "string", - "const": "autostart:deny-enable", - "markdownDescription": "Denies the enable command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "autostart:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`", - "type": "string", - "const": "core:default", - "markdownDescription": "Default core plugins set.\n#### This default permission set includes:\n\n- `core:path:default`\n- `core:event:default`\n- `core:window:default`\n- `core:webview:default`\n- `core:app:default`\n- `core:image:default`\n- `core:resources:default`\n- `core:menu:default`\n- `core:tray:default`" - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`", - "type": "string", - "const": "core:app:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-version`\n- `allow-name`\n- `allow-tauri-version`\n- `allow-identifier`\n- `allow-bundle-type`\n- `allow-register-listener`\n- `allow-remove-listener`\n- `allow-supports-multiple-windows`" - }, - { - "description": "Enables the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-hide", - "markdownDescription": "Enables the app_hide command without any pre-configured scope." - }, - { - "description": "Enables the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-app-show", - "markdownDescription": "Enables the app_show command without any pre-configured scope." - }, - { - "description": "Enables the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-bundle-type", - "markdownDescription": "Enables the bundle_type command without any pre-configured scope." - }, - { - "description": "Enables the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-default-window-icon", - "markdownDescription": "Enables the default_window_icon command without any pre-configured scope." - }, - { - "description": "Enables the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-fetch-data-store-identifiers", - "markdownDescription": "Enables the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Enables the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-identifier", - "markdownDescription": "Enables the identifier command without any pre-configured scope." - }, - { - "description": "Enables the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-name", - "markdownDescription": "Enables the name command without any pre-configured scope." - }, - { - "description": "Enables the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-register-listener", - "markdownDescription": "Enables the register_listener command without any pre-configured scope." - }, - { - "description": "Enables the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-data-store", - "markdownDescription": "Enables the remove_data_store command without any pre-configured scope." - }, - { - "description": "Enables the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-remove-listener", - "markdownDescription": "Enables the remove_listener command without any pre-configured scope." - }, - { - "description": "Enables the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-app-theme", - "markdownDescription": "Enables the set_app_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-set-dock-visibility", - "markdownDescription": "Enables the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Enables the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-supports-multiple-windows", - "markdownDescription": "Enables the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Enables the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-tauri-version", - "markdownDescription": "Enables the tauri_version command without any pre-configured scope." - }, - { - "description": "Enables the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:allow-version", - "markdownDescription": "Enables the version command without any pre-configured scope." - }, - { - "description": "Denies the app_hide command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-hide", - "markdownDescription": "Denies the app_hide command without any pre-configured scope." - }, - { - "description": "Denies the app_show command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-app-show", - "markdownDescription": "Denies the app_show command without any pre-configured scope." - }, - { - "description": "Denies the bundle_type command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-bundle-type", - "markdownDescription": "Denies the bundle_type command without any pre-configured scope." - }, - { - "description": "Denies the default_window_icon command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-default-window-icon", - "markdownDescription": "Denies the default_window_icon command without any pre-configured scope." - }, - { - "description": "Denies the fetch_data_store_identifiers command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-fetch-data-store-identifiers", - "markdownDescription": "Denies the fetch_data_store_identifiers command without any pre-configured scope." - }, - { - "description": "Denies the identifier command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-identifier", - "markdownDescription": "Denies the identifier command without any pre-configured scope." - }, - { - "description": "Denies the name command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-name", - "markdownDescription": "Denies the name command without any pre-configured scope." - }, - { - "description": "Denies the register_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-register-listener", - "markdownDescription": "Denies the register_listener command without any pre-configured scope." - }, - { - "description": "Denies the remove_data_store command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-data-store", - "markdownDescription": "Denies the remove_data_store command without any pre-configured scope." - }, - { - "description": "Denies the remove_listener command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-remove-listener", - "markdownDescription": "Denies the remove_listener command without any pre-configured scope." - }, - { - "description": "Denies the set_app_theme command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-app-theme", - "markdownDescription": "Denies the set_app_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_dock_visibility command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-set-dock-visibility", - "markdownDescription": "Denies the set_dock_visibility command without any pre-configured scope." - }, - { - "description": "Denies the supports_multiple_windows command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-supports-multiple-windows", - "markdownDescription": "Denies the supports_multiple_windows command without any pre-configured scope." - }, - { - "description": "Denies the tauri_version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-tauri-version", - "markdownDescription": "Denies the tauri_version command without any pre-configured scope." - }, - { - "description": "Denies the version command without any pre-configured scope.", - "type": "string", - "const": "core:app:deny-version", - "markdownDescription": "Denies the version command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`", - "type": "string", - "const": "core:event:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-listen`\n- `allow-unlisten`\n- `allow-emit`\n- `allow-emit-to`" - }, - { - "description": "Enables the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit", - "markdownDescription": "Enables the emit command without any pre-configured scope." - }, - { - "description": "Enables the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-emit-to", - "markdownDescription": "Enables the emit_to command without any pre-configured scope." - }, - { - "description": "Enables the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-listen", - "markdownDescription": "Enables the listen command without any pre-configured scope." - }, - { - "description": "Enables the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:allow-unlisten", - "markdownDescription": "Enables the unlisten command without any pre-configured scope." - }, - { - "description": "Denies the emit command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit", - "markdownDescription": "Denies the emit command without any pre-configured scope." - }, - { - "description": "Denies the emit_to command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-emit-to", - "markdownDescription": "Denies the emit_to command without any pre-configured scope." - }, - { - "description": "Denies the listen command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-listen", - "markdownDescription": "Denies the listen command without any pre-configured scope." - }, - { - "description": "Denies the unlisten command without any pre-configured scope.", - "type": "string", - "const": "core:event:deny-unlisten", - "markdownDescription": "Denies the unlisten command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`", - "type": "string", - "const": "core:image:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-from-bytes`\n- `allow-from-path`\n- `allow-rgba`\n- `allow-size`" - }, - { - "description": "Enables the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-bytes", - "markdownDescription": "Enables the from_bytes command without any pre-configured scope." - }, - { - "description": "Enables the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-from-path", - "markdownDescription": "Enables the from_path command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-rgba", - "markdownDescription": "Enables the rgba command without any pre-configured scope." - }, - { - "description": "Enables the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:allow-size", - "markdownDescription": "Enables the size command without any pre-configured scope." - }, - { - "description": "Denies the from_bytes command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-bytes", - "markdownDescription": "Denies the from_bytes command without any pre-configured scope." - }, - { - "description": "Denies the from_path command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-from-path", - "markdownDescription": "Denies the from_path command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the rgba command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-rgba", - "markdownDescription": "Denies the rgba command without any pre-configured scope." - }, - { - "description": "Denies the size command without any pre-configured scope.", - "type": "string", - "const": "core:image:deny-size", - "markdownDescription": "Denies the size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`", - "type": "string", - "const": "core:menu:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-append`\n- `allow-prepend`\n- `allow-insert`\n- `allow-remove`\n- `allow-remove-at`\n- `allow-items`\n- `allow-get`\n- `allow-popup`\n- `allow-create-default`\n- `allow-set-as-app-menu`\n- `allow-set-as-window-menu`\n- `allow-text`\n- `allow-set-text`\n- `allow-is-enabled`\n- `allow-set-enabled`\n- `allow-set-accelerator`\n- `allow-set-as-windows-menu-for-nsapp`\n- `allow-set-as-help-menu-for-nsapp`\n- `allow-is-checked`\n- `allow-set-checked`\n- `allow-set-icon`" - }, - { - "description": "Enables the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-append", - "markdownDescription": "Enables the append command without any pre-configured scope." - }, - { - "description": "Enables the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-create-default", - "markdownDescription": "Enables the create_default command without any pre-configured scope." - }, - { - "description": "Enables the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-get", - "markdownDescription": "Enables the get command without any pre-configured scope." - }, - { - "description": "Enables the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-insert", - "markdownDescription": "Enables the insert command without any pre-configured scope." - }, - { - "description": "Enables the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-checked", - "markdownDescription": "Enables the is_checked command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-items", - "markdownDescription": "Enables the items command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-popup", - "markdownDescription": "Enables the popup command without any pre-configured scope." - }, - { - "description": "Enables the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-prepend", - "markdownDescription": "Enables the prepend command without any pre-configured scope." - }, - { - "description": "Enables the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove", - "markdownDescription": "Enables the remove command without any pre-configured scope." - }, - { - "description": "Enables the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-remove-at", - "markdownDescription": "Enables the remove_at command without any pre-configured scope." - }, - { - "description": "Enables the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-accelerator", - "markdownDescription": "Enables the set_accelerator command without any pre-configured scope." - }, - { - "description": "Enables the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-app-menu", - "markdownDescription": "Enables the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-help-menu-for-nsapp", - "markdownDescription": "Enables the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-window-menu", - "markdownDescription": "Enables the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-as-windows-menu-for-nsapp", - "markdownDescription": "Enables the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Enables the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-checked", - "markdownDescription": "Enables the set_checked command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-set-text", - "markdownDescription": "Enables the set_text command without any pre-configured scope." - }, - { - "description": "Enables the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:allow-text", - "markdownDescription": "Enables the text command without any pre-configured scope." - }, - { - "description": "Denies the append command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-append", - "markdownDescription": "Denies the append command without any pre-configured scope." - }, - { - "description": "Denies the create_default command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-create-default", - "markdownDescription": "Denies the create_default command without any pre-configured scope." - }, - { - "description": "Denies the get command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-get", - "markdownDescription": "Denies the get command without any pre-configured scope." - }, - { - "description": "Denies the insert command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-insert", - "markdownDescription": "Denies the insert command without any pre-configured scope." - }, - { - "description": "Denies the is_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-checked", - "markdownDescription": "Denies the is_checked command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the items command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-items", - "markdownDescription": "Denies the items command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the popup command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-popup", - "markdownDescription": "Denies the popup command without any pre-configured scope." - }, - { - "description": "Denies the prepend command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-prepend", - "markdownDescription": "Denies the prepend command without any pre-configured scope." - }, - { - "description": "Denies the remove command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove", - "markdownDescription": "Denies the remove command without any pre-configured scope." - }, - { - "description": "Denies the remove_at command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-remove-at", - "markdownDescription": "Denies the remove_at command without any pre-configured scope." - }, - { - "description": "Denies the set_accelerator command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-accelerator", - "markdownDescription": "Denies the set_accelerator command without any pre-configured scope." - }, - { - "description": "Denies the set_as_app_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-app-menu", - "markdownDescription": "Denies the set_as_app_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-help-menu-for-nsapp", - "markdownDescription": "Denies the set_as_help_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_as_window_menu command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-window-menu", - "markdownDescription": "Denies the set_as_window_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-as-windows-menu-for-nsapp", - "markdownDescription": "Denies the set_as_windows_menu_for_nsapp command without any pre-configured scope." - }, - { - "description": "Denies the set_checked command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-checked", - "markdownDescription": "Denies the set_checked command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-set-text", - "markdownDescription": "Denies the set_text command without any pre-configured scope." - }, - { - "description": "Denies the text command without any pre-configured scope.", - "type": "string", - "const": "core:menu:deny-text", - "markdownDescription": "Denies the text command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`", - "type": "string", - "const": "core:path:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-resolve-directory`\n- `allow-resolve`\n- `allow-normalize`\n- `allow-join`\n- `allow-dirname`\n- `allow-extname`\n- `allow-basename`\n- `allow-is-absolute`" - }, - { - "description": "Enables the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-basename", - "markdownDescription": "Enables the basename command without any pre-configured scope." - }, - { - "description": "Enables the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-dirname", - "markdownDescription": "Enables the dirname command without any pre-configured scope." - }, - { - "description": "Enables the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-extname", - "markdownDescription": "Enables the extname command without any pre-configured scope." - }, - { - "description": "Enables the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-is-absolute", - "markdownDescription": "Enables the is_absolute command without any pre-configured scope." - }, - { - "description": "Enables the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-join", - "markdownDescription": "Enables the join command without any pre-configured scope." - }, - { - "description": "Enables the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-normalize", - "markdownDescription": "Enables the normalize command without any pre-configured scope." - }, - { - "description": "Enables the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve", - "markdownDescription": "Enables the resolve command without any pre-configured scope." - }, - { - "description": "Enables the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:allow-resolve-directory", - "markdownDescription": "Enables the resolve_directory command without any pre-configured scope." - }, - { - "description": "Denies the basename command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-basename", - "markdownDescription": "Denies the basename command without any pre-configured scope." - }, - { - "description": "Denies the dirname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-dirname", - "markdownDescription": "Denies the dirname command without any pre-configured scope." - }, - { - "description": "Denies the extname command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-extname", - "markdownDescription": "Denies the extname command without any pre-configured scope." - }, - { - "description": "Denies the is_absolute command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-is-absolute", - "markdownDescription": "Denies the is_absolute command without any pre-configured scope." - }, - { - "description": "Denies the join command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-join", - "markdownDescription": "Denies the join command without any pre-configured scope." - }, - { - "description": "Denies the normalize command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-normalize", - "markdownDescription": "Denies the normalize command without any pre-configured scope." - }, - { - "description": "Denies the resolve command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve", - "markdownDescription": "Denies the resolve command without any pre-configured scope." - }, - { - "description": "Denies the resolve_directory command without any pre-configured scope.", - "type": "string", - "const": "core:path:deny-resolve-directory", - "markdownDescription": "Denies the resolve_directory command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`", - "type": "string", - "const": "core:resources:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-close`" - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:resources:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`", - "type": "string", - "const": "core:tray:default", - "markdownDescription": "Default permissions for the plugin, which enables all commands.\n#### This default permission set includes:\n\n- `allow-new`\n- `allow-get-by-id`\n- `allow-remove-by-id`\n- `allow-set-icon`\n- `allow-set-menu`\n- `allow-set-tooltip`\n- `allow-set-title`\n- `allow-set-visible`\n- `allow-set-temp-dir-path`\n- `allow-set-icon-as-template`\n- `allow-set-icon-with-as-template`\n- `allow-set-show-menu-on-left-click`" - }, - { - "description": "Enables the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-get-by-id", - "markdownDescription": "Enables the get_by_id command without any pre-configured scope." - }, - { - "description": "Enables the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-new", - "markdownDescription": "Enables the new command without any pre-configured scope." - }, - { - "description": "Enables the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-remove-by-id", - "markdownDescription": "Enables the remove_by_id command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-as-template", - "markdownDescription": "Enables the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-icon-with-as-template", - "markdownDescription": "Enables the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Enables the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-menu", - "markdownDescription": "Enables the set_menu command without any pre-configured scope." - }, - { - "description": "Enables the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-show-menu-on-left-click", - "markdownDescription": "Enables the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Enables the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-temp-dir-path", - "markdownDescription": "Enables the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-tooltip", - "markdownDescription": "Enables the set_tooltip command without any pre-configured scope." - }, - { - "description": "Enables the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:allow-set-visible", - "markdownDescription": "Enables the set_visible command without any pre-configured scope." - }, - { - "description": "Denies the get_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-get-by-id", - "markdownDescription": "Denies the get_by_id command without any pre-configured scope." - }, - { - "description": "Denies the new command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-new", - "markdownDescription": "Denies the new command without any pre-configured scope." - }, - { - "description": "Denies the remove_by_id command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-remove-by-id", - "markdownDescription": "Denies the remove_by_id command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-as-template", - "markdownDescription": "Denies the set_icon_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_icon_with_as_template command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-icon-with-as-template", - "markdownDescription": "Denies the set_icon_with_as_template command without any pre-configured scope." - }, - { - "description": "Denies the set_menu command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-menu", - "markdownDescription": "Denies the set_menu command without any pre-configured scope." - }, - { - "description": "Denies the set_show_menu_on_left_click command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-show-menu-on-left-click", - "markdownDescription": "Denies the set_show_menu_on_left_click command without any pre-configured scope." - }, - { - "description": "Denies the set_temp_dir_path command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-temp-dir-path", - "markdownDescription": "Denies the set_temp_dir_path command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_tooltip command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-tooltip", - "markdownDescription": "Denies the set_tooltip command without any pre-configured scope." - }, - { - "description": "Denies the set_visible command without any pre-configured scope.", - "type": "string", - "const": "core:tray:deny-set-visible", - "markdownDescription": "Denies the set_visible command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`", - "type": "string", - "const": "core:webview:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-webviews`\n- `allow-webview-position`\n- `allow-webview-size`\n- `allow-internal-toggle-devtools`" - }, - { - "description": "Enables the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-clear-all-browsing-data", - "markdownDescription": "Enables the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Enables the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview", - "markdownDescription": "Enables the create_webview command without any pre-configured scope." - }, - { - "description": "Enables the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-create-webview-window", - "markdownDescription": "Enables the create_webview_window command without any pre-configured scope." - }, - { - "description": "Enables the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-get-all-webviews", - "markdownDescription": "Enables the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-internal-toggle-devtools", - "markdownDescription": "Enables the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Enables the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-print", - "markdownDescription": "Enables the print command without any pre-configured scope." - }, - { - "description": "Enables the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-reparent", - "markdownDescription": "Enables the reparent command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-auto-resize", - "markdownDescription": "Enables the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-background-color", - "markdownDescription": "Enables the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-focus", - "markdownDescription": "Enables the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-position", - "markdownDescription": "Enables the set_webview_position command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-size", - "markdownDescription": "Enables the set_webview_size command without any pre-configured scope." - }, - { - "description": "Enables the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-set-webview-zoom", - "markdownDescription": "Enables the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Enables the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-close", - "markdownDescription": "Enables the webview_close command without any pre-configured scope." - }, - { - "description": "Enables the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-hide", - "markdownDescription": "Enables the webview_hide command without any pre-configured scope." - }, - { - "description": "Enables the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-position", - "markdownDescription": "Enables the webview_position command without any pre-configured scope." - }, - { - "description": "Enables the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-show", - "markdownDescription": "Enables the webview_show command without any pre-configured scope." - }, - { - "description": "Enables the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:allow-webview-size", - "markdownDescription": "Enables the webview_size command without any pre-configured scope." - }, - { - "description": "Denies the clear_all_browsing_data command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-clear-all-browsing-data", - "markdownDescription": "Denies the clear_all_browsing_data command without any pre-configured scope." - }, - { - "description": "Denies the create_webview command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview", - "markdownDescription": "Denies the create_webview command without any pre-configured scope." - }, - { - "description": "Denies the create_webview_window command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-create-webview-window", - "markdownDescription": "Denies the create_webview_window command without any pre-configured scope." - }, - { - "description": "Denies the get_all_webviews command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-get-all-webviews", - "markdownDescription": "Denies the get_all_webviews command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_devtools command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-internal-toggle-devtools", - "markdownDescription": "Denies the internal_toggle_devtools command without any pre-configured scope." - }, - { - "description": "Denies the print command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-print", - "markdownDescription": "Denies the print command without any pre-configured scope." - }, - { - "description": "Denies the reparent command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-reparent", - "markdownDescription": "Denies the reparent command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_auto_resize command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-auto-resize", - "markdownDescription": "Denies the set_webview_auto_resize command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-background-color", - "markdownDescription": "Denies the set_webview_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_focus command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-focus", - "markdownDescription": "Denies the set_webview_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-position", - "markdownDescription": "Denies the set_webview_position command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-size", - "markdownDescription": "Denies the set_webview_size command without any pre-configured scope." - }, - { - "description": "Denies the set_webview_zoom command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-set-webview-zoom", - "markdownDescription": "Denies the set_webview_zoom command without any pre-configured scope." - }, - { - "description": "Denies the webview_close command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-close", - "markdownDescription": "Denies the webview_close command without any pre-configured scope." - }, - { - "description": "Denies the webview_hide command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-hide", - "markdownDescription": "Denies the webview_hide command without any pre-configured scope." - }, - { - "description": "Denies the webview_position command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-position", - "markdownDescription": "Denies the webview_position command without any pre-configured scope." - }, - { - "description": "Denies the webview_show command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-show", - "markdownDescription": "Denies the webview_show command without any pre-configured scope." - }, - { - "description": "Denies the webview_size command without any pre-configured scope.", - "type": "string", - "const": "core:webview:deny-webview-size", - "markdownDescription": "Denies the webview_size command without any pre-configured scope." - }, - { - "description": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`", - "type": "string", - "const": "core:window:default", - "markdownDescription": "Default permissions for the plugin.\n#### This default permission set includes:\n\n- `allow-get-all-windows`\n- `allow-scale-factor`\n- `allow-inner-position`\n- `allow-outer-position`\n- `allow-inner-size`\n- `allow-outer-size`\n- `allow-is-fullscreen`\n- `allow-is-minimized`\n- `allow-is-maximized`\n- `allow-is-focused`\n- `allow-is-decorated`\n- `allow-is-resizable`\n- `allow-is-maximizable`\n- `allow-is-minimizable`\n- `allow-is-closable`\n- `allow-is-visible`\n- `allow-is-enabled`\n- `allow-title`\n- `allow-current-monitor`\n- `allow-primary-monitor`\n- `allow-monitor-from-point`\n- `allow-available-monitors`\n- `allow-cursor-position`\n- `allow-theme`\n- `allow-is-always-on-top`\n- `allow-activity-name`\n- `allow-scene-identifier`\n- `allow-internal-toggle-maximize`" - }, - { - "description": "Enables the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-activity-name", - "markdownDescription": "Enables the activity_name command without any pre-configured scope." - }, - { - "description": "Enables the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-available-monitors", - "markdownDescription": "Enables the available_monitors command without any pre-configured scope." - }, - { - "description": "Enables the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-center", - "markdownDescription": "Enables the center command without any pre-configured scope." - }, - { - "description": "Enables the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-close", - "markdownDescription": "Enables the close command without any pre-configured scope." - }, - { - "description": "Enables the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-create", - "markdownDescription": "Enables the create command without any pre-configured scope." - }, - { - "description": "Enables the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-current-monitor", - "markdownDescription": "Enables the current_monitor command without any pre-configured scope." - }, - { - "description": "Enables the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-cursor-position", - "markdownDescription": "Enables the cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-destroy", - "markdownDescription": "Enables the destroy command without any pre-configured scope." - }, - { - "description": "Enables the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-get-all-windows", - "markdownDescription": "Enables the get_all_windows command without any pre-configured scope." - }, - { - "description": "Enables the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-hide", - "markdownDescription": "Enables the hide command without any pre-configured scope." - }, - { - "description": "Enables the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-position", - "markdownDescription": "Enables the inner_position command without any pre-configured scope." - }, - { - "description": "Enables the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-inner-size", - "markdownDescription": "Enables the inner_size command without any pre-configured scope." - }, - { - "description": "Enables the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-internal-toggle-maximize", - "markdownDescription": "Enables the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-always-on-top", - "markdownDescription": "Enables the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-closable", - "markdownDescription": "Enables the is_closable command without any pre-configured scope." - }, - { - "description": "Enables the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-decorated", - "markdownDescription": "Enables the is_decorated command without any pre-configured scope." - }, - { - "description": "Enables the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-enabled", - "markdownDescription": "Enables the is_enabled command without any pre-configured scope." - }, - { - "description": "Enables the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-focused", - "markdownDescription": "Enables the is_focused command without any pre-configured scope." - }, - { - "description": "Enables the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-fullscreen", - "markdownDescription": "Enables the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximizable", - "markdownDescription": "Enables the is_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-maximized", - "markdownDescription": "Enables the is_maximized command without any pre-configured scope." - }, - { - "description": "Enables the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimizable", - "markdownDescription": "Enables the is_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-minimized", - "markdownDescription": "Enables the is_minimized command without any pre-configured scope." - }, - { - "description": "Enables the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-resizable", - "markdownDescription": "Enables the is_resizable command without any pre-configured scope." - }, - { - "description": "Enables the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-is-visible", - "markdownDescription": "Enables the is_visible command without any pre-configured scope." - }, - { - "description": "Enables the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-maximize", - "markdownDescription": "Enables the maximize command without any pre-configured scope." - }, - { - "description": "Enables the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-minimize", - "markdownDescription": "Enables the minimize command without any pre-configured scope." - }, - { - "description": "Enables the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-monitor-from-point", - "markdownDescription": "Enables the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Enables the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-position", - "markdownDescription": "Enables the outer_position command without any pre-configured scope." - }, - { - "description": "Enables the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-outer-size", - "markdownDescription": "Enables the outer_size command without any pre-configured scope." - }, - { - "description": "Enables the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-primary-monitor", - "markdownDescription": "Enables the primary_monitor command without any pre-configured scope." - }, - { - "description": "Enables the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-request-user-attention", - "markdownDescription": "Enables the request_user_attention command without any pre-configured scope." - }, - { - "description": "Enables the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scale-factor", - "markdownDescription": "Enables the scale_factor command without any pre-configured scope." - }, - { - "description": "Enables the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-scene-identifier", - "markdownDescription": "Enables the scene_identifier command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-bottom", - "markdownDescription": "Enables the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Enables the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-always-on-top", - "markdownDescription": "Enables the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Enables the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-background-color", - "markdownDescription": "Enables the set_background_color command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-count", - "markdownDescription": "Enables the set_badge_count command without any pre-configured scope." - }, - { - "description": "Enables the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-badge-label", - "markdownDescription": "Enables the set_badge_label command without any pre-configured scope." - }, - { - "description": "Enables the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-closable", - "markdownDescription": "Enables the set_closable command without any pre-configured scope." - }, - { - "description": "Enables the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-content-protected", - "markdownDescription": "Enables the set_content_protected command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-grab", - "markdownDescription": "Enables the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-icon", - "markdownDescription": "Enables the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-position", - "markdownDescription": "Enables the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Enables the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-cursor-visible", - "markdownDescription": "Enables the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Enables the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-decorations", - "markdownDescription": "Enables the set_decorations command without any pre-configured scope." - }, - { - "description": "Enables the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-effects", - "markdownDescription": "Enables the set_effects command without any pre-configured scope." - }, - { - "description": "Enables the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-enabled", - "markdownDescription": "Enables the set_enabled command without any pre-configured scope." - }, - { - "description": "Enables the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focus", - "markdownDescription": "Enables the set_focus command without any pre-configured scope." - }, - { - "description": "Enables the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-focusable", - "markdownDescription": "Enables the set_focusable command without any pre-configured scope." - }, - { - "description": "Enables the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-fullscreen", - "markdownDescription": "Enables the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-icon", - "markdownDescription": "Enables the set_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-ignore-cursor-events", - "markdownDescription": "Enables the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Enables the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-max-size", - "markdownDescription": "Enables the set_max_size command without any pre-configured scope." - }, - { - "description": "Enables the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-maximizable", - "markdownDescription": "Enables the set_maximizable command without any pre-configured scope." - }, - { - "description": "Enables the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-min-size", - "markdownDescription": "Enables the set_min_size command without any pre-configured scope." - }, - { - "description": "Enables the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-minimizable", - "markdownDescription": "Enables the set_minimizable command without any pre-configured scope." - }, - { - "description": "Enables the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-overlay-icon", - "markdownDescription": "Enables the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Enables the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-position", - "markdownDescription": "Enables the set_position command without any pre-configured scope." - }, - { - "description": "Enables the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-progress-bar", - "markdownDescription": "Enables the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Enables the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-resizable", - "markdownDescription": "Enables the set_resizable command without any pre-configured scope." - }, - { - "description": "Enables the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-shadow", - "markdownDescription": "Enables the set_shadow command without any pre-configured scope." - }, - { - "description": "Enables the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-simple-fullscreen", - "markdownDescription": "Enables the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Enables the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size", - "markdownDescription": "Enables the set_size command without any pre-configured scope." - }, - { - "description": "Enables the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-size-constraints", - "markdownDescription": "Enables the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Enables the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-skip-taskbar", - "markdownDescription": "Enables the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Enables the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-theme", - "markdownDescription": "Enables the set_theme command without any pre-configured scope." - }, - { - "description": "Enables the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title", - "markdownDescription": "Enables the set_title command without any pre-configured scope." - }, - { - "description": "Enables the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-title-bar-style", - "markdownDescription": "Enables the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Enables the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-set-visible-on-all-workspaces", - "markdownDescription": "Enables the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Enables the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-show", - "markdownDescription": "Enables the show command without any pre-configured scope." - }, - { - "description": "Enables the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-dragging", - "markdownDescription": "Enables the start_dragging command without any pre-configured scope." - }, - { - "description": "Enables the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-start-resize-dragging", - "markdownDescription": "Enables the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Enables the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-theme", - "markdownDescription": "Enables the theme command without any pre-configured scope." - }, - { - "description": "Enables the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-title", - "markdownDescription": "Enables the title command without any pre-configured scope." - }, - { - "description": "Enables the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-toggle-maximize", - "markdownDescription": "Enables the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Enables the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unmaximize", - "markdownDescription": "Enables the unmaximize command without any pre-configured scope." - }, - { - "description": "Enables the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:allow-unminimize", - "markdownDescription": "Enables the unminimize command without any pre-configured scope." - }, - { - "description": "Denies the activity_name command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-activity-name", - "markdownDescription": "Denies the activity_name command without any pre-configured scope." - }, - { - "description": "Denies the available_monitors command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-available-monitors", - "markdownDescription": "Denies the available_monitors command without any pre-configured scope." - }, - { - "description": "Denies the center command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-center", - "markdownDescription": "Denies the center command without any pre-configured scope." - }, - { - "description": "Denies the close command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-close", - "markdownDescription": "Denies the close command without any pre-configured scope." - }, - { - "description": "Denies the create command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-create", - "markdownDescription": "Denies the create command without any pre-configured scope." - }, - { - "description": "Denies the current_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-current-monitor", - "markdownDescription": "Denies the current_monitor command without any pre-configured scope." - }, - { - "description": "Denies the cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-cursor-position", - "markdownDescription": "Denies the cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the destroy command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-destroy", - "markdownDescription": "Denies the destroy command without any pre-configured scope." - }, - { - "description": "Denies the get_all_windows command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-get-all-windows", - "markdownDescription": "Denies the get_all_windows command without any pre-configured scope." - }, - { - "description": "Denies the hide command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-hide", - "markdownDescription": "Denies the hide command without any pre-configured scope." - }, - { - "description": "Denies the inner_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-position", - "markdownDescription": "Denies the inner_position command without any pre-configured scope." - }, - { - "description": "Denies the inner_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-inner-size", - "markdownDescription": "Denies the inner_size command without any pre-configured scope." - }, - { - "description": "Denies the internal_toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-internal-toggle-maximize", - "markdownDescription": "Denies the internal_toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the is_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-always-on-top", - "markdownDescription": "Denies the is_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the is_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-closable", - "markdownDescription": "Denies the is_closable command without any pre-configured scope." - }, - { - "description": "Denies the is_decorated command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-decorated", - "markdownDescription": "Denies the is_decorated command without any pre-configured scope." - }, - { - "description": "Denies the is_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-enabled", - "markdownDescription": "Denies the is_enabled command without any pre-configured scope." - }, - { - "description": "Denies the is_focused command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-focused", - "markdownDescription": "Denies the is_focused command without any pre-configured scope." - }, - { - "description": "Denies the is_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-fullscreen", - "markdownDescription": "Denies the is_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the is_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximizable", - "markdownDescription": "Denies the is_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the is_maximized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-maximized", - "markdownDescription": "Denies the is_maximized command without any pre-configured scope." - }, - { - "description": "Denies the is_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimizable", - "markdownDescription": "Denies the is_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the is_minimized command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-minimized", - "markdownDescription": "Denies the is_minimized command without any pre-configured scope." - }, - { - "description": "Denies the is_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-resizable", - "markdownDescription": "Denies the is_resizable command without any pre-configured scope." - }, - { - "description": "Denies the is_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-is-visible", - "markdownDescription": "Denies the is_visible command without any pre-configured scope." - }, - { - "description": "Denies the maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-maximize", - "markdownDescription": "Denies the maximize command without any pre-configured scope." - }, - { - "description": "Denies the minimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-minimize", - "markdownDescription": "Denies the minimize command without any pre-configured scope." - }, - { - "description": "Denies the monitor_from_point command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-monitor-from-point", - "markdownDescription": "Denies the monitor_from_point command without any pre-configured scope." - }, - { - "description": "Denies the outer_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-position", - "markdownDescription": "Denies the outer_position command without any pre-configured scope." - }, - { - "description": "Denies the outer_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-outer-size", - "markdownDescription": "Denies the outer_size command without any pre-configured scope." - }, - { - "description": "Denies the primary_monitor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-primary-monitor", - "markdownDescription": "Denies the primary_monitor command without any pre-configured scope." - }, - { - "description": "Denies the request_user_attention command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-request-user-attention", - "markdownDescription": "Denies the request_user_attention command without any pre-configured scope." - }, - { - "description": "Denies the scale_factor command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scale-factor", - "markdownDescription": "Denies the scale_factor command without any pre-configured scope." - }, - { - "description": "Denies the scene_identifier command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-scene-identifier", - "markdownDescription": "Denies the scene_identifier command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_bottom command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-bottom", - "markdownDescription": "Denies the set_always_on_bottom command without any pre-configured scope." - }, - { - "description": "Denies the set_always_on_top command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-always-on-top", - "markdownDescription": "Denies the set_always_on_top command without any pre-configured scope." - }, - { - "description": "Denies the set_background_color command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-background-color", - "markdownDescription": "Denies the set_background_color command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_count command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-count", - "markdownDescription": "Denies the set_badge_count command without any pre-configured scope." - }, - { - "description": "Denies the set_badge_label command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-badge-label", - "markdownDescription": "Denies the set_badge_label command without any pre-configured scope." - }, - { - "description": "Denies the set_closable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-closable", - "markdownDescription": "Denies the set_closable command without any pre-configured scope." - }, - { - "description": "Denies the set_content_protected command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-content-protected", - "markdownDescription": "Denies the set_content_protected command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_grab command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-grab", - "markdownDescription": "Denies the set_cursor_grab command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-icon", - "markdownDescription": "Denies the set_cursor_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-position", - "markdownDescription": "Denies the set_cursor_position command without any pre-configured scope." - }, - { - "description": "Denies the set_cursor_visible command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-cursor-visible", - "markdownDescription": "Denies the set_cursor_visible command without any pre-configured scope." - }, - { - "description": "Denies the set_decorations command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-decorations", - "markdownDescription": "Denies the set_decorations command without any pre-configured scope." - }, - { - "description": "Denies the set_effects command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-effects", - "markdownDescription": "Denies the set_effects command without any pre-configured scope." - }, - { - "description": "Denies the set_enabled command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-enabled", - "markdownDescription": "Denies the set_enabled command without any pre-configured scope." - }, - { - "description": "Denies the set_focus command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focus", - "markdownDescription": "Denies the set_focus command without any pre-configured scope." - }, - { - "description": "Denies the set_focusable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-focusable", - "markdownDescription": "Denies the set_focusable command without any pre-configured scope." - }, - { - "description": "Denies the set_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-fullscreen", - "markdownDescription": "Denies the set_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-icon", - "markdownDescription": "Denies the set_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_ignore_cursor_events command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-ignore-cursor-events", - "markdownDescription": "Denies the set_ignore_cursor_events command without any pre-configured scope." - }, - { - "description": "Denies the set_max_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-max-size", - "markdownDescription": "Denies the set_max_size command without any pre-configured scope." - }, - { - "description": "Denies the set_maximizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-maximizable", - "markdownDescription": "Denies the set_maximizable command without any pre-configured scope." - }, - { - "description": "Denies the set_min_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-min-size", - "markdownDescription": "Denies the set_min_size command without any pre-configured scope." - }, - { - "description": "Denies the set_minimizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-minimizable", - "markdownDescription": "Denies the set_minimizable command without any pre-configured scope." - }, - { - "description": "Denies the set_overlay_icon command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-overlay-icon", - "markdownDescription": "Denies the set_overlay_icon command without any pre-configured scope." - }, - { - "description": "Denies the set_position command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-position", - "markdownDescription": "Denies the set_position command without any pre-configured scope." - }, - { - "description": "Denies the set_progress_bar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-progress-bar", - "markdownDescription": "Denies the set_progress_bar command without any pre-configured scope." - }, - { - "description": "Denies the set_resizable command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-resizable", - "markdownDescription": "Denies the set_resizable command without any pre-configured scope." - }, - { - "description": "Denies the set_shadow command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-shadow", - "markdownDescription": "Denies the set_shadow command without any pre-configured scope." - }, - { - "description": "Denies the set_simple_fullscreen command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-simple-fullscreen", - "markdownDescription": "Denies the set_simple_fullscreen command without any pre-configured scope." - }, - { - "description": "Denies the set_size command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size", - "markdownDescription": "Denies the set_size command without any pre-configured scope." - }, - { - "description": "Denies the set_size_constraints command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-size-constraints", - "markdownDescription": "Denies the set_size_constraints command without any pre-configured scope." - }, - { - "description": "Denies the set_skip_taskbar command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-skip-taskbar", - "markdownDescription": "Denies the set_skip_taskbar command without any pre-configured scope." - }, - { - "description": "Denies the set_theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-theme", - "markdownDescription": "Denies the set_theme command without any pre-configured scope." - }, - { - "description": "Denies the set_title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title", - "markdownDescription": "Denies the set_title command without any pre-configured scope." - }, - { - "description": "Denies the set_title_bar_style command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-title-bar-style", - "markdownDescription": "Denies the set_title_bar_style command without any pre-configured scope." - }, - { - "description": "Denies the set_visible_on_all_workspaces command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-set-visible-on-all-workspaces", - "markdownDescription": "Denies the set_visible_on_all_workspaces command without any pre-configured scope." - }, - { - "description": "Denies the show command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-show", - "markdownDescription": "Denies the show command without any pre-configured scope." - }, - { - "description": "Denies the start_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-dragging", - "markdownDescription": "Denies the start_dragging command without any pre-configured scope." - }, - { - "description": "Denies the start_resize_dragging command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-start-resize-dragging", - "markdownDescription": "Denies the start_resize_dragging command without any pre-configured scope." - }, - { - "description": "Denies the theme command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-theme", - "markdownDescription": "Denies the theme command without any pre-configured scope." - }, - { - "description": "Denies the title command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-title", - "markdownDescription": "Denies the title command without any pre-configured scope." - }, - { - "description": "Denies the toggle_maximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-toggle-maximize", - "markdownDescription": "Denies the toggle_maximize command without any pre-configured scope." - }, - { - "description": "Denies the unmaximize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unmaximize", - "markdownDescription": "Denies the unmaximize command without any pre-configured scope." - }, - { - "description": "Denies the unminimize command without any pre-configured scope.", - "type": "string", - "const": "core:window:deny-unminimize", - "markdownDescription": "Denies the unminimize command without any pre-configured scope." - }, - { - "description": "This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n\n#### This default permission set includes:\n\n- `allow-is-permission-granted`\n- `allow-request-permission`\n- `allow-notify`\n- `allow-register-action-types`\n- `allow-register-listener`\n- `allow-cancel`\n- `allow-get-pending`\n- `allow-remove-active`\n- `allow-get-active`\n- `allow-check-permissions`\n- `allow-show`\n- `allow-batch`\n- `allow-list-channels`\n- `allow-delete-channel`\n- `allow-create-channel`\n- `allow-permission-state`", - "type": "string", - "const": "notification:default", - "markdownDescription": "This permission set configures which\nnotification features are by default exposed.\n\n#### Granted Permissions\n\nIt allows all notification related features.\n\n\n#### This default permission set includes:\n\n- `allow-is-permission-granted`\n- `allow-request-permission`\n- `allow-notify`\n- `allow-register-action-types`\n- `allow-register-listener`\n- `allow-cancel`\n- `allow-get-pending`\n- `allow-remove-active`\n- `allow-get-active`\n- `allow-check-permissions`\n- `allow-show`\n- `allow-batch`\n- `allow-list-channels`\n- `allow-delete-channel`\n- `allow-create-channel`\n- `allow-permission-state`" - }, - { - "description": "Enables the batch command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-batch", - "markdownDescription": "Enables the batch command without any pre-configured scope." - }, - { - "description": "Enables the cancel command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-cancel", - "markdownDescription": "Enables the cancel command without any pre-configured scope." - }, - { - "description": "Enables the check_permissions command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-check-permissions", - "markdownDescription": "Enables the check_permissions command without any pre-configured scope." - }, - { - "description": "Enables the create_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-create-channel", - "markdownDescription": "Enables the create_channel command without any pre-configured scope." - }, - { - "description": "Enables the delete_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-delete-channel", - "markdownDescription": "Enables the delete_channel command without any pre-configured scope." - }, - { - "description": "Enables the get_active command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-get-active", - "markdownDescription": "Enables the get_active command without any pre-configured scope." - }, - { - "description": "Enables the get_pending command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-get-pending", - "markdownDescription": "Enables the get_pending command without any pre-configured scope." - }, - { - "description": "Enables the is_permission_granted command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-is-permission-granted", - "markdownDescription": "Enables the is_permission_granted command without any pre-configured scope." - }, - { - "description": "Enables the list_channels command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-list-channels", - "markdownDescription": "Enables the list_channels command without any pre-configured scope." - }, - { - "description": "Enables the notify command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-notify", - "markdownDescription": "Enables the notify command without any pre-configured scope." - }, - { - "description": "Enables the permission_state command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-permission-state", - "markdownDescription": "Enables the permission_state command without any pre-configured scope." - }, - { - "description": "Enables the register_action_types command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-register-action-types", - "markdownDescription": "Enables the register_action_types command without any pre-configured scope." - }, - { - "description": "Enables the register_listener command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-register-listener", - "markdownDescription": "Enables the register_listener command without any pre-configured scope." - }, - { - "description": "Enables the remove_active command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-remove-active", - "markdownDescription": "Enables the remove_active command without any pre-configured scope." - }, - { - "description": "Enables the request_permission command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-request-permission", - "markdownDescription": "Enables the request_permission command without any pre-configured scope." - }, - { - "description": "Enables the show command without any pre-configured scope.", - "type": "string", - "const": "notification:allow-show", - "markdownDescription": "Enables the show command without any pre-configured scope." - }, - { - "description": "Denies the batch command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-batch", - "markdownDescription": "Denies the batch command without any pre-configured scope." - }, - { - "description": "Denies the cancel command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-cancel", - "markdownDescription": "Denies the cancel command without any pre-configured scope." - }, - { - "description": "Denies the check_permissions command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-check-permissions", - "markdownDescription": "Denies the check_permissions command without any pre-configured scope." - }, - { - "description": "Denies the create_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-create-channel", - "markdownDescription": "Denies the create_channel command without any pre-configured scope." - }, - { - "description": "Denies the delete_channel command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-delete-channel", - "markdownDescription": "Denies the delete_channel command without any pre-configured scope." - }, - { - "description": "Denies the get_active command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-get-active", - "markdownDescription": "Denies the get_active command without any pre-configured scope." - }, - { - "description": "Denies the get_pending command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-get-pending", - "markdownDescription": "Denies the get_pending command without any pre-configured scope." - }, - { - "description": "Denies the is_permission_granted command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-is-permission-granted", - "markdownDescription": "Denies the is_permission_granted command without any pre-configured scope." - }, - { - "description": "Denies the list_channels command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-list-channels", - "markdownDescription": "Denies the list_channels command without any pre-configured scope." - }, - { - "description": "Denies the notify command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-notify", - "markdownDescription": "Denies the notify command without any pre-configured scope." - }, - { - "description": "Denies the permission_state command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-permission-state", - "markdownDescription": "Denies the permission_state command without any pre-configured scope." - }, - { - "description": "Denies the register_action_types command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-register-action-types", - "markdownDescription": "Denies the register_action_types command without any pre-configured scope." - }, - { - "description": "Denies the register_listener command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-register-listener", - "markdownDescription": "Denies the register_listener command without any pre-configured scope." - }, - { - "description": "Denies the remove_active command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-remove-active", - "markdownDescription": "Denies the remove_active command without any pre-configured scope." - }, - { - "description": "Denies the request_permission command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-request-permission", - "markdownDescription": "Denies the request_permission command without any pre-configured scope." - }, - { - "description": "Denies the show command without any pre-configured scope.", - "type": "string", - "const": "notification:deny-show", - "markdownDescription": "Denies the show command without any pre-configured scope." - }, - { - "description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`", - "type": "string", - "const": "shell:default", - "markdownDescription": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`" - }, - { - "description": "Enables the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-execute", - "markdownDescription": "Enables the execute command without any pre-configured scope." - }, - { - "description": "Enables the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-kill", - "markdownDescription": "Enables the kill command without any pre-configured scope." - }, - { - "description": "Enables the open command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-open", - "markdownDescription": "Enables the open command without any pre-configured scope." - }, - { - "description": "Enables the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-spawn", - "markdownDescription": "Enables the spawn command without any pre-configured scope." - }, - { - "description": "Enables the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:allow-stdin-write", - "markdownDescription": "Enables the stdin_write command without any pre-configured scope." - }, - { - "description": "Denies the execute command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-execute", - "markdownDescription": "Denies the execute command without any pre-configured scope." - }, - { - "description": "Denies the kill command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-kill", - "markdownDescription": "Denies the kill command without any pre-configured scope." - }, - { - "description": "Denies the open command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-open", - "markdownDescription": "Denies the open command without any pre-configured scope." - }, - { - "description": "Denies the spawn command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-spawn", - "markdownDescription": "Denies the spawn command without any pre-configured scope." - }, - { - "description": "Denies the stdin_write command without any pre-configured scope.", - "type": "string", - "const": "shell:deny-stdin-write", - "markdownDescription": "Denies the stdin_write command without any pre-configured scope." - } - ] - }, - "Value": { - "description": "All supported ACL values.", - "anyOf": [ - { - "description": "Represents a null JSON value.", - "type": "null" - }, - { - "description": "Represents a [`bool`].", - "type": "boolean" - }, - { - "description": "Represents a valid ACL [`Number`].", - "allOf": [ - { - "$ref": "#/definitions/Number" - } - ] - }, - { - "description": "Represents a [`String`].", - "type": "string" - }, - { - "description": "Represents a list of other [`Value`]s.", - "type": "array", - "items": { - "$ref": "#/definitions/Value" - } - }, - { - "description": "Represents a map of [`String`] keys to [`Value`]s.", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Value" - } - } - ] - }, - "Number": { - "description": "A valid ACL number.", - "anyOf": [ - { - "description": "Represents an [`i64`].", - "type": "integer", - "format": "int64" - }, - { - "description": "Represents a [`f64`].", - "type": "number", - "format": "double" - } - ] - }, - "Target": { - "description": "Platform target.", - "oneOf": [ - { - "description": "MacOS.", - "type": "string", - "enum": [ - "macOS" - ] - }, - { - "description": "Windows.", - "type": "string", - "enum": [ - "windows" - ] - }, - { - "description": "Linux.", - "type": "string", - "enum": [ - "linux" - ] - }, - { - "description": "Android.", - "type": "string", - "enum": [ - "android" - ] - }, - { - "description": "iOS.", - "type": "string", - "enum": [ - "iOS" - ] - } - ] - }, - "ShellScopeEntryAllowedArg": { - "description": "A command argument allowed to be executed by the webview API.", - "anyOf": [ - { - "description": "A non-configurable argument that is passed to the command in the order it was specified.", - "type": "string" - }, - { - "description": "A variable that is set while calling the command from the webview API.", - "type": "object", - "required": [ - "validator" - ], - "properties": { - "raw": { - "description": "Marks the validator as a raw regex, meaning the plugin should not make any modification at runtime.\n\nThis means the regex will not match on the entire string by default, which might be exploited if your regex allow unexpected input to be considered valid. When using this option, make sure your regex is correct.", - "default": false, - "type": "boolean" - }, - "validator": { - "description": "[regex] validator to require passed values to conform to an expected input.\n\nThis will require the argument value passed to this variable to match the `validator` regex before it will be executed.\n\nThe regex string is by default surrounded by `^...$` to match the full string. For example the `https?://\\w+` regex would be registered as `^https?://\\w+$`.\n\n[regex]: ", - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "ShellScopeEntryAllowedArgs": { - "description": "A set of command arguments allowed to be executed by the webview API.\n\nA value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. A list of [`ShellScopeEntryAllowedArg`] will set those arguments as the only valid arguments to be passed to the attached command configuration.", - "anyOf": [ - { - "description": "Use a simple boolean to allow all or disable all arguments to this command configuration.", - "type": "boolean" - }, - { - "description": "A specific set of [`ShellScopeEntryAllowedArg`] that are valid to call for the command configuration.", - "type": "array", - "items": { - "$ref": "#/definitions/ShellScopeEntryAllowedArg" - } - } - ] - } - } -} \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/icons/128x128.png b/packages/dcp-desktop/src-tauri/icons/128x128.png deleted file mode 100644 index 50d8767..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/128x128.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/128x128@2x.png b/packages/dcp-desktop/src-tauri/icons/128x128@2x.png deleted file mode 100644 index e877266..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/128x128@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/32x32.png b/packages/dcp-desktop/src-tauri/icons/32x32.png deleted file mode 100644 index e2498be..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/32x32.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/64x64.png b/packages/dcp-desktop/src-tauri/icons/64x64.png deleted file mode 100644 index 837f67e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/64x64.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square107x107Logo.png b/packages/dcp-desktop/src-tauri/icons/Square107x107Logo.png deleted file mode 100644 index a34d6a2..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square107x107Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square142x142Logo.png b/packages/dcp-desktop/src-tauri/icons/Square142x142Logo.png deleted file mode 100644 index c23c4e2..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square142x142Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square150x150Logo.png b/packages/dcp-desktop/src-tauri/icons/Square150x150Logo.png deleted file mode 100644 index 355ebda..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square150x150Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square284x284Logo.png b/packages/dcp-desktop/src-tauri/icons/Square284x284Logo.png deleted file mode 100644 index beb9b58..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square284x284Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square30x30Logo.png b/packages/dcp-desktop/src-tauri/icons/Square30x30Logo.png deleted file mode 100644 index 942e53b..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square30x30Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square310x310Logo.png b/packages/dcp-desktop/src-tauri/icons/Square310x310Logo.png deleted file mode 100644 index e736377..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square310x310Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square44x44Logo.png b/packages/dcp-desktop/src-tauri/icons/Square44x44Logo.png deleted file mode 100644 index a1f31b6..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square44x44Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square71x71Logo.png b/packages/dcp-desktop/src-tauri/icons/Square71x71Logo.png deleted file mode 100644 index 4eed046..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square71x71Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/Square89x89Logo.png b/packages/dcp-desktop/src-tauri/icons/Square89x89Logo.png deleted file mode 100644 index 369a0d8..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/Square89x89Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/StoreLogo.png b/packages/dcp-desktop/src-tauri/icons/StoreLogo.png deleted file mode 100644 index 6941659..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/StoreLogo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml b/packages/dcp-desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 2ffbf24..0000000 --- a/packages/dcp-desktop/src-tauri/icons/android/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index bbd4d8d..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index c72b7cf..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index c6f1ff0..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 83ab967..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index f3d99a1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 95d5217..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index efc881b..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index cece02e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 85300f7..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 3f7938c..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 8508bc1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index da4599b..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index fad55d7..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 58789c9..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index a6b250b..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/android/values/ic_launcher_background.xml b/packages/dcp-desktop/src-tauri/icons/android/values/ic_launcher_background.xml deleted file mode 100644 index ea9c223..0000000 --- a/packages/dcp-desktop/src-tauri/icons/android/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #fff - \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/icons/icon.icns b/packages/dcp-desktop/src-tauri/icons/icon.icns deleted file mode 100644 index f79a974..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/icon.icns and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/icon.ico b/packages/dcp-desktop/src-tauri/icons/icon.ico deleted file mode 100644 index 6e96d36..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/icon.ico and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/icon.png b/packages/dcp-desktop/src-tauri/icons/icon.png deleted file mode 100644 index 2864637..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/icon.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/icons_backup/icon.icns b/packages/dcp-desktop/src-tauri/icons/icons_backup/icon.icns deleted file mode 100644 index 1ae9059..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/icons_backup/icon.icns and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/icons_backup/icon.ico b/packages/dcp-desktop/src-tauri/icons/icons_backup/icon.ico deleted file mode 100644 index 47e06cc..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/icons_backup/icon.ico and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@1x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@1x.png deleted file mode 100644 index 6257d2e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@2x-1.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@2x-1.png deleted file mode 100644 index 8ba9fe1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@2x-1.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@2x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@2x.png deleted file mode 100644 index 8ba9fe1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@3x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@3x.png deleted file mode 100644 index d5f685a..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-20x20@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@1x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@1x.png deleted file mode 100644 index 3e97f00..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@2x-1.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@2x-1.png deleted file mode 100644 index bee1f8f..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@2x-1.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@2x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@2x.png deleted file mode 100644 index bee1f8f..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@3x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@3x.png deleted file mode 100644 index 08fca22..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-29x29@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@1x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@1x.png deleted file mode 100644 index 8ba9fe1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@2x-1.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@2x-1.png deleted file mode 100644 index f3de58d..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@2x-1.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@2x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@2x.png deleted file mode 100644 index f3de58d..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@3x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@3x.png deleted file mode 100644 index f5b55a3..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-40x40@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-512@2x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-512@2x.png deleted file mode 100644 index 25a01f2..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-512@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-60x60@2x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-60x60@2x.png deleted file mode 100644 index f5b55a3..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-60x60@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-60x60@3x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-60x60@3x.png deleted file mode 100644 index 956a318..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-60x60@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-76x76@1x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-76x76@1x.png deleted file mode 100644 index 251c061..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-76x76@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-76x76@2x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-76x76@2x.png deleted file mode 100644 index b59b9a3..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-76x76@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png b/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png deleted file mode 100644 index ca8ee50..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/128x128.png b/packages/dcp-desktop/src-tauri/icons_backup/128x128.png deleted file mode 100644 index 1f23db3..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/128x128.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/128x128@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/128x128@2x.png deleted file mode 100644 index d1a0100..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/128x128@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/32x32.png b/packages/dcp-desktop/src-tauri/icons_backup/32x32.png deleted file mode 100644 index cecae33..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/32x32.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/64x64.png b/packages/dcp-desktop/src-tauri/icons_backup/64x64.png deleted file mode 100644 index 6325971..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/64x64.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square107x107Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square107x107Logo.png deleted file mode 100644 index 39e1282..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square107x107Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square142x142Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square142x142Logo.png deleted file mode 100644 index 0963b78..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square142x142Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square150x150Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square150x150Logo.png deleted file mode 100644 index 2e83171..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square150x150Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square284x284Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square284x284Logo.png deleted file mode 100644 index 3af2bf7..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square284x284Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square30x30Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square30x30Logo.png deleted file mode 100644 index ceafc80..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square30x30Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square310x310Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square310x310Logo.png deleted file mode 100644 index c8c9424..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square310x310Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square44x44Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square44x44Logo.png deleted file mode 100644 index d643f4e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square44x44Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square71x71Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square71x71Logo.png deleted file mode 100644 index 94aad95..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square71x71Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/Square89x89Logo.png b/packages/dcp-desktop/src-tauri/icons_backup/Square89x89Logo.png deleted file mode 100644 index 7b16e1e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/Square89x89Logo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/StoreLogo.png b/packages/dcp-desktop/src-tauri/icons_backup/StoreLogo.png deleted file mode 100644 index 22960de..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/StoreLogo.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-anydpi-v26/ic_launcher.xml b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 2ffbf24..0000000 --- a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index bbd4d8d..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index c72b7cf..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index c6f1ff0..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 83ab967..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index f3d99a1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 95d5217..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index efc881b..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index cece02e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 85300f7..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 3f7938c..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 8508bc1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index da4599b..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index fad55d7..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher_foreground.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 58789c9..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher_round.png b/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index a6b250b..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/android/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/android/values/ic_launcher_background.xml b/packages/dcp-desktop/src-tauri/icons_backup/android/values/ic_launcher_background.xml deleted file mode 100644 index ea9c223..0000000 --- a/packages/dcp-desktop/src-tauri/icons_backup/android/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #fff - \ No newline at end of file diff --git a/packages/dcp-desktop/src-tauri/icons_backup/icon.icns b/packages/dcp-desktop/src-tauri/icons_backup/icon.icns deleted file mode 100644 index 1ae9059..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/icon.icns and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/icon.ico b/packages/dcp-desktop/src-tauri/icons_backup/icon.ico deleted file mode 100644 index 47e06cc..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/icon.ico and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/icon.png b/packages/dcp-desktop/src-tauri/icons_backup/icon.png deleted file mode 100644 index 9b1638e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/icon.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@1x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@1x.png deleted file mode 100644 index 6257d2e..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@2x-1.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@2x-1.png deleted file mode 100644 index 8ba9fe1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@2x-1.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@2x.png deleted file mode 100644 index 8ba9fe1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@3x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@3x.png deleted file mode 100644 index d5f685a..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-20x20@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@1x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@1x.png deleted file mode 100644 index 3e97f00..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@2x-1.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@2x-1.png deleted file mode 100644 index bee1f8f..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@2x-1.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@2x.png deleted file mode 100644 index bee1f8f..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@3x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@3x.png deleted file mode 100644 index 08fca22..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-29x29@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@1x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@1x.png deleted file mode 100644 index 8ba9fe1..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@2x-1.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@2x-1.png deleted file mode 100644 index f3de58d..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@2x-1.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@2x.png deleted file mode 100644 index f3de58d..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@3x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@3x.png deleted file mode 100644 index f5b55a3..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-40x40@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-512@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-512@2x.png deleted file mode 100644 index 25a01f2..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-512@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-60x60@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-60x60@2x.png deleted file mode 100644 index f5b55a3..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-60x60@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-60x60@3x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-60x60@3x.png deleted file mode 100644 index 956a318..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-60x60@3x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-76x76@1x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-76x76@1x.png deleted file mode 100644 index 251c061..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-76x76@1x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-76x76@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-76x76@2x.png deleted file mode 100644 index b59b9a3..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-76x76@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-83.5x83.5@2x.png b/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-83.5x83.5@2x.png deleted file mode 100644 index ca8ee50..0000000 Binary files a/packages/dcp-desktop/src-tauri/icons_backup/ios/AppIcon-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/dcp-desktop/src-tauri/resources/dcp-vault-bundle.cjs b/packages/dcp-desktop/src-tauri/resources/dcp-vault-bundle.cjs deleted file mode 100644 index 36ffad5..0000000 --- a/packages/dcp-desktop/src-tauri/resources/dcp-vault-bundle.cjs +++ /dev/null @@ -1,102642 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod2) => function __require() { - return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target, - mod2 -)); -var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2); - -// ../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js -var require_reusify = __commonJS({ - "../../node_modules/.pnpm/reusify@1.1.0/node_modules/reusify/reusify.js"(exports2, module2) { - "use strict"; - function reusify(Constructor) { - var head = new Constructor(); - var tail = head; - function get() { - var current = head; - if (current.next) { - head = current.next; - } else { - head = new Constructor(); - tail = head; - } - current.next = null; - return current; - } - function release(obj) { - tail.next = obj; - tail = obj; - } - return { - get, - release - }; - } - module2.exports = reusify; - } -}); - -// ../../node_modules/.pnpm/fastq@1.20.1/node_modules/fastq/queue.js -var require_queue = __commonJS({ - "../../node_modules/.pnpm/fastq@1.20.1/node_modules/fastq/queue.js"(exports2, module2) { - "use strict"; - var reusify = require_reusify(); - function fastqueue(context, worker, _concurrency) { - if (typeof context === "function") { - _concurrency = worker; - worker = context; - context = null; - } - if (!(_concurrency >= 1)) { - throw new Error("fastqueue concurrency must be equal to or greater than 1"); - } - var cache = reusify(Task); - var queueHead = null; - var queueTail = null; - var _running = 0; - var errorHandler = null; - var self2 = { - push, - drain: noop, - saturated: noop, - pause, - paused: false, - get concurrency() { - return _concurrency; - }, - set concurrency(value) { - if (!(value >= 1)) { - throw new Error("fastqueue concurrency must be equal to or greater than 1"); - } - _concurrency = value; - if (self2.paused) - return; - for (; queueHead && _running < _concurrency; ) { - _running++; - release(); - } - }, - running, - resume, - idle, - length, - getQueue, - unshift, - empty: noop, - kill, - killAndDrain, - error, - abort - }; - return self2; - function running() { - return _running; - } - function pause() { - self2.paused = true; - } - function length() { - var current = queueHead; - var counter = 0; - while (current) { - current = current.next; - counter++; - } - return counter; - } - function getQueue() { - var current = queueHead; - var tasks = []; - while (current) { - tasks.push(current.value); - current = current.next; - } - return tasks; - } - function resume() { - if (!self2.paused) - return; - self2.paused = false; - if (queueHead === null) { - _running++; - release(); - return; - } - for (; queueHead && _running < _concurrency; ) { - _running++; - release(); - } - } - function idle() { - return _running === 0 && self2.length() === 0; - } - function push(value, done) { - var current = cache.get(); - current.context = context; - current.release = release; - current.value = value; - current.callback = done || noop; - current.errorHandler = errorHandler; - if (_running >= _concurrency || self2.paused) { - if (queueTail) { - queueTail.next = current; - queueTail = current; - } else { - queueHead = current; - queueTail = current; - self2.saturated(); - } - } else { - _running++; - worker.call(context, current.value, current.worked); - } - } - function unshift(value, done) { - var current = cache.get(); - current.context = context; - current.release = release; - current.value = value; - current.callback = done || noop; - current.errorHandler = errorHandler; - if (_running >= _concurrency || self2.paused) { - if (queueHead) { - current.next = queueHead; - queueHead = current; - } else { - queueHead = current; - queueTail = current; - self2.saturated(); - } - } else { - _running++; - worker.call(context, current.value, current.worked); - } - } - function release(holder) { - if (holder) { - cache.release(holder); - } - var next = queueHead; - if (next && _running <= _concurrency) { - if (!self2.paused) { - if (queueTail === queueHead) { - queueTail = null; - } - queueHead = next.next; - next.next = null; - worker.call(context, next.value, next.worked); - if (queueTail === null) { - self2.empty(); - } - } else { - _running--; - } - } else if (--_running === 0) { - self2.drain(); - } - } - function kill() { - queueHead = null; - queueTail = null; - self2.drain = noop; - } - function killAndDrain() { - queueHead = null; - queueTail = null; - self2.drain(); - self2.drain = noop; - } - function abort() { - var current = queueHead; - queueHead = null; - queueTail = null; - while (current) { - var next = current.next; - var callback = current.callback; - var errorHandler2 = current.errorHandler; - var val = current.value; - var context2 = current.context; - current.value = null; - current.callback = noop; - current.errorHandler = null; - if (errorHandler2) { - errorHandler2(new Error("abort"), val); - } - callback.call(context2, new Error("abort")); - current.release(current); - current = next; - } - self2.drain = noop; - } - function error(handler) { - errorHandler = handler; - } - } - function noop() { - } - function Task() { - this.value = null; - this.callback = noop; - this.next = null; - this.release = noop; - this.context = null; - this.errorHandler = null; - var self2 = this; - this.worked = function worked(err, result) { - var callback = self2.callback; - var errorHandler = self2.errorHandler; - var val = self2.value; - self2.value = null; - self2.callback = noop; - if (self2.errorHandler) { - errorHandler(err, val); - } - callback.call(self2.context, err, result); - self2.release(self2); - }; - } - function queueAsPromised(context, worker, _concurrency) { - if (typeof context === "function") { - _concurrency = worker; - worker = context; - context = null; - } - function asyncWrapper(arg, cb) { - worker.call(this, arg).then(function(res) { - cb(null, res); - }, cb); - } - var queue = fastqueue(context, asyncWrapper, _concurrency); - var pushCb = queue.push; - var unshiftCb = queue.unshift; - queue.push = push; - queue.unshift = unshift; - queue.drained = drained; - return queue; - function push(value) { - var p = new Promise(function(resolve, reject) { - pushCb(value, function(err, result) { - if (err) { - reject(err); - return; - } - resolve(result); - }); - }); - p.catch(noop); - return p; - } - function unshift(value) { - var p = new Promise(function(resolve, reject) { - unshiftCb(value, function(err, result) { - if (err) { - reject(err); - return; - } - resolve(result); - }); - }); - p.catch(noop); - return p; - } - function drained() { - var p = new Promise(function(resolve) { - process.nextTick(function() { - if (queue.idle()) { - resolve(); - } else { - var previousDrain = queue.drain; - queue.drain = function() { - if (typeof previousDrain === "function") - previousDrain(); - resolve(); - queue.drain = previousDrain; - }; - } - }); - }); - return p; - } - } - module2.exports = fastqueue; - module2.exports.promise = queueAsPromised; - } -}); - -// ../../node_modules/.pnpm/@fastify+error@4.2.0/node_modules/@fastify/error/index.js -var require_error = __commonJS({ - "../../node_modules/.pnpm/@fastify+error@4.2.0/node_modules/@fastify/error/index.js"(exports2, module2) { - "use strict"; - var { format } = require("node:util"); - function toString() { - return `${this.name} [${this.code}]: ${this.message}`; - } - var FastifyGenericErrorSymbol = Symbol.for("fastify-error-generic"); - function createError(code, message, statusCode = 500, Base = Error, captureStackTrace = createError.captureStackTrace) { - const shouldCreateFastifyGenericError = code === FastifyGenericErrorSymbol; - if (shouldCreateFastifyGenericError) { - code = "FST_ERR"; - } - if (!code) - throw new Error("Fastify error code must not be empty"); - if (!message) - throw new Error("Fastify error message must not be empty"); - code = code.toUpperCase(); - !statusCode && (statusCode = void 0); - const FastifySpecificErrorSymbol = Symbol.for(`fastify-error ${code}`); - function FastifyError(...args) { - if (!new.target) { - return new FastifyError(...args); - } - this.code = code; - this.name = "FastifyError"; - this.statusCode = statusCode; - const lastElement = args.length - 1; - if (lastElement !== -1 && args[lastElement] && typeof args[lastElement] === "object" && "cause" in args[lastElement]) { - this.cause = args.pop().cause; - } - this.message = format(message, ...args); - Error.stackTraceLimit && captureStackTrace && Error.captureStackTrace(this, FastifyError); - } - FastifyError.prototype = Object.create(Base.prototype, { - constructor: { - value: FastifyError, - enumerable: false, - writable: true, - configurable: true - }, - [FastifyGenericErrorSymbol]: { - value: true, - enumerable: false, - writable: false, - configurable: false - }, - [FastifySpecificErrorSymbol]: { - value: true, - enumerable: false, - writable: false, - configurable: false - } - }); - if (shouldCreateFastifyGenericError) { - Object.defineProperty(FastifyError, Symbol.hasInstance, { - value(instance2) { - return instance2 && instance2[FastifyGenericErrorSymbol]; - }, - configurable: false, - writable: false, - enumerable: false - }); - } else { - Object.defineProperty(FastifyError, Symbol.hasInstance, { - value(instance2) { - return instance2 && instance2[FastifySpecificErrorSymbol]; - }, - configurable: false, - writable: false, - enumerable: false - }); - } - FastifyError.prototype[Symbol.toStringTag] = "Error"; - FastifyError.prototype.toString = toString; - return FastifyError; - } - createError.captureStackTrace = true; - var FastifyErrorConstructor = createError(FastifyGenericErrorSymbol, "Fastify Error", 500, Error); - module2.exports = createError; - module2.exports.FastifyError = FastifyErrorConstructor; - module2.exports.default = createError; - module2.exports.createError = createError; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/errors.js -var require_errors = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/errors.js"(exports2, module2) { - "use strict"; - var { createError } = require_error(); - module2.exports = { - AVV_ERR_EXPOSE_ALREADY_DEFINED: createError( - "AVV_ERR_EXPOSE_ALREADY_DEFINED", - "'%s' is already defined, specify an expose option for '%s'" - ), - AVV_ERR_ATTRIBUTE_ALREADY_DEFINED: createError( - "AVV_ERR_ATTRIBUTE_ALREADY_DEFINED", - "'%s' is already defined" - ), - AVV_ERR_CALLBACK_NOT_FN: createError( - "AVV_ERR_CALLBACK_NOT_FN", - "Callback for '%s' hook is not a function. Received: '%s'" - ), - AVV_ERR_PLUGIN_NOT_VALID: createError( - "AVV_ERR_PLUGIN_NOT_VALID", - "Plugin must be a function or a promise. Received: '%s'" - ), - AVV_ERR_ROOT_PLG_BOOTED: createError( - "AVV_ERR_ROOT_PLG_BOOTED", - "Root plugin has already booted" - ), - AVV_ERR_PARENT_PLG_LOADED: createError( - "AVV_ERR_PARENT_PLG_LOADED", - "Impossible to load '%s' plugin because the parent '%s' was already loaded" - ), - AVV_ERR_READY_TIMEOUT: createError( - "AVV_ERR_READY_TIMEOUT", - "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise" - ), - AVV_ERR_PLUGIN_EXEC_TIMEOUT: createError( - "AVV_ERR_PLUGIN_EXEC_TIMEOUT", - "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise" - ) - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/symbols.js -var require_symbols = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/symbols.js"(exports2, module2) { - "use strict"; - var kAvvio = Symbol("avvio.Boot"); - var kIsOnCloseHandler = Symbol("isOnCloseHandler"); - var kThenifyDoNotWrap = Symbol("avvio.ThenifyDoNotWrap"); - var kUntrackNode = Symbol("avvio.TimeTree.untrackNode"); - var kTrackNode = Symbol("avvio.TimeTree.trackNode"); - var kGetParent = Symbol("avvio.TimeTree.getParent"); - var kGetNode = Symbol("avvio.TimeTree.getNode"); - var kAddNode = Symbol("avvio.TimeTree.addNode"); - var kPluginMeta = Symbol.for("plugin-meta"); - module2.exports = { - kAvvio, - kIsOnCloseHandler, - kThenifyDoNotWrap, - kUntrackNode, - kTrackNode, - kGetParent, - kGetNode, - kAddNode, - kPluginMeta - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/time-tree.js -var require_time_tree = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/time-tree.js"(exports2, module2) { - "use strict"; - var { - kUntrackNode, - kTrackNode, - kGetParent, - kGetNode, - kAddNode - } = require_symbols(); - var TimeTree = class { - constructor() { - this.root = null; - this.tableId = /* @__PURE__ */ new Map(); - this.tableLabel = /* @__PURE__ */ new Map(); - } - /** - * @param {TimeTreeNode} node - */ - [kTrackNode](node) { - this.tableId.set(node.id, node); - if (this.tableLabel.has(node.label)) { - this.tableLabel.get(node.label).push(node); - } else { - this.tableLabel.set(node.label, [node]); - } - } - /** - * @param {TimeTreeNode} node - */ - [kUntrackNode](node) { - this.tableId.delete(node.id); - const labelNode = this.tableLabel.get(node.label); - labelNode.pop(); - if (labelNode.length === 0) { - this.tableLabel.delete(node.label); - } - } - /** - * @param {string} parent - * @returns {TimeTreeNode} - */ - [kGetParent](parent) { - if (parent === null) { - return null; - } else if (this.tableLabel.has(parent)) { - const parentNode = this.tableLabel.get(parent); - return parentNode[parentNode.length - 1]; - } else { - return null; - } - } - /** - * - * @param {string} nodeId - * @returns {TimeTreeNode} - */ - [kGetNode](nodeId) { - return this.tableId.get(nodeId); - } - /** - * @param {string} parent - * @param {string} label - * @param {number} start - * @returns {TimeTreeNode["id"]} - */ - [kAddNode](parent, label, start) { - const parentNode = this[kGetParent](parent); - const isRoot = parentNode === null; - if (isRoot) { - this.root = { - parent: null, - id: "root", - label, - nodes: [], - start, - stop: null, - diff: -1 - }; - this[kTrackNode](this.root); - return this.root.id; - } - const nodeId = `${label}-${Math.random()}`; - const childNode = { - parent, - id: nodeId, - label, - nodes: [], - start, - stop: null, - diff: -1 - }; - parentNode.nodes.push(childNode); - this[kTrackNode](childNode); - return nodeId; - } - /** - * @param {string} parent - * @param {string} label - * @param {number|undefined} start - * @returns {TimeTreeNode["id"]} - */ - start(parent, label, start = Date.now()) { - return this[kAddNode](parent, label, start); - } - /** - * @param {string} nodeId - * @param {number|undefined} stop - */ - stop(nodeId, stop = Date.now()) { - const node = this[kGetNode](nodeId); - if (node) { - node.stop = stop; - node.diff = node.stop - node.start || 0; - this[kUntrackNode](node); - } - } - /** - * @returns {TimeTreeNode} - */ - toJSON() { - return Object.assign({}, this.root); - } - /** - * @returns {string} - */ - prettyPrint() { - return prettyPrintTimeTree(this.toJSON()); - } - }; - function prettyPrintTimeTree(obj, prefix = "") { - let result = prefix; - const nodesCount = obj.nodes.length; - const lastIndex = nodesCount - 1; - result += `${obj.label} ${obj.diff} ms -`; - for (let i = 0; i < nodesCount; ++i) { - const node = obj.nodes[i]; - const prefix_ = prefix + (i === lastIndex ? " " : "\u2502 "); - result += prefix; - result += i === lastIndex ? "\u2514\u2500" : "\u251C\u2500"; - result += node.nodes.length === 0 ? "\u2500 " : "\u252C "; - result += prettyPrintTimeTree(node, prefix_).slice(prefix.length + 2); - } - return result; - } - module2.exports = { - TimeTree - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/debug.js -var require_debug = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/debug.js"(exports2, module2) { - "use strict"; - var { debuglog } = require("node:util"); - var debug = debuglog("avvio"); - module2.exports = { - debug - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/create-promise.js -var require_create_promise = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/create-promise.js"(exports2, module2) { - "use strict"; - function createPromise() { - const obj = { - resolve: null, - reject: null, - promise: null - }; - obj.promise = new Promise((resolve, reject) => { - obj.resolve = resolve; - obj.reject = reject; - }); - return obj; - } - module2.exports = { - createPromise - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/get-plugin-name.js -var require_get_plugin_name = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/get-plugin-name.js"(exports2, module2) { - "use strict"; - var { kPluginMeta } = require_symbols(); - function getPluginName(plugin, options) { - if (plugin[kPluginMeta]?.name) { - return plugin[kPluginMeta].name; - } - if (options?.name) { - return options.name; - } - if (plugin.name) { - return plugin.name; - } else { - return plugin.toString().split("\n").slice(0, 2).map((s) => s.trim()).join(" -- "); - } - } - module2.exports = { - getPluginName - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/is-promise-like.js -var require_is_promise_like = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/is-promise-like.js"(exports2, module2) { - "use strict"; - function isPromiseLike(maybePromiseLike) { - return maybePromiseLike !== null && typeof maybePromiseLike === "object" && typeof maybePromiseLike.then === "function"; - } - module2.exports = { - isPromiseLike - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/plugin.js -var require_plugin = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/plugin.js"(exports2, module2) { - "use strict"; - var { EventEmitter: EventEmitter2 } = require("node:events"); - var { inherits } = require("node:util"); - var { debug } = require_debug(); - var { createPromise } = require_create_promise(); - var { AVV_ERR_PLUGIN_EXEC_TIMEOUT } = require_errors(); - var { getPluginName } = require_get_plugin_name(); - var { isPromiseLike } = require_is_promise_like(); - function Plugin(queue, func, options, isAfter, timeout) { - this.queue = queue; - this.func = func; - this.options = options; - this.isAfter = isAfter; - this.timeout = timeout; - this.started = false; - this.name = getPluginName(func, options); - this.queue.pause(); - this._error = null; - this.loaded = false; - this._promise = null; - this.startTime = null; - } - inherits(Plugin, EventEmitter2); - Plugin.prototype.exec = function(server, callback) { - debug("exec", this.name); - this.server = server; - const func = this.func; - const name = this.name; - let completed = false; - this.options = typeof this.options === "function" ? this.options(this.server) : this.options; - let timer = null; - const done = (execErr) => { - if (completed) { - debug("loading complete", name); - return; - } - this._error = execErr; - if (execErr) { - debug("exec errored", name); - } else { - debug("exec completed", name); - } - completed = true; - if (timer) { - clearTimeout(timer); - } - callback(execErr); - }; - if (this.timeout > 0) { - debug("setting up timeout", name, this.timeout); - timer = setTimeout(function() { - debug("timed out", name); - timer = null; - const readyTimeoutErr = new AVV_ERR_PLUGIN_EXEC_TIMEOUT(name); - readyTimeoutErr.fn = func; - done(readyTimeoutErr); - }, this.timeout); - } - this.started = true; - this.startTime = Date.now(); - this.emit("start", this.server ? this.server.name : null, this.name, Date.now()); - const maybePromiseLike = func(this.server, this.options, done); - if (isPromiseLike(maybePromiseLike)) { - debug("exec: resolving promise", name); - maybePromiseLike.then( - () => process.nextTick(done), - (e) => process.nextTick(done, e) - ); - } else if (func.length < 3) { - done(); - } - }; - Plugin.prototype.loadedSoFar = function() { - debug("loadedSoFar", this.name); - if (this.loaded) { - return Promise.resolve(); - } - const setup = () => { - this.server.after((afterErr, callback) => { - this._error = afterErr; - this.queue.pause(); - if (this._promise) { - if (afterErr) { - debug("rejecting promise", this.name, afterErr); - this._promise.reject(afterErr); - } else { - debug("resolving promise", this.name); - this._promise.resolve(); - } - this._promise = null; - } - process.nextTick(callback, afterErr); - }); - this.queue.resume(); - }; - let res; - if (!this._promise) { - this._promise = createPromise(); - res = this._promise.promise; - if (!this.server) { - this.on("start", setup); - } else { - setup(); - } - } else { - res = Promise.resolve(); - } - return res; - }; - Plugin.prototype.enqueue = function(plugin, callback) { - debug("enqueue", this.name, plugin.name); - this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()); - this.queue.push(plugin, callback); - }; - Plugin.prototype.finish = function(err, callback) { - debug("finish", this.name, err); - const done = () => { - if (this.loaded) { - return; - } - debug("loaded", this.name); - this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()); - this.loaded = true; - callback(err); - }; - if (err) { - if (this._promise) { - this._promise.reject(err); - this._promise = null; - } - done(); - return; - } - const check = () => { - debug("check", this.name, this.queue.length(), this.queue.running(), this._promise); - if (this.queue.length() === 0 && this.queue.running() === 0) { - if (this._promise) { - const wrap = () => { - debug("wrap"); - queueMicrotask(check); - }; - this._promise.resolve(); - this._promise.promise.then(wrap, wrap); - this._promise = null; - } else { - done(); - } - } else { - debug("delayed", this.name); - this.queue.drain = () => { - debug("drain", this.name); - this.queue.drain = noop; - queueMicrotask(check); - }; - } - }; - queueMicrotask(check); - this.queue.resume(); - }; - function noop() { - } - module2.exports = { - Plugin - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/validate-plugin.js -var require_validate_plugin = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/validate-plugin.js"(exports2, module2) { - "use strict"; - var { AVV_ERR_PLUGIN_NOT_VALID } = require_errors(); - function validatePlugin(maybePlugin) { - if (!(maybePlugin && (typeof maybePlugin === "function" || typeof maybePlugin.then === "function"))) { - if (Array.isArray(maybePlugin)) { - throw new AVV_ERR_PLUGIN_NOT_VALID("array"); - } else if (maybePlugin === null) { - throw new AVV_ERR_PLUGIN_NOT_VALID("null"); - } else { - throw new AVV_ERR_PLUGIN_NOT_VALID(typeof maybePlugin); - } - } - } - module2.exports = { - validatePlugin - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/is-bundled-or-typescript-plugin.js -var require_is_bundled_or_typescript_plugin = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/is-bundled-or-typescript-plugin.js"(exports2, module2) { - "use strict"; - function isBundledOrTypescriptPlugin(maybeBundledOrTypescriptPlugin) { - return maybeBundledOrTypescriptPlugin !== null && typeof maybeBundledOrTypescriptPlugin === "object" && typeof maybeBundledOrTypescriptPlugin.default === "function"; - } - module2.exports = { - isBundledOrTypescriptPlugin - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/thenify.js -var require_thenify = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/thenify.js"(exports2, module2) { - "use strict"; - var { debug } = require_debug(); - var { kThenifyDoNotWrap } = require_symbols(); - function thenify() { - if (this.booted) { - debug("thenify returning undefined because we are already booted"); - return; - } - if (this[kThenifyDoNotWrap]) { - this[kThenifyDoNotWrap] = false; - return; - } - debug("thenify"); - return (resolve, reject) => { - const p = this._loadRegistered(); - return p.then(() => { - this[kThenifyDoNotWrap] = true; - return resolve(this._server); - }, reject); - }; - } - module2.exports = { - thenify - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/execute-with-thenable.js -var require_execute_with_thenable = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/lib/execute-with-thenable.js"(exports2, module2) { - "use strict"; - var { isPromiseLike } = require_is_promise_like(); - var { kAvvio } = require_symbols(); - function executeWithThenable(func, args, callback) { - let result; - try { - result = func.apply(func, args); - } catch (error) { - if (callback) { - process.nextTick(callback, error); - } - return; - } - if (isPromiseLike(result) && !result[kAvvio]) { - result.then(() => process.nextTick(callback), (error) => process.nextTick(callback, error)); - } else if (callback) { - process.nextTick(callback); - } - } - module2.exports = { - executeWithThenable - }; - } -}); - -// ../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/boot.js -var require_boot = __commonJS({ - "../../node_modules/.pnpm/avvio@9.2.0/node_modules/avvio/boot.js"(exports2, module2) { - "use strict"; - var fastq = require_queue(); - var EE = require("node:events").EventEmitter; - var inherits = require("node:util").inherits; - var { - AVV_ERR_EXPOSE_ALREADY_DEFINED, - AVV_ERR_CALLBACK_NOT_FN, - AVV_ERR_ROOT_PLG_BOOTED, - AVV_ERR_READY_TIMEOUT, - AVV_ERR_ATTRIBUTE_ALREADY_DEFINED - } = require_errors(); - var { - kAvvio, - kIsOnCloseHandler - } = require_symbols(); - var { TimeTree } = require_time_tree(); - var { Plugin } = require_plugin(); - var { debug } = require_debug(); - var { validatePlugin } = require_validate_plugin(); - var { isBundledOrTypescriptPlugin } = require_is_bundled_or_typescript_plugin(); - var { isPromiseLike } = require_is_promise_like(); - var { thenify } = require_thenify(); - var { executeWithThenable } = require_execute_with_thenable(); - function Boot(server, opts, done) { - if (typeof server === "function" && arguments.length === 1) { - done = server; - opts = {}; - server = null; - } - if (typeof opts === "function") { - done = opts; - opts = {}; - } - opts = opts || {}; - opts.autostart = opts.autostart !== false; - opts.timeout = Number(opts.timeout) || 0; - opts.expose = opts.expose || {}; - if (!new.target) { - return new Boot(server, opts, done); - } - this._server = server || this; - this._opts = opts; - if (server) { - this._expose(); - } - this._current = []; - this._error = null; - this._lastUsed = null; - this.setMaxListeners(0); - if (done) { - this.once("start", done); - } - this.started = false; - this.booted = false; - this.pluginTree = new TimeTree(); - this._readyQ = fastq(this, callWithCbOrNextTick, 1); - this._readyQ.pause(); - this._readyQ.drain = () => { - this.emit("start"); - this._readyQ.drain = noop; - }; - this._closeQ = fastq(this, closeWithCbOrNextTick, 1); - this._closeQ.pause(); - this._closeQ.drain = () => { - this.emit("close"); - this._closeQ.drain = noop; - }; - this._doStart = null; - const instance2 = this; - this._root = new Plugin(fastq(this, this._loadPluginNextTick, 1), function root(server2, opts2, done2) { - instance2._doStart = done2; - opts2.autostart && instance2.start(); - }, opts, false, 0); - this._trackPluginLoading(this._root); - this._loadPlugin(this._root, (err) => { - debug("root plugin ready"); - try { - this.emit("preReady"); - this._root = null; - } catch (preReadyError) { - err = err || this._error || preReadyError; - } - if (err) { - this._error = err; - if (this._readyQ.length() === 0) { - throw err; - } - } else { - this.booted = true; - } - this._readyQ.resume(); - }); - } - inherits(Boot, EE); - if ("asyncDispose" in Symbol) { - Boot.prototype[Symbol.asyncDispose] = function() { - return new Promise((resolve, reject) => { - this.close((err) => { - if (err) { - return reject(err); - } - resolve(); - }); - }); - }; - } - Boot.prototype.start = function() { - this.started = true; - process.nextTick(this._doStart); - return this; - }; - Boot.prototype.override = function(server, func, opts) { - return server; - }; - Boot.prototype[kAvvio] = true; - Boot.prototype.use = function(plugin, opts) { - this._lastUsed = this._addPlugin(plugin, opts, false); - return this; - }; - Boot.prototype._loadRegistered = function() { - const plugin = this._current[0]; - const weNeedToStart = !this.started && !this.booted; - if (weNeedToStart) { - process.nextTick(() => this._root.queue.resume()); - } - if (!plugin) { - return Promise.resolve(); - } - return plugin.loadedSoFar(); - }; - Object.defineProperty(Boot.prototype, "then", { get: thenify }); - Boot.prototype._addPlugin = function(pluginFn, opts, isAfter) { - if (isBundledOrTypescriptPlugin(pluginFn)) { - pluginFn = pluginFn.default; - } - validatePlugin(pluginFn); - opts = opts || {}; - if (this.booted) { - throw new AVV_ERR_ROOT_PLG_BOOTED(); - } - const current = this._current[0]; - let timeout = this._opts.timeout; - if (!current.loaded && current.timeout > 0) { - const delta = Date.now() - current.startTime; - timeout = current.timeout - (delta + 3); - } - const plugin = new Plugin(fastq(this, this._loadPluginNextTick, 1), pluginFn, opts, isAfter, timeout); - this._trackPluginLoading(plugin); - if (current.loaded) { - throw new Error(plugin.name, current.name); - } - current.enqueue(plugin, (err) => { - err && (this._error = err); - }); - return plugin; - }; - Boot.prototype._expose = function _expose() { - const instance2 = this; - const server = instance2._server; - const { - use: useKey = "use", - after: afterKey = "after", - ready: readyKey = "ready", - onClose: onCloseKey = "onClose", - close: closeKey = "close" - } = this._opts.expose; - if (server[useKey]) { - throw new AVV_ERR_EXPOSE_ALREADY_DEFINED(useKey, "use"); - } - server[useKey] = function(fn, opts) { - instance2.use(fn, opts); - return this; - }; - if (server[afterKey]) { - throw new AVV_ERR_EXPOSE_ALREADY_DEFINED(afterKey, "after"); - } - server[afterKey] = function(func) { - if (typeof func !== "function") { - return instance2._loadRegistered(); - } - instance2.after(encapsulateThreeParam(func, this)); - return this; - }; - if (server[readyKey]) { - throw new AVV_ERR_EXPOSE_ALREADY_DEFINED(readyKey, "ready"); - } - server[readyKey] = function(func) { - if (func && typeof func !== "function") { - throw new AVV_ERR_CALLBACK_NOT_FN(readyKey, typeof func); - } - return instance2.ready(func ? encapsulateThreeParam(func, this) : void 0); - }; - if (server[onCloseKey]) { - throw new AVV_ERR_EXPOSE_ALREADY_DEFINED(onCloseKey, "onClose"); - } - server[onCloseKey] = function(func) { - if (typeof func !== "function") { - throw new AVV_ERR_CALLBACK_NOT_FN(onCloseKey, typeof func); - } - instance2.onClose(encapsulateTwoParam(func, this)); - return this; - }; - if (server[closeKey]) { - throw new AVV_ERR_EXPOSE_ALREADY_DEFINED(closeKey, "close"); - } - server[closeKey] = function(func) { - if (func && typeof func !== "function") { - throw new AVV_ERR_CALLBACK_NOT_FN(closeKey, typeof func); - } - if (func) { - instance2.close(encapsulateThreeParam(func, this)); - return this; - } - return instance2.close(); - }; - if (server.then) { - throw new AVV_ERR_ATTRIBUTE_ALREADY_DEFINED("then"); - } - Object.defineProperty(server, "then", { get: thenify.bind(instance2) }); - server[kAvvio] = true; - }; - Boot.prototype.after = function(func) { - if (!func) { - return this._loadRegistered(); - } - this._addPlugin(_after.bind(this), {}, true); - function _after(s, opts, done) { - callWithCbOrNextTick.call(this, func, done); - } - return this; - }; - Boot.prototype.onClose = function(func) { - if (typeof func !== "function") { - throw new AVV_ERR_CALLBACK_NOT_FN("onClose", typeof func); - } - func[kIsOnCloseHandler] = true; - this._closeQ.unshift(func, (err) => { - err && (this._error = err); - }); - return this; - }; - Boot.prototype.close = function(func) { - let promise; - if (func) { - if (typeof func !== "function") { - throw new AVV_ERR_CALLBACK_NOT_FN("close", typeof func); - } - } else { - promise = new Promise(function(resolve, reject) { - func = function(err) { - if (err) { - return reject(err); - } - resolve(); - }; - }); - } - this.ready(() => { - this._error = null; - this._closeQ.push(func); - process.nextTick(this._closeQ.resume.bind(this._closeQ)); - }); - return promise; - }; - Boot.prototype.ready = function(func) { - if (func) { - if (typeof func !== "function") { - throw new AVV_ERR_CALLBACK_NOT_FN("ready", typeof func); - } - this._readyQ.push(func); - queueMicrotask(this.start.bind(this)); - return; - } - return new Promise((resolve, reject) => { - this._readyQ.push(readyPromiseCB); - this.start(); - const relativeContext = this._current[0].server; - function readyPromiseCB(err, context, done) { - if (err) { - reject(err); - } else { - resolve(relativeContext); - } - process.nextTick(done); - } - }); - }; - Boot.prototype._trackPluginLoading = function(plugin) { - const parentName = this._current[0]?.name || null; - plugin.once("start", (serverName, funcName, time) => { - const nodeId = this.pluginTree.start(parentName || null, funcName, time); - plugin.once("loaded", (serverName2, funcName2, time2) => { - this.pluginTree.stop(nodeId, time2); - }); - }); - }; - Boot.prototype.prettyPrint = function() { - return this.pluginTree.prettyPrint(); - }; - Boot.prototype.toJSON = function() { - return this.pluginTree.toJSON(); - }; - Boot.prototype._loadPlugin = function(plugin, callback) { - const instance2 = this; - if (isPromiseLike(plugin.func)) { - plugin.func.then((fn) => { - if (typeof fn.default === "function") { - fn = fn.default; - } - plugin.func = fn; - this._loadPlugin(plugin, callback); - }, callback); - return; - } - const last = instance2._current[0]; - instance2._current.unshift(plugin); - if (instance2._error && !plugin.isAfter) { - debug("skipping loading of plugin as instance errored and it is not an after", plugin.name); - process.nextTick(execCallback); - return; - } - let server = last?.server || instance2._server; - if (!plugin.isAfter) { - try { - server = instance2.override(server, plugin.func, plugin.options); - } catch (overrideErr) { - debug("override errored", plugin.name); - return execCallback(overrideErr); - } - } - plugin.exec(server, execCallback); - function execCallback(err) { - plugin.finish(err, (err2) => { - instance2._current.shift(); - callback(err2); - }); - } - }; - Boot.prototype._loadPluginNextTick = function(plugin, callback) { - process.nextTick(this._loadPlugin.bind(this), plugin, callback); - }; - function noop() { - } - function callWithCbOrNextTick(func, cb) { - const context = this._server; - const err = this._error; - this._error = null; - if (func.length === 0) { - this._error = err; - executeWithThenable(func, [], cb); - } else if (func.length === 1) { - executeWithThenable(func, [err], cb); - } else { - if (this._opts.timeout === 0) { - const wrapCb = (err2) => { - this._error = err2; - cb(this._error); - }; - if (func.length === 2) { - func(err, wrapCb); - } else { - func(err, context, wrapCb); - } - } else { - timeoutCall.call(this, func, err, context, cb); - } - } - } - function timeoutCall(func, rootErr, context, cb) { - const name = func.unwrappedName ?? func.name; - debug("setting up ready timeout", name, this._opts.timeout); - let timer = setTimeout(() => { - debug("timed out", name); - timer = null; - const toutErr = new AVV_ERR_READY_TIMEOUT(name); - toutErr.fn = func; - this._error = toutErr; - cb(toutErr); - }, this._opts.timeout); - if (func.length === 2) { - func(rootErr, timeoutCb.bind(this)); - } else { - func(rootErr, context, timeoutCb.bind(this)); - } - function timeoutCb(err) { - if (timer) { - clearTimeout(timer); - this._error = err; - cb(this._error); - } else { - } - } - } - function closeWithCbOrNextTick(func, cb) { - const context = this._server; - const isOnCloseHandler = func[kIsOnCloseHandler]; - if (func.length === 0 || func.length === 1) { - let promise; - if (isOnCloseHandler) { - promise = func(context); - } else { - promise = func(this._error); - } - if (promise && typeof promise.then === "function") { - debug("resolving close/onClose promise"); - promise.then( - () => process.nextTick(cb), - (e) => process.nextTick(cb, e) - ); - } else { - process.nextTick(cb); - } - } else if (func.length === 2) { - if (isOnCloseHandler) { - func(context, cb); - } else { - func(this._error, cb); - } - } else { - if (isOnCloseHandler) { - func(context, cb); - } else { - func(this._error, context, cb); - } - } - } - function encapsulateTwoParam(func, that) { - return _encapsulateTwoParam.bind(that); - function _encapsulateTwoParam(context, cb) { - let res; - if (func.length === 0) { - res = func(); - if (res?.then) { - res.then(function() { - process.nextTick(cb); - }, cb); - } else { - process.nextTick(cb); - } - } else if (func.length === 1) { - res = func(this); - if (res?.then) { - res.then(function() { - process.nextTick(cb); - }, cb); - } else { - process.nextTick(cb); - } - } else { - func(this, cb); - } - } - } - function encapsulateThreeParam(func, that) { - const wrapped = _encapsulateThreeParam.bind(that); - wrapped.unwrappedName = func.name; - return wrapped; - function _encapsulateThreeParam(err, cb) { - let res; - if (!func) { - process.nextTick(cb); - } else if (func.length === 0) { - res = func(); - if (res?.then) { - res.then(function() { - process.nextTick(cb, err); - }, cb); - } else { - process.nextTick(cb, err); - } - } else if (func.length === 1) { - res = func(err); - if (res?.then) { - res.then(function() { - process.nextTick(cb); - }, cb); - } else { - process.nextTick(cb); - } - } else if (func.length === 2) { - func(err, cb); - } else { - func(err, this, cb); - } - } - } - module2.exports = Boot; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/symbols.js -var require_symbols2 = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/symbols.js"(exports2, module2) { - "use strict"; - var keys = { - kAvvioBoot: Symbol("fastify.avvioBoot"), - kChildren: Symbol("fastify.children"), - kServerBindings: Symbol("fastify.serverBindings"), - kBodyLimit: Symbol("fastify.bodyLimit"), - kSupportedHTTPMethods: Symbol("fastify.acceptedHTTPMethods"), - kRoutePrefix: Symbol("fastify.routePrefix"), - kLogLevel: Symbol("fastify.logLevel"), - kLogSerializers: Symbol("fastify.logSerializers"), - kHooks: Symbol("fastify.hooks"), - kContentTypeParser: Symbol("fastify.contentTypeParser"), - kState: Symbol("fastify.state"), - kOptions: Symbol("fastify.options"), - kDisableRequestLogging: Symbol("fastify.disableRequestLogging"), - kPluginNameChain: Symbol("fastify.pluginNameChain"), - kRouteContext: Symbol("fastify.context"), - kGenReqId: Symbol("fastify.genReqId"), - kHttp2ServerSessions: Symbol("fastify.http2ServerSessions"), - // Schema - kSchemaController: Symbol("fastify.schemaController"), - kSchemaHeaders: Symbol("headers-schema"), - kSchemaParams: Symbol("params-schema"), - kSchemaQuerystring: Symbol("querystring-schema"), - kSchemaBody: Symbol("body-schema"), - kSchemaResponse: Symbol("response-schema"), - kSchemaErrorFormatter: Symbol("fastify.schemaErrorFormatter"), - kSchemaVisited: Symbol("fastify.schemas.visited"), - // Request - kRequest: Symbol("fastify.Request"), - kRequestPayloadStream: Symbol("fastify.RequestPayloadStream"), - kRequestAcceptVersion: Symbol("fastify.RequestAcceptVersion"), - kRequestCacheValidateFns: Symbol("fastify.request.cache.validateFns"), - kRequestOriginalUrl: Symbol("fastify.request.originalUrl"), - kRequestSignal: Symbol("fastify.request.signal"), - kHandlerTimeout: Symbol("fastify.handlerTimeout"), - kTimeoutTimer: Symbol("fastify.request.timeoutTimer"), - kOnAbort: Symbol("fastify.request.onAbort"), - // 404 - kFourOhFour: Symbol("fastify.404"), - kCanSetNotFoundHandler: Symbol("fastify.canSetNotFoundHandler"), - kFourOhFourLevelInstance: Symbol("fastify.404LogLevelInstance"), - kFourOhFourContext: Symbol("fastify.404ContextKey"), - kDefaultJsonParse: Symbol("fastify.defaultJSONParse"), - // Reply - kReply: Symbol("fastify.Reply"), - kReplySerializer: Symbol("fastify.reply.serializer"), - kReplyIsError: Symbol("fastify.reply.isError"), - kReplyHeaders: Symbol("fastify.reply.headers"), - kReplyTrailers: Symbol("fastify.reply.trailers"), - kReplyHasStatusCode: Symbol("fastify.reply.hasStatusCode"), - kReplyHijacked: Symbol("fastify.reply.hijacked"), - kReplyStartTime: Symbol("fastify.reply.startTime"), - kReplyNextErrorHandler: Symbol("fastify.reply.nextErrorHandler"), - kReplyEndTime: Symbol("fastify.reply.endTime"), - kReplyErrorHandlerCalled: Symbol("fastify.reply.errorHandlerCalled"), - kReplyIsRunningOnErrorHook: Symbol("fastify.reply.isRunningOnErrorHook"), - kReplySerializerDefault: Symbol("fastify.replySerializerDefault"), - kReplyCacheSerializeFns: Symbol("fastify.reply.cache.serializeFns"), - // This symbol is only meant to be used for fastify tests and should not be used for any other purpose - kTestInternals: Symbol("fastify.testInternals"), - kErrorHandler: Symbol("fastify.errorHandler"), - kErrorHandlerAlreadySet: Symbol("fastify.errorHandlerAlreadySet"), - kChildLoggerFactory: Symbol("fastify.childLoggerFactory"), - kHasBeenDecorated: Symbol("fastify.hasBeenDecorated"), - kKeepAliveConnections: Symbol("fastify.keepAliveConnections"), - kRouteByFastify: Symbol("fastify.routeByFastify") - }; - module2.exports = keys; - } -}); - -// ../../node_modules/.pnpm/process-warning@5.0.0/node_modules/process-warning/index.js -var require_process_warning = __commonJS({ - "../../node_modules/.pnpm/process-warning@5.0.0/node_modules/process-warning/index.js"(exports2, module2) { - "use strict"; - var { format } = require("node:util"); - function createDeprecation(params) { - return createWarning({ ...params, name: "DeprecationWarning" }); - } - function createWarning({ name, code, message, unlimited = false } = {}) { - if (!name) - throw new Error("Warning name must not be empty"); - if (!code) - throw new Error("Warning code must not be empty"); - if (!message) - throw new Error("Warning message must not be empty"); - if (typeof unlimited !== "boolean") - throw new Error("Warning opts.unlimited must be a boolean"); - code = code.toUpperCase(); - let warningContainer = { - [name]: function(a, b, c) { - if (warning.emitted === true && warning.unlimited !== true) { - return; - } - warning.emitted = true; - process.emitWarning(warning.format(a, b, c), warning.name, warning.code); - } - }; - if (unlimited) { - warningContainer = { - [name]: function(a, b, c) { - warning.emitted = true; - process.emitWarning(warning.format(a, b, c), warning.name, warning.code); - } - }; - } - const warning = warningContainer[name]; - warning.emitted = false; - warning.message = message; - warning.unlimited = unlimited; - warning.code = code; - warning.format = function(a, b, c) { - let formatted; - if (a && b && c) { - formatted = format(message, a, b, c); - } else if (a && b) { - formatted = format(message, a, b); - } else if (a) { - formatted = format(message, a); - } else { - formatted = message; - } - return formatted; - }; - return warning; - } - var out = { createWarning, createDeprecation }; - module2.exports = out; - module2.exports.default = out; - module2.exports.processWarning = out; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/warnings.js -var require_warnings = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/warnings.js"(exports2, module2) { - "use strict"; - var { createWarning } = require_process_warning(); - var FSTWRN001 = createWarning({ - name: "FastifyWarning", - code: "FSTWRN001", - message: "The %s schema for %s: %s is missing. This may indicate the schema is not well specified.", - unlimited: true - }); - var FSTWRN003 = createWarning({ - name: "FastifyWarning", - code: "FSTWRN003", - message: "The %s mixes async and callback styles that may lead to unhandled rejections. Please use only one of them.", - unlimited: true - }); - var FSTWRN004 = createWarning({ - name: "FastifyWarning", - code: "FSTWRN004", - message: "It seems that you are overriding an errorHandler in the same scope, which can lead to subtle bugs.", - unlimited: true - }); - var FSTSEC001 = createWarning({ - name: "FastifySecurity", - code: "FSTSEC001", - message: 'You are using /%s/ Content-Type which may be vulnerable to CORS attack. Please make sure your RegExp start with "^" or include ";?" to proper detection of the essence MIME type.', - unlimited: true - }); - var FSTDEP022 = createWarning({ - name: "FastifyWarning", - code: "FSTDEP022", - message: 'The router options for %s property access is deprecated. Please use "options.routerOptions" instead for accessing router options. The router options will be removed in `fastify@6`.', - unlimited: true - }); - module2.exports = { - FSTWRN001, - FSTWRN003, - FSTWRN004, - FSTSEC001, - FSTDEP022 - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/errors.js -var require_errors2 = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/errors.js"(exports2, module2) { - "use strict"; - var createError = require_error(); - var codes = { - /** - * Basic - */ - FST_ERR_NOT_FOUND: createError( - "FST_ERR_NOT_FOUND", - "Not Found", - 404 - ), - FST_ERR_OPTIONS_NOT_OBJ: createError( - "FST_ERR_OPTIONS_NOT_OBJ", - "Options must be an object", - 500, - TypeError - ), - FST_ERR_QSP_NOT_FN: createError( - "FST_ERR_QSP_NOT_FN", - "querystringParser option should be a function, instead got '%s'", - 500, - TypeError - ), - FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN: createError( - "FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN", - "schemaController.bucket option should be a function, instead got '%s'", - 500, - TypeError - ), - FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN: createError( - "FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN", - "schemaErrorFormatter option should be a non async function. Instead got '%s'.", - 500, - TypeError - ), - FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ: createError( - "FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ", - "ajv.customOptions option should be an object, instead got '%s'", - 500, - TypeError - ), - FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR: createError( - "FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR", - "ajv.plugins option should be an array, instead got '%s'", - 500, - TypeError - ), - FST_ERR_VALIDATION: createError( - "FST_ERR_VALIDATION", - "%s", - 400 - ), - FST_ERR_LISTEN_OPTIONS_INVALID: createError( - "FST_ERR_LISTEN_OPTIONS_INVALID", - "Invalid listen options: '%s'", - 500, - TypeError - ), - FST_ERR_ERROR_HANDLER_NOT_FN: createError( - "FST_ERR_ERROR_HANDLER_NOT_FN", - "Error Handler must be a function", - 500, - TypeError - ), - FST_ERR_ERROR_HANDLER_ALREADY_SET: createError( - "FST_ERR_ERROR_HANDLER_ALREADY_SET", - "Error Handler already set in this scope. Set 'allowErrorHandlerOverride: true' to allow overriding.", - 500, - TypeError - ), - /** - * ContentTypeParser - */ - FST_ERR_CTP_ALREADY_PRESENT: createError( - "FST_ERR_CTP_ALREADY_PRESENT", - "Content type parser '%s' already present." - ), - FST_ERR_CTP_INVALID_TYPE: createError( - "FST_ERR_CTP_INVALID_TYPE", - "The content type should be a string or a RegExp", - 500, - TypeError - ), - FST_ERR_CTP_EMPTY_TYPE: createError( - "FST_ERR_CTP_EMPTY_TYPE", - "The content type cannot be an empty string", - 500, - TypeError - ), - FST_ERR_CTP_INVALID_HANDLER: createError( - "FST_ERR_CTP_INVALID_HANDLER", - "The content type handler should be a function", - 500, - TypeError - ), - FST_ERR_CTP_INVALID_PARSE_TYPE: createError( - "FST_ERR_CTP_INVALID_PARSE_TYPE", - "The body parser can only parse your data as 'string' or 'buffer', you asked '%s' which is not supported.", - 500, - TypeError - ), - FST_ERR_CTP_BODY_TOO_LARGE: createError( - "FST_ERR_CTP_BODY_TOO_LARGE", - "Request body is too large", - 413, - RangeError - ), - FST_ERR_CTP_INVALID_MEDIA_TYPE: createError( - "FST_ERR_CTP_INVALID_MEDIA_TYPE", - "Unsupported Media Type", - 415 - ), - FST_ERR_CTP_INVALID_CONTENT_LENGTH: createError( - "FST_ERR_CTP_INVALID_CONTENT_LENGTH", - "Request body size did not match Content-Length", - 400, - RangeError - ), - FST_ERR_CTP_EMPTY_JSON_BODY: createError( - "FST_ERR_CTP_EMPTY_JSON_BODY", - "Body cannot be empty when content-type is set to 'application/json'", - 400 - ), - FST_ERR_CTP_INVALID_JSON_BODY: createError( - "FST_ERR_CTP_INVALID_JSON_BODY", - "Body is not valid JSON but content-type is set to 'application/json'", - 400 - ), - FST_ERR_CTP_INSTANCE_ALREADY_STARTED: createError( - "FST_ERR_CTP_INSTANCE_ALREADY_STARTED", - 'Cannot call "%s" when fastify instance is already started!', - 400 - ), - /** - * decorate - */ - FST_ERR_DEC_ALREADY_PRESENT: createError( - "FST_ERR_DEC_ALREADY_PRESENT", - "The decorator '%s' has already been added!" - ), - FST_ERR_DEC_DEPENDENCY_INVALID_TYPE: createError( - "FST_ERR_DEC_DEPENDENCY_INVALID_TYPE", - "The dependencies of decorator '%s' must be of type Array.", - 500, - TypeError - ), - FST_ERR_DEC_MISSING_DEPENDENCY: createError( - "FST_ERR_DEC_MISSING_DEPENDENCY", - "The decorator is missing dependency '%s'." - ), - FST_ERR_DEC_AFTER_START: createError( - "FST_ERR_DEC_AFTER_START", - "The decorator '%s' has been added after start!" - ), - FST_ERR_DEC_REFERENCE_TYPE: createError( - "FST_ERR_DEC_REFERENCE_TYPE", - "The decorator '%s' of type '%s' is a reference type. Use the { getter, setter } interface instead." - ), - FST_ERR_DEC_UNDECLARED: createError( - "FST_ERR_DEC_UNDECLARED", - "No decorator '%s' has been declared on %s." - ), - /** - * hooks - */ - FST_ERR_HOOK_INVALID_TYPE: createError( - "FST_ERR_HOOK_INVALID_TYPE", - "The hook name must be a string", - 500, - TypeError - ), - FST_ERR_HOOK_INVALID_HANDLER: createError( - "FST_ERR_HOOK_INVALID_HANDLER", - "%s hook should be a function, instead got %s", - 500, - TypeError - ), - FST_ERR_HOOK_INVALID_ASYNC_HANDLER: createError( - "FST_ERR_HOOK_INVALID_ASYNC_HANDLER", - "Async function has too many arguments. Async hooks should not use the 'done' argument.", - 500, - TypeError - ), - FST_ERR_HOOK_NOT_SUPPORTED: createError( - "FST_ERR_HOOK_NOT_SUPPORTED", - "%s hook not supported!", - 500, - TypeError - ), - /** - * Middlewares - */ - FST_ERR_MISSING_MIDDLEWARE: createError( - "FST_ERR_MISSING_MIDDLEWARE", - "You must register a plugin for handling middlewares, visit fastify.dev/docs/latest/Reference/Middleware/ for more info.", - 500 - ), - FST_ERR_HOOK_TIMEOUT: createError( - "FST_ERR_HOOK_TIMEOUT", - "A callback for '%s' hook%s timed out. You may have forgotten to call 'done' function or to resolve a Promise" - ), - /** - * logger - */ - FST_ERR_LOG_INVALID_DESTINATION: createError( - "FST_ERR_LOG_INVALID_DESTINATION", - "Cannot specify both logger.stream and logger.file options" - ), - FST_ERR_LOG_INVALID_LOGGER: createError( - "FST_ERR_LOG_INVALID_LOGGER", - "Invalid logger object provided. The logger instance should have these functions(s): '%s'.", - 500, - TypeError - ), - FST_ERR_LOG_INVALID_LOGGER_INSTANCE: createError( - "FST_ERR_LOG_INVALID_LOGGER_INSTANCE", - "loggerInstance only accepts a logger instance.", - 500, - TypeError - ), - FST_ERR_LOG_INVALID_LOGGER_CONFIG: createError( - "FST_ERR_LOG_INVALID_LOGGER_CONFIG", - "logger options only accepts a configuration object.", - 500, - TypeError - ), - FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED: createError( - "FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED", - "You cannot provide both logger and loggerInstance. Please provide only one.", - 500, - TypeError - ), - /** - * reply - */ - FST_ERR_REP_INVALID_PAYLOAD_TYPE: createError( - "FST_ERR_REP_INVALID_PAYLOAD_TYPE", - "Attempted to send payload of invalid type '%s'. Expected a string or Buffer.", - 500, - TypeError - ), - FST_ERR_REP_RESPONSE_BODY_CONSUMED: createError( - "FST_ERR_REP_RESPONSE_BODY_CONSUMED", - "Response.body is already consumed." - ), - FST_ERR_REP_READABLE_STREAM_LOCKED: createError( - "FST_ERR_REP_READABLE_STREAM_LOCKED", - "ReadableStream was locked. You should call releaseLock() method on reader before sending." - ), - FST_ERR_REP_ALREADY_SENT: createError( - "FST_ERR_REP_ALREADY_SENT", - 'Reply was already sent, did you forget to "return reply" in "%s" (%s)?' - ), - FST_ERR_REP_SENT_VALUE: createError( - "FST_ERR_REP_SENT_VALUE", - "The only possible value for reply.sent is true.", - 500, - TypeError - ), - FST_ERR_SEND_INSIDE_ONERR: createError( - "FST_ERR_SEND_INSIDE_ONERR", - "You cannot use `send` inside the `onError` hook" - ), - FST_ERR_SEND_UNDEFINED_ERR: createError( - "FST_ERR_SEND_UNDEFINED_ERR", - "Undefined error has occurred" - ), - FST_ERR_BAD_STATUS_CODE: createError( - "FST_ERR_BAD_STATUS_CODE", - "Called reply with an invalid status code: %s" - ), - FST_ERR_BAD_TRAILER_NAME: createError( - "FST_ERR_BAD_TRAILER_NAME", - "Called reply.trailer with an invalid header name: %s" - ), - FST_ERR_BAD_TRAILER_VALUE: createError( - "FST_ERR_BAD_TRAILER_VALUE", - "Called reply.trailer('%s', fn) with an invalid type: %s. Expected a function." - ), - FST_ERR_FAILED_ERROR_SERIALIZATION: createError( - "FST_ERR_FAILED_ERROR_SERIALIZATION", - "Failed to serialize an error. Error: %s. Original error: %s" - ), - FST_ERR_MISSING_SERIALIZATION_FN: createError( - "FST_ERR_MISSING_SERIALIZATION_FN", - 'Missing serialization function. Key "%s"' - ), - FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN: createError( - "FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN", - 'Missing serialization function. Key "%s:%s"' - ), - FST_ERR_REQ_INVALID_VALIDATION_INVOCATION: createError( - "FST_ERR_REQ_INVALID_VALIDATION_INVOCATION", - 'Invalid validation invocation. Missing validation function for HTTP part "%s" nor schema provided.' - ), - /** - * schemas - */ - FST_ERR_SCH_MISSING_ID: createError( - "FST_ERR_SCH_MISSING_ID", - "Missing schema $id property" - ), - FST_ERR_SCH_ALREADY_PRESENT: createError( - "FST_ERR_SCH_ALREADY_PRESENT", - "Schema with id '%s' already declared!" - ), - FST_ERR_SCH_CONTENT_MISSING_SCHEMA: createError( - "FST_ERR_SCH_CONTENT_MISSING_SCHEMA", - "Schema is missing for the content type '%s'" - ), - FST_ERR_SCH_DUPLICATE: createError( - "FST_ERR_SCH_DUPLICATE", - "Schema with '%s' already present!" - ), - FST_ERR_SCH_VALIDATION_BUILD: createError( - "FST_ERR_SCH_VALIDATION_BUILD", - "Failed building the validation schema for %s: %s, due to error %s" - ), - FST_ERR_SCH_SERIALIZATION_BUILD: createError( - "FST_ERR_SCH_SERIALIZATION_BUILD", - "Failed building the serialization schema for %s: %s, due to error %s" - ), - FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX: createError( - "FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX", - 'response schemas should be nested under a valid status code, e.g { 2xx: { type: "object" } }' - ), - /** - * initialConfig - */ - FST_ERR_INIT_OPTS_INVALID: createError( - "FST_ERR_INIT_OPTS_INVALID", - "Invalid initialization options: '%s'" - ), - FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE: createError( - "FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE", - "Cannot set forceCloseConnections to 'idle' as your HTTP server does not support closeIdleConnections method" - ), - /** - * router - */ - FST_ERR_DUPLICATED_ROUTE: createError( - "FST_ERR_DUPLICATED_ROUTE", - "Method '%s' already declared for route '%s'" - ), - FST_ERR_BAD_URL: createError( - "FST_ERR_BAD_URL", - "'%s' is not a valid url component", - 400, - URIError - ), - FST_ERR_ASYNC_CONSTRAINT: createError( - "FST_ERR_ASYNC_CONSTRAINT", - "Unexpected error from async constraint", - 500 - ), - FST_ERR_INVALID_URL: createError( - "FST_ERR_INVALID_URL", - "URL must be a string. Received '%s'", - 400, - TypeError - ), - FST_ERR_ROUTE_OPTIONS_NOT_OBJ: createError( - "FST_ERR_ROUTE_OPTIONS_NOT_OBJ", - 'Options for "%s:%s" route must be an object', - 500, - TypeError - ), - FST_ERR_ROUTE_DUPLICATED_HANDLER: createError( - "FST_ERR_ROUTE_DUPLICATED_HANDLER", - 'Duplicate handler for "%s:%s" route is not allowed!', - 500 - ), - FST_ERR_ROUTE_HANDLER_NOT_FN: createError( - "FST_ERR_ROUTE_HANDLER_NOT_FN", - "Error Handler for %s:%s route, if defined, must be a function", - 500, - TypeError - ), - FST_ERR_ROUTE_MISSING_HANDLER: createError( - "FST_ERR_ROUTE_MISSING_HANDLER", - 'Missing handler function for "%s:%s" route.', - 500 - ), - FST_ERR_ROUTE_METHOD_INVALID: createError( - "FST_ERR_ROUTE_METHOD_INVALID", - "Provided method is invalid!", - 500, - TypeError - ), - FST_ERR_ROUTE_METHOD_NOT_SUPPORTED: createError( - "FST_ERR_ROUTE_METHOD_NOT_SUPPORTED", - "%s method is not supported.", - 500 - ), - FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED: createError( - "FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED", - "Body validation schema for %s:%s route is not supported!", - 500 - ), - FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT: createError( - "FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT", - "'bodyLimit' option must be an integer > 0. Got '%s'", - 500, - TypeError - ), - FST_ERR_HANDLER_TIMEOUT: createError( - "FST_ERR_HANDLER_TIMEOUT", - "Request timed out after %s ms on route '%s'", - 503 - ), - FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT: createError( - "FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT", - "'handlerTimeout' option must be an integer > 0. Got '%s'", - 500, - TypeError - ), - FST_ERR_ROUTE_REWRITE_NOT_STR: createError( - "FST_ERR_ROUTE_REWRITE_NOT_STR", - 'Rewrite url for "%s" needs to be of type "string" but received "%s"', - 500, - TypeError - ), - /** - * again listen when close server - */ - FST_ERR_REOPENED_CLOSE_SERVER: createError( - "FST_ERR_REOPENED_CLOSE_SERVER", - "Fastify has already been closed and cannot be reopened" - ), - FST_ERR_REOPENED_SERVER: createError( - "FST_ERR_REOPENED_SERVER", - "Fastify is already listening" - ), - FST_ERR_INSTANCE_ALREADY_LISTENING: createError( - "FST_ERR_INSTANCE_ALREADY_LISTENING", - "Fastify instance is already listening. %s" - ), - /** - * plugin - */ - FST_ERR_PLUGIN_VERSION_MISMATCH: createError( - "FST_ERR_PLUGIN_VERSION_MISMATCH", - "fastify-plugin: %s - expected '%s' fastify version, '%s' is installed" - ), - FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE: createError( - "FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE", - "The decorator '%s'%s is not present in %s" - ), - FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER: createError( - "FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER", - "The %s plugin being registered mixes async and callback styles. Async plugin should not mix async and callback style.", - 500, - TypeError - ), - /** - * Avvio Errors - */ - FST_ERR_PLUGIN_CALLBACK_NOT_FN: createError( - "FST_ERR_PLUGIN_CALLBACK_NOT_FN", - "fastify-plugin: %s", - 500, - TypeError - ), - FST_ERR_PLUGIN_NOT_VALID: createError( - "FST_ERR_PLUGIN_NOT_VALID", - "fastify-plugin: %s" - ), - FST_ERR_ROOT_PLG_BOOTED: createError( - "FST_ERR_ROOT_PLG_BOOTED", - "fastify-plugin: %s" - ), - FST_ERR_PARENT_PLUGIN_BOOTED: createError( - "FST_ERR_PARENT_PLUGIN_BOOTED", - "fastify-plugin: %s" - ), - FST_ERR_PLUGIN_TIMEOUT: createError( - "FST_ERR_PLUGIN_TIMEOUT", - "fastify-plugin: %s" - ) - }; - function appendStackTrace(oldErr, newErr) { - newErr.cause = oldErr; - return newErr; - } - module2.exports = codes; - module2.exports.appendStackTrace = appendStackTrace; - module2.exports.AVVIO_ERRORS_MAP = { - AVV_ERR_CALLBACK_NOT_FN: codes.FST_ERR_PLUGIN_CALLBACK_NOT_FN, - AVV_ERR_PLUGIN_NOT_VALID: codes.FST_ERR_PLUGIN_NOT_VALID, - AVV_ERR_ROOT_PLG_BOOTED: codes.FST_ERR_ROOT_PLG_BOOTED, - AVV_ERR_PARENT_PLG_LOADED: codes.FST_ERR_PARENT_PLUGIN_BOOTED, - AVV_ERR_READY_TIMEOUT: codes.FST_ERR_PLUGIN_TIMEOUT, - AVV_ERR_PLUGIN_EXEC_TIMEOUT: codes.FST_ERR_PLUGIN_TIMEOUT - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/hooks.js -var require_hooks = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/hooks.js"(exports2, module2) { - "use strict"; - var applicationHooks = [ - "onRoute", - "onRegister", - "onReady", - "onListen", - "preClose", - "onClose" - ]; - var lifecycleHooks = [ - "onTimeout", - "onRequest", - "preParsing", - "preValidation", - "preSerialization", - "preHandler", - "onSend", - "onResponse", - "onError", - "onRequestAbort" - ]; - var supportedHooks = lifecycleHooks.concat(applicationHooks); - var { - FST_ERR_HOOK_INVALID_TYPE, - FST_ERR_HOOK_INVALID_HANDLER, - FST_ERR_SEND_UNDEFINED_ERR, - FST_ERR_HOOK_TIMEOUT, - FST_ERR_HOOK_NOT_SUPPORTED, - AVVIO_ERRORS_MAP, - appendStackTrace - } = require_errors2(); - var { - kChildren, - kHooks, - kRequestPayloadStream - } = require_symbols2(); - function Hooks() { - this.onRequest = []; - this.preParsing = []; - this.preValidation = []; - this.preSerialization = []; - this.preHandler = []; - this.onResponse = []; - this.onSend = []; - this.onError = []; - this.onRoute = []; - this.onRegister = []; - this.onReady = []; - this.onListen = []; - this.onTimeout = []; - this.onRequestAbort = []; - this.preClose = []; - } - Hooks.prototype = /* @__PURE__ */ Object.create(null); - Hooks.prototype.validate = function(hook, fn) { - if (typeof hook !== "string") - throw new FST_ERR_HOOK_INVALID_TYPE(); - if (Array.isArray(this[hook]) === false) { - throw new FST_ERR_HOOK_NOT_SUPPORTED(hook); - } - if (typeof fn !== "function") - throw new FST_ERR_HOOK_INVALID_HANDLER(hook, Object.prototype.toString.call(fn)); - }; - Hooks.prototype.add = function(hook, fn) { - this.validate(hook, fn); - this[hook].push(fn); - }; - function buildHooks(h) { - const hooks = new Hooks(); - hooks.onRequest = h.onRequest.slice(); - hooks.preParsing = h.preParsing.slice(); - hooks.preValidation = h.preValidation.slice(); - hooks.preSerialization = h.preSerialization.slice(); - hooks.preHandler = h.preHandler.slice(); - hooks.onSend = h.onSend.slice(); - hooks.onResponse = h.onResponse.slice(); - hooks.onError = h.onError.slice(); - hooks.onRoute = h.onRoute.slice(); - hooks.onRegister = h.onRegister.slice(); - hooks.onTimeout = h.onTimeout.slice(); - hooks.onRequestAbort = h.onRequestAbort.slice(); - hooks.onReady = []; - hooks.onListen = []; - hooks.preClose = []; - return hooks; - } - function hookRunnerApplication(hookName, boot, server, cb) { - const hooks = server[kHooks][hookName]; - let i = 0; - let c = 0; - next(); - function exit(err) { - const hookFnName = hooks[i - 1]?.name; - const hookFnFragment = hookFnName ? ` "${hookFnName}"` : ""; - if (err) { - if (err.code === "AVV_ERR_READY_TIMEOUT") { - err = appendStackTrace(err, new FST_ERR_HOOK_TIMEOUT(hookName, hookFnFragment)); - } else { - err = AVVIO_ERRORS_MAP[err.code] != null ? appendStackTrace(err, new AVVIO_ERRORS_MAP[err.code](err.message)) : err; - } - cb(err); - return; - } - cb(); - } - function next(err) { - if (err) { - exit(err); - return; - } - if (i === hooks.length && c === server[kChildren].length) { - if (i === 0 && c === 0) { - exit(); - } else { - boot(function manageTimeout(err2, done) { - exit(err2); - done(err2); - }); - } - return; - } - if (i === hooks.length && c < server[kChildren].length) { - const child = server[kChildren][c++]; - hookRunnerApplication(hookName, boot, child, next); - return; - } - boot(wrap(hooks[i++], server)); - next(); - } - function wrap(fn, server2) { - return function(err, done) { - if (err) { - done(err); - return; - } - if (fn.length === 1) { - try { - fn.call(server2, done); - } catch (error) { - done(error); - } - return; - } - try { - const ret = fn.call(server2); - if (ret && typeof ret.then === "function") { - ret.then(done, done); - return; - } - } catch (error) { - err = error; - } - done(err); - }; - } - } - function onListenHookRunner(server) { - const hooks = server[kHooks].onListen; - const hooksLen = hooks.length; - let i = 0; - let c = 0; - next(); - function next(err) { - err && server.log.error(err); - if (i === hooksLen) { - while (c < server[kChildren].length) { - const child = server[kChildren][c++]; - onListenHookRunner(child); - } - return; - } - wrap(hooks[i++], server, next); - } - async function wrap(fn, server2, done) { - if (fn.length === 1) { - try { - fn.call(server2, done); - } catch (e) { - done(e); - } - return; - } - try { - const ret = fn.call(server2); - if (ret && typeof ret.then === "function") { - ret.then(done, done); - return; - } - done(); - } catch (error) { - done(error); - } - } - } - function hookRunnerGenerator(iterator) { - return function hookRunner(functions, request, reply, cb) { - let i = 0; - function next(err) { - if (err || i === functions.length) { - cb(err, request, reply); - return; - } - let result; - try { - result = iterator(functions[i++], request, reply, next); - } catch (error) { - cb(error, request, reply); - return; - } - if (result && typeof result.then === "function") { - result.then(handleResolve, handleReject); - } - } - function handleResolve() { - next(); - } - function handleReject(err) { - if (!err) { - err = new FST_ERR_SEND_UNDEFINED_ERR(); - } - cb(err, request, reply); - } - next(); - }; - } - function onResponseHookIterator(fn, request, reply, next) { - return fn(request, reply, next); - } - var onResponseHookRunner = hookRunnerGenerator(onResponseHookIterator); - var preValidationHookRunner = hookRunnerGenerator(hookIterator); - var preHandlerHookRunner = hookRunnerGenerator(hookIterator); - var onTimeoutHookRunner = hookRunnerGenerator(hookIterator); - var onRequestHookRunner = hookRunnerGenerator(hookIterator); - function onSendHookRunner(functions, request, reply, payload, cb) { - let i = 0; - function next(err, newPayload) { - if (err) { - cb(err, request, reply, payload); - return; - } - if (newPayload !== void 0) { - payload = newPayload; - } - if (i === functions.length) { - cb(null, request, reply, payload); - return; - } - let result; - try { - result = functions[i++](request, reply, payload, next); - } catch (error) { - cb(error, request, reply); - return; - } - if (result && typeof result.then === "function") { - result.then(handleResolve, handleReject); - } - } - function handleResolve(newPayload) { - next(null, newPayload); - } - function handleReject(err) { - if (!err) { - err = new FST_ERR_SEND_UNDEFINED_ERR(); - } - cb(err, request, reply, payload); - } - next(); - } - var preSerializationHookRunner = onSendHookRunner; - function preParsingHookRunner(functions, request, reply, cb) { - let i = 0; - function next(err, newPayload) { - if (reply.sent) { - return; - } - if (newPayload !== void 0) { - request[kRequestPayloadStream] = newPayload; - } - if (err || i === functions.length) { - cb(err, request, reply); - return; - } - let result; - try { - result = functions[i++](request, reply, request[kRequestPayloadStream], next); - } catch (error) { - cb(error, request, reply); - return; - } - if (result && typeof result.then === "function") { - result.then(handleResolve, handleReject); - } - } - function handleResolve(newPayload) { - next(null, newPayload); - } - function handleReject(err) { - if (!err) { - err = new FST_ERR_SEND_UNDEFINED_ERR(); - } - cb(err, request, reply); - } - next(); - } - function onRequestAbortHookRunner(functions, request, cb) { - let i = 0; - function next(err) { - if (err || i === functions.length) { - cb(err, request); - return; - } - let result; - try { - result = functions[i++](request, next); - } catch (error) { - cb(error, request); - return; - } - if (result && typeof result.then === "function") { - result.then(handleResolve, handleReject); - } - } - function handleResolve() { - next(); - } - function handleReject(err) { - if (!err) { - err = new FST_ERR_SEND_UNDEFINED_ERR(); - } - cb(err, request); - } - next(); - } - function hookIterator(fn, request, reply, next) { - if (reply.sent === true) - return void 0; - return fn(request, reply, next); - } - module2.exports = { - Hooks, - buildHooks, - hookRunnerGenerator, - preParsingHookRunner, - onResponseHookRunner, - onSendHookRunner, - preSerializationHookRunner, - onRequestAbortHookRunner, - hookIterator, - hookRunnerApplication, - onListenHookRunner, - preHandlerHookRunner, - preValidationHookRunner, - onRequestHookRunner, - onTimeoutHookRunner, - lifecycleHooks, - supportedHooks - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/noop-set.js -var require_noop_set = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/noop-set.js"(exports2, module2) { - "use strict"; - module2.exports = function noopSet() { - return { - [Symbol.iterator]: function* () { - }, - add() { - }, - delete() { - }, - has() { - return true; - } - }; - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/promise.js -var require_promise = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/promise.js"(exports2, module2) { - "use strict"; - var { kTestInternals } = require_symbols2(); - function withResolvers() { - let res, rej; - const promise = new Promise((resolve, reject) => { - res = resolve; - rej = reject; - }); - return { promise, resolve: res, reject: rej }; - } - module2.exports = { - // TODO(20.x): remove when node@20 is not supported - withResolvers: typeof Promise.withResolvers === "function" ? Promise.withResolvers.bind(Promise) : withResolvers, - // Tested using the kTestInternals - [kTestInternals]: { - withResolvers - } - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/server.js -var require_server = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/server.js"(exports2, module2) { - "use strict"; - var http2 = require("node:http"); - var https2 = require("node:https"); - var http22 = require("node:http2"); - var dns = require("node:dns"); - var os2 = require("node:os"); - var { kState, kOptions, kServerBindings, kHttp2ServerSessions } = require_symbols2(); - var { FSTWRN003 } = require_warnings(); - var { onListenHookRunner } = require_hooks(); - var { - FST_ERR_REOPENED_CLOSE_SERVER, - FST_ERR_REOPENED_SERVER, - FST_ERR_LISTEN_OPTIONS_INVALID, - FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE - } = require_errors2(); - var noopSet = require_noop_set(); - var PonyPromise = require_promise(); - module2.exports.createServer = createServer; - function defaultResolveServerListeningText(address) { - return `Server listening at ${address}`; - } - function createServer(options, httpHandler) { - const server = getServerInstance(options, httpHandler); - function listen(listenOptions = { port: 0, host: "localhost" }, cb = void 0) { - if (typeof cb === "function") { - if (cb.constructor.name === "AsyncFunction") { - FSTWRN003("listen method"); - } - listenOptions.cb = cb; - } - if (listenOptions.signal) { - if (typeof listenOptions.signal.on !== "function" && typeof listenOptions.signal.addEventListener !== "function") { - throw new FST_ERR_LISTEN_OPTIONS_INVALID("Invalid options.signal"); - } - this[kState].aborted = listenOptions.signal.aborted; - if (this[kState].aborted) { - return this.close(); - } else { - const onAborted = () => { - this[kState].aborted = true; - this.close(); - }; - listenOptions.signal.addEventListener("abort", onAborted, { once: true }); - } - } - let host; - if (listenOptions.path == null) { - host = listenOptions.host ?? "localhost"; - } else { - host = listenOptions.host; - } - if (!Object.hasOwn(listenOptions, "host") || listenOptions.host == null) { - listenOptions.host = host; - } - if (host === "localhost") { - listenOptions.cb = (err, address) => { - if (err) { - cb(err, address); - return; - } - multipleBindings.call(this, server, httpHandler, options, listenOptions, () => { - this[kState].listening = true; - cb(null, address); - onListenHookRunner(this); - }); - }; - } else { - listenOptions.cb = (err, address) => { - if (err) { - cb(err, address); - return; - } - this[kState].listening = true; - cb(null, address); - onListenHookRunner(this); - }; - } - if (cb === void 0) { - const listening = listenPromise.call(this, server, listenOptions); - return listening.then((address) => { - const { promise, resolve } = PonyPromise.withResolvers(); - if (host === "localhost") { - multipleBindings.call(this, server, httpHandler, options, listenOptions, () => { - this[kState].listening = true; - resolve(address); - onListenHookRunner(this); - }); - } else { - resolve(address); - onListenHookRunner(this); - } - return promise; - }); - } - this.ready(listenCallback.call(this, server, listenOptions)); - } - const serverHasCloseAllConnections = typeof server.closeAllConnections === "function"; - const serverHasCloseIdleConnections = typeof server.closeIdleConnections === "function"; - const serverHasCloseHttp2Sessions = typeof server.closeHttp2Sessions === "function"; - let forceCloseConnections = options.forceCloseConnections; - if (forceCloseConnections === "idle" && !serverHasCloseIdleConnections) { - throw new FST_ERR_FORCE_CLOSE_CONNECTIONS_IDLE_NOT_AVAILABLE(); - } else if (typeof forceCloseConnections !== "boolean") { - forceCloseConnections = serverHasCloseIdleConnections ? "idle" : false; - } - const keepAliveConnections = !serverHasCloseAllConnections && forceCloseConnections === true ? /* @__PURE__ */ new Set() : noopSet(); - return { - server, - listen, - forceCloseConnections, - serverHasCloseAllConnections, - serverHasCloseHttp2Sessions, - keepAliveConnections - }; - } - function multipleBindings(mainServer, httpHandler, serverOpts, listenOptions, onListen) { - this[kState].listening = false; - dns.lookup(listenOptions.host, { all: true }, (dnsErr, addresses) => { - if (dnsErr || this[kState].aborted) { - onListen(); - return; - } - const isMainServerListening = mainServer.listening && serverOpts.serverFactory; - let binding = 0; - let bound = 0; - if (!isMainServerListening) { - const primaryAddress = mainServer.address(); - for (const adr of addresses) { - if (adr.address !== primaryAddress.address) { - binding++; - const secondaryOpts = Object.assign({}, listenOptions, { - host: adr.address, - port: primaryAddress.port, - cb: (_ignoreErr) => { - bound++; - if (!_ignoreErr) { - this[kServerBindings].push(secondaryServer); - } - if (bound === binding) { - onListen(); - } - } - }); - const secondaryServer = getServerInstance(serverOpts, httpHandler); - const closeSecondary = () => { - secondaryServer.close(() => { - }); - if (typeof secondaryServer.closeAllConnections === "function" && serverOpts.forceCloseConnections === true) { - secondaryServer.closeAllConnections(); - } - if (typeof secondaryServer.closeHttp2Sessions === "function") { - secondaryServer.closeHttp2Sessions(); - } - }; - secondaryServer.on("upgrade", mainServer.emit.bind(mainServer, "upgrade")); - mainServer.on("unref", closeSecondary); - mainServer.on("close", closeSecondary); - mainServer.on("error", closeSecondary); - this[kState].listening = false; - listenCallback.call(this, secondaryServer, secondaryOpts)(); - } - } - } - if (binding === 0) { - onListen(); - return; - } - const originUnref = mainServer.unref; - mainServer.unref = function() { - originUnref.call(mainServer); - mainServer.emit("unref"); - }; - }); - } - function listenCallback(server, listenOptions) { - const wrap = (err) => { - server.removeListener("error", wrap); - server.removeListener("listening", wrap); - if (!err) { - const address = logServerAddress.call( - this, - server, - listenOptions.listenTextResolver || defaultResolveServerListeningText - ); - listenOptions.cb(null, address); - } else { - this[kState].listening = false; - listenOptions.cb(err, null); - } - }; - return (err) => { - if (err != null) - return listenOptions.cb(err); - if (this[kState].listening && this[kState].closing) { - return listenOptions.cb(new FST_ERR_REOPENED_CLOSE_SERVER(), null); - } - if (this[kState].listening) { - return listenOptions.cb(new FST_ERR_REOPENED_SERVER(), null); - } - server.once("error", wrap); - if (!this[kState].closing) { - server.once("listening", wrap); - server.listen(listenOptions); - this[kState].listening = true; - } - }; - } - function listenPromise(server, listenOptions) { - if (this[kState].listening && this[kState].closing) { - return Promise.reject(new FST_ERR_REOPENED_CLOSE_SERVER()); - } - if (this[kState].listening) { - return Promise.reject(new FST_ERR_REOPENED_SERVER()); - } - return this.ready().then(() => { - if (this[kState].aborted) - return; - const { promise, resolve, reject } = PonyPromise.withResolvers(); - const errEventHandler = (err) => { - cleanup(); - this[kState].listening = false; - reject(err); - }; - const listeningEventHandler = () => { - cleanup(); - this[kState].listening = true; - resolve(logServerAddress.call( - this, - server, - listenOptions.listenTextResolver || defaultResolveServerListeningText - )); - }; - function cleanup() { - server.removeListener("error", errEventHandler); - server.removeListener("listening", listeningEventHandler); - } - server.once("error", errEventHandler); - server.once("listening", listeningEventHandler); - server.listen(listenOptions); - return promise; - }); - } - function getServerInstance(options, httpHandler) { - if (options.serverFactory) { - return options.serverFactory(httpHandler, options); - } - const httpsOptions = options.https === true ? {} : options.https; - if (options.http2) { - const server2 = typeof httpsOptions === "object" ? http22.createSecureServer(httpsOptions, httpHandler) : http22.createServer(options.http, httpHandler); - server2.on("session", (session) => session.setTimeout(options.http2SessionTimeout, () => { - session.close(); - })); - if (options.forceCloseConnections === true) { - server2.closeHttp2Sessions = createCloseHttp2SessionsByHttp2Server(server2); - } - server2.setTimeout(options.connectionTimeout); - return server2; - } - const server = httpsOptions ? https2.createServer(httpsOptions, httpHandler) : http2.createServer(options.http, httpHandler); - server.keepAliveTimeout = options.keepAliveTimeout; - server.requestTimeout = options.requestTimeout; - server.setTimeout(options.connectionTimeout); - if (options.maxRequestsPerSocket > 0) { - server.maxRequestsPerSocket = options.maxRequestsPerSocket; - } - return server; - } - function getAddresses(address) { - if (address.address === "0.0.0.0") { - return Object.values(os2.networkInterfaces()).flatMap((iface) => { - return iface.filter((iface2) => iface2.family === "IPv4"); - }).sort((iface) => { - return iface.internal ? -1 : 1; - }).map((iface) => { - return iface.address; - }); - } - return [address.address]; - } - function logServerAddress(server, listenTextResolver) { - let addresses; - const isUnixSocket = typeof server.address() === "string"; - if (!isUnixSocket) { - if (server.address().address.indexOf(":") === -1) { - addresses = getAddresses(server.address()).map((address) => address + ":" + server.address().port); - } else { - addresses = ["[" + server.address().address + "]:" + server.address().port]; - } - addresses = addresses.map((address) => "http" + (this[kOptions].https ? "s" : "") + "://" + address); - } else { - addresses = [server.address()]; - } - for (const address of addresses) { - this.log.info(listenTextResolver(address)); - } - return addresses[0]; - } - function createCloseHttp2SessionsByHttp2Server(http2Server) { - http2Server[kHttp2ServerSessions] = /* @__PURE__ */ new Set(); - http2Server.on("session", function(session) { - session.once("connect", function() { - http2Server[kHttp2ServerSessions].add(session); - }); - session.once("close", function() { - http2Server[kHttp2ServerSessions].delete(session); - }); - session.once("frameError", function(type2, code, streamId) { - if (streamId === 0) { - http2Server[kHttp2ServerSessions].delete(session); - } - }); - session.once("goaway", function() { - http2Server[kHttp2ServerSessions].delete(session); - }); - }); - return function closeHttp2Sessions() { - if (http2Server[kHttp2ServerSessions].size === 0) { - return; - } - for (const session of http2Server[kHttp2ServerSessions]) { - session.close(); - } - }; - } - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/content-type.js -var require_content_type = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/content-type.js"(exports2, module2) { - "use strict"; - var keyValuePairsReg = /(?:^|;)\s*([\w!#$%&'*+.^`|~-]+)=([^;]*)/gm; - var typeNameReg = /^[\w!#$%&'*+.^`|~-]+$/; - var subtypeNameReg = /^[\w!#$%&'*+.^`|~-]+\s*$/; - var ContentType = class { - #valid = false; - #empty = true; - #type = ""; - #subtype = ""; - #parameters = /* @__PURE__ */ new Map(); - #string; - constructor(headerValue) { - if (headerValue == null || headerValue === "" || headerValue === "undefined") { - return; - } - let sepIdx = headerValue.indexOf(";"); - if (sepIdx === -1) { - sepIdx = headerValue.indexOf("/"); - if (sepIdx === -1) { - return; - } - const type3 = headerValue.slice(0, sepIdx).trimStart().toLowerCase(); - const subtype2 = headerValue.slice(sepIdx + 1).trimEnd().toLowerCase(); - if (typeNameReg.test(type3) === true && subtypeNameReg.test(subtype2) === true) { - this.#valid = true; - this.#empty = false; - this.#type = type3; - this.#subtype = subtype2; - } - return; - } - const mediaType = headerValue.slice(0, sepIdx).toLowerCase(); - const paramsList = headerValue.slice(sepIdx + 1).trim(); - sepIdx = mediaType.indexOf("/"); - if (sepIdx === -1) { - return; - } - const type2 = mediaType.slice(0, sepIdx).trimStart(); - const subtype = mediaType.slice(sepIdx + 1).trimEnd(); - if (typeNameReg.test(type2) === false || subtypeNameReg.test(subtype) === false) { - return; - } - this.#type = type2; - this.#subtype = subtype; - this.#valid = true; - this.#empty = false; - let matches = keyValuePairsReg.exec(paramsList); - while (matches) { - const key = matches[1]; - const value = matches[2]; - if (value[0] === '"') { - if (value.at(-1) !== '"') { - this.#parameters.set(key, "invalid quoted string"); - matches = keyValuePairsReg.exec(paramsList); - continue; - } - this.#parameters.set(key, value.slice(1, value.length - 1)); - } else { - this.#parameters.set(key, value); - } - matches = keyValuePairsReg.exec(paramsList); - } - } - get [Symbol.toStringTag]() { - return "ContentType"; - } - get isEmpty() { - return this.#empty; - } - get isValid() { - return this.#valid; - } - get mediaType() { - return `${this.#type}/${this.#subtype}`; - } - get type() { - return this.#type; - } - get subtype() { - return this.#subtype; - } - get parameters() { - return this.#parameters; - } - toString() { - if (this.#string) - return this.#string; - const parameters = []; - for (const [key, value] of this.#parameters.entries()) { - parameters.push(`${key}="${value}"`); - } - const result = [this.#type, "/", this.#subtype]; - if (parameters.length > 0) { - result.push("; "); - result.push(parameters.join("; ")); - } - this.#string = result.join(""); - return this.#string; - } - }; - module2.exports = ContentType; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/error-status.js -var require_error_status = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/error-status.js"(exports2, module2) { - "use strict"; - var { - kReplyHasStatusCode - } = require_symbols2(); - function setErrorStatusCode(reply, err) { - if (!reply[kReplyHasStatusCode] || reply.statusCode === 200) { - const statusCode = err && (err.statusCode || err.status); - reply.code(statusCode >= 400 ? statusCode : 500); - } - } - module2.exports = { setErrorStatusCode }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/wrap-thenable.js -var require_wrap_thenable = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/wrap-thenable.js"(exports2, module2) { - "use strict"; - var { - kReplyIsError, - kReplyHijacked - } = require_symbols2(); - var { setErrorStatusCode } = require_error_status(); - var diagnostics = require("node:diagnostics_channel"); - var channels = diagnostics.tracingChannel("fastify.request.handler"); - function wrapThenable(thenable, reply, store) { - if (store) - store.async = true; - thenable.then(function(payload) { - if (reply[kReplyHijacked] === true) { - return; - } - if (store) { - channels.asyncStart.publish(store); - } - try { - if (payload !== void 0 || // - reply.sent === false && // - reply.raw.headersSent === false && reply.request.raw.aborted === false && reply.request.socket && !reply.request.socket.destroyed) { - try { - reply.send(payload); - } catch (err) { - reply[kReplyIsError] = true; - reply.send(err); - } - } - } finally { - if (store) { - channels.asyncEnd.publish(store); - } - } - }, function(err) { - if (store) { - store.error = err; - setErrorStatusCode(reply, err); - channels.error.publish(store); - channels.asyncStart.publish(store); - } - try { - if (reply.sent === true) { - reply.log.error({ err }, "Promise errored, but reply.sent = true was set"); - return; - } - reply[kReplyIsError] = true; - reply.send(err); - } catch (err2) { - reply.send(err2); - } finally { - if (store) { - channels.asyncEnd.publish(store); - } - } - }); - } - module2.exports = wrapThenable; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/validation.js -var require_validation = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/validation.js"(exports2, module2) { - "use strict"; - var { - kSchemaHeaders: headersSchema, - kSchemaParams: paramsSchema, - kSchemaQuerystring: querystringSchema, - kSchemaBody: bodySchema, - kSchemaResponse: responseSchema - } = require_symbols2(); - var scChecker = /^[1-5](?:\d{2}|xx)$|^default$/; - var { - FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX - } = require_errors2(); - var { FSTWRN001 } = require_warnings(); - function compileSchemasForSerialization(context, compile) { - if (!context.schema || !context.schema.response) { - return; - } - const { method, url } = context.config || {}; - context[responseSchema] = Object.keys(context.schema.response).reduce(function(acc, statusCode) { - const schema = context.schema.response[statusCode]; - statusCode = statusCode.toLowerCase(); - if (!scChecker.test(statusCode)) { - throw new FST_ERR_SCH_RESPONSE_SCHEMA_NOT_NESTED_2XX(); - } - if (schema.content) { - const contentTypesSchemas = {}; - for (const mediaName of Object.keys(schema.content)) { - const contentSchema = schema.content[mediaName].schema; - contentTypesSchemas[mediaName] = compile({ - schema: contentSchema, - url, - method, - httpStatus: statusCode, - contentType: mediaName - }); - } - acc[statusCode] = contentTypesSchemas; - } else { - acc[statusCode] = compile({ - schema, - url, - method, - httpStatus: statusCode - }); - } - return acc; - }, {}); - } - function compileSchemasForValidation(context, compile, isCustom) { - const { schema } = context; - if (!schema) { - return; - } - const { method, url } = context.config || {}; - const headers = schema.headers; - if (headers && (isCustom || Object.getPrototypeOf(headers) !== Object.prototype)) { - context[headersSchema] = compile({ schema: headers, method, url, httpPart: "headers" }); - } else if (headers) { - const headersSchemaLowerCase = {}; - Object.keys(headers).forEach((k) => { - headersSchemaLowerCase[k] = headers[k]; - }); - if (headersSchemaLowerCase.required instanceof Array) { - headersSchemaLowerCase.required = headersSchemaLowerCase.required.map((h) => h.toLowerCase()); - } - if (headers.properties) { - headersSchemaLowerCase.properties = {}; - Object.keys(headers.properties).forEach((k) => { - headersSchemaLowerCase.properties[k.toLowerCase()] = headers.properties[k]; - }); - } - context[headersSchema] = compile({ schema: headersSchemaLowerCase, method, url, httpPart: "headers" }); - } else if (Object.hasOwn(schema, "headers")) { - FSTWRN001("headers", method, url); - } - if (schema.body) { - const contentProperty = schema.body.content; - if (contentProperty) { - const contentTypeSchemas = {}; - for (const contentType of Object.keys(contentProperty)) { - const contentSchema = contentProperty[contentType].schema; - contentTypeSchemas[contentType] = compile({ schema: contentSchema, method, url, httpPart: "body", contentType }); - } - context[bodySchema] = contentTypeSchemas; - } else { - context[bodySchema] = compile({ schema: schema.body, method, url, httpPart: "body" }); - } - } else if (Object.hasOwn(schema, "body")) { - FSTWRN001("body", method, url); - } - if (schema.querystring) { - context[querystringSchema] = compile({ schema: schema.querystring, method, url, httpPart: "querystring" }); - } else if (Object.hasOwn(schema, "querystring")) { - FSTWRN001("querystring", method, url); - } - if (schema.params) { - context[paramsSchema] = compile({ schema: schema.params, method, url, httpPart: "params" }); - } else if (Object.hasOwn(schema, "params")) { - FSTWRN001("params", method, url); - } - } - function validateParam(validatorFunction, request, paramName) { - const isUndefined = request[paramName] === void 0; - let ret; - try { - ret = validatorFunction?.(isUndefined ? null : request[paramName]); - } catch (err) { - err.statusCode = 500; - return err; - } - if (ret && typeof ret.then === "function") { - return ret.then((res) => { - return answer(res); - }).catch((err) => { - return err; - }); - } - return answer(ret); - function answer(ret2) { - if (ret2 === false) - return validatorFunction.errors; - if (ret2 && ret2.error) - return ret2.error; - if (ret2 && ret2.value) - request[paramName] = ret2.value; - return false; - } - } - function validate3(context, request, execution) { - const runExecution = execution === void 0; - if (runExecution || !execution.skipParams) { - const params = validateParam(context[paramsSchema], request, "params"); - if (params) { - if (typeof params.then !== "function") { - return wrapValidationError(params, "params", context.schemaErrorFormatter); - } else { - return validateAsyncParams(params, context, request); - } - } - } - if (runExecution || !execution.skipBody) { - let validatorFunction = null; - if (typeof context[bodySchema] === "function") { - validatorFunction = context[bodySchema]; - } else if (context[bodySchema]) { - const contentType = getEssenceMediaType(request.headers["content-type"]); - const contentSchema = context[bodySchema][contentType]; - if (contentSchema) { - validatorFunction = contentSchema; - } - } - const body = validateParam(validatorFunction, request, "body"); - if (body) { - if (typeof body.then !== "function") { - return wrapValidationError(body, "body", context.schemaErrorFormatter); - } else { - return validateAsyncBody(body, context, request); - } - } - } - if (runExecution || !execution.skipQuery) { - const query = validateParam(context[querystringSchema], request, "query"); - if (query) { - if (typeof query.then !== "function") { - return wrapValidationError(query, "querystring", context.schemaErrorFormatter); - } else { - return validateAsyncQuery(query, context, request); - } - } - } - const headers = validateParam(context[headersSchema], request, "headers"); - if (headers) { - if (typeof headers.then !== "function") { - return wrapValidationError(headers, "headers", context.schemaErrorFormatter); - } else { - return validateAsyncHeaders(headers, context, request); - } - } - return false; - } - function validateAsyncParams(validatePromise, context, request) { - return validatePromise.then((paramsResult) => { - if (paramsResult) { - return wrapValidationError(paramsResult, "params", context.schemaErrorFormatter); - } - return validate3(context, request, { skipParams: true }); - }); - } - function validateAsyncBody(validatePromise, context, request) { - return validatePromise.then((bodyResult) => { - if (bodyResult) { - return wrapValidationError(bodyResult, "body", context.schemaErrorFormatter); - } - return validate3(context, request, { skipParams: true, skipBody: true }); - }); - } - function validateAsyncQuery(validatePromise, context, request) { - return validatePromise.then((queryResult) => { - if (queryResult) { - return wrapValidationError(queryResult, "querystring", context.schemaErrorFormatter); - } - return validate3(context, request, { skipParams: true, skipBody: true, skipQuery: true }); - }); - } - function validateAsyncHeaders(validatePromise, context, request) { - return validatePromise.then((headersResult) => { - if (headersResult) { - return wrapValidationError(headersResult, "headers", context.schemaErrorFormatter); - } - return false; - }); - } - function wrapValidationError(result, dataVar, schemaErrorFormatter) { - if (result instanceof Error) { - result.statusCode = result.statusCode || 400; - result.code = result.code || "FST_ERR_VALIDATION"; - result.validationContext = result.validationContext || dataVar; - return result; - } - const error = schemaErrorFormatter(result, dataVar); - error.statusCode = error.statusCode || 400; - error.code = error.code || "FST_ERR_VALIDATION"; - error.validation = result; - error.validationContext = dataVar; - return error; - } - function getEssenceMediaType(header) { - if (!header) - return ""; - return header.trimStart().split(/[ ;]/, 1)[0].trim().toLowerCase(); - } - module2.exports = { - symbols: { bodySchema, querystringSchema, responseSchema, paramsSchema, headersSchema }, - compileSchemasForValidation, - compileSchemasForSerialization, - validate: validate3 - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/handle-request.js -var require_handle_request = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/handle-request.js"(exports2, module2) { - "use strict"; - var diagnostics = require("node:diagnostics_channel"); - var ContentType = require_content_type(); - var wrapThenable = require_wrap_thenable(); - var { validate: validateSchema } = require_validation(); - var { preValidationHookRunner, preHandlerHookRunner } = require_hooks(); - var { FST_ERR_CTP_INVALID_MEDIA_TYPE } = require_errors2(); - var { setErrorStatusCode } = require_error_status(); - var { - kReplyIsError, - kRouteContext, - kFourOhFourContext, - kSupportedHTTPMethods - } = require_symbols2(); - var channels = diagnostics.tracingChannel("fastify.request.handler"); - function handleRequest(err, request, reply) { - if (reply.sent === true) - return; - if (err != null) { - reply[kReplyIsError] = true; - reply.send(err); - return; - } - const method = request.method; - if (this[kSupportedHTTPMethods].bodyless.has(method)) { - handler(request, reply); - return; - } - if (this[kSupportedHTTPMethods].bodywith.has(method)) { - const headers = request.headers; - const ctHeader = headers["content-type"]; - if (ctHeader === void 0) { - const contentLength = headers["content-length"]; - const transferEncoding = headers["transfer-encoding"]; - const isEmptyBody = transferEncoding === void 0 && (contentLength === void 0 || contentLength === "0"); - if (isEmptyBody) { - handler(request, reply); - return; - } - request[kRouteContext].contentTypeParser.run("", handler, request, reply); - return; - } - const contentType = new ContentType(ctHeader); - if (contentType.isValid === false) { - reply[kReplyIsError] = true; - reply.status(415).send(new FST_ERR_CTP_INVALID_MEDIA_TYPE()); - return; - } - request[kRouteContext].contentTypeParser.run(contentType.toString(), handler, request, reply); - return; - } - handler(request, reply); - } - function handler(request, reply) { - try { - if (request[kRouteContext].preValidation !== null) { - preValidationHookRunner( - request[kRouteContext].preValidation, - request, - reply, - preValidationCallback - ); - } else { - preValidationCallback(null, request, reply); - } - } catch (err) { - preValidationCallback(err, request, reply); - } - } - function preValidationCallback(err, request, reply) { - if (reply.sent === true) - return; - if (err != null) { - reply[kReplyIsError] = true; - reply.send(err); - return; - } - const validationErr = validateSchema(reply[kRouteContext], request); - const isAsync = validationErr && typeof validationErr.then === "function" || false; - if (isAsync) { - const cb = validationCompleted.bind(null, request, reply); - validationErr.then(cb, cb); - } else { - validationCompleted(request, reply, validationErr); - } - } - function validationCompleted(request, reply, validationErr) { - if (validationErr) { - if (reply[kRouteContext].attachValidation === false) { - reply.send(validationErr); - return; - } - reply.request.validationError = validationErr; - } - if (request[kRouteContext].preHandler !== null) { - preHandlerHookRunner( - request[kRouteContext].preHandler, - request, - reply, - preHandlerCallback - ); - } else { - preHandlerCallback(null, request, reply); - } - } - function preHandlerCallback(err, request, reply) { - if (reply.sent) - return; - const context = request[kRouteContext]; - if (!channels.hasSubscribers || context[kFourOhFourContext] === null) { - preHandlerCallbackInner(err, request, reply); - } else { - const store = { - request, - reply, - async: false, - route: { - url: context.config.url, - method: context.config.method - } - }; - channels.start.runStores(store, preHandlerCallbackInner, void 0, err, request, reply, store); - } - } - function preHandlerCallbackInner(err, request, reply, store) { - const context = request[kRouteContext]; - try { - if (err != null) { - reply[kReplyIsError] = true; - if (store) { - store.error = err; - setErrorStatusCode(reply, err); - channels.error.publish(store); - } - reply.send(err); - return; - } - let result; - try { - result = context.handler(request, reply); - } catch (err2) { - if (store) { - store.error = err2; - setErrorStatusCode(reply, err2); - channels.error.publish(store); - } - reply[kReplyIsError] = true; - reply.send(err2); - return; - } - if (result !== void 0) { - if (result !== null && typeof result.then === "function") { - wrapThenable(result, reply, store); - } else { - reply.send(result); - } - } - } finally { - if (store) - channels.end.publish(store); - } - } - module2.exports = handleRequest; - module2.exports[Symbol.for("internals")] = { handler, preHandlerCallback }; - } -}); - -// ../../node_modules/.pnpm/abstract-logging@2.0.1/node_modules/abstract-logging/index.js -var require_abstract_logging = __commonJS({ - "../../node_modules/.pnpm/abstract-logging@2.0.1/node_modules/abstract-logging/index.js"(exports2, module2) { - "use strict"; - function noop() { - } - var proto = { - fatal: noop, - error: noop, - warn: noop, - info: noop, - debug: noop, - trace: noop - }; - Object.defineProperty(module2, "exports", { - get() { - return Object.create(proto); - } - }); - } -}); - -// ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-helpers.js -var require_err_helpers = __commonJS({ - "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-helpers.js"(exports2, module2) { - "use strict"; - var isErrorLike = (err) => { - return err && typeof err.message === "string"; - }; - var getErrorCause = (err) => { - if (!err) - return; - const cause = err.cause; - if (typeof cause === "function") { - const causeResult = err.cause(); - return isErrorLike(causeResult) ? causeResult : void 0; - } else { - return isErrorLike(cause) ? cause : void 0; - } - }; - var _stackWithCauses = (err, seen) => { - if (!isErrorLike(err)) - return ""; - const stack = err.stack || ""; - if (seen.has(err)) { - return stack + "\ncauses have become circular..."; - } - const cause = getErrorCause(err); - if (cause) { - seen.add(err); - return stack + "\ncaused by: " + _stackWithCauses(cause, seen); - } else { - return stack; - } - }; - var stackWithCauses = (err) => _stackWithCauses(err, /* @__PURE__ */ new Set()); - var _messageWithCauses = (err, seen, skip) => { - if (!isErrorLike(err)) - return ""; - const message = skip ? "" : err.message || ""; - if (seen.has(err)) { - return message + ": ..."; - } - const cause = getErrorCause(err); - if (cause) { - seen.add(err); - const skipIfVErrorStyleCause = typeof err.cause === "function"; - return message + (skipIfVErrorStyleCause ? "" : ": ") + _messageWithCauses(cause, seen, skipIfVErrorStyleCause); - } else { - return message; - } - }; - var messageWithCauses = (err) => _messageWithCauses(err, /* @__PURE__ */ new Set()); - module2.exports = { - isErrorLike, - getErrorCause, - stackWithCauses, - messageWithCauses - }; - } -}); - -// ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-proto.js -var require_err_proto = __commonJS({ - "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-proto.js"(exports2, module2) { - "use strict"; - var seen = Symbol("circular-ref-tag"); - var rawSymbol = Symbol("pino-raw-err-ref"); - var pinoErrProto = Object.create({}, { - type: { - enumerable: true, - writable: true, - value: void 0 - }, - message: { - enumerable: true, - writable: true, - value: void 0 - }, - stack: { - enumerable: true, - writable: true, - value: void 0 - }, - aggregateErrors: { - enumerable: true, - writable: true, - value: void 0 - }, - raw: { - enumerable: false, - get: function() { - return this[rawSymbol]; - }, - set: function(val) { - this[rawSymbol] = val; - } - } - }); - Object.defineProperty(pinoErrProto, rawSymbol, { - writable: true, - value: {} - }); - module2.exports = { - pinoErrProto, - pinoErrorSymbols: { - seen, - rawSymbol - } - }; - } -}); - -// ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err.js -var require_err = __commonJS({ - "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err.js"(exports2, module2) { - "use strict"; - module2.exports = errSerializer; - var { messageWithCauses, stackWithCauses, isErrorLike } = require_err_helpers(); - var { pinoErrProto, pinoErrorSymbols } = require_err_proto(); - var { seen } = pinoErrorSymbols; - var { toString } = Object.prototype; - function errSerializer(err) { - if (!isErrorLike(err)) { - return err; - } - err[seen] = void 0; - const _err = Object.create(pinoErrProto); - _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name; - _err.message = messageWithCauses(err); - _err.stack = stackWithCauses(err); - if (Array.isArray(err.errors)) { - _err.aggregateErrors = err.errors.map((err2) => errSerializer(err2)); - } - for (const key in err) { - if (_err[key] === void 0) { - const val = err[key]; - if (isErrorLike(val)) { - if (key !== "cause" && !Object.prototype.hasOwnProperty.call(val, seen)) { - _err[key] = errSerializer(val); - } - } else { - _err[key] = val; - } - } - } - delete err[seen]; - _err.raw = err; - return _err; - } - } -}); - -// ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-with-cause.js -var require_err_with_cause = __commonJS({ - "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/err-with-cause.js"(exports2, module2) { - "use strict"; - module2.exports = errWithCauseSerializer; - var { isErrorLike } = require_err_helpers(); - var { pinoErrProto, pinoErrorSymbols } = require_err_proto(); - var { seen } = pinoErrorSymbols; - var { toString } = Object.prototype; - function errWithCauseSerializer(err) { - if (!isErrorLike(err)) { - return err; - } - err[seen] = void 0; - const _err = Object.create(pinoErrProto); - _err.type = toString.call(err.constructor) === "[object Function]" ? err.constructor.name : err.name; - _err.message = err.message; - _err.stack = err.stack; - if (Array.isArray(err.errors)) { - _err.aggregateErrors = err.errors.map((err2) => errWithCauseSerializer(err2)); - } - if (isErrorLike(err.cause) && !Object.prototype.hasOwnProperty.call(err.cause, seen)) { - _err.cause = errWithCauseSerializer(err.cause); - } - for (const key in err) { - if (_err[key] === void 0) { - const val = err[key]; - if (isErrorLike(val)) { - if (!Object.prototype.hasOwnProperty.call(val, seen)) { - _err[key] = errWithCauseSerializer(val); - } - } else { - _err[key] = val; - } - } - } - delete err[seen]; - _err.raw = err; - return _err; - } - } -}); - -// ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/req.js -var require_req = __commonJS({ - "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/req.js"(exports2, module2) { - "use strict"; - module2.exports = { - mapHttpRequest, - reqSerializer - }; - var rawSymbol = Symbol("pino-raw-req-ref"); - var pinoReqProto = Object.create({}, { - id: { - enumerable: true, - writable: true, - value: "" - }, - method: { - enumerable: true, - writable: true, - value: "" - }, - url: { - enumerable: true, - writable: true, - value: "" - }, - query: { - enumerable: true, - writable: true, - value: "" - }, - params: { - enumerable: true, - writable: true, - value: "" - }, - headers: { - enumerable: true, - writable: true, - value: {} - }, - remoteAddress: { - enumerable: true, - writable: true, - value: "" - }, - remotePort: { - enumerable: true, - writable: true, - value: "" - }, - raw: { - enumerable: false, - get: function() { - return this[rawSymbol]; - }, - set: function(val) { - this[rawSymbol] = val; - } - } - }); - Object.defineProperty(pinoReqProto, rawSymbol, { - writable: true, - value: {} - }); - function reqSerializer(req) { - const connection = req.info || req.socket; - const _req = Object.create(pinoReqProto); - _req.id = typeof req.id === "function" ? req.id() : req.id || (req.info ? req.info.id : void 0); - _req.method = req.method; - if (req.originalUrl) { - _req.url = req.originalUrl; - } else { - const path2 = req.path; - _req.url = typeof path2 === "string" ? path2 : req.url ? req.url.path || req.url : void 0; - } - if (req.query) { - _req.query = req.query; - } - if (req.params) { - _req.params = req.params; - } - _req.headers = req.headers; - _req.remoteAddress = connection && connection.remoteAddress; - _req.remotePort = connection && connection.remotePort; - _req.raw = req.raw || req; - return _req; - } - function mapHttpRequest(req) { - return { - req: reqSerializer(req) - }; - } - } -}); - -// ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/res.js -var require_res = __commonJS({ - "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/lib/res.js"(exports2, module2) { - "use strict"; - module2.exports = { - mapHttpResponse, - resSerializer - }; - var rawSymbol = Symbol("pino-raw-res-ref"); - var pinoResProto = Object.create({}, { - statusCode: { - enumerable: true, - writable: true, - value: 0 - }, - headers: { - enumerable: true, - writable: true, - value: "" - }, - raw: { - enumerable: false, - get: function() { - return this[rawSymbol]; - }, - set: function(val) { - this[rawSymbol] = val; - } - } - }); - Object.defineProperty(pinoResProto, rawSymbol, { - writable: true, - value: {} - }); - function resSerializer(res) { - const _res = Object.create(pinoResProto); - _res.statusCode = res.headersSent ? res.statusCode : null; - _res.headers = res.getHeaders ? res.getHeaders() : res._headers; - _res.raw = res; - return _res; - } - function mapHttpResponse(res) { - return { - res: resSerializer(res) - }; - } - } -}); - -// ../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/index.js -var require_pino_std_serializers = __commonJS({ - "../../node_modules/.pnpm/pino-std-serializers@7.1.0/node_modules/pino-std-serializers/index.js"(exports2, module2) { - "use strict"; - var errSerializer = require_err(); - var errWithCauseSerializer = require_err_with_cause(); - var reqSerializers = require_req(); - var resSerializers = require_res(); - module2.exports = { - err: errSerializer, - errWithCause: errWithCauseSerializer, - mapHttpRequest: reqSerializers.mapHttpRequest, - mapHttpResponse: resSerializers.mapHttpResponse, - req: reqSerializers.reqSerializer, - res: resSerializers.resSerializer, - wrapErrorSerializer: function wrapErrorSerializer(customSerializer) { - if (customSerializer === errSerializer) - return customSerializer; - return function wrapErrSerializer(err) { - return customSerializer(errSerializer(err)); - }; - }, - wrapRequestSerializer: function wrapRequestSerializer(customSerializer) { - if (customSerializer === reqSerializers.reqSerializer) - return customSerializer; - return function wrappedReqSerializer(req) { - return customSerializer(reqSerializers.reqSerializer(req)); - }; - }, - wrapResponseSerializer: function wrapResponseSerializer(customSerializer) { - if (customSerializer === resSerializers.resSerializer) - return customSerializer; - return function wrappedResSerializer(res) { - return customSerializer(resSerializers.resSerializer(res)); - }; - } - }; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/caller.js -var require_caller = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/caller.js"(exports2, module2) { - "use strict"; - function noOpPrepareStackTrace(_, stack) { - return stack; - } - module2.exports = function getCallers() { - const originalPrepare = Error.prepareStackTrace; - Error.prepareStackTrace = noOpPrepareStackTrace; - const stack = new Error().stack; - Error.prepareStackTrace = originalPrepare; - if (!Array.isArray(stack)) { - return void 0; - } - const entries = stack.slice(2); - const fileNames = []; - for (const entry of entries) { - if (!entry) { - continue; - } - fileNames.push(entry.getFileName()); - } - return fileNames; - }; - } -}); - -// ../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js -var require_redact = __commonJS({ - "../../node_modules/.pnpm/@pinojs+redact@0.4.0/node_modules/@pinojs/redact/index.js"(exports2, module2) { - "use strict"; - function deepClone(obj) { - if (obj === null || typeof obj !== "object") { - return obj; - } - if (obj instanceof Date) { - return new Date(obj.getTime()); - } - if (obj instanceof Array) { - const cloned = []; - for (let i = 0; i < obj.length; i++) { - cloned[i] = deepClone(obj[i]); - } - return cloned; - } - if (typeof obj === "object") { - const cloned = Object.create(Object.getPrototypeOf(obj)); - for (const key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - cloned[key] = deepClone(obj[key]); - } - } - return cloned; - } - return obj; - } - function parsePath(path2) { - const parts = []; - let current = ""; - let inBrackets = false; - let inQuotes = false; - let quoteChar = ""; - for (let i = 0; i < path2.length; i++) { - const char = path2[i]; - if (!inBrackets && char === ".") { - if (current) { - parts.push(current); - current = ""; - } - } else if (char === "[") { - if (current) { - parts.push(current); - current = ""; - } - inBrackets = true; - } else if (char === "]" && inBrackets) { - parts.push(current); - current = ""; - inBrackets = false; - inQuotes = false; - } else if ((char === '"' || char === "'") && inBrackets) { - if (!inQuotes) { - inQuotes = true; - quoteChar = char; - } else if (char === quoteChar) { - inQuotes = false; - quoteChar = ""; - } else { - current += char; - } - } else { - current += char; - } - } - if (current) { - parts.push(current); - } - return parts; - } - function setValue(obj, parts, value) { - let current = obj; - for (let i = 0; i < parts.length - 1; i++) { - const key = parts[i]; - if (typeof current !== "object" || current === null || !(key in current)) { - return false; - } - if (typeof current[key] !== "object" || current[key] === null) { - return false; - } - current = current[key]; - } - const lastKey = parts[parts.length - 1]; - if (lastKey === "*") { - if (Array.isArray(current)) { - for (let i = 0; i < current.length; i++) { - current[i] = value; - } - } else if (typeof current === "object" && current !== null) { - for (const key in current) { - if (Object.prototype.hasOwnProperty.call(current, key)) { - current[key] = value; - } - } - } - } else { - if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) { - current[lastKey] = value; - } - } - return true; - } - function removeKey(obj, parts) { - let current = obj; - for (let i = 0; i < parts.length - 1; i++) { - const key = parts[i]; - if (typeof current !== "object" || current === null || !(key in current)) { - return false; - } - if (typeof current[key] !== "object" || current[key] === null) { - return false; - } - current = current[key]; - } - const lastKey = parts[parts.length - 1]; - if (lastKey === "*") { - if (Array.isArray(current)) { - for (let i = 0; i < current.length; i++) { - current[i] = void 0; - } - } else if (typeof current === "object" && current !== null) { - for (const key in current) { - if (Object.prototype.hasOwnProperty.call(current, key)) { - delete current[key]; - } - } - } - } else { - if (typeof current === "object" && current !== null && lastKey in current && Object.prototype.hasOwnProperty.call(current, lastKey)) { - delete current[lastKey]; - } - } - return true; - } - var PATH_NOT_FOUND = Symbol("PATH_NOT_FOUND"); - function getValueIfExists(obj, parts) { - let current = obj; - for (const part of parts) { - if (current === null || current === void 0) { - return PATH_NOT_FOUND; - } - if (typeof current !== "object" || current === null) { - return PATH_NOT_FOUND; - } - if (!(part in current)) { - return PATH_NOT_FOUND; - } - current = current[part]; - } - return current; - } - function getValue(obj, parts) { - let current = obj; - for (const part of parts) { - if (current === null || current === void 0) { - return void 0; - } - if (typeof current !== "object" || current === null) { - return void 0; - } - current = current[part]; - } - return current; - } - function redactPaths(obj, paths, censor, remove = false) { - for (const path2 of paths) { - const parts = parsePath(path2); - if (parts.includes("*")) { - redactWildcardPath(obj, parts, censor, path2, remove); - } else { - if (remove) { - removeKey(obj, parts); - } else { - const value = getValueIfExists(obj, parts); - if (value === PATH_NOT_FOUND) { - continue; - } - const actualCensor = typeof censor === "function" ? censor(value, parts) : censor; - setValue(obj, parts, actualCensor); - } - } - } - } - function redactWildcardPath(obj, parts, censor, originalPath, remove = false) { - const wildcardIndex = parts.indexOf("*"); - if (wildcardIndex === parts.length - 1) { - const parentParts = parts.slice(0, -1); - let current = obj; - for (const part of parentParts) { - if (current === null || current === void 0) - return; - if (typeof current !== "object" || current === null) - return; - current = current[part]; - } - if (Array.isArray(current)) { - if (remove) { - for (let i = 0; i < current.length; i++) { - current[i] = void 0; - } - } else { - for (let i = 0; i < current.length; i++) { - const indexPath = [...parentParts, i.toString()]; - const actualCensor = typeof censor === "function" ? censor(current[i], indexPath) : censor; - current[i] = actualCensor; - } - } - } else if (typeof current === "object" && current !== null) { - if (remove) { - const keysToDelete = []; - for (const key in current) { - if (Object.prototype.hasOwnProperty.call(current, key)) { - keysToDelete.push(key); - } - } - for (const key of keysToDelete) { - delete current[key]; - } - } else { - for (const key in current) { - const keyPath = [...parentParts, key]; - const actualCensor = typeof censor === "function" ? censor(current[key], keyPath) : censor; - current[key] = actualCensor; - } - } - } - } else { - redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove); - } - } - function redactIntermediateWildcard(obj, parts, censor, wildcardIndex, originalPath, remove = false) { - const beforeWildcard = parts.slice(0, wildcardIndex); - const afterWildcard = parts.slice(wildcardIndex + 1); - const pathArray = []; - function traverse(current, pathLength) { - if (pathLength === beforeWildcard.length) { - if (Array.isArray(current)) { - for (let i = 0; i < current.length; i++) { - pathArray[pathLength] = i.toString(); - traverse(current[i], pathLength + 1); - } - } else if (typeof current === "object" && current !== null) { - for (const key in current) { - pathArray[pathLength] = key; - traverse(current[key], pathLength + 1); - } - } - } else if (pathLength < beforeWildcard.length) { - const nextKey = beforeWildcard[pathLength]; - if (current && typeof current === "object" && current !== null && nextKey in current) { - pathArray[pathLength] = nextKey; - traverse(current[nextKey], pathLength + 1); - } - } else { - if (afterWildcard.includes("*")) { - const wrappedCensor = typeof censor === "function" ? (value, path2) => { - const fullPath = [...pathArray.slice(0, pathLength), ...path2]; - return censor(value, fullPath); - } : censor; - redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove); - } else { - if (remove) { - removeKey(current, afterWildcard); - } else { - const actualCensor = typeof censor === "function" ? censor(getValue(current, afterWildcard), [...pathArray.slice(0, pathLength), ...afterWildcard]) : censor; - setValue(current, afterWildcard, actualCensor); - } - } - } - } - if (beforeWildcard.length === 0) { - traverse(obj, 0); - } else { - let current = obj; - for (let i = 0; i < beforeWildcard.length; i++) { - const part = beforeWildcard[i]; - if (current === null || current === void 0) - return; - if (typeof current !== "object" || current === null) - return; - current = current[part]; - pathArray[i] = part; - } - if (current !== null && current !== void 0) { - traverse(current, beforeWildcard.length); - } - } - } - function buildPathStructure(pathsToClone) { - if (pathsToClone.length === 0) { - return null; - } - const pathStructure = /* @__PURE__ */ new Map(); - for (const path2 of pathsToClone) { - const parts = parsePath(path2); - let current = pathStructure; - for (let i = 0; i < parts.length; i++) { - const part = parts[i]; - if (!current.has(part)) { - current.set(part, /* @__PURE__ */ new Map()); - } - current = current.get(part); - } - } - return pathStructure; - } - function selectiveClone(obj, pathStructure) { - if (!pathStructure) { - return obj; - } - function cloneSelectively(source, pathMap, depth = 0) { - if (!pathMap || pathMap.size === 0) { - return source; - } - if (source === null || typeof source !== "object") { - return source; - } - if (source instanceof Date) { - return new Date(source.getTime()); - } - if (Array.isArray(source)) { - const cloned2 = []; - for (let i = 0; i < source.length; i++) { - const indexStr = i.toString(); - if (pathMap.has(indexStr) || pathMap.has("*")) { - cloned2[i] = cloneSelectively(source[i], pathMap.get(indexStr) || pathMap.get("*")); - } else { - cloned2[i] = source[i]; - } - } - return cloned2; - } - const cloned = Object.create(Object.getPrototypeOf(source)); - for (const key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - if (pathMap.has(key) || pathMap.has("*")) { - cloned[key] = cloneSelectively(source[key], pathMap.get(key) || pathMap.get("*")); - } else { - cloned[key] = source[key]; - } - } - } - return cloned; - } - return cloneSelectively(obj, pathStructure); - } - function validatePath(path2) { - if (typeof path2 !== "string") { - throw new Error("Paths must be (non-empty) strings"); - } - if (path2 === "") { - throw new Error("Invalid redaction path ()"); - } - if (path2.includes("..")) { - throw new Error(`Invalid redaction path (${path2})`); - } - if (path2.includes(",")) { - throw new Error(`Invalid redaction path (${path2})`); - } - let bracketCount = 0; - let inQuotes = false; - let quoteChar = ""; - for (let i = 0; i < path2.length; i++) { - const char = path2[i]; - if ((char === '"' || char === "'") && bracketCount > 0) { - if (!inQuotes) { - inQuotes = true; - quoteChar = char; - } else if (char === quoteChar) { - inQuotes = false; - quoteChar = ""; - } - } else if (char === "[" && !inQuotes) { - bracketCount++; - } else if (char === "]" && !inQuotes) { - bracketCount--; - if (bracketCount < 0) { - throw new Error(`Invalid redaction path (${path2})`); - } - } - } - if (bracketCount !== 0) { - throw new Error(`Invalid redaction path (${path2})`); - } - } - function validatePaths(paths) { - if (!Array.isArray(paths)) { - throw new TypeError("paths must be an array"); - } - for (const path2 of paths) { - validatePath(path2); - } - } - function slowRedact(options = {}) { - const { - paths = [], - censor = "[REDACTED]", - serialize: serialize2 = JSON.stringify, - strict = true, - remove = false - } = options; - validatePaths(paths); - const pathStructure = buildPathStructure(paths); - return function redact(obj) { - if (strict && (obj === null || typeof obj !== "object")) { - if (obj === null || obj === void 0) { - return serialize2 ? serialize2(obj) : obj; - } - if (typeof obj !== "object") { - return serialize2 ? serialize2(obj) : obj; - } - } - const cloned = selectiveClone(obj, pathStructure); - const original = obj; - let actualCensor = censor; - if (typeof censor === "function") { - actualCensor = censor; - } - redactPaths(cloned, paths, actualCensor, remove); - if (serialize2 === false) { - cloned.restore = function() { - return deepClone(original); - }; - return cloned; - } - if (typeof serialize2 === "function") { - return serialize2(cloned); - } - return JSON.stringify(cloned); - }; - } - module2.exports = slowRedact; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/symbols.js -var require_symbols3 = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/symbols.js"(exports2, module2) { - "use strict"; - var setLevelSym = Symbol("pino.setLevel"); - var getLevelSym = Symbol("pino.getLevel"); - var levelValSym = Symbol("pino.levelVal"); - var levelCompSym = Symbol("pino.levelComp"); - var useLevelLabelsSym = Symbol("pino.useLevelLabels"); - var useOnlyCustomLevelsSym = Symbol("pino.useOnlyCustomLevels"); - var mixinSym = Symbol("pino.mixin"); - var lsCacheSym = Symbol("pino.lsCache"); - var chindingsSym = Symbol("pino.chindings"); - var asJsonSym = Symbol("pino.asJson"); - var writeSym = Symbol("pino.write"); - var redactFmtSym = Symbol("pino.redactFmt"); - var timeSym = Symbol("pino.time"); - var timeSliceIndexSym = Symbol("pino.timeSliceIndex"); - var streamSym = Symbol("pino.stream"); - var stringifySym = Symbol("pino.stringify"); - var stringifySafeSym = Symbol("pino.stringifySafe"); - var stringifiersSym = Symbol("pino.stringifiers"); - var endSym = Symbol("pino.end"); - var formatOptsSym = Symbol("pino.formatOpts"); - var messageKeySym = Symbol("pino.messageKey"); - var errorKeySym = Symbol("pino.errorKey"); - var nestedKeySym = Symbol("pino.nestedKey"); - var nestedKeyStrSym = Symbol("pino.nestedKeyStr"); - var mixinMergeStrategySym = Symbol("pino.mixinMergeStrategy"); - var msgPrefixSym = Symbol("pino.msgPrefix"); - var wildcardFirstSym = Symbol("pino.wildcardFirst"); - var serializersSym = Symbol.for("pino.serializers"); - var formattersSym = Symbol.for("pino.formatters"); - var hooksSym = Symbol.for("pino.hooks"); - var needsMetadataGsym = Symbol.for("pino.metadata"); - module2.exports = { - setLevelSym, - getLevelSym, - levelValSym, - levelCompSym, - useLevelLabelsSym, - mixinSym, - lsCacheSym, - chindingsSym, - asJsonSym, - writeSym, - serializersSym, - redactFmtSym, - timeSym, - timeSliceIndexSym, - streamSym, - stringifySym, - stringifySafeSym, - stringifiersSym, - endSym, - formatOptsSym, - messageKeySym, - errorKeySym, - nestedKeySym, - wildcardFirstSym, - needsMetadataGsym, - useOnlyCustomLevelsSym, - formattersSym, - hooksSym, - nestedKeyStrSym, - mixinMergeStrategySym, - msgPrefixSym - }; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/redaction.js -var require_redaction = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/redaction.js"(exports2, module2) { - "use strict"; - var Redact = require_redact(); - var { redactFmtSym, wildcardFirstSym } = require_symbols3(); - var rx = /[^.[\]]+|\[([^[\]]*?)\]/g; - var CENSOR = "[Redacted]"; - var strict = false; - function redaction(opts, serialize2) { - const { paths, censor, remove } = handle(opts); - const shape = paths.reduce((o, str) => { - rx.lastIndex = 0; - const first = rx.exec(str); - const next = rx.exec(str); - let ns = first[1] !== void 0 ? first[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/, "$1") : first[0]; - if (ns === "*") { - ns = wildcardFirstSym; - } - if (next === null) { - o[ns] = null; - return o; - } - if (o[ns] === null) { - return o; - } - const { index } = next; - const nextPath = `${str.substr(index, str.length - 1)}`; - o[ns] = o[ns] || []; - if (ns !== wildcardFirstSym && o[ns].length === 0) { - o[ns].push(...o[wildcardFirstSym] || []); - } - if (ns === wildcardFirstSym) { - Object.keys(o).forEach(function(k) { - if (o[k]) { - o[k].push(nextPath); - } - }); - } - o[ns].push(nextPath); - return o; - }, {}); - const result = { - [redactFmtSym]: Redact({ paths, censor, serialize: serialize2, strict, remove }) - }; - const topCensor = (...args) => { - return typeof censor === "function" ? serialize2(censor(...args)) : serialize2(censor); - }; - return [...Object.keys(shape), ...Object.getOwnPropertySymbols(shape)].reduce((o, k) => { - if (shape[k] === null) { - o[k] = (value) => topCensor(value, [k]); - } else { - const wrappedCensor = typeof censor === "function" ? (value, path2) => { - return censor(value, [k, ...path2]); - } : censor; - o[k] = Redact({ - paths: shape[k], - censor: wrappedCensor, - serialize: serialize2, - strict, - remove - }); - } - return o; - }, result); - } - function handle(opts) { - if (Array.isArray(opts)) { - opts = { paths: opts, censor: CENSOR }; - return opts; - } - let { paths, censor = CENSOR, remove } = opts; - if (Array.isArray(paths) === false) { - throw Error("pino \u2013 redact must contain an array of strings"); - } - if (remove === true) - censor = void 0; - return { paths, censor, remove }; - } - module2.exports = redaction; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/time.js -var require_time = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/time.js"(exports2, module2) { - "use strict"; - var nullTime = () => ""; - var epochTime = () => `,"time":${Date.now()}`; - var unixTime = () => `,"time":${Math.round(Date.now() / 1e3)}`; - var isoTime = () => `,"time":"${new Date(Date.now()).toISOString()}"`; - var NS_PER_MS = 1000000n; - var NS_PER_SEC = 1000000000n; - var startWallTimeNs = BigInt(Date.now()) * NS_PER_MS; - var startHrTime = process.hrtime.bigint(); - var isoTimeNano = () => { - const elapsedNs = process.hrtime.bigint() - startHrTime; - const currentTimeNs = startWallTimeNs + elapsedNs; - const secondsSinceEpoch = currentTimeNs / NS_PER_SEC; - const nanosWithinSecond = currentTimeNs % NS_PER_SEC; - const msSinceEpoch = Number(secondsSinceEpoch * 1000n + nanosWithinSecond / 1000000n); - const date = new Date(msSinceEpoch); - const year = date.getUTCFullYear(); - const month = (date.getUTCMonth() + 1).toString().padStart(2, "0"); - const day = date.getUTCDate().toString().padStart(2, "0"); - const hours = date.getUTCHours().toString().padStart(2, "0"); - const minutes = date.getUTCMinutes().toString().padStart(2, "0"); - const seconds = date.getUTCSeconds().toString().padStart(2, "0"); - return `,"time":"${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${nanosWithinSecond.toString().padStart(9, "0")}Z"`; - }; - module2.exports = { nullTime, epochTime, unixTime, isoTime, isoTimeNano }; - } -}); - -// ../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js -var require_quick_format_unescaped = __commonJS({ - "../../node_modules/.pnpm/quick-format-unescaped@4.0.4/node_modules/quick-format-unescaped/index.js"(exports2, module2) { - "use strict"; - function tryStringify(o) { - try { - return JSON.stringify(o); - } catch (e) { - return '"[Circular]"'; - } - } - module2.exports = format; - function format(f, args, opts) { - var ss = opts && opts.stringify || tryStringify; - var offset2 = 1; - if (typeof f === "object" && f !== null) { - var len = args.length + offset2; - if (len === 1) - return f; - var objects = new Array(len); - objects[0] = ss(f); - for (var index = 1; index < len; index++) { - objects[index] = ss(args[index]); - } - return objects.join(" "); - } - if (typeof f !== "string") { - return f; - } - var argLen = args.length; - if (argLen === 0) - return f; - var str = ""; - var a = 1 - offset2; - var lastPos = -1; - var flen = f && f.length || 0; - for (var i = 0; i < flen; ) { - if (f.charCodeAt(i) === 37 && i + 1 < flen) { - lastPos = lastPos > -1 ? lastPos : 0; - switch (f.charCodeAt(i + 1)) { - case 100: - case 102: - if (a >= argLen) - break; - if (args[a] == null) - break; - if (lastPos < i) - str += f.slice(lastPos, i); - str += Number(args[a]); - lastPos = i + 2; - i++; - break; - case 105: - if (a >= argLen) - break; - if (args[a] == null) - break; - if (lastPos < i) - str += f.slice(lastPos, i); - str += Math.floor(Number(args[a])); - lastPos = i + 2; - i++; - break; - case 79: - case 111: - case 106: - if (a >= argLen) - break; - if (args[a] === void 0) - break; - if (lastPos < i) - str += f.slice(lastPos, i); - var type2 = typeof args[a]; - if (type2 === "string") { - str += "'" + args[a] + "'"; - lastPos = i + 2; - i++; - break; - } - if (type2 === "function") { - str += args[a].name || ""; - lastPos = i + 2; - i++; - break; - } - str += ss(args[a]); - lastPos = i + 2; - i++; - break; - case 115: - if (a >= argLen) - break; - if (lastPos < i) - str += f.slice(lastPos, i); - str += String(args[a]); - lastPos = i + 2; - i++; - break; - case 37: - if (lastPos < i) - str += f.slice(lastPos, i); - str += "%"; - lastPos = i + 2; - i++; - a--; - break; - } - ++a; - } - ++i; - } - if (lastPos === -1) - return f; - else if (lastPos < flen) { - str += f.slice(lastPos); - } - return str; - } - } -}); - -// ../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js -var require_atomic_sleep = __commonJS({ - "../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js"(exports2, module2) { - "use strict"; - if (typeof SharedArrayBuffer !== "undefined" && typeof Atomics !== "undefined") { - let sleep2 = function(ms2) { - const valid = ms2 > 0 && ms2 < Infinity; - if (valid === false) { - if (typeof ms2 !== "number" && typeof ms2 !== "bigint") { - throw TypeError("sleep: ms must be a number"); - } - throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity"); - } - Atomics.wait(nil, 0, 0, Number(ms2)); - }; - const nil = new Int32Array(new SharedArrayBuffer(4)); - module2.exports = sleep2; - } else { - let sleep2 = function(ms2) { - const valid = ms2 > 0 && ms2 < Infinity; - if (valid === false) { - if (typeof ms2 !== "number" && typeof ms2 !== "bigint") { - throw TypeError("sleep: ms must be a number"); - } - throw RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity"); - } - const target = Date.now() + Number(ms2); - while (target > Date.now()) { - } - }; - module2.exports = sleep2; - } - } -}); - -// ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js -var require_sonic_boom = __commonJS({ - "../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js"(exports2, module2) { - "use strict"; - var fs2 = require("fs"); - var EventEmitter2 = require("events"); - var inherits = require("util").inherits; - var path2 = require("path"); - var sleep2 = require_atomic_sleep(); - var assert3 = require("assert"); - var BUSY_WRITE_TIMEOUT = 100; - var kEmptyBuffer = Buffer.allocUnsafe(0); - var MAX_WRITE = 16 * 1024; - var kContentModeBuffer = "buffer"; - var kContentModeUtf8 = "utf8"; - var [major, minor] = (process.versions.node || "0.0").split(".").map(Number); - var kCopyBuffer = major >= 22 && minor >= 7; - function openFile(file, sonic) { - sonic._opening = true; - sonic._writing = true; - sonic._asyncDrainScheduled = false; - function fileOpened(err, fd) { - if (err) { - sonic._reopening = false; - sonic._writing = false; - sonic._opening = false; - if (sonic.sync) { - process.nextTick(() => { - if (sonic.listenerCount("error") > 0) { - sonic.emit("error", err); - } - }); - } else { - sonic.emit("error", err); - } - return; - } - const reopening = sonic._reopening; - sonic.fd = fd; - sonic.file = file; - sonic._reopening = false; - sonic._opening = false; - sonic._writing = false; - if (sonic.sync) { - process.nextTick(() => sonic.emit("ready")); - } else { - sonic.emit("ready"); - } - if (sonic.destroyed) { - return; - } - if (!sonic._writing && sonic._len > sonic.minLength || sonic._flushPending) { - sonic._actualWrite(); - } else if (reopening) { - process.nextTick(() => sonic.emit("drain")); - } - } - const flags = sonic.append ? "a" : "w"; - const mode = sonic.mode; - if (sonic.sync) { - try { - if (sonic.mkdir) - fs2.mkdirSync(path2.dirname(file), { recursive: true }); - const fd = fs2.openSync(file, flags, mode); - fileOpened(null, fd); - } catch (err) { - fileOpened(err); - throw err; - } - } else if (sonic.mkdir) { - fs2.mkdir(path2.dirname(file), { recursive: true }, (err) => { - if (err) - return fileOpened(err); - fs2.open(file, flags, mode, fileOpened); - }); - } else { - fs2.open(file, flags, mode, fileOpened); - } - } - function SonicBoom(opts) { - if (!(this instanceof SonicBoom)) { - return new SonicBoom(opts); - } - let { fd, dest, minLength, maxLength, maxWrite, periodicFlush, sync, append = true, mkdir, retryEAGAIN, fsync, contentMode, mode } = opts || {}; - fd = fd || dest; - this._len = 0; - this.fd = -1; - this._bufs = []; - this._lens = []; - this._writing = false; - this._ending = false; - this._reopening = false; - this._asyncDrainScheduled = false; - this._flushPending = false; - this._hwm = Math.max(minLength || 0, 16387); - this.file = null; - this.destroyed = false; - this.minLength = minLength || 0; - this.maxLength = maxLength || 0; - this.maxWrite = maxWrite || MAX_WRITE; - this._periodicFlush = periodicFlush || 0; - this._periodicFlushTimer = void 0; - this.sync = sync || false; - this.writable = true; - this._fsync = fsync || false; - this.append = append || false; - this.mode = mode; - this.retryEAGAIN = retryEAGAIN || (() => true); - this.mkdir = mkdir || false; - let fsWriteSync; - let fsWrite; - if (contentMode === kContentModeBuffer) { - this._writingBuf = kEmptyBuffer; - this.write = writeBuffer; - this.flush = flushBuffer; - this.flushSync = flushBufferSync; - this._actualWrite = actualWriteBuffer; - fsWriteSync = () => fs2.writeSync(this.fd, this._writingBuf); - fsWrite = () => fs2.write(this.fd, this._writingBuf, this.release); - } else if (contentMode === void 0 || contentMode === kContentModeUtf8) { - this._writingBuf = ""; - this.write = write; - this.flush = flush; - this.flushSync = flushSync; - this._actualWrite = actualWrite; - fsWriteSync = () => { - if (Buffer.isBuffer(this._writingBuf)) { - return fs2.writeSync(this.fd, this._writingBuf); - } - return fs2.writeSync(this.fd, this._writingBuf, "utf8"); - }; - fsWrite = () => { - if (Buffer.isBuffer(this._writingBuf)) { - return fs2.write(this.fd, this._writingBuf, this.release); - } - return fs2.write(this.fd, this._writingBuf, "utf8", this.release); - }; - } else { - throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`); - } - if (typeof fd === "number") { - this.fd = fd; - process.nextTick(() => this.emit("ready")); - } else if (typeof fd === "string") { - openFile(fd, this); - } else { - throw new Error("SonicBoom supports only file descriptors and files"); - } - if (this.minLength >= this.maxWrite) { - throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`); - } - this.release = (err, n) => { - if (err) { - if ((err.code === "EAGAIN" || err.code === "EBUSY") && this.retryEAGAIN(err, this._writingBuf.length, this._len - this._writingBuf.length)) { - if (this.sync) { - try { - sleep2(BUSY_WRITE_TIMEOUT); - this.release(void 0, 0); - } catch (err2) { - this.release(err2); - } - } else { - setTimeout(fsWrite, BUSY_WRITE_TIMEOUT); - } - } else { - this._writing = false; - this.emit("error", err); - } - return; - } - this.emit("write", n); - const releasedBufObj = releaseWritingBuf(this._writingBuf, this._len, n); - this._len = releasedBufObj.len; - this._writingBuf = releasedBufObj.writingBuf; - if (this._writingBuf.length) { - if (!this.sync) { - fsWrite(); - return; - } - try { - do { - const n2 = fsWriteSync(); - const releasedBufObj2 = releaseWritingBuf(this._writingBuf, this._len, n2); - this._len = releasedBufObj2.len; - this._writingBuf = releasedBufObj2.writingBuf; - } while (this._writingBuf.length); - } catch (err2) { - this.release(err2); - return; - } - } - if (this._fsync) { - fs2.fsyncSync(this.fd); - } - const len = this._len; - if (this._reopening) { - this._writing = false; - this._reopening = false; - this.reopen(); - } else if (len > this.minLength) { - this._actualWrite(); - } else if (this._ending) { - if (len > 0) { - this._actualWrite(); - } else { - this._writing = false; - actualClose(this); - } - } else { - this._writing = false; - if (this.sync) { - if (!this._asyncDrainScheduled) { - this._asyncDrainScheduled = true; - process.nextTick(emitDrain, this); - } - } else { - this.emit("drain"); - } - } - }; - this.on("newListener", function(name) { - if (name === "drain") { - this._asyncDrainScheduled = false; - } - }); - if (this._periodicFlush !== 0) { - this._periodicFlushTimer = setInterval(() => this.flush(null), this._periodicFlush); - this._periodicFlushTimer.unref(); - } - } - function releaseWritingBuf(writingBuf, len, n) { - if (typeof writingBuf === "string") { - writingBuf = Buffer.from(writingBuf); - } - len = Math.max(len - n, 0); - writingBuf = writingBuf.subarray(n); - return { writingBuf, len }; - } - function emitDrain(sonic) { - const hasListeners = sonic.listenerCount("drain") > 0; - if (!hasListeners) - return; - sonic._asyncDrainScheduled = false; - sonic.emit("drain"); - } - inherits(SonicBoom, EventEmitter2); - function mergeBuf(bufs, len) { - if (bufs.length === 0) { - return kEmptyBuffer; - } - if (bufs.length === 1) { - return bufs[0]; - } - return Buffer.concat(bufs, len); - } - function write(data) { - if (this.destroyed) { - throw new Error("SonicBoom destroyed"); - } - data = "" + data; - const dataLen = Buffer.byteLength(data); - const len = this._len + dataLen; - const bufs = this._bufs; - if (this.maxLength && len > this.maxLength) { - this.emit("drop", data); - return this._len < this._hwm; - } - if (bufs.length === 0 || Buffer.byteLength(bufs[bufs.length - 1]) + dataLen > this.maxWrite) { - bufs.push(data); - } else { - bufs[bufs.length - 1] += data; - } - this._len = len; - if (!this._writing && this._len >= this.minLength) { - this._actualWrite(); - } - return this._len < this._hwm; - } - function writeBuffer(data) { - if (this.destroyed) { - throw new Error("SonicBoom destroyed"); - } - const len = this._len + data.length; - const bufs = this._bufs; - const lens = this._lens; - if (this.maxLength && len > this.maxLength) { - this.emit("drop", data); - return this._len < this._hwm; - } - if (bufs.length === 0 || lens[lens.length - 1] + data.length > this.maxWrite) { - bufs.push([data]); - lens.push(data.length); - } else { - bufs[bufs.length - 1].push(data); - lens[lens.length - 1] += data.length; - } - this._len = len; - if (!this._writing && this._len >= this.minLength) { - this._actualWrite(); - } - return this._len < this._hwm; - } - function callFlushCallbackOnDrain(cb) { - this._flushPending = true; - const onDrain = () => { - if (!this._fsync) { - try { - fs2.fsync(this.fd, (err) => { - this._flushPending = false; - cb(err); - }); - } catch (err) { - cb(err); - } - } else { - this._flushPending = false; - cb(); - } - this.off("error", onError); - }; - const onError = (err) => { - this._flushPending = false; - cb(err); - this.off("drain", onDrain); - }; - this.once("drain", onDrain); - this.once("error", onError); - } - function flush(cb) { - if (cb != null && typeof cb !== "function") { - throw new Error("flush cb must be a function"); - } - if (this.destroyed) { - const error = new Error("SonicBoom destroyed"); - if (cb) { - cb(error); - return; - } - throw error; - } - if (this.minLength <= 0) { - cb?.(); - return; - } - if (cb) { - callFlushCallbackOnDrain.call(this, cb); - } - if (this._writing) { - return; - } - if (this._bufs.length === 0) { - this._bufs.push(""); - } - this._actualWrite(); - } - function flushBuffer(cb) { - if (cb != null && typeof cb !== "function") { - throw new Error("flush cb must be a function"); - } - if (this.destroyed) { - const error = new Error("SonicBoom destroyed"); - if (cb) { - cb(error); - return; - } - throw error; - } - if (this.minLength <= 0) { - cb?.(); - return; - } - if (cb) { - callFlushCallbackOnDrain.call(this, cb); - } - if (this._writing) { - return; - } - if (this._bufs.length === 0) { - this._bufs.push([]); - this._lens.push(0); - } - this._actualWrite(); - } - SonicBoom.prototype.reopen = function(file) { - if (this.destroyed) { - throw new Error("SonicBoom destroyed"); - } - if (this._opening) { - this.once("ready", () => { - this.reopen(file); - }); - return; - } - if (this._ending) { - return; - } - if (!this.file) { - throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom"); - } - if (file) { - this.file = file; - } - this._reopening = true; - if (this._writing) { - return; - } - const fd = this.fd; - this.once("ready", () => { - if (fd !== this.fd) { - fs2.close(fd, (err) => { - if (err) { - return this.emit("error", err); - } - }); - } - }); - openFile(this.file, this); - }; - SonicBoom.prototype.end = function() { - if (this.destroyed) { - throw new Error("SonicBoom destroyed"); - } - if (this._opening) { - this.once("ready", () => { - this.end(); - }); - return; - } - if (this._ending) { - return; - } - this._ending = true; - if (this._writing) { - return; - } - if (this._len > 0 && this.fd >= 0) { - this._actualWrite(); - } else { - actualClose(this); - } - }; - function flushSync() { - if (this.destroyed) { - throw new Error("SonicBoom destroyed"); - } - if (this.fd < 0) { - throw new Error("sonic boom is not ready yet"); - } - if (!this._writing && this._writingBuf.length > 0) { - this._bufs.unshift(this._writingBuf); - this._writingBuf = ""; - } - let buf = ""; - while (this._bufs.length || buf.length) { - if (buf.length <= 0) { - buf = this._bufs[0]; - } - try { - const n = Buffer.isBuffer(buf) ? fs2.writeSync(this.fd, buf) : fs2.writeSync(this.fd, buf, "utf8"); - const releasedBufObj = releaseWritingBuf(buf, this._len, n); - buf = releasedBufObj.writingBuf; - this._len = releasedBufObj.len; - if (buf.length <= 0) { - this._bufs.shift(); - } - } catch (err) { - const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY"; - if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) { - throw err; - } - sleep2(BUSY_WRITE_TIMEOUT); - } - } - try { - fs2.fsyncSync(this.fd); - } catch { - } - } - function flushBufferSync() { - if (this.destroyed) { - throw new Error("SonicBoom destroyed"); - } - if (this.fd < 0) { - throw new Error("sonic boom is not ready yet"); - } - if (!this._writing && this._writingBuf.length > 0) { - this._bufs.unshift([this._writingBuf]); - this._writingBuf = kEmptyBuffer; - } - let buf = kEmptyBuffer; - while (this._bufs.length || buf.length) { - if (buf.length <= 0) { - buf = mergeBuf(this._bufs[0], this._lens[0]); - } - try { - const n = fs2.writeSync(this.fd, buf); - buf = buf.subarray(n); - this._len = Math.max(this._len - n, 0); - if (buf.length <= 0) { - this._bufs.shift(); - this._lens.shift(); - } - } catch (err) { - const shouldRetry = err.code === "EAGAIN" || err.code === "EBUSY"; - if (shouldRetry && !this.retryEAGAIN(err, buf.length, this._len - buf.length)) { - throw err; - } - sleep2(BUSY_WRITE_TIMEOUT); - } - } - } - SonicBoom.prototype.destroy = function() { - if (this.destroyed) { - return; - } - actualClose(this); - }; - function actualWrite() { - const release = this.release; - this._writing = true; - this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || ""; - if (this.sync) { - try { - const written = Buffer.isBuffer(this._writingBuf) ? fs2.writeSync(this.fd, this._writingBuf) : fs2.writeSync(this.fd, this._writingBuf, "utf8"); - release(null, written); - } catch (err) { - release(err); - } - } else { - fs2.write(this.fd, this._writingBuf, release); - } - } - function actualWriteBuffer() { - const release = this.release; - this._writing = true; - this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift()); - if (this.sync) { - try { - const written = fs2.writeSync(this.fd, this._writingBuf); - release(null, written); - } catch (err) { - release(err); - } - } else { - if (kCopyBuffer) { - this._writingBuf = Buffer.from(this._writingBuf); - } - fs2.write(this.fd, this._writingBuf, release); - } - } - function actualClose(sonic) { - if (sonic.fd === -1) { - sonic.once("ready", actualClose.bind(null, sonic)); - return; - } - if (sonic._periodicFlushTimer !== void 0) { - clearInterval(sonic._periodicFlushTimer); - } - sonic.destroyed = true; - sonic._bufs = []; - sonic._lens = []; - assert3(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`); - try { - fs2.fsync(sonic.fd, closeWrapped); - } catch { - } - function closeWrapped() { - if (sonic.fd !== 1 && sonic.fd !== 2) { - fs2.close(sonic.fd, done); - } else { - done(); - } - } - function done(err) { - if (err) { - sonic.emit("error", err); - return; - } - if (sonic._ending && !sonic._writing) { - sonic.emit("finish"); - } - sonic.emit("close"); - } - } - SonicBoom.SonicBoom = SonicBoom; - SonicBoom.default = SonicBoom; - module2.exports = SonicBoom; - } -}); - -// ../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js -var require_on_exit_leak_free = __commonJS({ - "../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js"(exports2, module2) { - "use strict"; - var refs = { - exit: [], - beforeExit: [] - }; - var functions = { - exit: onExit, - beforeExit: onBeforeExit - }; - var registry; - function ensureRegistry() { - if (registry === void 0) { - registry = new FinalizationRegistry(clear); - } - } - function install(event) { - if (refs[event].length > 0) { - return; - } - process.on(event, functions[event]); - } - function uninstall(event) { - if (refs[event].length > 0) { - return; - } - process.removeListener(event, functions[event]); - if (refs.exit.length === 0 && refs.beforeExit.length === 0) { - registry = void 0; - } - } - function onExit() { - callRefs("exit"); - } - function onBeforeExit() { - callRefs("beforeExit"); - } - function callRefs(event) { - for (const ref of refs[event]) { - const obj = ref.deref(); - const fn = ref.fn; - if (obj !== void 0) { - fn(obj, event); - } - } - refs[event] = []; - } - function clear(ref) { - for (const event of ["exit", "beforeExit"]) { - const index = refs[event].indexOf(ref); - refs[event].splice(index, index + 1); - uninstall(event); - } - } - function _register(event, obj, fn) { - if (obj === void 0) { - throw new Error("the object can't be undefined"); - } - install(event); - const ref = new WeakRef(obj); - ref.fn = fn; - ensureRegistry(); - registry.register(obj, ref); - refs[event].push(ref); - } - function register(obj, fn) { - _register("exit", obj, fn); - } - function registerBeforeExit(obj, fn) { - _register("beforeExit", obj, fn); - } - function unregister(obj) { - if (registry === void 0) { - return; - } - registry.unregister(obj); - for (const event of ["exit", "beforeExit"]) { - refs[event] = refs[event].filter((ref) => { - const _obj = ref.deref(); - return _obj && _obj !== obj; - }); - uninstall(event); - } - } - module2.exports = { - register, - registerBeforeExit, - unregister - }; - } -}); - -// ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/package.json -var require_package = __commonJS({ - "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/package.json"(exports2, module2) { - module2.exports = { - name: "thread-stream", - version: "4.0.0", - description: "A streaming way to send data to a Node.js Worker Thread", - main: "index.js", - types: "index.d.ts", - engines: { - node: ">=20" - }, - dependencies: { - "real-require": "^0.2.0" - }, - devDependencies: { - "@types/node": "^22.0.0", - "@yao-pkg/pkg": "^6.0.0", - borp: "^0.21.0", - desm: "^1.3.0", - eslint: "^9.39.1", - fastbench: "^1.0.1", - husky: "^9.0.6", - neostandard: "^0.12.2", - "pino-elasticsearch": "^8.0.0", - "sonic-boom": "^4.0.1", - "ts-node": "^10.8.0", - typescript: "~5.7.3" - }, - scripts: { - build: "tsc --noEmit", - lint: "eslint", - test: "npm run lint && npm run build && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'", - "test:ci": "npm run lint && npm run transpile && borp --pattern 'test/*.test.{js,mjs}'", - "test:yarn": "npm run transpile && borp --pattern 'test/*.test.js'", - transpile: "sh ./test/ts/transpile.sh", - prepare: "husky install" - }, - repository: { - type: "git", - url: "git+https://github.com/mcollina/thread-stream.git" - }, - keywords: [ - "worker", - "thread", - "threads", - "stream" - ], - author: "Matteo Collina ", - license: "MIT", - bugs: { - url: "https://github.com/mcollina/thread-stream/issues" - }, - homepage: "https://github.com/mcollina/thread-stream#readme" - }; - } -}); - -// ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/wait.js -var require_wait = __commonJS({ - "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/wait.js"(exports2, module2) { - "use strict"; - var WAIT_MS = 1e4; - function wait(state, index, expected, timeout, done) { - const max = timeout === Infinity ? Infinity : Date.now() + timeout; - const check = () => { - const current = Atomics.load(state, index); - if (current === expected) { - done(null, "ok"); - return; - } - if (max !== Infinity && Date.now() > max) { - done(null, "timed-out"); - return; - } - const remaining = max === Infinity ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now())); - const result = Atomics.waitAsync(state, index, current, remaining); - if (result.async) { - result.value.then(check); - } else { - setImmediate(check); - } - }; - check(); - } - function waitDiff(state, index, expected, timeout, done) { - const max = timeout === Infinity ? Infinity : Date.now() + timeout; - const check = () => { - const current = Atomics.load(state, index); - if (current !== expected) { - done(null, "ok"); - return; - } - if (max !== Infinity && Date.now() > max) { - done(null, "timed-out"); - return; - } - const remaining = max === Infinity ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now())); - const result = Atomics.waitAsync(state, index, expected, remaining); - if (result.async) { - result.value.then(check); - } else { - setImmediate(check); - } - }; - check(); - } - module2.exports = { wait, waitDiff }; - } -}); - -// ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/indexes.js -var require_indexes = __commonJS({ - "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/lib/indexes.js"(exports2, module2) { - "use strict"; - var WRITE_INDEX = 4; - var READ_INDEX = 8; - module2.exports = { - WRITE_INDEX, - READ_INDEX - }; - } -}); - -// ../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/index.js -var require_thread_stream = __commonJS({ - "../../node_modules/.pnpm/thread-stream@4.0.0/node_modules/thread-stream/index.js"(exports2, module2) { - "use strict"; - var { version: version2 } = require_package(); - var { EventEmitter: EventEmitter2 } = require("events"); - var { Worker } = require("worker_threads"); - var { join: join2 } = require("path"); - var { pathToFileURL } = require("url"); - var { wait } = require_wait(); - var { - WRITE_INDEX, - READ_INDEX - } = require_indexes(); - var buffer = require("buffer"); - var assert3 = require("assert"); - var kImpl = Symbol("kImpl"); - var MAX_STRING = buffer.constants.MAX_STRING_LENGTH; - var FakeWeakRef = class { - constructor(value) { - this._value = value; - } - deref() { - return this._value; - } - }; - var FakeFinalizationRegistry = class { - register() { - } - unregister() { - } - }; - var FinalizationRegistry2 = process.env.NODE_V8_COVERAGE ? FakeFinalizationRegistry : global.FinalizationRegistry || FakeFinalizationRegistry; - var WeakRef2 = process.env.NODE_V8_COVERAGE ? FakeWeakRef : global.WeakRef || FakeWeakRef; - var registry = new FinalizationRegistry2((worker) => { - if (worker.exited) { - return; - } - worker.terminate(); - }); - function createWorker(stream, opts) { - const { filename, workerData } = opts; - const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {}; - const toExecute = bundlerOverrides["thread-stream-worker"] || join2(__dirname, "lib", "worker.js"); - const worker = new Worker(toExecute, { - ...opts.workerOpts, - trackUnmanagedFds: false, - workerData: { - filename: filename.indexOf("file://") === 0 ? filename : pathToFileURL(filename).href, - dataBuf: stream[kImpl].dataBuf, - stateBuf: stream[kImpl].stateBuf, - workerData: { - $context: { - threadStreamVersion: version2 - }, - ...workerData - } - } - }); - worker.stream = new FakeWeakRef(stream); - worker.on("message", onWorkerMessage); - worker.on("exit", onWorkerExit); - registry.register(stream, worker); - return worker; - } - function drain(stream) { - assert3(!stream[kImpl].sync); - if (stream[kImpl].needDrain) { - stream[kImpl].needDrain = false; - stream.emit("drain"); - } - } - function nextFlush(stream) { - const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX); - let leftover = stream[kImpl].data.length - writeIndex; - if (leftover > 0) { - if (stream[kImpl].buf.length === 0) { - stream[kImpl].flushing = false; - if (stream[kImpl].ending) { - end(stream); - } else if (stream[kImpl].needDrain) { - process.nextTick(drain, stream); - } - return; - } - let toWrite = stream[kImpl].buf.slice(0, leftover); - let toWriteBytes = Buffer.byteLength(toWrite); - if (toWriteBytes <= leftover) { - stream[kImpl].buf = stream[kImpl].buf.slice(leftover); - write(stream, toWrite, nextFlush.bind(null, stream)); - } else { - stream.flush(() => { - if (stream.destroyed) { - return; - } - Atomics.store(stream[kImpl].state, READ_INDEX, 0); - Atomics.store(stream[kImpl].state, WRITE_INDEX, 0); - Atomics.notify(stream[kImpl].state, READ_INDEX); - while (toWriteBytes > stream[kImpl].data.length) { - leftover = leftover / 2; - toWrite = stream[kImpl].buf.slice(0, leftover); - toWriteBytes = Buffer.byteLength(toWrite); - } - stream[kImpl].buf = stream[kImpl].buf.slice(leftover); - write(stream, toWrite, nextFlush.bind(null, stream)); - }); - } - } else if (leftover === 0) { - if (writeIndex === 0 && stream[kImpl].buf.length === 0) { - return; - } - stream.flush(() => { - Atomics.store(stream[kImpl].state, READ_INDEX, 0); - Atomics.store(stream[kImpl].state, WRITE_INDEX, 0); - Atomics.notify(stream[kImpl].state, READ_INDEX); - nextFlush(stream); - }); - } else { - destroy(stream, new Error("overwritten")); - } - } - function onWorkerMessage(msg) { - const stream = this.stream.deref(); - if (stream === void 0) { - this.exited = true; - this.terminate(); - return; - } - switch (msg.code) { - case "READY": - this.stream = new WeakRef2(stream); - stream.flush(() => { - stream[kImpl].ready = true; - stream.emit("ready"); - }); - break; - case "ERROR": - destroy(stream, msg.err); - break; - case "EVENT": - if (Array.isArray(msg.args)) { - stream.emit(msg.name, ...msg.args); - } else { - stream.emit(msg.name, msg.args); - } - break; - case "WARNING": - process.emitWarning(msg.err); - break; - default: - destroy(stream, new Error("this should not happen: " + msg.code)); - } - } - function onWorkerExit(code) { - const stream = this.stream.deref(); - if (stream === void 0) { - return; - } - registry.unregister(stream); - stream.worker.exited = true; - stream.worker.off("exit", onWorkerExit); - destroy(stream, code !== 0 ? new Error("the worker thread exited") : null); - } - var ThreadStream = class extends EventEmitter2 { - constructor(opts = {}) { - super(); - if (opts.bufferSize < 4) { - throw new Error("bufferSize must at least fit a 4-byte utf-8 char"); - } - this[kImpl] = {}; - this[kImpl].stateBuf = new SharedArrayBuffer(128); - this[kImpl].state = new Int32Array(this[kImpl].stateBuf); - this[kImpl].dataBuf = new SharedArrayBuffer(opts.bufferSize || 4 * 1024 * 1024); - this[kImpl].data = Buffer.from(this[kImpl].dataBuf); - this[kImpl].sync = opts.sync || false; - this[kImpl].ending = false; - this[kImpl].ended = false; - this[kImpl].needDrain = false; - this[kImpl].destroyed = false; - this[kImpl].flushing = false; - this[kImpl].ready = false; - this[kImpl].finished = false; - this[kImpl].errored = null; - this[kImpl].closed = false; - this[kImpl].buf = ""; - this.worker = createWorker(this, opts); - this.on("message", (message, transferList) => { - this.worker.postMessage(message, transferList); - }); - } - write(data) { - if (this[kImpl].destroyed) { - error(this, new Error("the worker has exited")); - return false; - } - if (this[kImpl].ending) { - error(this, new Error("the worker is ending")); - return false; - } - if (this[kImpl].flushing && this[kImpl].buf.length + data.length >= MAX_STRING) { - try { - writeSync(this); - this[kImpl].flushing = true; - } catch (err) { - destroy(this, err); - return false; - } - } - this[kImpl].buf += data; - if (this[kImpl].sync) { - try { - writeSync(this); - return true; - } catch (err) { - destroy(this, err); - return false; - } - } - if (!this[kImpl].flushing) { - this[kImpl].flushing = true; - setImmediate(nextFlush, this); - } - this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].buf.length - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0; - return !this[kImpl].needDrain; - } - end() { - if (this[kImpl].destroyed) { - return; - } - this[kImpl].ending = true; - end(this); - } - flush(cb) { - if (this[kImpl].destroyed) { - if (typeof cb === "function") { - process.nextTick(cb, new Error("the worker has exited")); - } - return; - } - const writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX); - wait(this[kImpl].state, READ_INDEX, writeIndex, Infinity, (err, res) => { - if (err) { - destroy(this, err); - process.nextTick(cb, err); - return; - } - if (res === "not-equal") { - this.flush(cb); - return; - } - process.nextTick(cb); - }); - } - flushSync() { - if (this[kImpl].destroyed) { - return; - } - writeSync(this); - flushSync(this); - } - unref() { - this.worker.unref(); - } - ref() { - this.worker.ref(); - } - get ready() { - return this[kImpl].ready; - } - get destroyed() { - return this[kImpl].destroyed; - } - get closed() { - return this[kImpl].closed; - } - get writable() { - return !this[kImpl].destroyed && !this[kImpl].ending; - } - get writableEnded() { - return this[kImpl].ending; - } - get writableFinished() { - return this[kImpl].finished; - } - get writableNeedDrain() { - return this[kImpl].needDrain; - } - get writableObjectMode() { - return false; - } - get writableErrored() { - return this[kImpl].errored; - } - }; - function error(stream, err) { - setImmediate(() => { - stream.emit("error", err); - }); - } - function destroy(stream, err) { - if (stream[kImpl].destroyed) { - return; - } - stream[kImpl].destroyed = true; - if (err) { - stream[kImpl].errored = err; - error(stream, err); - } - if (!stream.worker.exited) { - stream.worker.terminate().catch(() => { - }).then(() => { - stream[kImpl].closed = true; - stream.emit("close"); - }); - } else { - setImmediate(() => { - stream[kImpl].closed = true; - stream.emit("close"); - }); - } - } - function write(stream, data, cb) { - const current = Atomics.load(stream[kImpl].state, WRITE_INDEX); - const length = Buffer.byteLength(data); - stream[kImpl].data.write(data, current); - Atomics.store(stream[kImpl].state, WRITE_INDEX, current + length); - Atomics.notify(stream[kImpl].state, WRITE_INDEX); - cb(); - return true; - } - function end(stream) { - if (stream[kImpl].ended || !stream[kImpl].ending || stream[kImpl].flushing) { - return; - } - stream[kImpl].ended = true; - try { - stream.flushSync(); - let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX); - Atomics.store(stream[kImpl].state, WRITE_INDEX, -1); - Atomics.notify(stream[kImpl].state, WRITE_INDEX); - let spins = 0; - while (readIndex !== -1) { - Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1e3); - readIndex = Atomics.load(stream[kImpl].state, READ_INDEX); - if (readIndex === -2) { - destroy(stream, new Error("end() failed")); - return; - } - if (++spins === 10) { - destroy(stream, new Error("end() took too long (10s)")); - return; - } - } - process.nextTick(() => { - stream[kImpl].finished = true; - stream.emit("finish"); - }); - } catch (err) { - destroy(stream, err); - } - } - function writeSync(stream) { - const cb = () => { - if (stream[kImpl].ending) { - end(stream); - } else if (stream[kImpl].needDrain) { - process.nextTick(drain, stream); - } - }; - stream[kImpl].flushing = false; - while (stream[kImpl].buf.length !== 0) { - const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX); - let leftover = stream[kImpl].data.length - writeIndex; - if (leftover === 0) { - flushSync(stream); - Atomics.store(stream[kImpl].state, READ_INDEX, 0); - Atomics.store(stream[kImpl].state, WRITE_INDEX, 0); - Atomics.notify(stream[kImpl].state, READ_INDEX); - continue; - } else if (leftover < 0) { - throw new Error("overwritten"); - } - let toWrite = stream[kImpl].buf.slice(0, leftover); - let toWriteBytes = Buffer.byteLength(toWrite); - if (toWriteBytes <= leftover) { - stream[kImpl].buf = stream[kImpl].buf.slice(leftover); - write(stream, toWrite, cb); - } else { - flushSync(stream); - Atomics.store(stream[kImpl].state, READ_INDEX, 0); - Atomics.store(stream[kImpl].state, WRITE_INDEX, 0); - Atomics.notify(stream[kImpl].state, READ_INDEX); - while (toWriteBytes > stream[kImpl].buf.length) { - leftover = leftover / 2; - toWrite = stream[kImpl].buf.slice(0, leftover); - toWriteBytes = Buffer.byteLength(toWrite); - } - stream[kImpl].buf = stream[kImpl].buf.slice(leftover); - write(stream, toWrite, cb); - } - } - } - function flushSync(stream) { - if (stream[kImpl].flushing) { - throw new Error("unable to flush while flushing"); - } - const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX); - let spins = 0; - while (true) { - const readIndex = Atomics.load(stream[kImpl].state, READ_INDEX); - if (readIndex === -2) { - throw Error("_flushSync failed"); - } - if (readIndex !== writeIndex) { - Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1e3); - } else { - break; - } - if (++spins === 10) { - throw new Error("_flushSync took too long (10s)"); - } - } - } - module2.exports = ThreadStream; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/transport.js -var require_transport = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/transport.js"(exports2, module2) { - "use strict"; - var { createRequire } = require("module"); - var { existsSync: existsSync2 } = require("node:fs"); - var getCallers = require_caller(); - var { join: join2, isAbsolute, sep } = require("node:path"); - var { fileURLToPath } = require("node:url"); - var sleep2 = require_atomic_sleep(); - var onExit = require_on_exit_leak_free(); - var ThreadStream = require_thread_stream(); - function setupOnExit(stream) { - onExit.register(stream, autoEnd); - onExit.registerBeforeExit(stream, flush); - stream.on("close", function() { - onExit.unregister(stream); - }); - } - function hasPreloadFlags() { - const execArgv = process.execArgv; - for (let i = 0; i < execArgv.length; i++) { - const arg = execArgv[i]; - if (arg === "--import" || arg === "--require" || arg === "-r") { - return true; - } - if (arg.startsWith("--import=") || arg.startsWith("--require=") || arg.startsWith("-r=")) { - return true; - } - } - return false; - } - function sanitizeNodeOptions(nodeOptions) { - const tokens = nodeOptions.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g); - if (!tokens) { - return nodeOptions; - } - const sanitized = []; - let changed = false; - for (let i = 0; i < tokens.length; i++) { - const token = tokens[i]; - if (token === "--require" || token === "-r" || token === "--import") { - const next = tokens[i + 1]; - if (next && shouldDropPreload(next)) { - changed = true; - i++; - continue; - } - sanitized.push(token); - if (next) { - sanitized.push(next); - i++; - } - continue; - } - if (token.startsWith("--require=") || token.startsWith("-r=") || token.startsWith("--import=")) { - const value = token.slice(token.indexOf("=") + 1); - if (shouldDropPreload(value)) { - changed = true; - continue; - } - } - sanitized.push(token); - } - return changed ? sanitized.join(" ") : nodeOptions; - } - function shouldDropPreload(value) { - const unquoted = stripQuotes(value); - if (!unquoted) { - return false; - } - let path2 = unquoted; - if (path2.startsWith("file://")) { - try { - path2 = fileURLToPath(path2); - } catch { - return false; - } - } - return isAbsolute(path2) && !existsSync2(path2); - } - function stripQuotes(value) { - const first = value[0]; - const last = value[value.length - 1]; - if (first === '"' && last === '"' || first === "'" && last === "'") { - return value.slice(1, -1); - } - return value; - } - function buildStream(filename, workerData, workerOpts, sync, name) { - if (!workerOpts.execArgv && hasPreloadFlags() && require.main === void 0) { - workerOpts = { - ...workerOpts, - execArgv: [] - }; - } - if (!workerOpts.env && process.env.NODE_OPTIONS) { - const nodeOptions = sanitizeNodeOptions(process.env.NODE_OPTIONS); - if (nodeOptions !== process.env.NODE_OPTIONS) { - workerOpts = { - ...workerOpts, - env: { - ...process.env, - NODE_OPTIONS: nodeOptions - } - }; - } - } - workerOpts = { ...workerOpts, name }; - const stream = new ThreadStream({ - filename, - workerData, - workerOpts, - sync - }); - stream.on("ready", onReady); - stream.on("close", function() { - process.removeListener("exit", onExit2); - }); - process.on("exit", onExit2); - function onReady() { - process.removeListener("exit", onExit2); - stream.unref(); - if (workerOpts.autoEnd !== false) { - setupOnExit(stream); - } - } - function onExit2() { - if (stream.closed) { - return; - } - stream.flushSync(); - sleep2(100); - stream.end(); - } - return stream; - } - function autoEnd(stream) { - stream.ref(); - stream.flushSync(); - stream.end(); - stream.once("close", function() { - stream.unref(); - }); - } - function flush(stream) { - stream.flushSync(); - } - function transport(fullOptions) { - const { pipeline, targets, levels, dedupe, worker = {}, caller = getCallers(), sync = false } = fullOptions; - const options = { - ...fullOptions.options - }; - const callers = typeof caller === "string" ? [caller] : caller; - const bundlerOverrides = typeof globalThis === "object" && Object.prototype.hasOwnProperty.call(globalThis, "__bundlerPathsOverrides") && globalThis.__bundlerPathsOverrides && typeof globalThis.__bundlerPathsOverrides === "object" ? globalThis.__bundlerPathsOverrides : /* @__PURE__ */ Object.create(null); - let target = fullOptions.target; - if (target && targets) { - throw new Error("only one of target or targets can be specified"); - } - if (targets) { - target = bundlerOverrides["pino-worker"] || join2(__dirname, "worker.js"); - options.targets = targets.filter((dest) => dest.target).map((dest) => { - return { - ...dest, - target: fixTarget(dest.target) - }; - }); - options.pipelines = targets.filter((dest) => dest.pipeline).map((dest) => { - return dest.pipeline.map((t) => { - return { - ...t, - level: dest.level, - // duplicate the pipeline `level` property defined in the upper level - target: fixTarget(t.target) - }; - }); - }); - } else if (pipeline) { - target = bundlerOverrides["pino-worker"] || join2(__dirname, "worker.js"); - options.pipelines = [pipeline.map((dest) => { - return { - ...dest, - target: fixTarget(dest.target) - }; - })]; - } - if (levels) { - options.levels = levels; - } - if (dedupe) { - options.dedupe = dedupe; - } - options.pinoWillSendConfig = true; - const name = targets || pipeline ? "pino.transport" : target; - return buildStream(fixTarget(target), options, worker, sync, name); - function fixTarget(origin) { - origin = bundlerOverrides[origin] || origin; - if (isAbsolute(origin) || origin.indexOf("file://") === 0) { - return origin; - } - if (origin === "pino/file") { - return join2(__dirname, "..", "file.js"); - } - let fixTarget2; - for (const filePath of callers) { - try { - const context = filePath === "node:repl" ? process.cwd() + sep : filePath; - fixTarget2 = createRequire(context).resolve(origin); - break; - } catch (err) { - continue; - } - } - if (!fixTarget2) { - throw new Error(`unable to determine transport target for "${origin}"`); - } - return fixTarget2; - } - } - module2.exports = transport; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/tools.js -var require_tools = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/tools.js"(exports2, module2) { - "use strict"; - var diagChan = require("node:diagnostics_channel"); - var format = require_quick_format_unescaped(); - var { mapHttpRequest, mapHttpResponse } = require_pino_std_serializers(); - var SonicBoom = require_sonic_boom(); - var onExit = require_on_exit_leak_free(); - var { - lsCacheSym, - chindingsSym, - writeSym, - serializersSym, - formatOptsSym, - endSym, - stringifiersSym, - stringifySym, - stringifySafeSym, - wildcardFirstSym, - nestedKeySym, - formattersSym, - messageKeySym, - errorKeySym, - nestedKeyStrSym, - msgPrefixSym - } = require_symbols3(); - var { isMainThread } = require("worker_threads"); - var transport = require_transport(); - var [nodeMajor] = process.versions.node.split(".").map((v) => Number(v)); - var asJsonChan = diagChan.tracingChannel("pino_asJson"); - var asString = nodeMajor >= 25 ? (str) => JSON.stringify(str) : _asString; - function noop() { - } - function genLog(level, hook) { - if (!hook) - return LOG; - return function hookWrappedLog(...args) { - hook.call(this, args, LOG, level); - }; - function LOG(o, ...n) { - if (typeof o === "object") { - let msg = o; - if (o !== null) { - if (o.method && o.headers && o.socket) { - o = mapHttpRequest(o); - } else if (typeof o.setHeader === "function") { - o = mapHttpResponse(o); - } - } - let formatParams; - if (msg === null && n.length === 0) { - formatParams = [null]; - } else { - msg = n.shift(); - formatParams = n; - } - if (typeof this[msgPrefixSym] === "string" && msg !== void 0 && msg !== null) { - msg = this[msgPrefixSym] + msg; - } - this[writeSym](o, format(msg, formatParams, this[formatOptsSym]), level); - } else { - let msg = o === void 0 ? n.shift() : o; - if (typeof this[msgPrefixSym] === "string" && msg !== void 0 && msg !== null) { - msg = this[msgPrefixSym] + msg; - } - this[writeSym](null, format(msg, n, this[formatOptsSym]), level); - } - } - } - function _asString(str) { - let result = ""; - let last = 0; - let found = false; - let point = 255; - const l = str.length; - if (l > 100) { - return JSON.stringify(str); - } - for (var i = 0; i < l && point >= 32; i++) { - point = str.charCodeAt(i); - if (point === 34 || point === 92) { - result += str.slice(last, i) + "\\"; - last = i; - found = true; - } - } - if (!found) { - result = str; - } else { - result += str.slice(last); - } - return point < 32 ? JSON.stringify(str) : '"' + result + '"'; - } - function asJson(obj, msg, num, time) { - if (asJsonChan.hasSubscribers === false) { - return _asJson.call(this, obj, msg, num, time); - } - const store = { instance: this, arguments }; - return asJsonChan.traceSync(_asJson, store, this, obj, msg, num, time); - } - function _asJson(obj, msg, num, time) { - const stringify3 = this[stringifySym]; - const stringifySafe = this[stringifySafeSym]; - const stringifiers = this[stringifiersSym]; - const end = this[endSym]; - const chindings = this[chindingsSym]; - const serializers = this[serializersSym]; - const formatters = this[formattersSym]; - const messageKey = this[messageKeySym]; - const errorKey = this[errorKeySym]; - let data = this[lsCacheSym][num] + time; - data = data + chindings; - let value; - if (formatters.log) { - obj = formatters.log(obj); - } - const wildcardStringifier = stringifiers[wildcardFirstSym]; - let propStr = ""; - for (const key in obj) { - value = obj[key]; - if (Object.prototype.hasOwnProperty.call(obj, key) && value !== void 0) { - if (serializers[key]) { - value = serializers[key](value); - } else if (key === errorKey && serializers.err) { - value = serializers.err(value); - } - const stringifier = stringifiers[key] || wildcardStringifier; - switch (typeof value) { - case "undefined": - case "function": - continue; - case "number": - if (Number.isFinite(value) === false) { - value = null; - } - case "boolean": - if (stringifier) - value = stringifier(value); - break; - case "string": - value = (stringifier || asString)(value); - break; - default: - value = (stringifier || stringify3)(value, stringifySafe); - } - if (value === void 0) - continue; - const strKey = asString(key); - propStr += "," + strKey + ":" + value; - } - } - let msgStr = ""; - if (msg !== void 0) { - value = serializers[messageKey] ? serializers[messageKey](msg) : msg; - const stringifier = stringifiers[messageKey] || wildcardStringifier; - switch (typeof value) { - case "function": - break; - case "number": - if (Number.isFinite(value) === false) { - value = null; - } - case "boolean": - if (stringifier) - value = stringifier(value); - msgStr = ',"' + messageKey + '":' + value; - break; - case "string": - value = (stringifier || asString)(value); - msgStr = ',"' + messageKey + '":' + value; - break; - default: - value = (stringifier || stringify3)(value, stringifySafe); - msgStr = ',"' + messageKey + '":' + value; - } - } - if (this[nestedKeySym] && propStr) { - return data + this[nestedKeyStrSym] + propStr.slice(1) + "}" + msgStr + end; - } else { - return data + propStr + msgStr + end; - } - } - function asChindings(instance2, bindings) { - let value; - let data = instance2[chindingsSym]; - const stringify3 = instance2[stringifySym]; - const stringifySafe = instance2[stringifySafeSym]; - const stringifiers = instance2[stringifiersSym]; - const wildcardStringifier = stringifiers[wildcardFirstSym]; - const serializers = instance2[serializersSym]; - const formatter = instance2[formattersSym].bindings; - bindings = formatter(bindings); - for (const key in bindings) { - value = bindings[key]; - const valid = (key.length < 5 || key !== "level" && key !== "serializers" && key !== "formatters" && key !== "customLevels") && bindings.hasOwnProperty(key) && value !== void 0; - if (valid === true) { - value = serializers[key] ? serializers[key](value) : value; - value = (stringifiers[key] || wildcardStringifier || stringify3)(value, stringifySafe); - if (value === void 0) - continue; - data += ',"' + key + '":' + value; - } - } - return data; - } - function hasBeenTampered(stream) { - return stream.write !== stream.constructor.prototype.write; - } - function buildSafeSonicBoom(opts) { - const stream = new SonicBoom(opts); - stream.on("error", filterBrokenPipe); - if (!opts.sync && isMainThread) { - onExit.register(stream, autoEnd); - stream.on("close", function() { - onExit.unregister(stream); - }); - } - return stream; - function filterBrokenPipe(err) { - if (err.code === "EPIPE") { - stream.write = noop; - stream.end = noop; - stream.flushSync = noop; - stream.destroy = noop; - return; - } - stream.removeListener("error", filterBrokenPipe); - stream.emit("error", err); - } - } - function autoEnd(stream, eventName) { - if (stream.destroyed) { - return; - } - if (eventName === "beforeExit") { - stream.flush(); - stream.on("drain", function() { - stream.end(); - }); - } else { - stream.flushSync(); - } - } - function createArgsNormalizer(defaultOptions) { - return function normalizeArgs(instance2, caller, opts = {}, stream) { - if (typeof opts === "string") { - stream = buildSafeSonicBoom({ dest: opts }); - opts = {}; - } else if (typeof stream === "string") { - if (opts && opts.transport) { - throw Error("only one of option.transport or stream can be specified"); - } - stream = buildSafeSonicBoom({ dest: stream }); - } else if (opts instanceof SonicBoom || opts.writable || opts._writableState) { - stream = opts; - opts = {}; - } else if (opts.transport) { - if (opts.transport instanceof SonicBoom || opts.transport.writable || opts.transport._writableState) { - throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)"); - } - if (opts.transport.targets && opts.transport.targets.length && opts.formatters && typeof opts.formatters.level === "function") { - throw Error("option.transport.targets do not allow custom level formatters"); - } - let customLevels; - if (opts.customLevels) { - customLevels = opts.useOnlyCustomLevels ? opts.customLevels : Object.assign({}, opts.levels, opts.customLevels); - } - stream = transport({ caller, ...opts.transport, levels: customLevels }); - } - opts = Object.assign({}, defaultOptions, opts); - opts.serializers = Object.assign({}, defaultOptions.serializers, opts.serializers); - opts.formatters = Object.assign({}, defaultOptions.formatters, opts.formatters); - if (opts.prettyPrint) { - throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)"); - } - const { enabled, onChild } = opts; - if (enabled === false) - opts.level = "silent"; - if (!onChild) - opts.onChild = noop; - if (!stream) { - if (!hasBeenTampered(process.stdout)) { - stream = buildSafeSonicBoom({ fd: process.stdout.fd || 1 }); - } else { - stream = process.stdout; - } - } - return { opts, stream }; - }; - } - function stringify2(obj, stringifySafeFn) { - try { - return JSON.stringify(obj); - } catch (_) { - try { - const stringify3 = stringifySafeFn || this[stringifySafeSym]; - return stringify3(obj); - } catch (_2) { - return '"[unable to serialize, circular reference is too complex to analyze]"'; - } - } - } - function buildFormatters(level, bindings, log) { - return { - level, - bindings, - log - }; - } - function normalizeDestFileDescriptor(destination) { - const fd = Number(destination); - if (typeof destination === "string" && Number.isFinite(fd)) { - return fd; - } - if (destination === void 0) { - return 1; - } - return destination; - } - module2.exports = { - noop, - buildSafeSonicBoom, - asChindings, - asJson, - genLog, - createArgsNormalizer, - stringify: stringify2, - buildFormatters, - normalizeDestFileDescriptor - }; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/constants.js -var require_constants = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/constants.js"(exports2, module2) { - var DEFAULT_LEVELS = { - trace: 10, - debug: 20, - info: 30, - warn: 40, - error: 50, - fatal: 60 - }; - var SORTING_ORDER = { - ASC: "ASC", - DESC: "DESC" - }; - module2.exports = { - DEFAULT_LEVELS, - SORTING_ORDER - }; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/levels.js -var require_levels = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/levels.js"(exports2, module2) { - "use strict"; - var { - lsCacheSym, - levelValSym, - useOnlyCustomLevelsSym, - streamSym, - formattersSym, - hooksSym, - levelCompSym - } = require_symbols3(); - var { noop, genLog } = require_tools(); - var { DEFAULT_LEVELS, SORTING_ORDER } = require_constants(); - var levelMethods = { - fatal: (hook) => { - const logFatal = genLog(DEFAULT_LEVELS.fatal, hook); - return function(...args) { - const stream = this[streamSym]; - logFatal.call(this, ...args); - if (typeof stream.flushSync === "function") { - try { - stream.flushSync(); - } catch (e) { - } - } - }; - }, - error: (hook) => genLog(DEFAULT_LEVELS.error, hook), - warn: (hook) => genLog(DEFAULT_LEVELS.warn, hook), - info: (hook) => genLog(DEFAULT_LEVELS.info, hook), - debug: (hook) => genLog(DEFAULT_LEVELS.debug, hook), - trace: (hook) => genLog(DEFAULT_LEVELS.trace, hook) - }; - var nums = Object.keys(DEFAULT_LEVELS).reduce((o, k) => { - o[DEFAULT_LEVELS[k]] = k; - return o; - }, {}); - var initialLsCache = Object.keys(nums).reduce((o, k) => { - o[k] = '{"level":' + Number(k); - return o; - }, {}); - function genLsCache(instance2) { - const formatter = instance2[formattersSym].level; - const { labels } = instance2.levels; - const cache = {}; - for (const label in labels) { - const level = formatter(labels[label], Number(label)); - cache[label] = JSON.stringify(level).slice(0, -1); - } - instance2[lsCacheSym] = cache; - return instance2; - } - function isStandardLevel(level, useOnlyCustomLevels) { - if (useOnlyCustomLevels) { - return false; - } - switch (level) { - case "fatal": - case "error": - case "warn": - case "info": - case "debug": - case "trace": - return true; - default: - return false; - } - } - function setLevel(level) { - const { labels, values } = this.levels; - if (typeof level === "number") { - if (labels[level] === void 0) - throw Error("unknown level value" + level); - level = labels[level]; - } - if (values[level] === void 0) - throw Error("unknown level " + level); - const preLevelVal = this[levelValSym]; - const levelVal = this[levelValSym] = values[level]; - const useOnlyCustomLevelsVal = this[useOnlyCustomLevelsSym]; - const levelComparison = this[levelCompSym]; - const hook = this[hooksSym].logMethod; - for (const key in values) { - if (levelComparison(values[key], levelVal) === false) { - this[key] = noop; - continue; - } - this[key] = isStandardLevel(key, useOnlyCustomLevelsVal) ? levelMethods[key](hook) : genLog(values[key], hook); - } - this.emit( - "level-change", - level, - levelVal, - labels[preLevelVal], - preLevelVal, - this - ); - } - function getLevel(level) { - const { levels, levelVal } = this; - return levels && levels.labels ? levels.labels[levelVal] : ""; - } - function isLevelEnabled(logLevel) { - const { values } = this.levels; - const logLevelVal = values[logLevel]; - return logLevelVal !== void 0 && this[levelCompSym](logLevelVal, this[levelValSym]); - } - function compareLevel(direction, current, expected) { - if (direction === SORTING_ORDER.DESC) { - return current <= expected; - } - return current >= expected; - } - function genLevelComparison(levelComparison) { - if (typeof levelComparison === "string") { - return compareLevel.bind(null, levelComparison); - } - return levelComparison; - } - function mappings(customLevels = null, useOnlyCustomLevels = false) { - const customNums = customLevels ? Object.keys(customLevels).reduce((o, k) => { - o[customLevels[k]] = k; - return o; - }, {}) : null; - const labels = Object.assign( - Object.create(Object.prototype, { Infinity: { value: "silent" } }), - useOnlyCustomLevels ? null : nums, - customNums - ); - const values = Object.assign( - Object.create(Object.prototype, { silent: { value: Infinity } }), - useOnlyCustomLevels ? null : DEFAULT_LEVELS, - customLevels - ); - return { labels, values }; - } - function assertDefaultLevelFound(defaultLevel, customLevels, useOnlyCustomLevels) { - if (typeof defaultLevel === "number") { - const values = [].concat( - Object.keys(customLevels || {}).map((key) => customLevels[key]), - useOnlyCustomLevels ? [] : Object.keys(nums).map((level) => +level), - Infinity - ); - if (!values.includes(defaultLevel)) { - throw Error(`default level:${defaultLevel} must be included in custom levels`); - } - return; - } - const labels = Object.assign( - Object.create(Object.prototype, { silent: { value: Infinity } }), - useOnlyCustomLevels ? null : DEFAULT_LEVELS, - customLevels - ); - if (!(defaultLevel in labels)) { - throw Error(`default level:${defaultLevel} must be included in custom levels`); - } - } - function assertNoLevelCollisions(levels, customLevels) { - const { labels, values } = levels; - for (const k in customLevels) { - if (k in values) { - throw Error("levels cannot be overridden"); - } - if (customLevels[k] in labels) { - throw Error("pre-existing level values cannot be used for new levels"); - } - } - } - function assertLevelComparison(levelComparison) { - if (typeof levelComparison === "function") { - return; - } - if (typeof levelComparison === "string" && Object.values(SORTING_ORDER).includes(levelComparison)) { - return; - } - throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type'); - } - module2.exports = { - initialLsCache, - genLsCache, - levelMethods, - getLevel, - setLevel, - isLevelEnabled, - mappings, - assertNoLevelCollisions, - assertDefaultLevelFound, - genLevelComparison, - assertLevelComparison - }; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/meta.js -var require_meta = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/meta.js"(exports2, module2) { - "use strict"; - module2.exports = { version: "10.3.1" }; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/proto.js -var require_proto = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/proto.js"(exports2, module2) { - "use strict"; - var { EventEmitter: EventEmitter2 } = require("node:events"); - var { - lsCacheSym, - levelValSym, - setLevelSym, - getLevelSym, - chindingsSym, - mixinSym, - asJsonSym, - writeSym, - mixinMergeStrategySym, - timeSym, - timeSliceIndexSym, - streamSym, - serializersSym, - formattersSym, - errorKeySym, - messageKeySym, - useOnlyCustomLevelsSym, - needsMetadataGsym, - redactFmtSym, - stringifySym, - formatOptsSym, - stringifiersSym, - msgPrefixSym, - hooksSym - } = require_symbols3(); - var { - getLevel, - setLevel, - isLevelEnabled, - mappings, - initialLsCache, - genLsCache, - assertNoLevelCollisions - } = require_levels(); - var { - asChindings, - asJson, - buildFormatters, - stringify: stringify2, - noop - } = require_tools(); - var { - version: version2 - } = require_meta(); - var redaction = require_redaction(); - var constructor = class Pino { - }; - var prototype = { - constructor, - child, - bindings, - setBindings, - flush, - isLevelEnabled, - version: version2, - get level() { - return this[getLevelSym](); - }, - set level(lvl) { - this[setLevelSym](lvl); - }, - get levelVal() { - return this[levelValSym]; - }, - set levelVal(n) { - throw Error("levelVal is read-only"); - }, - get msgPrefix() { - return this[msgPrefixSym]; - }, - get [Symbol.toStringTag]() { - return "Pino"; - }, - [lsCacheSym]: initialLsCache, - [writeSym]: write, - [asJsonSym]: asJson, - [getLevelSym]: getLevel, - [setLevelSym]: setLevel - }; - Object.setPrototypeOf(prototype, EventEmitter2.prototype); - module2.exports = function() { - return Object.create(prototype); - }; - var resetChildingsFormatter = (bindings2) => bindings2; - function child(bindings2, options) { - if (!bindings2) { - throw Error("missing bindings for child Pino"); - } - const serializers = this[serializersSym]; - const formatters = this[formattersSym]; - const instance2 = Object.create(this); - if (options == null) { - if (instance2[formattersSym].bindings !== resetChildingsFormatter) { - instance2[formattersSym] = buildFormatters( - formatters.level, - resetChildingsFormatter, - formatters.log - ); - } - instance2[chindingsSym] = asChindings(instance2, bindings2); - if (this.onChild !== noop) { - this.onChild(instance2); - } - return instance2; - } - if (options.hasOwnProperty("serializers") === true) { - instance2[serializersSym] = /* @__PURE__ */ Object.create(null); - for (const k in serializers) { - instance2[serializersSym][k] = serializers[k]; - } - const parentSymbols = Object.getOwnPropertySymbols(serializers); - for (var i = 0; i < parentSymbols.length; i++) { - const ks = parentSymbols[i]; - instance2[serializersSym][ks] = serializers[ks]; - } - for (const bk in options.serializers) { - instance2[serializersSym][bk] = options.serializers[bk]; - } - const bindingsSymbols = Object.getOwnPropertySymbols(options.serializers); - for (var bi = 0; bi < bindingsSymbols.length; bi++) { - const bks = bindingsSymbols[bi]; - instance2[serializersSym][bks] = options.serializers[bks]; - } - } else - instance2[serializersSym] = serializers; - if (options.hasOwnProperty("formatters")) { - const { level, bindings: chindings, log } = options.formatters; - instance2[formattersSym] = buildFormatters( - level || formatters.level, - chindings || resetChildingsFormatter, - log || formatters.log - ); - } else { - instance2[formattersSym] = buildFormatters( - formatters.level, - resetChildingsFormatter, - formatters.log - ); - } - if (options.hasOwnProperty("customLevels") === true) { - assertNoLevelCollisions(this.levels, options.customLevels); - instance2.levels = mappings(options.customLevels, instance2[useOnlyCustomLevelsSym]); - genLsCache(instance2); - } - if (typeof options.redact === "object" && options.redact !== null || Array.isArray(options.redact)) { - instance2.redact = options.redact; - const stringifiers = redaction(instance2.redact, stringify2); - const formatOpts = { stringify: stringifiers[redactFmtSym] }; - instance2[stringifySym] = stringify2; - instance2[stringifiersSym] = stringifiers; - instance2[formatOptsSym] = formatOpts; - } - if (typeof options.msgPrefix === "string") { - instance2[msgPrefixSym] = (this[msgPrefixSym] || "") + options.msgPrefix; - } - instance2[chindingsSym] = asChindings(instance2, bindings2); - if (options.level !== void 0 && options.level !== this.level || options.hasOwnProperty("customLevels")) { - const childLevel = options.level || this.level; - instance2[setLevelSym](childLevel); - } - this.onChild(instance2); - return instance2; - } - function bindings() { - const chindings = this[chindingsSym]; - const chindingsJson = `{${chindings.substr(1)}}`; - const bindingsFromJson = JSON.parse(chindingsJson); - delete bindingsFromJson.pid; - delete bindingsFromJson.hostname; - return bindingsFromJson; - } - function setBindings(newBindings) { - const chindings = asChindings(this, newBindings); - this[chindingsSym] = chindings; - } - function defaultMixinMergeStrategy(mergeObject, mixinObject) { - return Object.assign(mixinObject, mergeObject); - } - function write(_obj, msg, num) { - const t = this[timeSym](); - const mixin = this[mixinSym]; - const errorKey = this[errorKeySym]; - const messageKey = this[messageKeySym]; - const mixinMergeStrategy = this[mixinMergeStrategySym] || defaultMixinMergeStrategy; - let obj; - const streamWriteHook = this[hooksSym].streamWrite; - if (_obj === void 0 || _obj === null) { - obj = {}; - } else if (_obj instanceof Error) { - obj = { [errorKey]: _obj }; - if (msg === void 0) { - msg = _obj.message; - } - } else { - obj = _obj; - if (msg === void 0 && _obj[messageKey] === void 0 && _obj[errorKey]) { - msg = _obj[errorKey].message; - } - } - if (mixin) { - obj = mixinMergeStrategy(obj, mixin(obj, num, this)); - } - const s = this[asJsonSym](obj, msg, num, t); - const stream = this[streamSym]; - if (stream[needsMetadataGsym] === true) { - stream.lastLevel = num; - stream.lastObj = obj; - stream.lastMsg = msg; - stream.lastTime = t.slice(this[timeSliceIndexSym]); - stream.lastLogger = this; - } - stream.write(streamWriteHook ? streamWriteHook(s) : s); - } - function flush(cb) { - if (cb != null && typeof cb !== "function") { - throw Error("callback must be a function"); - } - const stream = this[streamSym]; - if (typeof stream.flush === "function") { - stream.flush(cb || noop); - } else if (cb) - cb(); - } - } -}); - -// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js -var require_safe_stable_stringify = __commonJS({ - "../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports2, module2) { - "use strict"; - var { hasOwnProperty } = Object.prototype; - var stringify2 = configure(); - stringify2.configure = configure; - stringify2.stringify = stringify2; - stringify2.default = stringify2; - exports2.stringify = stringify2; - exports2.configure = configure; - module2.exports = stringify2; - var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/; - function strEscape(str) { - if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) { - return `"${str}"`; - } - return JSON.stringify(str); - } - function sort(array2, comparator) { - if (array2.length > 200 || comparator) { - return array2.sort(comparator); - } - for (let i = 1; i < array2.length; i++) { - const currentValue = array2[i]; - let position = i; - while (position !== 0 && array2[position - 1] > currentValue) { - array2[position] = array2[position - 1]; - position--; - } - array2[position] = currentValue; - } - return array2; - } - var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor( - Object.getPrototypeOf( - Object.getPrototypeOf( - new Int8Array() - ) - ), - Symbol.toStringTag - ).get; - function isTypedArrayWithEntries(value) { - return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0; - } - function stringifyTypedArray(array2, separator, maximumBreadth) { - if (array2.length < maximumBreadth) { - maximumBreadth = array2.length; - } - const whitespace = separator === "," ? "" : " "; - let res = `"0":${whitespace}${array2[0]}`; - for (let i = 1; i < maximumBreadth; i++) { - res += `${separator}"${i}":${whitespace}${array2[i]}`; - } - return res; - } - function getCircularValueOption(options) { - if (hasOwnProperty.call(options, "circularValue")) { - const circularValue = options.circularValue; - if (typeof circularValue === "string") { - return `"${circularValue}"`; - } - if (circularValue == null) { - return circularValue; - } - if (circularValue === Error || circularValue === TypeError) { - return { - toString() { - throw new TypeError("Converting circular structure to JSON"); - } - }; - } - throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined'); - } - return '"[Circular]"'; - } - function getDeterministicOption(options) { - let value; - if (hasOwnProperty.call(options, "deterministic")) { - value = options.deterministic; - if (typeof value !== "boolean" && typeof value !== "function") { - throw new TypeError('The "deterministic" argument must be of type boolean or comparator function'); - } - } - return value === void 0 ? true : value; - } - function getBooleanOption(options, key) { - let value; - if (hasOwnProperty.call(options, key)) { - value = options[key]; - if (typeof value !== "boolean") { - throw new TypeError(`The "${key}" argument must be of type boolean`); - } - } - return value === void 0 ? true : value; - } - function getPositiveIntegerOption(options, key) { - let value; - if (hasOwnProperty.call(options, key)) { - value = options[key]; - if (typeof value !== "number") { - throw new TypeError(`The "${key}" argument must be of type number`); - } - if (!Number.isInteger(value)) { - throw new TypeError(`The "${key}" argument must be an integer`); - } - if (value < 1) { - throw new RangeError(`The "${key}" argument must be >= 1`); - } - } - return value === void 0 ? Infinity : value; - } - function getItemCount(number2) { - if (number2 === 1) { - return "1 item"; - } - return `${number2} items`; - } - function getUniqueReplacerSet(replacerArray) { - const replacerSet = /* @__PURE__ */ new Set(); - for (const value of replacerArray) { - if (typeof value === "string" || typeof value === "number") { - replacerSet.add(String(value)); - } - } - return replacerSet; - } - function getStrictOption(options) { - if (hasOwnProperty.call(options, "strict")) { - const value = options.strict; - if (typeof value !== "boolean") { - throw new TypeError('The "strict" argument must be of type boolean'); - } - if (value) { - return (value2) => { - let message = `Object can not safely be stringified. Received type ${typeof value2}`; - if (typeof value2 !== "function") - message += ` (${value2.toString()})`; - throw new Error(message); - }; - } - } - } - function configure(options) { - options = { ...options }; - const fail = getStrictOption(options); - if (fail) { - if (options.bigint === void 0) { - options.bigint = false; - } - if (!("circularValue" in options)) { - options.circularValue = Error; - } - } - const circularValue = getCircularValueOption(options); - const bigint = getBooleanOption(options, "bigint"); - const deterministic = getDeterministicOption(options); - const comparator = typeof deterministic === "function" ? deterministic : void 0; - const maximumDepth = getPositiveIntegerOption(options, "maximumDepth"); - const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth"); - function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) { - let value = parent[key]; - if (typeof value === "object" && value !== null && typeof value.toJSON === "function") { - value = value.toJSON(key); - } - value = replacer.call(parent, key, value); - switch (typeof value) { - case "string": - return strEscape(value); - case "object": { - if (value === null) { - return "null"; - } - if (stack.indexOf(value) !== -1) { - return circularValue; - } - let res = ""; - let join2 = ","; - const originalIndentation = indentation; - if (Array.isArray(value)) { - if (value.length === 0) { - return "[]"; - } - if (maximumDepth < stack.length + 1) { - return '"[Array]"'; - } - stack.push(value); - if (spacer !== "") { - indentation += spacer; - res += ` -${indentation}`; - join2 = `, -${indentation}`; - } - const maximumValuesToStringify = Math.min(value.length, maximumBreadth); - let i = 0; - for (; i < maximumValuesToStringify - 1; i++) { - const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation); - res += tmp2 !== void 0 ? tmp2 : "null"; - res += join2; - } - const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation); - res += tmp !== void 0 ? tmp : "null"; - if (value.length - 1 > maximumBreadth) { - const removedKeys = value.length - maximumBreadth - 1; - res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`; - } - if (spacer !== "") { - res += ` -${originalIndentation}`; - } - stack.pop(); - return `[${res}]`; - } - let keys = Object.keys(value); - const keyLength = keys.length; - if (keyLength === 0) { - return "{}"; - } - if (maximumDepth < stack.length + 1) { - return '"[Object]"'; - } - let whitespace = ""; - let separator = ""; - if (spacer !== "") { - indentation += spacer; - join2 = `, -${indentation}`; - whitespace = " "; - } - const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); - if (deterministic && !isTypedArrayWithEntries(value)) { - keys = sort(keys, comparator); - } - stack.push(value); - for (let i = 0; i < maximumPropertiesToStringify; i++) { - const key2 = keys[i]; - const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation); - if (tmp !== void 0) { - res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`; - separator = join2; - } - } - if (keyLength > maximumBreadth) { - const removedKeys = keyLength - maximumBreadth; - res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`; - separator = join2; - } - if (spacer !== "" && separator.length > 1) { - res = ` -${indentation}${res} -${originalIndentation}`; - } - stack.pop(); - return `{${res}}`; - } - case "number": - return isFinite(value) ? String(value) : fail ? fail(value) : "null"; - case "boolean": - return value === true ? "true" : "false"; - case "undefined": - return void 0; - case "bigint": - if (bigint) { - return String(value); - } - default: - return fail ? fail(value) : void 0; - } - } - function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) { - if (typeof value === "object" && value !== null && typeof value.toJSON === "function") { - value = value.toJSON(key); - } - switch (typeof value) { - case "string": - return strEscape(value); - case "object": { - if (value === null) { - return "null"; - } - if (stack.indexOf(value) !== -1) { - return circularValue; - } - const originalIndentation = indentation; - let res = ""; - let join2 = ","; - if (Array.isArray(value)) { - if (value.length === 0) { - return "[]"; - } - if (maximumDepth < stack.length + 1) { - return '"[Array]"'; - } - stack.push(value); - if (spacer !== "") { - indentation += spacer; - res += ` -${indentation}`; - join2 = `, -${indentation}`; - } - const maximumValuesToStringify = Math.min(value.length, maximumBreadth); - let i = 0; - for (; i < maximumValuesToStringify - 1; i++) { - const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation); - res += tmp2 !== void 0 ? tmp2 : "null"; - res += join2; - } - const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation); - res += tmp !== void 0 ? tmp : "null"; - if (value.length - 1 > maximumBreadth) { - const removedKeys = value.length - maximumBreadth - 1; - res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`; - } - if (spacer !== "") { - res += ` -${originalIndentation}`; - } - stack.pop(); - return `[${res}]`; - } - stack.push(value); - let whitespace = ""; - if (spacer !== "") { - indentation += spacer; - join2 = `, -${indentation}`; - whitespace = " "; - } - let separator = ""; - for (const key2 of replacer) { - const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation); - if (tmp !== void 0) { - res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`; - separator = join2; - } - } - if (spacer !== "" && separator.length > 1) { - res = ` -${indentation}${res} -${originalIndentation}`; - } - stack.pop(); - return `{${res}}`; - } - case "number": - return isFinite(value) ? String(value) : fail ? fail(value) : "null"; - case "boolean": - return value === true ? "true" : "false"; - case "undefined": - return void 0; - case "bigint": - if (bigint) { - return String(value); - } - default: - return fail ? fail(value) : void 0; - } - } - function stringifyIndent(key, value, stack, spacer, indentation) { - switch (typeof value) { - case "string": - return strEscape(value); - case "object": { - if (value === null) { - return "null"; - } - if (typeof value.toJSON === "function") { - value = value.toJSON(key); - if (typeof value !== "object") { - return stringifyIndent(key, value, stack, spacer, indentation); - } - if (value === null) { - return "null"; - } - } - if (stack.indexOf(value) !== -1) { - return circularValue; - } - const originalIndentation = indentation; - if (Array.isArray(value)) { - if (value.length === 0) { - return "[]"; - } - if (maximumDepth < stack.length + 1) { - return '"[Array]"'; - } - stack.push(value); - indentation += spacer; - let res2 = ` -${indentation}`; - const join3 = `, -${indentation}`; - const maximumValuesToStringify = Math.min(value.length, maximumBreadth); - let i = 0; - for (; i < maximumValuesToStringify - 1; i++) { - const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation); - res2 += tmp2 !== void 0 ? tmp2 : "null"; - res2 += join3; - } - const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation); - res2 += tmp !== void 0 ? tmp : "null"; - if (value.length - 1 > maximumBreadth) { - const removedKeys = value.length - maximumBreadth - 1; - res2 += `${join3}"... ${getItemCount(removedKeys)} not stringified"`; - } - res2 += ` -${originalIndentation}`; - stack.pop(); - return `[${res2}]`; - } - let keys = Object.keys(value); - const keyLength = keys.length; - if (keyLength === 0) { - return "{}"; - } - if (maximumDepth < stack.length + 1) { - return '"[Object]"'; - } - indentation += spacer; - const join2 = `, -${indentation}`; - let res = ""; - let separator = ""; - let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); - if (isTypedArrayWithEntries(value)) { - res += stringifyTypedArray(value, join2, maximumBreadth); - keys = keys.slice(value.length); - maximumPropertiesToStringify -= value.length; - separator = join2; - } - if (deterministic) { - keys = sort(keys, comparator); - } - stack.push(value); - for (let i = 0; i < maximumPropertiesToStringify; i++) { - const key2 = keys[i]; - const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation); - if (tmp !== void 0) { - res += `${separator}${strEscape(key2)}: ${tmp}`; - separator = join2; - } - } - if (keyLength > maximumBreadth) { - const removedKeys = keyLength - maximumBreadth; - res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`; - separator = join2; - } - if (separator !== "") { - res = ` -${indentation}${res} -${originalIndentation}`; - } - stack.pop(); - return `{${res}}`; - } - case "number": - return isFinite(value) ? String(value) : fail ? fail(value) : "null"; - case "boolean": - return value === true ? "true" : "false"; - case "undefined": - return void 0; - case "bigint": - if (bigint) { - return String(value); - } - default: - return fail ? fail(value) : void 0; - } - } - function stringifySimple(key, value, stack) { - switch (typeof value) { - case "string": - return strEscape(value); - case "object": { - if (value === null) { - return "null"; - } - if (typeof value.toJSON === "function") { - value = value.toJSON(key); - if (typeof value !== "object") { - return stringifySimple(key, value, stack); - } - if (value === null) { - return "null"; - } - } - if (stack.indexOf(value) !== -1) { - return circularValue; - } - let res = ""; - const hasLength = value.length !== void 0; - if (hasLength && Array.isArray(value)) { - if (value.length === 0) { - return "[]"; - } - if (maximumDepth < stack.length + 1) { - return '"[Array]"'; - } - stack.push(value); - const maximumValuesToStringify = Math.min(value.length, maximumBreadth); - let i = 0; - for (; i < maximumValuesToStringify - 1; i++) { - const tmp2 = stringifySimple(String(i), value[i], stack); - res += tmp2 !== void 0 ? tmp2 : "null"; - res += ","; - } - const tmp = stringifySimple(String(i), value[i], stack); - res += tmp !== void 0 ? tmp : "null"; - if (value.length - 1 > maximumBreadth) { - const removedKeys = value.length - maximumBreadth - 1; - res += `,"... ${getItemCount(removedKeys)} not stringified"`; - } - stack.pop(); - return `[${res}]`; - } - let keys = Object.keys(value); - const keyLength = keys.length; - if (keyLength === 0) { - return "{}"; - } - if (maximumDepth < stack.length + 1) { - return '"[Object]"'; - } - let separator = ""; - let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); - if (hasLength && isTypedArrayWithEntries(value)) { - res += stringifyTypedArray(value, ",", maximumBreadth); - keys = keys.slice(value.length); - maximumPropertiesToStringify -= value.length; - separator = ","; - } - if (deterministic) { - keys = sort(keys, comparator); - } - stack.push(value); - for (let i = 0; i < maximumPropertiesToStringify; i++) { - const key2 = keys[i]; - const tmp = stringifySimple(key2, value[key2], stack); - if (tmp !== void 0) { - res += `${separator}${strEscape(key2)}:${tmp}`; - separator = ","; - } - } - if (keyLength > maximumBreadth) { - const removedKeys = keyLength - maximumBreadth; - res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`; - } - stack.pop(); - return `{${res}}`; - } - case "number": - return isFinite(value) ? String(value) : fail ? fail(value) : "null"; - case "boolean": - return value === true ? "true" : "false"; - case "undefined": - return void 0; - case "bigint": - if (bigint) { - return String(value); - } - default: - return fail ? fail(value) : void 0; - } - } - function stringify3(value, replacer, space) { - if (arguments.length > 1) { - let spacer = ""; - if (typeof space === "number") { - spacer = " ".repeat(Math.min(space, 10)); - } else if (typeof space === "string") { - spacer = space.slice(0, 10); - } - if (replacer != null) { - if (typeof replacer === "function") { - return stringifyFnReplacer("", { "": value }, [], replacer, spacer, ""); - } - if (Array.isArray(replacer)) { - return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, ""); - } - } - if (spacer.length !== 0) { - return stringifyIndent("", value, [], spacer, ""); - } - } - return stringifySimple("", value, []); - } - return stringify3; - } - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/multistream.js -var require_multistream = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/lib/multistream.js"(exports2, module2) { - "use strict"; - var metadata = Symbol.for("pino.metadata"); - var { DEFAULT_LEVELS } = require_constants(); - var DEFAULT_INFO_LEVEL = DEFAULT_LEVELS.info; - function multistream(streamsArray, opts) { - streamsArray = streamsArray || []; - opts = opts || { dedupe: false }; - const streamLevels = Object.create(DEFAULT_LEVELS); - streamLevels.silent = Infinity; - if (opts.levels && typeof opts.levels === "object") { - Object.keys(opts.levels).forEach((i) => { - streamLevels[i] = opts.levels[i]; - }); - } - const res = { - write, - add: add2, - remove, - emit, - flushSync, - end, - minLevel: 0, - lastId: 0, - streams: [], - clone: clone2, - [metadata]: true, - streamLevels - }; - if (Array.isArray(streamsArray)) { - streamsArray.forEach(add2, res); - } else { - add2.call(res, streamsArray); - } - streamsArray = null; - return res; - function write(data) { - let dest; - const level = this.lastLevel; - const { streams } = this; - let recordedLevel = 0; - let stream; - for (let i = initLoopVar(streams.length, opts.dedupe); checkLoopVar(i, streams.length, opts.dedupe); i = adjustLoopVar(i, opts.dedupe)) { - dest = streams[i]; - if (dest.level <= level) { - if (recordedLevel !== 0 && recordedLevel !== dest.level) { - break; - } - stream = dest.stream; - if (stream[metadata]) { - const { lastTime, lastMsg, lastObj, lastLogger } = this; - stream.lastLevel = level; - stream.lastTime = lastTime; - stream.lastMsg = lastMsg; - stream.lastObj = lastObj; - stream.lastLogger = lastLogger; - } - stream.write(data); - if (opts.dedupe) { - recordedLevel = dest.level; - } - } else if (!opts.dedupe) { - break; - } - } - } - function emit(...args) { - for (const { stream } of this.streams) { - if (typeof stream.emit === "function") { - stream.emit(...args); - } - } - } - function flushSync() { - for (const { stream } of this.streams) { - if (typeof stream.flushSync === "function") { - stream.flushSync(); - } - } - } - function add2(dest) { - if (!dest) { - return res; - } - const isStream = typeof dest.write === "function" || dest.stream; - const stream_ = dest.write ? dest : dest.stream; - if (!isStream) { - throw Error("stream object needs to implement either StreamEntry or DestinationStream interface"); - } - const { streams, streamLevels: streamLevels2 } = this; - let level; - if (typeof dest.levelVal === "number") { - level = dest.levelVal; - } else if (typeof dest.level === "string") { - level = streamLevels2[dest.level]; - } else if (typeof dest.level === "number") { - level = dest.level; - } else { - level = DEFAULT_INFO_LEVEL; - } - const dest_ = { - stream: stream_, - level, - levelVal: void 0, - id: ++res.lastId - }; - streams.unshift(dest_); - streams.sort(compareByLevel); - this.minLevel = streams[0].level; - return res; - } - function remove(id) { - const { streams } = this; - const index = streams.findIndex((s) => s.id === id); - if (index >= 0) { - streams.splice(index, 1); - streams.sort(compareByLevel); - this.minLevel = streams.length > 0 ? streams[0].level : -1; - } - return res; - } - function end() { - for (const { stream } of this.streams) { - if (typeof stream.flushSync === "function") { - stream.flushSync(); - } - stream.end(); - } - } - function clone2(level) { - const streams = new Array(this.streams.length); - for (let i = 0; i < streams.length; i++) { - streams[i] = { - level, - stream: this.streams[i].stream - }; - } - return { - write, - add: add2, - remove, - minLevel: level, - streams, - clone: clone2, - emit, - flushSync, - [metadata]: true - }; - } - } - function compareByLevel(a, b) { - return a.level - b.level; - } - function initLoopVar(length, dedupe) { - return dedupe ? length - 1 : 0; - } - function adjustLoopVar(i, dedupe) { - return dedupe ? i - 1 : i + 1; - } - function checkLoopVar(i, length, dedupe) { - return dedupe ? i >= 0 : i < length; - } - module2.exports = multistream; - } -}); - -// ../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/pino.js -var require_pino = __commonJS({ - "../../node_modules/.pnpm/pino@10.3.1/node_modules/pino/pino.js"(exports2, module2) { - "use strict"; - var os2 = require("node:os"); - var stdSerializers = require_pino_std_serializers(); - var caller = require_caller(); - var redaction = require_redaction(); - var time = require_time(); - var proto = require_proto(); - var symbols = require_symbols3(); - var { configure } = require_safe_stable_stringify(); - var { assertDefaultLevelFound, mappings, genLsCache, genLevelComparison, assertLevelComparison } = require_levels(); - var { DEFAULT_LEVELS, SORTING_ORDER } = require_constants(); - var { - createArgsNormalizer, - asChindings, - buildSafeSonicBoom, - buildFormatters, - stringify: stringify2, - normalizeDestFileDescriptor, - noop - } = require_tools(); - var { version: version2 } = require_meta(); - var { - chindingsSym, - redactFmtSym, - serializersSym, - timeSym, - timeSliceIndexSym, - streamSym, - stringifySym, - stringifySafeSym, - stringifiersSym, - setLevelSym, - endSym, - formatOptsSym, - messageKeySym, - errorKeySym, - nestedKeySym, - mixinSym, - levelCompSym, - useOnlyCustomLevelsSym, - formattersSym, - hooksSym, - nestedKeyStrSym, - mixinMergeStrategySym, - msgPrefixSym - } = symbols; - var { epochTime, nullTime } = time; - var { pid } = process; - var hostname = os2.hostname(); - var defaultErrorSerializer = stdSerializers.err; - var defaultOptions = { - level: "info", - levelComparison: SORTING_ORDER.ASC, - levels: DEFAULT_LEVELS, - messageKey: "msg", - errorKey: "err", - nestedKey: null, - enabled: true, - base: { pid, hostname }, - serializers: Object.assign(/* @__PURE__ */ Object.create(null), { - err: defaultErrorSerializer - }), - formatters: Object.assign(/* @__PURE__ */ Object.create(null), { - bindings(bindings) { - return bindings; - }, - level(label, number2) { - return { level: number2 }; - } - }), - hooks: { - logMethod: void 0, - streamWrite: void 0 - }, - timestamp: epochTime, - name: void 0, - redact: null, - customLevels: null, - useOnlyCustomLevels: false, - depthLimit: 5, - edgeLimit: 100 - }; - var normalize = createArgsNormalizer(defaultOptions); - var serializers = Object.assign(/* @__PURE__ */ Object.create(null), stdSerializers); - function pino(...args) { - const instance2 = {}; - const { opts, stream } = normalize(instance2, caller(), ...args); - if (opts.level && typeof opts.level === "string" && DEFAULT_LEVELS[opts.level.toLowerCase()] !== void 0) - opts.level = opts.level.toLowerCase(); - const { - redact, - crlf, - serializers: serializers2, - timestamp, - messageKey, - errorKey, - nestedKey, - base, - name, - level, - customLevels, - levelComparison, - mixin, - mixinMergeStrategy, - useOnlyCustomLevels, - formatters, - hooks, - depthLimit, - edgeLimit, - onChild, - msgPrefix - } = opts; - const stringifySafe = configure({ - maximumDepth: depthLimit, - maximumBreadth: edgeLimit - }); - const allFormatters = buildFormatters( - formatters.level, - formatters.bindings, - formatters.log - ); - const stringifyFn = stringify2.bind({ - [stringifySafeSym]: stringifySafe - }); - const stringifiers = redact ? redaction(redact, stringifyFn) : {}; - const formatOpts = redact ? { stringify: stringifiers[redactFmtSym] } : { stringify: stringifyFn }; - const end = "}" + (crlf ? "\r\n" : "\n"); - const coreChindings = asChindings.bind(null, { - [chindingsSym]: "", - [serializersSym]: serializers2, - [stringifiersSym]: stringifiers, - [stringifySym]: stringify2, - [stringifySafeSym]: stringifySafe, - [formattersSym]: allFormatters - }); - let chindings = ""; - if (base !== null) { - if (name === void 0) { - chindings = coreChindings(base); - } else { - chindings = coreChindings(Object.assign({}, base, { name })); - } - } - const time2 = timestamp instanceof Function ? timestamp : timestamp ? epochTime : nullTime; - const timeSliceIndex = time2().indexOf(":") + 1; - if (useOnlyCustomLevels && !customLevels) - throw Error("customLevels is required if useOnlyCustomLevels is set true"); - if (mixin && typeof mixin !== "function") - throw Error(`Unknown mixin type "${typeof mixin}" - expected "function"`); - if (msgPrefix && typeof msgPrefix !== "string") - throw Error(`Unknown msgPrefix type "${typeof msgPrefix}" - expected "string"`); - assertDefaultLevelFound(level, customLevels, useOnlyCustomLevels); - const levels = mappings(customLevels, useOnlyCustomLevels); - if (typeof stream.emit === "function") { - stream.emit("message", { code: "PINO_CONFIG", config: { levels, messageKey, errorKey } }); - } - assertLevelComparison(levelComparison); - const levelCompFunc = genLevelComparison(levelComparison); - Object.assign(instance2, { - levels, - [levelCompSym]: levelCompFunc, - [useOnlyCustomLevelsSym]: useOnlyCustomLevels, - [streamSym]: stream, - [timeSym]: time2, - [timeSliceIndexSym]: timeSliceIndex, - [stringifySym]: stringify2, - [stringifySafeSym]: stringifySafe, - [stringifiersSym]: stringifiers, - [endSym]: end, - [formatOptsSym]: formatOpts, - [messageKeySym]: messageKey, - [errorKeySym]: errorKey, - [nestedKeySym]: nestedKey, - // protect against injection - [nestedKeyStrSym]: nestedKey ? `,${JSON.stringify(nestedKey)}:{` : "", - [serializersSym]: serializers2, - [mixinSym]: mixin, - [mixinMergeStrategySym]: mixinMergeStrategy, - [chindingsSym]: chindings, - [formattersSym]: allFormatters, - [hooksSym]: hooks, - silent: noop, - onChild, - [msgPrefixSym]: msgPrefix - }); - Object.setPrototypeOf(instance2, proto()); - genLsCache(instance2); - instance2[setLevelSym](level); - return instance2; - } - module2.exports = pino; - module2.exports.destination = (dest = process.stdout.fd) => { - if (typeof dest === "object") { - dest.dest = normalizeDestFileDescriptor(dest.dest || process.stdout.fd); - return buildSafeSonicBoom(dest); - } else { - return buildSafeSonicBoom({ dest: normalizeDestFileDescriptor(dest), minLength: 0 }); - } - }; - module2.exports.transport = require_transport(); - module2.exports.multistream = require_multistream(); - module2.exports.levels = mappings(); - module2.exports.stdSerializers = serializers; - module2.exports.stdTimeFunctions = Object.assign({}, time); - module2.exports.symbols = symbols; - module2.exports.version = version2; - module2.exports.default = pino; - module2.exports.pino = pino; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/logger-pino.js -var require_logger_pino = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/logger-pino.js"(exports2, module2) { - "use strict"; - var pino = require_pino(); - var { serializersSym } = pino.symbols; - var { - FST_ERR_LOG_INVALID_DESTINATION - } = require_errors2(); - function createPinoLogger(opts) { - if (opts.stream && opts.file) { - throw new FST_ERR_LOG_INVALID_DESTINATION(); - } else if (opts.file) { - opts.stream = pino.destination(opts.file); - delete opts.file; - } - const prevLogger = opts.logger; - const prevGenReqId = opts.genReqId; - let logger = null; - if (prevLogger) { - opts.logger = void 0; - opts.genReqId = void 0; - if (prevLogger[serializersSym]) { - opts.serializers = Object.assign({}, opts.serializers, prevLogger[serializersSym]); - } - logger = prevLogger.child({}, opts); - opts.logger = prevLogger; - opts.genReqId = prevGenReqId; - } else { - logger = pino(opts, opts.stream); - } - return logger; - } - var serializers = { - req: function asReqValue(req) { - return { - method: req.method, - url: req.url, - version: req.headers && req.headers["accept-version"], - host: req.host, - remoteAddress: req.ip, - remotePort: req.socket ? req.socket.remotePort : void 0 - }; - }, - err: pino.stdSerializers.err, - res: function asResValue(reply) { - return { - statusCode: reply.statusCode - }; - } - }; - module2.exports = { - serializers, - createPinoLogger - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/logger-factory.js -var require_logger_factory = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/logger-factory.js"(exports2, module2) { - "use strict"; - var { - FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED, - FST_ERR_LOG_INVALID_LOGGER_CONFIG, - FST_ERR_LOG_INVALID_LOGGER_INSTANCE, - FST_ERR_LOG_INVALID_LOGGER - } = require_errors2(); - function createChildLogger(context, logger, req, reqId, loggerOpts) { - const loggerBindings = { - [context.requestIdLogLabel]: reqId - }; - const child = context.childLoggerFactory.call(context.server, logger, loggerBindings, loggerOpts || {}, req); - if (context.childLoggerFactory !== defaultChildLoggerFactory) { - validateLogger(child, true); - } - return child; - } - function defaultChildLoggerFactory(logger, bindings, opts) { - return logger.child(bindings, opts); - } - function validateLogger(logger, strict) { - const methods = ["info", "error", "debug", "fatal", "warn", "trace", "child"]; - const missingMethods = logger ? methods.filter((method) => !logger[method] || typeof logger[method] !== "function") : methods; - if (!missingMethods.length) { - return true; - } else if (missingMethods.length === methods.length && !strict) { - return false; - } else { - throw FST_ERR_LOG_INVALID_LOGGER(missingMethods.join(",")); - } - } - function createLogger(options) { - if (options.logger && options.loggerInstance) { - throw new FST_ERR_LOG_LOGGER_AND_LOGGER_INSTANCE_PROVIDED(); - } - if (!options.loggerInstance && !options.logger) { - const nullLogger = require_abstract_logging(); - const logger2 = nullLogger; - logger2.child = () => logger2; - return { logger: logger2, hasLogger: false }; - } - const { createPinoLogger, serializers } = require_logger_pino(); - if (validateLogger(options.loggerInstance)) { - const logger2 = createPinoLogger({ - logger: options.loggerInstance, - serializers: Object.assign({}, serializers, options.loggerInstance.serializers) - }); - return { logger: logger2, hasLogger: true }; - } - if (validateLogger(options.logger)) { - throw FST_ERR_LOG_INVALID_LOGGER_CONFIG(); - } - if (options.loggerInstance) { - throw FST_ERR_LOG_INVALID_LOGGER_INSTANCE(); - } - const localLoggerOptions = {}; - if (Object.prototype.toString.call(options.logger) === "[object Object]") { - Reflect.ownKeys(options.logger).forEach((prop) => { - Object.defineProperty(localLoggerOptions, prop, { - value: options.logger[prop], - writable: true, - enumerable: true, - configurable: true - }); - }); - } - localLoggerOptions.level = localLoggerOptions.level || "info"; - localLoggerOptions.serializers = Object.assign({}, serializers, localLoggerOptions.serializers); - options.logger = localLoggerOptions; - const logger = createPinoLogger(options.logger); - return { logger, hasLogger: true }; - } - function now() { - const ts = process.hrtime(); - return ts[0] * 1e3 + ts[1] / 1e6; - } - module2.exports = { - createChildLogger, - defaultChildLoggerFactory, - createLogger, - validateLogger, - now - }; - } -}); - -// ../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js -var require_rfdc = __commonJS({ - "../../node_modules/.pnpm/rfdc@1.4.1/node_modules/rfdc/index.js"(exports2, module2) { - "use strict"; - module2.exports = rfdc; - function copyBuffer(cur) { - if (cur instanceof Buffer) { - return Buffer.from(cur); - } - return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length); - } - function rfdc(opts) { - opts = opts || {}; - if (opts.circles) - return rfdcCircles(opts); - const constructorHandlers = /* @__PURE__ */ new Map(); - constructorHandlers.set(Date, (o) => new Date(o)); - constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn))); - constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn))); - if (opts.constructorHandlers) { - for (const handler2 of opts.constructorHandlers) { - constructorHandlers.set(handler2[0], handler2[1]); - } - } - let handler = null; - return opts.proto ? cloneProto : clone2; - function cloneArray(a, fn) { - const keys = Object.keys(a); - const a2 = new Array(keys.length); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - const cur = a[k]; - if (typeof cur !== "object" || cur === null) { - a2[k] = cur; - } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { - a2[k] = handler(cur, fn); - } else if (ArrayBuffer.isView(cur)) { - a2[k] = copyBuffer(cur); - } else { - a2[k] = fn(cur); - } - } - return a2; - } - function clone2(o) { - if (typeof o !== "object" || o === null) - return o; - if (Array.isArray(o)) - return cloneArray(o, clone2); - if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { - return handler(o, clone2); - } - const o2 = {}; - for (const k in o) { - if (Object.hasOwnProperty.call(o, k) === false) - continue; - const cur = o[k]; - if (typeof cur !== "object" || cur === null) { - o2[k] = cur; - } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { - o2[k] = handler(cur, clone2); - } else if (ArrayBuffer.isView(cur)) { - o2[k] = copyBuffer(cur); - } else { - o2[k] = clone2(cur); - } - } - return o2; - } - function cloneProto(o) { - if (typeof o !== "object" || o === null) - return o; - if (Array.isArray(o)) - return cloneArray(o, cloneProto); - if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { - return handler(o, cloneProto); - } - const o2 = {}; - for (const k in o) { - const cur = o[k]; - if (typeof cur !== "object" || cur === null) { - o2[k] = cur; - } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { - o2[k] = handler(cur, cloneProto); - } else if (ArrayBuffer.isView(cur)) { - o2[k] = copyBuffer(cur); - } else { - o2[k] = cloneProto(cur); - } - } - return o2; - } - } - function rfdcCircles(opts) { - const refs = []; - const refsNew = []; - const constructorHandlers = /* @__PURE__ */ new Map(); - constructorHandlers.set(Date, (o) => new Date(o)); - constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn))); - constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn))); - if (opts.constructorHandlers) { - for (const handler2 of opts.constructorHandlers) { - constructorHandlers.set(handler2[0], handler2[1]); - } - } - let handler = null; - return opts.proto ? cloneProto : clone2; - function cloneArray(a, fn) { - const keys = Object.keys(a); - const a2 = new Array(keys.length); - for (let i = 0; i < keys.length; i++) { - const k = keys[i]; - const cur = a[k]; - if (typeof cur !== "object" || cur === null) { - a2[k] = cur; - } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { - a2[k] = handler(cur, fn); - } else if (ArrayBuffer.isView(cur)) { - a2[k] = copyBuffer(cur); - } else { - const index = refs.indexOf(cur); - if (index !== -1) { - a2[k] = refsNew[index]; - } else { - a2[k] = fn(cur); - } - } - } - return a2; - } - function clone2(o) { - if (typeof o !== "object" || o === null) - return o; - if (Array.isArray(o)) - return cloneArray(o, clone2); - if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { - return handler(o, clone2); - } - const o2 = {}; - refs.push(o); - refsNew.push(o2); - for (const k in o) { - if (Object.hasOwnProperty.call(o, k) === false) - continue; - const cur = o[k]; - if (typeof cur !== "object" || cur === null) { - o2[k] = cur; - } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { - o2[k] = handler(cur, clone2); - } else if (ArrayBuffer.isView(cur)) { - o2[k] = copyBuffer(cur); - } else { - const i = refs.indexOf(cur); - if (i !== -1) { - o2[k] = refsNew[i]; - } else { - o2[k] = clone2(cur); - } - } - } - refs.pop(); - refsNew.pop(); - return o2; - } - function cloneProto(o) { - if (typeof o !== "object" || o === null) - return o; - if (Array.isArray(o)) - return cloneArray(o, cloneProto); - if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { - return handler(o, cloneProto); - } - const o2 = {}; - refs.push(o); - refsNew.push(o2); - for (const k in o) { - const cur = o[k]; - if (typeof cur !== "object" || cur === null) { - o2[k] = cur; - } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { - o2[k] = handler(cur, cloneProto); - } else if (ArrayBuffer.isView(cur)) { - o2[k] = copyBuffer(cur); - } else { - const i = refs.indexOf(cur); - if (i !== -1) { - o2[k] = refsNew[i]; - } else { - o2[k] = cloneProto(cur); - } - } - } - refs.pop(); - refsNew.pop(); - return o2; - } - } - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/schemas.js -var require_schemas = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/schemas.js"(exports2, module2) { - "use strict"; - var fastClone = require_rfdc()({ circles: false, proto: true }); - var { kSchemaVisited, kSchemaResponse } = require_symbols2(); - var kFluentSchema = Symbol.for("fluent-schema-object"); - var { - FST_ERR_SCH_MISSING_ID, - FST_ERR_SCH_ALREADY_PRESENT, - FST_ERR_SCH_DUPLICATE, - FST_ERR_SCH_CONTENT_MISSING_SCHEMA - } = require_errors2(); - var SCHEMAS_SOURCE = ["params", "body", "querystring", "query", "headers"]; - function Schemas(initStore) { - this.store = initStore || {}; - } - Schemas.prototype.add = function(inputSchema) { - const schema = fastClone( - inputSchema.isFluentSchema || inputSchema.isFluentJSONSchema || inputSchema[kFluentSchema] ? inputSchema.valueOf() : inputSchema - ); - const id = schema.$id; - if (!id) { - throw new FST_ERR_SCH_MISSING_ID(); - } - if (this.store[id]) { - throw new FST_ERR_SCH_ALREADY_PRESENT(id); - } - this.store[id] = schema; - }; - Schemas.prototype.getSchemas = function() { - return Object.assign({}, this.store); - }; - Schemas.prototype.getSchema = function(schemaId) { - return this.store[schemaId]; - }; - function isCustomSchemaPrototype(schema) { - return typeof schema === "object" && Object.getPrototypeOf(schema) !== Object.prototype; - } - function normalizeSchema(routeSchemas, serverOptions) { - if (routeSchemas[kSchemaVisited]) { - return routeSchemas; - } - if (routeSchemas.query) { - if (routeSchemas.querystring) { - throw new FST_ERR_SCH_DUPLICATE("querystring"); - } - routeSchemas.querystring = routeSchemas.query; - } - generateFluentSchema(routeSchemas); - for (const key of SCHEMAS_SOURCE) { - const schema = routeSchemas[key]; - if (schema && !isCustomSchemaPrototype(schema)) { - if (key === "body" && schema.content) { - const contentProperty = schema.content; - const keys = Object.keys(contentProperty); - for (let i = 0; i < keys.length; i++) { - const contentType = keys[i]; - const contentSchema = contentProperty[contentType].schema; - if (!contentSchema) { - throw new FST_ERR_SCH_CONTENT_MISSING_SCHEMA(contentType); - } - } - continue; - } - } - } - if (routeSchemas.response) { - const httpCodes = Object.keys(routeSchemas.response); - for (const code of httpCodes) { - if (isCustomSchemaPrototype(routeSchemas.response[code])) { - continue; - } - const contentProperty = routeSchemas.response[code].content; - if (contentProperty) { - const keys = Object.keys(contentProperty); - for (let i = 0; i < keys.length; i++) { - const mediaName = keys[i]; - if (!contentProperty[mediaName].schema) { - throw new FST_ERR_SCH_CONTENT_MISSING_SCHEMA(mediaName); - } - } - } - } - } - routeSchemas[kSchemaVisited] = true; - return routeSchemas; - } - function generateFluentSchema(schema) { - for (const key of SCHEMAS_SOURCE) { - if (schema[key] && (schema[key].isFluentSchema || schema[key][kFluentSchema])) { - schema[key] = schema[key].valueOf(); - } - } - if (schema.response) { - const httpCodes = Object.keys(schema.response); - for (const code of httpCodes) { - if (schema.response[code].isFluentSchema || schema.response[code][kFluentSchema]) { - schema.response[code] = schema.response[code].valueOf(); - } - } - } - } - function getSchemaSerializer(context, statusCode, contentType) { - const responseSchemaDef = context[kSchemaResponse]; - if (!responseSchemaDef) { - return false; - } - if (responseSchemaDef[statusCode]) { - if (responseSchemaDef[statusCode].constructor === Object && contentType) { - const mediaName = contentType.split(";", 1)[0]; - if (responseSchemaDef[statusCode][mediaName]) { - return responseSchemaDef[statusCode][mediaName]; - } - if (responseSchemaDef[statusCode]["*/*"]) { - return responseSchemaDef[statusCode]["*/*"]; - } - return false; - } - return responseSchemaDef[statusCode]; - } - const fallbackStatusCode = (statusCode + "")[0] + "xx"; - if (responseSchemaDef[fallbackStatusCode]) { - if (responseSchemaDef[fallbackStatusCode].constructor === Object && contentType) { - const mediaName = contentType.split(";", 1)[0]; - if (responseSchemaDef[fallbackStatusCode][mediaName]) { - return responseSchemaDef[fallbackStatusCode][mediaName]; - } - if (responseSchemaDef[fallbackStatusCode]["*/*"]) { - return responseSchemaDef[fallbackStatusCode]["*/*"]; - } - return false; - } - return responseSchemaDef[fallbackStatusCode]; - } - if (responseSchemaDef.default) { - if (responseSchemaDef.default.constructor === Object && contentType) { - const mediaName = contentType.split(";", 1)[0]; - if (responseSchemaDef.default[mediaName]) { - return responseSchemaDef.default[mediaName]; - } - if (responseSchemaDef.default["*/*"]) { - return responseSchemaDef.default["*/*"]; - } - return false; - } - return responseSchemaDef.default; - } - return false; - } - module2.exports = { - buildSchemas(initStore) { - return new Schemas(initStore); - }, - getSchemaSerializer, - normalizeSchema - }; - } -}); - -// ../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/serializer.js -var require_serializer = __commonJS({ - "../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/serializer.js"(exports2, module2) { - "use strict"; - var STR_ESCAPE = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]/; - module2.exports = class Serializer { - constructor(options) { - switch (options && options.rounding) { - case "floor": - this.parseInteger = Math.floor; - break; - case "ceil": - this.parseInteger = Math.ceil; - break; - case "round": - this.parseInteger = Math.round; - break; - case "trunc": - default: - this.parseInteger = Math.trunc; - break; - } - this._options = options; - } - asInteger(i) { - if (Number.isInteger(i)) { - return "" + i; - } else if (typeof i === "bigint") { - return i.toString(); - } - const integer = this.parseInteger(i); - if (integer === Infinity || integer === -Infinity || integer !== integer) { - throw new Error(`The value "${i}" cannot be converted to an integer.`); - } - return "" + integer; - } - asNumber(i) { - const num = Number(i); - if (num !== num) { - throw new Error(`The value "${i}" cannot be converted to a number.`); - } else if (num === Infinity || num === -Infinity) { - return "null"; - } else { - return "" + num; - } - } - asBoolean(bool) { - return bool && "true" || "false"; - } - asDateTime(date) { - if (date === null) - return '""'; - if (date instanceof Date) { - return '"' + date.toISOString() + '"'; - } - if (typeof date === "string") { - return '"' + date + '"'; - } - throw new Error(`The value "${date}" cannot be converted to a date-time.`); - } - asDate(date) { - if (date === null) - return '""'; - if (date instanceof Date) { - return '"' + new Date(date.getTime() - date.getTimezoneOffset() * 6e4).toISOString().slice(0, 10) + '"'; - } - if (typeof date === "string") { - return '"' + date + '"'; - } - throw new Error(`The value "${date}" cannot be converted to a date.`); - } - asTime(date) { - if (date === null) - return '""'; - if (date instanceof Date) { - return '"' + new Date(date.getTime() - date.getTimezoneOffset() * 6e4).toISOString().slice(11, 19) + '"'; - } - if (typeof date === "string") { - return '"' + date + '"'; - } - throw new Error(`The value "${date}" cannot be converted to a time.`); - } - asString(str) { - const len = str.length; - if (len === 0) { - return '""'; - } else if (len < 42) { - let result = ""; - let last = -1; - let point = 255; - for (let i = 0; i < len; i++) { - point = str.charCodeAt(i); - if (point === 34 || // '"' - point === 92) { - last === -1 && (last = 0); - result += str.slice(last, i) + "\\"; - last = i; - } else if (point < 32 || point >= 55296 && point <= 57343) { - return JSON.stringify(str); - } - } - return last === -1 && '"' + str + '"' || '"' + result + str.slice(last) + '"'; - } else if (len < 5e3 && STR_ESCAPE.test(str) === false) { - return '"' + str + '"'; - } else { - return JSON.stringify(str); - } - } - asUnsafeString(str) { - return '"' + str + '"'; - } - getState() { - return this._options; - } - static restoreFromState(state) { - return new Serializer(state); - } - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/error-serializer.js -var require_error_serializer = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/error-serializer.js"(exports2, module2) { - "use strict"; - var Serializer = require_serializer(); - var serializerState = { "mode": "standalone" }; - var serializer = Serializer.restoreFromState(serializerState); - var validator = null; - module2.exports = function anonymous(validator2, serializer2) { - const { - asString, - asNumber, - asBoolean, - asDateTime, - asDate, - asTime, - asUnsafeString - } = serializer2; - const asInteger = serializer2.asInteger.bind(serializer2); - const JSON_STR_BEGIN_OBJECT = "{"; - const JSON_STR_END_OBJECT = "}"; - const JSON_STR_BEGIN_ARRAY = "["; - const JSON_STR_END_ARRAY = "]"; - const JSON_STR_COMMA = ","; - const JSON_STR_COLONS = ":"; - const JSON_STR_QUOTE = '"'; - const JSON_STR_EMPTY_OBJECT = JSON_STR_BEGIN_OBJECT + JSON_STR_END_OBJECT; - const JSON_STR_EMPTY_ARRAY = JSON_STR_BEGIN_ARRAY + JSON_STR_END_ARRAY; - const JSON_STR_EMPTY_STRING = JSON_STR_QUOTE + JSON_STR_QUOTE; - const JSON_STR_NULL = "null"; - function anonymous0(input) { - const obj = input && typeof input.toJSON === "function" ? input.toJSON() : input; - if (obj === null) - return JSON_STR_EMPTY_OBJECT; - let value; - let json = JSON_STR_BEGIN_OBJECT; - let addComma = false; - value = obj["statusCode"]; - if (value !== void 0) { - !addComma && (addComma = true) || (json += JSON_STR_COMMA); - json += '"statusCode":'; - json += asNumber(value); - } - value = obj["code"]; - if (value !== void 0) { - !addComma && (addComma = true) || (json += JSON_STR_COMMA); - json += '"code":'; - if (typeof value !== "string") { - if (value === null) { - json += JSON_STR_EMPTY_STRING; - } else if (value instanceof Date) { - json += JSON_STR_QUOTE + value.toISOString() + JSON_STR_QUOTE; - } else if (value instanceof RegExp) { - json += asString(value.source); - } else { - json += asString(value.toString()); - } - } else { - json += asString(value); - } - } - value = obj["error"]; - if (value !== void 0) { - !addComma && (addComma = true) || (json += JSON_STR_COMMA); - json += '"error":'; - if (typeof value !== "string") { - if (value === null) { - json += JSON_STR_EMPTY_STRING; - } else if (value instanceof Date) { - json += JSON_STR_QUOTE + value.toISOString() + JSON_STR_QUOTE; - } else if (value instanceof RegExp) { - json += asString(value.source); - } else { - json += asString(value.toString()); - } - } else { - json += asString(value); - } - } - value = obj["message"]; - if (value !== void 0) { - !addComma && (addComma = true) || (json += JSON_STR_COMMA); - json += '"message":'; - if (typeof value !== "string") { - if (value === null) { - json += JSON_STR_EMPTY_STRING; - } else if (value instanceof Date) { - json += JSON_STR_QUOTE + value.toISOString() + JSON_STR_QUOTE; - } else if (value instanceof RegExp) { - json += asString(value.source); - } else { - json += asString(value.toString()); - } - } else { - json += asString(value); - } - } - return json + JSON_STR_END_OBJECT; - } - const main2 = anonymous0; - return main2; - }(validator, serializer); - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/error-handler.js -var require_error_handler = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/error-handler.js"(exports2, module2) { - "use strict"; - var statusCodes = require("node:http").STATUS_CODES; - var wrapThenable = require_wrap_thenable(); - var { setErrorStatusCode } = require_error_status(); - var { - kReplyHeaders, - kReplyNextErrorHandler, - kReplyIsRunningOnErrorHook, - kRouteContext, - kDisableRequestLogging - } = require_symbols2(); - var { - FST_ERR_REP_INVALID_PAYLOAD_TYPE, - FST_ERR_FAILED_ERROR_SERIALIZATION - } = require_errors2(); - var { getSchemaSerializer } = require_schemas(); - var serializeError = require_error_serializer(); - var rootErrorHandler = { - func: defaultErrorHandler, - toJSON() { - return this.func.name.toString() + "()"; - } - }; - function handleError(reply, error, cb) { - reply[kReplyIsRunningOnErrorHook] = false; - const context = reply[kRouteContext]; - if (reply[kReplyNextErrorHandler] === false) { - fallbackErrorHandler(error, reply, function(reply2, payload) { - try { - reply2.raw.writeHead(reply2.raw.statusCode, reply2[kReplyHeaders]); - } catch (error2) { - if (!reply2.log[kDisableRequestLogging]) { - reply2.log.warn( - { req: reply2.request, res: reply2, err: error2 }, - error2?.message - ); - } - reply2.raw.writeHead(reply2.raw.statusCode); - } - reply2.raw.end(payload); - }); - return; - } - const errorHandler = reply[kReplyNextErrorHandler] || context.errorHandler; - reply[kReplyNextErrorHandler] = Object.getPrototypeOf(errorHandler); - delete reply[kReplyHeaders]["content-type"]; - delete reply[kReplyHeaders]["content-length"]; - const func = errorHandler.func; - if (!func) { - reply[kReplyNextErrorHandler] = false; - fallbackErrorHandler(error, reply, cb); - return; - } - try { - const result = func(error, reply.request, reply); - if (result !== void 0) { - if (result !== null && typeof result.then === "function") { - wrapThenable(result, reply); - } else { - reply.send(result); - } - } - } catch (err) { - reply.send(err); - } - } - function defaultErrorHandler(error, request, reply) { - setErrorHeaders(error, reply); - setErrorStatusCode(reply, error); - if (reply.statusCode < 500) { - if (!reply.log[kDisableRequestLogging]) { - reply.log.info( - { res: reply, err: error }, - error?.message - ); - } - } else { - if (!reply.log[kDisableRequestLogging]) { - reply.log.error( - { req: request, res: reply, err: error }, - error?.message - ); - } - } - reply.send(error); - } - function fallbackErrorHandler(error, reply, cb) { - const res = reply.raw; - const statusCode = reply.statusCode; - reply[kReplyHeaders]["content-type"] = reply[kReplyHeaders]["content-type"] ?? "application/json; charset=utf-8"; - let payload; - try { - const serializerFn = getSchemaSerializer(reply[kRouteContext], statusCode, reply[kReplyHeaders]["content-type"]); - if (serializerFn === false) { - payload = serializeError({ - error: statusCodes[statusCode + ""], - code: error.code, - message: error.message, - statusCode - }); - } else { - payload = serializerFn(Object.create(error, { - error: { value: statusCodes[statusCode + ""] }, - message: { value: error.message }, - statusCode: { value: statusCode } - })); - } - } catch (err) { - if (!reply.log[kDisableRequestLogging]) { - reply.log.error({ err, statusCode: res.statusCode }, "The serializer for the given status code failed"); - } - reply.code(500); - payload = serializeError(new FST_ERR_FAILED_ERROR_SERIALIZATION(err.message, error.message)); - } - if (typeof payload !== "string" && !Buffer.isBuffer(payload)) { - payload = serializeError(new FST_ERR_REP_INVALID_PAYLOAD_TYPE(typeof payload)); - } - reply[kReplyHeaders]["content-length"] = "" + Buffer.byteLength(payload); - cb(reply, payload); - } - function buildErrorHandler(parent = rootErrorHandler, func) { - if (!func) { - return parent; - } - const errorHandler = Object.create(parent); - errorHandler.func = func; - return errorHandler; - } - function setErrorHeaders(error, reply) { - const res = reply.raw; - let statusCode = res.statusCode; - statusCode = statusCode >= 400 ? statusCode : 500; - if (error != null) { - if (error.headers !== void 0) { - reply.headers(error.headers); - } - if (error.status >= 400) { - statusCode = error.status; - } else if (error.statusCode >= 400) { - statusCode = error.statusCode; - } - } - res.statusCode = statusCode; - } - module2.exports = { - buildErrorHandler, - handleError - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/decorate.js -var require_decorate = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/decorate.js"(exports2, module2) { - "use strict"; - var { - kReply, - kRequest, - kState, - kHasBeenDecorated - } = require_symbols2(); - var { - FST_ERR_DEC_ALREADY_PRESENT, - FST_ERR_DEC_MISSING_DEPENDENCY, - FST_ERR_DEC_AFTER_START, - FST_ERR_DEC_REFERENCE_TYPE, - FST_ERR_DEC_DEPENDENCY_INVALID_TYPE, - FST_ERR_DEC_UNDECLARED - } = require_errors2(); - function decorate(instance2, name, fn, dependencies) { - if (Object.hasOwn(instance2, name)) { - throw new FST_ERR_DEC_ALREADY_PRESENT(name); - } - checkDependencies(instance2, name, dependencies); - if (fn && (typeof fn.getter === "function" || typeof fn.setter === "function")) { - Object.defineProperty(instance2, name, { - get: fn.getter, - set: fn.setter - }); - } else { - instance2[name] = fn; - } - } - function getInstanceDecorator(name) { - if (!checkExistence(this, name)) { - throw new FST_ERR_DEC_UNDECLARED(name, "instance"); - } - if (typeof this[name] === "function") { - return this[name].bind(this); - } - return this[name]; - } - function decorateConstructor(konstructor, name, fn, dependencies) { - const instance2 = konstructor.prototype; - if (Object.hasOwn(instance2, name) || hasKey(konstructor, name)) { - throw new FST_ERR_DEC_ALREADY_PRESENT(name); - } - konstructor[kHasBeenDecorated] = true; - checkDependencies(konstructor, name, dependencies); - if (fn && (typeof fn.getter === "function" || typeof fn.setter === "function")) { - Object.defineProperty(instance2, name, { - get: fn.getter, - set: fn.setter - }); - } else if (typeof fn === "function") { - instance2[name] = fn; - } else { - konstructor.props.push({ key: name, value: fn }); - } - } - function checkReferenceType(name, fn) { - if (typeof fn === "object" && fn && !(typeof fn.getter === "function" || typeof fn.setter === "function")) { - throw new FST_ERR_DEC_REFERENCE_TYPE(name, typeof fn); - } - } - function decorateFastify(name, fn, dependencies) { - assertNotStarted(this, name); - decorate(this, name, fn, dependencies); - return this; - } - function checkExistence(instance2, name) { - if (name) { - return name in instance2 || instance2.prototype && name in instance2.prototype || hasKey(instance2, name); - } - return instance2 in this; - } - function hasKey(fn, name) { - if (fn.props) { - return fn.props.find(({ key }) => key === name); - } - return false; - } - function checkRequestExistence(name) { - if (name && hasKey(this[kRequest], name)) - return true; - return checkExistence(this[kRequest].prototype, name); - } - function checkReplyExistence(name) { - if (name && hasKey(this[kReply], name)) - return true; - return checkExistence(this[kReply].prototype, name); - } - function checkDependencies(instance2, name, deps) { - if (deps === void 0 || deps === null) { - return; - } - if (!Array.isArray(deps)) { - throw new FST_ERR_DEC_DEPENDENCY_INVALID_TYPE(name); - } - for (let i = 0; i !== deps.length; ++i) { - if (!checkExistence(instance2, deps[i])) { - throw new FST_ERR_DEC_MISSING_DEPENDENCY(deps[i]); - } - } - } - function decorateReply(name, fn, dependencies) { - assertNotStarted(this, name); - checkReferenceType(name, fn); - decorateConstructor(this[kReply], name, fn, dependencies); - return this; - } - function decorateRequest(name, fn, dependencies) { - assertNotStarted(this, name); - checkReferenceType(name, fn); - decorateConstructor(this[kRequest], name, fn, dependencies); - return this; - } - function assertNotStarted(instance2, name) { - if (instance2[kState].started) { - throw new FST_ERR_DEC_AFTER_START(name); - } - } - module2.exports = { - add: decorateFastify, - exist: checkExistence, - existRequest: checkRequestExistence, - existReply: checkReplyExistence, - dependencies: checkDependencies, - decorateReply, - decorateRequest, - getInstanceDecorator, - hasKey - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/reply.js -var require_reply = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/reply.js"(exports2, module2) { - "use strict"; - var eos = require("node:stream").finished; - var { - kFourOhFourContext, - kReplyErrorHandlerCalled, - kReplyHijacked, - kReplyStartTime, - kReplyEndTime, - kReplySerializer, - kReplySerializerDefault, - kReplyIsError, - kReplyHeaders, - kReplyTrailers, - kReplyHasStatusCode, - kReplyIsRunningOnErrorHook, - kReplyNextErrorHandler, - kDisableRequestLogging, - kSchemaResponse, - kReplyCacheSerializeFns, - kSchemaController, - kOptions, - kRouteContext, - kTimeoutTimer, - kOnAbort, - kRequestSignal - } = require_symbols2(); - var { - onSendHookRunner, - onResponseHookRunner, - preHandlerHookRunner, - preSerializationHookRunner - } = require_hooks(); - var internals = require_handle_request()[Symbol.for("internals")]; - var loggerUtils = require_logger_factory(); - var now = loggerUtils.now; - var { handleError } = require_error_handler(); - var { getSchemaSerializer } = require_schemas(); - var CONTENT_TYPE = { - JSON: "application/json; charset=utf-8", - PLAIN: "text/plain; charset=utf-8", - OCTET: "application/octet-stream" - }; - var { - FST_ERR_REP_INVALID_PAYLOAD_TYPE, - FST_ERR_REP_RESPONSE_BODY_CONSUMED, - FST_ERR_REP_READABLE_STREAM_LOCKED, - FST_ERR_REP_ALREADY_SENT, - FST_ERR_SEND_INSIDE_ONERR, - FST_ERR_BAD_STATUS_CODE, - FST_ERR_BAD_TRAILER_NAME, - FST_ERR_BAD_TRAILER_VALUE, - FST_ERR_MISSING_SERIALIZATION_FN, - FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN, - FST_ERR_DEC_UNDECLARED - } = require_errors2(); - var decorators = require_decorate(); - var toString = Object.prototype.toString; - function Reply(res, request, log) { - this.raw = res; - this[kReplySerializer] = null; - this[kReplyErrorHandlerCalled] = false; - this[kReplyIsError] = false; - this[kReplyIsRunningOnErrorHook] = false; - this.request = request; - this[kReplyHeaders] = {}; - this[kReplyTrailers] = null; - this[kReplyHasStatusCode] = false; - this[kReplyStartTime] = void 0; - this.log = log; - } - Reply.props = []; - Object.defineProperties(Reply.prototype, { - [kRouteContext]: { - get() { - return this.request[kRouteContext]; - } - }, - elapsedTime: { - get() { - if (this[kReplyStartTime] === void 0) { - return 0; - } - return (this[kReplyEndTime] || now()) - this[kReplyStartTime]; - } - }, - server: { - get() { - return this.request[kRouteContext].server; - } - }, - sent: { - enumerable: true, - get() { - return (this[kReplyHijacked] || this.raw.writableEnded) === true; - } - }, - statusCode: { - get() { - return this.raw.statusCode; - }, - set(value) { - this.code(value); - } - }, - routeOptions: { - get() { - return this.request.routeOptions; - } - } - }); - Reply.prototype.writeEarlyHints = function(hints, callback) { - this.raw.writeEarlyHints(hints, callback); - return this; - }; - Reply.prototype.hijack = function() { - this[kReplyHijacked] = true; - if (this.request[kRequestSignal]) { - clearTimeout(this.request[kTimeoutTimer]); - this.request[kTimeoutTimer] = null; - if (this.request[kOnAbort]) { - this.request.raw.removeListener("close", this.request[kOnAbort]); - this.request[kOnAbort] = null; - } - } - return this; - }; - Reply.prototype.send = function(payload) { - if (this[kReplyIsRunningOnErrorHook]) { - throw new FST_ERR_SEND_INSIDE_ONERR(); - } - if (this.sent === true) { - this.log.warn({ err: new FST_ERR_REP_ALREADY_SENT(this.request.url, this.request.method) }); - return this; - } - if (this[kReplyIsError] || payload instanceof Error) { - this[kReplyIsError] = false; - onErrorHook(this, payload, onSendHook); - return this; - } - if (payload === void 0) { - onSendHook(this, payload); - return this; - } - const contentType = this.getHeader("content-type"); - const hasContentType = contentType !== void 0; - if (payload !== null) { - if ( - // node:stream - typeof payload.pipe === "function" || // node:stream/web - typeof payload.getReader === "function" || // Response - toString.call(payload) === "[object Response]" - ) { - onSendHook(this, payload); - return this; - } - if (payload.buffer instanceof ArrayBuffer) { - if (!hasContentType) { - this[kReplyHeaders]["content-type"] = CONTENT_TYPE.OCTET; - } - const payloadToSend = Buffer.isBuffer(payload) ? payload : Buffer.from(payload.buffer, payload.byteOffset, payload.byteLength); - onSendHook(this, payloadToSend); - return this; - } - if (!hasContentType && typeof payload === "string") { - this[kReplyHeaders]["content-type"] = CONTENT_TYPE.PLAIN; - onSendHook(this, payload); - return this; - } - } - if (this[kReplySerializer] !== null) { - if (typeof payload !== "string") { - preSerializationHook(this, payload); - return this; - } - payload = this[kReplySerializer](payload); - } else if (!hasContentType || contentType.indexOf("json") !== -1) { - if (!hasContentType) { - this[kReplyHeaders]["content-type"] = CONTENT_TYPE.JSON; - } else if (contentType.indexOf("charset") === -1) { - const customContentType = contentType.trim(); - if (customContentType.endsWith(";")) { - this[kReplyHeaders]["content-type"] = `${customContentType} charset=utf-8`; - } else { - this[kReplyHeaders]["content-type"] = `${customContentType}; charset=utf-8`; - } - } - if (typeof payload !== "string") { - preSerializationHook(this, payload); - return this; - } - } - onSendHook(this, payload); - return this; - }; - Reply.prototype.getHeader = function(key) { - key = key.toLowerCase(); - const value = this[kReplyHeaders][key]; - return value !== void 0 ? value : this.raw.getHeader(key); - }; - Reply.prototype.getHeaders = function() { - return { - ...this.raw.getHeaders(), - ...this[kReplyHeaders] - }; - }; - Reply.prototype.hasHeader = function(key) { - key = key.toLowerCase(); - return this[kReplyHeaders][key] !== void 0 || this.raw.hasHeader(key); - }; - Reply.prototype.removeHeader = function(key) { - delete this[kReplyHeaders][key.toLowerCase()]; - return this; - }; - Reply.prototype.header = function(key, value = "") { - key = key.toLowerCase(); - if (this[kReplyHeaders][key] && key === "set-cookie") { - if (typeof this[kReplyHeaders][key] === "string") { - this[kReplyHeaders][key] = [this[kReplyHeaders][key]]; - } - if (Array.isArray(value)) { - Array.prototype.push.apply(this[kReplyHeaders][key], value); - } else { - this[kReplyHeaders][key].push(value); - } - } else { - this[kReplyHeaders][key] = value; - } - return this; - }; - Reply.prototype.headers = function(headers) { - const keys = Object.keys(headers); - for (let i = 0; i !== keys.length; ++i) { - const key = keys[i]; - this.header(key, headers[key]); - } - return this; - }; - var INVALID_TRAILERS = /* @__PURE__ */ new Set([ - "transfer-encoding", - "content-length", - "host", - "cache-control", - "max-forwards", - "te", - "authorization", - "set-cookie", - "content-encoding", - "content-type", - "content-range", - "trailer" - ]); - Reply.prototype.trailer = function(key, fn) { - key = key.toLowerCase(); - if (INVALID_TRAILERS.has(key)) { - throw new FST_ERR_BAD_TRAILER_NAME(key); - } - if (typeof fn !== "function") { - throw new FST_ERR_BAD_TRAILER_VALUE(key, typeof fn); - } - if (this[kReplyTrailers] === null) - this[kReplyTrailers] = {}; - this[kReplyTrailers][key] = fn; - return this; - }; - Reply.prototype.hasTrailer = function(key) { - return this[kReplyTrailers]?.[key.toLowerCase()] !== void 0; - }; - Reply.prototype.removeTrailer = function(key) { - if (this[kReplyTrailers] === null) - return this; - this[kReplyTrailers][key.toLowerCase()] = void 0; - return this; - }; - Reply.prototype.code = function(code) { - const statusCode = +code; - if (!(statusCode >= 100 && statusCode <= 599)) { - throw new FST_ERR_BAD_STATUS_CODE(code || String(code)); - } - this.raw.statusCode = statusCode; - this[kReplyHasStatusCode] = true; - return this; - }; - Reply.prototype.status = Reply.prototype.code; - Reply.prototype.getSerializationFunction = function(schemaOrStatus, contentType) { - let serialize3; - if (typeof schemaOrStatus === "string" || typeof schemaOrStatus === "number") { - if (typeof contentType === "string") { - serialize3 = this[kRouteContext][kSchemaResponse]?.[schemaOrStatus]?.[contentType]; - } else { - serialize3 = this[kRouteContext][kSchemaResponse]?.[schemaOrStatus]; - } - } else if (typeof schemaOrStatus === "object") { - serialize3 = this[kRouteContext][kReplyCacheSerializeFns]?.get(schemaOrStatus); - } - return serialize3; - }; - Reply.prototype.compileSerializationSchema = function(schema, httpStatus = null, contentType = null) { - const { request } = this; - const { method, url } = request; - if (this[kRouteContext][kReplyCacheSerializeFns]?.has(schema)) { - return this[kRouteContext][kReplyCacheSerializeFns].get(schema); - } - const serializerCompiler = this[kRouteContext].serializerCompiler || this.server[kSchemaController].serializerCompiler || // We compile the schemas if no custom serializerCompiler is provided - // nor set - (this.server[kSchemaController].setupSerializer(this.server[kOptions]) || this.server[kSchemaController].serializerCompiler); - const serializeFn = serializerCompiler({ - schema, - method, - url, - httpStatus, - contentType - }); - if (this[kRouteContext][kReplyCacheSerializeFns] == null) { - this[kRouteContext][kReplyCacheSerializeFns] = /* @__PURE__ */ new WeakMap(); - } - this[kRouteContext][kReplyCacheSerializeFns].set(schema, serializeFn); - return serializeFn; - }; - Reply.prototype.serializeInput = function(input, schema, httpStatus, contentType) { - const possibleContentType = httpStatus; - let serialize3; - httpStatus = typeof schema === "string" || typeof schema === "number" ? schema : httpStatus; - contentType = httpStatus && possibleContentType !== httpStatus ? possibleContentType : contentType; - if (httpStatus != null) { - if (contentType != null) { - serialize3 = this[kRouteContext][kSchemaResponse]?.[httpStatus]?.[contentType]; - } else { - serialize3 = this[kRouteContext][kSchemaResponse]?.[httpStatus]; - } - if (serialize3 == null) { - if (contentType) - throw new FST_ERR_MISSING_CONTENTTYPE_SERIALIZATION_FN(httpStatus, contentType); - throw new FST_ERR_MISSING_SERIALIZATION_FN(httpStatus); - } - } else { - if (this[kRouteContext][kReplyCacheSerializeFns]?.has(schema)) { - serialize3 = this[kRouteContext][kReplyCacheSerializeFns].get(schema); - } else { - serialize3 = this.compileSerializationSchema(schema, httpStatus, contentType); - } - } - return serialize3(input); - }; - Reply.prototype.serialize = function(payload) { - if (this[kReplySerializer] !== null) { - return this[kReplySerializer](payload); - } else { - if (this[kRouteContext] && this[kRouteContext][kReplySerializerDefault]) { - return this[kRouteContext][kReplySerializerDefault](payload, this.raw.statusCode); - } else { - return serialize2(this[kRouteContext], payload, this.raw.statusCode); - } - } - }; - Reply.prototype.serializer = function(fn) { - this[kReplySerializer] = fn; - return this; - }; - Reply.prototype.type = function(type2) { - this[kReplyHeaders]["content-type"] = type2; - return this; - }; - Reply.prototype.redirect = function(url, code) { - if (!code) { - code = this[kReplyHasStatusCode] ? this.raw.statusCode : 302; - } - return this.header("location", url).code(code).send(); - }; - Reply.prototype.callNotFound = function() { - notFound(this); - return this; - }; - Reply.prototype.then = function(fulfilled, rejected) { - if (this.sent) { - fulfilled(); - return; - } - eos(this.raw, (err) => { - if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { - if (rejected) { - rejected(err); - } else { - this.log && this.log.warn("unhandled rejection on reply.then"); - } - } else { - fulfilled(); - } - }); - }; - Reply.prototype.getDecorator = function(name) { - if (!decorators.hasKey(this, name) && !decorators.exist(this, name)) { - throw new FST_ERR_DEC_UNDECLARED(name, "reply"); - } - const decorator = this[name]; - if (typeof decorator === "function") { - return decorator.bind(this); - } - return decorator; - }; - function preSerializationHook(reply, payload) { - if (reply[kRouteContext].preSerialization !== null) { - preSerializationHookRunner( - reply[kRouteContext].preSerialization, - reply.request, - reply, - payload, - preSerializationHookEnd - ); - } else { - preSerializationHookEnd(null, void 0, reply, payload); - } - } - function preSerializationHookEnd(err, _request, reply, payload) { - if (err != null) { - onErrorHook(reply, err); - return; - } - try { - if (reply[kReplySerializer] !== null) { - payload = reply[kReplySerializer](payload); - } else if (reply[kRouteContext] && reply[kRouteContext][kReplySerializerDefault]) { - payload = reply[kRouteContext][kReplySerializerDefault](payload, reply.raw.statusCode); - } else { - payload = serialize2(reply[kRouteContext], payload, reply.raw.statusCode, reply[kReplyHeaders]["content-type"]); - } - } catch (e) { - wrapSerializationError(e, reply); - onErrorHook(reply, e); - return; - } - onSendHook(reply, payload); - } - function wrapSerializationError(error, reply) { - error.serialization = reply[kRouteContext].config; - } - function onSendHook(reply, payload) { - if (reply[kRouteContext].onSend !== null) { - onSendHookRunner( - reply[kRouteContext].onSend, - reply.request, - reply, - payload, - wrapOnSendEnd - ); - } else { - onSendEnd(reply, payload); - } - } - function wrapOnSendEnd(err, request, reply, payload) { - if (err != null) { - onErrorHook(reply, err); - } else { - onSendEnd(reply, payload); - } - } - function safeWriteHead(reply, statusCode) { - const res = reply.raw; - try { - res.writeHead(statusCode, reply[kReplyHeaders]); - } catch (err) { - if (err.code === "ERR_HTTP_HEADERS_SENT") { - reply.log.warn(`Reply was already sent, did you forget to "return reply" in the "${reply.request.raw.url}" (${reply.request.raw.method}) route?`); - } - throw err; - } - } - function onSendEnd(reply, payload) { - const res = reply.raw; - const req = reply.request; - if (reply[kReplyTrailers] !== null) { - const trailerHeaders = Object.keys(reply[kReplyTrailers]); - let header = ""; - for (const trailerName of trailerHeaders) { - if (typeof reply[kReplyTrailers][trailerName] !== "function") - continue; - header += " "; - header += trailerName; - } - reply.header("Transfer-Encoding", "chunked"); - reply.header("Trailer", header.trim()); - } - if (toString.call(payload) === "[object Response]") { - if (typeof payload.status === "number") { - reply.code(payload.status); - } - if (typeof payload.headers === "object" && typeof payload.headers.forEach === "function") { - for (const [headerName, headerValue] of payload.headers) { - reply.header(headerName, headerValue); - } - } - if (payload.body !== null) { - if (payload.bodyUsed) { - throw new FST_ERR_REP_RESPONSE_BODY_CONSUMED(); - } - } - payload = payload.body; - } - const statusCode = res.statusCode; - if (payload === void 0 || payload === null) { - if (statusCode >= 200 && statusCode !== 204 && statusCode !== 304 && req.method !== "HEAD" && reply[kReplyTrailers] === null) { - reply[kReplyHeaders]["content-length"] = "0"; - } - safeWriteHead(reply, statusCode); - sendTrailer(payload, res, reply); - return; - } - if (statusCode >= 100 && statusCode < 200 || statusCode === 204) { - reply.removeHeader("content-type"); - reply.removeHeader("content-length"); - safeWriteHead(reply, statusCode); - sendTrailer(void 0, res, reply); - if (typeof payload.resume === "function") { - payload.on("error", noop); - payload.resume(); - } - return; - } - if (typeof payload.pipe === "function") { - sendStream(payload, res, reply); - return; - } - if (typeof payload.getReader === "function") { - sendWebStream(payload, res, reply); - return; - } - if (typeof payload !== "string" && !Buffer.isBuffer(payload)) { - throw new FST_ERR_REP_INVALID_PAYLOAD_TYPE(typeof payload); - } - if (reply[kReplyTrailers] === null) { - const contentLength = reply[kReplyHeaders]["content-length"]; - if (!contentLength || req.raw.method !== "HEAD" && Number(contentLength) !== Buffer.byteLength(payload)) { - reply[kReplyHeaders]["content-length"] = "" + Buffer.byteLength(payload); - } - } - safeWriteHead(reply, statusCode); - res.write(payload); - sendTrailer(payload, res, reply); - } - function logStreamError(logger, err, res) { - if (err.code === "ERR_STREAM_PREMATURE_CLOSE") { - if (!logger[kDisableRequestLogging]) { - logger.info({ res }, "stream closed prematurely"); - } - } else { - logger.warn({ err }, "response terminated with an error with headers already sent"); - } - } - function sendWebStream(payload, res, reply) { - if (payload.locked) { - throw new FST_ERR_REP_READABLE_STREAM_LOCKED(); - } - let sourceOpen = true; - let errorLogged = false; - let waitingDrain = false; - const reader = payload.getReader(); - eos(res, function(err) { - if (sourceOpen) { - if (err != null && res.headersSent && !errorLogged) { - errorLogged = true; - logStreamError(reply.log, err, res); - } - reader.cancel().catch(noop); - } - }); - if (!res.headersSent) { - for (const key in reply[kReplyHeaders]) { - res.setHeader(key, reply[kReplyHeaders][key]); - } - } else { - reply.log.warn("response will send, but you shouldn't use res.writeHead in stream mode"); - } - function onRead(result) { - if (result.done) { - sourceOpen = false; - sendTrailer(null, res, reply); - return; - } - if (res.destroyed) { - sourceOpen = false; - reader.cancel().catch(noop); - return; - } - const shouldContinue = res.write(result.value); - if (shouldContinue === false) { - waitingDrain = true; - res.once("drain", onDrain); - return; - } - reader.read().then(onRead, onReadError); - } - function onDrain() { - if (!waitingDrain || !sourceOpen || res.destroyed) { - return; - } - waitingDrain = false; - reader.read().then(onRead, onReadError); - } - function onReadError(err) { - sourceOpen = false; - if (res.headersSent || reply.request.raw.aborted === true) { - if (!errorLogged) { - errorLogged = true; - logStreamError(reply.log, err, reply); - } - res.destroy(); - } else { - onErrorHook(reply, err); - } - } - reader.read().then(onRead, onReadError); - } - function sendStream(payload, res, reply) { - let sourceOpen = true; - let errorLogged = false; - sendStreamTrailer(payload, res, reply); - eos(payload, { readable: true, writable: false }, function(err) { - sourceOpen = false; - if (err != null) { - if (res.headersSent || reply.request.raw.aborted === true) { - if (!errorLogged) { - errorLogged = true; - logStreamError(reply.log, err, reply); - } - res.destroy(); - } else { - onErrorHook(reply, err); - } - } - }); - eos(res, function(err) { - if (sourceOpen) { - if (err != null && res.headersSent && !errorLogged) { - errorLogged = true; - logStreamError(reply.log, err, res); - } - if (typeof payload.destroy === "function") { - payload.destroy(); - } else if (typeof payload.close === "function") { - payload.close(noop); - } else if (typeof payload.abort === "function") { - payload.abort(); - } else { - reply.log.warn("stream payload does not end properly"); - } - } - }); - if (!res.headersSent) { - for (const key in reply[kReplyHeaders]) { - res.setHeader(key, reply[kReplyHeaders][key]); - } - } else { - reply.log.warn("response will send, but you shouldn't use res.writeHead in stream mode"); - } - payload.pipe(res); - } - function sendTrailer(payload, res, reply) { - if (reply[kReplyTrailers] === null) { - res.end(null, null, null); - return; - } - const trailerHeaders = Object.keys(reply[kReplyTrailers]); - const trailers = {}; - let handled = 0; - let skipped = true; - function send() { - if (handled === 0) { - res.addTrailers(trailers); - res.end(null, null, null); - } - } - for (const trailerName of trailerHeaders) { - let cb = function(err, value) { - handled++; - if (err) - reply.log.debug(err); - else - trailers[trailerName] = value; - process.nextTick(send); - }; - if (typeof reply[kReplyTrailers][trailerName] !== "function") - continue; - skipped = false; - handled--; - const result = reply[kReplyTrailers][trailerName](reply, payload, cb); - if (typeof result === "object" && typeof result.then === "function") { - result.then((v) => cb(null, v), cb); - } - } - if (skipped) - res.end(null, null, null); - } - function sendStreamTrailer(payload, res, reply) { - if (reply[kReplyTrailers] === null) - return; - payload.on("end", () => sendTrailer(null, res, reply)); - } - function onErrorHook(reply, error, cb) { - if (reply[kRouteContext].onError !== null && !reply[kReplyNextErrorHandler]) { - reply[kReplyIsRunningOnErrorHook] = true; - onSendHookRunner( - reply[kRouteContext].onError, - reply.request, - reply, - error, - () => handleError(reply, error, cb) - ); - } else { - handleError(reply, error, cb); - } - } - function setupResponseListeners(reply) { - reply[kReplyStartTime] = now(); - const onResFinished = (err) => { - reply[kReplyEndTime] = now(); - reply.raw.removeListener("finish", onResFinished); - reply.raw.removeListener("error", onResFinished); - const ctx = reply[kRouteContext]; - if (reply.request[kRequestSignal]) { - clearTimeout(reply.request[kTimeoutTimer]); - reply.request[kTimeoutTimer] = null; - if (reply.request[kOnAbort]) { - reply.request.raw.removeListener("close", reply.request[kOnAbort]); - reply.request[kOnAbort] = null; - } - } - if (ctx && ctx.onResponse !== null) { - onResponseHookRunner( - ctx.onResponse, - reply.request, - reply, - onResponseCallback - ); - } else { - onResponseCallback(err, reply.request, reply); - } - }; - reply.raw.on("finish", onResFinished); - reply.raw.on("error", onResFinished); - } - function onResponseCallback(err, request, reply) { - if (reply.log[kDisableRequestLogging]) { - return; - } - const responseTime = reply.elapsedTime; - if (err != null) { - reply.log.error({ - res: reply, - err, - responseTime - }, "request errored"); - return; - } - reply.log.info({ - res: reply, - responseTime - }, "request completed"); - } - function buildReply(R) { - const props = R.props.slice(); - function _Reply(res, request, log) { - this.raw = res; - this[kReplyIsError] = false; - this[kReplyErrorHandlerCalled] = false; - this[kReplyHijacked] = false; - this[kReplySerializer] = null; - this.request = request; - this[kReplyHeaders] = {}; - this[kReplyTrailers] = null; - this[kReplyStartTime] = void 0; - this[kReplyEndTime] = void 0; - this.log = log; - let prop; - for (let i = 0; i < props.length; i++) { - prop = props[i]; - this[prop.key] = prop.value; - } - } - Object.setPrototypeOf(_Reply.prototype, R.prototype); - Object.setPrototypeOf(_Reply, R); - _Reply.parent = R; - _Reply.props = props; - return _Reply; - } - function notFound(reply) { - if (reply[kRouteContext][kFourOhFourContext] === null) { - reply.log.warn("Trying to send a NotFound error inside a 404 handler. Sending basic 404 response."); - reply.code(404).send("404 Not Found"); - return; - } - reply.request[kRouteContext] = reply[kRouteContext][kFourOhFourContext]; - if (reply[kRouteContext].preHandler !== null) { - preHandlerHookRunner( - reply[kRouteContext].preHandler, - reply.request, - reply, - internals.preHandlerCallback - ); - } else { - internals.preHandlerCallback(null, reply.request, reply); - } - } - function serialize2(context, data, statusCode, contentType) { - const fnSerialize = getSchemaSerializer(context, statusCode, contentType); - if (fnSerialize) { - return fnSerialize(data); - } - return JSON.stringify(data); - } - function noop() { - } - module2.exports = Reply; - module2.exports.buildReply = buildReply; - module2.exports.setupResponseListeners = setupResponseListeners; - } -}); - -// ../../node_modules/.pnpm/@fastify+forwarded@3.0.1/node_modules/@fastify/forwarded/index.js -var require_forwarded = __commonJS({ - "../../node_modules/.pnpm/@fastify+forwarded@3.0.1/node_modules/@fastify/forwarded/index.js"(exports2, module2) { - "use strict"; - function forwarded(req) { - if (!req) { - throw new TypeError("argument req is required"); - } - const header = req.headers["x-forwarded-for"]; - const socketAddr = req.socket.remoteAddress; - if (!header || typeof header !== "string") { - return [socketAddr]; - } else if (header.indexOf(",") === -1) { - const remote = header.trim(); - return remote.length ? [socketAddr, remote] : [socketAddr]; - } else { - return parse2(header, socketAddr); - } - } - function parse2(header, socketAddr) { - const result = [socketAddr]; - let end = header.length; - let start = end; - let char; - let i; - for (i = end - 1; i >= 0; --i) { - char = header[i]; - if (char === " ") { - start === end && (start = end = i); - } else if (char === ",") { - start !== end && result.push(header.slice(start, end)); - start = end = i; - } else { - start = i; - } - } - start !== end && result.push(header.substring(start, end)); - return result; - } - module2.exports = forwarded; - module2.exports.default = forwarded; - module2.exports.forwarded = forwarded; - } -}); - -// ../../node_modules/.pnpm/ipaddr.js@2.3.0/node_modules/ipaddr.js/lib/ipaddr.js -var require_ipaddr = __commonJS({ - "../../node_modules/.pnpm/ipaddr.js@2.3.0/node_modules/ipaddr.js/lib/ipaddr.js"(exports2, module2) { - (function(root) { - "use strict"; - const ipv4Part = "(0?\\d+|0x[a-f0-9]+)"; - const ipv4Regexes = { - fourOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, "i"), - threeOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}$`, "i"), - twoOctet: new RegExp(`^${ipv4Part}\\.${ipv4Part}$`, "i"), - longValue: new RegExp(`^${ipv4Part}$`, "i") - }; - const octalRegex = new RegExp(`^0[0-7]+$`, "i"); - const hexRegex = new RegExp(`^0x[a-f0-9]+$`, "i"); - const zoneIndex = "%[0-9a-z]{1,}"; - const ipv6Part = "(?:[0-9a-f]+::?)+"; - const ipv6Regexes = { - zoneIndex: new RegExp(zoneIndex, "i"), - "native": new RegExp(`^(::)?(${ipv6Part})?([0-9a-f]+)?(::)?(${zoneIndex})?$`, "i"), - deprecatedTransitional: new RegExp(`^(?:::)(${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?)$`, "i"), - transitional: new RegExp(`^((?:${ipv6Part})|(?:::)(?:${ipv6Part})?)${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}\\.${ipv4Part}(${zoneIndex})?$`, "i") - }; - function expandIPv6(string2, parts) { - if (string2.indexOf("::") !== string2.lastIndexOf("::")) { - return null; - } - let colonCount = 0; - let lastColon = -1; - let zoneId = (string2.match(ipv6Regexes.zoneIndex) || [])[0]; - let replacement, replacementCount; - if (zoneId) { - zoneId = zoneId.substring(1); - string2 = string2.replace(/%.+$/, ""); - } - while ((lastColon = string2.indexOf(":", lastColon + 1)) >= 0) { - colonCount++; - } - if (string2.substr(0, 2) === "::") { - colonCount--; - } - if (string2.substr(-2, 2) === "::") { - colonCount--; - } - if (colonCount > parts) { - return null; - } - replacementCount = parts - colonCount; - replacement = ":"; - while (replacementCount--) { - replacement += "0:"; - } - string2 = string2.replace("::", replacement); - if (string2[0] === ":") { - string2 = string2.slice(1); - } - if (string2[string2.length - 1] === ":") { - string2 = string2.slice(0, -1); - } - parts = function() { - const ref = string2.split(":"); - const results = []; - for (let i = 0; i < ref.length; i++) { - results.push(parseInt(ref[i], 16)); - } - return results; - }(); - return { - parts, - zoneId - }; - } - function matchCIDR(first, second, partSize, cidrBits) { - if (first.length !== second.length) { - throw new Error("ipaddr: cannot match CIDR for objects with different lengths"); - } - let part = 0; - let shift; - while (cidrBits > 0) { - shift = partSize - cidrBits; - if (shift < 0) { - shift = 0; - } - if (first[part] >> shift !== second[part] >> shift) { - return false; - } - cidrBits -= partSize; - part += 1; - } - return true; - } - function parseIntAuto(string2) { - if (hexRegex.test(string2)) { - return parseInt(string2, 16); - } - if (string2[0] === "0" && !isNaN(parseInt(string2[1], 10))) { - if (octalRegex.test(string2)) { - return parseInt(string2, 8); - } - throw new Error(`ipaddr: cannot parse ${string2} as octal`); - } - return parseInt(string2, 10); - } - function padPart(part, length) { - while (part.length < length) { - part = `0${part}`; - } - return part; - } - const ipaddr = {}; - ipaddr.IPv4 = function() { - function IPv4(octets) { - if (octets.length !== 4) { - throw new Error("ipaddr: ipv4 octet count should be 4"); - } - let i, octet; - for (i = 0; i < octets.length; i++) { - octet = octets[i]; - if (!(0 <= octet && octet <= 255)) { - throw new Error("ipaddr: ipv4 octet should fit in 8 bits"); - } - } - this.octets = octets; - } - IPv4.prototype.SpecialRanges = { - unspecified: [[new IPv4([0, 0, 0, 0]), 8]], - broadcast: [[new IPv4([255, 255, 255, 255]), 32]], - // RFC3171 - multicast: [[new IPv4([224, 0, 0, 0]), 4]], - // RFC3927 - linkLocal: [[new IPv4([169, 254, 0, 0]), 16]], - // RFC5735 - loopback: [[new IPv4([127, 0, 0, 0]), 8]], - // RFC6598 - carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]], - // RFC1918 - "private": [ - [new IPv4([10, 0, 0, 0]), 8], - [new IPv4([172, 16, 0, 0]), 12], - [new IPv4([192, 168, 0, 0]), 16] - ], - // Reserved and testing-only ranges; RFCs 5735, 5737, 2544, 1700 - reserved: [ - [new IPv4([192, 0, 0, 0]), 24], - [new IPv4([192, 0, 2, 0]), 24], - [new IPv4([192, 88, 99, 0]), 24], - [new IPv4([198, 18, 0, 0]), 15], - [new IPv4([198, 51, 100, 0]), 24], - [new IPv4([203, 0, 113, 0]), 24], - [new IPv4([240, 0, 0, 0]), 4] - ], - // RFC7534, RFC7535 - as112: [ - [new IPv4([192, 175, 48, 0]), 24], - [new IPv4([192, 31, 196, 0]), 24] - ], - // RFC7450 - amt: [ - [new IPv4([192, 52, 193, 0]), 24] - ] - }; - IPv4.prototype.kind = function() { - return "ipv4"; - }; - IPv4.prototype.match = function(other, cidrRange) { - let ref; - if (cidrRange === void 0) { - ref = other; - other = ref[0]; - cidrRange = ref[1]; - } - if (other.kind() !== "ipv4") { - throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one"); - } - return matchCIDR(this.octets, other.octets, 8, cidrRange); - }; - IPv4.prototype.prefixLengthFromSubnetMask = function() { - let cidr = 0; - let stop = false; - const zerotable = { - 0: 8, - 128: 7, - 192: 6, - 224: 5, - 240: 4, - 248: 3, - 252: 2, - 254: 1, - 255: 0 - }; - let i, octet, zeros; - for (i = 3; i >= 0; i -= 1) { - octet = this.octets[i]; - if (octet in zerotable) { - zeros = zerotable[octet]; - if (stop && zeros !== 0) { - return null; - } - if (zeros !== 8) { - stop = true; - } - cidr += zeros; - } else { - return null; - } - } - return 32 - cidr; - }; - IPv4.prototype.range = function() { - return ipaddr.subnetMatch(this, this.SpecialRanges); - }; - IPv4.prototype.toByteArray = function() { - return this.octets.slice(0); - }; - IPv4.prototype.toIPv4MappedAddress = function() { - return ipaddr.IPv6.parse(`::ffff:${this.toString()}`); - }; - IPv4.prototype.toNormalizedString = function() { - return this.toString(); - }; - IPv4.prototype.toString = function() { - return this.octets.join("."); - }; - return IPv4; - }(); - ipaddr.IPv4.broadcastAddressFromCIDR = function(string2) { - try { - const cidr = this.parseCIDR(string2); - const ipInterfaceOctets = cidr[0].toByteArray(); - const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - const octets = []; - let i = 0; - while (i < 4) { - octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255); - i++; - } - return new this(octets); - } catch (e) { - throw new Error("ipaddr: the address does not have IPv4 CIDR format"); - } - }; - ipaddr.IPv4.isIPv4 = function(string2) { - return this.parser(string2) !== null; - }; - ipaddr.IPv4.isValid = function(string2) { - try { - new this(this.parser(string2)); - return true; - } catch (e) { - return false; - } - }; - ipaddr.IPv4.isValidCIDR = function(string2) { - try { - this.parseCIDR(string2); - return true; - } catch (e) { - return false; - } - }; - ipaddr.IPv4.isValidFourPartDecimal = function(string2) { - if (ipaddr.IPv4.isValid(string2) && string2.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/)) { - return true; - } else { - return false; - } - }; - ipaddr.IPv4.isValidCIDRFourPartDecimal = function(string2) { - const match = string2.match(/^(.+)\/(\d+)$/); - if (!ipaddr.IPv4.isValidCIDR(string2) || !match) { - return false; - } - return ipaddr.IPv4.isValidFourPartDecimal(match[1]); - }; - ipaddr.IPv4.networkAddressFromCIDR = function(string2) { - let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets; - try { - cidr = this.parseCIDR(string2); - ipInterfaceOctets = cidr[0].toByteArray(); - subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - octets = []; - i = 0; - while (i < 4) { - octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)); - i++; - } - return new this(octets); - } catch (e) { - throw new Error("ipaddr: the address does not have IPv4 CIDR format"); - } - }; - ipaddr.IPv4.parse = function(string2) { - const parts = this.parser(string2); - if (parts === null) { - throw new Error("ipaddr: string is not formatted like an IPv4 Address"); - } - return new this(parts); - }; - ipaddr.IPv4.parseCIDR = function(string2) { - let match; - if (match = string2.match(/^(.+)\/(\d+)$/)) { - const maskLength = parseInt(match[2]); - if (maskLength >= 0 && maskLength <= 32) { - const parsed = [this.parse(match[1]), maskLength]; - Object.defineProperty(parsed, "toString", { - value: function() { - return this.join("/"); - } - }); - return parsed; - } - } - throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range"); - }; - ipaddr.IPv4.parser = function(string2) { - let match, part, value; - if (match = string2.match(ipv4Regexes.fourOctet)) { - return function() { - const ref = match.slice(1, 6); - const results = []; - for (let i = 0; i < ref.length; i++) { - part = ref[i]; - results.push(parseIntAuto(part)); - } - return results; - }(); - } else if (match = string2.match(ipv4Regexes.longValue)) { - value = parseIntAuto(match[1]); - if (value > 4294967295 || value < 0) { - throw new Error("ipaddr: address outside defined range"); - } - return function() { - const results = []; - let shift; - for (shift = 0; shift <= 24; shift += 8) { - results.push(value >> shift & 255); - } - return results; - }().reverse(); - } else if (match = string2.match(ipv4Regexes.twoOctet)) { - return function() { - const ref = match.slice(1, 4); - const results = []; - value = parseIntAuto(ref[1]); - if (value > 16777215 || value < 0) { - throw new Error("ipaddr: address outside defined range"); - } - results.push(parseIntAuto(ref[0])); - results.push(value >> 16 & 255); - results.push(value >> 8 & 255); - results.push(value & 255); - return results; - }(); - } else if (match = string2.match(ipv4Regexes.threeOctet)) { - return function() { - const ref = match.slice(1, 5); - const results = []; - value = parseIntAuto(ref[2]); - if (value > 65535 || value < 0) { - throw new Error("ipaddr: address outside defined range"); - } - results.push(parseIntAuto(ref[0])); - results.push(parseIntAuto(ref[1])); - results.push(value >> 8 & 255); - results.push(value & 255); - return results; - }(); - } else { - return null; - } - }; - ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) { - prefix = parseInt(prefix); - if (prefix < 0 || prefix > 32) { - throw new Error("ipaddr: invalid IPv4 prefix length"); - } - const octets = [0, 0, 0, 0]; - let j = 0; - const filledOctetCount = Math.floor(prefix / 8); - while (j < filledOctetCount) { - octets[j] = 255; - j++; - } - if (filledOctetCount < 4) { - octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - prefix % 8; - } - return new this(octets); - }; - ipaddr.IPv6 = function() { - function IPv6(parts, zoneId) { - let i, part; - if (parts.length === 16) { - this.parts = []; - for (i = 0; i <= 14; i += 2) { - this.parts.push(parts[i] << 8 | parts[i + 1]); - } - } else if (parts.length === 8) { - this.parts = parts; - } else { - throw new Error("ipaddr: ipv6 part count should be 8 or 16"); - } - for (i = 0; i < this.parts.length; i++) { - part = this.parts[i]; - if (!(0 <= part && part <= 65535)) { - throw new Error("ipaddr: ipv6 part should fit in 16 bits"); - } - } - if (zoneId) { - this.zoneId = zoneId; - } - } - IPv6.prototype.SpecialRanges = { - // RFC4291, here and after - unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128], - linkLocal: [new IPv6([65152, 0, 0, 0, 0, 0, 0, 0]), 10], - multicast: [new IPv6([65280, 0, 0, 0, 0, 0, 0, 0]), 8], - loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128], - uniqueLocal: [new IPv6([64512, 0, 0, 0, 0, 0, 0, 0]), 7], - ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 65535, 0, 0]), 96], - // RFC6666 - discard: [new IPv6([256, 0, 0, 0, 0, 0, 0, 0]), 64], - // RFC6145 - rfc6145: [new IPv6([0, 0, 0, 0, 65535, 0, 0, 0]), 96], - // RFC6052 - rfc6052: [new IPv6([100, 65435, 0, 0, 0, 0, 0, 0]), 96], - // RFC3056 - "6to4": [new IPv6([8194, 0, 0, 0, 0, 0, 0, 0]), 16], - // RFC6052, RFC6146 - teredo: [new IPv6([8193, 0, 0, 0, 0, 0, 0, 0]), 32], - // RFC5180 - benchmarking: [new IPv6([8193, 2, 0, 0, 0, 0, 0, 0]), 48], - // RFC7450 - amt: [new IPv6([8193, 3, 0, 0, 0, 0, 0, 0]), 32], - as112v6: [ - [new IPv6([8193, 4, 274, 0, 0, 0, 0, 0]), 48], - [new IPv6([9760, 79, 32768, 0, 0, 0, 0, 0]), 48] - ], - deprecated: [new IPv6([8193, 16, 0, 0, 0, 0, 0, 0]), 28], - orchid2: [new IPv6([8193, 32, 0, 0, 0, 0, 0, 0]), 28], - droneRemoteIdProtocolEntityTags: [new IPv6([8193, 48, 0, 0, 0, 0, 0, 0]), 28], - reserved: [ - // RFC3849 - [new IPv6([8193, 0, 0, 0, 0, 0, 0, 0]), 23], - // RFC2928 - [new IPv6([8193, 3512, 0, 0, 0, 0, 0, 0]), 32] - ] - }; - IPv6.prototype.isIPv4MappedAddress = function() { - return this.range() === "ipv4Mapped"; - }; - IPv6.prototype.kind = function() { - return "ipv6"; - }; - IPv6.prototype.match = function(other, cidrRange) { - let ref; - if (cidrRange === void 0) { - ref = other; - other = ref[0]; - cidrRange = ref[1]; - } - if (other.kind() !== "ipv6") { - throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one"); - } - return matchCIDR(this.parts, other.parts, 16, cidrRange); - }; - IPv6.prototype.prefixLengthFromSubnetMask = function() { - let cidr = 0; - let stop = false; - const zerotable = { - 0: 16, - 32768: 15, - 49152: 14, - 57344: 13, - 61440: 12, - 63488: 11, - 64512: 10, - 65024: 9, - 65280: 8, - 65408: 7, - 65472: 6, - 65504: 5, - 65520: 4, - 65528: 3, - 65532: 2, - 65534: 1, - 65535: 0 - }; - let part, zeros; - for (let i = 7; i >= 0; i -= 1) { - part = this.parts[i]; - if (part in zerotable) { - zeros = zerotable[part]; - if (stop && zeros !== 0) { - return null; - } - if (zeros !== 16) { - stop = true; - } - cidr += zeros; - } else { - return null; - } - } - return 128 - cidr; - }; - IPv6.prototype.range = function() { - return ipaddr.subnetMatch(this, this.SpecialRanges); - }; - IPv6.prototype.toByteArray = function() { - let part; - const bytes = []; - const ref = this.parts; - for (let i = 0; i < ref.length; i++) { - part = ref[i]; - bytes.push(part >> 8); - bytes.push(part & 255); - } - return bytes; - }; - IPv6.prototype.toFixedLengthString = function() { - const addr = function() { - const results = []; - for (let i = 0; i < this.parts.length; i++) { - results.push(padPart(this.parts[i].toString(16), 4)); - } - return results; - }.call(this).join(":"); - let suffix = ""; - if (this.zoneId) { - suffix = `%${this.zoneId}`; - } - return addr + suffix; - }; - IPv6.prototype.toIPv4Address = function() { - if (!this.isIPv4MappedAddress()) { - throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4"); - } - const ref = this.parts.slice(-2); - const high = ref[0]; - const low = ref[1]; - return new ipaddr.IPv4([high >> 8, high & 255, low >> 8, low & 255]); - }; - IPv6.prototype.toNormalizedString = function() { - const addr = function() { - const results = []; - for (let i = 0; i < this.parts.length; i++) { - results.push(this.parts[i].toString(16)); - } - return results; - }.call(this).join(":"); - let suffix = ""; - if (this.zoneId) { - suffix = `%${this.zoneId}`; - } - return addr + suffix; - }; - IPv6.prototype.toRFC5952String = function() { - const regex = /((^|:)(0(:|$)){2,})/g; - const string2 = this.toNormalizedString(); - let bestMatchIndex = 0; - let bestMatchLength = -1; - let match; - while (match = regex.exec(string2)) { - if (match[0].length > bestMatchLength) { - bestMatchIndex = match.index; - bestMatchLength = match[0].length; - } - } - if (bestMatchLength < 0) { - return string2; - } - return `${string2.substring(0, bestMatchIndex)}::${string2.substring(bestMatchIndex + bestMatchLength)}`; - }; - IPv6.prototype.toString = function() { - return this.toRFC5952String(); - }; - return IPv6; - }(); - ipaddr.IPv6.broadcastAddressFromCIDR = function(string2) { - try { - const cidr = this.parseCIDR(string2); - const ipInterfaceOctets = cidr[0].toByteArray(); - const subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - const octets = []; - let i = 0; - while (i < 16) { - octets.push(parseInt(ipInterfaceOctets[i], 10) | parseInt(subnetMaskOctets[i], 10) ^ 255); - i++; - } - return new this(octets); - } catch (e) { - throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`); - } - }; - ipaddr.IPv6.isIPv6 = function(string2) { - return this.parser(string2) !== null; - }; - ipaddr.IPv6.isValid = function(string2) { - if (typeof string2 === "string" && string2.indexOf(":") === -1) { - return false; - } - try { - const addr = this.parser(string2); - new this(addr.parts, addr.zoneId); - return true; - } catch (e) { - return false; - } - }; - ipaddr.IPv6.isValidCIDR = function(string2) { - if (typeof string2 === "string" && string2.indexOf(":") === -1) { - return false; - } - try { - this.parseCIDR(string2); - return true; - } catch (e) { - return false; - } - }; - ipaddr.IPv6.networkAddressFromCIDR = function(string2) { - let cidr, i, ipInterfaceOctets, octets, subnetMaskOctets; - try { - cidr = this.parseCIDR(string2); - ipInterfaceOctets = cidr[0].toByteArray(); - subnetMaskOctets = this.subnetMaskFromPrefixLength(cidr[1]).toByteArray(); - octets = []; - i = 0; - while (i < 16) { - octets.push(parseInt(ipInterfaceOctets[i], 10) & parseInt(subnetMaskOctets[i], 10)); - i++; - } - return new this(octets); - } catch (e) { - throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${e})`); - } - }; - ipaddr.IPv6.parse = function(string2) { - const addr = this.parser(string2); - if (addr.parts === null) { - throw new Error("ipaddr: string is not formatted like an IPv6 Address"); - } - return new this(addr.parts, addr.zoneId); - }; - ipaddr.IPv6.parseCIDR = function(string2) { - let maskLength, match, parsed; - if (match = string2.match(/^(.+)\/(\d+)$/)) { - maskLength = parseInt(match[2]); - if (maskLength >= 0 && maskLength <= 128) { - parsed = [this.parse(match[1]), maskLength]; - Object.defineProperty(parsed, "toString", { - value: function() { - return this.join("/"); - } - }); - return parsed; - } - } - throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range"); - }; - ipaddr.IPv6.parser = function(string2) { - let addr, i, match, octet, octets, zoneId; - if (match = string2.match(ipv6Regexes.deprecatedTransitional)) { - return this.parser(`::ffff:${match[1]}`); - } - if (ipv6Regexes.native.test(string2)) { - return expandIPv6(string2, 8); - } - if (match = string2.match(ipv6Regexes.transitional)) { - zoneId = match[6] || ""; - addr = match[1]; - if (!match[1].endsWith("::")) { - addr = addr.slice(0, -1); - } - addr = expandIPv6(addr + zoneId, 6); - if (addr.parts) { - octets = [ - parseInt(match[2]), - parseInt(match[3]), - parseInt(match[4]), - parseInt(match[5]) - ]; - for (i = 0; i < octets.length; i++) { - octet = octets[i]; - if (!(0 <= octet && octet <= 255)) { - return null; - } - } - addr.parts.push(octets[0] << 8 | octets[1]); - addr.parts.push(octets[2] << 8 | octets[3]); - return { - parts: addr.parts, - zoneId: addr.zoneId - }; - } - } - return null; - }; - ipaddr.IPv6.subnetMaskFromPrefixLength = function(prefix) { - prefix = parseInt(prefix); - if (prefix < 0 || prefix > 128) { - throw new Error("ipaddr: invalid IPv6 prefix length"); - } - const octets = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - let j = 0; - const filledOctetCount = Math.floor(prefix / 8); - while (j < filledOctetCount) { - octets[j] = 255; - j++; - } - if (filledOctetCount < 16) { - octets[filledOctetCount] = Math.pow(2, prefix % 8) - 1 << 8 - prefix % 8; - } - return new this(octets); - }; - ipaddr.fromByteArray = function(bytes) { - const length = bytes.length; - if (length === 4) { - return new ipaddr.IPv4(bytes); - } else if (length === 16) { - return new ipaddr.IPv6(bytes); - } else { - throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address"); - } - }; - ipaddr.isValid = function(string2) { - return ipaddr.IPv6.isValid(string2) || ipaddr.IPv4.isValid(string2); - }; - ipaddr.isValidCIDR = function(string2) { - return ipaddr.IPv6.isValidCIDR(string2) || ipaddr.IPv4.isValidCIDR(string2); - }; - ipaddr.parse = function(string2) { - if (ipaddr.IPv6.isValid(string2)) { - return ipaddr.IPv6.parse(string2); - } else if (ipaddr.IPv4.isValid(string2)) { - return ipaddr.IPv4.parse(string2); - } else { - throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format"); - } - }; - ipaddr.parseCIDR = function(string2) { - try { - return ipaddr.IPv6.parseCIDR(string2); - } catch (e) { - try { - return ipaddr.IPv4.parseCIDR(string2); - } catch (e2) { - throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format"); - } - } - }; - ipaddr.process = function(string2) { - const addr = this.parse(string2); - if (addr.kind() === "ipv6" && addr.isIPv4MappedAddress()) { - return addr.toIPv4Address(); - } else { - return addr; - } - }; - ipaddr.subnetMatch = function(address, rangeList, defaultName) { - let i, rangeName, rangeSubnets, subnet; - if (defaultName === void 0 || defaultName === null) { - defaultName = "unicast"; - } - for (rangeName in rangeList) { - if (Object.prototype.hasOwnProperty.call(rangeList, rangeName)) { - rangeSubnets = rangeList[rangeName]; - if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) { - rangeSubnets = [rangeSubnets]; - } - for (i = 0; i < rangeSubnets.length; i++) { - subnet = rangeSubnets[i]; - if (address.kind() === subnet[0].kind() && address.match.apply(address, subnet)) { - return rangeName; - } - } - } - } - return defaultName; - }; - if (typeof module2 !== "undefined" && module2.exports) { - module2.exports = ipaddr; - } else { - root.ipaddr = ipaddr; - } - })(exports2); - } -}); - -// ../../node_modules/.pnpm/@fastify+proxy-addr@5.1.0/node_modules/@fastify/proxy-addr/index.js -var require_proxy_addr = __commonJS({ - "../../node_modules/.pnpm/@fastify+proxy-addr@5.1.0/node_modules/@fastify/proxy-addr/index.js"(exports2, module2) { - "use strict"; - module2.exports = proxyaddr; - module2.exports.default = proxyaddr; - module2.exports.proxyaddr = proxyaddr; - module2.exports.all = alladdrs; - module2.exports.compile = compile; - var forwarded = require_forwarded(); - var ipaddr = require_ipaddr(); - var DIGIT_REGEXP = /^\d+$/u; - var isip = ipaddr.isValid; - var parseip = ipaddr.parse; - var IP_RANGES = { - linklocal: ["169.254.0.0/16", "fe80::/10"], - loopback: ["127.0.0.1/8", "::1/128"], - uniquelocal: ["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "fc00::/7"] - }; - function alladdrs(req, trust) { - const addrs = forwarded(req); - if (!trust) { - return addrs; - } - if (typeof trust !== "function") { - trust = compile(trust); - } - for (let i = 0; i < addrs.length - 1; i++) { - if (trust(addrs[i], i)) - continue; - addrs.length = i + 1; - } - return addrs; - } - function compile(val) { - if (!val) { - throw new TypeError("argument is required"); - } - let trust; - if (typeof val === "string") { - trust = [val]; - } else if (Array.isArray(val)) { - trust = val.slice(); - } else { - throw new TypeError("unsupported trust argument"); - } - for (let i = 0; i < trust.length; i++) { - val = trust[i]; - if (!Object.hasOwn(IP_RANGES, val)) { - continue; - } - val = IP_RANGES[val]; - trust.splice.apply(trust, [i, 1].concat(val)); - i += val.length - 1; - } - return compileTrust(compileRangeSubnets(trust)); - } - function compileRangeSubnets(arr) { - const rangeSubnets = new Array(arr.length); - for (let i = 0; i < arr.length; i++) { - rangeSubnets[i] = parseipNotation(arr[i]); - } - return rangeSubnets; - } - function compileTrust(rangeSubnets) { - const len = rangeSubnets.length; - return len === 0 ? trustNone : len === 1 ? trustSingle(rangeSubnets[0]) : trustMulti(rangeSubnets); - } - function parseipNotation(note) { - const pos = note.lastIndexOf("/"); - const str = pos !== -1 ? note.substring(0, pos) : note; - if (!isip(str)) { - throw new TypeError("invalid IP address: " + str); - } - let ip = parseip(str); - if (pos === -1 && ip.kind() === "ipv6" && ip.isIPv4MappedAddress()) { - ip = ip.toIPv4Address(); - } - const max = ip.kind() === "ipv6" ? 128 : 32; - let range = pos !== -1 ? note.substring(pos + 1, note.length) : null; - if (range === null) { - range = max; - } else if (DIGIT_REGEXP.test(range)) { - range = parseInt(range, 10); - } else if (ip.kind() === "ipv4" && isip(range)) { - range = parseNetmask(range); - } else { - range = null; - } - if (range <= 0 || range > max) { - throw new TypeError("invalid range on address: " + note); - } - return [ip, range]; - } - function parseNetmask(netmask) { - const ip = parseip(netmask); - const kind = ip.kind(); - return kind === "ipv4" ? ip.prefixLengthFromSubnetMask() : null; - } - function proxyaddr(req, trust) { - if (!req) { - throw new TypeError("req argument is required"); - } - if (!trust) { - throw new TypeError("trust argument is required"); - } - const addrs = alladdrs(req, trust); - return addrs[addrs.length - 1]; - } - function trustNone() { - return false; - } - function trustMulti(subnets) { - return function trust(addr) { - if (!isip(addr)) - return false; - const ip = parseip(addr); - let ipconv; - const kind = ip.kind(); - for (let i = 0; i < subnets.length; i++) { - const subnet = subnets[i]; - const subnetip = subnet[0]; - const subnetkind = subnetip.kind(); - const subnetrange = subnet[1]; - let trusted = ip; - if (kind !== subnetkind) { - const subnetisipv4 = subnetkind === "ipv4"; - if (subnetisipv4 && !ip.isIPv4MappedAddress()) { - continue; - } - if (!ipconv) { - ipconv = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress(); - } - trusted = ipconv; - } - if (trusted.match(subnetip, subnetrange)) { - return true; - } - } - return false; - }; - } - function trustSingle(subnet) { - const subnetip = subnet[0]; - const subnetkind = subnetip.kind(); - const subnetisipv4 = subnetkind === "ipv4"; - const subnetrange = subnet[1]; - return function trust(addr) { - if (!isip(addr)) - return false; - let ip = parseip(addr); - const kind = ip.kind(); - if (kind !== subnetkind) { - if (subnetisipv4 && !ip.isIPv4MappedAddress()) { - return false; - } - ip = subnetisipv4 ? ip.toIPv4Address() : ip.toIPv4MappedAddress(); - } - return ip.match(subnetip, subnetrange); - }; - } - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/request.js -var require_request = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/request.js"(exports2, module2) { - "use strict"; - var proxyAddr = require_proxy_addr(); - var { - kHasBeenDecorated, - kSchemaBody, - kSchemaHeaders, - kSchemaParams, - kSchemaQuerystring, - kSchemaController, - kOptions, - kRequestCacheValidateFns, - kRouteContext, - kRequestOriginalUrl, - kRequestSignal, - kOnAbort - } = require_symbols2(); - var { FST_ERR_REQ_INVALID_VALIDATION_INVOCATION, FST_ERR_DEC_UNDECLARED } = require_errors2(); - var decorators = require_decorate(); - var HTTP_PART_SYMBOL_MAP = { - body: kSchemaBody, - headers: kSchemaHeaders, - params: kSchemaParams, - querystring: kSchemaQuerystring, - query: kSchemaQuerystring - }; - function Request2(id, params, req, query, log, context) { - this.id = id; - this[kRouteContext] = context; - this.params = params; - this.raw = req; - this.query = query; - this.log = log; - this.body = void 0; - } - Request2.props = []; - function getTrustProxyFn(tp) { - if (typeof tp === "function") { - return tp; - } - if (tp === true) { - return function() { - return true; - }; - } - if (typeof tp === "number") { - return function(a, i) { - return i < tp; - }; - } - if (typeof tp === "string") { - const values = tp.split(",").map((it) => it.trim()); - return proxyAddr.compile(values); - } - return proxyAddr.compile(tp); - } - function buildRequest(R, trustProxy) { - if (trustProxy) { - return buildRequestWithTrustProxy(R, trustProxy); - } - return buildRegularRequest(R); - } - function buildRegularRequest(R) { - const props = R.props.slice(); - function _Request(id, params, req, query, log, context) { - this.id = id; - this[kRouteContext] = context; - this.params = params; - this.raw = req; - this.query = query; - this.log = log; - this.body = void 0; - let prop; - for (let i = 0; i < props.length; i++) { - prop = props[i]; - this[prop.key] = prop.value; - } - } - Object.setPrototypeOf(_Request.prototype, R.prototype); - Object.setPrototypeOf(_Request, R); - _Request.props = props; - _Request.parent = R; - return _Request; - } - function getLastEntryInMultiHeaderValue(headerValue) { - const lastIndex = headerValue.lastIndexOf(","); - return lastIndex === -1 ? headerValue.trim() : headerValue.slice(lastIndex + 1).trim(); - } - function buildRequestWithTrustProxy(R, trustProxy) { - const _Request = buildRegularRequest(R); - const proxyFn = getTrustProxyFn(trustProxy); - _Request[kHasBeenDecorated] = true; - Object.defineProperties(_Request.prototype, { - ip: { - get() { - const addrs = proxyAddr.all(this.raw, proxyFn); - return addrs[addrs.length - 1]; - } - }, - ips: { - get() { - return proxyAddr.all(this.raw, proxyFn); - } - }, - host: { - get() { - const socketAddr = this.raw.socket?.remoteAddress; - if (this.headers["x-forwarded-host"] && socketAddr !== null && proxyFn(socketAddr, 0)) { - return getLastEntryInMultiHeaderValue(this.headers["x-forwarded-host"]); - } - return this.headers.host ?? this.headers[":authority"] ?? ""; - } - }, - protocol: { - get() { - const socketAddr = this.raw.socket?.remoteAddress; - if (this.headers["x-forwarded-proto"] && socketAddr !== null && proxyFn(socketAddr, 0)) { - return getLastEntryInMultiHeaderValue(this.headers["x-forwarded-proto"]); - } - if (this.socket) { - return this.socket.encrypted ? "https" : "http"; - } - } - } - }); - return _Request; - } - function assertsRequestDecoration(request, name) { - if (!decorators.hasKey(request, name) && !decorators.exist(request, name)) { - throw new FST_ERR_DEC_UNDECLARED(name, "request"); - } - } - Object.defineProperties(Request2.prototype, { - server: { - get() { - return this[kRouteContext].server; - } - }, - url: { - get() { - return this.raw.url; - } - }, - originalUrl: { - get() { - if (!this[kRequestOriginalUrl]) { - this[kRequestOriginalUrl] = this.raw.originalUrl || this.raw.url; - } - return this[kRequestOriginalUrl]; - } - }, - method: { - get() { - return this.raw.method; - } - }, - routeOptions: { - get() { - const context = this[kRouteContext]; - const routeLimit = context._parserOptions.limit; - const serverLimit = context.server.initialConfig.bodyLimit; - const version2 = context.server.hasConstraintStrategy("version") ? this.raw.headers["accept-version"] : void 0; - const options = { - method: context.config?.method, - url: context.config?.url, - bodyLimit: routeLimit || serverLimit, - handlerTimeout: context.handlerTimeout, - attachValidation: context.attachValidation, - logLevel: context.logLevel, - exposeHeadRoute: context.exposeHeadRoute, - prefixTrailingSlash: context.prefixTrailingSlash, - handler: context.handler, - config: context.config, - schema: context.schema, - version: version2 - }; - return options; - } - }, - is404: { - get() { - return this[kRouteContext].config?.url === void 0; - } - }, - socket: { - get() { - return this.raw.socket; - } - }, - signal: { - get() { - let ac = this[kRequestSignal]; - if (ac) - return ac.signal; - ac = new AbortController(); - this[kRequestSignal] = ac; - const onAbort = () => { - if (!ac.signal.aborted) - ac.abort(); - }; - this.raw.on("close", onAbort); - this[kOnAbort] = onAbort; - return ac.signal; - } - }, - ip: { - get() { - if (this.socket) { - return this.socket.remoteAddress; - } - } - }, - host: { - get() { - return this.raw.headers.host ?? this.raw.headers[":authority"] ?? ""; - } - }, - hostname: { - get() { - if (this.host[0] === "[") { - return this.host.slice(0, this.host.indexOf("]") + 1); - } - return this.host.split(":", 1)[0]; - } - }, - port: { - get() { - const portReg = /(?:\d+)$/; - const host = this.headers.host ?? this.headers[":authority"] ?? ""; - const matches = portReg.exec(host); - if (matches === null || matches[1] === void 0) { - return null; - } - return parseInt(matches.groups.port.slice(1), 10); - } - }, - protocol: { - get() { - if (this.socket) { - return this.socket.encrypted ? "https" : "http"; - } - } - }, - headers: { - get() { - if (this.additionalHeaders) { - return Object.assign({}, this.raw.headers, this.additionalHeaders); - } - return this.raw.headers; - }, - set(headers) { - this.additionalHeaders = headers; - } - }, - getValidationFunction: { - value: function(httpPartOrSchema) { - if (typeof httpPartOrSchema === "string") { - const symbol = HTTP_PART_SYMBOL_MAP[httpPartOrSchema]; - return this[kRouteContext][symbol]; - } else if (typeof httpPartOrSchema === "object") { - return this[kRouteContext][kRequestCacheValidateFns]?.get(httpPartOrSchema); - } - } - }, - compileValidationSchema: { - value: function(schema, httpPart = null) { - const { method, url } = this; - if (this[kRouteContext][kRequestCacheValidateFns]?.has(schema)) { - return this[kRouteContext][kRequestCacheValidateFns].get(schema); - } - const validatorCompiler = this[kRouteContext].validatorCompiler || this.server[kSchemaController].validatorCompiler || // We compile the schemas if no custom validatorCompiler is provided - // nor set - (this.server[kSchemaController].setupValidator(this.server[kOptions]) || this.server[kSchemaController].validatorCompiler); - const validateFn = validatorCompiler({ - schema, - method, - url, - httpPart - }); - if (this[kRouteContext][kRequestCacheValidateFns] == null) { - this[kRouteContext][kRequestCacheValidateFns] = /* @__PURE__ */ new WeakMap(); - } - this[kRouteContext][kRequestCacheValidateFns].set(schema, validateFn); - return validateFn; - } - }, - validateInput: { - value: function(input, schema, httpPart) { - httpPart = typeof schema === "string" ? schema : httpPart; - const symbol = httpPart != null && typeof httpPart === "string" && HTTP_PART_SYMBOL_MAP[httpPart]; - let validate3; - if (symbol) { - validate3 = this[kRouteContext][symbol]; - } - if (validate3 == null && (schema == null || typeof schema !== "object" || Array.isArray(schema))) { - throw new FST_ERR_REQ_INVALID_VALIDATION_INVOCATION(httpPart); - } - if (validate3 == null) { - if (this[kRouteContext][kRequestCacheValidateFns]?.has(schema)) { - validate3 = this[kRouteContext][kRequestCacheValidateFns].get(schema); - } else { - validate3 = this.compileValidationSchema(schema, httpPart); - } - } - return validate3(input); - } - }, - getDecorator: { - value: function(name) { - assertsRequestDecoration(this, name); - const decorator = this[name]; - if (typeof decorator === "function") { - return decorator.bind(this); - } - return decorator; - } - }, - setDecorator: { - value: function(name, value) { - assertsRequestDecoration(this, name); - this[name] = value; - } - } - }); - module2.exports = Request2; - module2.exports.buildRequest = buildRequest; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/context.js -var require_context = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/context.js"(exports2, module2) { - "use strict"; - var { - kFourOhFourContext, - kReplySerializerDefault, - kSchemaErrorFormatter, - kErrorHandler, - kChildLoggerFactory, - kOptions, - kReply, - kRequest, - kBodyLimit, - kLogLevel, - kContentTypeParser, - kRouteByFastify, - kRequestCacheValidateFns, - kReplyCacheSerializeFns, - kHandlerTimeout - } = require_symbols2(); - function Context({ - schema, - handler, - config, - requestIdLogLabel, - childLoggerFactory, - errorHandler, - bodyLimit, - logLevel, - logSerializers, - attachValidation, - validatorCompiler, - serializerCompiler, - replySerializer, - schemaErrorFormatter, - exposeHeadRoute, - prefixTrailingSlash, - server, - isFastify, - handlerTimeout - }) { - this.schema = schema; - this.handler = handler; - this.Reply = server[kReply]; - this.Request = server[kRequest]; - this.contentTypeParser = server[kContentTypeParser]; - this.onRequest = null; - this.onSend = null; - this.onError = null; - this.onTimeout = null; - this.preHandler = null; - this.onResponse = null; - this.preSerialization = null; - this.onRequestAbort = null; - this.config = config; - this.errorHandler = errorHandler || server[kErrorHandler]; - this.requestIdLogLabel = requestIdLogLabel || server[kOptions].requestIdLogLabel; - this.childLoggerFactory = childLoggerFactory || server[kChildLoggerFactory]; - this._middie = null; - this._parserOptions = { - limit: bodyLimit || server[kBodyLimit] - }; - this.exposeHeadRoute = exposeHeadRoute; - this.prefixTrailingSlash = prefixTrailingSlash; - this.logLevel = logLevel || server[kLogLevel]; - this.logSerializers = logSerializers; - this[kFourOhFourContext] = null; - this.attachValidation = attachValidation; - this[kReplySerializerDefault] = replySerializer; - this.schemaErrorFormatter = schemaErrorFormatter || server[kSchemaErrorFormatter] || defaultSchemaErrorFormatter; - this[kRouteByFastify] = isFastify; - this[kRequestCacheValidateFns] = null; - this[kReplyCacheSerializeFns] = null; - this.validatorCompiler = validatorCompiler || null; - this.serializerCompiler = serializerCompiler || null; - this.handlerTimeout = handlerTimeout || server[kHandlerTimeout] || 0; - this.server = server; - } - function defaultSchemaErrorFormatter(errors, dataVar) { - let text = ""; - const separator = ", "; - for (let i = 0; i !== errors.length; ++i) { - const e = errors[i]; - text += dataVar + (e.instancePath || "") + " " + e.message + separator; - } - return new Error(text.slice(0, -separator.length)); - } - module2.exports = Context; - } -}); - -// ../../node_modules/.pnpm/toad-cache@3.7.0/node_modules/toad-cache/dist/toad-cache.cjs -var require_toad_cache = __commonJS({ - "../../node_modules/.pnpm/toad-cache@3.7.0/node_modules/toad-cache/dist/toad-cache.cjs"(exports2) { - "use strict"; - var FifoMap = class { - constructor(max = 1e3, ttlInMsecs = 0) { - if (isNaN(max) || max < 0) { - throw new Error("Invalid max value"); - } - if (isNaN(ttlInMsecs) || ttlInMsecs < 0) { - throw new Error("Invalid ttl value"); - } - this.first = null; - this.items = /* @__PURE__ */ new Map(); - this.last = null; - this.max = max; - this.ttl = ttlInMsecs; - } - get size() { - return this.items.size; - } - clear() { - this.items = /* @__PURE__ */ new Map(); - this.first = null; - this.last = null; - } - delete(key) { - if (this.items.has(key)) { - const deletedItem = this.items.get(key); - this.items.delete(key); - if (deletedItem.prev !== null) { - deletedItem.prev.next = deletedItem.next; - } - if (deletedItem.next !== null) { - deletedItem.next.prev = deletedItem.prev; - } - if (this.first === deletedItem) { - this.first = deletedItem.next; - } - if (this.last === deletedItem) { - this.last = deletedItem.prev; - } - } - } - deleteMany(keys) { - for (var i = 0; i < keys.length; i++) { - this.delete(keys[i]); - } - } - evict() { - if (this.size > 0) { - const item = this.first; - this.items.delete(item.key); - if (this.size === 0) { - this.first = null; - this.last = null; - } else { - this.first = item.next; - this.first.prev = null; - } - } - } - expiresAt(key) { - if (this.items.has(key)) { - return this.items.get(key).expiry; - } - } - get(key) { - if (this.items.has(key)) { - const item = this.items.get(key); - if (this.ttl > 0 && item.expiry <= Date.now()) { - this.delete(key); - return; - } - return item.value; - } - } - getMany(keys) { - const result = []; - for (var i = 0; i < keys.length; i++) { - result.push(this.get(keys[i])); - } - return result; - } - keys() { - return this.items.keys(); - } - set(key, value) { - if (this.items.has(key)) { - const item2 = this.items.get(key); - item2.value = value; - item2.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl; - return; - } - if (this.max > 0 && this.size === this.max) { - this.evict(); - } - const item = { - expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl, - key, - prev: this.last, - next: null, - value - }; - this.items.set(key, item); - if (this.size === 1) { - this.first = item; - } else { - this.last.next = item; - } - this.last = item; - } - }; - var LruMap = class { - constructor(max = 1e3, ttlInMsecs = 0) { - if (isNaN(max) || max < 0) { - throw new Error("Invalid max value"); - } - if (isNaN(ttlInMsecs) || ttlInMsecs < 0) { - throw new Error("Invalid ttl value"); - } - this.first = null; - this.items = /* @__PURE__ */ new Map(); - this.last = null; - this.max = max; - this.ttl = ttlInMsecs; - } - get size() { - return this.items.size; - } - bumpLru(item) { - if (this.last === item) { - return; - } - const last = this.last; - const next = item.next; - const prev = item.prev; - if (this.first === item) { - this.first = next; - } - item.next = null; - item.prev = last; - last.next = item; - if (prev !== null) { - prev.next = next; - } - if (next !== null) { - next.prev = prev; - } - this.last = item; - } - clear() { - this.items = /* @__PURE__ */ new Map(); - this.first = null; - this.last = null; - } - delete(key) { - if (this.items.has(key)) { - const item = this.items.get(key); - this.items.delete(key); - if (item.prev !== null) { - item.prev.next = item.next; - } - if (item.next !== null) { - item.next.prev = item.prev; - } - if (this.first === item) { - this.first = item.next; - } - if (this.last === item) { - this.last = item.prev; - } - } - } - deleteMany(keys) { - for (var i = 0; i < keys.length; i++) { - this.delete(keys[i]); - } - } - evict() { - if (this.size > 0) { - const item = this.first; - this.items.delete(item.key); - if (this.size === 0) { - this.first = null; - this.last = null; - } else { - this.first = item.next; - this.first.prev = null; - } - } - } - expiresAt(key) { - if (this.items.has(key)) { - return this.items.get(key).expiry; - } - } - get(key) { - if (this.items.has(key)) { - const item = this.items.get(key); - if (this.ttl > 0 && item.expiry <= Date.now()) { - this.delete(key); - return; - } - this.bumpLru(item); - return item.value; - } - } - getMany(keys) { - const result = []; - for (var i = 0; i < keys.length; i++) { - result.push(this.get(keys[i])); - } - return result; - } - keys() { - return this.items.keys(); - } - set(key, value) { - if (this.items.has(key)) { - const item2 = this.items.get(key); - item2.value = value; - item2.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl; - if (this.last !== item2) { - this.bumpLru(item2); - } - return; - } - if (this.max > 0 && this.size === this.max) { - this.evict(); - } - const item = { - expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl, - key, - prev: this.last, - next: null, - value - }; - this.items.set(key, item); - if (this.size === 1) { - this.first = item; - } else { - this.last.next = item; - } - this.last = item; - } - }; - var LruObject = class { - constructor(max = 1e3, ttlInMsecs = 0) { - if (isNaN(max) || max < 0) { - throw new Error("Invalid max value"); - } - if (isNaN(ttlInMsecs) || ttlInMsecs < 0) { - throw new Error("Invalid ttl value"); - } - this.first = null; - this.items = /* @__PURE__ */ Object.create(null); - this.last = null; - this.size = 0; - this.max = max; - this.ttl = ttlInMsecs; - } - bumpLru(item) { - if (this.last === item) { - return; - } - const last = this.last; - const next = item.next; - const prev = item.prev; - if (this.first === item) { - this.first = next; - } - item.next = null; - item.prev = last; - last.next = item; - if (prev !== null) { - prev.next = next; - } - if (next !== null) { - next.prev = prev; - } - this.last = item; - } - clear() { - this.items = /* @__PURE__ */ Object.create(null); - this.first = null; - this.last = null; - this.size = 0; - } - delete(key) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - const item = this.items[key]; - delete this.items[key]; - this.size--; - if (item.prev !== null) { - item.prev.next = item.next; - } - if (item.next !== null) { - item.next.prev = item.prev; - } - if (this.first === item) { - this.first = item.next; - } - if (this.last === item) { - this.last = item.prev; - } - } - } - deleteMany(keys) { - for (var i = 0; i < keys.length; i++) { - this.delete(keys[i]); - } - } - evict() { - if (this.size > 0) { - const item = this.first; - delete this.items[item.key]; - if (--this.size === 0) { - this.first = null; - this.last = null; - } else { - this.first = item.next; - this.first.prev = null; - } - } - } - expiresAt(key) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - return this.items[key].expiry; - } - } - get(key) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - const item = this.items[key]; - if (this.ttl > 0 && item.expiry <= Date.now()) { - this.delete(key); - return; - } - this.bumpLru(item); - return item.value; - } - } - getMany(keys) { - const result = []; - for (var i = 0; i < keys.length; i++) { - result.push(this.get(keys[i])); - } - return result; - } - keys() { - return Object.keys(this.items); - } - set(key, value) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - const item2 = this.items[key]; - item2.value = value; - item2.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl; - if (this.last !== item2) { - this.bumpLru(item2); - } - return; - } - if (this.max > 0 && this.size === this.max) { - this.evict(); - } - const item = { - expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl, - key, - prev: this.last, - next: null, - value - }; - this.items[key] = item; - if (++this.size === 1) { - this.first = item; - } else { - this.last.next = item; - } - this.last = item; - } - }; - var HitStatisticsRecord = class { - constructor() { - this.records = {}; - } - initForCache(cacheId, currentTimeStamp) { - this.records[cacheId] = { - [currentTimeStamp]: { - cacheSize: 0, - hits: 0, - falsyHits: 0, - emptyHits: 0, - misses: 0, - expirations: 0, - evictions: 0, - invalidateOne: 0, - invalidateAll: 0, - sets: 0 - } - }; - } - resetForCache(cacheId) { - for (let key of Object.keys(this.records[cacheId])) { - this.records[cacheId][key] = { - cacheSize: 0, - hits: 0, - falsyHits: 0, - emptyHits: 0, - misses: 0, - expirations: 0, - evictions: 0, - invalidateOne: 0, - invalidateAll: 0, - sets: 0 - }; - } - } - getStatistics() { - return this.records; - } - }; - function getTimestamp(date) { - return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}`; - } - var HitStatistics = class { - constructor(cacheId, statisticTtlInHours, globalStatisticsRecord) { - this.cacheId = cacheId; - this.statisticTtlInHours = statisticTtlInHours; - this.collectionStart = /* @__PURE__ */ new Date(); - this.currentTimeStamp = getTimestamp(this.collectionStart); - this.records = globalStatisticsRecord || new HitStatisticsRecord(); - this.records.initForCache(this.cacheId, this.currentTimeStamp); - } - get currentRecord() { - if (!this.records.records[this.cacheId][this.currentTimeStamp]) { - this.records.records[this.cacheId][this.currentTimeStamp] = { - cacheSize: 0, - hits: 0, - falsyHits: 0, - emptyHits: 0, - misses: 0, - expirations: 0, - evictions: 0, - sets: 0, - invalidateOne: 0, - invalidateAll: 0 - }; - } - return this.records.records[this.cacheId][this.currentTimeStamp]; - } - hoursPassed() { - return (Date.now() - this.collectionStart) / 1e3 / 60 / 60; - } - addHit() { - this.archiveIfNeeded(); - this.currentRecord.hits++; - } - addFalsyHit() { - this.archiveIfNeeded(); - this.currentRecord.falsyHits++; - } - addEmptyHit() { - this.archiveIfNeeded(); - this.currentRecord.emptyHits++; - } - addMiss() { - this.archiveIfNeeded(); - this.currentRecord.misses++; - } - addEviction() { - this.archiveIfNeeded(); - this.currentRecord.evictions++; - } - setCacheSize(currentSize) { - this.archiveIfNeeded(); - this.currentRecord.cacheSize = currentSize; - } - addExpiration() { - this.archiveIfNeeded(); - this.currentRecord.expirations++; - } - addSet() { - this.archiveIfNeeded(); - this.currentRecord.sets++; - } - addInvalidateOne() { - this.archiveIfNeeded(); - this.currentRecord.invalidateOne++; - } - addInvalidateAll() { - this.archiveIfNeeded(); - this.currentRecord.invalidateAll++; - } - getStatistics() { - return this.records.getStatistics(); - } - archiveIfNeeded() { - if (this.hoursPassed() >= this.statisticTtlInHours) { - this.collectionStart = /* @__PURE__ */ new Date(); - this.currentTimeStamp = getTimestamp(this.collectionStart); - this.records.initForCache(this.cacheId, this.currentTimeStamp); - } - } - }; - var LruObjectHitStatistics = class extends LruObject { - constructor(max, ttlInMsecs, cacheId, globalStatisticsRecord, statisticTtlInHours) { - super(max || 1e3, ttlInMsecs || 0); - if (!cacheId) { - throw new Error("Cache id is mandatory"); - } - this.hitStatistics = new HitStatistics( - cacheId, - statisticTtlInHours !== void 0 ? statisticTtlInHours : 24, - globalStatisticsRecord - ); - } - getStatistics() { - return this.hitStatistics.getStatistics(); - } - set(key, value) { - super.set(key, value); - this.hitStatistics.addSet(); - this.hitStatistics.setCacheSize(this.size); - } - evict() { - super.evict(); - this.hitStatistics.addEviction(); - this.hitStatistics.setCacheSize(this.size); - } - delete(key, isExpiration = false) { - super.delete(key); - if (!isExpiration) { - this.hitStatistics.addInvalidateOne(); - } - this.hitStatistics.setCacheSize(this.size); - } - clear() { - super.clear(); - this.hitStatistics.addInvalidateAll(); - this.hitStatistics.setCacheSize(this.size); - } - get(key) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - const item = this.items[key]; - if (this.ttl > 0 && item.expiry <= Date.now()) { - this.delete(key, true); - this.hitStatistics.addExpiration(); - return; - } - this.bumpLru(item); - if (!item.value) { - this.hitStatistics.addFalsyHit(); - } - if (item.value === void 0 || item.value === null || item.value === "") { - this.hitStatistics.addEmptyHit(); - } - this.hitStatistics.addHit(); - return item.value; - } - this.hitStatistics.addMiss(); - } - }; - var FifoObject = class { - constructor(max = 1e3, ttlInMsecs = 0) { - if (isNaN(max) || max < 0) { - throw new Error("Invalid max value"); - } - if (isNaN(ttlInMsecs) || ttlInMsecs < 0) { - throw new Error("Invalid ttl value"); - } - this.first = null; - this.items = /* @__PURE__ */ Object.create(null); - this.last = null; - this.size = 0; - this.max = max; - this.ttl = ttlInMsecs; - } - clear() { - this.items = /* @__PURE__ */ Object.create(null); - this.first = null; - this.last = null; - this.size = 0; - } - delete(key) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - const deletedItem = this.items[key]; - delete this.items[key]; - this.size--; - if (deletedItem.prev !== null) { - deletedItem.prev.next = deletedItem.next; - } - if (deletedItem.next !== null) { - deletedItem.next.prev = deletedItem.prev; - } - if (this.first === deletedItem) { - this.first = deletedItem.next; - } - if (this.last === deletedItem) { - this.last = deletedItem.prev; - } - } - } - deleteMany(keys) { - for (var i = 0; i < keys.length; i++) { - this.delete(keys[i]); - } - } - evict() { - if (this.size > 0) { - const item = this.first; - delete this.items[item.key]; - if (--this.size === 0) { - this.first = null; - this.last = null; - } else { - this.first = item.next; - this.first.prev = null; - } - } - } - expiresAt(key) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - return this.items[key].expiry; - } - } - get(key) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - const item = this.items[key]; - if (this.ttl > 0 && item.expiry <= Date.now()) { - this.delete(key); - return; - } - return item.value; - } - } - getMany(keys) { - const result = []; - for (var i = 0; i < keys.length; i++) { - result.push(this.get(keys[i])); - } - return result; - } - keys() { - return Object.keys(this.items); - } - set(key, value) { - if (Object.prototype.hasOwnProperty.call(this.items, key)) { - const item2 = this.items[key]; - item2.value = value; - item2.expiry = this.ttl > 0 ? Date.now() + this.ttl : this.ttl; - return; - } - if (this.max > 0 && this.size === this.max) { - this.evict(); - } - const item = { - expiry: this.ttl > 0 ? Date.now() + this.ttl : this.ttl, - key, - prev: this.last, - next: null, - value - }; - this.items[key] = item; - if (++this.size === 1) { - this.first = item; - } else { - this.last.next = item; - } - this.last = item; - } - }; - exports2.Fifo = FifoObject; - exports2.FifoMap = FifoMap; - exports2.FifoObject = FifoObject; - exports2.HitStatisticsRecord = HitStatisticsRecord; - exports2.Lru = LruObject; - exports2.LruHitStatistics = LruObjectHitStatistics; - exports2.LruMap = LruMap; - exports2.LruObject = LruObject; - exports2.LruObjectHitStatistics = LruObjectHitStatistics; - } -}); - -// ../../node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.js -var require_secure_json_parse = __commonJS({ - "../../node_modules/.pnpm/secure-json-parse@4.1.0/node_modules/secure-json-parse/index.js"(exports2, module2) { - "use strict"; - var hasBuffer = typeof Buffer !== "undefined"; - var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/; - var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/; - function _parse(text, reviver, options) { - if (options == null) { - if (reviver !== null && typeof reviver === "object") { - options = reviver; - reviver = void 0; - } - } - if (hasBuffer && Buffer.isBuffer(text)) { - text = text.toString(); - } - if (text && text.charCodeAt(0) === 65279) { - text = text.slice(1); - } - const obj = JSON.parse(text, reviver); - if (obj === null || typeof obj !== "object") { - return obj; - } - const protoAction = options && options.protoAction || "error"; - const constructorAction = options && options.constructorAction || "error"; - if (protoAction === "ignore" && constructorAction === "ignore") { - return obj; - } - if (protoAction !== "ignore" && constructorAction !== "ignore") { - if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) { - return obj; - } - } else if (protoAction !== "ignore" && constructorAction === "ignore") { - if (suspectProtoRx.test(text) === false) { - return obj; - } - } else { - if (suspectConstructorRx.test(text) === false) { - return obj; - } - } - return filter(obj, { protoAction, constructorAction, safe: options && options.safe }); - } - function filter(obj, { protoAction = "error", constructorAction = "error", safe } = {}) { - let next = [obj]; - while (next.length) { - const nodes = next; - next = []; - for (const node of nodes) { - if (protoAction !== "ignore" && Object.prototype.hasOwnProperty.call(node, "__proto__")) { - if (safe === true) { - return null; - } else if (protoAction === "error") { - throw new SyntaxError("Object contains forbidden prototype property"); - } - delete node.__proto__; - } - if (constructorAction !== "ignore" && Object.prototype.hasOwnProperty.call(node, "constructor") && node.constructor !== null && typeof node.constructor === "object" && Object.prototype.hasOwnProperty.call(node.constructor, "prototype")) { - if (safe === true) { - return null; - } else if (constructorAction === "error") { - throw new SyntaxError("Object contains forbidden prototype property"); - } - delete node.constructor; - } - for (const key in node) { - const value = node[key]; - if (value && typeof value === "object") { - next.push(value); - } - } - } - } - return obj; - } - function parse2(text, reviver, options) { - const { stackTraceLimit } = Error; - Error.stackTraceLimit = 0; - try { - return _parse(text, reviver, options); - } finally { - Error.stackTraceLimit = stackTraceLimit; - } - } - function safeParse(text, reviver) { - const { stackTraceLimit } = Error; - Error.stackTraceLimit = 0; - try { - return _parse(text, reviver, { safe: true }); - } catch { - return void 0; - } finally { - Error.stackTraceLimit = stackTraceLimit; - } - } - module2.exports = parse2; - module2.exports.default = parse2; - module2.exports.parse = parse2; - module2.exports.safeParse = safeParse; - module2.exports.scan = filter; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/content-type-parser.js -var require_content_type_parser = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/content-type-parser.js"(exports2, module2) { - "use strict"; - var { AsyncResource } = require("node:async_hooks"); - var { FifoMap: Fifo } = require_toad_cache(); - var { parse: secureJsonParse } = require_secure_json_parse(); - var ContentType = require_content_type(); - var { - kDefaultJsonParse, - kContentTypeParser, - kBodyLimit, - kRequestPayloadStream, - kState, - kTestInternals, - kReplyIsError, - kRouteContext - } = require_symbols2(); - var { - FST_ERR_CTP_INVALID_TYPE, - FST_ERR_CTP_EMPTY_TYPE, - FST_ERR_CTP_ALREADY_PRESENT, - FST_ERR_CTP_INVALID_HANDLER, - FST_ERR_CTP_INVALID_PARSE_TYPE, - FST_ERR_CTP_BODY_TOO_LARGE, - FST_ERR_CTP_INVALID_MEDIA_TYPE, - FST_ERR_CTP_INVALID_CONTENT_LENGTH, - FST_ERR_CTP_EMPTY_JSON_BODY, - FST_ERR_CTP_INSTANCE_ALREADY_STARTED, - FST_ERR_CTP_INVALID_JSON_BODY - } = require_errors2(); - var { FSTSEC001 } = require_warnings(); - function ContentTypeParser(bodyLimit, onProtoPoisoning, onConstructorPoisoning) { - this[kDefaultJsonParse] = getDefaultJsonParser(onProtoPoisoning, onConstructorPoisoning); - this.customParsers = /* @__PURE__ */ new Map(); - this.customParsers.set("application/json", new Parser(true, false, bodyLimit, this[kDefaultJsonParse])); - this.customParsers.set("text/plain", new Parser(true, false, bodyLimit, defaultPlainTextParser)); - this.parserList = ["application/json", "text/plain"]; - this.parserRegExpList = []; - this.cache = new Fifo(100); - } - ContentTypeParser.prototype.add = function(contentType, opts, parserFn) { - const contentTypeIsString = typeof contentType === "string"; - if (contentTypeIsString) { - contentType = contentType.trim().toLowerCase(); - if (contentType.length === 0) - throw new FST_ERR_CTP_EMPTY_TYPE(); - } else if (!(contentType instanceof RegExp)) { - throw new FST_ERR_CTP_INVALID_TYPE(); - } - if (typeof parserFn !== "function") { - throw new FST_ERR_CTP_INVALID_HANDLER(); - } - if (this.existingParser(contentType)) { - throw new FST_ERR_CTP_ALREADY_PRESENT(contentType); - } - if (opts.parseAs !== void 0) { - if (opts.parseAs !== "string" && opts.parseAs !== "buffer") { - throw new FST_ERR_CTP_INVALID_PARSE_TYPE(opts.parseAs); - } - } - const parser = new Parser( - opts.parseAs === "string", - opts.parseAs === "buffer", - opts.bodyLimit, - parserFn - ); - if (contentType === "*") { - this.customParsers.set("", parser); - } else { - if (contentTypeIsString) { - const ct = new ContentType(contentType); - if (ct.isValid === false) { - throw new FST_ERR_CTP_INVALID_TYPE(); - } - const normalizedContentType = ct.toString(); - this.parserList.unshift(normalizedContentType); - this.customParsers.set(normalizedContentType, parser); - } else { - validateRegExp(contentType); - this.parserRegExpList.unshift(contentType); - this.customParsers.set(contentType.toString(), parser); - } - } - }; - ContentTypeParser.prototype.hasParser = function(contentType) { - if (typeof contentType === "string") { - contentType = new ContentType(contentType).toString(); - } else { - if (!(contentType instanceof RegExp)) - throw new FST_ERR_CTP_INVALID_TYPE(); - contentType = contentType.toString(); - } - return this.customParsers.has(contentType); - }; - ContentTypeParser.prototype.existingParser = function(contentType) { - if (typeof contentType === "string") { - const ct = new ContentType(contentType).toString(); - if (contentType === "application/json" && this.customParsers.has(contentType)) { - return this.customParsers.get(ct).fn !== this[kDefaultJsonParse]; - } - if (contentType === "text/plain" && this.customParsers.has(contentType)) { - return this.customParsers.get(ct).fn !== defaultPlainTextParser; - } - } - return this.hasParser(contentType); - }; - ContentTypeParser.prototype.getParser = function(contentType) { - if (typeof contentType === "string") { - contentType = new ContentType(contentType); - } - const ct = contentType.toString(); - let parser = this.cache.get(ct); - if (parser !== void 0) - return parser; - parser = this.customParsers.get(ct); - if (parser !== void 0) { - this.cache.set(ct, parser); - return parser; - } - parser = this.customParsers.get(contentType.mediaType); - if (parser !== void 0) { - return parser; - } - for (let j = 0; j !== this.parserRegExpList.length; ++j) { - const parserRegExp = this.parserRegExpList[j]; - if (parserRegExp.test(ct)) { - parser = this.customParsers.get(parserRegExp.toString()); - this.cache.set(ct, parser); - return parser; - } - } - return this.customParsers.get(""); - }; - ContentTypeParser.prototype.removeAll = function() { - this.customParsers = /* @__PURE__ */ new Map(); - this.parserRegExpList = []; - this.parserList = []; - this.cache = new Fifo(100); - }; - ContentTypeParser.prototype.remove = function(contentType) { - let parsers; - if (typeof contentType === "string") { - contentType = new ContentType(contentType).toString(); - parsers = this.parserList; - } else { - if (!(contentType instanceof RegExp)) - throw new FST_ERR_CTP_INVALID_TYPE(); - contentType = contentType.toString(); - parsers = this.parserRegExpList; - } - const removed = this.customParsers.delete(contentType); - const idx = parsers.findIndex((ct) => ct.toString() === contentType); - if (idx > -1) { - parsers.splice(idx, 1); - } - return removed || idx > -1; - }; - ContentTypeParser.prototype.run = function(contentType, handler, request, reply) { - const parser = this.getParser(contentType); - if (parser === void 0) { - if (request.is404 === true) { - handler(request, reply); - return; - } - reply[kReplyIsError] = true; - reply.send(new FST_ERR_CTP_INVALID_MEDIA_TYPE()); - return; - } - const resource = new AsyncResource("content-type-parser:run", request); - const done = resource.bind(onDone); - if (parser.asString === true || parser.asBuffer === true) { - rawBody( - request, - reply, - reply[kRouteContext]._parserOptions, - parser, - done - ); - return; - } - const result = parser.fn(request, request[kRequestPayloadStream], done); - if (result && typeof result.then === "function") { - result.then((body) => { - done(null, body); - }, done); - } - function onDone(error, body) { - resource.emitDestroy(); - if (error != null) { - reply.header("connection", "close"); - reply[kReplyIsError] = true; - reply.send(error); - return; - } - request.body = body; - handler(request, reply); - } - }; - function rawBody(request, reply, options, parser, done) { - const asString = parser.asString === true; - const limit = options.limit === null ? parser.bodyLimit : options.limit; - const contentLength = Number(request.headers["content-length"]); - if (contentLength > limit) { - done(new FST_ERR_CTP_BODY_TOO_LARGE(), void 0); - return; - } - let receivedLength = 0; - let body = asString ? "" : []; - const payload = request[kRequestPayloadStream] || request.raw; - if (asString) { - payload.setEncoding("utf8"); - } - payload.on("data", onData); - payload.on("end", onEnd); - payload.on("error", onEnd); - payload.resume(); - function onData(chunk) { - receivedLength += asString ? Buffer.byteLength(chunk) : chunk.length; - const { receivedEncodedLength = 0 } = payload; - if (receivedLength > limit || receivedEncodedLength > limit) { - payload.removeListener("data", onData); - payload.removeListener("end", onEnd); - payload.removeListener("error", onEnd); - done(new FST_ERR_CTP_BODY_TOO_LARGE(), void 0); - return; - } - if (asString) { - body += chunk; - } else { - body.push(chunk); - } - } - function onEnd(err) { - payload.removeListener("data", onData); - payload.removeListener("end", onEnd); - payload.removeListener("error", onEnd); - if (err != null) { - if (!(typeof err.statusCode === "number" && err.statusCode >= 400)) { - err.statusCode = 400; - } - done(err, void 0); - return; - } - if (!Number.isNaN(contentLength) && (payload.receivedEncodedLength || receivedLength) !== contentLength) { - done(new FST_ERR_CTP_INVALID_CONTENT_LENGTH(), void 0); - return; - } - if (!asString) { - body = Buffer.concat(body); - } - const result = parser.fn(request, body, done); - if (result && typeof result.then === "function") { - result.then((body2) => { - done(null, body2); - }, done); - } - } - } - function getDefaultJsonParser(onProtoPoisoning, onConstructorPoisoning) { - const parseOptions = { protoAction: onProtoPoisoning, constructorAction: onConstructorPoisoning }; - return defaultJsonParser; - function defaultJsonParser(req, body, done) { - if (body.length === 0) { - done(new FST_ERR_CTP_EMPTY_JSON_BODY(), void 0); - return; - } - try { - done(null, secureJsonParse(body, parseOptions)); - } catch { - done(new FST_ERR_CTP_INVALID_JSON_BODY(), void 0); - } - } - } - function defaultPlainTextParser(req, body, done) { - done(null, body); - } - function Parser(asString, asBuffer, bodyLimit, fn) { - this.asString = asString; - this.asBuffer = asBuffer; - this.bodyLimit = bodyLimit; - this.fn = fn; - } - function buildContentTypeParser(c) { - const contentTypeParser = new ContentTypeParser(); - contentTypeParser[kDefaultJsonParse] = c[kDefaultJsonParse]; - contentTypeParser.customParsers = new Map(c.customParsers.entries()); - contentTypeParser.parserList = c.parserList.slice(); - contentTypeParser.parserRegExpList = c.parserRegExpList.slice(); - return contentTypeParser; - } - function addContentTypeParser(contentType, opts, parser) { - if (this[kState].started) { - throw new FST_ERR_CTP_INSTANCE_ALREADY_STARTED("addContentTypeParser"); - } - if (typeof opts === "function") { - parser = opts; - opts = {}; - } - if (!opts) - opts = {}; - if (!opts.bodyLimit) - opts.bodyLimit = this[kBodyLimit]; - if (Array.isArray(contentType)) { - contentType.forEach((type2) => this[kContentTypeParser].add(type2, opts, parser)); - } else { - this[kContentTypeParser].add(contentType, opts, parser); - } - return this; - } - function hasContentTypeParser(contentType) { - return this[kContentTypeParser].hasParser(contentType); - } - function removeContentTypeParser(contentType) { - if (this[kState].started) { - throw new FST_ERR_CTP_INSTANCE_ALREADY_STARTED("removeContentTypeParser"); - } - if (Array.isArray(contentType)) { - for (const type2 of contentType) { - this[kContentTypeParser].remove(type2); - } - } else { - this[kContentTypeParser].remove(contentType); - } - } - function removeAllContentTypeParsers() { - if (this[kState].started) { - throw new FST_ERR_CTP_INSTANCE_ALREADY_STARTED("removeAllContentTypeParsers"); - } - this[kContentTypeParser].removeAll(); - } - function validateRegExp(regexp) { - if (regexp.source[0] !== "^" && regexp.source.includes(";?") === false) { - FSTSEC001(regexp.source); - } - } - module2.exports = ContentTypeParser; - module2.exports.helpers = { - buildContentTypeParser, - addContentTypeParser, - hasContentTypeParser, - removeContentTypeParser, - removeAllContentTypeParsers - }; - module2.exports.defaultParsers = { - getDefaultJsonParser, - defaultTextParser: defaultPlainTextParser - }; - module2.exports[kTestInternals] = { rawBody }; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js -var require_code = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.regexpCode = exports2.getEsmExportName = exports2.getProperty = exports2.safeStringify = exports2.stringify = exports2.strConcat = exports2.addCodeArg = exports2.str = exports2._ = exports2.nil = exports2._Code = exports2.Name = exports2.IDENTIFIER = exports2._CodeOrName = void 0; - var _CodeOrName = class { - }; - exports2._CodeOrName = _CodeOrName; - exports2.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; - var Name = class extends _CodeOrName { - constructor(s) { - super(); - if (!exports2.IDENTIFIER.test(s)) - throw new Error("CodeGen: name must be a valid identifier"); - this.str = s; - } - toString() { - return this.str; - } - emptyStr() { - return false; - } - get names() { - return { [this.str]: 1 }; - } - }; - exports2.Name = Name; - var _Code = class extends _CodeOrName { - constructor(code) { - super(); - this._items = typeof code === "string" ? [code] : code; - } - toString() { - return this.str; - } - emptyStr() { - if (this._items.length > 1) - return false; - const item = this._items[0]; - return item === "" || item === '""'; - } - get str() { - var _a; - return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, ""); - } - get names() { - var _a; - return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => { - if (c instanceof Name) - names[c.str] = (names[c.str] || 0) + 1; - return names; - }, {}); - } - }; - exports2._Code = _Code; - exports2.nil = new _Code(""); - function _(strs, ...args) { - const code = [strs[0]]; - let i = 0; - while (i < args.length) { - addCodeArg(code, args[i]); - code.push(strs[++i]); - } - return new _Code(code); - } - exports2._ = _; - var plus = new _Code("+"); - function str(strs, ...args) { - const expr = [safeStringify(strs[0])]; - let i = 0; - while (i < args.length) { - expr.push(plus); - addCodeArg(expr, args[i]); - expr.push(plus, safeStringify(strs[++i])); - } - optimize(expr); - return new _Code(expr); - } - exports2.str = str; - function addCodeArg(code, arg) { - if (arg instanceof _Code) - code.push(...arg._items); - else if (arg instanceof Name) - code.push(arg); - else - code.push(interpolate(arg)); - } - exports2.addCodeArg = addCodeArg; - function optimize(expr) { - let i = 1; - while (i < expr.length - 1) { - if (expr[i] === plus) { - const res = mergeExprItems(expr[i - 1], expr[i + 1]); - if (res !== void 0) { - expr.splice(i - 1, 3, res); - continue; - } - expr[i++] = "+"; - } - i++; - } - } - function mergeExprItems(a, b) { - if (b === '""') - return a; - if (a === '""') - return b; - if (typeof a == "string") { - if (b instanceof Name || a[a.length - 1] !== '"') - return; - if (typeof b != "string") - return `${a.slice(0, -1)}${b}"`; - if (b[0] === '"') - return a.slice(0, -1) + b.slice(1); - return; - } - if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) - return `"${a}${b.slice(1)}`; - return; - } - function strConcat(c1, c2) { - return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`; - } - exports2.strConcat = strConcat; - function interpolate(x) { - return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x); - } - function stringify2(x) { - return new _Code(safeStringify(x)); - } - exports2.stringify = stringify2; - function safeStringify(x) { - return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); - } - exports2.safeStringify = safeStringify; - function getProperty(key) { - return typeof key == "string" && exports2.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`; - } - exports2.getProperty = getProperty; - function getEsmExportName(key) { - if (typeof key == "string" && exports2.IDENTIFIER.test(key)) { - return new _Code(`${key}`); - } - throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); - } - exports2.getEsmExportName = getEsmExportName; - function regexpCode(rx) { - return new _Code(rx.toString()); - } - exports2.regexpCode = regexpCode; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js -var require_scope = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ValueScope = exports2.ValueScopeName = exports2.Scope = exports2.varKinds = exports2.UsedValueState = void 0; - var code_1 = require_code(); - var ValueError = class extends Error { - constructor(name) { - super(`CodeGen: "code" for ${name} not defined`); - this.value = name.value; - } - }; - var UsedValueState; - (function(UsedValueState2) { - UsedValueState2[UsedValueState2["Started"] = 0] = "Started"; - UsedValueState2[UsedValueState2["Completed"] = 1] = "Completed"; - })(UsedValueState || (exports2.UsedValueState = UsedValueState = {})); - exports2.varKinds = { - const: new code_1.Name("const"), - let: new code_1.Name("let"), - var: new code_1.Name("var") - }; - var Scope = class { - constructor({ prefixes, parent } = {}) { - this._names = {}; - this._prefixes = prefixes; - this._parent = parent; - } - toName(nameOrPrefix) { - return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); - } - name(prefix) { - return new code_1.Name(this._newName(prefix)); - } - _newName(prefix) { - const ng = this._names[prefix] || this._nameGroup(prefix); - return `${prefix}${ng.index++}`; - } - _nameGroup(prefix) { - var _a, _b; - if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { - throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); - } - return this._names[prefix] = { prefix, index: 0 }; - } - }; - exports2.Scope = Scope; - var ValueScopeName = class extends code_1.Name { - constructor(prefix, nameStr) { - super(nameStr); - this.prefix = prefix; - } - setValue(value, { property, itemIndex }) { - this.value = value; - this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`; - } - }; - exports2.ValueScopeName = ValueScopeName; - var line = (0, code_1._)`\n`; - var ValueScope = class extends Scope { - constructor(opts) { - super(opts); - this._values = {}; - this._scope = opts.scope; - this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; - } - get() { - return this._scope; - } - name(prefix) { - return new ValueScopeName(prefix, this._newName(prefix)); - } - value(nameOrPrefix, value) { - var _a; - if (value.ref === void 0) - throw new Error("CodeGen: ref must be passed in value"); - const name = this.toName(nameOrPrefix); - const { prefix } = name; - const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; - let vs = this._values[prefix]; - if (vs) { - const _name = vs.get(valueKey); - if (_name) - return _name; - } else { - vs = this._values[prefix] = /* @__PURE__ */ new Map(); - } - vs.set(valueKey, name); - const s = this._scope[prefix] || (this._scope[prefix] = []); - const itemIndex = s.length; - s[itemIndex] = value.ref; - name.setValue(value, { property: prefix, itemIndex }); - return name; - } - getValue(prefix, keyOrRef) { - const vs = this._values[prefix]; - if (!vs) - return; - return vs.get(keyOrRef); - } - scopeRefs(scopeName, values = this._values) { - return this._reduceValues(values, (name) => { - if (name.scopePath === void 0) - throw new Error(`CodeGen: name "${name}" has no value`); - return (0, code_1._)`${scopeName}${name.scopePath}`; - }); - } - scopeCode(values = this._values, usedValues, getCode) { - return this._reduceValues(values, (name) => { - if (name.value === void 0) - throw new Error(`CodeGen: name "${name}" has no value`); - return name.value.code; - }, usedValues, getCode); - } - _reduceValues(values, valueCode, usedValues = {}, getCode) { - let code = code_1.nil; - for (const prefix in values) { - const vs = values[prefix]; - if (!vs) - continue; - const nameSet = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map(); - vs.forEach((name) => { - if (nameSet.has(name)) - return; - nameSet.set(name, UsedValueState.Started); - let c = valueCode(name); - if (c) { - const def = this.opts.es5 ? exports2.varKinds.var : exports2.varKinds.const; - code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`; - } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) { - code = (0, code_1._)`${code}${c}${this.opts._n}`; - } else { - throw new ValueError(name); - } - nameSet.set(name, UsedValueState.Completed); - }); - } - return code; - } - }; - exports2.ValueScope = ValueScope; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js -var require_codegen = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.or = exports2.and = exports2.not = exports2.CodeGen = exports2.operators = exports2.varKinds = exports2.ValueScopeName = exports2.ValueScope = exports2.Scope = exports2.Name = exports2.regexpCode = exports2.stringify = exports2.getProperty = exports2.nil = exports2.strConcat = exports2.str = exports2._ = void 0; - var code_1 = require_code(); - var scope_1 = require_scope(); - var code_2 = require_code(); - Object.defineProperty(exports2, "_", { enumerable: true, get: function() { - return code_2._; - } }); - Object.defineProperty(exports2, "str", { enumerable: true, get: function() { - return code_2.str; - } }); - Object.defineProperty(exports2, "strConcat", { enumerable: true, get: function() { - return code_2.strConcat; - } }); - Object.defineProperty(exports2, "nil", { enumerable: true, get: function() { - return code_2.nil; - } }); - Object.defineProperty(exports2, "getProperty", { enumerable: true, get: function() { - return code_2.getProperty; - } }); - Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() { - return code_2.stringify; - } }); - Object.defineProperty(exports2, "regexpCode", { enumerable: true, get: function() { - return code_2.regexpCode; - } }); - Object.defineProperty(exports2, "Name", { enumerable: true, get: function() { - return code_2.Name; - } }); - var scope_2 = require_scope(); - Object.defineProperty(exports2, "Scope", { enumerable: true, get: function() { - return scope_2.Scope; - } }); - Object.defineProperty(exports2, "ValueScope", { enumerable: true, get: function() { - return scope_2.ValueScope; - } }); - Object.defineProperty(exports2, "ValueScopeName", { enumerable: true, get: function() { - return scope_2.ValueScopeName; - } }); - Object.defineProperty(exports2, "varKinds", { enumerable: true, get: function() { - return scope_2.varKinds; - } }); - exports2.operators = { - GT: new code_1._Code(">"), - GTE: new code_1._Code(">="), - LT: new code_1._Code("<"), - LTE: new code_1._Code("<="), - EQ: new code_1._Code("==="), - NEQ: new code_1._Code("!=="), - NOT: new code_1._Code("!"), - OR: new code_1._Code("||"), - AND: new code_1._Code("&&"), - ADD: new code_1._Code("+") - }; - var Node = class { - optimizeNodes() { - return this; - } - optimizeNames(_names, _constants) { - return this; - } - }; - var Def = class extends Node { - constructor(varKind, name, rhs) { - super(); - this.varKind = varKind; - this.name = name; - this.rhs = rhs; - } - render({ es5, _n }) { - const varKind = es5 ? scope_1.varKinds.var : this.varKind; - const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`; - return `${varKind} ${this.name}${rhs};` + _n; - } - optimizeNames(names, constants2) { - if (!names[this.name.str]) - return; - if (this.rhs) - this.rhs = optimizeExpr(this.rhs, names, constants2); - return this; - } - get names() { - return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; - } - }; - var Assign = class extends Node { - constructor(lhs, rhs, sideEffects) { - super(); - this.lhs = lhs; - this.rhs = rhs; - this.sideEffects = sideEffects; - } - render({ _n }) { - return `${this.lhs} = ${this.rhs};` + _n; - } - optimizeNames(names, constants2) { - if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) - return; - this.rhs = optimizeExpr(this.rhs, names, constants2); - return this; - } - get names() { - const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; - return addExprNames(names, this.rhs); - } - }; - var AssignOp = class extends Assign { - constructor(lhs, op, rhs, sideEffects) { - super(lhs, rhs, sideEffects); - this.op = op; - } - render({ _n }) { - return `${this.lhs} ${this.op}= ${this.rhs};` + _n; - } - }; - var Label = class extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - return `${this.label}:` + _n; - } - }; - var Break = class extends Node { - constructor(label) { - super(); - this.label = label; - this.names = {}; - } - render({ _n }) { - const label = this.label ? ` ${this.label}` : ""; - return `break${label};` + _n; - } - }; - var Throw = class extends Node { - constructor(error) { - super(); - this.error = error; - } - render({ _n }) { - return `throw ${this.error};` + _n; - } - get names() { - return this.error.names; - } - }; - var AnyCode = class extends Node { - constructor(code) { - super(); - this.code = code; - } - render({ _n }) { - return `${this.code};` + _n; - } - optimizeNodes() { - return `${this.code}` ? this : void 0; - } - optimizeNames(names, constants2) { - this.code = optimizeExpr(this.code, names, constants2); - return this; - } - get names() { - return this.code instanceof code_1._CodeOrName ? this.code.names : {}; - } - }; - var ParentNode = class extends Node { - constructor(nodes = []) { - super(); - this.nodes = nodes; - } - render(opts) { - return this.nodes.reduce((code, n) => code + n.render(opts), ""); - } - optimizeNodes() { - const { nodes } = this; - let i = nodes.length; - while (i--) { - const n = nodes[i].optimizeNodes(); - if (Array.isArray(n)) - nodes.splice(i, 1, ...n); - else if (n) - nodes[i] = n; - else - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : void 0; - } - optimizeNames(names, constants2) { - const { nodes } = this; - let i = nodes.length; - while (i--) { - const n = nodes[i]; - if (n.optimizeNames(names, constants2)) - continue; - subtractNames(names, n.names); - nodes.splice(i, 1); - } - return nodes.length > 0 ? this : void 0; - } - get names() { - return this.nodes.reduce((names, n) => addNames(names, n.names), {}); - } - }; - var BlockNode = class extends ParentNode { - render(opts) { - return "{" + opts._n + super.render(opts) + "}" + opts._n; - } - }; - var Root = class extends ParentNode { - }; - var Else = class extends BlockNode { - }; - Else.kind = "else"; - var If = class _If extends BlockNode { - constructor(condition, nodes) { - super(nodes); - this.condition = condition; - } - render(opts) { - let code = `if(${this.condition})` + super.render(opts); - if (this.else) - code += "else " + this.else.render(opts); - return code; - } - optimizeNodes() { - super.optimizeNodes(); - const cond = this.condition; - if (cond === true) - return this.nodes; - let e = this.else; - if (e) { - const ns = e.optimizeNodes(); - e = this.else = Array.isArray(ns) ? new Else(ns) : ns; - } - if (e) { - if (cond === false) - return e instanceof _If ? e : e.nodes; - if (this.nodes.length) - return this; - return new _If(not(cond), e instanceof _If ? [e] : e.nodes); - } - if (cond === false || !this.nodes.length) - return void 0; - return this; - } - optimizeNames(names, constants2) { - var _a; - this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants2); - if (!(super.optimizeNames(names, constants2) || this.else)) - return; - this.condition = optimizeExpr(this.condition, names, constants2); - return this; - } - get names() { - const names = super.names; - addExprNames(names, this.condition); - if (this.else) - addNames(names, this.else.names); - return names; - } - }; - If.kind = "if"; - var For = class extends BlockNode { - }; - For.kind = "for"; - var ForLoop = class extends For { - constructor(iteration) { - super(); - this.iteration = iteration; - } - render(opts) { - return `for(${this.iteration})` + super.render(opts); - } - optimizeNames(names, constants2) { - if (!super.optimizeNames(names, constants2)) - return; - this.iteration = optimizeExpr(this.iteration, names, constants2); - return this; - } - get names() { - return addNames(super.names, this.iteration.names); - } - }; - var ForRange = class extends For { - constructor(varKind, name, from, to) { - super(); - this.varKind = varKind; - this.name = name; - this.from = from; - this.to = to; - } - render(opts) { - const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; - const { name, from, to } = this; - return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); - } - get names() { - const names = addExprNames(super.names, this.from); - return addExprNames(names, this.to); - } - }; - var ForIter = class extends For { - constructor(loop, varKind, name, iterable) { - super(); - this.loop = loop; - this.varKind = varKind; - this.name = name; - this.iterable = iterable; - } - render(opts) { - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); - } - optimizeNames(names, constants2) { - if (!super.optimizeNames(names, constants2)) - return; - this.iterable = optimizeExpr(this.iterable, names, constants2); - return this; - } - get names() { - return addNames(super.names, this.iterable.names); - } - }; - var Func = class extends BlockNode { - constructor(name, args, async) { - super(); - this.name = name; - this.args = args; - this.async = async; - } - render(opts) { - const _async = this.async ? "async " : ""; - return `${_async}function ${this.name}(${this.args})` + super.render(opts); - } - }; - Func.kind = "func"; - var Return = class extends ParentNode { - render(opts) { - return "return " + super.render(opts); - } - }; - Return.kind = "return"; - var Try = class extends BlockNode { - render(opts) { - let code = "try" + super.render(opts); - if (this.catch) - code += this.catch.render(opts); - if (this.finally) - code += this.finally.render(opts); - return code; - } - optimizeNodes() { - var _a, _b; - super.optimizeNodes(); - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); - return this; - } - optimizeNames(names, constants2) { - var _a, _b; - super.optimizeNames(names, constants2); - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants2); - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants2); - return this; - } - get names() { - const names = super.names; - if (this.catch) - addNames(names, this.catch.names); - if (this.finally) - addNames(names, this.finally.names); - return names; - } - }; - var Catch = class extends BlockNode { - constructor(error) { - super(); - this.error = error; - } - render(opts) { - return `catch(${this.error})` + super.render(opts); - } - }; - Catch.kind = "catch"; - var Finally = class extends BlockNode { - render(opts) { - return "finally" + super.render(opts); - } - }; - Finally.kind = "finally"; - var CodeGen = class { - constructor(extScope, opts = {}) { - this._values = {}; - this._blockStarts = []; - this._constants = {}; - this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; - this._extScope = extScope; - this._scope = new scope_1.Scope({ parent: extScope }); - this._nodes = [new Root()]; - } - toString() { - return this._root.render(this.opts); - } - // returns unique name in the internal scope - name(prefix) { - return this._scope.name(prefix); - } - // reserves unique name in the external scope - scopeName(prefix) { - return this._extScope.name(prefix); - } - // reserves unique name in the external scope and assigns value to it - scopeValue(prefixOrName, value) { - const name = this._extScope.value(prefixOrName, value); - const vs = this._values[name.prefix] || (this._values[name.prefix] = /* @__PURE__ */ new Set()); - vs.add(name); - return name; - } - getScopeValue(prefix, keyOrRef) { - return this._extScope.getValue(prefix, keyOrRef); - } - // return code that assigns values in the external scope to the names that are used internally - // (same names that were returned by gen.scopeName or gen.scopeValue) - scopeRefs(scopeName) { - return this._extScope.scopeRefs(scopeName, this._values); - } - scopeCode() { - return this._extScope.scopeCode(this._values); - } - _def(varKind, nameOrPrefix, rhs, constant) { - const name = this._scope.toName(nameOrPrefix); - if (rhs !== void 0 && constant) - this._constants[name.str] = rhs; - this._leafNode(new Def(varKind, name, rhs)); - return name; - } - // `const` declaration (`var` in es5 mode) - const(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); - } - // `let` declaration with optional assignment (`var` in es5 mode) - let(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); - } - // `var` declaration with optional assignment - var(nameOrPrefix, rhs, _constant) { - return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); - } - // assignment code - assign(lhs, rhs, sideEffects) { - return this._leafNode(new Assign(lhs, rhs, sideEffects)); - } - // `+=` code - add(lhs, rhs) { - return this._leafNode(new AssignOp(lhs, exports2.operators.ADD, rhs)); - } - // appends passed SafeExpr to code or executes Block - code(c) { - if (typeof c == "function") - c(); - else if (c !== code_1.nil) - this._leafNode(new AnyCode(c)); - return this; - } - // returns code for object literal for the passed argument list of key-value pairs - object(...keyValues) { - const code = ["{"]; - for (const [key, value] of keyValues) { - if (code.length > 1) - code.push(","); - code.push(key); - if (key !== value || this.opts.es5) { - code.push(":"); - (0, code_1.addCodeArg)(code, value); - } - } - code.push("}"); - return new code_1._Code(code); - } - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) - if(condition, thenBody, elseBody) { - this._blockNode(new If(condition)); - if (thenBody && elseBody) { - this.code(thenBody).else().code(elseBody).endIf(); - } else if (thenBody) { - this.code(thenBody).endIf(); - } else if (elseBody) { - throw new Error('CodeGen: "else" body without "then" body'); - } - return this; - } - // `else if` clause - invalid without `if` or after `else` clauses - elseIf(condition) { - return this._elseNode(new If(condition)); - } - // `else` clause - only valid after `if` or `else if` clauses - else() { - return this._elseNode(new Else()); - } - // end `if` statement (needed if gen.if was used only with condition) - endIf() { - return this._endBlockNode(If, Else); - } - _for(node, forBody) { - this._blockNode(node); - if (forBody) - this.code(forBody).endFor(); - return this; - } - // a generic `for` clause (or statement if `forBody` is passed) - for(iteration, forBody) { - return this._for(new ForLoop(iteration), forBody); - } - // `for` statement for a range of values - forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); - } - // `for-of` statement (in es5 mode replace with a normal for loop) - forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { - const name = this._scope.toName(nameOrPrefix); - if (this.opts.es5) { - const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); - return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, (i) => { - this.var(name, (0, code_1._)`${arr}[${i}]`); - forBody(name); - }); - } - return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); - } - // `for-in` statement. - // With option `ownProperties` replaced with a `for-of` loop for object keys - forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { - if (this.opts.ownProperties) { - return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody); - } - const name = this._scope.toName(nameOrPrefix); - return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); - } - // end `for` loop - endFor() { - return this._endBlockNode(For); - } - // `label` statement - label(label) { - return this._leafNode(new Label(label)); - } - // `break` statement - break(label) { - return this._leafNode(new Break(label)); - } - // `return` statement - return(value) { - const node = new Return(); - this._blockNode(node); - this.code(value); - if (node.nodes.length !== 1) - throw new Error('CodeGen: "return" should have one node'); - return this._endBlockNode(Return); - } - // `try` statement - try(tryBody, catchCode, finallyCode) { - if (!catchCode && !finallyCode) - throw new Error('CodeGen: "try" without "catch" and "finally"'); - const node = new Try(); - this._blockNode(node); - this.code(tryBody); - if (catchCode) { - const error = this.name("e"); - this._currNode = node.catch = new Catch(error); - catchCode(error); - } - if (finallyCode) { - this._currNode = node.finally = new Finally(); - this.code(finallyCode); - } - return this._endBlockNode(Catch, Finally); - } - // `throw` statement - throw(error) { - return this._leafNode(new Throw(error)); - } - // start self-balancing block - block(body, nodeCount) { - this._blockStarts.push(this._nodes.length); - if (body) - this.code(body).endBlock(nodeCount); - return this; - } - // end the current self-balancing block - endBlock(nodeCount) { - const len = this._blockStarts.pop(); - if (len === void 0) - throw new Error("CodeGen: not in self-balancing block"); - const toClose = this._nodes.length - len; - if (toClose < 0 || nodeCount !== void 0 && toClose !== nodeCount) { - throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); - } - this._nodes.length = len; - return this; - } - // `function` heading (or definition if funcBody is passed) - func(name, args = code_1.nil, async, funcBody) { - this._blockNode(new Func(name, args, async)); - if (funcBody) - this.code(funcBody).endFunc(); - return this; - } - // end function definition - endFunc() { - return this._endBlockNode(Func); - } - optimize(n = 1) { - while (n-- > 0) { - this._root.optimizeNodes(); - this._root.optimizeNames(this._root.names, this._constants); - } - } - _leafNode(node) { - this._currNode.nodes.push(node); - return this; - } - _blockNode(node) { - this._currNode.nodes.push(node); - this._nodes.push(node); - } - _endBlockNode(N1, N2) { - const n = this._currNode; - if (n instanceof N1 || N2 && n instanceof N2) { - this._nodes.pop(); - return this; - } - throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); - } - _elseNode(node) { - const n = this._currNode; - if (!(n instanceof If)) { - throw new Error('CodeGen: "else" without "if"'); - } - this._currNode = n.else = node; - return this; - } - get _root() { - return this._nodes[0]; - } - get _currNode() { - const ns = this._nodes; - return ns[ns.length - 1]; - } - set _currNode(node) { - const ns = this._nodes; - ns[ns.length - 1] = node; - } - }; - exports2.CodeGen = CodeGen; - function addNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) + (from[n] || 0); - return names; - } - function addExprNames(names, from) { - return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; - } - function optimizeExpr(expr, names, constants2) { - if (expr instanceof code_1.Name) - return replaceName(expr); - if (!canOptimize(expr)) - return expr; - return new code_1._Code(expr._items.reduce((items, c) => { - if (c instanceof code_1.Name) - c = replaceName(c); - if (c instanceof code_1._Code) - items.push(...c._items); - else - items.push(c); - return items; - }, [])); - function replaceName(n) { - const c = constants2[n.str]; - if (c === void 0 || names[n.str] !== 1) - return n; - delete names[n.str]; - return c; - } - function canOptimize(e) { - return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants2[c.str] !== void 0); - } - } - function subtractNames(names, from) { - for (const n in from) - names[n] = (names[n] || 0) - (from[n] || 0); - } - function not(x) { - return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`; - } - exports2.not = not; - var andCode = mappend(exports2.operators.AND); - function and(...args) { - return args.reduce(andCode); - } - exports2.and = and; - var orCode = mappend(exports2.operators.OR); - function or(...args) { - return args.reduce(orCode); - } - exports2.or = or; - function mappend(op) { - return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`; - } - function par(x) { - return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`; - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js -var require_util = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkStrictMode = exports2.getErrorPath = exports2.Type = exports2.useFunc = exports2.setEvaluated = exports2.evaluatedPropsToName = exports2.mergeEvaluated = exports2.eachItem = exports2.unescapeJsonPointer = exports2.escapeJsonPointer = exports2.escapeFragment = exports2.unescapeFragment = exports2.schemaRefOrVal = exports2.schemaHasRulesButRef = exports2.schemaHasRules = exports2.checkUnknownRules = exports2.alwaysValidSchema = exports2.toHash = void 0; - var codegen_1 = require_codegen(); - var code_1 = require_code(); - function toHash(arr) { - const hash = {}; - for (const item of arr) - hash[item] = true; - return hash; - } - exports2.toHash = toHash; - function alwaysValidSchema(it, schema) { - if (typeof schema == "boolean") - return schema; - if (Object.keys(schema).length === 0) - return true; - checkUnknownRules(it, schema); - return !schemaHasRules(schema, it.self.RULES.all); - } - exports2.alwaysValidSchema = alwaysValidSchema; - function checkUnknownRules(it, schema = it.schema) { - const { opts, self: self2 } = it; - if (!opts.strictSchema) - return; - if (typeof schema === "boolean") - return; - const rules = self2.RULES.keywords; - for (const key in schema) { - if (!rules[key]) - checkStrictMode(it, `unknown keyword: "${key}"`); - } - } - exports2.checkUnknownRules = checkUnknownRules; - function schemaHasRules(schema, rules) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (rules[key]) - return true; - return false; - } - exports2.schemaHasRules = schemaHasRules; - function schemaHasRulesButRef(schema, RULES) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (key !== "$ref" && RULES.all[key]) - return true; - return false; - } - exports2.schemaHasRulesButRef = schemaHasRulesButRef; - function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { - if (!$data) { - if (typeof schema == "number" || typeof schema == "boolean") - return schema; - if (typeof schema == "string") - return (0, codegen_1._)`${schema}`; - } - return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; - } - exports2.schemaRefOrVal = schemaRefOrVal; - function unescapeFragment(str) { - return unescapeJsonPointer(decodeURIComponent(str)); - } - exports2.unescapeFragment = unescapeFragment; - function escapeFragment(str) { - return encodeURIComponent(escapeJsonPointer(str)); - } - exports2.escapeFragment = escapeFragment; - function escapeJsonPointer(str) { - if (typeof str == "number") - return `${str}`; - return str.replace(/~/g, "~0").replace(/\//g, "~1"); - } - exports2.escapeJsonPointer = escapeJsonPointer; - function unescapeJsonPointer(str) { - return str.replace(/~1/g, "/").replace(/~0/g, "~"); - } - exports2.unescapeJsonPointer = unescapeJsonPointer; - function eachItem(xs, f) { - if (Array.isArray(xs)) { - for (const x of xs) - f(x); - } else { - f(xs); - } - } - exports2.eachItem = eachItem; - function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) { - return (gen2, from, to, toName) => { - const res = to === void 0 ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen2, from, to) : mergeToName(gen2, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen2, to, from), from) : mergeValues(from, to); - return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen2, res) : res; - }; - } - exports2.mergeEvaluated = { - props: makeMergeEvaluated({ - mergeNames: (gen2, from, to) => gen2.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => { - gen2.if((0, codegen_1._)`${from} === true`, () => gen2.assign(to, true), () => gen2.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`)); - }), - mergeToName: (gen2, from, to) => gen2.if((0, codegen_1._)`${to} !== true`, () => { - if (from === true) { - gen2.assign(to, true); - } else { - gen2.assign(to, (0, codegen_1._)`${to} || {}`); - setEvaluated(gen2, to, from); - } - }), - mergeValues: (from, to) => from === true ? true : { ...from, ...to }, - resultToName: evaluatedPropsToName - }), - items: makeMergeEvaluated({ - mergeNames: (gen2, from, to) => gen2.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen2.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), - mergeToName: (gen2, from, to) => gen2.if((0, codegen_1._)`${to} !== true`, () => gen2.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)), - mergeValues: (from, to) => from === true ? true : Math.max(from, to), - resultToName: (gen2, items) => gen2.var("items", items) - }) - }; - function evaluatedPropsToName(gen2, ps) { - if (ps === true) - return gen2.var("props", true); - const props = gen2.var("props", (0, codegen_1._)`{}`); - if (ps !== void 0) - setEvaluated(gen2, props, ps); - return props; - } - exports2.evaluatedPropsToName = evaluatedPropsToName; - function setEvaluated(gen2, props, ps) { - Object.keys(ps).forEach((p) => gen2.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true)); - } - exports2.setEvaluated = setEvaluated; - var snippets = {}; - function useFunc(gen2, f) { - return gen2.scopeValue("func", { - ref: f, - code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)) - }); - } - exports2.useFunc = useFunc; - var Type; - (function(Type2) { - Type2[Type2["Num"] = 0] = "Num"; - Type2[Type2["Str"] = 1] = "Str"; - })(Type || (exports2.Type = Type = {})); - function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { - if (dataProp instanceof codegen_1.Name) { - const isNumber = dataPropType === Type.Num; - return jsPropertySyntax ? isNumber ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; - } - return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); - } - exports2.getErrorPath = getErrorPath; - function checkStrictMode(it, msg, mode = it.opts.strictSchema) { - if (!mode) - return; - msg = `strict mode: ${msg}`; - if (mode === true) - throw new Error(msg); - it.self.logger.warn(msg); - } - exports2.checkStrictMode = checkStrictMode; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js -var require_names = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var names = { - // validation function arguments - data: new codegen_1.Name("data"), - // data passed to validation function - // args passed from referencing schema - valCxt: new codegen_1.Name("valCxt"), - // validation/data context - should not be used directly, it is destructured to the names below - instancePath: new codegen_1.Name("instancePath"), - parentData: new codegen_1.Name("parentData"), - parentDataProperty: new codegen_1.Name("parentDataProperty"), - rootData: new codegen_1.Name("rootData"), - // root data - same as the data passed to the first/top validation function - dynamicAnchors: new codegen_1.Name("dynamicAnchors"), - // used to support recursiveRef and dynamicRef - // function scoped variables - vErrors: new codegen_1.Name("vErrors"), - // null or array of validation errors - errors: new codegen_1.Name("errors"), - // counter of validation errors - this: new codegen_1.Name("this"), - // "globals" - self: new codegen_1.Name("self"), - scope: new codegen_1.Name("scope"), - // JTD serialize/parse name for JSON string and position - json: new codegen_1.Name("json"), - jsonPos: new codegen_1.Name("jsonPos"), - jsonLen: new codegen_1.Name("jsonLen"), - jsonPart: new codegen_1.Name("jsonPart") - }; - exports2.default = names; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js -var require_errors3 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.extendErrors = exports2.resetErrorsCount = exports2.reportExtraError = exports2.reportError = exports2.keyword$DataError = exports2.keywordError = void 0; - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var names_1 = require_names(); - exports2.keywordError = { - message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation` - }; - exports2.keyword$DataError = { - message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)` - }; - function reportError(cxt, error = exports2.keywordError, errorPaths, overrideAllErrors) { - const { it } = cxt; - const { gen: gen2, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error, errorPaths); - if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) { - addError(gen2, errObj); - } else { - returnErrors(it, (0, codegen_1._)`[${errObj}]`); - } - } - exports2.reportError = reportError; - function reportExtraError(cxt, error = exports2.keywordError, errorPaths) { - const { it } = cxt; - const { gen: gen2, compositeRule, allErrors } = it; - const errObj = errorObjectCode(cxt, error, errorPaths); - addError(gen2, errObj); - if (!(compositeRule || allErrors)) { - returnErrors(it, names_1.default.vErrors); - } - } - exports2.reportExtraError = reportExtraError; - function resetErrorsCount(gen2, errsCount) { - gen2.assign(names_1.default.errors, errsCount); - gen2.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen2.if(errsCount, () => gen2.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen2.assign(names_1.default.vErrors, null))); - } - exports2.resetErrorsCount = resetErrorsCount; - function extendErrors({ gen: gen2, keyword, schemaValue, data, errsCount, it }) { - if (errsCount === void 0) - throw new Error("ajv implementation error"); - const err = gen2.name("err"); - gen2.forRange("i", errsCount, names_1.default.errors, (i) => { - gen2.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`); - gen2.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen2.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); - gen2.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`); - if (it.opts.verbose) { - gen2.assign((0, codegen_1._)`${err}.schema`, schemaValue); - gen2.assign((0, codegen_1._)`${err}.data`, data); - } - }); - } - exports2.extendErrors = extendErrors; - function addError(gen2, errObj) { - const err = gen2.const("err", errObj); - gen2.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen2.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`); - gen2.code((0, codegen_1._)`${names_1.default.errors}++`); - } - function returnErrors(it, errs) { - const { gen: gen2, validateName: validateName2, schemaEnv } = it; - if (schemaEnv.$async) { - gen2.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`); - } else { - gen2.assign((0, codegen_1._)`${validateName2}.errors`, errs); - gen2.return(false); - } - } - var E = { - keyword: new codegen_1.Name("keyword"), - schemaPath: new codegen_1.Name("schemaPath"), - // also used in JTD errors - params: new codegen_1.Name("params"), - propertyName: new codegen_1.Name("propertyName"), - message: new codegen_1.Name("message"), - schema: new codegen_1.Name("schema"), - parentSchema: new codegen_1.Name("parentSchema") - }; - function errorObjectCode(cxt, error, errorPaths) { - const { createErrors } = cxt.it; - if (createErrors === false) - return (0, codegen_1._)`{}`; - return errorObject(cxt, error, errorPaths); - } - function errorObject(cxt, error, errorPaths = {}) { - const { gen: gen2, it } = cxt; - const keyValues = [ - errorInstancePath(it, errorPaths), - errorSchemaPath(cxt, errorPaths) - ]; - extraErrorProps(cxt, error, keyValues); - return gen2.object(...keyValues); - } - function errorInstancePath({ errorPath }, { instancePath }) { - const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath; - return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; - } - function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { - let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`; - if (schemaPath) { - schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; - } - return [E.schemaPath, schPath]; - } - function extraErrorProps(cxt, { params, message }, keyValues) { - const { keyword, data, schemaValue, it } = cxt; - const { opts, propertyName, topSchemaRef, schemaPath } = it; - keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]); - if (opts.messages) { - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); - } - if (opts.verbose) { - keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); - } - if (propertyName) - keyValues.push([E.propertyName, propertyName]); - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js -var require_boolSchema = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.boolOrEmptySchema = exports2.topBoolOrEmptySchema = void 0; - var errors_1 = require_errors3(); - var codegen_1 = require_codegen(); - var names_1 = require_names(); - var boolError = { - message: "boolean schema is false" - }; - function topBoolOrEmptySchema(it) { - const { gen: gen2, schema, validateName: validateName2 } = it; - if (schema === false) { - falseSchemaError(it, false); - } else if (typeof schema == "object" && schema.$async === true) { - gen2.return(names_1.default.data); - } else { - gen2.assign((0, codegen_1._)`${validateName2}.errors`, null); - gen2.return(true); - } - } - exports2.topBoolOrEmptySchema = topBoolOrEmptySchema; - function boolOrEmptySchema(it, valid) { - const { gen: gen2, schema } = it; - if (schema === false) { - gen2.var(valid, false); - falseSchemaError(it); - } else { - gen2.var(valid, true); - } - } - exports2.boolOrEmptySchema = boolOrEmptySchema; - function falseSchemaError(it, overrideAllErrors) { - const { gen: gen2, data } = it; - const cxt = { - gen: gen2, - keyword: "false schema", - data, - schema: false, - schemaCode: false, - schemaValue: false, - params: {}, - it - }; - (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors); - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js -var require_rules = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRules = exports2.isJSONType = void 0; - var _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; - var jsonTypes = new Set(_jsonTypes); - function isJSONType(x) { - return typeof x == "string" && jsonTypes.has(x); - } - exports2.isJSONType = isJSONType; - function getRules() { - const groups = { - number: { type: "number", rules: [] }, - string: { type: "string", rules: [] }, - array: { type: "array", rules: [] }, - object: { type: "object", rules: [] } - }; - return { - types: { ...groups, integer: true, boolean: true, null: true }, - rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], - post: { rules: [] }, - all: {}, - keywords: {} - }; - } - exports2.getRules = getRules; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js -var require_applicability = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.shouldUseRule = exports2.shouldUseGroup = exports2.schemaHasRulesForType = void 0; - function schemaHasRulesForType({ schema, self: self2 }, type2) { - const group = self2.RULES.types[type2]; - return group && group !== true && shouldUseGroup(schema, group); - } - exports2.schemaHasRulesForType = schemaHasRulesForType; - function shouldUseGroup(schema, group) { - return group.rules.some((rule) => shouldUseRule(schema, rule)); - } - exports2.shouldUseGroup = shouldUseGroup; - function shouldUseRule(schema, rule) { - var _a; - return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0)); - } - exports2.shouldUseRule = shouldUseRule; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js -var require_dataType = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reportTypeError = exports2.checkDataTypes = exports2.checkDataType = exports2.coerceAndCheckDataType = exports2.getJSONTypes = exports2.getSchemaTypes = exports2.DataType = void 0; - var rules_1 = require_rules(); - var applicability_1 = require_applicability(); - var errors_1 = require_errors3(); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var DataType; - (function(DataType2) { - DataType2[DataType2["Correct"] = 0] = "Correct"; - DataType2[DataType2["Wrong"] = 1] = "Wrong"; - })(DataType || (exports2.DataType = DataType = {})); - function getSchemaTypes(schema) { - const types = getJSONTypes(schema.type); - const hasNull = types.includes("null"); - if (hasNull) { - if (schema.nullable === false) - throw new Error("type: null contradicts nullable: false"); - } else { - if (!types.length && schema.nullable !== void 0) { - throw new Error('"nullable" cannot be used without "type"'); - } - if (schema.nullable === true) - types.push("null"); - } - return types; - } - exports2.getSchemaTypes = getSchemaTypes; - function getJSONTypes(ts) { - const types = Array.isArray(ts) ? ts : ts ? [ts] : []; - if (types.every(rules_1.isJSONType)) - return types; - throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); - } - exports2.getJSONTypes = getJSONTypes; - function coerceAndCheckDataType(it, types) { - const { gen: gen2, data, opts } = it; - const coerceTo = coerceToTypes(types, opts.coerceTypes); - const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); - if (checkTypes) { - const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); - gen2.if(wrongType, () => { - if (coerceTo.length) - coerceData(it, types, coerceTo); - else - reportTypeError(it); - }); - } - return checkTypes; - } - exports2.coerceAndCheckDataType = coerceAndCheckDataType; - var COERCIBLE = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean", "null"]); - function coerceToTypes(types, coerceTypes) { - return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : []; - } - function coerceData(it, types, coerceTo) { - const { gen: gen2, data, opts } = it; - const dataType = gen2.let("dataType", (0, codegen_1._)`typeof ${data}`); - const coerced = gen2.let("coerced", (0, codegen_1._)`undefined`); - if (opts.coerceTypes === "array") { - gen2.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen2.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen2.assign(coerced, data))); - } - gen2.if((0, codegen_1._)`${coerced} !== undefined`); - for (const t of coerceTo) { - if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") { - coerceSpecificType(t); - } - } - gen2.else(); - reportTypeError(it); - gen2.endIf(); - gen2.if((0, codegen_1._)`${coerced} !== undefined`, () => { - gen2.assign(data, coerced); - assignParentData(it, coerced); - }); - function coerceSpecificType(t) { - switch (t) { - case "string": - gen2.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`); - return; - case "number": - gen2.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null - || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`); - return; - case "integer": - gen2.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`); - return; - case "boolean": - gen2.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true); - return; - case "null": - gen2.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`); - gen2.assign(coerced, null); - return; - case "array": - gen2.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number" - || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`); - } - } - } - function assignParentData({ gen: gen2, parentData, parentDataProperty }, expr) { - gen2.if((0, codegen_1._)`${parentData} !== undefined`, () => gen2.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr)); - } - function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { - const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; - let cond; - switch (dataType) { - case "null": - return (0, codegen_1._)`${data} ${EQ} null`; - case "array": - cond = (0, codegen_1._)`Array.isArray(${data})`; - break; - case "object": - cond = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`; - break; - case "integer": - cond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`); - break; - case "number": - cond = numCond(); - break; - default: - return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`; - } - return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); - function numCond(_cond = codegen_1.nil) { - return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil); - } - } - exports2.checkDataType = checkDataType; - function checkDataTypes(dataTypes, data, strictNums, correct) { - if (dataTypes.length === 1) { - return checkDataType(dataTypes[0], data, strictNums, correct); - } - let cond; - const types = (0, util_1.toHash)(dataTypes); - if (types.array && types.object) { - const notObj = (0, codegen_1._)`typeof ${data} != "object"`; - cond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`; - delete types.null; - delete types.array; - delete types.object; - } else { - cond = codegen_1.nil; - } - if (types.number) - delete types.integer; - for (const t in types) - cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); - return cond; - } - exports2.checkDataTypes = checkDataTypes; - var typeError = { - message: ({ schema }) => `must be ${schema}`, - params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}` - }; - function reportTypeError(it) { - const cxt = getTypeErrorContext(it); - (0, errors_1.reportError)(cxt, typeError); - } - exports2.reportTypeError = reportTypeError; - function getTypeErrorContext(it) { - const { gen: gen2, data, schema } = it; - const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type"); - return { - gen: gen2, - keyword: "type", - data, - schema: schema.type, - schemaCode, - schemaValue: schemaCode, - parentSchema: schema, - params: {}, - it - }; - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js -var require_defaults = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.assignDefaults = void 0; - var codegen_1 = require_codegen(); - var util_1 = require_util(); - function assignDefaults(it, ty) { - const { properties, items } = it.schema; - if (ty === "object" && properties) { - for (const key in properties) { - assignDefault(it, key, properties[key].default); - } - } else if (ty === "array" && Array.isArray(items)) { - items.forEach((sch, i) => assignDefault(it, i, sch.default)); - } - } - exports2.assignDefaults = assignDefaults; - function assignDefault(it, prop, defaultValue) { - const { gen: gen2, compositeRule, data, opts } = it; - if (defaultValue === void 0) - return; - const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`; - if (compositeRule) { - (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); - return; - } - let condition = (0, codegen_1._)`${childData} === undefined`; - if (opts.useDefaults === "empty") { - condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`; - } - gen2.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js -var require_code2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateUnion = exports2.validateArray = exports2.usePattern = exports2.callValidateCode = exports2.schemaProperties = exports2.allSchemaProperties = exports2.noPropertyInData = exports2.propertyInData = exports2.isOwnProperty = exports2.hasPropFunc = exports2.reportMissingProp = exports2.checkMissingProp = exports2.checkReportMissingProp = void 0; - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var names_1 = require_names(); - var util_2 = require_util(); - function checkReportMissingProp(cxt, prop) { - const { gen: gen2, data, it } = cxt; - gen2.if(noPropertyInData(gen2, data, prop, it.opts.ownProperties), () => { - cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true); - cxt.error(); - }); - } - exports2.checkReportMissingProp = checkReportMissingProp; - function checkMissingProp({ gen: gen2, data, it: { opts } }, properties, missing) { - return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen2, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`))); - } - exports2.checkMissingProp = checkMissingProp; - function reportMissingProp(cxt, missing) { - cxt.setParams({ missingProperty: missing }, true); - cxt.error(); - } - exports2.reportMissingProp = reportMissingProp; - function hasPropFunc(gen2) { - return gen2.scopeValue("func", { - // eslint-disable-next-line @typescript-eslint/unbound-method - ref: Object.prototype.hasOwnProperty, - code: (0, codegen_1._)`Object.prototype.hasOwnProperty` - }); - } - exports2.hasPropFunc = hasPropFunc; - function isOwnProperty(gen2, data, property) { - return (0, codegen_1._)`${hasPropFunc(gen2)}.call(${data}, ${property})`; - } - exports2.isOwnProperty = isOwnProperty; - function propertyInData(gen2, data, property, ownProperties) { - const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`; - return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen2, data, property)}` : cond; - } - exports2.propertyInData = propertyInData; - function noPropertyInData(gen2, data, property, ownProperties) { - const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`; - return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen2, data, property))) : cond; - } - exports2.noPropertyInData = noPropertyInData; - function allSchemaProperties(schemaMap) { - return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : []; - } - exports2.allSchemaProperties = allSchemaProperties; - function schemaProperties(it, schemaMap) { - return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); - } - exports2.schemaProperties = schemaProperties; - function callValidateCode({ schemaCode, data, it: { gen: gen2, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { - const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; - const valCxt = [ - [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], - [names_1.default.parentData, it.parentData], - [names_1.default.parentDataProperty, it.parentDataProperty], - [names_1.default.rootData, names_1.default.rootData] - ]; - if (it.opts.dynamicRef) - valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); - const args = (0, codegen_1._)`${dataAndSchema}, ${gen2.object(...valCxt)}`; - return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`; - } - exports2.callValidateCode = callValidateCode; - var newRegExp = (0, codegen_1._)`new RegExp`; - function usePattern({ gen: gen2, it: { opts } }, pattern) { - const u = opts.unicodeRegExp ? "u" : ""; - const { regExp } = opts.code; - const rx = regExp(pattern, u); - return gen2.scopeValue("pattern", { - key: rx.toString(), - ref: rx, - code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen2, regExp)}(${pattern}, ${u})` - }); - } - exports2.usePattern = usePattern; - function validateArray(cxt) { - const { gen: gen2, data, keyword, it } = cxt; - const valid = gen2.name("valid"); - if (it.allErrors) { - const validArr = gen2.let("valid", true); - validateItems(() => gen2.assign(validArr, false)); - return validArr; - } - gen2.var(valid, true); - validateItems(() => gen2.break()); - return valid; - function validateItems(notValid) { - const len = gen2.const("len", (0, codegen_1._)`${data}.length`); - gen2.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword, - dataProp: i, - dataPropType: util_1.Type.Num - }, valid); - gen2.if((0, codegen_1.not)(valid), notValid); - }); - } - } - exports2.validateArray = validateArray; - function validateUnion(cxt) { - const { gen: gen2, schema, keyword, it } = cxt; - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch)); - if (alwaysValid && !it.opts.unevaluated) - return; - const valid = gen2.let("valid", false); - const schValid = gen2.name("_valid"); - gen2.block(() => schema.forEach((_sch, i) => { - const schCxt = cxt.subschema({ - keyword, - schemaProp: i, - compositeRule: true - }, schValid); - gen2.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`); - const merged = cxt.mergeValidEvaluated(schCxt, schValid); - if (!merged) - gen2.if((0, codegen_1.not)(valid)); - })); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); - } - exports2.validateUnion = validateUnion; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js -var require_keyword = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateKeywordUsage = exports2.validSchemaType = exports2.funcKeywordCode = exports2.macroKeywordCode = void 0; - var codegen_1 = require_codegen(); - var names_1 = require_names(); - var code_1 = require_code2(); - var errors_1 = require_errors3(); - function macroKeywordCode(cxt, def) { - const { gen: gen2, keyword, schema, parentSchema, it } = cxt; - const macroSchema = def.macro.call(it.self, schema, parentSchema, it); - const schemaRef = useKeyword(gen2, keyword, macroSchema); - if (it.opts.validateSchema !== false) - it.self.validateSchema(macroSchema, true); - const valid = gen2.name("valid"); - cxt.subschema({ - schema: macroSchema, - schemaPath: codegen_1.nil, - errSchemaPath: `${it.errSchemaPath}/${keyword}`, - topSchemaRef: schemaRef, - compositeRule: true - }, valid); - cxt.pass(valid, () => cxt.error(true)); - } - exports2.macroKeywordCode = macroKeywordCode; - function funcKeywordCode(cxt, def) { - var _a; - const { gen: gen2, keyword, schema, parentSchema, $data, it } = cxt; - checkAsyncKeyword(it, def); - const validate3 = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; - const validateRef = useKeyword(gen2, keyword, validate3); - const valid = gen2.let("valid"); - cxt.block$data(valid, validateKeyword); - cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); - function validateKeyword() { - if (def.errors === false) { - assignValid(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => cxt.error()); - } else { - const ruleErrs = def.async ? validateAsync() : validateSync(); - if (def.modifying) - modifyData(cxt); - reportErrs(() => addErrs(cxt, ruleErrs)); - } - } - function validateAsync() { - const ruleErrs = gen2.let("ruleErrs", null); - gen2.try(() => assignValid((0, codegen_1._)`await `), (e) => gen2.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen2.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen2.throw(e))); - return ruleErrs; - } - function validateSync() { - const validateErrs = (0, codegen_1._)`${validateRef}.errors`; - gen2.assign(validateErrs, null); - assignValid(codegen_1.nil); - return validateErrs; - } - function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) { - const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; - const passSchema = !("compile" in def && !$data || def.schema === false); - gen2.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); - } - function reportErrs(errors) { - var _a2; - gen2.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors); - } - } - exports2.funcKeywordCode = funcKeywordCode; - function modifyData(cxt) { - const { gen: gen2, data, it } = cxt; - gen2.if(it.parentData, () => gen2.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`)); - } - function addErrs(cxt, errs) { - const { gen: gen2 } = cxt; - gen2.if((0, codegen_1._)`Array.isArray(${errs})`, () => { - gen2.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); - (0, errors_1.extendErrors)(cxt); - }, () => cxt.error()); - } - function checkAsyncKeyword({ schemaEnv }, def) { - if (def.async && !schemaEnv.$async) - throw new Error("async keyword in sync schema"); - } - function useKeyword(gen2, keyword, result) { - if (result === void 0) - throw new Error(`keyword "${keyword}" failed to compile`); - return gen2.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); - } - function validSchemaType(schema, schemaType, allowUndefined = false) { - return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined"); - } - exports2.validSchemaType = validSchemaType; - function validateKeywordUsage({ schema, opts, self: self2, errSchemaPath }, def, keyword) { - if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { - throw new Error("ajv implementation error"); - } - const deps = def.dependencies; - if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) { - throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); - } - if (def.validateSchema) { - const valid = def.validateSchema(schema[keyword]); - if (!valid) { - const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self2.errorsText(def.validateSchema.errors); - if (opts.validateSchema === "log") - self2.logger.error(msg); - else - throw new Error(msg); - } - } - } - exports2.validateKeywordUsage = validateKeywordUsage; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js -var require_subschema = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.extendSubschemaMode = exports2.extendSubschemaData = exports2.getSubschema = void 0; - var codegen_1 = require_codegen(); - var util_1 = require_util(); - function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { - if (keyword !== void 0 && schema !== void 0) { - throw new Error('both "keyword" and "schema" passed, only one allowed'); - } - if (keyword !== void 0) { - const sch = it.schema[keyword]; - return schemaProp === void 0 ? { - schema: sch, - schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}` - } : { - schema: sch[schemaProp], - schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, - errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}` - }; - } - if (schema !== void 0) { - if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) { - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); - } - return { - schema, - schemaPath, - topSchemaRef, - errSchemaPath - }; - } - throw new Error('either "keyword" or "schema" must be passed'); - } - exports2.getSubschema = getSubschema; - function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { - if (data !== void 0 && dataProp !== void 0) { - throw new Error('both "data" and "dataProp" passed, only one allowed'); - } - const { gen: gen2 } = it; - if (dataProp !== void 0) { - const { errorPath, dataPathArr, opts } = it; - const nextData = gen2.let("data", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); - dataContextProps(nextData); - subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; - subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`; - subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; - } - if (data !== void 0) { - const nextData = data instanceof codegen_1.Name ? data : gen2.let("data", data, true); - dataContextProps(nextData); - if (propertyName !== void 0) - subschema.propertyName = propertyName; - } - if (dataTypes) - subschema.dataTypes = dataTypes; - function dataContextProps(_nextData) { - subschema.data = _nextData; - subschema.dataLevel = it.dataLevel + 1; - subschema.dataTypes = []; - it.definedProperties = /* @__PURE__ */ new Set(); - subschema.parentData = it.data; - subschema.dataNames = [...it.dataNames, _nextData]; - } - } - exports2.extendSubschemaData = extendSubschemaData; - function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { - if (compositeRule !== void 0) - subschema.compositeRule = compositeRule; - if (createErrors !== void 0) - subschema.createErrors = createErrors; - if (allErrors !== void 0) - subschema.allErrors = allErrors; - subschema.jtdDiscriminator = jtdDiscriminator; - subschema.jtdMetadata = jtdMetadata; - } - exports2.extendSubschemaMode = extendSubschemaMode; - } -}); - -// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js -var require_fast_deep_equal = __commonJS({ - "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports2, module2) { - "use strict"; - module2.exports = function equal(a, b) { - if (a === b) - return true; - if (a && b && typeof a == "object" && typeof b == "object") { - if (a.constructor !== b.constructor) - return false; - var length, i, keys; - if (Array.isArray(a)) { - length = a.length; - if (length != b.length) - return false; - for (i = length; i-- !== 0; ) - if (!equal(a[i], b[i])) - return false; - return true; - } - if (a.constructor === RegExp) - return a.source === b.source && a.flags === b.flags; - if (a.valueOf !== Object.prototype.valueOf) - return a.valueOf() === b.valueOf(); - if (a.toString !== Object.prototype.toString) - return a.toString() === b.toString(); - keys = Object.keys(a); - length = keys.length; - if (length !== Object.keys(b).length) - return false; - for (i = length; i-- !== 0; ) - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) - return false; - for (i = length; i-- !== 0; ) { - var key = keys[i]; - if (!equal(a[key], b[key])) - return false; - } - return true; - } - return a !== a && b !== b; - }; - } -}); - -// ../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js -var require_json_schema_traverse = __commonJS({ - "../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js"(exports2, module2) { - "use strict"; - var traverse = module2.exports = function(schema, opts, cb) { - if (typeof opts == "function") { - cb = opts; - opts = {}; - } - cb = opts.cb || cb; - var pre = typeof cb == "function" ? cb : cb.pre || function() { - }; - var post = cb.post || function() { - }; - _traverse(opts, pre, post, schema, "", schema); - }; - traverse.keywords = { - additionalItems: true, - items: true, - contains: true, - additionalProperties: true, - propertyNames: true, - not: true, - if: true, - then: true, - else: true - }; - traverse.arrayKeywords = { - items: true, - allOf: true, - anyOf: true, - oneOf: true - }; - traverse.propsKeywords = { - $defs: true, - definitions: true, - properties: true, - patternProperties: true, - dependencies: true - }; - traverse.skipKeywords = { - default: true, - enum: true, - const: true, - required: true, - maximum: true, - minimum: true, - exclusiveMaximum: true, - exclusiveMinimum: true, - multipleOf: true, - maxLength: true, - minLength: true, - pattern: true, - format: true, - maxItems: true, - minItems: true, - uniqueItems: true, - maxProperties: true, - minProperties: true - }; - function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { - if (schema && typeof schema == "object" && !Array.isArray(schema)) { - pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - for (var key in schema) { - var sch = schema[key]; - if (Array.isArray(sch)) { - if (key in traverse.arrayKeywords) { - for (var i = 0; i < sch.length; i++) - _traverse(opts, pre, post, sch[i], jsonPtr + "/" + key + "/" + i, rootSchema, jsonPtr, key, schema, i); - } - } else if (key in traverse.propsKeywords) { - if (sch && typeof sch == "object") { - for (var prop in sch) - _traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop); - } - } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) { - _traverse(opts, pre, post, sch, jsonPtr + "/" + key, rootSchema, jsonPtr, key, schema); - } - } - post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - } - } - function escapeJsonPtr(str) { - return str.replace(/~/g, "~0").replace(/\//g, "~1"); - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js -var require_resolve = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getSchemaRefs = exports2.resolveUrl = exports2.normalizeId = exports2._getFullPath = exports2.getFullPath = exports2.inlineRef = void 0; - var util_1 = require_util(); - var equal = require_fast_deep_equal(); - var traverse = require_json_schema_traverse(); - var SIMPLE_INLINED = /* @__PURE__ */ new Set([ - "type", - "format", - "pattern", - "maxLength", - "minLength", - "maxProperties", - "minProperties", - "maxItems", - "minItems", - "maximum", - "minimum", - "uniqueItems", - "multipleOf", - "required", - "enum", - "const" - ]); - function inlineRef(schema, limit = true) { - if (typeof schema == "boolean") - return true; - if (limit === true) - return !hasRef(schema); - if (!limit) - return false; - return countKeys(schema) <= limit; - } - exports2.inlineRef = inlineRef; - var REF_KEYWORDS = /* @__PURE__ */ new Set([ - "$ref", - "$recursiveRef", - "$recursiveAnchor", - "$dynamicRef", - "$dynamicAnchor" - ]); - function hasRef(schema) { - for (const key in schema) { - if (REF_KEYWORDS.has(key)) - return true; - const sch = schema[key]; - if (Array.isArray(sch) && sch.some(hasRef)) - return true; - if (typeof sch == "object" && hasRef(sch)) - return true; - } - return false; - } - function countKeys(schema) { - let count = 0; - for (const key in schema) { - if (key === "$ref") - return Infinity; - count++; - if (SIMPLE_INLINED.has(key)) - continue; - if (typeof schema[key] == "object") { - (0, util_1.eachItem)(schema[key], (sch) => count += countKeys(sch)); - } - if (count === Infinity) - return Infinity; - } - return count; - } - function getFullPath(resolver, id = "", normalize) { - if (normalize !== false) - id = normalizeId(id); - const p = resolver.parse(id); - return _getFullPath(resolver, p); - } - exports2.getFullPath = getFullPath; - function _getFullPath(resolver, p) { - const serialized = resolver.serialize(p); - return serialized.split("#")[0] + "#"; - } - exports2._getFullPath = _getFullPath; - var TRAILING_SLASH_HASH = /#\/?$/; - function normalizeId(id) { - return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; - } - exports2.normalizeId = normalizeId; - function resolveUrl(resolver, baseId, id) { - id = normalizeId(id); - return resolver.resolve(baseId, id); - } - exports2.resolveUrl = resolveUrl; - var ANCHOR = /^[a-z_][-a-z0-9._]*$/i; - function getSchemaRefs(schema, baseId) { - if (typeof schema == "boolean") - return {}; - const { schemaId, uriResolver } = this.opts; - const schId = normalizeId(schema[schemaId] || baseId); - const baseIds = { "": schId }; - const pathPrefix = getFullPath(uriResolver, schId, false); - const localRefs = {}; - const schemaRefs = /* @__PURE__ */ new Set(); - traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { - if (parentJsonPtr === void 0) - return; - const fullPath = pathPrefix + jsonPtr; - let innerBaseId = baseIds[parentJsonPtr]; - if (typeof sch[schemaId] == "string") - innerBaseId = addRef.call(this, sch[schemaId]); - addAnchor.call(this, sch.$anchor); - addAnchor.call(this, sch.$dynamicAnchor); - baseIds[jsonPtr] = innerBaseId; - function addRef(ref) { - const _resolve = this.opts.uriResolver.resolve; - ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref); - if (schemaRefs.has(ref)) - throw ambiguos(ref); - schemaRefs.add(ref); - let schOrRef = this.refs[ref]; - if (typeof schOrRef == "string") - schOrRef = this.refs[schOrRef]; - if (typeof schOrRef == "object") { - checkAmbiguosRef(sch, schOrRef.schema, ref); - } else if (ref !== normalizeId(fullPath)) { - if (ref[0] === "#") { - checkAmbiguosRef(sch, localRefs[ref], ref); - localRefs[ref] = sch; - } else { - this.refs[ref] = fullPath; - } - } - return ref; - } - function addAnchor(anchor) { - if (typeof anchor == "string") { - if (!ANCHOR.test(anchor)) - throw new Error(`invalid anchor "${anchor}"`); - addRef.call(this, `#${anchor}`); - } - } - }); - return localRefs; - function checkAmbiguosRef(sch1, sch2, ref) { - if (sch2 !== void 0 && !equal(sch1, sch2)) - throw ambiguos(ref); - } - function ambiguos(ref) { - return new Error(`reference "${ref}" resolves to more than one schema`); - } - } - exports2.getSchemaRefs = getSchemaRefs; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js -var require_validate = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getData = exports2.KeywordCxt = exports2.validateFunctionCode = void 0; - var boolSchema_1 = require_boolSchema(); - var dataType_1 = require_dataType(); - var applicability_1 = require_applicability(); - var dataType_2 = require_dataType(); - var defaults_1 = require_defaults(); - var keyword_1 = require_keyword(); - var subschema_1 = require_subschema(); - var codegen_1 = require_codegen(); - var names_1 = require_names(); - var resolve_1 = require_resolve(); - var util_1 = require_util(); - var errors_1 = require_errors3(); - function validateFunctionCode(it) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - topSchemaObjCode(it); - return; - } - } - validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); - } - exports2.validateFunctionCode = validateFunctionCode; - function validateFunction({ gen: gen2, validateName: validateName2, schema, schemaEnv, opts }, body) { - if (opts.code.es5) { - gen2.func(validateName2, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { - gen2.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`); - destructureValCxtES5(gen2, opts); - gen2.code(body); - }); - } else { - gen2.func(validateName2, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen2.code(funcSourceUrl(schema, opts)).code(body)); - } - } - function destructureValCxt(opts) { - return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; - } - function destructureValCxtES5(gen2, opts) { - gen2.if(names_1.default.valCxt, () => { - gen2.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`); - gen2.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`); - gen2.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); - gen2.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`); - if (opts.dynamicRef) - gen2.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); - }, () => { - gen2.var(names_1.default.instancePath, (0, codegen_1._)`""`); - gen2.var(names_1.default.parentData, (0, codegen_1._)`undefined`); - gen2.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`); - gen2.var(names_1.default.rootData, names_1.default.data); - if (opts.dynamicRef) - gen2.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`); - }); - } - function topSchemaObjCode(it) { - const { schema, opts, gen: gen2 } = it; - validateFunction(it, () => { - if (opts.$comment && schema.$comment) - commentKeyword(it); - checkNoDefault(it); - gen2.let(names_1.default.vErrors, null); - gen2.let(names_1.default.errors, 0); - if (opts.unevaluated) - resetEvaluated(it); - typeAndKeywords(it); - returnResults(it); - }); - return; - } - function resetEvaluated(it) { - const { gen: gen2, validateName: validateName2 } = it; - it.evaluated = gen2.const("evaluated", (0, codegen_1._)`${validateName2}.evaluated`); - gen2.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen2.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`)); - gen2.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen2.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`)); - } - function funcSourceUrl(schema, opts) { - const schId = typeof schema == "object" && schema[opts.schemaId]; - return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil; - } - function subschemaCode(it, valid) { - if (isSchemaObj(it)) { - checkKeywords(it); - if (schemaCxtHasRules(it)) { - subSchemaObjCode(it, valid); - return; - } - } - (0, boolSchema_1.boolOrEmptySchema)(it, valid); - } - function schemaCxtHasRules({ schema, self: self2 }) { - if (typeof schema == "boolean") - return !schema; - for (const key in schema) - if (self2.RULES.all[key]) - return true; - return false; - } - function isSchemaObj(it) { - return typeof it.schema != "boolean"; - } - function subSchemaObjCode(it, valid) { - const { schema, gen: gen2, opts } = it; - if (opts.$comment && schema.$comment) - commentKeyword(it); - updateContext(it); - checkAsyncSchema(it); - const errsCount = gen2.const("_errs", names_1.default.errors); - typeAndKeywords(it, errsCount); - gen2.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); - } - function checkKeywords(it) { - (0, util_1.checkUnknownRules)(it); - checkRefsAndKeywords(it); - } - function typeAndKeywords(it, errsCount) { - if (it.opts.jtd) - return schemaKeywords(it, [], false, errsCount); - const types = (0, dataType_1.getSchemaTypes)(it.schema); - const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); - schemaKeywords(it, types, !checkedTypes, errsCount); - } - function checkRefsAndKeywords(it) { - const { schema, errSchemaPath, opts, self: self2 } = it; - if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self2.RULES)) { - self2.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); - } - } - function checkNoDefault(it) { - const { schema, opts } = it; - if (schema.default !== void 0 && opts.useDefaults && opts.strictSchema) { - (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); - } - } - function updateContext(it) { - const schId = it.schema[it.opts.schemaId]; - if (schId) - it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); - } - function checkAsyncSchema(it) { - if (it.schema.$async && !it.schemaEnv.$async) - throw new Error("async schema in sync schema"); - } - function commentKeyword({ gen: gen2, schemaEnv, schema, errSchemaPath, opts }) { - const msg = schema.$comment; - if (opts.$comment === true) { - gen2.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`); - } else if (typeof opts.$comment == "function") { - const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`; - const rootName = gen2.scopeValue("root", { ref: schemaEnv.root }); - gen2.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); - } - } - function returnResults(it) { - const { gen: gen2, schemaEnv, validateName: validateName2, ValidationError, opts } = it; - if (schemaEnv.$async) { - gen2.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen2.return(names_1.default.data), () => gen2.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`)); - } else { - gen2.assign((0, codegen_1._)`${validateName2}.errors`, names_1.default.vErrors); - if (opts.unevaluated) - assignEvaluated(it); - gen2.return((0, codegen_1._)`${names_1.default.errors} === 0`); - } - } - function assignEvaluated({ gen: gen2, evaluated, props, items }) { - if (props instanceof codegen_1.Name) - gen2.assign((0, codegen_1._)`${evaluated}.props`, props); - if (items instanceof codegen_1.Name) - gen2.assign((0, codegen_1._)`${evaluated}.items`, items); - } - function schemaKeywords(it, types, typeErrors, errsCount) { - const { gen: gen2, schema, data, allErrors, opts, self: self2 } = it; - const { RULES } = self2; - if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { - gen2.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); - return; - } - if (!opts.jtd) - checkStrictTypes(it, types); - gen2.block(() => { - for (const group of RULES.rules) - groupKeywords(group); - groupKeywords(RULES.post); - }); - function groupKeywords(group) { - if (!(0, applicability_1.shouldUseGroup)(schema, group)) - return; - if (group.type) { - gen2.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); - iterateKeywords(it, group); - if (types.length === 1 && types[0] === group.type && typeErrors) { - gen2.else(); - (0, dataType_2.reportTypeError)(it); - } - gen2.endIf(); - } else { - iterateKeywords(it, group); - } - if (!allErrors) - gen2.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`); - } - } - function iterateKeywords(it, group) { - const { gen: gen2, schema, opts: { useDefaults } } = it; - if (useDefaults) - (0, defaults_1.assignDefaults)(it, group.type); - gen2.block(() => { - for (const rule of group.rules) { - if ((0, applicability_1.shouldUseRule)(schema, rule)) { - keywordCode(it, rule.keyword, rule.definition, group.type); - } - } - }); - } - function checkStrictTypes(it, types) { - if (it.schemaEnv.meta || !it.opts.strictTypes) - return; - checkContextTypes(it, types); - if (!it.opts.allowUnionTypes) - checkMultipleTypes(it, types); - checkKeywordTypes(it, it.dataTypes); - } - function checkContextTypes(it, types) { - if (!types.length) - return; - if (!it.dataTypes.length) { - it.dataTypes = types; - return; - } - types.forEach((t) => { - if (!includesType(it.dataTypes, t)) { - strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); - } - }); - narrowSchemaTypes(it, types); - } - function checkMultipleTypes(it, ts) { - if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { - strictTypesError(it, "use allowUnionTypes to allow union type keyword"); - } - } - function checkKeywordTypes(it, ts) { - const rules = it.self.RULES.all; - for (const keyword in rules) { - const rule = rules[keyword]; - if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { - const { type: type2 } = rule.definition; - if (type2.length && !type2.some((t) => hasApplicableType(ts, t))) { - strictTypesError(it, `missing type "${type2.join(",")}" for keyword "${keyword}"`); - } - } - } - } - function hasApplicableType(schTs, kwdT) { - return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer"); - } - function includesType(ts, t) { - return ts.includes(t) || t === "integer" && ts.includes("number"); - } - function narrowSchemaTypes(it, withTypes) { - const ts = []; - for (const t of it.dataTypes) { - if (includesType(withTypes, t)) - ts.push(t); - else if (withTypes.includes("integer") && t === "number") - ts.push("integer"); - } - it.dataTypes = ts; - } - function strictTypesError(it, msg) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - msg += ` at "${schemaPath}" (strictTypes)`; - (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); - } - var KeywordCxt = class { - constructor(it, def, keyword) { - (0, keyword_1.validateKeywordUsage)(it, def, keyword); - this.gen = it.gen; - this.allErrors = it.allErrors; - this.keyword = keyword; - this.data = it.data; - this.schema = it.schema[keyword]; - this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; - this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); - this.schemaType = def.schemaType; - this.parentSchema = it.schema; - this.params = {}; - this.it = it; - this.def = def; - if (this.$data) { - this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); - } else { - this.schemaCode = this.schemaValue; - if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { - throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); - } - } - if ("code" in def ? def.trackErrors : def.errors !== false) { - this.errsCount = it.gen.const("_errs", names_1.default.errors); - } - } - result(condition, successAction, failAction) { - this.failResult((0, codegen_1.not)(condition), successAction, failAction); - } - failResult(condition, successAction, failAction) { - this.gen.if(condition); - if (failAction) - failAction(); - else - this.error(); - if (successAction) { - this.gen.else(); - successAction(); - if (this.allErrors) - this.gen.endIf(); - } else { - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - } - pass(condition, failAction) { - this.failResult((0, codegen_1.not)(condition), void 0, failAction); - } - fail(condition) { - if (condition === void 0) { - this.error(); - if (!this.allErrors) - this.gen.if(false); - return; - } - this.gen.if(condition); - this.error(); - if (this.allErrors) - this.gen.endIf(); - else - this.gen.else(); - } - fail$data(condition) { - if (!this.$data) - return this.fail(condition); - const { schemaCode } = this; - this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); - } - error(append, errorParams, errorPaths) { - if (errorParams) { - this.setParams(errorParams); - this._error(append, errorPaths); - this.setParams({}); - return; - } - this._error(append, errorPaths); - } - _error(append, errorPaths) { - ; - (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); - } - $dataError() { - (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); - } - reset() { - if (this.errsCount === void 0) - throw new Error('add "trackErrors" to keyword definition'); - (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); - } - ok(cond) { - if (!this.allErrors) - this.gen.if(cond); - } - setParams(obj, assign) { - if (assign) - Object.assign(this.params, obj); - else - this.params = obj; - } - block$data(valid, codeBlock, $dataValid = codegen_1.nil) { - this.gen.block(() => { - this.check$data(valid, $dataValid); - codeBlock(); - }); - } - check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { - if (!this.$data) - return; - const { gen: gen2, schemaCode, schemaType, def } = this; - gen2.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid)); - if (valid !== codegen_1.nil) - gen2.assign(valid, true); - if (schemaType.length || def.validateSchema) { - gen2.elseIf(this.invalid$data()); - this.$dataError(); - if (valid !== codegen_1.nil) - gen2.assign(valid, false); - } - gen2.else(); - } - invalid$data() { - const { gen: gen2, schemaCode, schemaType, def, it } = this; - return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); - function wrong$DataType() { - if (schemaType.length) { - if (!(schemaCode instanceof codegen_1.Name)) - throw new Error("ajv implementation error"); - const st = Array.isArray(schemaType) ? schemaType : [schemaType]; - return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; - } - return codegen_1.nil; - } - function invalid$DataSchema() { - if (def.validateSchema) { - const validateSchemaRef = gen2.scopeValue("validate$data", { ref: def.validateSchema }); - return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`; - } - return codegen_1.nil; - } - } - subschema(appl, valid) { - const subschema = (0, subschema_1.getSubschema)(this.it, appl); - (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); - (0, subschema_1.extendSubschemaMode)(subschema, appl); - const nextContext = { ...this.it, ...subschema, items: void 0, props: void 0 }; - subschemaCode(nextContext, valid); - return nextContext; - } - mergeEvaluated(schemaCxt, toName) { - const { it, gen: gen2 } = this; - if (!it.opts.unevaluated) - return; - if (it.props !== true && schemaCxt.props !== void 0) { - it.props = util_1.mergeEvaluated.props(gen2, schemaCxt.props, it.props, toName); - } - if (it.items !== true && schemaCxt.items !== void 0) { - it.items = util_1.mergeEvaluated.items(gen2, schemaCxt.items, it.items, toName); - } - } - mergeValidEvaluated(schemaCxt, valid) { - const { it, gen: gen2 } = this; - if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { - gen2.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); - return true; - } - } - }; - exports2.KeywordCxt = KeywordCxt; - function keywordCode(it, keyword, def, ruleType) { - const cxt = new KeywordCxt(it, def, keyword); - if ("code" in def) { - def.code(cxt, ruleType); - } else if (cxt.$data && def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } else if ("macro" in def) { - (0, keyword_1.macroKeywordCode)(cxt, def); - } else if (def.compile || def.validate) { - (0, keyword_1.funcKeywordCode)(cxt, def); - } - } - var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; - var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; - function getData($data, { dataLevel, dataNames, dataPathArr }) { - let jsonPointer; - let data; - if ($data === "") - return names_1.default.rootData; - if ($data[0] === "/") { - if (!JSON_POINTER.test($data)) - throw new Error(`Invalid JSON-pointer: ${$data}`); - jsonPointer = $data; - data = names_1.default.rootData; - } else { - const matches = RELATIVE_JSON_POINTER.exec($data); - if (!matches) - throw new Error(`Invalid JSON-pointer: ${$data}`); - const up = +matches[1]; - jsonPointer = matches[2]; - if (jsonPointer === "#") { - if (up >= dataLevel) - throw new Error(errorMsg("property/index", up)); - return dataPathArr[dataLevel - up]; - } - if (up > dataLevel) - throw new Error(errorMsg("data", up)); - data = dataNames[dataLevel - up]; - if (!jsonPointer) - return data; - } - let expr = data; - const segments = jsonPointer.split("/"); - for (const segment of segments) { - if (segment) { - data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; - expr = (0, codegen_1._)`${expr} && ${data}`; - } - } - return expr; - function errorMsg(pointerType, up) { - return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; - } - } - exports2.getData = getData; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js -var require_validation_error = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var ValidationError = class extends Error { - constructor(errors) { - super("validation failed"); - this.errors = errors; - this.ajv = this.validation = true; - } - }; - exports2.default = ValidationError; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js -var require_ref_error = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var resolve_1 = require_resolve(); - var MissingRefError = class extends Error { - constructor(resolver, baseId, ref, msg) { - super(msg || `can't resolve reference ${ref} from id ${baseId}`); - this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); - this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); - } - }; - exports2.default = MissingRefError; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js -var require_compile = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.resolveSchema = exports2.getCompilingSchema = exports2.resolveRef = exports2.compileSchema = exports2.SchemaEnv = void 0; - var codegen_1 = require_codegen(); - var validation_error_1 = require_validation_error(); - var names_1 = require_names(); - var resolve_1 = require_resolve(); - var util_1 = require_util(); - var validate_1 = require_validate(); - var SchemaEnv = class { - constructor(env) { - var _a; - this.refs = {}; - this.dynamicAnchors = {}; - let schema; - if (typeof env.schema == "object") - schema = env.schema; - this.schema = env.schema; - this.schemaId = env.schemaId; - this.root = env.root || this; - this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); - this.schemaPath = env.schemaPath; - this.localRefs = env.localRefs; - this.meta = env.meta; - this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; - this.refs = {}; - } - }; - exports2.SchemaEnv = SchemaEnv; - function compileSchema(sch) { - const _sch = getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen2 = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - let _ValidationError; - if (sch.$async) { - _ValidationError = gen2.scopeValue("Error", { - ref: validation_error_1.default, - code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default` - }); - } - const validateName2 = gen2.scopeName("validate"); - sch.validateName = validateName2; - const schemaCxt = { - gen: gen2, - allErrors: this.opts.allErrors, - data: names_1.default.data, - parentData: names_1.default.parentData, - parentDataProperty: names_1.default.parentDataProperty, - dataNames: [names_1.default.data], - dataPathArr: [codegen_1.nil], - // TODO can its length be used as dataLevel if nil is removed? - dataLevel: 0, - dataTypes: [], - definedProperties: /* @__PURE__ */ new Set(), - topSchemaRef: gen2.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }), - validateName: validateName2, - ValidationError: _ValidationError, - schema: sch.schema, - schemaEnv: sch, - rootId, - baseId: sch.baseId || rootId, - schemaPath: codegen_1.nil, - errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), - errorPath: (0, codegen_1._)`""`, - opts: this.opts, - self: this - }; - let sourceCode; - try { - this._compilations.add(sch); - (0, validate_1.validateFunctionCode)(schemaCxt); - gen2.optimize(this.opts.code.optimize); - const validateCode = gen2.toString(); - sourceCode = `${gen2.scopeRefs(names_1.default.scope)}return ${validateCode}`; - if (this.opts.code.process) - sourceCode = this.opts.code.process(sourceCode, sch); - const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); - const validate3 = makeValidate(this, this.scope.get()); - this.scope.value(validateName2, { ref: validate3 }); - validate3.errors = null; - validate3.schema = sch.schema; - validate3.schemaEnv = sch; - if (sch.$async) - validate3.$async = true; - if (this.opts.code.source === true) { - validate3.source = { validateName: validateName2, validateCode, scopeValues: gen2._values }; - } - if (this.opts.unevaluated) { - const { props, items } = schemaCxt; - validate3.evaluated = { - props: props instanceof codegen_1.Name ? void 0 : props, - items: items instanceof codegen_1.Name ? void 0 : items, - dynamicProps: props instanceof codegen_1.Name, - dynamicItems: items instanceof codegen_1.Name - }; - if (validate3.source) - validate3.source.evaluated = (0, codegen_1.stringify)(validate3.evaluated); - } - sch.validate = validate3; - return sch; - } catch (e) { - delete sch.validate; - delete sch.validateName; - if (sourceCode) - this.logger.error("Error compiling schema, function code:", sourceCode); - throw e; - } finally { - this._compilations.delete(sch); - } - } - exports2.compileSchema = compileSchema; - function resolveRef(root, baseId, ref) { - var _a; - ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); - const schOrFunc = root.refs[ref]; - if (schOrFunc) - return schOrFunc; - let _sch = resolve.call(this, root, ref); - if (_sch === void 0) { - const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; - const { schemaId } = this.opts; - if (schema) - _sch = new SchemaEnv({ schema, schemaId, root, baseId }); - } - if (_sch === void 0) - return; - return root.refs[ref] = inlineOrCompile.call(this, _sch); - } - exports2.resolveRef = resolveRef; - function inlineOrCompile(sch) { - if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) - return sch.schema; - return sch.validate ? sch : compileSchema.call(this, sch); - } - function getCompilingSchema(schEnv) { - for (const sch of this._compilations) { - if (sameSchemaEnv(sch, schEnv)) - return sch; - } - } - exports2.getCompilingSchema = getCompilingSchema; - function sameSchemaEnv(s1, s2) { - return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; - } - function resolve(root, ref) { - let sch; - while (typeof (sch = this.refs[ref]) == "string") - ref = sch; - return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); - } - function resolveSchema(root, ref) { - const p = this.opts.uriResolver.parse(ref); - const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); - let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, void 0); - if (Object.keys(root.schema).length > 0 && refPath === baseId) { - return getJsonPointer.call(this, p, root); - } - const id = (0, resolve_1.normalizeId)(refPath); - const schOrRef = this.refs[id] || this.schemas[id]; - if (typeof schOrRef == "string") { - const sch = resolveSchema.call(this, root, schOrRef); - if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") - return; - return getJsonPointer.call(this, p, sch); - } - if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") - return; - if (!schOrRef.validate) - compileSchema.call(this, schOrRef); - if (id === (0, resolve_1.normalizeId)(ref)) { - const { schema } = schOrRef; - const { schemaId } = this.opts; - const schId = schema[schemaId]; - if (schId) - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - return new SchemaEnv({ schema, schemaId, root, baseId }); - } - return getJsonPointer.call(this, p, schOrRef); - } - exports2.resolveSchema = resolveSchema; - var PREVENT_SCOPE_CHANGE = /* @__PURE__ */ new Set([ - "properties", - "patternProperties", - "enum", - "dependencies", - "definitions" - ]); - function getJsonPointer(parsedRef, { baseId, schema, root }) { - var _a; - if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") - return; - for (const part of parsedRef.fragment.slice(1).split("/")) { - if (typeof schema === "boolean") - return; - const partSchema = schema[(0, util_1.unescapeFragment)(part)]; - if (partSchema === void 0) - return; - schema = partSchema; - const schId = typeof schema === "object" && schema[this.opts.schemaId]; - if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); - } - } - let env; - if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { - const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); - env = resolveSchema.call(this, root, $ref); - } - const { schemaId } = this.opts; - env = env || new SchemaEnv({ schema, schemaId, root, baseId }); - if (env.schema !== env.root.schema) - return env; - return void 0; - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.json -var require_data = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.json"(exports2, module2) { - module2.exports = { - $id: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#", - description: "Meta-schema for $data reference (JSON AnySchema extension proposal)", - type: "object", - required: ["$data"], - properties: { - $data: { - type: "string", - anyOf: [{ format: "relative-json-pointer" }, { format: "json-pointer" }] - } - }, - additionalProperties: false - }; - } -}); - -// ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js -var require_utils = __commonJS({ - "../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js"(exports2, module2) { - "use strict"; - var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu); - var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u); - function stringArrayToHexStripped(input) { - let acc = ""; - let code = 0; - let i = 0; - for (i = 0; i < input.length; i++) { - code = input[i].charCodeAt(0); - if (code === 48) { - continue; - } - if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { - return ""; - } - acc += input[i]; - break; - } - for (i += 1; i < input.length; i++) { - code = input[i].charCodeAt(0); - if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { - return ""; - } - acc += input[i]; - } - return acc; - } - var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u); - function consumeIsZone(buffer) { - buffer.length = 0; - return true; - } - function consumeHextets(buffer, address, output) { - if (buffer.length) { - const hex = stringArrayToHexStripped(buffer); - if (hex !== "") { - address.push(hex); - } else { - output.error = true; - return false; - } - buffer.length = 0; - } - return true; - } - function getIPV6(input) { - let tokenCount = 0; - const output = { error: false, address: "", zone: "" }; - const address = []; - const buffer = []; - let endipv6Encountered = false; - let endIpv6 = false; - let consume = consumeHextets; - for (let i = 0; i < input.length; i++) { - const cursor = input[i]; - if (cursor === "[" || cursor === "]") { - continue; - } - if (cursor === ":") { - if (endipv6Encountered === true) { - endIpv6 = true; - } - if (!consume(buffer, address, output)) { - break; - } - if (++tokenCount > 7) { - output.error = true; - break; - } - if (i > 0 && input[i - 1] === ":") { - endipv6Encountered = true; - } - address.push(":"); - continue; - } else if (cursor === "%") { - if (!consume(buffer, address, output)) { - break; - } - consume = consumeIsZone; - } else { - buffer.push(cursor); - continue; - } - } - if (buffer.length) { - if (consume === consumeIsZone) { - output.zone = buffer.join(""); - } else if (endIpv6) { - address.push(buffer.join("")); - } else { - address.push(stringArrayToHexStripped(buffer)); - } - } - output.address = address.join(""); - return output; - } - function normalizeIPv6(host) { - if (findToken(host, ":") < 2) { - return { host, isIPV6: false }; - } - const ipv6 = getIPV6(host); - if (!ipv6.error) { - let newHost = ipv6.address; - let escapedHost = ipv6.address; - if (ipv6.zone) { - newHost += "%" + ipv6.zone; - escapedHost += "%25" + ipv6.zone; - } - return { host: newHost, isIPV6: true, escapedHost }; - } else { - return { host, isIPV6: false }; - } - } - function findToken(str, token) { - let ind = 0; - for (let i = 0; i < str.length; i++) { - if (str[i] === token) - ind++; - } - return ind; - } - function removeDotSegments(path2) { - let input = path2; - const output = []; - let nextSlash = -1; - let len = 0; - while (len = input.length) { - if (len === 1) { - if (input === ".") { - break; - } else if (input === "/") { - output.push("/"); - break; - } else { - output.push(input); - break; - } - } else if (len === 2) { - if (input[0] === ".") { - if (input[1] === ".") { - break; - } else if (input[1] === "/") { - input = input.slice(2); - continue; - } - } else if (input[0] === "/") { - if (input[1] === "." || input[1] === "/") { - output.push("/"); - break; - } - } - } else if (len === 3) { - if (input === "/..") { - if (output.length !== 0) { - output.pop(); - } - output.push("/"); - break; - } - } - if (input[0] === ".") { - if (input[1] === ".") { - if (input[2] === "/") { - input = input.slice(3); - continue; - } - } else if (input[1] === "/") { - input = input.slice(2); - continue; - } - } else if (input[0] === "/") { - if (input[1] === ".") { - if (input[2] === "/") { - input = input.slice(2); - continue; - } else if (input[2] === ".") { - if (input[3] === "/") { - input = input.slice(3); - if (output.length !== 0) { - output.pop(); - } - continue; - } - } - } - } - if ((nextSlash = input.indexOf("/", 1)) === -1) { - output.push(input); - break; - } else { - output.push(input.slice(0, nextSlash)); - input = input.slice(nextSlash); - } - } - return output.join(""); - } - function normalizeComponentEncoding(component, esc) { - const func = esc !== true ? escape : unescape; - if (component.scheme !== void 0) { - component.scheme = func(component.scheme); - } - if (component.userinfo !== void 0) { - component.userinfo = func(component.userinfo); - } - if (component.host !== void 0) { - component.host = func(component.host); - } - if (component.path !== void 0) { - component.path = func(component.path); - } - if (component.query !== void 0) { - component.query = func(component.query); - } - if (component.fragment !== void 0) { - component.fragment = func(component.fragment); - } - return component; - } - function recomposeAuthority(component) { - const uriTokens = []; - if (component.userinfo !== void 0) { - uriTokens.push(component.userinfo); - uriTokens.push("@"); - } - if (component.host !== void 0) { - let host = unescape(component.host); - if (!isIPv4(host)) { - const ipV6res = normalizeIPv6(host); - if (ipV6res.isIPV6 === true) { - host = `[${ipV6res.escapedHost}]`; - } else { - host = component.host; - } - } - uriTokens.push(host); - } - if (typeof component.port === "number" || typeof component.port === "string") { - uriTokens.push(":"); - uriTokens.push(String(component.port)); - } - return uriTokens.length ? uriTokens.join("") : void 0; - } - module2.exports = { - nonSimpleDomain, - recomposeAuthority, - normalizeComponentEncoding, - removeDotSegments, - isIPv4, - isUUID, - normalizeIPv6, - stringArrayToHexStripped - }; - } -}); - -// ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js -var require_schemes = __commonJS({ - "../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js"(exports2, module2) { - "use strict"; - var { isUUID } = require_utils(); - var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; - var supportedSchemeNames = ( - /** @type {const} */ - [ - "http", - "https", - "ws", - "wss", - "urn", - "urn:uuid" - ] - ); - function isValidSchemeName(name) { - return supportedSchemeNames.indexOf( - /** @type {*} */ - name - ) !== -1; - } - function wsIsSecure(wsComponent) { - if (wsComponent.secure === true) { - return true; - } else if (wsComponent.secure === false) { - return false; - } else if (wsComponent.scheme) { - return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S"); - } else { - return false; - } - } - function httpParse(component) { - if (!component.host) { - component.error = component.error || "HTTP URIs must have a host."; - } - return component; - } - function httpSerialize(component) { - const secure = String(component.scheme).toLowerCase() === "https"; - if (component.port === (secure ? 443 : 80) || component.port === "") { - component.port = void 0; - } - if (!component.path) { - component.path = "/"; - } - return component; - } - function wsParse(wsComponent) { - wsComponent.secure = wsIsSecure(wsComponent); - wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : ""); - wsComponent.path = void 0; - wsComponent.query = void 0; - return wsComponent; - } - function wsSerialize(wsComponent) { - if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") { - wsComponent.port = void 0; - } - if (typeof wsComponent.secure === "boolean") { - wsComponent.scheme = wsComponent.secure ? "wss" : "ws"; - wsComponent.secure = void 0; - } - if (wsComponent.resourceName) { - const [path2, query] = wsComponent.resourceName.split("?"); - wsComponent.path = path2 && path2 !== "/" ? path2 : void 0; - wsComponent.query = query; - wsComponent.resourceName = void 0; - } - wsComponent.fragment = void 0; - return wsComponent; - } - function urnParse(urnComponent, options) { - if (!urnComponent.path) { - urnComponent.error = "URN can not be parsed"; - return urnComponent; - } - const matches = urnComponent.path.match(URN_REG); - if (matches) { - const scheme = options.scheme || urnComponent.scheme || "urn"; - urnComponent.nid = matches[1].toLowerCase(); - urnComponent.nss = matches[2]; - const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`; - const schemeHandler = getSchemeHandler(urnScheme); - urnComponent.path = void 0; - if (schemeHandler) { - urnComponent = schemeHandler.parse(urnComponent, options); - } - } else { - urnComponent.error = urnComponent.error || "URN can not be parsed."; - } - return urnComponent; - } - function urnSerialize(urnComponent, options) { - if (urnComponent.nid === void 0) { - throw new Error("URN without nid cannot be serialized"); - } - const scheme = options.scheme || urnComponent.scheme || "urn"; - const nid = urnComponent.nid.toLowerCase(); - const urnScheme = `${scheme}:${options.nid || nid}`; - const schemeHandler = getSchemeHandler(urnScheme); - if (schemeHandler) { - urnComponent = schemeHandler.serialize(urnComponent, options); - } - const uriComponent = urnComponent; - const nss = urnComponent.nss; - uriComponent.path = `${nid || options.nid}:${nss}`; - options.skipEscape = true; - return uriComponent; - } - function urnuuidParse(urnComponent, options) { - const uuidComponent = urnComponent; - uuidComponent.uuid = uuidComponent.nss; - uuidComponent.nss = void 0; - if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) { - uuidComponent.error = uuidComponent.error || "UUID is not valid."; - } - return uuidComponent; - } - function urnuuidSerialize(uuidComponent) { - const urnComponent = uuidComponent; - urnComponent.nss = (uuidComponent.uuid || "").toLowerCase(); - return urnComponent; - } - var http2 = ( - /** @type {SchemeHandler} */ - { - scheme: "http", - domainHost: true, - parse: httpParse, - serialize: httpSerialize - } - ); - var https2 = ( - /** @type {SchemeHandler} */ - { - scheme: "https", - domainHost: http2.domainHost, - parse: httpParse, - serialize: httpSerialize - } - ); - var ws = ( - /** @type {SchemeHandler} */ - { - scheme: "ws", - domainHost: true, - parse: wsParse, - serialize: wsSerialize - } - ); - var wss = ( - /** @type {SchemeHandler} */ - { - scheme: "wss", - domainHost: ws.domainHost, - parse: ws.parse, - serialize: ws.serialize - } - ); - var urn = ( - /** @type {SchemeHandler} */ - { - scheme: "urn", - parse: urnParse, - serialize: urnSerialize, - skipNormalize: true - } - ); - var urnuuid = ( - /** @type {SchemeHandler} */ - { - scheme: "urn:uuid", - parse: urnuuidParse, - serialize: urnuuidSerialize, - skipNormalize: true - } - ); - var SCHEMES = ( - /** @type {Record} */ - { - http: http2, - https: https2, - ws, - wss, - urn, - "urn:uuid": urnuuid - } - ); - Object.setPrototypeOf(SCHEMES, null); - function getSchemeHandler(scheme) { - return scheme && (SCHEMES[ - /** @type {SchemeName} */ - scheme - ] || SCHEMES[ - /** @type {SchemeName} */ - scheme.toLowerCase() - ]) || void 0; - } - module2.exports = { - wsIsSecure, - SCHEMES, - isValidSchemeName, - getSchemeHandler - }; - } -}); - -// ../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js -var require_fast_uri = __commonJS({ - "../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js"(exports2, module2) { - "use strict"; - var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils(); - var { SCHEMES, getSchemeHandler } = require_schemes(); - function normalize(uri, options) { - if (typeof uri === "string") { - uri = /** @type {T} */ - serialize2(parse2(uri, options), options); - } else if (typeof uri === "object") { - uri = /** @type {T} */ - parse2(serialize2(uri, options), options); - } - return uri; - } - function resolve(baseURI, relativeURI, options) { - const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" }; - const resolved = resolveComponent(parse2(baseURI, schemelessOptions), parse2(relativeURI, schemelessOptions), schemelessOptions, true); - schemelessOptions.skipEscape = true; - return serialize2(resolved, schemelessOptions); - } - function resolveComponent(base, relative, options, skipNormalization) { - const target = {}; - if (!skipNormalization) { - base = parse2(serialize2(base, options), options); - relative = parse2(serialize2(relative, options), options); - } - options = options || {}; - if (!options.tolerant && relative.scheme) { - target.scheme = relative.scheme; - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) { - target.userinfo = relative.userinfo; - target.host = relative.host; - target.port = relative.port; - target.path = removeDotSegments(relative.path || ""); - target.query = relative.query; - } else { - if (!relative.path) { - target.path = base.path; - if (relative.query !== void 0) { - target.query = relative.query; - } else { - target.query = base.query; - } - } else { - if (relative.path[0] === "/") { - target.path = removeDotSegments(relative.path); - } else { - if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) { - target.path = "/" + relative.path; - } else if (!base.path) { - target.path = relative.path; - } else { - target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; - } - target.path = removeDotSegments(target.path); - } - target.query = relative.query; - } - target.userinfo = base.userinfo; - target.host = base.host; - target.port = base.port; - } - target.scheme = base.scheme; - } - target.fragment = relative.fragment; - return target; - } - function equal(uriA, uriB, options) { - if (typeof uriA === "string") { - uriA = unescape(uriA); - uriA = serialize2(normalizeComponentEncoding(parse2(uriA, options), true), { ...options, skipEscape: true }); - } else if (typeof uriA === "object") { - uriA = serialize2(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true }); - } - if (typeof uriB === "string") { - uriB = unescape(uriB); - uriB = serialize2(normalizeComponentEncoding(parse2(uriB, options), true), { ...options, skipEscape: true }); - } else if (typeof uriB === "object") { - uriB = serialize2(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true }); - } - return uriA.toLowerCase() === uriB.toLowerCase(); - } - function serialize2(cmpts, opts) { - const component = { - host: cmpts.host, - scheme: cmpts.scheme, - userinfo: cmpts.userinfo, - port: cmpts.port, - path: cmpts.path, - query: cmpts.query, - nid: cmpts.nid, - nss: cmpts.nss, - uuid: cmpts.uuid, - fragment: cmpts.fragment, - reference: cmpts.reference, - resourceName: cmpts.resourceName, - secure: cmpts.secure, - error: "" - }; - const options = Object.assign({}, opts); - const uriTokens = []; - const schemeHandler = getSchemeHandler(options.scheme || component.scheme); - if (schemeHandler && schemeHandler.serialize) - schemeHandler.serialize(component, options); - if (component.path !== void 0) { - if (!options.skipEscape) { - component.path = escape(component.path); - if (component.scheme !== void 0) { - component.path = component.path.split("%3A").join(":"); - } - } else { - component.path = unescape(component.path); - } - } - if (options.reference !== "suffix" && component.scheme) { - uriTokens.push(component.scheme, ":"); - } - const authority = recomposeAuthority(component); - if (authority !== void 0) { - if (options.reference !== "suffix") { - uriTokens.push("//"); - } - uriTokens.push(authority); - if (component.path && component.path[0] !== "/") { - uriTokens.push("/"); - } - } - if (component.path !== void 0) { - let s = component.path; - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { - s = removeDotSegments(s); - } - if (authority === void 0 && s[0] === "/" && s[1] === "/") { - s = "/%2F" + s.slice(2); - } - uriTokens.push(s); - } - if (component.query !== void 0) { - uriTokens.push("?", component.query); - } - if (component.fragment !== void 0) { - uriTokens.push("#", component.fragment); - } - return uriTokens.join(""); - } - var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; - function parse2(uri, opts) { - const options = Object.assign({}, opts); - const parsed = { - scheme: void 0, - userinfo: void 0, - host: "", - port: void 0, - path: "", - query: void 0, - fragment: void 0 - }; - let isIP = false; - if (options.reference === "suffix") { - if (options.scheme) { - uri = options.scheme + ":" + uri; - } else { - uri = "//" + uri; - } - } - const matches = uri.match(URI_PARSE); - if (matches) { - parsed.scheme = matches[1]; - parsed.userinfo = matches[3]; - parsed.host = matches[4]; - parsed.port = parseInt(matches[5], 10); - parsed.path = matches[6] || ""; - parsed.query = matches[7]; - parsed.fragment = matches[8]; - if (isNaN(parsed.port)) { - parsed.port = matches[5]; - } - if (parsed.host) { - const ipv4result = isIPv4(parsed.host); - if (ipv4result === false) { - const ipv6result = normalizeIPv6(parsed.host); - parsed.host = ipv6result.host.toLowerCase(); - isIP = ipv6result.isIPV6; - } else { - isIP = true; - } - } - if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) { - parsed.reference = "same-document"; - } else if (parsed.scheme === void 0) { - parsed.reference = "relative"; - } else if (parsed.fragment === void 0) { - parsed.reference = "absolute"; - } else { - parsed.reference = "uri"; - } - if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) { - parsed.error = parsed.error || "URI is not a " + options.reference + " reference."; - } - const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme); - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { - if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) { - try { - parsed.host = URL.domainToASCII(parsed.host.toLowerCase()); - } catch (e) { - parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e; - } - } - } - if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) { - if (uri.indexOf("%") !== -1) { - if (parsed.scheme !== void 0) { - parsed.scheme = unescape(parsed.scheme); - } - if (parsed.host !== void 0) { - parsed.host = unescape(parsed.host); - } - } - if (parsed.path) { - parsed.path = escape(unescape(parsed.path)); - } - if (parsed.fragment) { - parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)); - } - } - if (schemeHandler && schemeHandler.parse) { - schemeHandler.parse(parsed, options); - } - } else { - parsed.error = parsed.error || "URI can not be parsed."; - } - return parsed; - } - var fastUri = { - SCHEMES, - normalize, - resolve, - resolveComponent, - equal, - serialize: serialize2, - parse: parse2 - }; - module2.exports = fastUri; - module2.exports.default = fastUri; - module2.exports.fastUri = fastUri; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js -var require_uri = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var uri = require_fast_uri(); - uri.code = 'require("ajv/dist/runtime/uri").default'; - exports2.default = uri; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js -var require_core = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = void 0; - var validate_1 = require_validate(); - Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() { - return validate_1.KeywordCxt; - } }); - var codegen_1 = require_codegen(); - Object.defineProperty(exports2, "_", { enumerable: true, get: function() { - return codegen_1._; - } }); - Object.defineProperty(exports2, "str", { enumerable: true, get: function() { - return codegen_1.str; - } }); - Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() { - return codegen_1.stringify; - } }); - Object.defineProperty(exports2, "nil", { enumerable: true, get: function() { - return codegen_1.nil; - } }); - Object.defineProperty(exports2, "Name", { enumerable: true, get: function() { - return codegen_1.Name; - } }); - Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() { - return codegen_1.CodeGen; - } }); - var validation_error_1 = require_validation_error(); - var ref_error_1 = require_ref_error(); - var rules_1 = require_rules(); - var compile_1 = require_compile(); - var codegen_2 = require_codegen(); - var resolve_1 = require_resolve(); - var dataType_1 = require_dataType(); - var util_1 = require_util(); - var $dataRefSchema = require_data(); - var uri_1 = require_uri(); - var defaultRegExp = (str, flags) => new RegExp(str, flags); - defaultRegExp.code = "new RegExp"; - var META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; - var EXT_SCOPE_NAMES = /* @__PURE__ */ new Set([ - "validate", - "serialize", - "parse", - "wrapper", - "root", - "schema", - "keyword", - "pattern", - "formats", - "validate$data", - "func", - "obj", - "Error" - ]); - var removedOptions = { - errorDataPath: "", - format: "`validateFormats: false` can be used instead.", - nullable: '"nullable" keyword is supported by default.', - jsonPointers: "Deprecated jsPropertySyntax can be used instead.", - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", - sourceCode: "Use option `code: {source: true}`", - strictDefaults: "It is default now, see option `strict`.", - strictKeywords: "It is default now, see option `strict`.", - uniqueItems: '"uniqueItems" keyword is always validated.', - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", - cache: "Map is used as cache, schema object as key.", - serialize: "Map is used as cache, schema object as key.", - ajvErrors: "It is default now." - }; - var deprecatedOptions = { - ignoreKeywordsWithRef: "", - jsPropertySyntax: "", - unicode: '"minLength"/"maxLength" account for unicode characters by default.' - }; - var MAX_EXPRESSION = 200; - function requiredOptions(o) { - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; - const s = o.strict; - const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; - const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0; - const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; - const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; - return { - strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, - strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, - strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", - strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", - strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, - code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, - loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, - loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, - meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, - messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, - inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, - schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", - addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, - validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, - validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, - unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, - int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, - uriResolver - }; - } - var Ajv = class { - constructor(opts = {}) { - this.schemas = {}; - this.refs = {}; - this.formats = /* @__PURE__ */ Object.create(null); - this._compilations = /* @__PURE__ */ new Set(); - this._loading = {}; - this._cache = /* @__PURE__ */ new Map(); - opts = this.opts = { ...opts, ...requiredOptions(opts) }; - const { es5, lines } = this.opts.code; - this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); - this.logger = getLogger(opts.logger); - const formatOpt = opts.validateFormats; - opts.validateFormats = false; - this.RULES = (0, rules_1.getRules)(); - checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); - checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); - this._metaOpts = getMetaSchemaOptions.call(this); - if (opts.formats) - addInitialFormats.call(this); - this._addVocabularies(); - this._addDefaultMetaSchema(); - if (opts.keywords) - addInitialKeywords.call(this, opts.keywords); - if (typeof opts.meta == "object") - this.addMetaSchema(opts.meta); - addInitialSchemas.call(this); - opts.validateFormats = formatOpt; - } - _addVocabularies() { - this.addKeyword("$async"); - } - _addDefaultMetaSchema() { - const { $data, meta, schemaId } = this.opts; - let _dataRefSchema = $dataRefSchema; - if (schemaId === "id") { - _dataRefSchema = { ...$dataRefSchema }; - _dataRefSchema.id = _dataRefSchema.$id; - delete _dataRefSchema.$id; - } - if (meta && $data) - this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); - } - defaultMeta() { - const { meta, schemaId } = this.opts; - return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : void 0; - } - validate(schemaKeyRef, data) { - let v; - if (typeof schemaKeyRef == "string") { - v = this.getSchema(schemaKeyRef); - if (!v) - throw new Error(`no schema with key or ref "${schemaKeyRef}"`); - } else { - v = this.compile(schemaKeyRef); - } - const valid = v(data); - if (!("$async" in v)) - this.errors = v.errors; - return valid; - } - compile(schema, _meta) { - const sch = this._addSchema(schema, _meta); - return sch.validate || this._compileSchemaEnv(sch); - } - compileAsync(schema, meta) { - if (typeof this.opts.loadSchema != "function") { - throw new Error("options.loadSchema should be a function"); - } - const { loadSchema } = this.opts; - return runCompileAsync.call(this, schema, meta); - async function runCompileAsync(_schema, _meta) { - await loadMetaSchema.call(this, _schema.$schema); - const sch = this._addSchema(_schema, _meta); - return sch.validate || _compileAsync.call(this, sch); - } - async function loadMetaSchema($ref) { - if ($ref && !this.getSchema($ref)) { - await runCompileAsync.call(this, { $ref }, true); - } - } - async function _compileAsync(sch) { - try { - return this._compileSchemaEnv(sch); - } catch (e) { - if (!(e instanceof ref_error_1.default)) - throw e; - checkLoaded.call(this, e); - await loadMissingSchema.call(this, e.missingSchema); - return _compileAsync.call(this, sch); - } - } - function checkLoaded({ missingSchema: ref, missingRef }) { - if (this.refs[ref]) { - throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); - } - } - async function loadMissingSchema(ref) { - const _schema = await _loadSchema.call(this, ref); - if (!this.refs[ref]) - await loadMetaSchema.call(this, _schema.$schema); - if (!this.refs[ref]) - this.addSchema(_schema, ref, meta); - } - async function _loadSchema(ref) { - const p = this._loading[ref]; - if (p) - return p; - try { - return await (this._loading[ref] = loadSchema(ref)); - } finally { - delete this._loading[ref]; - } - } - } - // Adds schema to the instance - addSchema(schema, key, _meta, _validateSchema = this.opts.validateSchema) { - if (Array.isArray(schema)) { - for (const sch of schema) - this.addSchema(sch, void 0, _meta, _validateSchema); - return this; - } - let id; - if (typeof schema === "object") { - const { schemaId } = this.opts; - id = schema[schemaId]; - if (id !== void 0 && typeof id != "string") { - throw new Error(`schema ${schemaId} must be string`); - } - } - key = (0, resolve_1.normalizeId)(key || id); - this._checkUnique(key); - this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true); - return this; - } - // Add schema that will be used to validate other schemas - // options in META_IGNORE_OPTIONS are alway set to false - addMetaSchema(schema, key, _validateSchema = this.opts.validateSchema) { - this.addSchema(schema, key, true, _validateSchema); - return this; - } - // Validate schema against its meta-schema - validateSchema(schema, throwOrLogError) { - if (typeof schema == "boolean") - return true; - let $schema; - $schema = schema.$schema; - if ($schema !== void 0 && typeof $schema != "string") { - throw new Error("$schema must be a string"); - } - $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); - if (!$schema) { - this.logger.warn("meta-schema not available"); - this.errors = null; - return true; - } - const valid = this.validate($schema, schema); - if (!valid && throwOrLogError) { - const message = "schema is invalid: " + this.errorsText(); - if (this.opts.validateSchema === "log") - this.logger.error(message); - else - throw new Error(message); - } - return valid; - } - // Get compiled schema by `key` or `ref`. - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) - getSchema(keyRef) { - let sch; - while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") - keyRef = sch; - if (sch === void 0) { - const { schemaId } = this.opts; - const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); - sch = compile_1.resolveSchema.call(this, root, keyRef); - if (!sch) - return; - this.refs[keyRef] = sch; - } - return sch.validate || this._compileSchemaEnv(sch); - } - // Remove cached schema(s). - // If no parameter is passed all schemas but meta-schemas are removed. - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - removeSchema(schemaKeyRef) { - if (schemaKeyRef instanceof RegExp) { - this._removeAllSchemas(this.schemas, schemaKeyRef); - this._removeAllSchemas(this.refs, schemaKeyRef); - return this; - } - switch (typeof schemaKeyRef) { - case "undefined": - this._removeAllSchemas(this.schemas); - this._removeAllSchemas(this.refs); - this._cache.clear(); - return this; - case "string": { - const sch = getSchEnv.call(this, schemaKeyRef); - if (typeof sch == "object") - this._cache.delete(sch.schema); - delete this.schemas[schemaKeyRef]; - delete this.refs[schemaKeyRef]; - return this; - } - case "object": { - const cacheKey = schemaKeyRef; - this._cache.delete(cacheKey); - let id = schemaKeyRef[this.opts.schemaId]; - if (id) { - id = (0, resolve_1.normalizeId)(id); - delete this.schemas[id]; - delete this.refs[id]; - } - return this; - } - default: - throw new Error("ajv.removeSchema: invalid parameter"); - } - } - // add "vocabulary" - a collection of keywords - addVocabulary(definitions) { - for (const def of definitions) - this.addKeyword(def); - return this; - } - addKeyword(kwdOrDef, def) { - let keyword; - if (typeof kwdOrDef == "string") { - keyword = kwdOrDef; - if (typeof def == "object") { - this.logger.warn("these parameters are deprecated, see docs for addKeyword"); - def.keyword = keyword; - } - } else if (typeof kwdOrDef == "object" && def === void 0) { - def = kwdOrDef; - keyword = def.keyword; - if (Array.isArray(keyword) && !keyword.length) { - throw new Error("addKeywords: keyword must be string or non-empty array"); - } - } else { - throw new Error("invalid addKeywords parameters"); - } - checkKeyword.call(this, keyword, def); - if (!def) { - (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd)); - return this; - } - keywordMetaschema.call(this, def); - const definition = { - ...def, - type: (0, dataType_1.getJSONTypes)(def.type), - schemaType: (0, dataType_1.getJSONTypes)(def.schemaType) - }; - (0, util_1.eachItem)(keyword, definition.type.length === 0 ? (k) => addRule.call(this, k, definition) : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t))); - return this; - } - getKeyword(keyword) { - const rule = this.RULES.all[keyword]; - return typeof rule == "object" ? rule.definition : !!rule; - } - // Remove keyword - removeKeyword(keyword) { - const { RULES } = this; - delete RULES.keywords[keyword]; - delete RULES.all[keyword]; - for (const group of RULES.rules) { - const i = group.rules.findIndex((rule) => rule.keyword === keyword); - if (i >= 0) - group.rules.splice(i, 1); - } - return this; - } - // Add format - addFormat(name, format) { - if (typeof format == "string") - format = new RegExp(format); - this.formats[name] = format; - return this; - } - errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) { - if (!errors || errors.length === 0) - return "No errors"; - return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg); - } - $dataMetaSchema(metaSchema, keywordsJsonPointers) { - const rules = this.RULES.all; - metaSchema = JSON.parse(JSON.stringify(metaSchema)); - for (const jsonPointer of keywordsJsonPointers) { - const segments = jsonPointer.split("/").slice(1); - let keywords = metaSchema; - for (const seg of segments) - keywords = keywords[seg]; - for (const key in rules) { - const rule = rules[key]; - if (typeof rule != "object") - continue; - const { $data } = rule.definition; - const schema = keywords[key]; - if ($data && schema) - keywords[key] = schemaOrData(schema); - } - } - return metaSchema; - } - _removeAllSchemas(schemas, regex) { - for (const keyRef in schemas) { - const sch = schemas[keyRef]; - if (!regex || regex.test(keyRef)) { - if (typeof sch == "string") { - delete schemas[keyRef]; - } else if (sch && !sch.meta) { - this._cache.delete(sch.schema); - delete schemas[keyRef]; - } - } - } - } - _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { - let id; - const { schemaId } = this.opts; - if (typeof schema == "object") { - id = schema[schemaId]; - } else { - if (this.opts.jtd) - throw new Error("schema must be object"); - else if (typeof schema != "boolean") - throw new Error("schema must be object or boolean"); - } - let sch = this._cache.get(schema); - if (sch !== void 0) - return sch; - baseId = (0, resolve_1.normalizeId)(id || baseId); - const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); - sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); - this._cache.set(sch.schema, sch); - if (addSchema && !baseId.startsWith("#")) { - if (baseId) - this._checkUnique(baseId); - this.refs[baseId] = sch; - } - if (validateSchema) - this.validateSchema(schema, true); - return sch; - } - _checkUnique(id) { - if (this.schemas[id] || this.refs[id]) { - throw new Error(`schema with key or id "${id}" already exists`); - } - } - _compileSchemaEnv(sch) { - if (sch.meta) - this._compileMetaSchema(sch); - else - compile_1.compileSchema.call(this, sch); - if (!sch.validate) - throw new Error("ajv implementation error"); - return sch.validate; - } - _compileMetaSchema(sch) { - const currentOpts = this.opts; - this.opts = this._metaOpts; - try { - compile_1.compileSchema.call(this, sch); - } finally { - this.opts = currentOpts; - } - } - }; - Ajv.ValidationError = validation_error_1.default; - Ajv.MissingRefError = ref_error_1.default; - exports2.default = Ajv; - function checkOptions(checkOpts, options, msg, log = "error") { - for (const key in checkOpts) { - const opt = key; - if (opt in options) - this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); - } - } - function getSchEnv(keyRef) { - keyRef = (0, resolve_1.normalizeId)(keyRef); - return this.schemas[keyRef] || this.refs[keyRef]; - } - function addInitialSchemas() { - const optsSchemas = this.opts.schemas; - if (!optsSchemas) - return; - if (Array.isArray(optsSchemas)) - this.addSchema(optsSchemas); - else - for (const key in optsSchemas) - this.addSchema(optsSchemas[key], key); - } - function addInitialFormats() { - for (const name in this.opts.formats) { - const format = this.opts.formats[name]; - if (format) - this.addFormat(name, format); - } - } - function addInitialKeywords(defs) { - if (Array.isArray(defs)) { - this.addVocabulary(defs); - return; - } - this.logger.warn("keywords option as map is deprecated, pass array"); - for (const keyword in defs) { - const def = defs[keyword]; - if (!def.keyword) - def.keyword = keyword; - this.addKeyword(def); - } - } - function getMetaSchemaOptions() { - const metaOpts = { ...this.opts }; - for (const opt of META_IGNORE_OPTIONS) - delete metaOpts[opt]; - return metaOpts; - } - var noLogs = { log() { - }, warn() { - }, error() { - } }; - function getLogger(logger) { - if (logger === false) - return noLogs; - if (logger === void 0) - return console; - if (logger.log && logger.warn && logger.error) - return logger; - throw new Error("logger must implement log, warn and error methods"); - } - var KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; - function checkKeyword(keyword, def) { - const { RULES } = this; - (0, util_1.eachItem)(keyword, (kwd) => { - if (RULES.keywords[kwd]) - throw new Error(`Keyword ${kwd} is already defined`); - if (!KEYWORD_NAME.test(kwd)) - throw new Error(`Keyword ${kwd} has invalid name`); - }); - if (!def) - return; - if (def.$data && !("code" in def || "validate" in def)) { - throw new Error('$data keyword must have "code" or "validate" function'); - } - } - function addRule(keyword, definition, dataType) { - var _a; - const post = definition === null || definition === void 0 ? void 0 : definition.post; - if (dataType && post) - throw new Error('keyword with "post" flag cannot have "type"'); - const { RULES } = this; - let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); - if (!ruleGroup) { - ruleGroup = { type: dataType, rules: [] }; - RULES.rules.push(ruleGroup); - } - RULES.keywords[keyword] = true; - if (!definition) - return; - const rule = { - keyword, - definition: { - ...definition, - type: (0, dataType_1.getJSONTypes)(definition.type), - schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType) - } - }; - if (definition.before) - addBeforeRule.call(this, ruleGroup, rule, definition.before); - else - ruleGroup.rules.push(rule); - RULES.all[keyword] = rule; - (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd)); - } - function addBeforeRule(ruleGroup, rule, before) { - const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before); - if (i >= 0) { - ruleGroup.rules.splice(i, 0, rule); - } else { - ruleGroup.rules.push(rule); - this.logger.warn(`rule ${before} is not defined`); - } - } - function keywordMetaschema(def) { - let { metaSchema } = def; - if (metaSchema === void 0) - return; - if (def.$data && this.opts.$data) - metaSchema = schemaOrData(metaSchema); - def.validateSchema = this.compile(metaSchema, true); - } - var $dataRef = { - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" - }; - function schemaOrData(schema) { - return { anyOf: [schema, $dataRef] }; - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js -var require_id = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var def = { - keyword: "id", - code() { - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js -var require_ref = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.callRef = exports2.getValidate = void 0; - var ref_error_1 = require_ref_error(); - var code_1 = require_code2(); - var codegen_1 = require_codegen(); - var names_1 = require_names(); - var compile_1 = require_compile(); - var util_1 = require_util(); - var def = { - keyword: "$ref", - schemaType: "string", - code(cxt) { - const { gen: gen2, schema: $ref, it } = cxt; - const { baseId, schemaEnv: env, validateName: validateName2, opts, self: self2 } = it; - const { root } = env; - if (($ref === "#" || $ref === "#/") && baseId === root.baseId) - return callRootRef(); - const schOrEnv = compile_1.resolveRef.call(self2, root, baseId, $ref); - if (schOrEnv === void 0) - throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); - if (schOrEnv instanceof compile_1.SchemaEnv) - return callValidate(schOrEnv); - return inlineRefSchema(schOrEnv); - function callRootRef() { - if (env === root) - return callRef(cxt, validateName2, env, env.$async); - const rootName = gen2.scopeValue("root", { ref: root }); - return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async); - } - function callValidate(sch) { - const v = getValidate(cxt, sch); - callRef(cxt, v, sch, sch.$async); - } - function inlineRefSchema(sch) { - const schName = gen2.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); - const valid = gen2.name("valid"); - const schCxt = cxt.subschema({ - schema: sch, - dataTypes: [], - schemaPath: codegen_1.nil, - topSchemaRef: schName, - errSchemaPath: $ref - }, valid); - cxt.mergeEvaluated(schCxt); - cxt.ok(valid); - } - } - }; - function getValidate(cxt, sch) { - const { gen: gen2 } = cxt; - return sch.validate ? gen2.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen2.scopeValue("wrapper", { ref: sch })}.validate`; - } - exports2.getValidate = getValidate; - function callRef(cxt, v, sch, $async) { - const { gen: gen2, it } = cxt; - const { allErrors, schemaEnv: env, opts } = it; - const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; - if ($async) - callAsyncRef(); - else - callSyncRef(); - function callAsyncRef() { - if (!env.$async) - throw new Error("async schema referenced by sync schema"); - const valid = gen2.let("valid"); - gen2.try(() => { - gen2.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); - addEvaluatedFrom(v); - if (!allErrors) - gen2.assign(valid, true); - }, (e) => { - gen2.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen2.throw(e)); - addErrorsFrom(e); - if (!allErrors) - gen2.assign(valid, false); - }); - cxt.ok(valid); - } - function callSyncRef() { - cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); - } - function addErrorsFrom(source) { - const errs = (0, codegen_1._)`${source}.errors`; - gen2.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); - gen2.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); - } - function addEvaluatedFrom(source) { - var _a; - if (!it.opts.unevaluated) - return; - const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; - if (it.props !== true) { - if (schEvaluated && !schEvaluated.dynamicProps) { - if (schEvaluated.props !== void 0) { - it.props = util_1.mergeEvaluated.props(gen2, schEvaluated.props, it.props); - } - } else { - const props = gen2.var("props", (0, codegen_1._)`${source}.evaluated.props`); - it.props = util_1.mergeEvaluated.props(gen2, props, it.props, codegen_1.Name); - } - } - if (it.items !== true) { - if (schEvaluated && !schEvaluated.dynamicItems) { - if (schEvaluated.items !== void 0) { - it.items = util_1.mergeEvaluated.items(gen2, schEvaluated.items, it.items); - } - } else { - const items = gen2.var("items", (0, codegen_1._)`${source}.evaluated.items`); - it.items = util_1.mergeEvaluated.items(gen2, items, it.items, codegen_1.Name); - } - } - } - } - exports2.callRef = callRef; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js -var require_core2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var id_1 = require_id(); - var ref_1 = require_ref(); - var core = [ - "$schema", - "$id", - "$defs", - "$vocabulary", - { keyword: "$comment" }, - "definitions", - id_1.default, - ref_1.default - ]; - exports2.default = core; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js -var require_limitNumber = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var ops = codegen_1.operators; - var KWDs = { - maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, - minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, - exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, - exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } - }; - var error = { - message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, - params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` - }; - var def = { - keyword: Object.keys(KWDs), - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js -var require_multipleOf = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var error = { - message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, - params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` - }; - var def = { - keyword: "multipleOf", - type: "number", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { gen: gen2, data, schemaCode, it } = cxt; - const prec = it.opts.multipleOfPrecision; - const res = gen2.let("res"); - const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`; - cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js -var require_ucs2length = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function ucs2length(str) { - const len = str.length; - let length = 0; - let pos = 0; - let value; - while (pos < len) { - length++; - value = str.charCodeAt(pos++); - if (value >= 55296 && value <= 56319 && pos < len) { - value = str.charCodeAt(pos); - if ((value & 64512) === 56320) - pos++; - } - } - return length; - } - exports2.default = ucs2length; - ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js -var require_limitLength = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var ucs2length_1 = require_ucs2length(); - var error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxLength" ? "more" : "fewer"; - return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; - }, - params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` - }; - var def = { - keyword: ["maxLength", "minLength"], - type: "string", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode, it } = cxt; - const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; - const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; - cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js -var require_pattern = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var code_1 = require_code2(); - var util_1 = require_util(); - var codegen_1 = require_codegen(); - var error = { - message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, - params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` - }; - var def = { - keyword: "pattern", - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt) { - const { gen: gen2, data, $data, schema, schemaCode, it } = cxt; - const u = it.opts.unicodeRegExp ? "u" : ""; - if ($data) { - const { regExp } = it.opts.code; - const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen2, regExp); - const valid = gen2.let("valid"); - gen2.try(() => gen2.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen2.assign(valid, false)); - cxt.fail$data((0, codegen_1._)`!${valid}`); - } else { - const regExp = (0, code_1.usePattern)(cxt, schema); - cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js -var require_limitProperties = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxProperties" ? "more" : "fewer"; - return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; - }, - params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` - }; - var def = { - keyword: ["maxProperties", "minProperties"], - type: "object", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js -var require_required = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var code_1 = require_code2(); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var error = { - message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, - params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` - }; - var def = { - keyword: "required", - type: "object", - schemaType: "array", - $data: true, - error, - code(cxt) { - const { gen: gen2, schema, schemaCode, data, $data, it } = cxt; - const { opts } = it; - if (!$data && schema.length === 0) - return; - const useLoop = schema.length >= opts.loopRequired; - if (it.allErrors) - allErrorsMode(); - else - exitOnErrorMode(); - if (opts.strictRequired) { - const props = cxt.parentSchema.properties; - const { definedProperties } = cxt.it; - for (const requiredKey of schema) { - if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) { - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; - const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; - (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); - } - } - } - function allErrorsMode() { - if (useLoop || $data) { - cxt.block$data(codegen_1.nil, loopAllRequired); - } else { - for (const prop of schema) { - (0, code_1.checkReportMissingProp)(cxt, prop); - } - } - } - function exitOnErrorMode() { - const missing = gen2.let("missing"); - if (useLoop || $data) { - const valid = gen2.let("valid", true); - cxt.block$data(valid, () => loopUntilMissing(missing, valid)); - cxt.ok(valid); - } else { - gen2.if((0, code_1.checkMissingProp)(cxt, schema, missing)); - (0, code_1.reportMissingProp)(cxt, missing); - gen2.else(); - } - } - function loopAllRequired() { - gen2.forOf("prop", schemaCode, (prop) => { - cxt.setParams({ missingProperty: prop }); - gen2.if((0, code_1.noPropertyInData)(gen2, data, prop, opts.ownProperties), () => cxt.error()); - }); - } - function loopUntilMissing(missing, valid) { - cxt.setParams({ missingProperty: missing }); - gen2.forOf(missing, schemaCode, () => { - gen2.assign(valid, (0, code_1.propertyInData)(gen2, data, missing, opts.ownProperties)); - gen2.if((0, codegen_1.not)(valid), () => { - cxt.error(); - gen2.break(); - }); - }, codegen_1.nil); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js -var require_limitItems = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var error = { - message({ keyword, schemaCode }) { - const comp = keyword === "maxItems" ? "more" : "fewer"; - return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; - }, - params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` - }; - var def = { - keyword: ["maxItems", "minItems"], - type: "array", - schemaType: "number", - $data: true, - error, - code(cxt) { - const { keyword, data, schemaCode } = cxt; - const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; - cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js -var require_equal = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var equal = require_fast_deep_equal(); - equal.code = 'require("ajv/dist/runtime/equal").default'; - exports2.default = equal; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js -var require_uniqueItems = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var dataType_1 = require_dataType(); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var equal_1 = require_equal(); - var error = { - message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, - params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}` - }; - var def = { - keyword: "uniqueItems", - type: "array", - schemaType: "boolean", - $data: true, - error, - code(cxt) { - const { gen: gen2, data, $data, schema, parentSchema, schemaCode, it } = cxt; - if (!$data && !schema) - return; - const valid = gen2.let("valid"); - const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; - cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`); - cxt.ok(valid); - function validateUniqueItems() { - const i = gen2.let("i", (0, codegen_1._)`${data}.length`); - const j = gen2.let("j"); - cxt.setParams({ i, j }); - gen2.assign(valid, true); - gen2.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); - } - function canOptimize() { - return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array"); - } - function loopN(i, j) { - const item = gen2.name("item"); - const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); - const indices = gen2.const("indices", (0, codegen_1._)`{}`); - gen2.for((0, codegen_1._)`;${i}--;`, () => { - gen2.let(item, (0, codegen_1._)`${data}[${i}]`); - gen2.if(wrongType, (0, codegen_1._)`continue`); - if (itemTypes.length > 1) - gen2.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`); - gen2.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => { - gen2.assign(j, (0, codegen_1._)`${indices}[${item}]`); - cxt.error(); - gen2.assign(valid, false).break(); - }).code((0, codegen_1._)`${indices}[${item}] = ${i}`); - }); - } - function loopN2(i, j) { - const eql = (0, util_1.useFunc)(gen2, equal_1.default); - const outer = gen2.name("outer"); - gen2.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen2.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen2.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => { - cxt.error(); - gen2.assign(valid, false).break(outer); - }))); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js -var require_const = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var equal_1 = require_equal(); - var error = { - message: "must be equal to constant", - params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` - }; - var def = { - keyword: "const", - $data: true, - error, - code(cxt) { - const { gen: gen2, data, $data, schemaCode, schema } = cxt; - if ($data || schema && typeof schema == "object") { - cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen2, equal_1.default)}(${data}, ${schemaCode})`); - } else { - cxt.fail((0, codegen_1._)`${schema} !== ${data}`); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js -var require_enum = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var equal_1 = require_equal(); - var error = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` - }; - var def = { - keyword: "enum", - schemaType: "array", - $data: true, - error, - code(cxt) { - const { gen: gen2, data, $data, schema, schemaCode, it } = cxt; - if (!$data && schema.length === 0) - throw new Error("enum must have non-empty array"); - const useLoop = schema.length >= it.opts.loopEnum; - let eql; - const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen2, equal_1.default); - let valid; - if (useLoop || $data) { - valid = gen2.let("valid"); - cxt.block$data(valid, loopEnum); - } else { - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const vSchema = gen2.const("vSchema", schemaCode); - valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i))); - } - cxt.pass(valid); - function loopEnum() { - gen2.assign(valid, false); - gen2.forOf("v", schemaCode, (v) => gen2.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen2.assign(valid, true).break())); - } - function equalCode(vSchema, i) { - const sch = schema[i]; - return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`; - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js -var require_validation2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var limitNumber_1 = require_limitNumber(); - var multipleOf_1 = require_multipleOf(); - var limitLength_1 = require_limitLength(); - var pattern_1 = require_pattern(); - var limitProperties_1 = require_limitProperties(); - var required_1 = require_required(); - var limitItems_1 = require_limitItems(); - var uniqueItems_1 = require_uniqueItems(); - var const_1 = require_const(); - var enum_1 = require_enum(); - var validation = [ - // number - limitNumber_1.default, - multipleOf_1.default, - // string - limitLength_1.default, - pattern_1.default, - // object - limitProperties_1.default, - required_1.default, - // array - limitItems_1.default, - uniqueItems_1.default, - // any - { keyword: "type", schemaType: ["string", "array"] }, - { keyword: "nullable", schemaType: "boolean" }, - const_1.default, - enum_1.default - ]; - exports2.default = validation; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js -var require_additionalItems = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateAdditionalItems = void 0; - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var error = { - message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` - }; - var def = { - keyword: "additionalItems", - type: "array", - schemaType: ["boolean", "object"], - before: "uniqueItems", - error, - code(cxt) { - const { parentSchema, it } = cxt; - const { items } = parentSchema; - if (!Array.isArray(items)) { - (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); - return; - } - validateAdditionalItems(cxt, items); - } - }; - function validateAdditionalItems(cxt, items) { - const { gen: gen2, schema, data, keyword, it } = cxt; - it.items = true; - const len = gen2.const("len", (0, codegen_1._)`${data}.length`); - if (schema === false) { - cxt.setParams({ len: items.length }); - cxt.pass((0, codegen_1._)`${len} <= ${items.length}`); - } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen2.var("valid", (0, codegen_1._)`${len} <= ${items.length}`); - gen2.if((0, codegen_1.not)(valid), () => validateItems(valid)); - cxt.ok(valid); - } - function validateItems(valid) { - gen2.forRange("i", items.length, len, (i) => { - cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); - if (!it.allErrors) - gen2.if((0, codegen_1.not)(valid), () => gen2.break()); - }); - } - } - exports2.validateAdditionalItems = validateAdditionalItems; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js -var require_items = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateTuple = void 0; - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var code_1 = require_code2(); - var def = { - keyword: "items", - type: "array", - schemaType: ["object", "array", "boolean"], - before: "uniqueItems", - code(cxt) { - const { schema, it } = cxt; - if (Array.isArray(schema)) - return validateTuple(cxt, "additionalItems", schema); - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - cxt.ok((0, code_1.validateArray)(cxt)); - } - }; - function validateTuple(cxt, extraItems, schArr = cxt.schema) { - const { gen: gen2, parentSchema, data, keyword, it } = cxt; - checkStrictTuple(parentSchema); - if (it.opts.unevaluated && schArr.length && it.items !== true) { - it.items = util_1.mergeEvaluated.items(gen2, schArr.length, it.items); - } - const valid = gen2.name("valid"); - const len = gen2.const("len", (0, codegen_1._)`${data}.length`); - schArr.forEach((sch, i) => { - if ((0, util_1.alwaysValidSchema)(it, sch)) - return; - gen2.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({ - keyword, - schemaProp: i, - dataProp: i - }, valid)); - cxt.ok(valid); - }); - function checkStrictTuple(sch) { - const { opts, errSchemaPath } = it; - const l = schArr.length; - const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); - if (opts.strictTuples && !fullTuple) { - const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; - (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); - } - } - } - exports2.validateTuple = validateTuple; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js -var require_prefixItems = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var items_1 = require_items(); - var def = { - keyword: "prefixItems", - type: "array", - schemaType: ["array"], - before: "uniqueItems", - code: (cxt) => (0, items_1.validateTuple)(cxt, "items") - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js -var require_items2020 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var code_1 = require_code2(); - var additionalItems_1 = require_additionalItems(); - var error = { - message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, - params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` - }; - var def = { - keyword: "items", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - error, - code(cxt) { - const { schema, parentSchema, it } = cxt; - const { prefixItems } = parentSchema; - it.items = true; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - if (prefixItems) - (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems); - else - cxt.ok((0, code_1.validateArray)(cxt)); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js -var require_contains = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var error = { - message: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`, - params: ({ params: { min, max } }) => max === void 0 ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}` - }; - var def = { - keyword: "contains", - type: "array", - schemaType: ["object", "boolean"], - before: "uniqueItems", - trackErrors: true, - error, - code(cxt) { - const { gen: gen2, schema, parentSchema, data, it } = cxt; - let min; - let max; - const { minContains, maxContains } = parentSchema; - if (it.opts.next) { - min = minContains === void 0 ? 1 : minContains; - max = maxContains; - } else { - min = 1; - } - const len = gen2.const("len", (0, codegen_1._)`${data}.length`); - cxt.setParams({ min, max }); - if (max === void 0 && min === 0) { - (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); - return; - } - if (max !== void 0 && min > max) { - (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); - cxt.fail(); - return; - } - if ((0, util_1.alwaysValidSchema)(it, schema)) { - let cond = (0, codegen_1._)`${len} >= ${min}`; - if (max !== void 0) - cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`; - cxt.pass(cond); - return; - } - it.items = true; - const valid = gen2.name("valid"); - if (max === void 0 && min === 1) { - validateItems(valid, () => gen2.if(valid, () => gen2.break())); - } else if (min === 0) { - gen2.let(valid, true); - if (max !== void 0) - gen2.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount); - } else { - gen2.let(valid, false); - validateItemsWithCount(); - } - cxt.result(valid, () => cxt.reset()); - function validateItemsWithCount() { - const schValid = gen2.name("_valid"); - const count = gen2.let("count", 0); - validateItems(schValid, () => gen2.if(schValid, () => checkLimits(count))); - } - function validateItems(_valid, block) { - gen2.forRange("i", 0, len, (i) => { - cxt.subschema({ - keyword: "contains", - dataProp: i, - dataPropType: util_1.Type.Num, - compositeRule: true - }, _valid); - block(); - }); - } - function checkLimits(count) { - gen2.code((0, codegen_1._)`${count}++`); - if (max === void 0) { - gen2.if((0, codegen_1._)`${count} >= ${min}`, () => gen2.assign(valid, true).break()); - } else { - gen2.if((0, codegen_1._)`${count} > ${max}`, () => gen2.assign(valid, false).break()); - if (min === 1) - gen2.assign(valid, true); - else - gen2.if((0, codegen_1._)`${count} >= ${min}`, () => gen2.assign(valid, true)); - } - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js -var require_dependencies = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateSchemaDeps = exports2.validatePropertyDeps = exports2.error = void 0; - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var code_1 = require_code2(); - exports2.error = { - message: ({ params: { property, depsCount, deps } }) => { - const property_ies = depsCount === 1 ? "property" : "properties"; - return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`; - }, - params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property}, - missingProperty: ${missingProperty}, - depsCount: ${depsCount}, - deps: ${deps}}` - // TODO change to reference - }; - var def = { - keyword: "dependencies", - type: "object", - schemaType: "object", - error: exports2.error, - code(cxt) { - const [propDeps, schDeps] = splitDependencies(cxt); - validatePropertyDeps(cxt, propDeps); - validateSchemaDeps(cxt, schDeps); - } - }; - function splitDependencies({ schema }) { - const propertyDeps = {}; - const schemaDeps = {}; - for (const key in schema) { - if (key === "__proto__") - continue; - const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; - deps[key] = schema[key]; - } - return [propertyDeps, schemaDeps]; - } - function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { - const { gen: gen2, data, it } = cxt; - if (Object.keys(propertyDeps).length === 0) - return; - const missing = gen2.let("missing"); - for (const prop in propertyDeps) { - const deps = propertyDeps[prop]; - if (deps.length === 0) - continue; - const hasProperty = (0, code_1.propertyInData)(gen2, data, prop, it.opts.ownProperties); - cxt.setParams({ - property: prop, - depsCount: deps.length, - deps: deps.join(", ") - }); - if (it.allErrors) { - gen2.if(hasProperty, () => { - for (const depProp of deps) { - (0, code_1.checkReportMissingProp)(cxt, depProp); - } - }); - } else { - gen2.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); - (0, code_1.reportMissingProp)(cxt, missing); - gen2.else(); - } - } - } - exports2.validatePropertyDeps = validatePropertyDeps; - function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { - const { gen: gen2, data, keyword, it } = cxt; - const valid = gen2.name("valid"); - for (const prop in schemaDeps) { - if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) - continue; - gen2.if( - (0, code_1.propertyInData)(gen2, data, prop, it.opts.ownProperties), - () => { - const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); - cxt.mergeValidEvaluated(schCxt, valid); - }, - () => gen2.var(valid, true) - // TODO var - ); - cxt.ok(valid); - } - } - exports2.validateSchemaDeps = validateSchemaDeps; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js -var require_propertyNames = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var error = { - message: "property name must be valid", - params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` - }; - var def = { - keyword: "propertyNames", - type: "object", - schemaType: ["object", "boolean"], - error, - code(cxt) { - const { gen: gen2, schema, data, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - const valid = gen2.name("valid"); - gen2.forIn("key", data, (key) => { - cxt.setParams({ propertyName: key }); - cxt.subschema({ - keyword: "propertyNames", - data: key, - dataTypes: ["string"], - propertyName: key, - compositeRule: true - }, valid); - gen2.if((0, codegen_1.not)(valid), () => { - cxt.error(true); - if (!it.allErrors) - gen2.break(); - }); - }); - cxt.ok(valid); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js -var require_additionalProperties = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var code_1 = require_code2(); - var codegen_1 = require_codegen(); - var names_1 = require_names(); - var util_1 = require_util(); - var error = { - message: "must NOT have additional properties", - params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` - }; - var def = { - keyword: "additionalProperties", - type: ["object"], - schemaType: ["boolean", "object"], - allowUndefined: true, - trackErrors: true, - error, - code(cxt) { - const { gen: gen2, schema, parentSchema, data, errsCount, it } = cxt; - if (!errsCount) - throw new Error("ajv implementation error"); - const { allErrors, opts } = it; - it.props = true; - if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema)) - return; - const props = (0, code_1.allSchemaProperties)(parentSchema.properties); - const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); - checkAdditionalProperties(); - cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); - function checkAdditionalProperties() { - gen2.forIn("key", data, (key) => { - if (!props.length && !patProps.length) - additionalPropertyCode(key); - else - gen2.if(isAdditional(key), () => additionalPropertyCode(key)); - }); - } - function isAdditional(key) { - let definedProp; - if (props.length > 8) { - const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); - definedProp = (0, code_1.isOwnProperty)(gen2, propsSchema, key); - } else if (props.length) { - definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key} === ${p}`)); - } else { - definedProp = codegen_1.nil; - } - if (patProps.length) { - definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); - } - return (0, codegen_1.not)(definedProp); - } - function deleteAdditional(key) { - gen2.code((0, codegen_1._)`delete ${data}[${key}]`); - } - function additionalPropertyCode(key) { - if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) { - deleteAdditional(key); - return; - } - if (schema === false) { - cxt.setParams({ additionalProperty: key }); - cxt.error(); - if (!allErrors) - gen2.break(); - return; - } - if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { - const valid = gen2.name("valid"); - if (opts.removeAdditional === "failing") { - applyAdditionalSchema(key, valid, false); - gen2.if((0, codegen_1.not)(valid), () => { - cxt.reset(); - deleteAdditional(key); - }); - } else { - applyAdditionalSchema(key, valid); - if (!allErrors) - gen2.if((0, codegen_1.not)(valid), () => gen2.break()); - } - } - } - function applyAdditionalSchema(key, valid, errors) { - const subschema = { - keyword: "additionalProperties", - dataProp: key, - dataPropType: util_1.Type.Str - }; - if (errors === false) { - Object.assign(subschema, { - compositeRule: true, - createErrors: false, - allErrors: false - }); - } - cxt.subschema(subschema, valid); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js -var require_properties = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var validate_1 = require_validate(); - var code_1 = require_code2(); - var util_1 = require_util(); - var additionalProperties_1 = require_additionalProperties(); - var def = { - keyword: "properties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen: gen2, schema, parentSchema, data, it } = cxt; - if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) { - additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); - } - const allProps = (0, code_1.allSchemaProperties)(schema); - for (const prop of allProps) { - it.definedProperties.add(prop); - } - if (it.opts.unevaluated && allProps.length && it.props !== true) { - it.props = util_1.mergeEvaluated.props(gen2, (0, util_1.toHash)(allProps), it.props); - } - const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); - if (properties.length === 0) - return; - const valid = gen2.name("valid"); - for (const prop of properties) { - if (hasDefault(prop)) { - applyPropertySchema(prop); - } else { - gen2.if((0, code_1.propertyInData)(gen2, data, prop, it.opts.ownProperties)); - applyPropertySchema(prop); - if (!it.allErrors) - gen2.else().var(valid, true); - gen2.endIf(); - } - cxt.it.definedProperties.add(prop); - cxt.ok(valid); - } - function hasDefault(prop) { - return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== void 0; - } - function applyPropertySchema(prop) { - cxt.subschema({ - keyword: "properties", - schemaProp: prop, - dataProp: prop - }, valid); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js -var require_patternProperties = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var code_1 = require_code2(); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var util_2 = require_util(); - var def = { - keyword: "patternProperties", - type: "object", - schemaType: "object", - code(cxt) { - const { gen: gen2, schema, data, parentSchema, it } = cxt; - const { opts } = it; - const patterns = (0, code_1.allSchemaProperties)(schema); - const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p])); - if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) { - return; - } - const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; - const valid = gen2.name("valid"); - if (it.props !== true && !(it.props instanceof codegen_1.Name)) { - it.props = (0, util_2.evaluatedPropsToName)(gen2, it.props); - } - const { props } = it; - validatePatternProperties(); - function validatePatternProperties() { - for (const pat of patterns) { - if (checkProperties) - checkMatchingProperties(pat); - if (it.allErrors) { - validateProperties(pat); - } else { - gen2.var(valid, true); - validateProperties(pat); - gen2.if(valid); - } - } - } - function checkMatchingProperties(pat) { - for (const prop in checkProperties) { - if (new RegExp(pat).test(prop)) { - (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); - } - } - } - function validateProperties(pat) { - gen2.forIn("key", data, (key) => { - gen2.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { - const alwaysValid = alwaysValidPatterns.includes(pat); - if (!alwaysValid) { - cxt.subschema({ - keyword: "patternProperties", - schemaProp: pat, - dataProp: key, - dataPropType: util_2.Type.Str - }, valid); - } - if (it.opts.unevaluated && props !== true) { - gen2.assign((0, codegen_1._)`${props}[${key}]`, true); - } else if (!alwaysValid && !it.allErrors) { - gen2.if((0, codegen_1.not)(valid), () => gen2.break()); - } - }); - }); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js -var require_not = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var def = { - keyword: "not", - schemaType: ["object", "boolean"], - trackErrors: true, - code(cxt) { - const { gen: gen2, schema, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) { - cxt.fail(); - return; - } - const valid = gen2.name("valid"); - cxt.subschema({ - keyword: "not", - compositeRule: true, - createErrors: false, - allErrors: false - }, valid); - cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); - }, - error: { message: "must NOT be valid" } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js -var require_anyOf = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var code_1 = require_code2(); - var def = { - keyword: "anyOf", - schemaType: "array", - trackErrors: true, - code: code_1.validateUnion, - error: { message: "must match a schema in anyOf" } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js -var require_oneOf = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var error = { - message: "must match exactly one schema in oneOf", - params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` - }; - var def = { - keyword: "oneOf", - schemaType: "array", - trackErrors: true, - error, - code(cxt) { - const { gen: gen2, schema, parentSchema, it } = cxt; - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - if (it.opts.discriminator && parentSchema.discriminator) - return; - const schArr = schema; - const valid = gen2.let("valid", false); - const passing = gen2.let("passing", null); - const schValid = gen2.name("_valid"); - cxt.setParams({ passing }); - gen2.block(validateOneOf); - cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); - function validateOneOf() { - schArr.forEach((sch, i) => { - let schCxt; - if ((0, util_1.alwaysValidSchema)(it, sch)) { - gen2.var(schValid, true); - } else { - schCxt = cxt.subschema({ - keyword: "oneOf", - schemaProp: i, - compositeRule: true - }, schValid); - } - if (i > 0) { - gen2.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else(); - } - gen2.if(schValid, () => { - gen2.assign(valid, true); - gen2.assign(passing, i); - if (schCxt) - cxt.mergeEvaluated(schCxt, codegen_1.Name); - }); - }); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js -var require_allOf = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var def = { - keyword: "allOf", - schemaType: "array", - code(cxt) { - const { gen: gen2, schema, it } = cxt; - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - const valid = gen2.name("valid"); - schema.forEach((sch, i) => { - if ((0, util_1.alwaysValidSchema)(it, sch)) - return; - const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); - cxt.ok(valid); - cxt.mergeEvaluated(schCxt); - }); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js -var require_if = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var util_1 = require_util(); - var error = { - message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, - params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` - }; - var def = { - keyword: "if", - schemaType: ["object", "boolean"], - trackErrors: true, - error, - code(cxt) { - const { gen: gen2, parentSchema, it } = cxt; - if (parentSchema.then === void 0 && parentSchema.else === void 0) { - (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); - } - const hasThen = hasSchema(it, "then"); - const hasElse = hasSchema(it, "else"); - if (!hasThen && !hasElse) - return; - const valid = gen2.let("valid", true); - const schValid = gen2.name("_valid"); - validateIf(); - cxt.reset(); - if (hasThen && hasElse) { - const ifClause = gen2.let("ifClause"); - cxt.setParams({ ifClause }); - gen2.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); - } else if (hasThen) { - gen2.if(schValid, validateClause("then")); - } else { - gen2.if((0, codegen_1.not)(schValid), validateClause("else")); - } - cxt.pass(valid, () => cxt.error(true)); - function validateIf() { - const schCxt = cxt.subschema({ - keyword: "if", - compositeRule: true, - createErrors: false, - allErrors: false - }, schValid); - cxt.mergeEvaluated(schCxt); - } - function validateClause(keyword, ifClause) { - return () => { - const schCxt = cxt.subschema({ keyword }, schValid); - gen2.assign(valid, schValid); - cxt.mergeValidEvaluated(schCxt, valid); - if (ifClause) - gen2.assign(ifClause, (0, codegen_1._)`${keyword}`); - else - cxt.setParams({ ifClause: keyword }); - }; - } - } - }; - function hasSchema(it, keyword) { - const schema = it.schema[keyword]; - return schema !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema); - } - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js -var require_thenElse = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var def = { - keyword: ["then", "else"], - schemaType: ["object", "boolean"], - code({ keyword, parentSchema, it }) { - if (parentSchema.if === void 0) - (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js -var require_applicator = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var additionalItems_1 = require_additionalItems(); - var prefixItems_1 = require_prefixItems(); - var items_1 = require_items(); - var items2020_1 = require_items2020(); - var contains_1 = require_contains(); - var dependencies_1 = require_dependencies(); - var propertyNames_1 = require_propertyNames(); - var additionalProperties_1 = require_additionalProperties(); - var properties_1 = require_properties(); - var patternProperties_1 = require_patternProperties(); - var not_1 = require_not(); - var anyOf_1 = require_anyOf(); - var oneOf_1 = require_oneOf(); - var allOf_1 = require_allOf(); - var if_1 = require_if(); - var thenElse_1 = require_thenElse(); - function getApplicator(draft2020 = false) { - const applicator = [ - // any - not_1.default, - anyOf_1.default, - oneOf_1.default, - allOf_1.default, - if_1.default, - thenElse_1.default, - // object - propertyNames_1.default, - additionalProperties_1.default, - dependencies_1.default, - properties_1.default, - patternProperties_1.default - ]; - if (draft2020) - applicator.push(prefixItems_1.default, items2020_1.default); - else - applicator.push(additionalItems_1.default, items_1.default); - applicator.push(contains_1.default); - return applicator; - } - exports2.default = getApplicator; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js -var require_format = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var error = { - message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, - params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` - }; - var def = { - keyword: "format", - type: ["number", "string"], - schemaType: "string", - $data: true, - error, - code(cxt, ruleType) { - const { gen: gen2, data, $data, schema, schemaCode, it } = cxt; - const { opts, errSchemaPath, schemaEnv, self: self2 } = it; - if (!opts.validateFormats) - return; - if ($data) - validate$DataFormat(); - else - validateFormat(); - function validate$DataFormat() { - const fmts = gen2.scopeValue("formats", { - ref: self2.formats, - code: opts.code.formats - }); - const fDef = gen2.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`); - const fType = gen2.let("fType"); - const format = gen2.let("format"); - gen2.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen2.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen2.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef)); - cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); - function unknownFmt() { - if (opts.strictSchema === false) - return codegen_1.nil; - return (0, codegen_1._)`${schemaCode} && !${format}`; - } - function invalidFmt() { - const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`; - const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; - return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; - } - } - function validateFormat() { - const formatDef = self2.formats[schema]; - if (!formatDef) { - unknownFormat(); - return; - } - if (formatDef === true) - return; - const [fmtType, format, fmtRef] = getFormat(formatDef); - if (fmtType === ruleType) - cxt.pass(validCondition()); - function unknownFormat() { - if (opts.strictSchema === false) { - self2.logger.warn(unknownMsg()); - return; - } - throw new Error(unknownMsg()); - function unknownMsg() { - return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; - } - } - function getFormat(fmtDef) { - const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0; - const fmt = gen2.scopeValue("formats", { key: schema, ref: fmtDef, code }); - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { - return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`]; - } - return ["string", fmtDef, fmt]; - } - function validCondition() { - if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { - if (!schemaEnv.$async) - throw new Error("async format in sync schema"); - return (0, codegen_1._)`await ${fmtRef}(${data})`; - } - return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`; - } - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js -var require_format2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var format_1 = require_format(); - var format = [format_1.default]; - exports2.default = format; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js -var require_metadata = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.contentVocabulary = exports2.metadataVocabulary = void 0; - exports2.metadataVocabulary = [ - "title", - "description", - "default", - "deprecated", - "readOnly", - "writeOnly", - "examples" - ]; - exports2.contentVocabulary = [ - "contentMediaType", - "contentEncoding", - "contentSchema" - ]; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js -var require_draft7 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var core_1 = require_core2(); - var validation_1 = require_validation2(); - var applicator_1 = require_applicator(); - var format_1 = require_format2(); - var metadata_1 = require_metadata(); - var draft7Vocabularies = [ - core_1.default, - validation_1.default, - (0, applicator_1.default)(), - format_1.default, - metadata_1.metadataVocabulary, - metadata_1.contentVocabulary - ]; - exports2.default = draft7Vocabularies; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js -var require_types = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DiscrError = void 0; - var DiscrError; - (function(DiscrError2) { - DiscrError2["Tag"] = "tag"; - DiscrError2["Mapping"] = "mapping"; - })(DiscrError || (exports2.DiscrError = DiscrError = {})); - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js -var require_discriminator = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var types_1 = require_types(); - var compile_1 = require_compile(); - var ref_error_1 = require_ref_error(); - var util_1 = require_util(); - var error = { - message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, - params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}` - }; - var def = { - keyword: "discriminator", - type: "object", - schemaType: "object", - error, - code(cxt) { - const { gen: gen2, data, schema, parentSchema, it } = cxt; - const { oneOf } = parentSchema; - if (!it.opts.discriminator) { - throw new Error("discriminator: requires discriminator option"); - } - const tagName = schema.propertyName; - if (typeof tagName != "string") - throw new Error("discriminator: requires propertyName"); - if (schema.mapping) - throw new Error("discriminator: mapping is not supported"); - if (!oneOf) - throw new Error("discriminator: requires oneOf keyword"); - const valid = gen2.let("valid", false); - const tag = gen2.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`); - gen2.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); - cxt.ok(valid); - function validateMapping() { - const mapping = getMapping(); - gen2.if(false); - for (const tagValue in mapping) { - gen2.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); - gen2.assign(valid, applyTagSchema(mapping[tagValue])); - } - gen2.else(); - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); - gen2.endIf(); - } - function applyTagSchema(schemaProp) { - const _valid = gen2.name("valid"); - const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); - cxt.mergeEvaluated(schCxt, codegen_1.Name); - return _valid; - } - function getMapping() { - var _a; - const oneOfMapping = {}; - const topRequired = hasRequired(parentSchema); - let tagRequired = true; - for (let i = 0; i < oneOf.length; i++) { - let sch = oneOf[i]; - if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { - const ref = sch.$ref; - sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); - if (sch instanceof compile_1.SchemaEnv) - sch = sch.schema; - if (sch === void 0) - throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); - } - const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; - if (typeof propSch != "object") { - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); - } - tagRequired = tagRequired && (topRequired || hasRequired(sch)); - addMappings(propSch, i); - } - if (!tagRequired) - throw new Error(`discriminator: "${tagName}" must be required`); - return oneOfMapping; - function hasRequired({ required }) { - return Array.isArray(required) && required.includes(tagName); - } - function addMappings(sch, i) { - if (sch.const) { - addMapping(sch.const, i); - } else if (sch.enum) { - for (const tagValue of sch.enum) { - addMapping(tagValue, i); - } - } else { - throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); - } - } - function addMapping(tagValue, i) { - if (typeof tagValue != "string" || tagValue in oneOfMapping) { - throw new Error(`discriminator: "${tagName}" values must be unique strings`); - } - oneOfMapping[tagValue] = i; - } - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json -var require_json_schema_draft_07 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.json"(exports2, module2) { - module2.exports = { - $schema: "http://json-schema.org/draft-07/schema#", - $id: "http://json-schema.org/draft-07/schema#", - title: "Core schema meta-schema", - definitions: { - schemaArray: { - type: "array", - minItems: 1, - items: { $ref: "#" } - }, - nonNegativeInteger: { - type: "integer", - minimum: 0 - }, - nonNegativeIntegerDefault0: { - allOf: [{ $ref: "#/definitions/nonNegativeInteger" }, { default: 0 }] - }, - simpleTypes: { - enum: ["array", "boolean", "integer", "null", "number", "object", "string"] - }, - stringArray: { - type: "array", - items: { type: "string" }, - uniqueItems: true, - default: [] - } - }, - type: ["object", "boolean"], - properties: { - $id: { - type: "string", - format: "uri-reference" - }, - $schema: { - type: "string", - format: "uri" - }, - $ref: { - type: "string", - format: "uri-reference" - }, - $comment: { - type: "string" - }, - title: { - type: "string" - }, - description: { - type: "string" - }, - default: true, - readOnly: { - type: "boolean", - default: false - }, - examples: { - type: "array", - items: true - }, - multipleOf: { - type: "number", - exclusiveMinimum: 0 - }, - maximum: { - type: "number" - }, - exclusiveMaximum: { - type: "number" - }, - minimum: { - type: "number" - }, - exclusiveMinimum: { - type: "number" - }, - maxLength: { $ref: "#/definitions/nonNegativeInteger" }, - minLength: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, - pattern: { - type: "string", - format: "regex" - }, - additionalItems: { $ref: "#" }, - items: { - anyOf: [{ $ref: "#" }, { $ref: "#/definitions/schemaArray" }], - default: true - }, - maxItems: { $ref: "#/definitions/nonNegativeInteger" }, - minItems: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, - uniqueItems: { - type: "boolean", - default: false - }, - contains: { $ref: "#" }, - maxProperties: { $ref: "#/definitions/nonNegativeInteger" }, - minProperties: { $ref: "#/definitions/nonNegativeIntegerDefault0" }, - required: { $ref: "#/definitions/stringArray" }, - additionalProperties: { $ref: "#" }, - definitions: { - type: "object", - additionalProperties: { $ref: "#" }, - default: {} - }, - properties: { - type: "object", - additionalProperties: { $ref: "#" }, - default: {} - }, - patternProperties: { - type: "object", - additionalProperties: { $ref: "#" }, - propertyNames: { format: "regex" }, - default: {} - }, - dependencies: { - type: "object", - additionalProperties: { - anyOf: [{ $ref: "#" }, { $ref: "#/definitions/stringArray" }] - } - }, - propertyNames: { $ref: "#" }, - const: true, - enum: { - type: "array", - items: true, - minItems: 1, - uniqueItems: true - }, - type: { - anyOf: [ - { $ref: "#/definitions/simpleTypes" }, - { - type: "array", - items: { $ref: "#/definitions/simpleTypes" }, - minItems: 1, - uniqueItems: true - } - ] - }, - format: { type: "string" }, - contentMediaType: { type: "string" }, - contentEncoding: { type: "string" }, - if: { $ref: "#" }, - then: { $ref: "#" }, - else: { $ref: "#" }, - allOf: { $ref: "#/definitions/schemaArray" }, - anyOf: { $ref: "#/definitions/schemaArray" }, - oneOf: { $ref: "#/definitions/schemaArray" }, - not: { $ref: "#" } - }, - default: true - }; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js -var require_ajv = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv = void 0; - var core_1 = require_core(); - var draft7_1 = require_draft7(); - var discriminator_1 = require_discriminator(); - var draft7MetaSchema = require_json_schema_draft_07(); - var META_SUPPORT_DATA = ["/properties"]; - var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; - var Ajv = class extends core_1.default { - _addVocabularies() { - super._addVocabularies(); - draft7_1.default.forEach((v) => this.addVocabulary(v)); - if (this.opts.discriminator) - this.addKeyword(discriminator_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - if (!this.opts.meta) - return; - const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema; - this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; - } - defaultMeta() { - return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); - } - }; - exports2.Ajv = Ajv; - module2.exports = exports2 = Ajv; - module2.exports.Ajv = Ajv; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.default = Ajv; - var validate_1 = require_validate(); - Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() { - return validate_1.KeywordCxt; - } }); - var codegen_1 = require_codegen(); - Object.defineProperty(exports2, "_", { enumerable: true, get: function() { - return codegen_1._; - } }); - Object.defineProperty(exports2, "str", { enumerable: true, get: function() { - return codegen_1.str; - } }); - Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() { - return codegen_1.stringify; - } }); - Object.defineProperty(exports2, "nil", { enumerable: true, get: function() { - return codegen_1.nil; - } }); - Object.defineProperty(exports2, "Name", { enumerable: true, get: function() { - return codegen_1.Name; - } }); - Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() { - return codegen_1.CodeGen; - } }); - var validation_error_1 = require_validation_error(); - Object.defineProperty(exports2, "ValidationError", { enumerable: true, get: function() { - return validation_error_1.default; - } }); - var ref_error_1 = require_ref_error(); - Object.defineProperty(exports2, "MissingRefError", { enumerable: true, get: function() { - return ref_error_1.default; - } }); - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/metadata.js -var require_metadata2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/metadata.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkMetadata = void 0; - var util_1 = require_util(); - var def = { - keyword: "metadata", - schemaType: "object", - code(cxt) { - checkMetadata(cxt); - const { gen: gen2, schema, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - const valid = gen2.name("valid"); - cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid); - cxt.ok(valid); - } - }; - function checkMetadata({ it, keyword }, metadata) { - if (it.jtdMetadata !== metadata) { - throw new Error(`JTD: "${keyword}" cannot be used in this schema location`); - } - } - exports2.checkMetadata = checkMetadata; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/ref.js -var require_ref2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/ref.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hasRef = void 0; - var compile_1 = require_compile(); - var codegen_1 = require_codegen(); - var ref_error_1 = require_ref_error(); - var names_1 = require_names(); - var ref_1 = require_ref(); - var metadata_1 = require_metadata2(); - var def = { - keyword: "ref", - schemaType: "string", - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen: gen2, data, schema: ref, parentSchema, it } = cxt; - const { schemaEnv: { root } } = it; - const valid = gen2.name("valid"); - if (parentSchema.nullable) { - gen2.var(valid, (0, codegen_1._)`${data} === null`); - gen2.if((0, codegen_1.not)(valid), validateJtdRef); - } else { - gen2.var(valid, false); - validateJtdRef(); - } - cxt.ok(valid); - function validateJtdRef() { - var _a; - const refSchema = (_a = root.schema.definitions) === null || _a === void 0 ? void 0 : _a[ref]; - if (!refSchema) { - throw new ref_error_1.default(it.opts.uriResolver, "", ref, `No definition ${ref}`); - } - if (hasRef(refSchema) || !it.opts.inlineRefs) - callValidate(refSchema); - else - inlineRefSchema(refSchema); - } - function callValidate(schema) { - const sch = compile_1.compileSchema.call(it.self, new compile_1.SchemaEnv({ schema, root, schemaPath: `/definitions/${ref}` })); - const v = (0, ref_1.getValidate)(cxt, sch); - const errsCount = gen2.const("_errs", names_1.default.errors); - (0, ref_1.callRef)(cxt, v, sch, sch.$async); - gen2.assign(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); - } - function inlineRefSchema(schema) { - const schName = gen2.scopeValue("schema", it.opts.code.source === true ? { ref: schema, code: (0, codegen_1.stringify)(schema) } : { ref: schema }); - cxt.subschema({ - schema, - dataTypes: [], - schemaPath: codegen_1.nil, - topSchemaRef: schName, - errSchemaPath: `/definitions/${ref}` - }, valid); - } - } - }; - function hasRef(schema) { - for (const key in schema) { - let sch; - if (key === "ref" || typeof (sch = schema[key]) == "object" && hasRef(sch)) - return true; - } - return false; - } - exports2.hasRef = hasRef; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/timestamp.js -var require_timestamp = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/timestamp.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var DT_SEPARATOR = /t|\s/i; - var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; - var TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i; - var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function validTimestamp(str, allowDate) { - const dt = str.split(DT_SEPARATOR); - return dt.length === 2 && validDate(dt[0]) && validTime(dt[1]) || allowDate && dt.length === 1 && validDate(dt[0]); - } - exports2.default = validTimestamp; - function validDate(str) { - const matches = DATE.exec(str); - if (!matches) - return false; - const y = +matches[1]; - const m = +matches[2]; - const d = +matches[3]; - return m >= 1 && m <= 12 && d >= 1 && (d <= DAYS[m] || // leap year: https://tools.ietf.org/html/rfc3339#appendix-C - m === 2 && d === 29 && (y % 100 === 0 ? y % 400 === 0 : y % 4 === 0)); - } - function validTime(str) { - const matches = TIME.exec(str); - if (!matches) - return false; - const hr = +matches[1]; - const min = +matches[2]; - const sec = +matches[3]; - const tzH = +(matches[4] || 0); - const tzM = +(matches[5] || 0); - return hr <= 23 && min <= 59 && sec <= 59 || // leap second - hr - tzH === 23 && min - tzM === 59 && sec === 60; - } - validTimestamp.code = 'require("ajv/dist/runtime/timestamp").default'; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/error.js -var require_error2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.typeErrorParams = exports2.typeErrorMessage = exports2.typeError = void 0; - var codegen_1 = require_codegen(); - function typeError(t) { - return { - message: (cxt) => typeErrorMessage(cxt, t), - params: (cxt) => typeErrorParams(cxt, t) - }; - } - exports2.typeError = typeError; - function typeErrorMessage({ parentSchema }, t) { - return (parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable) ? `must be ${t} or null` : `must be ${t}`; - } - exports2.typeErrorMessage = typeErrorMessage; - function typeErrorParams({ parentSchema }, t) { - return (0, codegen_1._)`{type: ${t}, nullable: ${!!(parentSchema === null || parentSchema === void 0 ? void 0 : parentSchema.nullable)}}`; - } - exports2.typeErrorParams = typeErrorParams; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/type.js -var require_type = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/type.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.intRange = void 0; - var codegen_1 = require_codegen(); - var timestamp_1 = require_timestamp(); - var util_1 = require_util(); - var metadata_1 = require_metadata2(); - var error_1 = require_error2(); - exports2.intRange = { - int8: [-128, 127, 3], - uint8: [0, 255, 3], - int16: [-32768, 32767, 5], - uint16: [0, 65535, 5], - int32: [-2147483648, 2147483647, 10], - uint32: [0, 4294967295, 10] - }; - var error = { - message: (cxt) => (0, error_1.typeErrorMessage)(cxt, cxt.schema), - params: (cxt) => (0, error_1.typeErrorParams)(cxt, cxt.schema) - }; - function timestampCode(cxt) { - const { gen: gen2, data, it } = cxt; - const { timestamp, allowDate } = it.opts; - if (timestamp === "date") - return (0, codegen_1._)`${data} instanceof Date `; - const vts = (0, util_1.useFunc)(gen2, timestamp_1.default); - const allowDateArg = allowDate ? (0, codegen_1._)`, true` : codegen_1.nil; - const validString = (0, codegen_1._)`typeof ${data} == "string" && ${vts}(${data}${allowDateArg})`; - return timestamp === "string" ? validString : (0, codegen_1.or)((0, codegen_1._)`${data} instanceof Date`, validString); - } - var def = { - keyword: "type", - schemaType: "string", - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { data, schema, parentSchema, it } = cxt; - let cond; - switch (schema) { - case "boolean": - case "string": - cond = (0, codegen_1._)`typeof ${data} == ${schema}`; - break; - case "timestamp": { - cond = timestampCode(cxt); - break; - } - case "float32": - case "float64": - cond = (0, codegen_1._)`typeof ${data} == "number"`; - break; - default: { - const sch = schema; - cond = (0, codegen_1._)`typeof ${data} == "number" && isFinite(${data}) && !(${data} % 1)`; - if (!it.opts.int32range && (sch === "int32" || sch === "uint32")) { - if (sch === "uint32") - cond = (0, codegen_1._)`${cond} && ${data} >= 0`; - } else { - const [min, max] = exports2.intRange[sch]; - cond = (0, codegen_1._)`${cond} && ${data} >= ${min} && ${data} <= ${max}`; - } - } - } - cxt.pass(parentSchema.nullable ? (0, codegen_1.or)((0, codegen_1._)`${data} === null`, cond) : cond); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/nullable.js -var require_nullable = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/nullable.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkNullableObject = exports2.checkNullable = void 0; - var codegen_1 = require_codegen(); - function checkNullable({ gen: gen2, data, parentSchema }, cond = codegen_1.nil) { - const valid = gen2.name("valid"); - if (parentSchema.nullable) { - gen2.let(valid, (0, codegen_1._)`${data} === null`); - cond = (0, codegen_1.not)(valid); - } else { - gen2.let(valid, false); - } - return [valid, cond]; - } - exports2.checkNullable = checkNullable; - function checkNullableObject(cxt, cond) { - const [valid, cond_] = checkNullable(cxt, cond); - return [valid, (0, codegen_1._)`${cond_} && typeof ${cxt.data} == "object" && !Array.isArray(${cxt.data})`]; - } - exports2.checkNullableObject = checkNullableObject; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/enum.js -var require_enum2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/enum.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var metadata_1 = require_metadata2(); - var nullable_1 = require_nullable(); - var error = { - message: "must be equal to one of the allowed values", - params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` - }; - var def = { - keyword: "enum", - schemaType: "array", - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen: gen2, data, schema, schemaValue, parentSchema, it } = cxt; - if (schema.length === 0) - throw new Error("enum must have non-empty array"); - if (schema.length !== new Set(schema).size) - throw new Error("enum items must be unique"); - let valid; - const isString = (0, codegen_1._)`typeof ${data} == "string"`; - if (schema.length >= it.opts.loopEnum) { - let cond; - [valid, cond] = (0, nullable_1.checkNullable)(cxt, isString); - gen2.if(cond, loopEnum); - } else { - if (!Array.isArray(schema)) - throw new Error("ajv implementation error"); - valid = (0, codegen_1.and)(isString, (0, codegen_1.or)(...schema.map((value) => (0, codegen_1._)`${data} === ${value}`))); - if (parentSchema.nullable) - valid = (0, codegen_1.or)((0, codegen_1._)`${data} === null`, valid); - } - cxt.pass(valid); - function loopEnum() { - gen2.forOf("v", schemaValue, (v) => gen2.if((0, codegen_1._)`${valid} = ${data} === ${v}`, () => gen2.break())); - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/elements.js -var require_elements = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/elements.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var code_1 = require_code2(); - var codegen_1 = require_codegen(); - var metadata_1 = require_metadata2(); - var nullable_1 = require_nullable(); - var error_1 = require_error2(); - var def = { - keyword: "elements", - schemaType: "object", - error: (0, error_1.typeError)("array"), - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen: gen2, data, schema, it } = cxt; - if ((0, util_1.alwaysValidSchema)(it, schema)) - return; - const [valid] = (0, nullable_1.checkNullable)(cxt); - gen2.if((0, codegen_1.not)(valid), () => gen2.if((0, codegen_1._)`Array.isArray(${data})`, () => gen2.assign(valid, (0, code_1.validateArray)(cxt)), () => cxt.error())); - cxt.ok(valid); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/properties.js -var require_properties2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/properties.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.validateProperties = exports2.error = void 0; - var code_1 = require_code2(); - var util_1 = require_util(); - var codegen_1 = require_codegen(); - var metadata_1 = require_metadata2(); - var nullable_1 = require_nullable(); - var error_1 = require_error2(); - var PropError; - (function(PropError2) { - PropError2["Additional"] = "additional"; - PropError2["Missing"] = "missing"; - })(PropError || (PropError = {})); - exports2.error = { - message: (cxt) => { - const { params } = cxt; - return params.propError ? params.propError === PropError.Additional ? "must NOT have additional properties" : `must have property '${params.missingProperty}'` : (0, error_1.typeErrorMessage)(cxt, "object"); - }, - params: (cxt) => { - const { params } = cxt; - return params.propError ? params.propError === PropError.Additional ? (0, codegen_1._)`{error: ${params.propError}, additionalProperty: ${params.additionalProperty}}` : (0, codegen_1._)`{error: ${params.propError}, missingProperty: ${params.missingProperty}}` : (0, error_1.typeErrorParams)(cxt, "object"); - } - }; - var def = { - keyword: "properties", - schemaType: "object", - error: exports2.error, - code: validateProperties - }; - function validateProperties(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen: gen2, data, parentSchema, it } = cxt; - const { additionalProperties, nullable: nullable2 } = parentSchema; - if (it.jtdDiscriminator && nullable2) - throw new Error("JTD: nullable inside discriminator mapping"); - if (commonProperties()) { - throw new Error("JTD: properties and optionalProperties have common members"); - } - const [allProps, properties] = schemaProperties("properties"); - const [allOptProps, optProperties] = schemaProperties("optionalProperties"); - if (properties.length === 0 && optProperties.length === 0 && additionalProperties) { - return; - } - const [valid, cond] = it.jtdDiscriminator === void 0 ? (0, nullable_1.checkNullableObject)(cxt, data) : [gen2.let("valid", false), true]; - gen2.if(cond, () => gen2.assign(valid, true).block(() => { - validateProps(properties, "properties", true); - validateProps(optProperties, "optionalProperties"); - if (!additionalProperties) - validateAdditional(); - })); - cxt.pass(valid); - function commonProperties() { - const props = parentSchema.properties; - const optProps = parentSchema.optionalProperties; - if (!(props && optProps)) - return false; - for (const p in props) { - if (Object.prototype.hasOwnProperty.call(optProps, p)) - return true; - } - return false; - } - function schemaProperties(keyword) { - const schema = parentSchema[keyword]; - const allPs = schema ? (0, code_1.allSchemaProperties)(schema) : []; - if (it.jtdDiscriminator && allPs.some((p) => p === it.jtdDiscriminator)) { - throw new Error(`JTD: discriminator tag used in ${keyword}`); - } - const ps = allPs.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p])); - return [allPs, ps]; - } - function validateProps(props, keyword, required) { - const _valid = gen2.var("valid"); - for (const prop of props) { - gen2.if((0, code_1.propertyInData)(gen2, data, prop, it.opts.ownProperties), () => applyPropertySchema(prop, keyword, _valid), () => missingProperty(prop)); - cxt.ok(_valid); - } - function missingProperty(prop) { - if (required) { - gen2.assign(_valid, false); - cxt.error(false, { propError: PropError.Missing, missingProperty: prop }, { schemaPath: prop }); - } else { - gen2.assign(_valid, true); - } - } - } - function applyPropertySchema(prop, keyword, _valid) { - cxt.subschema({ - keyword, - schemaProp: prop, - dataProp: prop - }, _valid); - } - function validateAdditional() { - gen2.forIn("key", data, (key) => { - const addProp = isAdditional(key, allProps, "properties", it.jtdDiscriminator); - const addOptProp = isAdditional(key, allOptProps, "optionalProperties"); - const extra = addProp === true ? addOptProp : addOptProp === true ? addProp : (0, codegen_1.and)(addProp, addOptProp); - gen2.if(extra, () => { - if (it.opts.removeAdditional) { - gen2.code((0, codegen_1._)`delete ${data}[${key}]`); - } else { - cxt.error(false, { propError: PropError.Additional, additionalProperty: key }, { instancePath: key, parentSchema: true }); - if (!it.opts.allErrors) - gen2.break(); - } - }); - }); - } - function isAdditional(key, props, keyword, jtdDiscriminator) { - let additional; - if (props.length > 8) { - const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema[keyword], keyword); - additional = (0, codegen_1.not)((0, code_1.isOwnProperty)(gen2, propsSchema, key)); - if (jtdDiscriminator !== void 0) { - additional = (0, codegen_1.and)(additional, (0, codegen_1._)`${key} !== ${jtdDiscriminator}`); - } - } else if (props.length || jtdDiscriminator !== void 0) { - const ps = jtdDiscriminator === void 0 ? props : [jtdDiscriminator].concat(props); - additional = (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._)`${key} !== ${p}`)); - } else { - additional = true; - } - return additional; - } - } - exports2.validateProperties = validateProperties; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js -var require_optionalProperties = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var properties_1 = require_properties2(); - var def = { - keyword: "optionalProperties", - schemaType: "object", - error: properties_1.error, - code(cxt) { - if (cxt.parentSchema.properties) - return; - (0, properties_1.validateProperties)(cxt); - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/discriminator.js -var require_discriminator2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/discriminator.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var codegen_1 = require_codegen(); - var metadata_1 = require_metadata2(); - var nullable_1 = require_nullable(); - var error_1 = require_error2(); - var types_1 = require_types(); - var error = { - message: (cxt) => { - const { schema, params } = cxt; - return params.discrError ? params.discrError === types_1.DiscrError.Tag ? `tag "${schema}" must be string` : `value of tag "${schema}" must be in mapping` : (0, error_1.typeErrorMessage)(cxt, "object"); - }, - params: (cxt) => { - const { schema, params } = cxt; - return params.discrError ? (0, codegen_1._)`{error: ${params.discrError}, tag: ${schema}, tagValue: ${params.tag}}` : (0, error_1.typeErrorParams)(cxt, "object"); - } - }; - var def = { - keyword: "discriminator", - schemaType: "string", - implements: ["mapping"], - error, - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen: gen2, data, schema, parentSchema } = cxt; - const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); - gen2.if(cond); - validateDiscriminator(); - gen2.elseIf((0, codegen_1.not)(valid)); - cxt.error(); - gen2.endIf(); - cxt.ok(valid); - function validateDiscriminator() { - const tag = gen2.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(schema)}`); - gen2.if((0, codegen_1._)`${tag} === undefined`); - cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }); - gen2.elseIf((0, codegen_1._)`typeof ${tag} == "string"`); - validateMapping(tag); - gen2.else(); - cxt.error(false, { discrError: types_1.DiscrError.Tag, tag }, { instancePath: schema }); - gen2.endIf(); - } - function validateMapping(tag) { - gen2.if(false); - for (const tagValue in parentSchema.mapping) { - gen2.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); - gen2.assign(valid, applyTagSchema(tagValue)); - } - gen2.else(); - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag }, { instancePath: schema, schemaPath: "mapping", parentSchema: true }); - gen2.endIf(); - } - function applyTagSchema(schemaProp) { - const _valid = gen2.name("valid"); - cxt.subschema({ - keyword: "mapping", - schemaProp, - jtdDiscriminator: schema - }, _valid); - return _valid; - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/values.js -var require_values = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/values.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var util_1 = require_util(); - var codegen_1 = require_codegen(); - var metadata_1 = require_metadata2(); - var nullable_1 = require_nullable(); - var error_1 = require_error2(); - var def = { - keyword: "values", - schemaType: "object", - error: (0, error_1.typeError)("object"), - code(cxt) { - (0, metadata_1.checkMetadata)(cxt); - const { gen: gen2, data, schema, it } = cxt; - const [valid, cond] = (0, nullable_1.checkNullableObject)(cxt, data); - if ((0, util_1.alwaysValidSchema)(it, schema)) { - gen2.if((0, codegen_1.not)((0, codegen_1.or)(cond, valid)), () => cxt.error()); - } else { - gen2.if(cond); - gen2.assign(valid, validateMap()); - gen2.elseIf((0, codegen_1.not)(valid)); - cxt.error(); - gen2.endIf(); - } - cxt.ok(valid); - function validateMap() { - const _valid = gen2.name("valid"); - if (it.allErrors) { - const validMap = gen2.let("valid", true); - validateValues(() => gen2.assign(validMap, false)); - return validMap; - } - gen2.var(_valid, true); - validateValues(() => gen2.break()); - return _valid; - function validateValues(notValid) { - gen2.forIn("key", data, (key) => { - cxt.subschema({ - keyword: "values", - dataProp: key, - dataPropType: util_1.Type.Str - }, _valid); - gen2.if((0, codegen_1.not)(_valid), notValid); - }); - } - } - } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/union.js -var require_union = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/union.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var code_1 = require_code2(); - var def = { - keyword: "union", - schemaType: "array", - trackErrors: true, - code: code_1.validateUnion, - error: { message: "must match a schema in union" } - }; - exports2.default = def; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/index.js -var require_jtd = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/jtd/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var ref_1 = require_ref2(); - var type_1 = require_type(); - var enum_1 = require_enum2(); - var elements_1 = require_elements(); - var properties_1 = require_properties2(); - var optionalProperties_1 = require_optionalProperties(); - var discriminator_1 = require_discriminator2(); - var values_1 = require_values(); - var union_1 = require_union(); - var metadata_1 = require_metadata2(); - var jtdVocabulary = [ - "definitions", - ref_1.default, - type_1.default, - enum_1.default, - elements_1.default, - properties_1.default, - optionalProperties_1.default, - discriminator_1.default, - values_1.default, - union_1.default, - metadata_1.default, - { keyword: "additionalProperties", schemaType: "boolean" }, - { keyword: "nullable", schemaType: "boolean" } - ]; - exports2.default = jtdVocabulary; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/jtd-schema.js -var require_jtd_schema = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/jtd-schema.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var shared = (root) => { - const sch = { - nullable: { type: "boolean" }, - metadata: { - optionalProperties: { - union: { elements: { ref: "schema" } } - }, - additionalProperties: true - } - }; - if (root) - sch.definitions = { values: { ref: "schema" } }; - return sch; - }; - var emptyForm = (root) => ({ - optionalProperties: shared(root) - }); - var refForm = (root) => ({ - properties: { - ref: { type: "string" } - }, - optionalProperties: shared(root) - }); - var typeForm = (root) => ({ - properties: { - type: { - enum: [ - "boolean", - "timestamp", - "string", - "float32", - "float64", - "int8", - "uint8", - "int16", - "uint16", - "int32", - "uint32" - ] - } - }, - optionalProperties: shared(root) - }); - var enumForm = (root) => ({ - properties: { - enum: { elements: { type: "string" } } - }, - optionalProperties: shared(root) - }); - var elementsForm = (root) => ({ - properties: { - elements: { ref: "schema" } - }, - optionalProperties: shared(root) - }); - var propertiesForm = (root) => ({ - properties: { - properties: { values: { ref: "schema" } } - }, - optionalProperties: { - optionalProperties: { values: { ref: "schema" } }, - additionalProperties: { type: "boolean" }, - ...shared(root) - } - }); - var optionalPropertiesForm = (root) => ({ - properties: { - optionalProperties: { values: { ref: "schema" } } - }, - optionalProperties: { - additionalProperties: { type: "boolean" }, - ...shared(root) - } - }); - var discriminatorForm = (root) => ({ - properties: { - discriminator: { type: "string" }, - mapping: { - values: { - metadata: { - union: [propertiesForm(false), optionalPropertiesForm(false)] - } - } - } - }, - optionalProperties: shared(root) - }); - var valuesForm = (root) => ({ - properties: { - values: { ref: "schema" } - }, - optionalProperties: shared(root) - }); - var schema = (root) => ({ - metadata: { - union: [ - emptyForm, - refForm, - typeForm, - enumForm, - elementsForm, - propertiesForm, - optionalPropertiesForm, - discriminatorForm, - valuesForm - ].map((s) => s(root)) - } - }); - var jtdMetaSchema = { - definitions: { - schema: schema(false) - }, - ...schema(true) - }; - exports2.default = jtdMetaSchema; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/jtd/types.js -var require_types2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/jtd/types.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.jtdForms = void 0; - exports2.jtdForms = [ - "elements", - "values", - "discriminator", - "properties", - "optionalProperties", - "enum", - "type", - "ref" - ]; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/quote.js -var require_quote = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/quote.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var rxEscapable = ( - // eslint-disable-next-line no-control-regex, no-misleading-character-class - /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g - ); - var escaped = { - "\b": "\\b", - " ": "\\t", - "\n": "\\n", - "\f": "\\f", - "\r": "\\r", - '"': '\\"', - "\\": "\\\\" - }; - function quote(s) { - rxEscapable.lastIndex = 0; - return '"' + (rxEscapable.test(s) ? s.replace(rxEscapable, (a) => { - const c = escaped[a]; - return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4); - }) : s) + '"'; - } - exports2.default = quote; - quote.code = 'require("ajv/dist/runtime/quote").default'; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/jtd/serialize.js -var require_serialize = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/jtd/serialize.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var types_1 = require_types2(); - var __1 = require_compile(); - var codegen_1 = require_codegen(); - var ref_error_1 = require_ref_error(); - var names_1 = require_names(); - var code_1 = require_code2(); - var ref_1 = require_ref2(); - var util_1 = require_util(); - var quote_1 = require_quote(); - var genSerialize = { - elements: serializeElements, - values: serializeValues, - discriminator: serializeDiscriminator, - properties: serializeProperties, - optionalProperties: serializeProperties, - enum: serializeString, - type: serializeType, - ref: serializeRef - }; - function compileSerializer(sch, definitions) { - const _sch = __1.getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen2 = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - const serializeName = gen2.scopeName("serialize"); - const cxt = { - self: this, - gen: gen2, - schema: sch.schema, - schemaEnv: sch, - definitions, - data: names_1.default.data - }; - let sourceCode; - try { - this._compilations.add(sch); - sch.serializeName = serializeName; - gen2.func(serializeName, names_1.default.data, false, () => { - gen2.let(names_1.default.json, (0, codegen_1.str)``); - serializeCode(cxt); - gen2.return(names_1.default.json); - }); - gen2.optimize(this.opts.code.optimize); - const serializeFuncCode = gen2.toString(); - sourceCode = `${gen2.scopeRefs(names_1.default.scope)}return ${serializeFuncCode}`; - const makeSerialize = new Function(`${names_1.default.scope}`, sourceCode); - const serialize2 = makeSerialize(this.scope.get()); - this.scope.value(serializeName, { ref: serialize2 }); - sch.serialize = serialize2; - } catch (e) { - if (sourceCode) - this.logger.error("Error compiling serializer, function code:", sourceCode); - delete sch.serialize; - delete sch.serializeName; - throw e; - } finally { - this._compilations.delete(sch); - } - return sch; - } - exports2.default = compileSerializer; - function serializeCode(cxt) { - let form; - for (const key of types_1.jtdForms) { - if (key in cxt.schema) { - form = key; - break; - } - } - serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty); - } - function serializeNullable(cxt, serializeForm) { - const { gen: gen2, schema, data } = cxt; - if (!schema.nullable) - return serializeForm(cxt); - gen2.if((0, codegen_1._)`${data} === undefined || ${data} === null`, () => gen2.add(names_1.default.json, (0, codegen_1._)`"null"`), () => serializeForm(cxt)); - } - function serializeElements(cxt) { - const { gen: gen2, schema, data } = cxt; - gen2.add(names_1.default.json, (0, codegen_1.str)`[`); - const first = gen2.let("first", true); - gen2.forOf("el", data, (el) => { - addComma(cxt, first); - serializeCode({ ...cxt, schema: schema.elements, data: el }); - }); - gen2.add(names_1.default.json, (0, codegen_1.str)`]`); - } - function serializeValues(cxt) { - const { gen: gen2, schema, data } = cxt; - gen2.add(names_1.default.json, (0, codegen_1.str)`{`); - const first = gen2.let("first", true); - gen2.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)); - gen2.add(names_1.default.json, (0, codegen_1.str)`}`); - } - function serializeKeyValue(cxt, key, schema, first) { - const { gen: gen2, data } = cxt; - addComma(cxt, first); - serializeString({ ...cxt, data: key }); - gen2.add(names_1.default.json, (0, codegen_1.str)`:`); - const value = gen2.const("value", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(key)}`); - serializeCode({ ...cxt, schema, data: value }); - } - function serializeDiscriminator(cxt) { - const { gen: gen2, schema, data } = cxt; - const { discriminator } = schema; - gen2.add(names_1.default.json, (0, codegen_1.str)`{${JSON.stringify(discriminator)}:`); - const tag = gen2.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(discriminator)}`); - serializeString({ ...cxt, data: tag }); - gen2.if(false); - for (const tagValue in schema.mapping) { - gen2.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); - const sch = schema.mapping[tagValue]; - serializeSchemaProperties({ ...cxt, schema: sch }, discriminator); - } - gen2.endIf(); - gen2.add(names_1.default.json, (0, codegen_1.str)`}`); - } - function serializeProperties(cxt) { - const { gen: gen2 } = cxt; - gen2.add(names_1.default.json, (0, codegen_1.str)`{`); - serializeSchemaProperties(cxt); - gen2.add(names_1.default.json, (0, codegen_1.str)`}`); - } - function serializeSchemaProperties(cxt, discriminator) { - const { gen: gen2, schema, data } = cxt; - const { properties, optionalProperties } = schema; - const props = keys(properties); - const optProps = keys(optionalProperties); - const allProps = allProperties(props.concat(optProps)); - let first = !discriminator; - let firstProp; - for (const key of props) { - if (first) - first = false; - else - gen2.add(names_1.default.json, (0, codegen_1.str)`,`); - serializeProperty(key, properties[key], keyValue(key)); - } - if (first) - firstProp = gen2.let("first", true); - for (const key of optProps) { - const value = keyValue(key); - gen2.if((0, codegen_1.and)((0, codegen_1._)`${value} !== undefined`, (0, code_1.isOwnProperty)(gen2, data, key)), () => { - addComma(cxt, firstProp); - serializeProperty(key, optionalProperties[key], value); - }); - } - if (schema.additionalProperties) { - gen2.forIn("key", data, (key) => gen2.if(isAdditional(key, allProps), () => serializeKeyValue(cxt, key, {}, firstProp))); - } - function keys(ps) { - return ps ? Object.keys(ps) : []; - } - function allProperties(ps) { - if (discriminator) - ps.push(discriminator); - if (new Set(ps).size !== ps.length) { - throw new Error("JTD: properties/optionalProperties/disciminator overlap"); - } - return ps; - } - function keyValue(key) { - return gen2.const("value", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(key)}`); - } - function serializeProperty(key, propSchema, value) { - gen2.add(names_1.default.json, (0, codegen_1.str)`${JSON.stringify(key)}:`); - serializeCode({ ...cxt, schema: propSchema, data: value }); - } - function isAdditional(key, ps) { - return ps.length ? (0, codegen_1.and)(...ps.map((p) => (0, codegen_1._)`${key} !== ${p}`)) : true; - } - } - function serializeType(cxt) { - const { gen: gen2, schema, data } = cxt; - switch (schema.type) { - case "boolean": - gen2.add(names_1.default.json, (0, codegen_1._)`${data} ? "true" : "false"`); - break; - case "string": - serializeString(cxt); - break; - case "timestamp": - gen2.if((0, codegen_1._)`${data} instanceof Date`, () => gen2.add(names_1.default.json, (0, codegen_1._)`'"' + ${data}.toISOString() + '"'`), () => serializeString(cxt)); - break; - default: - serializeNumber(cxt); - } - } - function serializeString({ gen: gen2, data }) { - gen2.add(names_1.default.json, (0, codegen_1._)`${(0, util_1.useFunc)(gen2, quote_1.default)}(${data})`); - } - function serializeNumber({ gen: gen2, data, self: self2 }) { - const condition = (0, codegen_1._)`${data} === Infinity || ${data} === -Infinity || ${data} !== ${data}`; - if (self2.opts.specialNumbers === void 0 || self2.opts.specialNumbers === "fast") { - gen2.add(names_1.default.json, (0, codegen_1._)`"" + ${data}`); - } else { - gen2.if(condition, () => gen2.add(names_1.default.json, (0, codegen_1._)`null`), () => gen2.add(names_1.default.json, (0, codegen_1._)`"" + ${data}`)); - } - } - function serializeRef(cxt) { - const { gen: gen2, self: self2, data, definitions, schema, schemaEnv } = cxt; - const { ref } = schema; - const refSchema = definitions[ref]; - if (!refSchema) - throw new ref_error_1.default(self2.opts.uriResolver, "", ref, `No definition ${ref}`); - if (!(0, ref_1.hasRef)(refSchema)) - return serializeCode({ ...cxt, schema: refSchema }); - const { root } = schemaEnv; - const sch = compileSerializer.call(self2, new __1.SchemaEnv({ schema: refSchema, root }), definitions); - gen2.add(names_1.default.json, (0, codegen_1._)`${getSerialize(gen2, sch)}(${data})`); - } - function getSerialize(gen2, sch) { - return sch.serialize ? gen2.scopeValue("serialize", { ref: sch.serialize }) : (0, codegen_1._)`${gen2.scopeValue("wrapper", { ref: sch })}.serialize`; - } - function serializeEmpty({ gen: gen2, data }) { - gen2.add(names_1.default.json, (0, codegen_1._)`JSON.stringify(${data})`); - } - function addComma({ gen: gen2 }, first) { - if (first) { - gen2.if(first, () => gen2.assign(first, false), () => gen2.add(names_1.default.json, (0, codegen_1.str)`,`)); - } else { - gen2.add(names_1.default.json, (0, codegen_1.str)`,`); - } - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/parseJson.js -var require_parseJson = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/parseJson.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.parseJsonString = exports2.parseJsonNumber = exports2.parseJson = void 0; - var rxParseJson = /position\s(\d+)(?: \(line \d+ column \d+\))?$/; - function parseJson(s, pos) { - let endPos; - parseJson.message = void 0; - let matches; - if (pos) - s = s.slice(pos); - try { - parseJson.position = pos + s.length; - return JSON.parse(s); - } catch (e) { - matches = rxParseJson.exec(e.message); - if (!matches) { - parseJson.message = "unexpected end"; - return void 0; - } - endPos = +matches[1]; - const c = s[endPos]; - s = s.slice(0, endPos); - parseJson.position = pos + endPos; - try { - return JSON.parse(s); - } catch (e1) { - parseJson.message = `unexpected token ${c}`; - return void 0; - } - } - } - exports2.parseJson = parseJson; - parseJson.message = void 0; - parseJson.position = 0; - parseJson.code = 'require("ajv/dist/runtime/parseJson").parseJson'; - function parseJsonNumber(s, pos, maxDigits) { - let numStr = ""; - let c; - parseJsonNumber.message = void 0; - if (s[pos] === "-") { - numStr += "-"; - pos++; - } - if (s[pos] === "0") { - numStr += "0"; - pos++; - } else { - if (!parseDigits(maxDigits)) { - errorMessage(); - return void 0; - } - } - if (maxDigits) { - parseJsonNumber.position = pos; - return +numStr; - } - if (s[pos] === ".") { - numStr += "."; - pos++; - if (!parseDigits()) { - errorMessage(); - return void 0; - } - } - if (c = s[pos], c === "e" || c === "E") { - numStr += "e"; - pos++; - if (c = s[pos], c === "+" || c === "-") { - numStr += c; - pos++; - } - if (!parseDigits()) { - errorMessage(); - return void 0; - } - } - parseJsonNumber.position = pos; - return +numStr; - function parseDigits(maxLen) { - let digit = false; - while (c = s[pos], c >= "0" && c <= "9" && (maxLen === void 0 || maxLen-- > 0)) { - digit = true; - numStr += c; - pos++; - } - return digit; - } - function errorMessage() { - parseJsonNumber.position = pos; - parseJsonNumber.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end"; - } - } - exports2.parseJsonNumber = parseJsonNumber; - parseJsonNumber.message = void 0; - parseJsonNumber.position = 0; - parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber'; - var escapedChars = { - b: "\b", - f: "\f", - n: "\n", - r: "\r", - t: " ", - '"': '"', - "/": "/", - "\\": "\\" - }; - var CODE_A = "a".charCodeAt(0); - var CODE_0 = "0".charCodeAt(0); - function parseJsonString(s, pos) { - let str = ""; - let c; - parseJsonString.message = void 0; - while (true) { - c = s[pos++]; - if (c === '"') - break; - if (c === "\\") { - c = s[pos]; - if (c in escapedChars) { - str += escapedChars[c]; - pos++; - } else if (c === "u") { - pos++; - let count = 4; - let code = 0; - while (count--) { - code <<= 4; - c = s[pos]; - if (c === void 0) { - errorMessage("unexpected end"); - return void 0; - } - c = c.toLowerCase(); - if (c >= "a" && c <= "f") { - code += c.charCodeAt(0) - CODE_A + 10; - } else if (c >= "0" && c <= "9") { - code += c.charCodeAt(0) - CODE_0; - } else { - errorMessage(`unexpected token ${c}`); - return void 0; - } - pos++; - } - str += String.fromCharCode(code); - } else { - errorMessage(`unexpected token ${c}`); - return void 0; - } - } else if (c === void 0) { - errorMessage("unexpected end"); - return void 0; - } else { - if (c.charCodeAt(0) >= 32) { - str += c; - } else { - errorMessage(`unexpected token ${c}`); - return void 0; - } - } - } - parseJsonString.position = pos; - return str; - function errorMessage(msg) { - parseJsonString.position = pos; - parseJsonString.message = msg; - } - } - exports2.parseJsonString = parseJsonString; - parseJsonString.message = void 0; - parseJsonString.position = 0; - parseJsonString.code = 'require("ajv/dist/runtime/parseJson").parseJsonString'; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/jtd/parse.js -var require_parse = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/jtd/parse.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var types_1 = require_types2(); - var __1 = require_compile(); - var codegen_1 = require_codegen(); - var ref_error_1 = require_ref_error(); - var names_1 = require_names(); - var code_1 = require_code2(); - var ref_1 = require_ref2(); - var type_1 = require_type(); - var parseJson_1 = require_parseJson(); - var util_1 = require_util(); - var timestamp_1 = require_timestamp(); - var genParse = { - elements: parseElements, - values: parseValues, - discriminator: parseDiscriminator, - properties: parseProperties, - optionalProperties: parseProperties, - enum: parseEnum, - type: parseType, - ref: parseRef - }; - function compileParser(sch, definitions) { - const _sch = __1.getCompilingSchema.call(this, sch); - if (_sch) - return _sch; - const { es5, lines } = this.opts.code; - const { ownProperties } = this.opts; - const gen2 = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); - const parseName = gen2.scopeName("parse"); - const cxt = { - self: this, - gen: gen2, - schema: sch.schema, - schemaEnv: sch, - definitions, - data: names_1.default.data, - parseName, - char: gen2.name("c") - }; - let sourceCode; - try { - this._compilations.add(sch); - sch.parseName = parseName; - parserFunction(cxt); - gen2.optimize(this.opts.code.optimize); - const parseFuncCode = gen2.toString(); - sourceCode = `${gen2.scopeRefs(names_1.default.scope)}return ${parseFuncCode}`; - const makeParse = new Function(`${names_1.default.scope}`, sourceCode); - const parse2 = makeParse(this.scope.get()); - this.scope.value(parseName, { ref: parse2 }); - sch.parse = parse2; - } catch (e) { - if (sourceCode) - this.logger.error("Error compiling parser, function code:", sourceCode); - delete sch.parse; - delete sch.parseName; - throw e; - } finally { - this._compilations.delete(sch); - } - return sch; - } - exports2.default = compileParser; - var undef = (0, codegen_1._)`undefined`; - function parserFunction(cxt) { - const { gen: gen2, parseName, char } = cxt; - gen2.func(parseName, (0, codegen_1._)`${names_1.default.json}, ${names_1.default.jsonPos}, ${names_1.default.jsonPart}`, false, () => { - gen2.let(names_1.default.data); - gen2.let(char); - gen2.assign((0, codegen_1._)`${parseName}.message`, undef); - gen2.assign((0, codegen_1._)`${parseName}.position`, undef); - gen2.assign(names_1.default.jsonPos, (0, codegen_1._)`${names_1.default.jsonPos} || 0`); - gen2.const(names_1.default.jsonLen, (0, codegen_1._)`${names_1.default.json}.length`); - parseCode(cxt); - skipWhitespace(cxt); - gen2.if(names_1.default.jsonPart, () => { - gen2.assign((0, codegen_1._)`${parseName}.position`, names_1.default.jsonPos); - gen2.return(names_1.default.data); - }); - gen2.if((0, codegen_1._)`${names_1.default.jsonPos} === ${names_1.default.jsonLen}`, () => gen2.return(names_1.default.data)); - jsonSyntaxError(cxt); - }); - } - function parseCode(cxt) { - let form; - for (const key of types_1.jtdForms) { - if (key in cxt.schema) { - form = key; - break; - } - } - if (form) - parseNullable(cxt, genParse[form]); - else - parseEmpty(cxt); - } - var parseBoolean = parseBooleanToken(true, parseBooleanToken(false, jsonSyntaxError)); - function parseNullable(cxt, parseForm) { - const { gen: gen2, schema, data } = cxt; - if (!schema.nullable) - return parseForm(cxt); - tryParseToken(cxt, "null", parseForm, () => gen2.assign(data, null)); - } - function parseElements(cxt) { - const { gen: gen2, schema, data } = cxt; - parseToken(cxt, "["); - const ix = gen2.let("i", 0); - gen2.assign(data, (0, codegen_1._)`[]`); - parseItems(cxt, "]", () => { - const el = gen2.let("el"); - parseCode({ ...cxt, schema: schema.elements, data: el }); - gen2.assign((0, codegen_1._)`${data}[${ix}++]`, el); - }); - } - function parseValues(cxt) { - const { gen: gen2, schema, data } = cxt; - parseToken(cxt, "{"); - gen2.assign(data, (0, codegen_1._)`{}`); - parseItems(cxt, "}", () => parseKeyValue(cxt, schema.values)); - } - function parseItems(cxt, endToken, block) { - tryParseItems(cxt, endToken, block); - parseToken(cxt, endToken); - } - function tryParseItems(cxt, endToken, block) { - const { gen: gen2 } = cxt; - gen2.for((0, codegen_1._)`;${names_1.default.jsonPos}<${names_1.default.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { - block(); - tryParseToken(cxt, ",", () => gen2.break(), hasItem); - }); - function hasItem() { - tryParseToken(cxt, endToken, () => { - }, jsonSyntaxError); - } - } - function parseKeyValue(cxt, schema) { - const { gen: gen2 } = cxt; - const key = gen2.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - parsePropertyValue(cxt, key, schema); - } - function parseDiscriminator(cxt) { - const { gen: gen2, data, schema } = cxt; - const { discriminator, mapping } = schema; - parseToken(cxt, "{"); - gen2.assign(data, (0, codegen_1._)`{}`); - const startPos = gen2.const("pos", names_1.default.jsonPos); - const value = gen2.let("value"); - const tag = gen2.let("tag"); - tryParseItems(cxt, "}", () => { - const key = gen2.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - gen2.if( - (0, codegen_1._)`${key} === ${discriminator}`, - () => { - parseString({ ...cxt, data: tag }); - gen2.assign((0, codegen_1._)`${data}[${key}]`, tag); - gen2.break(); - }, - () => parseEmpty({ ...cxt, data: value }) - // can be discarded/skipped - ); - }); - gen2.assign(names_1.default.jsonPos, startPos); - gen2.if((0, codegen_1._)`${tag} === undefined`); - parsingError(cxt, (0, codegen_1.str)`discriminator tag not found`); - for (const tagValue in mapping) { - gen2.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); - parseSchemaProperties({ ...cxt, schema: mapping[tagValue] }, discriminator); - } - gen2.else(); - parsingError(cxt, (0, codegen_1.str)`discriminator value not in schema`); - gen2.endIf(); - } - function parseProperties(cxt) { - const { gen: gen2, data } = cxt; - parseToken(cxt, "{"); - gen2.assign(data, (0, codegen_1._)`{}`); - parseSchemaProperties(cxt); - } - function parseSchemaProperties(cxt, discriminator) { - const { gen: gen2, schema, data } = cxt; - const { properties, optionalProperties, additionalProperties } = schema; - parseItems(cxt, "}", () => { - const key = gen2.let("key"); - parseString({ ...cxt, data: key }); - parseToken(cxt, ":"); - gen2.if(false); - parseDefinedProperty(cxt, key, properties); - parseDefinedProperty(cxt, key, optionalProperties); - if (discriminator) { - gen2.elseIf((0, codegen_1._)`${key} === ${discriminator}`); - const tag = gen2.let("tag"); - parseString({ ...cxt, data: tag }); - } - gen2.else(); - if (additionalProperties) { - parseEmpty({ ...cxt, data: (0, codegen_1._)`${data}[${key}]` }); - } else { - parsingError(cxt, (0, codegen_1.str)`property ${key} not allowed`); - } - gen2.endIf(); - }); - if (properties) { - const hasProp = (0, code_1.hasPropFunc)(gen2); - const allProps = (0, codegen_1.and)(...Object.keys(properties).map((p) => (0, codegen_1._)`${hasProp}.call(${data}, ${p})`)); - gen2.if((0, codegen_1.not)(allProps), () => parsingError(cxt, (0, codegen_1.str)`missing required properties`)); - } - } - function parseDefinedProperty(cxt, key, schemas = {}) { - const { gen: gen2 } = cxt; - for (const prop in schemas) { - gen2.elseIf((0, codegen_1._)`${key} === ${prop}`); - parsePropertyValue(cxt, key, schemas[prop]); - } - } - function parsePropertyValue(cxt, key, schema) { - parseCode({ ...cxt, schema, data: (0, codegen_1._)`${cxt.data}[${key}]` }); - } - function parseType(cxt) { - const { gen: gen2, schema, data, self: self2 } = cxt; - switch (schema.type) { - case "boolean": - parseBoolean(cxt); - break; - case "string": - parseString(cxt); - break; - case "timestamp": { - parseString(cxt); - const vts = (0, util_1.useFunc)(gen2, timestamp_1.default); - const { allowDate, parseDate } = self2.opts; - const notValid = allowDate ? (0, codegen_1._)`!${vts}(${data}, true)` : (0, codegen_1._)`!${vts}(${data})`; - const fail = parseDate ? (0, codegen_1.or)(notValid, (0, codegen_1._)`(${data} = new Date(${data}), false)`, (0, codegen_1._)`isNaN(${data}.valueOf())`) : notValid; - gen2.if(fail, () => parsingError(cxt, (0, codegen_1.str)`invalid timestamp`)); - break; - } - case "float32": - case "float64": - parseNumber(cxt); - break; - default: { - const t = schema.type; - if (!self2.opts.int32range && (t === "int32" || t === "uint32")) { - parseNumber(cxt, 16); - if (t === "uint32") { - gen2.if((0, codegen_1._)`${data} < 0`, () => parsingError(cxt, (0, codegen_1.str)`integer out of range`)); - } - } else { - const [min, max, maxDigits] = type_1.intRange[t]; - parseNumber(cxt, maxDigits); - gen2.if((0, codegen_1._)`${data} < ${min} || ${data} > ${max}`, () => parsingError(cxt, (0, codegen_1.str)`integer out of range`)); - } - } - } - } - function parseString(cxt) { - parseToken(cxt, '"'); - parseWith(cxt, parseJson_1.parseJsonString); - } - function parseEnum(cxt) { - const { gen: gen2, data, schema } = cxt; - const enumSch = schema.enum; - parseToken(cxt, '"'); - gen2.if(false); - for (const value of enumSch) { - const valueStr = JSON.stringify(value).slice(1); - gen2.elseIf((0, codegen_1._)`${jsonSlice(valueStr.length)} === ${valueStr}`); - gen2.assign(data, (0, codegen_1.str)`${value}`); - gen2.add(names_1.default.jsonPos, valueStr.length); - } - gen2.else(); - jsonSyntaxError(cxt); - gen2.endIf(); - } - function parseNumber(cxt, maxDigits) { - const { gen: gen2 } = cxt; - skipWhitespace(cxt); - gen2.if((0, codegen_1._)`"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits)); - } - function parseBooleanToken(bool, fail) { - return (cxt) => { - const { gen: gen2, data } = cxt; - tryParseToken(cxt, `${bool}`, () => fail(cxt), () => gen2.assign(data, bool)); - }; - } - function parseRef(cxt) { - const { gen: gen2, self: self2, definitions, schema, schemaEnv } = cxt; - const { ref } = schema; - const refSchema = definitions[ref]; - if (!refSchema) - throw new ref_error_1.default(self2.opts.uriResolver, "", ref, `No definition ${ref}`); - if (!(0, ref_1.hasRef)(refSchema)) - return parseCode({ ...cxt, schema: refSchema }); - const { root } = schemaEnv; - const sch = compileParser.call(self2, new __1.SchemaEnv({ schema: refSchema, root }), definitions); - partialParse(cxt, getParser(gen2, sch), true); - } - function getParser(gen2, sch) { - return sch.parse ? gen2.scopeValue("parse", { ref: sch.parse }) : (0, codegen_1._)`${gen2.scopeValue("wrapper", { ref: sch })}.parse`; - } - function parseEmpty(cxt) { - parseWith(cxt, parseJson_1.parseJson); - } - function parseWith(cxt, parseFunc, args) { - partialParse(cxt, (0, util_1.useFunc)(cxt.gen, parseFunc), args); - } - function partialParse(cxt, parseFunc, args) { - const { gen: gen2, data } = cxt; - gen2.assign(data, (0, codegen_1._)`${parseFunc}(${names_1.default.json}, ${names_1.default.jsonPos}${args ? (0, codegen_1._)`, ${args}` : codegen_1.nil})`); - gen2.assign(names_1.default.jsonPos, (0, codegen_1._)`${parseFunc}.position`); - gen2.if((0, codegen_1._)`${data} === undefined`, () => parsingError(cxt, (0, codegen_1._)`${parseFunc}.message`)); - } - function parseToken(cxt, tok) { - tryParseToken(cxt, tok, jsonSyntaxError); - } - function tryParseToken(cxt, tok, fail, success) { - const { gen: gen2 } = cxt; - const n = tok.length; - skipWhitespace(cxt); - gen2.if((0, codegen_1._)`${jsonSlice(n)} === ${tok}`, () => { - gen2.add(names_1.default.jsonPos, n); - success === null || success === void 0 ? void 0 : success(cxt); - }, () => fail(cxt)); - } - function skipWhitespace({ gen: gen2, char: c }) { - gen2.code((0, codegen_1._)`while((${c}=${names_1.default.json}[${names_1.default.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${names_1.default.jsonPos}++;`); - } - function jsonSlice(len) { - return len === 1 ? (0, codegen_1._)`${names_1.default.json}[${names_1.default.jsonPos}]` : (0, codegen_1._)`${names_1.default.json}.slice(${names_1.default.jsonPos}, ${names_1.default.jsonPos}+${len})`; - } - function jsonSyntaxError(cxt) { - parsingError(cxt, (0, codegen_1._)`"unexpected token " + ${names_1.default.json}[${names_1.default.jsonPos}]`); - } - function parsingError({ gen: gen2, parseName }, msg) { - gen2.assign((0, codegen_1._)`${parseName}.message`, msg); - gen2.assign((0, codegen_1._)`${parseName}.position`, names_1.default.jsonPos); - gen2.return(undef); - } - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/jtd.js -var require_jtd2 = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/jtd.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.MissingRefError = exports2.ValidationError = exports2.CodeGen = exports2.Name = exports2.nil = exports2.stringify = exports2.str = exports2._ = exports2.KeywordCxt = exports2.Ajv = void 0; - var core_1 = require_core(); - var jtd_1 = require_jtd(); - var jtd_schema_1 = require_jtd_schema(); - var serialize_1 = require_serialize(); - var parse_1 = require_parse(); - var META_SCHEMA_ID = "JTD-meta-schema"; - var Ajv = class extends core_1.default { - constructor(opts = {}) { - super({ - ...opts, - jtd: true - }); - } - _addVocabularies() { - super._addVocabularies(); - this.addVocabulary(jtd_1.default); - } - _addDefaultMetaSchema() { - super._addDefaultMetaSchema(); - if (!this.opts.meta) - return; - this.addMetaSchema(jtd_schema_1.default, META_SCHEMA_ID, false); - } - defaultMeta() { - return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : void 0); - } - compileSerializer(schema) { - const sch = this._addSchema(schema); - return sch.serialize || this._compileSerializer(sch); - } - compileParser(schema) { - const sch = this._addSchema(schema); - return sch.parse || this._compileParser(sch); - } - _compileSerializer(sch) { - serialize_1.default.call(this, sch, sch.schema.definitions || {}); - if (!sch.serialize) - throw new Error("ajv implementation error"); - return sch.serialize; - } - _compileParser(sch) { - parse_1.default.call(this, sch, sch.schema.definitions || {}); - if (!sch.parse) - throw new Error("ajv implementation error"); - return sch.parse; - } - }; - exports2.Ajv = Ajv; - module2.exports = exports2 = Ajv; - module2.exports.Ajv = Ajv; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.default = Ajv; - var validate_1 = require_validate(); - Object.defineProperty(exports2, "KeywordCxt", { enumerable: true, get: function() { - return validate_1.KeywordCxt; - } }); - var codegen_1 = require_codegen(); - Object.defineProperty(exports2, "_", { enumerable: true, get: function() { - return codegen_1._; - } }); - Object.defineProperty(exports2, "str", { enumerable: true, get: function() { - return codegen_1.str; - } }); - Object.defineProperty(exports2, "stringify", { enumerable: true, get: function() { - return codegen_1.stringify; - } }); - Object.defineProperty(exports2, "nil", { enumerable: true, get: function() { - return codegen_1.nil; - } }); - Object.defineProperty(exports2, "Name", { enumerable: true, get: function() { - return codegen_1.Name; - } }); - Object.defineProperty(exports2, "CodeGen", { enumerable: true, get: function() { - return codegen_1.CodeGen; - } }); - var validation_error_1 = require_validation_error(); - Object.defineProperty(exports2, "ValidationError", { enumerable: true, get: function() { - return validation_error_1.default; - } }); - var ref_error_1 = require_ref_error(); - Object.defineProperty(exports2, "MissingRefError", { enumerable: true, get: function() { - return ref_error_1.default; - } }); - } -}); - -// ../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/lib/default-ajv-options.js -var require_default_ajv_options = __commonJS({ - "../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/lib/default-ajv-options.js"(exports2, module2) { - "use strict"; - var fastUri = require_fast_uri(); - module2.exports = Object.freeze({ - coerceTypes: "array", - useDefaults: true, - removeAdditional: true, - uriResolver: fastUri, - addUsedSchema: false, - // Explicitly set allErrors to `false`. - // When set to `true`, a DoS attack is possible. - allErrors: false - }); - } -}); - -// ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js -var require_formats = __commonJS({ - "../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/formats.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.formatNames = exports2.fastFormats = exports2.fullFormats = void 0; - function fmtDef(validate3, compare) { - return { validate: validate3, compare }; - } - exports2.fullFormats = { - // date: http://tools.ietf.org/html/rfc3339#section-5.6 - date: fmtDef(date, compareDate), - // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 - time: fmtDef(getTime(true), compareTime), - "date-time": fmtDef(getDateTime(true), compareDateTime), - "iso-time": fmtDef(getTime(), compareIsoTime), - "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime), - // duration: https://tools.ietf.org/html/rfc3339#appendix-A - duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, - uri, - "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, - // uri-template: https://tools.ietf.org/html/rfc6570 - "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, - // For the source: https://gist.github.com/dperini/729294 - // For test cases: https://mathiasbynens.be/demo/url-regex - url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, - email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, - hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, - // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html - ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, - ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, - regex, - // uuid: http://tools.ietf.org/html/rfc4122 - uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, - // JSON-pointer: https://tools.ietf.org/html/rfc6901 - // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A - "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, - "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, - // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 - "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, - // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types - // byte: https://github.com/miguelmota/is-base64 - byte, - // signed 32 bit integer - int32: { type: "number", validate: validateInt32 }, - // signed 64 bit integer - int64: { type: "number", validate: validateInt64 }, - // C-type float - float: { type: "number", validate: validateNumber }, - // C-type double - double: { type: "number", validate: validateNumber }, - // hint to the UI to hide input strings - password: true, - // unchecked string payload - binary: true - }; - exports2.fastFormats = { - ...exports2.fullFormats, - date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate), - time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime), - "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime), - "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime), - "iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime), - // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js - uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, - "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, - // email (sources from jsen validator): - // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 - // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation') - email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i - }; - exports2.formatNames = Object.keys(exports2.fullFormats); - function isLeapYear(year) { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); - } - var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; - var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function date(str) { - const matches = DATE.exec(str); - if (!matches) - return false; - const year = +matches[1]; - const month = +matches[2]; - const day = +matches[3]; - return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]); - } - function compareDate(d1, d2) { - if (!(d1 && d2)) - return void 0; - if (d1 > d2) - return 1; - if (d1 < d2) - return -1; - return 0; - } - var TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i; - function getTime(strictTimeZone) { - return function time(str) { - const matches = TIME.exec(str); - if (!matches) - return false; - const hr = +matches[1]; - const min = +matches[2]; - const sec = +matches[3]; - const tz = matches[4]; - const tzSign = matches[5] === "-" ? -1 : 1; - const tzH = +(matches[6] || 0); - const tzM = +(matches[7] || 0); - if (tzH > 23 || tzM > 59 || strictTimeZone && !tz) - return false; - if (hr <= 23 && min <= 59 && sec < 60) - return true; - const utcMin = min - tzM * tzSign; - const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0); - return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61; - }; - } - function compareTime(s1, s2) { - if (!(s1 && s2)) - return void 0; - const t1 = (/* @__PURE__ */ new Date("2020-01-01T" + s1)).valueOf(); - const t2 = (/* @__PURE__ */ new Date("2020-01-01T" + s2)).valueOf(); - if (!(t1 && t2)) - return void 0; - return t1 - t2; - } - function compareIsoTime(t1, t2) { - if (!(t1 && t2)) - return void 0; - const a1 = TIME.exec(t1); - const a2 = TIME.exec(t2); - if (!(a1 && a2)) - return void 0; - t1 = a1[1] + a1[2] + a1[3]; - t2 = a2[1] + a2[2] + a2[3]; - if (t1 > t2) - return 1; - if (t1 < t2) - return -1; - return 0; - } - var DATE_TIME_SEPARATOR = /t|\s/i; - function getDateTime(strictTimeZone) { - const time = getTime(strictTimeZone); - return function date_time(str) { - const dateTime = str.split(DATE_TIME_SEPARATOR); - return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]); - }; - } - function compareDateTime(dt1, dt2) { - if (!(dt1 && dt2)) - return void 0; - const d1 = new Date(dt1).valueOf(); - const d2 = new Date(dt2).valueOf(); - if (!(d1 && d2)) - return void 0; - return d1 - d2; - } - function compareIsoDateTime(dt1, dt2) { - if (!(dt1 && dt2)) - return void 0; - const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR); - const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR); - const res = compareDate(d1, d2); - if (res === void 0) - return void 0; - return res || compareTime(t1, t2); - } - var NOT_URI_FRAGMENT = /\/|:/; - var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; - function uri(str) { - return NOT_URI_FRAGMENT.test(str) && URI.test(str); - } - var BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm; - function byte(str) { - BYTE.lastIndex = 0; - return BYTE.test(str); - } - var MIN_INT32 = -(2 ** 31); - var MAX_INT32 = 2 ** 31 - 1; - function validateInt32(value) { - return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32; - } - function validateInt64(value) { - return Number.isInteger(value); - } - function validateNumber() { - return true; - } - var Z_ANCHOR = /[^\\]\\Z/; - function regex(str) { - if (Z_ANCHOR.test(str)) - return false; - try { - new RegExp(str); - return true; - } catch (e) { - return false; - } - } - } -}); - -// ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/limit.js -var require_limit = __commonJS({ - "../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/limit.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.formatLimitDefinition = void 0; - var ajv_1 = require_ajv(); - var codegen_1 = require_codegen(); - var ops = codegen_1.operators; - var KWDs = { - formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, - formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, - formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, - formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } - }; - var error = { - message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, - params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` - }; - exports2.formatLimitDefinition = { - keyword: Object.keys(KWDs), - type: "string", - schemaType: "string", - $data: true, - error, - code(cxt) { - const { gen: gen2, data, schemaCode, keyword, it } = cxt; - const { opts, self: self2 } = it; - if (!opts.validateFormats) - return; - const fCxt = new ajv_1.KeywordCxt(it, self2.RULES.all.format.definition, "format"); - if (fCxt.$data) - validate$DataFormat(); - else - validateFormat(); - function validate$DataFormat() { - const fmts = gen2.scopeValue("formats", { - ref: self2.formats, - code: opts.code.formats - }); - const fmt = gen2.const("fmt", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`); - cxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != "object"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != "function"`, compareCode(fmt))); - } - function validateFormat() { - const format = fCxt.schema; - const fmtDef = self2.formats[format]; - if (!fmtDef || fmtDef === true) - return; - if (typeof fmtDef != "object" || fmtDef instanceof RegExp || typeof fmtDef.compare != "function") { - throw new Error(`"${keyword}": format "${format}" does not define "compare" function`); - } - const fmt = gen2.scopeValue("formats", { - key: format, - ref: fmtDef, - code: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : void 0 - }); - cxt.fail$data(compareCode(fmt)); - } - function compareCode(fmt) { - return (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`; - } - }, - dependencies: ["format"] - }; - var formatLimitPlugin = (ajv) => { - ajv.addKeyword(exports2.formatLimitDefinition); - return ajv; - }; - exports2.default = formatLimitPlugin; - } -}); - -// ../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/index.js -var require_dist = __commonJS({ - "../../node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/index.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var formats_1 = require_formats(); - var limit_1 = require_limit(); - var codegen_1 = require_codegen(); - var fullName = new codegen_1.Name("fullFormats"); - var fastName = new codegen_1.Name("fastFormats"); - var formatsPlugin = (ajv, opts = { keywords: true }) => { - if (Array.isArray(opts)) { - addFormats(ajv, opts, formats_1.fullFormats, fullName); - return ajv; - } - const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName]; - const list = opts.formats || formats_1.formatNames; - addFormats(ajv, list, formats, exportName); - if (opts.keywords) - (0, limit_1.default)(ajv); - return ajv; - }; - formatsPlugin.get = (name, mode = "full") => { - const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats; - const f = formats[name]; - if (!f) - throw new Error(`Unknown format "${name}"`); - return f; - }; - function addFormats(ajv, list, fs2, exportName) { - var _a; - var _b; - (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`; - for (const f of list) - ajv.addFormat(f, fs2[f]); - } - module2.exports = exports2 = formatsPlugin; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.default = formatsPlugin; - } -}); - -// ../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/lib/validator-compiler.js -var require_validator_compiler = __commonJS({ - "../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/lib/validator-compiler.js"(exports2, module2) { - "use strict"; - var Ajv = require_ajv().default; - var AjvJTD = require_jtd2(); - var defaultAjvOptions = require_default_ajv_options(); - var ValidatorCompiler = class { - constructor(externalSchemas, options) { - if (options.mode === "JTD") { - this.ajv = new AjvJTD(Object.assign({}, defaultAjvOptions, options.customOptions)); - } else { - this.ajv = new Ajv(Object.assign({}, defaultAjvOptions, options.customOptions)); - } - let addFormatPlugin = true; - if (options.plugins && options.plugins.length > 0) { - for (const plugin of options.plugins) { - if (Array.isArray(plugin)) { - addFormatPlugin = addFormatPlugin && plugin[0].name !== "formatsPlugin"; - plugin[0](this.ajv, plugin[1]); - } else { - addFormatPlugin = addFormatPlugin && plugin.name !== "formatsPlugin"; - plugin(this.ajv); - } - } - } - if (addFormatPlugin) { - require_dist()(this.ajv); - } - options.onCreate?.(this.ajv); - const sourceSchemas = Object.values(externalSchemas); - for (const extSchema of sourceSchemas) { - this.ajv.addSchema(extSchema); - } - } - buildValidatorFunction({ - schema - /*, method, url, httpPart */ - }) { - if (schema.$id) { - const stored = this.ajv.getSchema(schema.$id); - if (stored) { - return stored; - } - } - return this.ajv.compile(schema); - } - }; - module2.exports = ValidatorCompiler; - } -}); - -// ../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/lib/serializer-compiler.js -var require_serializer_compiler = __commonJS({ - "../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/lib/serializer-compiler.js"(exports2, module2) { - "use strict"; - var AjvJTD = require_jtd2(); - var defaultAjvOptions = require_default_ajv_options(); - var SerializerCompiler = class { - constructor(_externalSchemas, options) { - this.ajv = new AjvJTD(Object.assign({}, defaultAjvOptions, options)); - } - buildSerializerFunction({ - schema - /*, method, url, httpStatus */ - }) { - return this.ajv.compileSerializer(schema); - } - }; - module2.exports = SerializerCompiler; - } -}); - -// ../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/standalone/index.js -var require_standalone = __commonJS({ - "../../node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/standalone/index.js"(exports2, module2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var scope_1 = require_scope(); - var code_1 = require_code(); - function standaloneCode(ajv, refsOrFunc) { - if (!ajv.opts.code.source) { - throw new Error("moduleCode: ajv instance must have code.source option"); - } - const { _n } = ajv.scope.opts; - return typeof refsOrFunc == "function" ? funcExportCode(refsOrFunc.source) : refsOrFunc !== void 0 ? multiExportsCode(refsOrFunc, getValidate) : multiExportsCode(ajv.schemas, (sch) => sch.meta ? void 0 : ajv.compile(sch.schema)); - function getValidate(id) { - const v = ajv.getSchema(id); - if (!v) - throw new Error(`moduleCode: no schema with id ${id}`); - return v; - } - function funcExportCode(source) { - const usedValues = {}; - const n = source === null || source === void 0 ? void 0 : source.validateName; - const vCode = validateCode(usedValues, source); - if (ajv.opts.code.esm) { - return `"use strict";${_n}export const validate = ${n};${_n}export default ${n};${_n}${vCode}`; - } - return `"use strict";${_n}module.exports = ${n};${_n}module.exports.default = ${n};${_n}${vCode}`; - } - function multiExportsCode(schemas, getValidateFunc) { - var _a; - const usedValues = {}; - let code = (0, code_1._)`"use strict";`; - for (const name in schemas) { - const v = getValidateFunc(schemas[name]); - if (v) { - const vCode = validateCode(usedValues, v.source); - const exportSyntax = ajv.opts.code.esm ? (0, code_1._)`export const ${(0, code_1.getEsmExportName)(name)}` : (0, code_1._)`exports${(0, code_1.getProperty)(name)}`; - code = (0, code_1._)`${code}${_n}${exportSyntax} = ${(_a = v.source) === null || _a === void 0 ? void 0 : _a.validateName};${_n}${vCode}`; - } - } - return `${code}`; - } - function validateCode(usedValues, s) { - if (!s) - throw new Error('moduleCode: function does not have "source" property'); - if (usedState(s.validateName) === scope_1.UsedValueState.Completed) - return code_1.nil; - setUsedState(s.validateName, scope_1.UsedValueState.Started); - const scopeCode = ajv.scope.scopeCode(s.scopeValues, usedValues, refValidateCode); - const code = new code_1._Code(`${scopeCode}${_n}${s.validateCode}`); - return s.evaluated ? (0, code_1._)`${code}${s.validateName}.evaluated = ${s.evaluated};${_n}` : code; - function refValidateCode(n) { - var _a; - const vRef = (_a = n.value) === null || _a === void 0 ? void 0 : _a.ref; - if (n.prefix === "validate" && typeof vRef == "function") { - const v = vRef; - return validateCode(usedValues, v.source); - } else if ((n.prefix === "root" || n.prefix === "wrapper") && typeof vRef == "object") { - const { validate: validate3, validateName: validateName2 } = vRef; - if (!validateName2) - throw new Error("ajv internal error"); - const def = ajv.opts.code.es5 ? scope_1.varKinds.var : scope_1.varKinds.const; - const wrapper = (0, code_1._)`${def} ${n} = {validate: ${validateName2}};`; - if (usedState(validateName2) === scope_1.UsedValueState.Started) - return wrapper; - const vCode = validateCode(usedValues, validate3 === null || validate3 === void 0 ? void 0 : validate3.source); - return (0, code_1._)`${wrapper}${_n}${vCode}`; - } - return void 0; - } - function usedState(name) { - var _a; - return (_a = usedValues[name.prefix]) === null || _a === void 0 ? void 0 : _a.get(name); - } - function setUsedState(name, state) { - const { prefix } = name; - const names = usedValues[prefix] = usedValues[prefix] || /* @__PURE__ */ new Map(); - names.set(name, state); - } - } - } - module2.exports = exports2 = standaloneCode; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.default = standaloneCode; - } -}); - -// ../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/standalone.js -var require_standalone2 = __commonJS({ - "../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/standalone.js"(exports2, module2) { - "use strict"; - var ValidatorSelector = require_ajv_compiler(); - var standaloneCode = require_standalone().default; - function StandaloneValidator(options = { readMode: true }) { - if (options.readMode === true && !options.restoreFunction) { - throw new Error("You must provide a restoreFunction options when readMode ON"); - } - if (options.readMode !== true && !options.storeFunction) { - throw new Error("You must provide a storeFunction options when readMode OFF"); - } - if (options.readMode === true) { - return function wrapper() { - return function(opts) { - return options.restoreFunction(opts); - }; - }; - } - const factory = ValidatorSelector(); - return function wrapper(externalSchemas, ajvOptions = {}) { - if (!ajvOptions.customOptions || !ajvOptions.customOptions.code) { - ajvOptions.customOptions = Object.assign({}, ajvOptions.customOptions, { code: { source: true } }); - } - const compiler = factory(externalSchemas, ajvOptions); - return function(opts) { - const validationFunc = compiler(opts); - const schemaValidationCode = standaloneCode(compiler[ValidatorSelector.AjvReference].ajv, validationFunc); - options.storeFunction(opts, schemaValidationCode); - return validationFunc; - }; - }; - } - module2.exports = StandaloneValidator; - } -}); - -// ../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/index.js -var require_ajv_compiler = __commonJS({ - "../../node_modules/.pnpm/@fastify+ajv-compiler@4.0.5/node_modules/@fastify/ajv-compiler/index.js"(exports2, module2) { - "use strict"; - var AjvReference = Symbol.for("fastify.ajv-compiler.reference"); - var ValidatorCompiler = require_validator_compiler(); - var SerializerCompiler = require_serializer_compiler(); - function AjvCompiler(opts) { - const validatorPool = /* @__PURE__ */ new Map(); - const serializerPool = /* @__PURE__ */ new Map(); - if (opts && opts.jtdSerializer === true) { - return function buildSerializerFromPool(externalSchemas, serializerOpts) { - const uniqueAjvKey = getPoolKey({}, serializerOpts); - if (serializerPool.has(uniqueAjvKey)) { - return serializerPool.get(uniqueAjvKey); - } - const compiler = new SerializerCompiler(externalSchemas, serializerOpts); - const ret = compiler.buildSerializerFunction.bind(compiler); - serializerPool.set(uniqueAjvKey, ret); - return ret; - }; - } - return function buildCompilerFromPool(externalSchemas, options) { - const uniqueAjvKey = getPoolKey(externalSchemas, options.customOptions); - if (validatorPool.has(uniqueAjvKey)) { - return validatorPool.get(uniqueAjvKey); - } - const compiler = new ValidatorCompiler(externalSchemas, options); - const ret = compiler.buildValidatorFunction.bind(compiler); - validatorPool.set(uniqueAjvKey, ret); - if (options.customOptions.code !== void 0) { - ret[AjvReference] = compiler; - } - return ret; - }; - } - function getPoolKey(externalSchemas, options) { - const externals = JSON.stringify(externalSchemas); - const ajvConfig = JSON.stringify(options); - return `${externals}${ajvConfig}`; - } - module2.exports = AjvCompiler; - module2.exports.default = AjvCompiler; - module2.exports.AjvCompiler = AjvCompiler; - module2.exports.AjvReference = AjvReference; - module2.exports.StandaloneValidator = require_standalone2(); - } -}); - -// ../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js -var require_dist2 = __commonJS({ - "../../node_modules/.pnpm/dequal@2.0.3/node_modules/dequal/dist/index.js"(exports2) { - var has = Object.prototype.hasOwnProperty; - function find2(iter, tar, key) { - for (key of iter.keys()) { - if (dequal(key, tar)) - return key; - } - } - function dequal(foo, bar) { - var ctor, len, tmp; - if (foo === bar) - return true; - if (foo && bar && (ctor = foo.constructor) === bar.constructor) { - if (ctor === Date) - return foo.getTime() === bar.getTime(); - if (ctor === RegExp) - return foo.toString() === bar.toString(); - if (ctor === Array) { - if ((len = foo.length) === bar.length) { - while (len-- && dequal(foo[len], bar[len])) - ; - } - return len === -1; - } - if (ctor === Set) { - if (foo.size !== bar.size) { - return false; - } - for (len of foo) { - tmp = len; - if (tmp && typeof tmp === "object") { - tmp = find2(bar, tmp); - if (!tmp) - return false; - } - if (!bar.has(tmp)) - return false; - } - return true; - } - if (ctor === Map) { - if (foo.size !== bar.size) { - return false; - } - for (len of foo) { - tmp = len[0]; - if (tmp && typeof tmp === "object") { - tmp = find2(bar, tmp); - if (!tmp) - return false; - } - if (!dequal(len[1], bar.get(tmp))) { - return false; - } - } - return true; - } - if (ctor === ArrayBuffer) { - foo = new Uint8Array(foo); - bar = new Uint8Array(bar); - } else if (ctor === DataView) { - if ((len = foo.byteLength) === bar.byteLength) { - while (len-- && foo.getInt8(len) === bar.getInt8(len)) - ; - } - return len === -1; - } - if (ArrayBuffer.isView(foo)) { - if ((len = foo.byteLength) === bar.byteLength) { - while (len-- && foo[len] === bar[len]) - ; - } - return len === -1; - } - if (!ctor || typeof foo === "object") { - len = 0; - for (ctor in foo) { - if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) - return false; - if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) - return false; - } - return Object.keys(bar).length === len; - } - } - return foo !== foo && bar !== bar; - } - exports2.dequal = dequal; - } -}); - -// ../../node_modules/.pnpm/json-schema-ref-resolver@3.0.0/node_modules/json-schema-ref-resolver/index.js -var require_json_schema_ref_resolver = __commonJS({ - "../../node_modules/.pnpm/json-schema-ref-resolver@3.0.0/node_modules/json-schema-ref-resolver/index.js"(exports2, module2) { - "use strict"; - var { dequal: deepEqual } = require_dist2(); - var jsonSchemaRefSymbol = Symbol.for("json-schema-ref"); - var RefResolver = class { - #schemas; - #derefSchemas; - #insertRefSymbol; - #allowEqualDuplicates; - #cloneSchemaWithoutRefs; - constructor(opts = {}) { - this.#schemas = {}; - this.#derefSchemas = {}; - this.#insertRefSymbol = opts.insertRefSymbol ?? false; - this.#allowEqualDuplicates = opts.allowEqualDuplicates ?? true; - this.#cloneSchemaWithoutRefs = opts.cloneSchemaWithoutRefs ?? false; - } - addSchema(schema, rootSchemaId, isRootSchema = true) { - if (isRootSchema) { - if (schema.$id !== void 0 && schema.$id.charAt(0) !== "#") { - rootSchemaId = schema.$id; - } else { - this.#insertSchemaBySchemaId(schema, rootSchemaId); - } - } - const schemaId = schema.$id; - if (schemaId !== void 0 && typeof schemaId === "string") { - if (schemaId.charAt(0) === "#") { - this.#insertSchemaByAnchor(schema, rootSchemaId, schemaId); - } else { - this.#insertSchemaBySchemaId(schema, schemaId); - rootSchemaId = schemaId; - } - } - const ref = schema.$ref; - if (ref !== void 0 && typeof ref === "string") { - const { refSchemaId, refJsonPointer } = this.#parseSchemaRef(ref, rootSchemaId); - this.#schemas[rootSchemaId].refs.push({ - schemaId: refSchemaId, - jsonPointer: refJsonPointer - }); - } - for (const key in schema) { - if (typeof schema[key] === "object" && schema[key] !== null) { - this.addSchema(schema[key], rootSchemaId, false); - } - } - } - getSchema(schemaId, jsonPointer = "#") { - const schema = this.#schemas[schemaId]; - if (schema === void 0) { - throw new Error( - `Cannot resolve ref "${schemaId}${jsonPointer}". Schema with id "${schemaId}" is not found.` - ); - } - if (schema.anchors[jsonPointer] !== void 0) { - return schema.anchors[jsonPointer]; - } - return getDataByJSONPointer(schema.schema, jsonPointer); - } - hasSchema(schemaId) { - return this.#schemas[schemaId] !== void 0; - } - getSchemaRefs(schemaId) { - const schema = this.#schemas[schemaId]; - if (schema === void 0) { - throw new Error(`Schema with id "${schemaId}" is not found.`); - } - return schema.refs; - } - getSchemaDependencies(schemaId, dependencies = {}) { - const schema = this.#schemas[schemaId]; - for (const ref of schema.refs) { - const dependencySchemaId = ref.schemaId; - if (dependencySchemaId === schemaId || dependencies[dependencySchemaId] !== void 0) - continue; - dependencies[dependencySchemaId] = this.getSchema(dependencySchemaId); - this.getSchemaDependencies(dependencySchemaId, dependencies); - } - return dependencies; - } - derefSchema(schemaId) { - if (this.#derefSchemas[schemaId] !== void 0) - return; - const schema = this.#schemas[schemaId]; - if (schema === void 0) { - throw new Error(`Schema with id "${schemaId}" is not found.`); - } - if (!this.#cloneSchemaWithoutRefs && schema.refs.length === 0) { - this.#derefSchemas[schemaId] = { - schema: schema.schema, - anchors: schema.anchors - }; - } - const refs = []; - this.#addDerefSchema(schema.schema, schemaId, true, refs); - const dependencies = this.getSchemaDependencies(schemaId); - for (const schemaId2 in dependencies) { - const schema2 = dependencies[schemaId2]; - this.#addDerefSchema(schema2, schemaId2, true, refs); - } - for (const ref of refs) { - const { - refSchemaId, - refJsonPointer - } = this.#parseSchemaRef(ref.ref, ref.sourceSchemaId); - const targetSchema = this.getDerefSchema(refSchemaId, refJsonPointer); - if (targetSchema === null) { - throw new Error( - `Cannot resolve ref "${ref.ref}". Ref "${refJsonPointer}" is not found in schema "${refSchemaId}".` - ); - } - ref.targetSchema = targetSchema; - ref.targetSchemaId = refSchemaId; - } - for (const ref of refs) { - this.#resolveRef(ref, refs); - } - } - getDerefSchema(schemaId, jsonPointer = "#") { - let derefSchema = this.#derefSchemas[schemaId]; - if (derefSchema === void 0) { - this.derefSchema(schemaId); - derefSchema = this.#derefSchemas[schemaId]; - } - if (derefSchema.anchors[jsonPointer] !== void 0) { - return derefSchema.anchors[jsonPointer]; - } - return getDataByJSONPointer(derefSchema.schema, jsonPointer); - } - #parseSchemaRef(ref, schemaId) { - const sharpIndex = ref.indexOf("#"); - if (sharpIndex === -1) { - return { refSchemaId: ref, refJsonPointer: "#" }; - } - if (sharpIndex === 0) { - return { refSchemaId: schemaId, refJsonPointer: ref }; - } - return { - refSchemaId: ref.slice(0, sharpIndex), - refJsonPointer: ref.slice(sharpIndex) - }; - } - #addDerefSchema(schema, rootSchemaId, isRootSchema, refs = []) { - const derefSchema = Array.isArray(schema) ? [...schema] : { ...schema }; - if (isRootSchema) { - if (schema.$id !== void 0 && schema.$id.charAt(0) !== "#") { - rootSchemaId = schema.$id; - } else { - this.#insertDerefSchemaBySchemaId(derefSchema, rootSchemaId); - } - } - const schemaId = derefSchema.$id; - if (schemaId !== void 0 && typeof schemaId === "string") { - if (schemaId.charAt(0) === "#") { - this.#insertDerefSchemaByAnchor(derefSchema, rootSchemaId, schemaId); - } else { - this.#insertDerefSchemaBySchemaId(derefSchema, schemaId); - rootSchemaId = schemaId; - } - } - if (derefSchema.$ref !== void 0) { - refs.push({ - ref: derefSchema.$ref, - sourceSchemaId: rootSchemaId, - sourceSchema: derefSchema - }); - } - for (const key in derefSchema) { - const value = derefSchema[key]; - if (typeof value === "object" && value !== null) { - derefSchema[key] = this.#addDerefSchema(value, rootSchemaId, false, refs); - } - } - return derefSchema; - } - #resolveRef(ref, refs) { - const { sourceSchema, targetSchema } = ref; - if (!sourceSchema.$ref) - return; - if (this.#insertRefSymbol) { - sourceSchema[jsonSchemaRefSymbol] = sourceSchema.$ref; - } - delete sourceSchema.$ref; - if (targetSchema.$ref) { - const targetSchemaRef = refs.find((ref2) => ref2.sourceSchema === targetSchema); - this.#resolveRef(targetSchemaRef, refs); - } - for (const key in targetSchema) { - if (key === "$id") - continue; - if (sourceSchema[key] !== void 0) { - if (deepEqual(sourceSchema[key], targetSchema[key])) - continue; - throw new Error( - `Cannot resolve ref "${ref.ref}". Property "${key}" already exists in schema "${ref.sourceSchemaId}".` - ); - } - sourceSchema[key] = targetSchema[key]; - } - ref.isResolved = true; - } - #insertSchemaBySchemaId(schema, schemaId) { - const foundSchema = this.#schemas[schemaId]; - if (foundSchema !== void 0) { - if (this.#allowEqualDuplicates && deepEqual(schema, foundSchema.schema)) - return; - throw new Error(`There is already another schema with id "${schemaId}".`); - } - this.#schemas[schemaId] = { schema, anchors: {}, refs: [] }; - } - #insertSchemaByAnchor(schema, schemaId, anchor) { - const { anchors } = this.#schemas[schemaId]; - if (anchors[anchor] !== void 0) { - throw new Error(`There is already another anchor "${anchor}" in schema "${schemaId}".`); - } - anchors[anchor] = schema; - } - #insertDerefSchemaBySchemaId(schema, schemaId) { - const foundSchema = this.#derefSchemas[schemaId]; - if (foundSchema !== void 0) - return; - this.#derefSchemas[schemaId] = { schema, anchors: {} }; - } - #insertDerefSchemaByAnchor(schema, schemaId, anchor) { - const { anchors } = this.#derefSchemas[schemaId]; - anchors[anchor] = schema; - } - }; - function getDataByJSONPointer(data, jsonPointer) { - const parts = jsonPointer.split("/"); - let current = data; - for (const part of parts) { - if (part === "" || part === "#") - continue; - if (typeof current !== "object" || current === null) { - return null; - } - current = current[part]; - } - return current ?? null; - } - module2.exports = { RefResolver }; - } -}); - -// ../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/validator.js -var require_validator = __commonJS({ - "../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/validator.js"(exports2, module2) { - "use strict"; - var Ajv = require_ajv(); - var fastUri = require_fast_uri(); - var ajvFormats = require_dist(); - var clone2 = require_rfdc()({ proto: true }); - var Validator = class _Validator { - constructor(ajvOptions) { - this.ajv = new Ajv({ - ...ajvOptions, - strictSchema: false, - validateSchema: false, - allowUnionTypes: true, - uriResolver: fastUri - }); - ajvFormats(this.ajv); - this.ajv.addKeyword({ - keyword: "fjs_type", - type: "object", - errors: false, - validate: (_type, data) => { - return data && typeof data.toJSON === "function"; - } - }); - this._ajvSchemas = {}; - this._ajvOptions = ajvOptions || {}; - } - addSchema(schema, schemaName) { - let schemaKey = schema.$id || schemaName; - if (schema.$id !== void 0 && schema.$id[0] === "#") { - schemaKey = schemaName + schema.$id; - } - if (this.ajv.refs[schemaKey] === void 0 && this.ajv.schemas[schemaKey] === void 0) { - const ajvSchema = clone2(schema); - this.convertSchemaToAjvFormat(ajvSchema); - this.ajv.addSchema(ajvSchema, schemaKey); - this._ajvSchemas[schemaKey] = schema; - } - } - validate(schemaRef, data) { - return this.ajv.validate(schemaRef, data); - } - // Ajv does not natively support JavaScript objects like Date or other types - // that rely on a custom .toJSON() representation. To properly validate schemas - // that may contain such objects (e.g. Date, ObjectId, etc.), we replace all - // occurrences of the string type with a custom keyword fjs_type - // (see https://github.com/fastify/fast-json-stringify/pull/441) - convertSchemaToAjvFormat(schema) { - if (schema === null) - return; - if (schema.type === "string") { - schema.fjs_type = "string"; - schema.type = ["string", "object"]; - } else if (Array.isArray(schema.type) && schema.type.includes("string") && !schema.type.includes("object")) { - schema.fjs_type = "string"; - schema.type.push("object"); - } - for (const property in schema) { - if (typeof schema[property] === "object") { - this.convertSchemaToAjvFormat(schema[property]); - } - } - } - getState() { - return { - ajvOptions: this._ajvOptions, - ajvSchemas: this._ajvSchemas - }; - } - static restoreFromState(state) { - const validator = new _Validator(state.ajvOptions); - for (const [id, ajvSchema] of Object.entries(state.ajvSchemas)) { - validator.ajv.addSchema(ajvSchema, id); - } - return validator; - } - }; - module2.exports = Validator; - } -}); - -// ../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/location.js -var require_location = __commonJS({ - "../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/location.js"(exports2, module2) { - "use strict"; - var Location = class _Location { - constructor(schema, schemaId, jsonPointer = "#") { - this.schema = schema; - this.schemaId = schemaId; - this.jsonPointer = jsonPointer; - } - getPropertyLocation(propertyName) { - const propertyLocation = new _Location( - this.schema[propertyName], - this.schemaId, - this.jsonPointer + "/" + propertyName - ); - return propertyLocation; - } - getSchemaRef() { - return this.schemaId + this.jsonPointer; - } - }; - module2.exports = Location; - } -}); - -// ../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/schema-validator.js -var require_schema_validator = __commonJS({ - "../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/schema-validator.js"(exports2, module2) { - "use strict"; - module2.exports = validate10; - module2.exports.default = validate10; - var schema11 = { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://json-schema.org/draft-07/schema#", "title": "Core schema meta-schema", "definitions": { "schemaArray": { "type": "array", "minItems": 1, "items": { "$ref": "#" } }, "nonNegativeInteger": { "type": "integer", "minimum": 0 }, "nonNegativeIntegerDefault0": { "allOf": [{ "$ref": "#/definitions/nonNegativeInteger" }, { "default": 0 }] }, "simpleTypes": { "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] }, "stringArray": { "type": "array", "items": { "type": "string" }, "uniqueItems": true, "default": [] } }, "type": ["object", "boolean"], "properties": { "$id": { "type": "string", "format": "uri-reference" }, "$schema": { "type": "string", "format": "uri" }, "$ref": { "type": "string", "format": "uri-reference" }, "$comment": { "type": "string" }, "title": { "type": "string" }, "description": { "type": "string" }, "default": true, "readOnly": { "type": "boolean", "default": false }, "examples": { "type": "array", "items": true }, "multipleOf": { "type": "number", "exclusiveMinimum": 0 }, "maximum": { "type": "number" }, "exclusiveMaximum": { "type": "number" }, "minimum": { "type": "number" }, "exclusiveMinimum": { "type": "number" }, "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, "pattern": { "type": "string", "format": "regex" }, "additionalItems": { "$ref": "#" }, "items": { "anyOf": [{ "$ref": "#" }, { "$ref": "#/definitions/schemaArray" }], "default": true }, "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, "uniqueItems": { "type": "boolean", "default": false }, "contains": { "$ref": "#" }, "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, "required": { "$ref": "#/definitions/stringArray" }, "additionalProperties": { "$ref": "#" }, "definitions": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "properties": { "type": "object", "additionalProperties": { "$ref": "#" }, "default": {} }, "patternProperties": { "type": "object", "additionalProperties": { "$ref": "#" }, "propertyNames": { "format": "regex" }, "default": {} }, "dependencies": { "type": "object", "additionalProperties": { "anyOf": [{ "$ref": "#" }, { "$ref": "#/definitions/stringArray" }] } }, "propertyNames": { "$ref": "#" }, "const": true, "enum": { "type": "array", "items": true, "minItems": 1, "uniqueItems": true }, "type": { "anyOf": [{ "$ref": "#/definitions/simpleTypes" }, { "type": "array", "items": { "$ref": "#/definitions/simpleTypes" }, "minItems": 1, "uniqueItems": true }] }, "format": { "type": "string" }, "contentMediaType": { "type": "string" }, "contentEncoding": { "type": "string" }, "if": { "$ref": "#" }, "then": { "$ref": "#" }, "else": { "$ref": "#" }, "allOf": { "$ref": "#/definitions/schemaArray" }, "anyOf": { "$ref": "#/definitions/schemaArray" }, "oneOf": { "$ref": "#/definitions/schemaArray" }, "not": { "$ref": "#" } }, "default": true }; - var schema20 = { "enum": ["array", "boolean", "integer", "null", "number", "object", "string"] }; - var formats0 = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; - var formats2 = require_formats().fullFormats.uri; - var formats6 = require_formats().fullFormats.regex; - function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - const _errs1 = errors; - if (!(typeof data == "number" && (!(data % 1) && !isNaN(data)) && isFinite(data))) { - validate11.errors = [{ instancePath, schemaPath: "#/definitions/nonNegativeInteger/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - if (errors === _errs1) { - if (typeof data == "number" && isFinite(data)) { - if (data < 0 || isNaN(data)) { - validate11.errors = [{ instancePath, schemaPath: "#/definitions/nonNegativeInteger/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }]; - return false; - } - } - } - validate11.errors = vErrors; - return errors === 0; - } - var root1 = { validate: validate10 }; - function validate13(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (errors === 0) { - if (Array.isArray(data)) { - if (data.length < 1) { - validate13.errors = [{ instancePath, schemaPath: "#/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }]; - return false; - } else { - var valid0 = true; - const len0 = data.length; - for (let i0 = 0; i0 < len0; i0++) { - const _errs1 = errors; - if (!root1.validate(data[i0], { instancePath: instancePath + "/" + i0, parentData: data, parentDataProperty: i0, rootData })) { - vErrors = vErrors === null ? root1.validate.errors : vErrors.concat(root1.validate.errors); - errors = vErrors.length; - } - var valid0 = _errs1 === errors; - if (!valid0) { - break; - } - } - } - } else { - validate13.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; - return false; - } - } - validate13.errors = vErrors; - return errors === 0; - } - var func0 = require_equal().default; - function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - ; - let vErrors = null; - let errors = 0; - if (!(data && typeof data == "object" && !Array.isArray(data)) && typeof data !== "boolean") { - validate10.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: schema11.type }, message: "must be object,boolean" }]; - return false; - } - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.$id !== void 0) { - let data0 = data.$id; - const _errs1 = errors; - if (errors === _errs1) { - if (errors === _errs1) { - if (typeof data0 === "string") { - if (!formats0.test(data0)) { - validate10.errors = [{ instancePath: instancePath + "/$id", schemaPath: "#/properties/%24id/format", keyword: "format", params: { format: "uri-reference" }, message: 'must match format "uri-reference"' }]; - return false; - } - } else { - validate10.errors = [{ instancePath: instancePath + "/$id", schemaPath: "#/properties/%24id/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - } - var valid0 = _errs1 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.$schema !== void 0) { - let data1 = data.$schema; - const _errs3 = errors; - if (errors === _errs3) { - if (errors === _errs3) { - if (typeof data1 === "string") { - if (!formats2(data1)) { - validate10.errors = [{ instancePath: instancePath + "/$schema", schemaPath: "#/properties/%24schema/format", keyword: "format", params: { format: "uri" }, message: 'must match format "uri"' }]; - return false; - } - } else { - validate10.errors = [{ instancePath: instancePath + "/$schema", schemaPath: "#/properties/%24schema/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - } - var valid0 = _errs3 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.$ref !== void 0) { - let data2 = data.$ref; - const _errs5 = errors; - if (errors === _errs5) { - if (errors === _errs5) { - if (typeof data2 === "string") { - if (!formats0.test(data2)) { - validate10.errors = [{ instancePath: instancePath + "/$ref", schemaPath: "#/properties/%24ref/format", keyword: "format", params: { format: "uri-reference" }, message: 'must match format "uri-reference"' }]; - return false; - } - } else { - validate10.errors = [{ instancePath: instancePath + "/$ref", schemaPath: "#/properties/%24ref/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - } - var valid0 = _errs5 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.$comment !== void 0) { - const _errs7 = errors; - if (typeof data.$comment !== "string") { - validate10.errors = [{ instancePath: instancePath + "/$comment", schemaPath: "#/properties/%24comment/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - var valid0 = _errs7 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.title !== void 0) { - const _errs9 = errors; - if (typeof data.title !== "string") { - validate10.errors = [{ instancePath: instancePath + "/title", schemaPath: "#/properties/title/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - var valid0 = _errs9 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.description !== void 0) { - const _errs11 = errors; - if (typeof data.description !== "string") { - validate10.errors = [{ instancePath: instancePath + "/description", schemaPath: "#/properties/description/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - var valid0 = _errs11 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.readOnly !== void 0) { - const _errs13 = errors; - if (typeof data.readOnly !== "boolean") { - validate10.errors = [{ instancePath: instancePath + "/readOnly", schemaPath: "#/properties/readOnly/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - var valid0 = _errs13 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.examples !== void 0) { - const _errs15 = errors; - if (errors === _errs15) { - if (!Array.isArray(data.examples)) { - validate10.errors = [{ instancePath: instancePath + "/examples", schemaPath: "#/properties/examples/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; - return false; - } - } - var valid0 = _errs15 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.multipleOf !== void 0) { - let data8 = data.multipleOf; - const _errs17 = errors; - if (errors === _errs17) { - if (typeof data8 == "number" && isFinite(data8)) { - if (data8 <= 0 || isNaN(data8)) { - validate10.errors = [{ instancePath: instancePath + "/multipleOf", schemaPath: "#/properties/multipleOf/exclusiveMinimum", keyword: "exclusiveMinimum", params: { comparison: ">", limit: 0 }, message: "must be > 0" }]; - return false; - } - } else { - validate10.errors = [{ instancePath: instancePath + "/multipleOf", schemaPath: "#/properties/multipleOf/type", keyword: "type", params: { type: "number" }, message: "must be number" }]; - return false; - } - } - var valid0 = _errs17 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.maximum !== void 0) { - let data9 = data.maximum; - const _errs19 = errors; - if (!(typeof data9 == "number" && isFinite(data9))) { - validate10.errors = [{ instancePath: instancePath + "/maximum", schemaPath: "#/properties/maximum/type", keyword: "type", params: { type: "number" }, message: "must be number" }]; - return false; - } - var valid0 = _errs19 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.exclusiveMaximum !== void 0) { - let data10 = data.exclusiveMaximum; - const _errs21 = errors; - if (!(typeof data10 == "number" && isFinite(data10))) { - validate10.errors = [{ instancePath: instancePath + "/exclusiveMaximum", schemaPath: "#/properties/exclusiveMaximum/type", keyword: "type", params: { type: "number" }, message: "must be number" }]; - return false; - } - var valid0 = _errs21 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.minimum !== void 0) { - let data11 = data.minimum; - const _errs23 = errors; - if (!(typeof data11 == "number" && isFinite(data11))) { - validate10.errors = [{ instancePath: instancePath + "/minimum", schemaPath: "#/properties/minimum/type", keyword: "type", params: { type: "number" }, message: "must be number" }]; - return false; - } - var valid0 = _errs23 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.exclusiveMinimum !== void 0) { - let data12 = data.exclusiveMinimum; - const _errs25 = errors; - if (!(typeof data12 == "number" && isFinite(data12))) { - validate10.errors = [{ instancePath: instancePath + "/exclusiveMinimum", schemaPath: "#/properties/exclusiveMinimum/type", keyword: "type", params: { type: "number" }, message: "must be number" }]; - return false; - } - var valid0 = _errs25 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.maxLength !== void 0) { - let data13 = data.maxLength; - const _errs27 = errors; - const _errs28 = errors; - if (!(typeof data13 == "number" && (!(data13 % 1) && !isNaN(data13)) && isFinite(data13))) { - validate10.errors = [{ instancePath: instancePath + "/maxLength", schemaPath: "#/definitions/nonNegativeInteger/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - if (errors === _errs28) { - if (typeof data13 == "number" && isFinite(data13)) { - if (data13 < 0 || isNaN(data13)) { - validate10.errors = [{ instancePath: instancePath + "/maxLength", schemaPath: "#/definitions/nonNegativeInteger/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }]; - return false; - } - } - } - var valid0 = _errs27 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.minLength !== void 0) { - const _errs30 = errors; - if (!validate11(data.minLength, { instancePath: instancePath + "/minLength", parentData: data, parentDataProperty: "minLength", rootData })) { - vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors); - errors = vErrors.length; - } - var valid0 = _errs30 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.pattern !== void 0) { - let data15 = data.pattern; - const _errs31 = errors; - if (errors === _errs31) { - if (errors === _errs31) { - if (typeof data15 === "string") { - if (!formats6(data15)) { - validate10.errors = [{ instancePath: instancePath + "/pattern", schemaPath: "#/properties/pattern/format", keyword: "format", params: { format: "regex" }, message: 'must match format "regex"' }]; - return false; - } - } else { - validate10.errors = [{ instancePath: instancePath + "/pattern", schemaPath: "#/properties/pattern/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - } - var valid0 = _errs31 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.additionalItems !== void 0) { - const _errs33 = errors; - if (!validate10(data.additionalItems, { instancePath: instancePath + "/additionalItems", parentData: data, parentDataProperty: "additionalItems", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs33 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.items !== void 0) { - let data17 = data.items; - const _errs34 = errors; - const _errs35 = errors; - let valid2 = false; - const _errs36 = errors; - if (!validate10(data17, { instancePath: instancePath + "/items", parentData: data, parentDataProperty: "items", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var _valid0 = _errs36 === errors; - valid2 = valid2 || _valid0; - if (!valid2) { - const _errs37 = errors; - if (!validate13(data17, { instancePath: instancePath + "/items", parentData: data, parentDataProperty: "items", rootData })) { - vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors); - errors = vErrors.length; - } - var _valid0 = _errs37 === errors; - valid2 = valid2 || _valid0; - } - if (!valid2) { - const err0 = { instancePath: instancePath + "/items", schemaPath: "#/properties/items/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs35; - if (vErrors !== null) { - if (_errs35) { - vErrors.length = _errs35; - } else { - vErrors = null; - } - } - } - var valid0 = _errs34 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.maxItems !== void 0) { - let data18 = data.maxItems; - const _errs38 = errors; - const _errs39 = errors; - if (!(typeof data18 == "number" && (!(data18 % 1) && !isNaN(data18)) && isFinite(data18))) { - validate10.errors = [{ instancePath: instancePath + "/maxItems", schemaPath: "#/definitions/nonNegativeInteger/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - if (errors === _errs39) { - if (typeof data18 == "number" && isFinite(data18)) { - if (data18 < 0 || isNaN(data18)) { - validate10.errors = [{ instancePath: instancePath + "/maxItems", schemaPath: "#/definitions/nonNegativeInteger/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }]; - return false; - } - } - } - var valid0 = _errs38 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.minItems !== void 0) { - const _errs41 = errors; - if (!validate11(data.minItems, { instancePath: instancePath + "/minItems", parentData: data, parentDataProperty: "minItems", rootData })) { - vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors); - errors = vErrors.length; - } - var valid0 = _errs41 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.uniqueItems !== void 0) { - const _errs42 = errors; - if (typeof data.uniqueItems !== "boolean") { - validate10.errors = [{ instancePath: instancePath + "/uniqueItems", schemaPath: "#/properties/uniqueItems/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - var valid0 = _errs42 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.contains !== void 0) { - const _errs44 = errors; - if (!validate10(data.contains, { instancePath: instancePath + "/contains", parentData: data, parentDataProperty: "contains", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs44 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.maxProperties !== void 0) { - let data22 = data.maxProperties; - const _errs45 = errors; - const _errs46 = errors; - if (!(typeof data22 == "number" && (!(data22 % 1) && !isNaN(data22)) && isFinite(data22))) { - validate10.errors = [{ instancePath: instancePath + "/maxProperties", schemaPath: "#/definitions/nonNegativeInteger/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - if (errors === _errs46) { - if (typeof data22 == "number" && isFinite(data22)) { - if (data22 < 0 || isNaN(data22)) { - validate10.errors = [{ instancePath: instancePath + "/maxProperties", schemaPath: "#/definitions/nonNegativeInteger/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" }]; - return false; - } - } - } - var valid0 = _errs45 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.minProperties !== void 0) { - const _errs48 = errors; - if (!validate11(data.minProperties, { instancePath: instancePath + "/minProperties", parentData: data, parentDataProperty: "minProperties", rootData })) { - vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors); - errors = vErrors.length; - } - var valid0 = _errs48 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.required !== void 0) { - let data24 = data.required; - const _errs49 = errors; - const _errs50 = errors; - if (errors === _errs50) { - if (Array.isArray(data24)) { - var valid6 = true; - const len0 = data24.length; - for (let i0 = 0; i0 < len0; i0++) { - const _errs52 = errors; - if (typeof data24[i0] !== "string") { - validate10.errors = [{ instancePath: instancePath + "/required/" + i0, schemaPath: "#/definitions/stringArray/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - var valid6 = _errs52 === errors; - if (!valid6) { - break; - } - } - if (valid6) { - let i1 = data24.length; - let j0; - if (i1 > 1) { - const indices0 = {}; - for (; i1--; ) { - let item0 = data24[i1]; - if (typeof item0 !== "string") { - continue; - } - if (typeof indices0[item0] == "number") { - j0 = indices0[item0]; - validate10.errors = [{ instancePath: instancePath + "/required", schemaPath: "#/definitions/stringArray/uniqueItems", keyword: "uniqueItems", params: { i: i1, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i1 + " are identical)" }]; - return false; - break; - } - indices0[item0] = i1; - } - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/required", schemaPath: "#/definitions/stringArray/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; - return false; - } - } - var valid0 = _errs49 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.additionalProperties !== void 0) { - const _errs54 = errors; - if (!validate10(data.additionalProperties, { instancePath: instancePath + "/additionalProperties", parentData: data, parentDataProperty: "additionalProperties", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs54 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.definitions !== void 0) { - let data27 = data.definitions; - const _errs55 = errors; - if (errors === _errs55) { - if (data27 && typeof data27 == "object" && !Array.isArray(data27)) { - for (const key0 in data27) { - const _errs58 = errors; - if (!validate10(data27[key0], { instancePath: instancePath + "/definitions/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data27, parentDataProperty: key0, rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid8 = _errs58 === errors; - if (!valid8) { - break; - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/definitions", schemaPath: "#/properties/definitions/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid0 = _errs55 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.properties !== void 0) { - let data29 = data.properties; - const _errs59 = errors; - if (errors === _errs59) { - if (data29 && typeof data29 == "object" && !Array.isArray(data29)) { - for (const key1 in data29) { - const _errs62 = errors; - if (!validate10(data29[key1], { instancePath: instancePath + "/properties/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data29, parentDataProperty: key1, rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid9 = _errs62 === errors; - if (!valid9) { - break; - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/properties", schemaPath: "#/properties/properties/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid0 = _errs59 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.patternProperties !== void 0) { - let data31 = data.patternProperties; - const _errs63 = errors; - if (errors === _errs63) { - if (data31 && typeof data31 == "object" && !Array.isArray(data31)) { - for (const key2 in data31) { - const _errs65 = errors; - if (errors === _errs65) { - if (typeof key2 === "string") { - if (!formats6(key2)) { - const err1 = { instancePath: instancePath + "/patternProperties", schemaPath: "#/properties/patternProperties/propertyNames/format", keyword: "format", params: { format: "regex" }, message: 'must match format "regex"', propertyName: key2 }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - } - var valid10 = _errs65 === errors; - if (!valid10) { - const err2 = { instancePath: instancePath + "/patternProperties", schemaPath: "#/properties/patternProperties/propertyNames", keyword: "propertyNames", params: { propertyName: key2 }, message: "property name must be valid" }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - validate10.errors = vErrors; - return false; - break; - } - } - if (valid10) { - for (const key3 in data31) { - const _errs67 = errors; - if (!validate10(data31[key3], { instancePath: instancePath + "/patternProperties/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data31, parentDataProperty: key3, rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid11 = _errs67 === errors; - if (!valid11) { - break; - } - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/patternProperties", schemaPath: "#/properties/patternProperties/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid0 = _errs63 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.dependencies !== void 0) { - let data33 = data.dependencies; - const _errs68 = errors; - if (errors === _errs68) { - if (data33 && typeof data33 == "object" && !Array.isArray(data33)) { - for (const key4 in data33) { - let data34 = data33[key4]; - const _errs71 = errors; - const _errs72 = errors; - let valid13 = false; - const _errs73 = errors; - if (!validate10(data34, { instancePath: instancePath + "/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data33, parentDataProperty: key4, rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var _valid1 = _errs73 === errors; - valid13 = valid13 || _valid1; - if (!valid13) { - const _errs74 = errors; - const _errs75 = errors; - if (errors === _errs75) { - if (Array.isArray(data34)) { - var valid15 = true; - const len1 = data34.length; - for (let i2 = 0; i2 < len1; i2++) { - const _errs77 = errors; - if (typeof data34[i2] !== "string") { - const err3 = { instancePath: instancePath + "/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1") + "/" + i2, schemaPath: "#/definitions/stringArray/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - var valid15 = _errs77 === errors; - if (!valid15) { - break; - } - } - if (valid15) { - let i3 = data34.length; - let j1; - if (i3 > 1) { - const indices1 = {}; - for (; i3--; ) { - let item1 = data34[i3]; - if (typeof item1 !== "string") { - continue; - } - if (typeof indices1[item1] == "number") { - j1 = indices1[item1]; - const err4 = { instancePath: instancePath + "/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/definitions/stringArray/uniqueItems", keyword: "uniqueItems", params: { i: i3, j: j1 }, message: "must NOT have duplicate items (items ## " + j1 + " and " + i3 + " are identical)" }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - break; - } - indices1[item1] = i3; - } - } - } - } else { - const err5 = { instancePath: instancePath + "/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/definitions/stringArray/type", keyword: "type", params: { type: "array" }, message: "must be array" }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - var _valid1 = _errs74 === errors; - valid13 = valid13 || _valid1; - } - if (!valid13) { - const err6 = { instancePath: instancePath + "/dependencies/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/dependencies/additionalProperties/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs72; - if (vErrors !== null) { - if (_errs72) { - vErrors.length = _errs72; - } else { - vErrors = null; - } - } - } - var valid12 = _errs71 === errors; - if (!valid12) { - break; - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/dependencies", schemaPath: "#/properties/dependencies/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid0 = _errs68 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.propertyNames !== void 0) { - const _errs79 = errors; - if (!validate10(data.propertyNames, { instancePath: instancePath + "/propertyNames", parentData: data, parentDataProperty: "propertyNames", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs79 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.enum !== void 0) { - let data37 = data.enum; - const _errs80 = errors; - if (errors === _errs80) { - if (Array.isArray(data37)) { - if (data37.length < 1) { - validate10.errors = [{ instancePath: instancePath + "/enum", schemaPath: "#/properties/enum/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }]; - return false; - } else { - let i4 = data37.length; - let j2; - if (i4 > 1) { - outer0: - for (; i4--; ) { - for (j2 = i4; j2--; ) { - if (func0(data37[i4], data37[j2])) { - validate10.errors = [{ instancePath: instancePath + "/enum", schemaPath: "#/properties/enum/uniqueItems", keyword: "uniqueItems", params: { i: i4, j: j2 }, message: "must NOT have duplicate items (items ## " + j2 + " and " + i4 + " are identical)" }]; - return false; - break outer0; - } - } - } - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/enum", schemaPath: "#/properties/enum/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; - return false; - } - } - var valid0 = _errs80 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.type !== void 0) { - let data38 = data.type; - const _errs82 = errors; - const _errs83 = errors; - let valid18 = false; - const _errs84 = errors; - if (!(data38 === "array" || data38 === "boolean" || data38 === "integer" || data38 === "null" || data38 === "number" || data38 === "object" || data38 === "string")) { - const err7 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/simpleTypes/enum", keyword: "enum", params: { allowedValues: schema20.enum }, message: "must be equal to one of the allowed values" }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - var _valid2 = _errs84 === errors; - valid18 = valid18 || _valid2; - if (!valid18) { - const _errs86 = errors; - if (errors === _errs86) { - if (Array.isArray(data38)) { - if (data38.length < 1) { - const err8 = { instancePath: instancePath + "/type", schemaPath: "#/properties/type/anyOf/1/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } else { - var valid20 = true; - const len2 = data38.length; - for (let i5 = 0; i5 < len2; i5++) { - let data39 = data38[i5]; - const _errs88 = errors; - if (!(data39 === "array" || data39 === "boolean" || data39 === "integer" || data39 === "null" || data39 === "number" || data39 === "object" || data39 === "string")) { - const err9 = { instancePath: instancePath + "/type/" + i5, schemaPath: "#/definitions/simpleTypes/enum", keyword: "enum", params: { allowedValues: schema20.enum }, message: "must be equal to one of the allowed values" }; - if (vErrors === null) { - vErrors = [err9]; - } else { - vErrors.push(err9); - } - errors++; - } - var valid20 = _errs88 === errors; - if (!valid20) { - break; - } - } - if (valid20) { - let i6 = data38.length; - let j3; - if (i6 > 1) { - outer1: - for (; i6--; ) { - for (j3 = i6; j3--; ) { - if (func0(data38[i6], data38[j3])) { - const err10 = { instancePath: instancePath + "/type", schemaPath: "#/properties/type/anyOf/1/uniqueItems", keyword: "uniqueItems", params: { i: i6, j: j3 }, message: "must NOT have duplicate items (items ## " + j3 + " and " + i6 + " are identical)" }; - if (vErrors === null) { - vErrors = [err10]; - } else { - vErrors.push(err10); - } - errors++; - break outer1; - } - } - } - } - } - } - } else { - const err11 = { instancePath: instancePath + "/type", schemaPath: "#/properties/type/anyOf/1/type", keyword: "type", params: { type: "array" }, message: "must be array" }; - if (vErrors === null) { - vErrors = [err11]; - } else { - vErrors.push(err11); - } - errors++; - } - } - var _valid2 = _errs86 === errors; - valid18 = valid18 || _valid2; - } - if (!valid18) { - const err12 = { instancePath: instancePath + "/type", schemaPath: "#/properties/type/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; - if (vErrors === null) { - vErrors = [err12]; - } else { - vErrors.push(err12); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs83; - if (vErrors !== null) { - if (_errs83) { - vErrors.length = _errs83; - } else { - vErrors = null; - } - } - } - var valid0 = _errs82 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.format !== void 0) { - const _errs90 = errors; - if (typeof data.format !== "string") { - validate10.errors = [{ instancePath: instancePath + "/format", schemaPath: "#/properties/format/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - var valid0 = _errs90 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.contentMediaType !== void 0) { - const _errs92 = errors; - if (typeof data.contentMediaType !== "string") { - validate10.errors = [{ instancePath: instancePath + "/contentMediaType", schemaPath: "#/properties/contentMediaType/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - var valid0 = _errs92 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.contentEncoding !== void 0) { - const _errs94 = errors; - if (typeof data.contentEncoding !== "string") { - validate10.errors = [{ instancePath: instancePath + "/contentEncoding", schemaPath: "#/properties/contentEncoding/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - var valid0 = _errs94 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.if !== void 0) { - const _errs96 = errors; - if (!validate10(data.if, { instancePath: instancePath + "/if", parentData: data, parentDataProperty: "if", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs96 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.then !== void 0) { - const _errs97 = errors; - if (!validate10(data.then, { instancePath: instancePath + "/then", parentData: data, parentDataProperty: "then", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs97 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.else !== void 0) { - const _errs98 = errors; - if (!validate10(data.else, { instancePath: instancePath + "/else", parentData: data, parentDataProperty: "else", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs98 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.allOf !== void 0) { - const _errs99 = errors; - if (!validate13(data.allOf, { instancePath: instancePath + "/allOf", parentData: data, parentDataProperty: "allOf", rootData })) { - vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors); - errors = vErrors.length; - } - var valid0 = _errs99 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.anyOf !== void 0) { - const _errs100 = errors; - if (!validate13(data.anyOf, { instancePath: instancePath + "/anyOf", parentData: data, parentDataProperty: "anyOf", rootData })) { - vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors); - errors = vErrors.length; - } - var valid0 = _errs100 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.oneOf !== void 0) { - const _errs101 = errors; - if (!validate13(data.oneOf, { instancePath: instancePath + "/oneOf", parentData: data, parentDataProperty: "oneOf", rootData })) { - vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors); - errors = vErrors.length; - } - var valid0 = _errs101 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.not !== void 0) { - const _errs102 = errors; - if (!validate10(data.not, { instancePath: instancePath + "/not", parentData: data, parentDataProperty: "not", rootData })) { - vErrors = vErrors === null ? validate10.errors : vErrors.concat(validate10.errors); - errors = vErrors.length; - } - var valid0 = _errs102 === errors; - } else { - var valid0 = true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - validate10.errors = vErrors; - return errors === 0; - } - } -}); - -// ../../node_modules/.pnpm/@fastify+merge-json-schemas@0.2.1/node_modules/@fastify/merge-json-schemas/lib/errors.js -var require_errors4 = __commonJS({ - "../../node_modules/.pnpm/@fastify+merge-json-schemas@0.2.1/node_modules/@fastify/merge-json-schemas/lib/errors.js"(exports2, module2) { - "use strict"; - var MergeError = class extends Error { - constructor(keyword, schemas) { - super(); - this.name = "JsonSchemaMergeError"; - this.code = "JSON_SCHEMA_MERGE_ERROR"; - this.message = `Failed to merge "${keyword}" keyword schemas.`; - this.schemas = schemas; - } - }; - var ResolverNotFoundError = class extends Error { - constructor(keyword, schemas) { - super(); - this.name = "JsonSchemaMergeError"; - this.code = "JSON_SCHEMA_MERGE_ERROR"; - this.message = `Resolver for "${keyword}" keyword not found.`; - this.schemas = schemas; - } - }; - var InvalidOnConflictOptionError = class extends Error { - constructor(onConflict) { - super(); - this.name = "JsonSchemaMergeError"; - this.code = "JSON_SCHEMA_MERGE_ERROR"; - this.message = `Invalid "onConflict" option: "${onConflict}".`; - } - }; - module2.exports = { - MergeError, - ResolverNotFoundError, - InvalidOnConflictOptionError - }; - } -}); - -// ../../node_modules/.pnpm/@fastify+merge-json-schemas@0.2.1/node_modules/@fastify/merge-json-schemas/lib/resolvers.js -var require_resolvers = __commonJS({ - "../../node_modules/.pnpm/@fastify+merge-json-schemas@0.2.1/node_modules/@fastify/merge-json-schemas/lib/resolvers.js"(exports2, module2) { - "use strict"; - var { dequal: deepEqual } = require_dist2(); - var { MergeError } = require_errors4(); - function _arraysIntersection(arrays) { - let intersection = arrays[0]; - for (let i = 1; i < arrays.length; i++) { - intersection = intersection.filter( - (value) => arrays[i].includes(value) - ); - } - return intersection; - } - function arraysIntersection(keyword, values, mergedSchema) { - const intersection = _arraysIntersection(values); - if (intersection.length === 0) { - throw new MergeError(keyword, values); - } - mergedSchema[keyword] = intersection; - } - function hybridArraysIntersection(keyword, values, mergedSchema) { - for (let i = 0; i < values.length; i++) { - if (!Array.isArray(values[i])) { - values[i] = [values[i]]; - } - } - const intersection = _arraysIntersection(values); - if (intersection.length === 0) { - throw new MergeError(keyword, values); - } - if (intersection.length === 1) { - mergedSchema[keyword] = intersection[0]; - } else { - mergedSchema[keyword] = intersection; - } - } - function arraysUnion(keyword, values, mergedSchema) { - const union2 = []; - for (const array2 of values) { - for (const value of array2) { - if (!union2.includes(value)) { - union2.push(value); - } - } - } - mergedSchema[keyword] = union2; - } - function minNumber(keyword, values, mergedSchema) { - mergedSchema[keyword] = Math.min(...values); - } - function maxNumber(keyword, values, mergedSchema) { - mergedSchema[keyword] = Math.max(...values); - } - function commonMultiple(keyword, values, mergedSchema) { - const gcd = (a, b) => !b ? a : gcd(b, a % b); - const lcm = (a, b) => a * b / gcd(a, b); - let scale = 1; - for (const value of values) { - while (value * scale % 1 !== 0) { - scale *= 10; - } - } - let multiple = values[0] * scale; - for (const value of values) { - multiple = lcm(multiple, value * scale); - } - mergedSchema[keyword] = multiple / scale; - } - function allEqual(keyword, values, mergedSchema) { - const firstValue = values[0]; - for (let i = 1; i < values.length; i++) { - if (!deepEqual(values[i], firstValue)) { - throw new MergeError(keyword, values); - } - } - mergedSchema[keyword] = firstValue; - } - function skip() { - } - function booleanAnd(keyword, values, mergedSchema) { - for (const value of values) { - if (value === false) { - mergedSchema[keyword] = false; - return; - } - } - mergedSchema[keyword] = true; - } - function booleanOr(keyword, values, mergedSchema) { - for (const value of values) { - if (value === true) { - mergedSchema[keyword] = true; - return; - } - } - mergedSchema[keyword] = false; - } - module2.exports = { - arraysIntersection, - hybridArraysIntersection, - arraysUnion, - minNumber, - maxNumber, - commonMultiple, - allEqual, - booleanAnd, - booleanOr, - skip - }; - } -}); - -// ../../node_modules/.pnpm/@fastify+merge-json-schemas@0.2.1/node_modules/@fastify/merge-json-schemas/index.js -var require_merge_json_schemas = __commonJS({ - "../../node_modules/.pnpm/@fastify+merge-json-schemas@0.2.1/node_modules/@fastify/merge-json-schemas/index.js"(exports2, module2) { - "use strict"; - var { dequal: deepEqual } = require_dist2(); - var resolvers = require_resolvers(); - var errors = require_errors4(); - var keywordsResolvers = { - $id: resolvers.skip, - type: resolvers.hybridArraysIntersection, - enum: resolvers.arraysIntersection, - minLength: resolvers.maxNumber, - maxLength: resolvers.minNumber, - minimum: resolvers.maxNumber, - maximum: resolvers.minNumber, - multipleOf: resolvers.commonMultiple, - exclusiveMinimum: resolvers.maxNumber, - exclusiveMaximum: resolvers.minNumber, - minItems: resolvers.maxNumber, - maxItems: resolvers.minNumber, - maxProperties: resolvers.minNumber, - minProperties: resolvers.maxNumber, - const: resolvers.allEqual, - default: resolvers.allEqual, - format: resolvers.allEqual, - required: resolvers.arraysUnion, - properties: mergeProperties, - patternProperties: mergeObjects, - additionalProperties: mergeSchemasResolver, - items: mergeItems, - additionalItems: mergeAdditionalItems, - definitions: mergeObjects, - $defs: mergeObjects, - nullable: resolvers.booleanAnd, - oneOf: mergeOneOf, - anyOf: mergeOneOf, - allOf: resolvers.arraysUnion, - not: mergeSchemasResolver, - if: mergeIfThenElseSchemas, - then: resolvers.skip, - else: resolvers.skip, - dependencies: mergeDependencies, - dependentRequired: mergeDependencies, - dependentSchemas: mergeObjects, - propertyNames: mergeSchemasResolver, - uniqueItems: resolvers.booleanOr, - contains: mergeSchemasResolver - }; - function mergeSchemasResolver(keyword, values, mergedSchema, _schemas, options) { - mergedSchema[keyword] = _mergeSchemas(values, options); - } - function cartesianProduct(arrays) { - let result = [[]]; - for (const array2 of arrays) { - const temp = []; - for (const x of result) { - for (const y of array2) { - temp.push([...x, y]); - } - } - result = temp; - } - return result; - } - function mergeOneOf(keyword, values, mergedSchema, _schemas, options) { - if (values.length === 1) { - mergedSchema[keyword] = values[0]; - return; - } - const product = cartesianProduct(values); - const mergedOneOf = []; - for (const combination of product) { - try { - const mergedSchema2 = _mergeSchemas(combination, options); - if (mergedSchema2 !== void 0) { - mergedOneOf.push(mergedSchema2); - } - } catch (error) { - if (error instanceof errors.MergeError) - continue; - throw error; - } - } - mergedSchema[keyword] = mergedOneOf; - } - function getSchemaForItem(schema, index) { - const { items, additionalItems } = schema; - if (Array.isArray(items)) { - if (index < items.length) { - return items[index]; - } - return additionalItems; - } - if (items !== void 0) { - return items; - } - return additionalItems; - } - function mergeItems(keyword, values, mergedSchema, schemas, options) { - let maxArrayItemsLength = 0; - for (const itemsSchema of values) { - if (Array.isArray(itemsSchema)) { - maxArrayItemsLength = Math.max(maxArrayItemsLength, itemsSchema.length); - } - } - if (maxArrayItemsLength === 0) { - mergedSchema[keyword] = _mergeSchemas(values, options); - return; - } - const mergedItemsSchemas = []; - for (let i = 0; i < maxArrayItemsLength; i++) { - const indexItemSchemas = []; - for (const schema of schemas) { - const itemSchema = getSchemaForItem(schema, i); - if (itemSchema !== void 0) { - indexItemSchemas.push(itemSchema); - } - } - mergedItemsSchemas[i] = _mergeSchemas(indexItemSchemas, options); - } - mergedSchema[keyword] = mergedItemsSchemas; - } - function mergeAdditionalItems(keyword, values, mergedSchema, schemas, options) { - let hasArrayItems = false; - for (const schema of schemas) { - if (Array.isArray(schema.items)) { - hasArrayItems = true; - break; - } - } - if (!hasArrayItems) { - mergedSchema[keyword] = _mergeSchemas(values, options); - return; - } - const mergedAdditionalItemsSchemas = []; - for (const schema of schemas) { - let additionalItemsSchema = schema.additionalItems; - if (additionalItemsSchema === void 0 && !Array.isArray(schema.items)) { - additionalItemsSchema = schema.items; - } - if (additionalItemsSchema !== void 0) { - mergedAdditionalItemsSchemas.push(additionalItemsSchema); - } - } - mergedSchema[keyword] = _mergeSchemas(mergedAdditionalItemsSchemas, options); - } - function getSchemaForProperty(schema, propertyName) { - const { properties, patternProperties, additionalProperties } = schema; - if (properties?.[propertyName] !== void 0) { - return properties[propertyName]; - } - for (const pattern of Object.keys(patternProperties ?? {})) { - const regexp = new RegExp(pattern); - if (regexp.test(propertyName)) { - return patternProperties[pattern]; - } - } - return additionalProperties; - } - function mergeProperties(keyword, _values, mergedSchema, schemas, options) { - const foundProperties = {}; - for (const currentSchema of schemas) { - const properties = currentSchema.properties ?? {}; - for (const propertyName of Object.keys(properties)) { - if (foundProperties[propertyName] !== void 0) - continue; - const propertySchema = properties[propertyName]; - foundProperties[propertyName] = [propertySchema]; - for (const anotherSchema of schemas) { - if (currentSchema === anotherSchema) - continue; - const propertySchema2 = getSchemaForProperty(anotherSchema, propertyName); - if (propertySchema2 !== void 0) { - foundProperties[propertyName].push(propertySchema2); - } - } - } - } - const mergedProperties = {}; - for (const property of Object.keys(foundProperties)) { - const propertySchemas = foundProperties[property]; - mergedProperties[property] = _mergeSchemas(propertySchemas, options); - } - mergedSchema[keyword] = mergedProperties; - } - function mergeObjects(keyword, values, mergedSchema, _schemas, options) { - const objectsProperties = {}; - for (const properties of values) { - for (const propertyName of Object.keys(properties)) { - if (objectsProperties[propertyName] === void 0) { - objectsProperties[propertyName] = []; - } - objectsProperties[propertyName].push(properties[propertyName]); - } - } - const mergedProperties = {}; - for (const propertyName of Object.keys(objectsProperties)) { - const propertySchemas = objectsProperties[propertyName]; - const mergedPropertySchema = _mergeSchemas(propertySchemas, options); - mergedProperties[propertyName] = mergedPropertySchema; - } - mergedSchema[keyword] = mergedProperties; - } - function mergeIfThenElseSchemas(_keyword, _values, mergedSchema, schemas, options) { - for (let i = 0; i < schemas.length; i++) { - const subSchema = { - if: schemas[i].if, - then: schemas[i].then, - else: schemas[i].else - }; - if (subSchema.if === void 0) - continue; - if (mergedSchema.if === void 0) { - mergedSchema.if = subSchema.if; - if (subSchema.then !== void 0) { - mergedSchema.then = subSchema.then; - } - if (subSchema.else !== void 0) { - mergedSchema.else = subSchema.else; - } - continue; - } - if (mergedSchema.then !== void 0) { - mergedSchema.then = _mergeSchemas([mergedSchema.then, subSchema], options); - } - if (mergedSchema.else !== void 0) { - mergedSchema.else = _mergeSchemas([mergedSchema.else, subSchema], options); - } - } - } - function mergeDependencies(keyword, values, mergedSchema) { - const mergedDependencies = {}; - for (const dependencies of values) { - for (const propertyName of Object.keys(dependencies)) { - if (mergedDependencies[propertyName] === void 0) { - mergedDependencies[propertyName] = []; - } - const mergedPropertyDependencies = mergedDependencies[propertyName]; - for (const propertyDependency of dependencies[propertyName]) { - if (!mergedPropertyDependencies.includes(propertyDependency)) { - mergedPropertyDependencies.push(propertyDependency); - } - } - } - } - mergedSchema[keyword] = mergedDependencies; - } - function _mergeSchemas(schemas, options) { - if (schemas.length === 0) - return {}; - if (schemas.length === 1) - return schemas[0]; - const mergedSchema = {}; - const keywords = {}; - let allSchemasAreTrue = true; - for (const schema of schemas) { - if (schema === false) - return false; - if (schema === true) - continue; - allSchemasAreTrue = false; - for (const keyword of Object.keys(schema)) { - if (keywords[keyword] === void 0) { - keywords[keyword] = []; - } - keywords[keyword].push(schema[keyword]); - } - } - if (allSchemasAreTrue) - return true; - for (const keyword of Object.keys(keywords)) { - const keywordValues = keywords[keyword]; - const resolver = options.resolvers[keyword] ?? options.defaultResolver; - resolver(keyword, keywordValues, mergedSchema, schemas, options); - } - return mergedSchema; - } - function defaultResolver(keyword, values, mergedSchema, _schemas, options) { - const onConflict = options.onConflict ?? "throw"; - if (values.length === 1 || onConflict === "first") { - mergedSchema[keyword] = values[0]; - return; - } - let allValuesEqual = true; - for (let i = 1; i < values.length; i++) { - if (!deepEqual(values[i], values[0])) { - allValuesEqual = false; - break; - } - } - if (allValuesEqual) { - mergedSchema[keyword] = values[0]; - return; - } - if (onConflict === "throw") { - throw new errors.ResolverNotFoundError(keyword, values); - } - if (onConflict === "skip") { - return; - } - throw new errors.InvalidOnConflictOptionError(onConflict); - } - function mergeSchemas(schemas, options = {}) { - if (options.defaultResolver === void 0) { - options.defaultResolver = defaultResolver; - } - options.resolvers = { ...keywordsResolvers, ...options.resolvers }; - const mergedSchema = _mergeSchemas(schemas, options); - return mergedSchema; - } - module2.exports = { mergeSchemas, keywordsResolvers, defaultResolver, ...errors }; - } -}); - -// ../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/merge-schemas.js -var require_merge_schemas = __commonJS({ - "../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/merge-schemas.js"(exports2, module2) { - "use strict"; - var { mergeSchemas: _mergeSchemas } = require_merge_json_schemas(); - function mergeSchemas(schemas) { - return _mergeSchemas(schemas, { onConflict: "skip" }); - } - module2.exports = mergeSchemas; - } -}); - -// ../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/standalone.js -var require_standalone3 = __commonJS({ - "../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/lib/standalone.js"(exports2, module2) { - "use strict"; - function buildStandaloneCode(contextFunc, context, serializer, validator) { - let ajvDependencyCode = ""; - if (context.validatorSchemasIds.size > 0) { - ajvDependencyCode += "const Validator = require('fast-json-stringify/lib/validator')\n"; - ajvDependencyCode += `const validatorState = ${JSON.stringify(validator.getState())} -`; - ajvDependencyCode += "const validator = Validator.restoreFromState(validatorState)\n"; - } else { - ajvDependencyCode += "const validator = null\n"; - } - const { schema, ...serializerState } = serializer.getState(); - return ` - 'use strict' - - const Serializer = require('fast-json-stringify/lib/serializer') - const serializerState = ${JSON.stringify(serializerState)} - const serializer = Serializer.restoreFromState(serializerState) - - ${ajvDependencyCode} - - module.exports = ${contextFunc.toString()}(validator, serializer)`; - } - module2.exports = buildStandaloneCode; - module2.exports.dependencies = { - Serializer: require_serializer(), - Validator: require_validator() - }; - } -}); - -// ../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/index.js -var require_fast_json_stringify = __commonJS({ - "../../node_modules/.pnpm/fast-json-stringify@6.3.0/node_modules/fast-json-stringify/index.js"(exports2, module2) { - "use strict"; - var { RefResolver } = require_json_schema_ref_resolver(); - var Serializer = require_serializer(); - var Validator = require_validator(); - var Location = require_location(); - var validate3 = require_schema_validator(); - var mergeSchemas = require_merge_schemas(); - var SINGLE_TICK = /'/g; - var largeArraySize = 2e4; - var largeArrayMechanism = "default"; - var serializerFns = ` -const { - asString, - asNumber, - asBoolean, - asDateTime, - asDate, - asTime, - asUnsafeString -} = serializer - -const asInteger = serializer.asInteger.bind(serializer) - -`; - var validRoundingMethods = /* @__PURE__ */ new Set([ - "floor", - "ceil", - "round", - "trunc" - ]); - var validLargeArrayMechanisms = /* @__PURE__ */ new Set([ - "default", - "json-stringify" - ]); - var schemaIdCounter = 0; - function isValidSchema(schema, name) { - if (!validate3(schema)) { - if (name) { - name = `"${name}" `; - } else { - name = ""; - } - const first = validate3.errors[0]; - const err = new Error(`${name}schema is invalid: data${first.instancePath} ${first.message}`); - err.errors = isValidSchema.errors; - throw err; - } - } - function resolveRef(context, location) { - const ref = location.schema.$ref; - let hashIndex = ref.indexOf("#"); - if (hashIndex === -1) { - hashIndex = ref.length; - } - const schemaId = ref.slice(0, hashIndex) || location.schemaId; - const jsonPointer = ref.slice(hashIndex) || "#"; - const schema = context.refResolver.getSchema(schemaId, jsonPointer); - if (schema === null) { - throw new Error(`Cannot find reference "${ref}"`); - } - const newLocation = new Location(schema, schemaId, jsonPointer); - if (schema.$ref !== void 0) { - return resolveRef(context, newLocation); - } - return newLocation; - } - function getMergedLocation(context, mergedSchemaId) { - const mergedSchema = context.refResolver.getSchema(mergedSchemaId, "#"); - return new Location(mergedSchema, mergedSchemaId, "#"); - } - function getSchemaId(schema, rootSchemaId) { - if (schema.$id && schema.$id.charAt(0) !== "#") { - return schema.$id; - } - return rootSchemaId; - } - function getSafeSchemaRef(context, location) { - let schemaRef = location.getSchemaRef() || ""; - if (schemaRef.startsWith(context.rootSchemaId)) { - schemaRef = schemaRef.replace(context.rootSchemaId, "") || "#"; - } - return schemaRef; - } - function build(schema, options) { - isValidSchema(schema); - options = options || {}; - const context = { - functions: [], - functionsCounter: 0, - functionsNamesBySchema: /* @__PURE__ */ new Map(), - options, - refResolver: new RefResolver(), - rootSchemaId: schema.$id || `__fjs_root_${schemaIdCounter++}`, - validatorSchemasIds: /* @__PURE__ */ new Set(), - mergedSchemasIds: /* @__PURE__ */ new Map(), - recursiveSchemas: /* @__PURE__ */ new Set(), - recursivePaths: /* @__PURE__ */ new Set(), - buildingSet: /* @__PURE__ */ new Set(), - uid: 0 - }; - const schemaId = getSchemaId(schema, context.rootSchemaId); - if (!context.refResolver.hasSchema(schemaId)) { - context.refResolver.addSchema(schema, context.rootSchemaId); - } - if (options.schema) { - for (const key in options.schema) { - const schema2 = options.schema[key]; - const schemaId2 = getSchemaId(schema2, key); - if (!context.refResolver.hasSchema(schemaId2)) { - isValidSchema(schema2, key); - context.refResolver.addSchema(schema2, key); - } - } - } - if (options.rounding) { - if (!validRoundingMethods.has(options.rounding)) { - throw new Error(`Unsupported integer rounding method ${options.rounding}`); - } - } - if (options.largeArrayMechanism) { - if (validLargeArrayMechanisms.has(options.largeArrayMechanism)) { - largeArrayMechanism = options.largeArrayMechanism; - } else { - throw new Error(`Unsupported large array mechanism ${options.largeArrayMechanism}`); - } - } - if (options.largeArraySize) { - const largeArraySizeType = typeof options.largeArraySize; - let parsedNumber; - if (largeArraySizeType === "string" && Number.isFinite(parsedNumber = Number.parseInt(options.largeArraySize, 10))) { - largeArraySize = parsedNumber; - } else if (largeArraySizeType === "number" && Number.isInteger(options.largeArraySize)) { - largeArraySize = options.largeArraySize; - } else if (largeArraySizeType === "bigint") { - largeArraySize = Number(options.largeArraySize); - } else { - throw new Error(`Unsupported large array size. Expected integer-like, got ${typeof options.largeArraySize} with value ${options.largeArraySize}`); - } - } - const location = new Location(schema, context.rootSchemaId); - detectRecursiveSchemas(context, location); - const code = buildValue(context, location, "input"); - let contextFunctionCode = ` - ${serializerFns} - const JSON_STR_BEGIN_OBJECT = '{' - const JSON_STR_END_OBJECT = '}' - const JSON_STR_BEGIN_ARRAY = '[' - const JSON_STR_END_ARRAY = ']' - const JSON_STR_COMMA = ',' - const JSON_STR_COLONS = ':' - const JSON_STR_QUOTE = '"' - const JSON_STR_EMPTY_OBJECT = JSON_STR_BEGIN_OBJECT + JSON_STR_END_OBJECT - const JSON_STR_EMPTY_ARRAY = JSON_STR_BEGIN_ARRAY + JSON_STR_END_ARRAY - const JSON_STR_EMPTY_STRING = JSON_STR_QUOTE + JSON_STR_QUOTE - const JSON_STR_NULL = 'null' - `; - if (code === "json += anonymous0(input)") { - contextFunctionCode += ` - ${context.functions.join("\n")} - const main = anonymous0 - return main - `; - } else { - contextFunctionCode += ` - function main (input) { - let json = '' - ${code} - return json - } - ${context.functions.join("\n")} - return main - `; - } - const serializer = new Serializer(options); - const validator = new Validator(options.ajv); - for (const schemaId2 of context.validatorSchemasIds) { - const schema2 = context.refResolver.getSchema(schemaId2); - validator.addSchema(schema2, schemaId2); - const dependencies = context.refResolver.getSchemaDependencies(schemaId2); - for (const [schemaId3, schema3] of Object.entries(dependencies)) { - validator.addSchema(schema3, schemaId3); - } - } - if (options.debugMode) { - options.mode = "debug"; - } - if (options.mode === "debug") { - return { - validator, - serializer, - code: `validator -serializer -${contextFunctionCode}`, - ajv: validator.ajv - }; - } - const contextFunc = new Function("validator", "serializer", contextFunctionCode); - if (options.mode === "standalone") { - const buildStandaloneCode = require_standalone3(); - return buildStandaloneCode(contextFunc, context, serializer, validator); - } - return contextFunc(validator, serializer); - } - var objectKeywords = [ - "properties", - "required", - "additionalProperties", - "patternProperties", - "maxProperties", - "minProperties", - "dependencies" - ]; - var arrayKeywords = [ - "items", - "additionalItems", - "maxItems", - "minItems", - "uniqueItems", - "contains" - ]; - var stringKeywords = [ - "maxLength", - "minLength", - "pattern" - ]; - var numberKeywords = [ - "multipleOf", - "maximum", - "exclusiveMaximum", - "minimum", - "exclusiveMinimum" - ]; - function inferTypeByKeyword(schema) { - for (const keyword of objectKeywords) { - if (keyword in schema) - return "object"; - } - for (const keyword of arrayKeywords) { - if (keyword in schema) - return "array"; - } - for (const keyword of stringKeywords) { - if (keyword in schema) - return "string"; - } - for (const keyword of numberKeywords) { - if (keyword in schema) - return "number"; - } - return schema.type; - } - function buildExtraObjectPropertiesSerializer(context, location, addComma, objVar) { - const schema = location.schema; - const propertiesKeys = Object.keys(schema.properties || {}); - let code = ` - for (const key of Object.keys(${objVar})) { - if ( - ${propertiesKeys.length > 0 ? propertiesKeys.map((k) => `key === ${JSON.stringify(k)}`).join(" || ") + " ||" : ""} - ${objVar}[key] === undefined || - typeof ${objVar}[key] === 'function' || - typeof ${objVar}[key] === 'symbol' - ) continue - const value = ${objVar}[key] - `; - const patternPropertiesLocation = location.getPropertyLocation("patternProperties"); - const patternPropertiesSchema = patternPropertiesLocation.schema; - if (patternPropertiesSchema !== void 0) { - for (const propertyKey in patternPropertiesSchema) { - const propertyLocation = patternPropertiesLocation.getPropertyLocation(propertyKey); - code += ` - if (/${propertyKey.replace(/\\*\//g, "\\/")}/.test(key)) { - ${addComma} - json += asString(key) + JSON_STR_COLONS - ${buildValue(context, propertyLocation, "value")} - continue - } - `; - } - } - const additionalPropertiesLocation = location.getPropertyLocation("additionalProperties"); - const additionalPropertiesSchema = additionalPropertiesLocation.schema; - if (additionalPropertiesSchema !== void 0) { - if (additionalPropertiesSchema === true) { - code += ` - ${addComma} - json += asString(key) + JSON_STR_COLONS + JSON.stringify(value) - `; - } else { - const propertyLocation = location.getPropertyLocation("additionalProperties"); - code += ` - ${addComma} - json += asString(key) + JSON_STR_COLONS - ${buildValue(context, propertyLocation, "value")} - `; - } - } - code += ` - } - `; - return code; - } - function buildInnerObject(context, location, objVar) { - const schema = location.schema; - const propertiesLocation = location.getPropertyLocation("properties"); - const requiredProperties = schema.required || []; - const propertiesKeys = Object.keys(schema.properties || {}).sort( - (key1, key2) => { - const required1 = requiredProperties.includes(key1); - const required2 = requiredProperties.includes(key2); - return required1 === required2 ? 0 : required1 ? -1 : 1; - } - ); - let code = ""; - for (const key of requiredProperties) { - if (!propertiesKeys.includes(key)) { - const sanitizedKey = JSON.stringify(key); - code += `if (${objVar}[${sanitizedKey}] === undefined) throw new Error('${sanitizedKey.replace(/'/g, "\\'")} is required!') -`; - } - } - code += "json += JSON_STR_BEGIN_OBJECT\n"; - const localUid = context.uid++; - let addComma = ""; - if (requiredProperties.length > 0) { - for (let i = 0; i < propertiesKeys.length; i++) { - const key = propertiesKeys[i]; - const propertyLocation = propertiesLocation.getPropertyLocation(key); - let resolvedLocation = propertyLocation; - if (propertyLocation.schema.$ref) { - resolvedLocation = resolveRef(context, propertyLocation); - } - const sanitizedKey = JSON.stringify(key); - const value = `value_${key.replace(/[^a-zA-Z0-9]/g, "_")}_${context.uid++}`; - const defaultValue = resolvedLocation.schema.default; - const isRequired = requiredProperties.includes(key); - const currentAddComma = i === 0 ? "" : "json += JSON_STR_COMMA"; - code += ` - const ${value} = ${objVar}[${sanitizedKey}] - if (${value} !== undefined) { - ${currentAddComma} - json += ${JSON.stringify(sanitizedKey + ":")} - ${buildValue(context, resolvedLocation, `${value}`)} - }`; - if (defaultValue !== void 0) { - code += ` else { - ${currentAddComma} - json += ${JSON.stringify(sanitizedKey + ":" + JSON.stringify(defaultValue))} - } - `; - } else if (isRequired) { - code += ` else { - throw new Error('${sanitizedKey.replace(/'/g, "\\'")} is required!') - } - `; - } else { - code += "\n"; - } - } - addComma = "json += JSON_STR_COMMA"; - } else { - const needsRuntimeComma = propertiesKeys.length > 1 || schema.patternProperties || schema.additionalProperties !== void 0 && schema.additionalProperties !== false; - if (needsRuntimeComma) { - code += `let addComma_${localUid} = false -`; - addComma = `!addComma_${localUid} && (addComma_${localUid} = true) || (json += JSON_STR_COMMA)`; - } - for (const key of propertiesKeys) { - let propertyLocation = propertiesLocation.getPropertyLocation(key); - if (propertyLocation.schema.$ref) { - propertyLocation = resolveRef(context, propertyLocation); - } - const sanitizedKey = JSON.stringify(key); - const value = `value_${key.replace(/[^a-zA-Z0-9]/g, "_")}_${context.uid++}`; - const defaultValue = propertyLocation.schema.default; - const isRequired = requiredProperties.includes(key); - code += ` - const ${value} = ${objVar}[${sanitizedKey}] - if (${value} !== undefined) { - ${addComma} - json += ${JSON.stringify(sanitizedKey + ":")} - ${buildValue(context, propertyLocation, `${value}`)} - }`; - if (defaultValue !== void 0) { - code += ` else { - ${addComma} - json += ${JSON.stringify(sanitizedKey + ":" + JSON.stringify(defaultValue))} - } - `; - } else if (isRequired) { - code += ` else { - throw new Error('${sanitizedKey.replace(/'/g, "\\'")} is required!') - } - `; - } else { - code += "\n"; - } - } - } - if (schema.patternProperties || schema.additionalProperties) { - code += buildExtraObjectPropertiesSerializer(context, location, addComma, objVar); - } - code += ` - json += JSON_STR_END_OBJECT - `; - return code; - } - function mergeLocations(context, mergedSchemaId, mergedLocations) { - for (let i = 0, mergedLocationsLength = mergedLocations.length; i < mergedLocationsLength; i++) { - const location = mergedLocations[i]; - const schema = location.schema; - if (schema.$ref) { - mergedLocations[i] = resolveRef(context, location); - } - } - const mergedSchemas = []; - for (const location of mergedLocations) { - const schema = cloneOriginSchema(context, location.schema, location.schemaId); - delete schema.$id; - mergedSchemas.push(schema); - } - const mergedSchema = mergeSchemas(mergedSchemas); - const mergedLocation = new Location(mergedSchema, mergedSchemaId); - context.refResolver.addSchema(mergedSchema, mergedSchemaId); - return mergedLocation; - } - function cloneOriginSchema(context, schema, schemaId) { - const clonedSchema = Array.isArray(schema) ? [] : {}; - if (schema.$id !== void 0 && schema.$id.charAt(0) !== "#") { - schemaId = schema.$id; - } - const mergedSchemaRef = context.mergedSchemasIds.get(schema); - if (mergedSchemaRef) { - context.mergedSchemasIds.set(clonedSchema, mergedSchemaRef); - } - for (const key in schema) { - let value = schema[key]; - if (key === "$ref" && typeof value === "string" && value.charAt(0) === "#") { - value = schemaId + value; - } - if (typeof value === "object" && value !== null) { - value = cloneOriginSchema(context, value, schemaId); - } - clonedSchema[key] = value; - } - return clonedSchema; - } - function toJSON(variableName) { - return `(${variableName} && typeof ${variableName}.toJSON === 'function') - ? ${variableName}.toJSON() - : ${variableName} - `; - } - function buildObject(context, location, input) { - const schema = location.schema; - if (context.functionsNamesBySchema.has(schema)) { - const funcName = context.functionsNamesBySchema.get(schema); - return `json += ${funcName}(${input})`; - } - const nullable2 = schema.nullable === true; - const schemaId = location.schemaId || ""; - const jsonPointer = location.jsonPointer || ""; - const fullPath = `${schemaId}#${jsonPointer}`; - if (context.recursivePaths.has(fullPath) || context.buildingSet.has(schema)) { - const functionName = generateFuncName(context); - context.functionsNamesBySchema.set(schema, functionName); - const schemaRef = getSafeSchemaRef(context, location); - const functionCode = ` - // ${schemaRef} - function ${functionName} (input) { - const obj = ${toJSON("input")} - if (obj === null) return ${nullable2 ? "JSON_STR_NULL" : "JSON_STR_EMPTY_OBJECT"} - let json = '' - - ${buildInnerObject(context, location, "obj")} - return json - } - `; - context.functions.push(functionCode); - return `json += ${functionName}(${input})`; - } - context.buildingSet.add(schema); - const objVar = `obj_${context.uid++}`; - const code = ` - const ${objVar} = ${toJSON(input)} - if (${objVar} === null) { - json += ${nullable2 ? "JSON_STR_NULL" : "JSON_STR_EMPTY_OBJECT"} - } else { - ${buildInnerObject(context, location, objVar)} - } - `; - context.buildingSet.delete(schema); - return code; - } - function buildArray(context, location, input) { - const schema = location.schema; - let itemsLocation = location.getPropertyLocation("items"); - itemsLocation.schema = itemsLocation.schema || {}; - if (itemsLocation.schema.$ref) { - itemsLocation = resolveRef(context, itemsLocation); - } - const itemsSchema = itemsLocation.schema; - if (context.functionsNamesBySchema.has(schema)) { - const funcName = context.functionsNamesBySchema.get(schema); - return `json += ${funcName}(${input})`; - } - const nullable2 = schema.nullable === true; - const schemaId = location.schemaId || ""; - const jsonPointer = location.jsonPointer || ""; - const fullPath = `${schemaId}#${jsonPointer}`; - if (context.recursivePaths.has(fullPath) || context.buildingSet.has(schema)) { - const functionName = generateFuncName(context); - context.functionsNamesBySchema.set(schema, functionName); - const schemaRef = getSafeSchemaRef(context, location); - let functionCode = ` - function ${functionName} (obj) { - // ${schemaRef} - let json = '' - `; - functionCode += ` - if (obj === null) return ${nullable2 ? "JSON_STR_NULL" : "JSON_STR_EMPTY_ARRAY"} - if (!Array.isArray(obj)) { - throw new TypeError(\`The value of '${schemaRef}' does not match schema definition.\`) - } - const arrayLength = obj.length - `; - if (!schema.additionalItems && Array.isArray(itemsSchema)) { - functionCode += ` - if (arrayLength > ${itemsSchema.length}) { - throw new Error(\`Item at ${itemsSchema.length} does not match schema definition.\`) - } - `; - } - if (largeArrayMechanism === "json-stringify") { - functionCode += `if (arrayLength >= ${largeArraySize}) return JSON.stringify(obj) -`; - } - functionCode += ` - json += JSON_STR_BEGIN_ARRAY - `; - if (Array.isArray(itemsSchema)) { - for (let i = 0, itemsSchemaLength = itemsSchema.length; i < itemsSchemaLength; i++) { - let item = itemsSchema[i]; - let itemLocation = itemsLocation.getPropertyLocation(i); - if (itemLocation.schema.$ref) { - itemLocation = resolveRef(context, itemLocation); - item = itemLocation.schema; - } - const value = `value_${i}`; - functionCode += `const ${value} = obj[${i}]`; - const tmpRes = buildValue(context, itemLocation, value); - functionCode += ` - if (${i} < arrayLength) { - if (${buildArrayTypeCondition(item.type, value)}) { - if (${i}) { - json += JSON_STR_COMMA - } - ${tmpRes} - } else { - throw new Error(\`Item at ${i} does not match schema definition.\`) - } - } - `; - } - if (schema.additionalItems) { - functionCode += ` - for (let i = ${itemsSchema.length}; i < arrayLength; i++) { - if (i) { - json += JSON_STR_COMMA - } - json += JSON.stringify(obj[i]) - }`; - } - } else { - const code = buildValue(context, itemsLocation, "value"); - functionCode += ` - if (arrayLength > 0) { - const value = obj[0] - ${code} - for (let i = 1; i < arrayLength; i++) { - json += JSON_STR_COMMA - const value = obj[i] - ${code} - } - }`; - } - functionCode += ` - return json + JSON_STR_END_ARRAY - }`; - context.functions.push(functionCode); - return `json += ${functionName}(${input})`; - } - context.buildingSet.add(schema); - const safeSchemaRef = getSafeSchemaRef(context, location); - const objVar = `obj_${context.uid++}`; - let inlinedCode = ` - const ${objVar} = ${input} - if (${objVar} === null) { - json += ${nullable2 ? "JSON_STR_NULL" : "JSON_STR_EMPTY_ARRAY"} - } else if (!Array.isArray(${objVar})) { - throw new TypeError(\`The value of '${safeSchemaRef}' does not match schema definition.\`) - } else { - const arrayLength_${objVar} = ${objVar}.length - `; - if (!schema.additionalItems && Array.isArray(itemsSchema)) { - inlinedCode += ` - if (arrayLength_${objVar} > ${itemsSchema.length}) { - throw new Error(\`Item at ${itemsSchema.length} does not match schema definition.\`) - } - `; - } - if (largeArrayMechanism === "json-stringify") { - inlinedCode += `if (arrayLength_${objVar} >= ${largeArraySize}) json += JSON.stringify(${objVar}) - else {`; - } - inlinedCode += ` - json += JSON_STR_BEGIN_ARRAY - `; - if (Array.isArray(itemsSchema)) { - const localUid = context.uid++; - inlinedCode += `let addComma_${localUid} = false -`; - for (let i = 0, itemsSchemaLength = itemsSchema.length; i < itemsSchemaLength; i++) { - let item = itemsSchema[i]; - let itemLocation = itemsLocation.getPropertyLocation(i); - if (itemLocation.schema.$ref) { - itemLocation = resolveRef(context, itemLocation); - item = itemLocation.schema; - } - const value = `value_${i}_${context.uid++}`; - inlinedCode += `const ${value} = ${objVar}[${i}]`; - const tmpRes = buildValue(context, itemLocation, value); - inlinedCode += ` - if (${i} < arrayLength_${objVar}) { - if (${buildArrayTypeCondition(item.type, value)}) { - !addComma_${localUid} && (addComma_${localUid} = true) || (json += JSON_STR_COMMA) - ${tmpRes} - } else { - throw new Error(\`Item at ${i} does not match schema definition.\`) - } - } - `; - } - if (schema.additionalItems) { - inlinedCode += ` - for (let i = ${itemsSchema.length}; i < arrayLength_${objVar}; i++) { - !addComma_${localUid} && (addComma_${localUid} = true) || (json += JSON_STR_COMMA) - json += JSON.stringify(${objVar}[i]) - }`; - } - } else { - const code = buildValue(context, itemsLocation, "value"); - inlinedCode += ` - if (arrayLength_${objVar} > 0) { - const value = ${objVar}[0] - ${code} - for (let i = 1; i < arrayLength_${objVar}; i++) { - json += JSON_STR_COMMA - const value = ${objVar}[i] - ${code} - } - }`; - } - inlinedCode += ` - json += JSON_STR_END_ARRAY - `; - if (largeArrayMechanism === "json-stringify") { - inlinedCode += "}"; - } - inlinedCode += "}"; - context.buildingSet.delete(schema); - return inlinedCode; - } - function buildArrayTypeCondition(type2, accessor) { - let condition; - switch (type2) { - case "null": - condition = `${accessor} === null`; - break; - case "string": - condition = `typeof ${accessor} === 'string' || - ${accessor} === null || - ${accessor} instanceof Date || - ${accessor} instanceof RegExp || - ( - typeof ${accessor} === "object" && - typeof ${accessor}.toString === "function" && - ${accessor}.toString !== Object.prototype.toString - )`; - break; - case "integer": - condition = `Number.isInteger(${accessor})`; - break; - case "number": - condition = `Number.isFinite(${accessor})`; - break; - case "boolean": - condition = `typeof ${accessor} === 'boolean'`; - break; - case "object": - condition = `${accessor} && typeof ${accessor} === 'object' && ${accessor}.constructor === Object`; - break; - case "array": - condition = `Array.isArray(${accessor})`; - break; - default: - if (Array.isArray(type2)) { - const conditions = type2.map((subType) => { - return buildArrayTypeCondition(subType, accessor); - }); - condition = `(${conditions.join(" || ")})`; - } - } - return condition; - } - function generateFuncName(context) { - return "anonymous" + context.functionsCounter++; - } - function buildMultiTypeSerializer(context, location, input) { - const schema = location.schema; - const types = schema.type.sort((t1) => t1 === "null" ? -1 : 1); - let code = ""; - types.forEach((type2, index) => { - location.schema = { ...location.schema, type: type2 }; - const nestedResult = buildSingleTypeSerializer(context, location, input); - const statement = index === 0 ? "if" : "else if"; - switch (type2) { - case "null": - code += ` - ${statement} (${input} === null) { - ${nestedResult} - } - `; - break; - case "string": { - code += ` - ${statement}( - typeof ${input} === "string" || - ${input} === null || - ${input} instanceof Date || - ${input} instanceof RegExp || - ( - typeof ${input} === "object" && - typeof ${input}.toString === "function" && - ${input}.toString !== Object.prototype.toString - ) - ) { - ${nestedResult} - } - `; - break; - } - case "array": { - code += ` - ${statement}(Array.isArray(${input})) { - ${nestedResult} - } - `; - break; - } - case "integer": { - code += ` - ${statement}(Number.isInteger(${input}) || ${input} === null) { - ${nestedResult} - } - `; - break; - } - default: { - code += ` - ${statement}(typeof ${input} === "${type2}" || ${input} === null) { - ${nestedResult} - } - `; - break; - } - } - }); - code += ` - else throw new TypeError(\`The value of '${getSafeSchemaRef(context, location)}' does not match schema definition.\`) - `; - return code; - } - function buildSingleTypeSerializer(context, location, input) { - const schema = location.schema; - switch (schema.type) { - case "null": - return "json += JSON_STR_NULL"; - case "string": { - if (schema.format === "date-time") { - return `json += asDateTime(${input})`; - } else if (schema.format === "date") { - return `json += asDate(${input})`; - } else if (schema.format === "time") { - return `json += asTime(${input})`; - } else if (schema.format === "unsafe") { - return `json += asUnsafeString(${input})`; - } else { - return ` - if (typeof ${input} !== 'string') { - if (${input} === null) { - json += JSON_STR_EMPTY_STRING - } else if (${input} instanceof Date) { - json += JSON_STR_QUOTE + ${input}.toISOString() + JSON_STR_QUOTE - } else if (${input} instanceof RegExp) { - json += asString(${input}.source) - } else { - json += asString(${input}.toString()) - } - } else { - json += asString(${input}) - } - `; - } - } - case "integer": - return `json += asInteger(${input})`; - case "number": - return `json += asNumber(${input})`; - case "boolean": - return `json += asBoolean(${input})`; - case "object": { - return buildObject(context, location, input); - } - case "array": { - return buildArray(context, location, input); - } - case void 0: - return `json += JSON.stringify(${input})`; - default: - throw new Error(`${schema.type} unsupported`); - } - } - function detectRecursiveSchemas(context, location) { - const pathStack = /* @__PURE__ */ new Set(); - function traverse(location2) { - const schema = location2.schema; - if (typeof schema !== "object" || schema === null) - return; - const schemaId = location2.schemaId || ""; - const jsonPointer = location2.jsonPointer || ""; - const fullPath = `${schemaId}#${jsonPointer}`; - if (pathStack.has(fullPath)) { - let inCycle = false; - for (const p of pathStack) { - if (p === fullPath) - inCycle = true; - if (inCycle) - context.recursivePaths.add(p); - } - context.recursivePaths.add(fullPath); - return; - } - pathStack.add(fullPath); - if (schema.$ref) { - try { - const res = resolveRef(context, location2); - traverse(res); - } catch (err) { - } - } - if (schema.properties) { - const propertiesLocation = location2.getPropertyLocation("properties"); - for (const key in schema.properties) { - traverse(propertiesLocation.getPropertyLocation(key)); - } - } - if (schema.additionalProperties && typeof schema.additionalProperties === "object") { - traverse(location2.getPropertyLocation("additionalProperties")); - } - if (schema.patternProperties) { - const patternPropertiesLocation = location2.getPropertyLocation("patternProperties"); - for (const key in schema.patternProperties) { - traverse(patternPropertiesLocation.getPropertyLocation(key)); - } - } - if (schema.items) { - const itemsLocation = location2.getPropertyLocation("items"); - if (Array.isArray(schema.items)) { - for (let i = 0; i < schema.items.length; i++) { - traverse(itemsLocation.getPropertyLocation(i)); - } - } else { - traverse(itemsLocation); - } - } - if (schema.additionalItems && typeof schema.additionalItems === "object") { - traverse(location2.getPropertyLocation("additionalItems")); - } - if (schema.oneOf) { - const oneOfLocation = location2.getPropertyLocation("oneOf"); - for (let i = 0; i < schema.oneOf.length; i++) { - traverse(oneOfLocation.getPropertyLocation(i)); - } - } - if (schema.anyOf) { - const anyOfLocation = location2.getPropertyLocation("anyOf"); - for (let i = 0; i < schema.anyOf.length; i++) { - traverse(anyOfLocation.getPropertyLocation(i)); - } - } - if (schema.allOf) { - const allOfLocation = location2.getPropertyLocation("allOf"); - for (let i = 0; i < schema.allOf.length; i++) { - traverse(allOfLocation.getPropertyLocation(i)); - } - } - if (schema.then) - traverse(location2.getPropertyLocation("then")); - if (schema.else) - traverse(location2.getPropertyLocation("else")); - pathStack.delete(fullPath); - } - traverse(location); - } - function buildConstSerializer(location, input) { - const schema = location.schema; - const type2 = schema.type; - const hasNullType = Array.isArray(type2) && type2.includes("null"); - let code = ""; - if (hasNullType) { - code += ` - if (${input} === null) { - json += JSON_STR_NULL - } else { - `; - } - code += `json += '${JSON.stringify(schema.const).replace(SINGLE_TICK, "\\'")}'`; - if (hasNullType) { - code += ` - } - `; - } - return code; - } - function buildAllOf(context, location, input) { - const schema = location.schema; - let mergedSchemaId = context.mergedSchemasIds.get(schema); - if (mergedSchemaId) { - const mergedLocation2 = getMergedLocation(context, mergedSchemaId); - return buildValue(context, mergedLocation2, input); - } - mergedSchemaId = `__fjs_merged_${schemaIdCounter++}`; - context.mergedSchemasIds.set(schema, mergedSchemaId); - const { allOf, ...schemaWithoutAllOf } = location.schema; - const locations = [ - new Location( - schemaWithoutAllOf, - location.schemaId, - location.jsonPointer - ) - ]; - const allOfsLocation = location.getPropertyLocation("allOf"); - for (let i = 0, allOfLength = allOf.length; i < allOfLength; i++) { - locations.push(allOfsLocation.getPropertyLocation(i)); - } - const mergedLocation = mergeLocations(context, mergedSchemaId, locations); - return buildValue(context, mergedLocation, input); - } - function buildOneOf(context, location, input) { - context.validatorSchemasIds.add(location.schemaId); - const schema = location.schema; - const type2 = schema.anyOf ? "anyOf" : "oneOf"; - const { [type2]: oneOfs, ...schemaWithoutAnyOf } = location.schema; - const locationWithoutOneOf = new Location( - schemaWithoutAnyOf, - location.schemaId, - location.jsonPointer - ); - const oneOfsLocation = location.getPropertyLocation(type2); - let code = ""; - for (let index = 0, oneOfsLength = oneOfs.length; index < oneOfsLength; index++) { - const optionLocation = oneOfsLocation.getPropertyLocation(index); - const optionSchema = optionLocation.schema; - let mergedSchemaId = context.mergedSchemasIds.get(optionSchema); - let mergedLocation = null; - if (mergedSchemaId) { - mergedLocation = getMergedLocation(context, mergedSchemaId); - } else { - mergedSchemaId = `__fjs_merged_${schemaIdCounter++}`; - context.mergedSchemasIds.set(optionSchema, mergedSchemaId); - mergedLocation = mergeLocations(context, mergedSchemaId, [ - locationWithoutOneOf, - optionLocation - ]); - } - const nestedResult = buildValue(context, mergedLocation, input); - const schemaRef = optionLocation.getSchemaRef(); - code += ` - ${index === 0 ? "if" : "else if"}(validator.validate("${schemaRef}", ${input})) { - ${nestedResult} - } - `; - } - code += ` - else throw new TypeError(\`The value of '${getSafeSchemaRef(context, location)}' does not match schema definition.\`) - `; - return code; - } - function buildIfThenElse(context, location, input) { - context.validatorSchemasIds.add(location.schemaId); - const { - if: ifSchema, - then: thenSchema, - else: elseSchema, - ...schemaWithoutIfThenElse - } = location.schema; - const rootLocation = new Location( - schemaWithoutIfThenElse, - location.schemaId, - location.jsonPointer - ); - const ifLocation = location.getPropertyLocation("if"); - const ifSchemaRef = ifLocation.getSchemaRef(); - const thenLocation = location.getPropertyLocation("then"); - let thenMergedSchemaId = context.mergedSchemasIds.get(thenSchema); - let thenMergedLocation = null; - if (thenMergedSchemaId) { - thenMergedLocation = getMergedLocation(context, thenMergedSchemaId); - } else { - thenMergedSchemaId = `__fjs_merged_${schemaIdCounter++}`; - context.mergedSchemasIds.set(thenSchema, thenMergedSchemaId); - thenMergedLocation = mergeLocations(context, thenMergedSchemaId, [ - rootLocation, - thenLocation - ]); - } - if (!elseSchema) { - return ` - if (validator.validate("${ifSchemaRef}", ${input})) { - ${buildValue(context, thenMergedLocation, input)} - } else { - ${buildValue(context, rootLocation, input)} - } - `; - } - const elseLocation = location.getPropertyLocation("else"); - let elseMergedSchemaId = context.mergedSchemasIds.get(elseSchema); - let elseMergedLocation = null; - if (elseMergedSchemaId) { - elseMergedLocation = getMergedLocation(context, elseMergedSchemaId); - } else { - elseMergedSchemaId = `__fjs_merged_${schemaIdCounter++}`; - context.mergedSchemasIds.set(elseSchema, elseMergedSchemaId); - elseMergedLocation = mergeLocations(context, elseMergedSchemaId, [ - rootLocation, - elseLocation - ]); - } - return ` - if (validator.validate("${ifSchemaRef}", ${input})) { - ${buildValue(context, thenMergedLocation, input)} - } else { - ${buildValue(context, elseMergedLocation, input)} - } - `; - } - function buildValue(context, location, input) { - let schema = location.schema; - if (typeof schema === "boolean") { - return `json += JSON.stringify(${input})`; - } - if (schema.$ref) { - location = resolveRef(context, location); - schema = location.schema; - } - if (schema.allOf) { - return buildAllOf(context, location, input); - } - if (schema.anyOf || schema.oneOf) { - return buildOneOf(context, location, input); - } - if (schema.if && schema.then) { - return buildIfThenElse(context, location, input); - } - if (schema.type === void 0) { - const inferredType = inferTypeByKeyword(schema); - if (inferredType) { - schema.type = inferredType; - } - } - let code = ""; - const type2 = schema.type; - const nullable2 = schema.nullable === true; - if (nullable2) { - code += ` - if (${input} === null) { - json += JSON_STR_NULL - } else { - `; - } - if (schema.const !== void 0) { - code += buildConstSerializer(location, input); - } else if (Array.isArray(type2)) { - code += buildMultiTypeSerializer(context, location, input); - } else { - code += buildSingleTypeSerializer(context, location, input); - } - if (nullable2) { - code += ` - } - `; - } - return code; - } - module2.exports = build; - module2.exports.default = build; - module2.exports.build = build; - module2.exports.validLargeArrayMechanisms = validLargeArrayMechanisms; - module2.exports.restore = function({ code, validator, serializer }) { - return Function.apply(null, ["validator", "serializer", code]).apply(null, [validator, serializer]); - }; - } -}); - -// ../../node_modules/.pnpm/@fastify+fast-json-stringify-compiler@5.0.3/node_modules/@fastify/fast-json-stringify-compiler/standalone.js -var require_standalone4 = __commonJS({ - "../../node_modules/.pnpm/@fastify+fast-json-stringify-compiler@5.0.3/node_modules/@fastify/fast-json-stringify-compiler/standalone.js"(exports2, module2) { - "use strict"; - var fastJsonStringify = require_fast_json_stringify(); - function SerializerSelector() { - return function buildSerializerFactory(externalSchemas, serializerOpts) { - const fjsOpts = Object.assign({}, serializerOpts, { schema: externalSchemas }); - return responseSchemaCompiler.bind(null, fjsOpts); - }; - } - function responseSchemaCompiler(fjsOpts, { - schema - /* method, url, httpStatus */ - }) { - if (fjsOpts.schema && schema.$id && fjsOpts.schema[schema.$id]) { - fjsOpts.schema = { ...fjsOpts.schema }; - delete fjsOpts.schema[schema.$id]; - } - return fastJsonStringify(schema, fjsOpts); - } - function StandaloneSerializer(options = { readMode: true }) { - if (options.readMode === true && typeof options.restoreFunction !== "function") { - throw new Error("You must provide a function for the restoreFunction-option when readMode ON"); - } - if (options.readMode !== true && typeof options.storeFunction !== "function") { - throw new Error("You must provide a function for the storeFunction-option when readMode OFF"); - } - if (options.readMode === true) { - return function wrapper() { - return function(opts) { - return options.restoreFunction(opts); - }; - }; - } - const factory = SerializerSelector(); - return function wrapper(externalSchemas, serializerOpts = {}) { - serializerOpts.mode = "standalone"; - const compiler = factory(externalSchemas, serializerOpts); - return function(opts) { - const serializeFuncCode = compiler(opts); - options.storeFunction(opts, serializeFuncCode); - return new Function(serializeFuncCode); - }; - }; - } - module2.exports.SerializerSelector = SerializerSelector; - module2.exports.StandaloneSerializer = StandaloneSerializer; - module2.exports.default = StandaloneSerializer; - } -}); - -// ../../node_modules/.pnpm/@fastify+fast-json-stringify-compiler@5.0.3/node_modules/@fastify/fast-json-stringify-compiler/index.js -var require_fast_json_stringify_compiler = __commonJS({ - "../../node_modules/.pnpm/@fastify+fast-json-stringify-compiler@5.0.3/node_modules/@fastify/fast-json-stringify-compiler/index.js"(exports2, module2) { - "use strict"; - var { SerializerSelector, StandaloneSerializer } = require_standalone4(); - module2.exports = SerializerSelector; - module2.exports.default = SerializerSelector; - module2.exports.SerializerSelector = SerializerSelector; - module2.exports.StandaloneSerializer = StandaloneSerializer; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/schema-controller.js -var require_schema_controller = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/schema-controller.js"(exports2, module2) { - "use strict"; - var { buildSchemas } = require_schemas(); - function buildSchemaController(parentSchemaCtrl, opts) { - if (parentSchemaCtrl) { - return new SchemaController(parentSchemaCtrl, opts); - } - const compilersFactory = Object.assign({ - buildValidator: null, - buildSerializer: null - }, opts?.compilersFactory); - if (!compilersFactory.buildValidator) { - const ValidatorSelector = require_ajv_compiler(); - compilersFactory.buildValidator = ValidatorSelector(); - } - if (!compilersFactory.buildSerializer) { - const SerializerSelector = require_fast_json_stringify_compiler(); - compilersFactory.buildSerializer = SerializerSelector(); - } - const option = { - bucket: opts && opts.bucket || buildSchemas, - compilersFactory, - isCustomValidatorCompiler: typeof opts?.compilersFactory?.buildValidator === "function", - isCustomSerializerCompiler: typeof opts?.compilersFactory?.buildValidator === "function" - }; - return new SchemaController(void 0, option); - } - var SchemaController = class { - constructor(parent, options) { - this.opts = options || parent?.opts; - this.addedSchemas = false; - this.compilersFactory = this.opts.compilersFactory; - if (parent) { - this.schemaBucket = this.opts.bucket(parent.getSchemas()); - this.validatorCompiler = parent.getValidatorCompiler(); - this.serializerCompiler = parent.getSerializerCompiler(); - this.isCustomValidatorCompiler = parent.isCustomValidatorCompiler; - this.isCustomSerializerCompiler = parent.isCustomSerializerCompiler; - this.parent = parent; - } else { - this.schemaBucket = this.opts.bucket(); - this.isCustomValidatorCompiler = this.opts.isCustomValidatorCompiler || false; - this.isCustomSerializerCompiler = this.opts.isCustomSerializerCompiler || false; - } - } - // Bucket interface - add(schema) { - this.addedSchemas = true; - return this.schemaBucket.add(schema); - } - getSchema(schemaId) { - return this.schemaBucket.getSchema(schemaId); - } - getSchemas() { - return this.schemaBucket.getSchemas(); - } - setValidatorCompiler(validatorCompiler) { - this.compilersFactory = Object.assign( - {}, - this.compilersFactory, - { buildValidator: () => validatorCompiler } - ); - this.validatorCompiler = validatorCompiler; - this.isCustomValidatorCompiler = true; - } - setSerializerCompiler(serializerCompiler) { - this.compilersFactory = Object.assign( - {}, - this.compilersFactory, - { buildSerializer: () => serializerCompiler } - ); - this.serializerCompiler = serializerCompiler; - this.isCustomSerializerCompiler = true; - } - getValidatorCompiler() { - return this.validatorCompiler || this.parent && this.parent.getValidatorCompiler(); - } - getSerializerCompiler() { - return this.serializerCompiler || this.parent && this.parent.getSerializerCompiler(); - } - getSerializerBuilder() { - return this.compilersFactory.buildSerializer || this.parent && this.parent.getSerializerBuilder(); - } - getValidatorBuilder() { - return this.compilersFactory.buildValidator || this.parent && this.parent.getValidatorBuilder(); - } - /** - * This method will be called when a validator must be setup. - * Do not setup the compiler more than once - * @param {object} serverOptions the fastify server options - */ - setupValidator(serverOptions) { - const isReady = this.validatorCompiler !== void 0 && !this.addedSchemas; - if (isReady) { - return; - } - this.validatorCompiler = this.getValidatorBuilder()(this.schemaBucket.getSchemas(), serverOptions.ajv); - } - /** - * This method will be called when a serializer must be setup. - * Do not setup the compiler more than once - * @param {object} serverOptions the fastify server options - */ - setupSerializer(serverOptions) { - const isReady = this.serializerCompiler !== void 0 && !this.addedSchemas; - if (isReady) { - return; - } - this.serializerCompiler = this.getSerializerBuilder()(this.schemaBucket.getSchemas(), serverOptions.serializerOpts); - } - }; - SchemaController.buildSchemaController = buildSchemaController; - module2.exports = SchemaController; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js -var require_constants2 = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js"(exports2, module2) { - "use strict"; - var SEMVER_SPEC_VERSION = "2.0.0"; - var MAX_LENGTH = 256; - var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ - 9007199254740991; - var MAX_SAFE_COMPONENT_LENGTH = 16; - var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; - var RELEASE_TYPES = [ - "major", - "premajor", - "minor", - "preminor", - "patch", - "prepatch", - "prerelease" - ]; - module2.exports = { - MAX_LENGTH, - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_SAFE_INTEGER, - RELEASE_TYPES, - SEMVER_SPEC_VERSION, - FLAG_INCLUDE_PRERELEASE: 1, - FLAG_LOOSE: 2 - }; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js -var require_debug2 = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js"(exports2, module2) { - "use strict"; - var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js -var require_re = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js"(exports2, module2) { - "use strict"; - var { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH - } = require_constants2(); - var debug = require_debug2(); - exports2 = module2.exports = {}; - var re = exports2.re = []; - var safeRe = exports2.safeRe = []; - var src = exports2.src = []; - var safeSrc = exports2.safeSrc = []; - var t = exports2.t = {}; - var R = 0; - var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; - var safeRegexReplacements = [ - ["\\s", 1], - ["\\d", MAX_LENGTH], - [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] - ]; - var makeSafeRegex = (value) => { - for (const [token, max] of safeRegexReplacements) { - value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); - } - return value; - }; - var createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value); - const index = R++; - debug(name, index, value); - t[name] = index; - src[index] = value; - safeSrc[index] = safe; - re[index] = new RegExp(value, isGlobal ? "g" : void 0); - safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); - }; - createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); - createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); - createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); - createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); - createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); - createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); - createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); - createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); - createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); - createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); - createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); - createToken("FULL", `^${src[t.FULLPLAIN]}$`); - createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); - createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); - createToken("GTLT", "((?:<|>)?=?)"); - createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); - createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); - createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); - createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); - createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); - createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); - createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); - createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); - createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); - createToken("COERCERTL", src[t.COERCE], true); - createToken("COERCERTLFULL", src[t.COERCEFULL], true); - createToken("LONETILDE", "(?:~>?)"); - createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); - exports2.tildeTrimReplace = "$1~"; - createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); - createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); - createToken("LONECARET", "(?:\\^)"); - createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); - exports2.caretTrimReplace = "$1^"; - createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); - createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); - createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); - createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); - createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); - exports2.comparatorTrimReplace = "$1$2$3"; - createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); - createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); - createToken("STAR", "(<|>)?=?\\s*\\*"); - createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); - createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js -var require_parse_options = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js"(exports2, module2) { - "use strict"; - var looseOption = Object.freeze({ loose: true }); - var emptyOpts = Object.freeze({}); - var parseOptions = (options) => { - if (!options) { - return emptyOpts; - } - if (typeof options !== "object") { - return looseOption; - } - return options; - }; - module2.exports = parseOptions; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js -var require_identifiers = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports2, module2) { - "use strict"; - var numeric = /^[0-9]+$/; - var compareIdentifiers = (a, b) => { - if (typeof a === "number" && typeof b === "number") { - return a === b ? 0 : a < b ? -1 : 1; - } - const anum = numeric.test(a); - const bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; - } - return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; - }; - var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); - module2.exports = { - compareIdentifiers, - rcompareIdentifiers - }; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js -var require_semver = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js"(exports2, module2) { - "use strict"; - var debug = require_debug2(); - var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants2(); - var { safeRe: re, t } = require_re(); - var parseOptions = require_parse_options(); - var { compareIdentifiers } = require_identifiers(); - var SemVer = class _SemVer { - constructor(version2, options) { - options = parseOptions(options); - if (version2 instanceof _SemVer) { - if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) { - return version2; - } else { - version2 = version2.version; - } - } else if (typeof version2 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`); - } - if (version2.length > MAX_LENGTH) { - throw new TypeError( - `version is longer than ${MAX_LENGTH} characters` - ); - } - debug("SemVer", version2, options); - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - const m = version2.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); - if (!m) { - throw new TypeError(`Invalid Version: ${version2}`); - } - this.raw = version2; - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - if (this.major > MAX_SAFE_INTEGER || this.major < 0) { - throw new TypeError("Invalid major version"); - } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); - } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); - } - if (!m[4]) { - this.prerelease = []; - } else { - this.prerelease = m[4].split(".").map((id) => { - if (/^[0-9]+$/.test(id)) { - const num = +id; - if (num >= 0 && num < MAX_SAFE_INTEGER) { - return num; - } - } - return id; - }); - } - this.build = m[5] ? m[5].split(".") : []; - this.format(); - } - format() { - this.version = `${this.major}.${this.minor}.${this.patch}`; - if (this.prerelease.length) { - this.version += `-${this.prerelease.join(".")}`; - } - return this.version; - } - toString() { - return this.version; - } - compare(other) { - debug("SemVer.compare", this.version, this.options, other); - if (!(other instanceof _SemVer)) { - if (typeof other === "string" && other === this.version) { - return 0; - } - other = new _SemVer(other, this.options); - } - if (other.version === this.version) { - return 0; - } - return this.compareMain(other) || this.comparePre(other); - } - compareMain(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - if (this.major < other.major) { - return -1; - } - if (this.major > other.major) { - return 1; - } - if (this.minor < other.minor) { - return -1; - } - if (this.minor > other.minor) { - return 1; - } - if (this.patch < other.patch) { - return -1; - } - if (this.patch > other.patch) { - return 1; - } - return 0; - } - comparePre(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - if (this.prerelease.length && !other.prerelease.length) { - return -1; - } else if (!this.prerelease.length && other.prerelease.length) { - return 1; - } else if (!this.prerelease.length && !other.prerelease.length) { - return 0; - } - let i = 0; - do { - const a = this.prerelease[i]; - const b = other.prerelease[i]; - debug("prerelease compare", i, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); - } - compareBuild(other) { - if (!(other instanceof _SemVer)) { - other = new _SemVer(other, this.options); - } - let i = 0; - do { - const a = this.build[i]; - const b = other.build[i]; - debug("build compare", i, a, b); - if (a === void 0 && b === void 0) { - return 0; - } else if (b === void 0) { - return 1; - } else if (a === void 0) { - return -1; - } else if (a === b) { - continue; - } else { - return compareIdentifiers(a, b); - } - } while (++i); - } - // preminor will bump the version up to the next minor release, and immediately - // down to pre-release. premajor and prepatch work the same way. - inc(release, identifier, identifierBase) { - if (release.startsWith("pre")) { - if (!identifier && identifierBase === false) { - throw new Error("invalid increment argument: identifier is empty"); - } - if (identifier) { - const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); - if (!match || match[1] !== identifier) { - throw new Error(`invalid identifier: ${identifier}`); - } - } - } - switch (release) { - case "premajor": - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc("pre", identifier, identifierBase); - break; - case "preminor": - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc("pre", identifier, identifierBase); - break; - case "prepatch": - this.prerelease.length = 0; - this.inc("patch", identifier, identifierBase); - this.inc("pre", identifier, identifierBase); - break; - case "prerelease": - if (this.prerelease.length === 0) { - this.inc("patch", identifier, identifierBase); - } - this.inc("pre", identifier, identifierBase); - 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": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; - } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; - } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; - } - this.prerelease = []; - break; - case "pre": { - const base = Number(identifierBase) ? 1 : 0; - if (this.prerelease.length === 0) { - this.prerelease = [base]; - } else { - let i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === "number") { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) { - if (identifier === this.prerelease.join(".") && identifierBase === false) { - throw new Error("invalid increment argument: identifier already exists"); - } - this.prerelease.push(base); - } - } - if (identifier) { - let prerelease = [identifier, base]; - if (identifierBase === false) { - prerelease = [identifier]; - } - if (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease; - } - } else { - this.prerelease = prerelease; - } - } - break; - } - default: - throw new Error(`invalid increment argument: ${release}`); - } - this.raw = this.format(); - if (this.build.length) { - this.raw += `+${this.build.join(".")}`; - } - return this; - } - }; - module2.exports = SemVer; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js -var require_parse2 = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var parse2 = (version2, options, throwErrors = false) => { - if (version2 instanceof SemVer) { - return version2; - } - try { - return new SemVer(version2, options); - } catch (er) { - if (!throwErrors) { - return null; - } - throw er; - } - }; - module2.exports = parse2; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js -var require_valid = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js"(exports2, module2) { - "use strict"; - var parse2 = require_parse2(); - var valid = (version2, options) => { - const v = parse2(version2, options); - return v ? v.version : null; - }; - module2.exports = valid; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js -var require_clean = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js"(exports2, module2) { - "use strict"; - var parse2 = require_parse2(); - var clean2 = (version2, options) => { - const s = parse2(version2.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; - }; - module2.exports = clean2; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js -var require_inc = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var inc = (version2, release, options, identifier, identifierBase) => { - if (typeof options === "string") { - identifierBase = identifier; - identifier = options; - options = void 0; - } - try { - return new SemVer( - version2 instanceof SemVer ? version2.version : version2, - options - ).inc(release, identifier, identifierBase).version; - } catch (er) { - return null; - } - }; - module2.exports = inc; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js -var require_diff = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js"(exports2, module2) { - "use strict"; - var parse2 = require_parse2(); - var diff = (version1, version2) => { - const v12 = parse2(version1, null, true); - const v2 = parse2(version2, null, true); - const comparison = v12.compare(v2); - if (comparison === 0) { - return null; - } - const v1Higher = comparison > 0; - const highVersion = v1Higher ? v12 : v2; - const lowVersion = v1Higher ? v2 : v12; - const highHasPre = !!highVersion.prerelease.length; - const lowHasPre = !!lowVersion.prerelease.length; - if (lowHasPre && !highHasPre) { - if (!lowVersion.patch && !lowVersion.minor) { - return "major"; - } - if (lowVersion.compareMain(highVersion) === 0) { - if (lowVersion.minor && !lowVersion.patch) { - return "minor"; - } - return "patch"; - } - } - const prefix = highHasPre ? "pre" : ""; - if (v12.major !== v2.major) { - return prefix + "major"; - } - if (v12.minor !== v2.minor) { - return prefix + "minor"; - } - if (v12.patch !== v2.patch) { - return prefix + "patch"; - } - return "prerelease"; - }; - module2.exports = diff; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js -var require_major = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var major = (a, loose) => new SemVer(a, loose).major; - module2.exports = major; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js -var require_minor = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var minor = (a, loose) => new SemVer(a, loose).minor; - module2.exports = minor; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js -var require_patch = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var patch = (a, loose) => new SemVer(a, loose).patch; - module2.exports = patch; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js -var require_prerelease = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js"(exports2, module2) { - "use strict"; - var parse2 = require_parse2(); - var prerelease = (version2, options) => { - const parsed = parse2(version2, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; - }; - module2.exports = prerelease; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js -var require_compare = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); - module2.exports = compare; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js -var require_rcompare = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var rcompare = (a, b, loose) => compare(b, a, loose); - module2.exports = rcompare; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js -var require_compare_loose = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var compareLoose = (a, b) => compare(a, b, true); - module2.exports = compareLoose; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js -var require_compare_build = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var compareBuild = (a, b, loose) => { - const versionA = new SemVer(a, loose); - const versionB = new SemVer(b, loose); - return versionA.compare(versionB) || versionA.compareBuild(versionB); - }; - module2.exports = compareBuild; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js -var require_sort = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js"(exports2, module2) { - "use strict"; - var compareBuild = require_compare_build(); - var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)); - module2.exports = sort; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js -var require_rsort = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js"(exports2, module2) { - "use strict"; - var compareBuild = require_compare_build(); - var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)); - module2.exports = rsort; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js -var require_gt = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var gt = (a, b, loose) => compare(a, b, loose) > 0; - module2.exports = gt; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js -var require_lt = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var lt = (a, b, loose) => compare(a, b, loose) < 0; - module2.exports = lt; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js -var require_eq = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var eq = (a, b, loose) => compare(a, b, loose) === 0; - module2.exports = eq; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js -var require_neq = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var neq = (a, b, loose) => compare(a, b, loose) !== 0; - module2.exports = neq; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js -var require_gte = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var gte = (a, b, loose) => compare(a, b, loose) >= 0; - module2.exports = gte; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js -var require_lte = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var lte = (a, b, loose) => compare(a, b, loose) <= 0; - module2.exports = lte; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js -var require_cmp = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js"(exports2, module2) { - "use strict"; - var eq = require_eq(); - var neq = require_neq(); - var gt = require_gt(); - var gte = require_gte(); - var lt = require_lt(); - var lte = require_lte(); - var cmp = (a, op, b, loose) => { - switch (op) { - case "===": - if (typeof a === "object") { - a = a.version; - } - if (typeof b === "object") { - b = b.version; - } - return a === b; - case "!==": - if (typeof a === "object") { - a = a.version; - } - if (typeof b === "object") { - b = b.version; - } - return a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError(`Invalid operator: ${op}`); - } - }; - module2.exports = cmp; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js -var require_coerce = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var parse2 = require_parse2(); - var { safeRe: re, t } = require_re(); - var coerce2 = (version2, options) => { - if (version2 instanceof SemVer) { - return version2; - } - if (typeof version2 === "number") { - version2 = String(version2); - } - if (typeof version2 !== "string") { - return null; - } - options = options || {}; - let match = null; - if (!options.rtl) { - match = version2.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); - } else { - const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; - let next; - while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; - } - coerceRtlRegex.lastIndex = -1; - } - if (match === null) { - return null; - } - const major = match[2]; - const minor = match[3] || "0"; - const patch = match[4] || "0"; - const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; - const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; - return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options); - }; - module2.exports = coerce2; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js -var require_lrucache = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js"(exports2, module2) { - "use strict"; - var LRUCache = class { - constructor() { - this.max = 1e3; - this.map = /* @__PURE__ */ new Map(); - } - get(key) { - const value = this.map.get(key); - if (value === void 0) { - return void 0; - } else { - this.map.delete(key); - this.map.set(key, value); - return value; - } - } - delete(key) { - return this.map.delete(key); - } - set(key, value) { - const deleted = this.delete(key); - if (!deleted && value !== void 0) { - if (this.map.size >= this.max) { - const firstKey = this.map.keys().next().value; - this.delete(firstKey); - } - this.map.set(key, value); - } - return this; - } - }; - module2.exports = LRUCache; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js -var require_range = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js"(exports2, module2) { - "use strict"; - var SPACE_CHARACTERS = /\s+/g; - var Range = class _Range { - constructor(range, options) { - options = parseOptions(options); - if (range instanceof _Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new _Range(range.raw, options); - } - } - if (range instanceof Comparator) { - this.raw = range.value; - this.set = [[range]]; - this.formatted = void 0; - return this; - } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().replace(SPACE_CHARACTERS, " "); - this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); - if (!this.set.length) { - throw new TypeError(`Invalid SemVer Range: ${this.raw}`); - } - if (this.set.length > 1) { - const first = this.set[0]; - this.set = this.set.filter((c) => !isNullSet(c[0])); - if (this.set.length === 0) { - this.set = [first]; - } else if (this.set.length > 1) { - for (const c of this.set) { - if (c.length === 1 && isAny(c[0])) { - this.set = [c]; - break; - } - } - } - } - this.formatted = void 0; - } - get range() { - if (this.formatted === void 0) { - this.formatted = ""; - for (let i = 0; i < this.set.length; i++) { - if (i > 0) { - this.formatted += "||"; - } - const comps = this.set[i]; - for (let k = 0; k < comps.length; k++) { - if (k > 0) { - this.formatted += " "; - } - this.formatted += comps[k].toString().trim(); - } - } - } - return this.formatted; - } - format() { - return this.range; - } - toString() { - return this.range; - } - parseRange(range) { - const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); - const memoKey = memoOpts + ":" + range; - const cached = cache.get(memoKey); - if (cached) { - return cached; - } - const loose = this.options.loose; - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); - debug("hyphen replace", range); - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug("comparator trim", range); - range = range.replace(re[t.TILDETRIM], tildeTrimReplace); - debug("tilde trim", range); - range = range.replace(re[t.CARETTRIM], caretTrimReplace); - debug("caret trim", range); - let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); - if (loose) { - rangeList = rangeList.filter((comp) => { - debug("loose invalid filter", comp, this.options); - return !!comp.match(re[t.COMPARATORLOOSE]); - }); - } - debug("range list", rangeList); - const rangeMap = /* @__PURE__ */ new Map(); - const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); - for (const comp of comparators) { - if (isNullSet(comp)) { - return [comp]; - } - rangeMap.set(comp.value, comp); - } - if (rangeMap.size > 1 && rangeMap.has("")) { - rangeMap.delete(""); - } - const result = [...rangeMap.values()]; - cache.set(memoKey, result); - return result; - } - intersects(range, options) { - if (!(range instanceof _Range)) { - throw new TypeError("a Range is required"); - } - return this.set.some((thisComparators) => { - return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { - return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { - return rangeComparators.every((rangeComparator) => { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); - } - // if ANY of the sets match ALL of its comparators, then pass - test(version2) { - if (!version2) { - return false; - } - if (typeof version2 === "string") { - try { - version2 = new SemVer(version2, this.options); - } catch (er) { - return false; - } - } - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version2, this.options)) { - return true; - } - } - return false; - } - }; - module2.exports = Range; - var LRU = require_lrucache(); - var cache = new LRU(); - var parseOptions = require_parse_options(); - var Comparator = require_comparator(); - var debug = require_debug2(); - var SemVer = require_semver(); - var { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace - } = require_re(); - var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants2(); - var isNullSet = (c) => c.value === "<0.0.0-0"; - var isAny = (c) => c.value === ""; - var isSatisfiable = (comparators, options) => { - let result = true; - const remainingComparators = comparators.slice(); - let testComparator = remainingComparators.pop(); - while (result && remainingComparators.length) { - result = remainingComparators.every((otherComparator) => { - return testComparator.intersects(otherComparator, options); - }); - testComparator = remainingComparators.pop(); - } - return result; - }; - var parseComparator = (comp, options) => { - comp = comp.replace(re[t.BUILD], ""); - debug("comp", comp, options); - comp = replaceCarets(comp, options); - debug("caret", comp); - comp = replaceTildes(comp, options); - debug("tildes", comp); - comp = replaceXRanges(comp, options); - debug("xrange", comp); - comp = replaceStars(comp, options); - debug("stars", comp); - return comp; - }; - var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; - var replaceTildes = (comp, options) => { - return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); - }; - var replaceTilde = (comp, options) => { - const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; - return comp.replace(r, (_, M, m, p, pr) => { - debug("tilde", comp, _, M, m, p, pr); - let ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; - } else if (isX(p)) { - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; - } else if (pr) { - debug("replaceTilde pr", pr); - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } else { - ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; - } - debug("tilde return", ret); - return ret; - }); - }; - var replaceCarets = (comp, options) => { - return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); - }; - var replaceCaret = (comp, options) => { - debug("caret", comp, options); - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - const z = options.includePrerelease ? "-0" : ""; - return comp.replace(r, (_, M, m, p, pr) => { - debug("caret", comp, _, M, m, p, pr); - let ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; - } else if (isX(p)) { - if (M === "0") { - ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; - } else { - ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; - } - } else if (pr) { - debug("replaceCaret pr", pr); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } - } else { - ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; - } - } else { - debug("no pr"); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; - } - } else { - ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; - } - } - debug("caret return", ret); - return ret; - }); - }; - var replaceXRanges = (comp, options) => { - debug("replaceXRanges", comp, options); - return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); - }; - var replaceXRange = (comp, options) => { - comp = comp.trim(); - const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; - return comp.replace(r, (ret, gtlt, M, m, p, pr) => { - debug("xRange", comp, ret, gtlt, M, m, p, pr); - const xM = isX(M); - const xm = xM || isX(m); - const xp = xm || isX(p); - const anyX = xp; - if (gtlt === "=" && anyX) { - gtlt = ""; - } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; - } - p = 0; - if (gtlt === ">") { - gtlt = ">="; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else { - m = +m + 1; - p = 0; - } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; - } else { - m = +m + 1; - } - } - if (gtlt === "<") { - pr = "-0"; - } - ret = `${gtlt + M}.${m}.${p}${pr}`; - } else if (xm) { - ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; - } else if (xp) { - ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; - } - debug("xRange return", ret); - return ret; - }); - }; - var replaceStars = (comp, options) => { - debug("replaceStars", comp, options); - return comp.trim().replace(re[t.STAR], ""); - }; - var replaceGTE0 = (comp, options) => { - debug("replaceGTE0", comp, options); - return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); - }; - var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { - if (isX(fM)) { - from = ""; - } else if (isX(fm)) { - from = `>=${fM}.0.0${incPr ? "-0" : ""}`; - } else if (isX(fp)) { - from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; - } else if (fpr) { - from = `>=${from}`; - } else { - from = `>=${from}${incPr ? "-0" : ""}`; - } - if (isX(tM)) { - to = ""; - } else if (isX(tm)) { - to = `<${+tM + 1}.0.0-0`; - } else if (isX(tp)) { - to = `<${tM}.${+tm + 1}.0-0`; - } else if (tpr) { - to = `<=${tM}.${tm}.${tp}-${tpr}`; - } else if (incPr) { - to = `<${tM}.${tm}.${+tp + 1}-0`; - } else { - to = `<=${to}`; - } - return `${from} ${to}`.trim(); - }; - var testSet = (set, version2, options) => { - for (let i = 0; i < set.length; i++) { - if (!set[i].test(version2)) { - return false; - } - } - if (version2.prerelease.length && !options.includePrerelease) { - for (let i = 0; i < set.length; i++) { - debug(set[i].semver); - if (set[i].semver === Comparator.ANY) { - continue; - } - if (set[i].semver.prerelease.length > 0) { - const allowed = set[i].semver; - if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { - return true; - } - } - } - return false; - } - return true; - }; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js -var require_comparator = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js"(exports2, module2) { - "use strict"; - var ANY = Symbol("SemVer ANY"); - var Comparator = class _Comparator { - static get ANY() { - return ANY; - } - constructor(comp, options) { - options = parseOptions(options); - if (comp instanceof _Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; - } - } - comp = comp.trim().split(/\s+/).join(" "); - debug("comparator", comp, options); - this.options = options; - this.loose = !!options.loose; - this.parse(comp); - if (this.semver === ANY) { - this.value = ""; - } else { - this.value = this.operator + this.semver.version; - } - debug("comp", this); - } - parse(comp) { - const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; - const m = comp.match(r); - if (!m) { - throw new TypeError(`Invalid comparator: ${comp}`); - } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; - } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); - } - } - toString() { - return this.value; - } - test(version2) { - debug("Comparator.test", version2, this.options.loose); - if (this.semver === ANY || version2 === ANY) { - return true; - } - if (typeof version2 === "string") { - try { - version2 = new SemVer(version2, this.options); - } catch (er) { - return false; - } - } - return cmp(version2, this.operator, this.semver, this.options); - } - intersects(comp, options) { - if (!(comp instanceof _Comparator)) { - throw new TypeError("a Comparator is required"); - } - if (this.operator === "") { - if (this.value === "") { - return true; - } - return new Range(comp.value, options).test(this.value); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; - } - return new Range(this.value, options).test(comp.semver); - } - options = parseOptions(options); - if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { - return false; - } - if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { - return false; - } - if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { - return true; - } - if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { - return true; - } - if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { - return true; - } - if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { - return true; - } - if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { - return true; - } - return false; - } - }; - module2.exports = Comparator; - var parseOptions = require_parse_options(); - var { safeRe: re, t } = require_re(); - var cmp = require_cmp(); - var debug = require_debug2(); - var SemVer = require_semver(); - var Range = require_range(); - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js -var require_satisfies = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js"(exports2, module2) { - "use strict"; - var Range = require_range(); - var satisfies = (version2, range, options) => { - try { - range = new Range(range, options); - } catch (er) { - return false; - } - return range.test(version2); - }; - module2.exports = satisfies; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js -var require_to_comparators = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js"(exports2, module2) { - "use strict"; - var Range = require_range(); - var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")); - module2.exports = toComparators; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js -var require_max_satisfying = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Range = require_range(); - var maxSatisfying = (versions, range, options) => { - let max = null; - let maxSV = null; - let rangeObj = null; - try { - rangeObj = new Range(range, options); - } catch (er) { - return null; - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; - }; - module2.exports = maxSatisfying; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js -var require_min_satisfying = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Range = require_range(); - var minSatisfying = (versions, range, options) => { - let min = null; - let minSV = null; - let rangeObj = null; - try { - rangeObj = new Range(range, options); - } catch (er) { - return null; - } - versions.forEach((v) => { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; - }; - module2.exports = minSatisfying; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js -var require_min_version = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Range = require_range(); - var gt = require_gt(); - var minVersion = (range, loose) => { - range = new Range(range, loose); - let minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; - } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i]; - let setMin = null; - comparators.forEach((comparator) => { - const compver = new SemVer(comparator.semver.version); - switch (comparator.operator) { - case ">": - if (compver.prerelease.length === 0) { - compver.patch++; - } else { - compver.prerelease.push(0); - } - compver.raw = compver.format(); - case "": - case ">=": - if (!setMin || gt(compver, setMin)) { - setMin = compver; - } - break; - case "<": - case "<=": - break; - default: - throw new Error(`Unexpected operation: ${comparator.operator}`); - } - }); - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin; - } - } - if (minver && range.test(minver)) { - return minver; - } - return null; - }; - module2.exports = minVersion; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js -var require_valid2 = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js"(exports2, module2) { - "use strict"; - var Range = require_range(); - var validRange = (range, options) => { - try { - return new Range(range, options).range || "*"; - } catch (er) { - return null; - } - }; - module2.exports = validRange; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js -var require_outside = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js"(exports2, module2) { - "use strict"; - var SemVer = require_semver(); - var Comparator = require_comparator(); - var { ANY } = Comparator; - var Range = require_range(); - var satisfies = require_satisfies(); - var gt = require_gt(); - var lt = require_lt(); - var lte = require_lte(); - var gte = require_gte(); - var outside = (version2, range, hilo, options) => { - version2 = new SemVer(version2, options); - range = new Range(range, options); - let gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies(version2, range, options)) { - return false; - } - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.set[i]; - let high = null; - let low = null; - comparators.forEach((comparator) => { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, options)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, options)) { - low = comparator; - } - }); - if (high.operator === comp || high.operator === ecomp) { - return false; - } - if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version2, low.semver)) { - return false; - } - } - return true; - }; - module2.exports = outside; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js -var require_gtr = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js"(exports2, module2) { - "use strict"; - var outside = require_outside(); - var gtr = (version2, range, options) => outside(version2, range, ">", options); - module2.exports = gtr; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js -var require_ltr = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js"(exports2, module2) { - "use strict"; - var outside = require_outside(); - var ltr = (version2, range, options) => outside(version2, range, "<", options); - module2.exports = ltr; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js -var require_intersects = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js"(exports2, module2) { - "use strict"; - var Range = require_range(); - var intersects = (r1, r2, options) => { - r1 = new Range(r1, options); - r2 = new Range(r2, options); - return r1.intersects(r2, options); - }; - module2.exports = intersects; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js -var require_simplify = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js"(exports2, module2) { - "use strict"; - var satisfies = require_satisfies(); - var compare = require_compare(); - module2.exports = (versions, range, options) => { - const set = []; - let first = null; - let prev = null; - const v = versions.sort((a, b) => compare(a, b, options)); - for (const version2 of v) { - const included = satisfies(version2, range, options); - if (included) { - prev = version2; - if (!first) { - first = version2; - } - } else { - if (prev) { - set.push([first, prev]); - } - prev = null; - first = null; - } - } - if (first) { - set.push([first, null]); - } - const ranges = []; - for (const [min, max] of set) { - if (min === max) { - ranges.push(min); - } else if (!max && min === v[0]) { - ranges.push("*"); - } else if (!max) { - ranges.push(`>=${min}`); - } else if (min === v[0]) { - ranges.push(`<=${max}`); - } else { - ranges.push(`${min} - ${max}`); - } - } - const simplified = ranges.join(" || "); - const original = typeof range.raw === "string" ? range.raw : String(range); - return simplified.length < original.length ? simplified : range; - }; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js -var require_subset = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js"(exports2, module2) { - "use strict"; - var Range = require_range(); - var Comparator = require_comparator(); - var { ANY } = Comparator; - var satisfies = require_satisfies(); - var compare = require_compare(); - var subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true; - } - sub = new Range(sub, options); - dom = new Range(dom, options); - let sawNonNull = false; - OUTER: - for (const simpleSub of sub.set) { - for (const simpleDom of dom.set) { - const isSub = simpleSubset(simpleSub, simpleDom, options); - sawNonNull = sawNonNull || isSub !== null; - if (isSub) { - continue OUTER; - } - } - if (sawNonNull) { - return false; - } - } - return true; - }; - var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; - var minimumVersion = [new Comparator(">=0.0.0")]; - var simpleSubset = (sub, dom, options) => { - if (sub === dom) { - return true; - } - if (sub.length === 1 && sub[0].semver === ANY) { - if (dom.length === 1 && dom[0].semver === ANY) { - return true; - } else if (options.includePrerelease) { - sub = minimumVersionWithPreRelease; - } else { - sub = minimumVersion; - } - } - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true; - } else { - dom = minimumVersion; - } - } - const eqSet = /* @__PURE__ */ new Set(); - let gt, lt; - for (const c of sub) { - if (c.operator === ">" || c.operator === ">=") { - gt = higherGT(gt, c, options); - } else if (c.operator === "<" || c.operator === "<=") { - lt = lowerLT(lt, c, options); - } else { - eqSet.add(c.semver); - } - } - if (eqSet.size > 1) { - return null; - } - let gtltComp; - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options); - if (gtltComp > 0) { - return null; - } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) { - return null; - } - } - for (const eq of eqSet) { - if (gt && !satisfies(eq, String(gt), options)) { - return null; - } - if (lt && !satisfies(eq, String(lt), options)) { - return null; - } - for (const c of dom) { - if (!satisfies(eq, String(c), options)) { - return false; - } - } - return true; - } - let higher, lower; - let hasDomLT, hasDomGT; - let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; - let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false; - } - for (const c of dom) { - hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; - hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; - if (gt) { - if (needDomGTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { - needDomGTPre = false; - } - } - if (c.operator === ">" || c.operator === ">=") { - higher = higherGT(gt, c, options); - if (higher === c && higher !== gt) { - return false; - } - } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) { - return false; - } - } - if (lt) { - if (needDomLTPre) { - if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { - needDomLTPre = false; - } - } - if (c.operator === "<" || c.operator === "<=") { - lower = lowerLT(lt, c, options); - if (lower === c && lower !== lt) { - return false; - } - } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) { - return false; - } - } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false; - } - } - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false; - } - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false; - } - if (needDomGTPre || needDomLTPre) { - return false; - } - return true; - }; - var higherGT = (a, b, options) => { - if (!a) { - return b; - } - const comp = compare(a.semver, b.semver, options); - return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a; - }; - var lowerLT = (a, b, options) => { - if (!a) { - return b; - } - const comp = compare(a.semver, b.semver, options); - return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a; - }; - module2.exports = subset; - } -}); - -// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js -var require_semver2 = __commonJS({ - "../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js"(exports2, module2) { - "use strict"; - var internalRe = require_re(); - var constants2 = require_constants2(); - var SemVer = require_semver(); - var identifiers = require_identifiers(); - var parse2 = require_parse2(); - var valid = require_valid(); - var clean2 = require_clean(); - var inc = require_inc(); - var diff = require_diff(); - var major = require_major(); - var minor = require_minor(); - var patch = require_patch(); - var prerelease = require_prerelease(); - var compare = require_compare(); - var rcompare = require_rcompare(); - var compareLoose = require_compare_loose(); - var compareBuild = require_compare_build(); - var sort = require_sort(); - var rsort = require_rsort(); - var gt = require_gt(); - var lt = require_lt(); - var eq = require_eq(); - var neq = require_neq(); - var gte = require_gte(); - var lte = require_lte(); - var cmp = require_cmp(); - var coerce2 = require_coerce(); - var Comparator = require_comparator(); - var Range = require_range(); - var satisfies = require_satisfies(); - var toComparators = require_to_comparators(); - var maxSatisfying = require_max_satisfying(); - var minSatisfying = require_min_satisfying(); - var minVersion = require_min_version(); - var validRange = require_valid2(); - var outside = require_outside(); - var gtr = require_gtr(); - var ltr = require_ltr(); - var intersects = require_intersects(); - var simplifyRange = require_simplify(); - var subset = require_subset(); - module2.exports = { - parse: parse2, - valid, - clean: clean2, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte, - lte, - cmp, - coerce: coerce2, - Comparator, - Range, - satisfies, - toComparators, - maxSatisfying, - minSatisfying, - minVersion, - validRange, - outside, - gtr, - ltr, - intersects, - simplifyRange, - subset, - SemVer, - re: internalRe.re, - src: internalRe.src, - tokens: internalRe.t, - SEMVER_SPEC_VERSION: constants2.SEMVER_SPEC_VERSION, - RELEASE_TYPES: constants2.RELEASE_TYPES, - compareIdentifiers: identifiers.compareIdentifiers, - rcompareIdentifiers: identifiers.rcompareIdentifiers - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/plugin-utils.js -var require_plugin_utils = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/plugin-utils.js"(exports2, module2) { - "use strict"; - var semver = require_semver2(); - var assert3 = require("node:assert"); - var kRegisteredPlugins = Symbol.for("registered-plugin"); - var { - kTestInternals - } = require_symbols2(); - var { exist, existReply, existRequest } = require_decorate(); - var { - FST_ERR_PLUGIN_VERSION_MISMATCH, - FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE, - FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER - } = require_errors2(); - var rcRegex = /-(?:rc|pre|alpha).+$/u; - function getMeta(fn) { - return fn[Symbol.for("plugin-meta")]; - } - function getPluginName(func) { - const display = getDisplayName(func); - if (display) { - return display; - } - const cache = require.cache; - if (cache) { - const keys = Object.keys(cache); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (cache[key].exports === func) { - return key; - } - } - } - if (func.name) { - return func.name; - } - return null; - } - function getFuncPreview(func) { - return func.toString().split("\n", 2).map((s) => s.trim()).join(" -- "); - } - function getDisplayName(fn) { - return fn[Symbol.for("fastify.display-name")]; - } - function shouldSkipOverride(fn) { - return !!fn[Symbol.for("skip-override")]; - } - function checkDependencies(fn) { - const meta = getMeta(fn); - if (!meta) - return; - const dependencies = meta.dependencies; - if (!dependencies) - return; - assert3(Array.isArray(dependencies), "The dependencies should be an array of strings"); - dependencies.forEach((dependency) => { - assert3( - this[kRegisteredPlugins].indexOf(dependency) > -1, - `The dependency '${dependency}' of plugin '${meta.name}' is not registered` - ); - }); - } - function checkDecorators(fn) { - const meta = getMeta(fn); - if (!meta) - return; - const { decorators, name } = meta; - if (!decorators) - return; - if (decorators.fastify) - _checkDecorators(this, "Fastify", decorators.fastify, name); - if (decorators.reply) - _checkDecorators(this, "Reply", decorators.reply, name); - if (decorators.request) - _checkDecorators(this, "Request", decorators.request, name); - } - var checks = { - Fastify: exist, - Request: existRequest, - Reply: existReply - }; - function _checkDecorators(that, instance2, decorators, name) { - assert3(Array.isArray(decorators), "The decorators should be an array of strings"); - decorators.forEach((decorator) => { - const withPluginName = typeof name === "string" ? ` required by '${name}'` : ""; - if (!checks[instance2].call(that, decorator)) { - throw new FST_ERR_PLUGIN_NOT_PRESENT_IN_INSTANCE(decorator, withPluginName, instance2); - } - }); - } - function checkVersion(fn) { - const meta = getMeta(fn); - if (meta?.fastify == null) - return; - const requiredVersion = meta.fastify; - const fastifyRc = rcRegex.test(this.version); - if (fastifyRc === true && semver.gt(this.version, semver.coerce(requiredVersion)) === true) { - return; - } - if (requiredVersion && semver.satisfies(this.version, requiredVersion, { includePrerelease: fastifyRc }) === false) { - throw new FST_ERR_PLUGIN_VERSION_MISMATCH(meta.name, requiredVersion, this.version); - } - } - function registerPluginName(fn) { - const meta = getMeta(fn); - if (!meta) - return; - const name = meta.name; - if (!name) - return; - this[kRegisteredPlugins].push(name); - return name; - } - function checkPluginHealthiness(fn, pluginName) { - if (fn.constructor.name === "AsyncFunction" && fn.length === 3) { - throw new FST_ERR_PLUGIN_INVALID_ASYNC_HANDLER(pluginName); - } - } - function registerPlugin(fn) { - const pluginName = registerPluginName.call(this, fn) || getPluginName(fn); - checkPluginHealthiness.call(this, fn, pluginName); - checkVersion.call(this, fn); - checkDecorators.call(this, fn); - checkDependencies.call(this, fn); - return shouldSkipOverride(fn); - } - module2.exports = { - getPluginName, - getFuncPreview, - kRegisteredPlugins, - getDisplayName, - registerPlugin - }; - module2.exports[kTestInternals] = { - shouldSkipOverride, - getMeta, - checkDecorators, - checkDependencies - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/req-id-gen-factory.js -var require_req_id_gen_factory = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/req-id-gen-factory.js"(exports2, module2) { - "use strict"; - function reqIdGenFactory(requestIdHeader, optGenReqId) { - const genReqId = optGenReqId || buildDefaultGenReqId(); - if (requestIdHeader) { - return buildOptionalHeaderReqId(requestIdHeader, genReqId); - } - return genReqId; - } - function getGenReqId(contextServer, req) { - return contextServer.genReqId(req); - } - function buildDefaultGenReqId() { - const maxInt = 2147483647; - let nextReqId = 0; - return function defaultGenReqId() { - nextReqId = nextReqId + 1 & maxInt; - return `req-${nextReqId.toString(36)}`; - }; - } - function buildOptionalHeaderReqId(requestIdHeader, genReqId) { - return function(req) { - return req.headers[requestIdHeader] || genReqId(req); - }; - } - module2.exports = { - getGenReqId, - reqIdGenFactory - }; - } -}); - -// ../../node_modules/.pnpm/fast-decode-uri-component@1.0.1/node_modules/fast-decode-uri-component/index.js -var require_fast_decode_uri_component = __commonJS({ - "../../node_modules/.pnpm/fast-decode-uri-component@1.0.1/node_modules/fast-decode-uri-component/index.js"(exports2, module2) { - "use strict"; - var UTF8_ACCEPT = 12; - var UTF8_REJECT = 0; - var UTF8_DATA = [ - // The first part of the table maps bytes to character to a transition. - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 4, - 4, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 6, - 7, - 7, - 7, - 7, - 7, - 7, - 7, - 7, - 7, - 7, - 7, - 7, - 8, - 7, - 7, - 10, - 9, - 9, - 9, - 11, - 4, - 4, - 4, - 4, - 4, - 4, - 4, - 4, - 4, - 4, - 4, - // The second part of the table maps a state to a new state when adding a - // transition. - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 12, - 0, - 0, - 0, - 0, - 24, - 36, - 48, - 60, - 72, - 84, - 96, - 0, - 12, - 12, - 12, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 24, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 24, - 24, - 24, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 24, - 24, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 48, - 48, - 48, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 48, - 48, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 48, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - // The third part maps the current transition to a mask that needs to apply - // to the byte. - 127, - 63, - 63, - 63, - 0, - 31, - 15, - 15, - 15, - 7, - 7, - 7 - ]; - function decodeURIComponent2(uri) { - var percentPosition = uri.indexOf("%"); - if (percentPosition === -1) - return uri; - var length = uri.length; - var decoded = ""; - var last = 0; - var codepoint = 0; - var startOfOctets = percentPosition; - var state = UTF8_ACCEPT; - while (percentPosition > -1 && percentPosition < length) { - var high = hexCodeToInt(uri[percentPosition + 1], 4); - var low = hexCodeToInt(uri[percentPosition + 2], 0); - var byte = high | low; - var type2 = UTF8_DATA[byte]; - state = UTF8_DATA[256 + state + type2]; - codepoint = codepoint << 6 | byte & UTF8_DATA[364 + type2]; - if (state === UTF8_ACCEPT) { - decoded += uri.slice(last, startOfOctets); - decoded += codepoint <= 65535 ? String.fromCharCode(codepoint) : String.fromCharCode( - 55232 + (codepoint >> 10), - 56320 + (codepoint & 1023) - ); - codepoint = 0; - last = percentPosition + 3; - percentPosition = startOfOctets = uri.indexOf("%", last); - } else if (state === UTF8_REJECT) { - return null; - } else { - percentPosition += 3; - if (percentPosition < length && uri.charCodeAt(percentPosition) === 37) - continue; - return null; - } - } - return decoded + uri.slice(last); - } - var HEX = { - "0": 0, - "1": 1, - "2": 2, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7, - "8": 8, - "9": 9, - "a": 10, - "A": 10, - "b": 11, - "B": 11, - "c": 12, - "C": 12, - "d": 13, - "D": 13, - "e": 14, - "E": 14, - "f": 15, - "F": 15 - }; - function hexCodeToInt(c, shift) { - var i = HEX[c]; - return i === void 0 ? 255 : i << shift; - } - module2.exports = decodeURIComponent2; - } -}); - -// ../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/parse.js -var require_parse3 = __commonJS({ - "../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/parse.js"(exports2, module2) { - "use strict"; - var fastDecode = require_fast_decode_uri_component(); - var plusRegex = /\+/g; - var Empty = function() { - }; - Empty.prototype = /* @__PURE__ */ Object.create(null); - function parse2(input) { - const result = new Empty(); - if (typeof input !== "string") { - return result; - } - let inputLength = input.length; - let key = ""; - let value = ""; - let startingIndex = -1; - let equalityIndex = -1; - let shouldDecodeKey = false; - let shouldDecodeValue = false; - let keyHasPlus = false; - let valueHasPlus = false; - let hasBothKeyValuePair = false; - let c = 0; - for (let i = 0; i < inputLength + 1; i++) { - c = i !== inputLength ? input.charCodeAt(i) : 38; - if (c === 38) { - hasBothKeyValuePair = equalityIndex > startingIndex; - if (!hasBothKeyValuePair) { - equalityIndex = i; - } - key = input.slice(startingIndex + 1, equalityIndex); - if (hasBothKeyValuePair || key.length > 0) { - if (keyHasPlus) { - key = key.replace(plusRegex, " "); - } - if (shouldDecodeKey) { - key = fastDecode(key) || key; - } - if (hasBothKeyValuePair) { - value = input.slice(equalityIndex + 1, i); - if (valueHasPlus) { - value = value.replace(plusRegex, " "); - } - if (shouldDecodeValue) { - value = fastDecode(value) || value; - } - } - const currentValue = result[key]; - if (currentValue === void 0) { - result[key] = value; - } else { - if (currentValue.pop) { - currentValue.push(value); - } else { - result[key] = [currentValue, value]; - } - } - } - value = ""; - startingIndex = i; - equalityIndex = i; - shouldDecodeKey = false; - shouldDecodeValue = false; - keyHasPlus = false; - valueHasPlus = false; - } else if (c === 61) { - if (equalityIndex <= startingIndex) { - equalityIndex = i; - } else { - shouldDecodeValue = true; - } - } else if (c === 43) { - if (equalityIndex > startingIndex) { - valueHasPlus = true; - } else { - keyHasPlus = true; - } - } else if (c === 37) { - if (equalityIndex > startingIndex) { - shouldDecodeValue = true; - } else { - shouldDecodeKey = true; - } - } - } - return result; - } - module2.exports = parse2; - } -}); - -// ../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/internals/querystring.js -var require_querystring = __commonJS({ - "../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/internals/querystring.js"(exports2, module2) { - var hexTable = Array.from( - { length: 256 }, - (_, i) => "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase() - ); - var noEscape = new Int8Array([ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - // 0 - 15 - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - // 16 - 31 - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - // 32 - 47 - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - // 48 - 63 - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - // 64 - 79 - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - // 80 - 95 - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - // 96 - 111 - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 0 - // 112 - 127 - ]); - function encodeString(str) { - const len = str.length; - if (len === 0) - return ""; - let out = ""; - let lastPos = 0; - let i = 0; - outer: - for (; i < len; i++) { - let c = str.charCodeAt(i); - while (c < 128) { - if (noEscape[c] !== 1) { - if (lastPos < i) - out += str.slice(lastPos, i); - lastPos = i + 1; - out += hexTable[c]; - } - if (++i === len) - break outer; - c = str.charCodeAt(i); - } - if (lastPos < i) - out += str.slice(lastPos, i); - if (c < 2048) { - lastPos = i + 1; - out += hexTable[192 | c >> 6] + hexTable[128 | c & 63]; - continue; - } - if (c < 55296 || c >= 57344) { - lastPos = i + 1; - out += hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]; - continue; - } - ++i; - if (i >= len) { - throw new Error("URI malformed"); - } - const c2 = str.charCodeAt(i) & 1023; - lastPos = i + 1; - c = 65536 + ((c & 1023) << 10 | c2); - out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]; - } - if (lastPos === 0) - return str; - if (lastPos < len) - return out + str.slice(lastPos); - return out; - } - module2.exports = { encodeString }; - } -}); - -// ../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/stringify.js -var require_stringify = __commonJS({ - "../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/stringify.js"(exports2, module2) { - "use strict"; - var { encodeString } = require_querystring(); - function getAsPrimitive(value) { - const type2 = typeof value; - if (type2 === "string") { - return encodeString(value); - } else if (type2 === "bigint") { - return value.toString(); - } else if (type2 === "boolean") { - return value ? "true" : "false"; - } else if (type2 === "number" && Number.isFinite(value)) { - return value < 1e21 ? "" + value : encodeString("" + value); - } - return ""; - } - function stringify2(input) { - let result = ""; - if (input === null || typeof input !== "object") { - return result; - } - const separator = "&"; - const keys = Object.keys(input); - const keyLength = keys.length; - let valueLength = 0; - for (let i = 0; i < keyLength; i++) { - const key = keys[i]; - const value = input[key]; - const encodedKey = encodeString(key) + "="; - if (i) { - result += separator; - } - if (Array.isArray(value)) { - valueLength = value.length; - for (let j = 0; j < valueLength; j++) { - if (j) { - result += separator; - } - result += encodedKey; - result += getAsPrimitive(value[j]); - } - } else { - result += encodedKey; - result += getAsPrimitive(value); - } - } - return result; - } - module2.exports = stringify2; - } -}); - -// ../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/index.js -var require_lib = __commonJS({ - "../../node_modules/.pnpm/fast-querystring@1.1.2/node_modules/fast-querystring/lib/index.js"(exports2, module2) { - "use strict"; - var parse2 = require_parse3(); - var stringify2 = require_stringify(); - var fastQuerystring = { - parse: parse2, - stringify: stringify2 - }; - module2.exports = fastQuerystring; - module2.exports.default = fastQuerystring; - module2.exports.parse = parse2; - module2.exports.stringify = stringify2; - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/tokens.js -var require_tokens = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/tokens.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/types.js -var require_types3 = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/types.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.types = void 0; - var types; - (function(types2) { - types2[types2["ROOT"] = 0] = "ROOT"; - types2[types2["GROUP"] = 1] = "GROUP"; - types2[types2["POSITION"] = 2] = "POSITION"; - types2[types2["SET"] = 3] = "SET"; - types2[types2["RANGE"] = 4] = "RANGE"; - types2[types2["REPETITION"] = 5] = "REPETITION"; - types2[types2["REFERENCE"] = 6] = "REFERENCE"; - types2[types2["CHAR"] = 7] = "CHAR"; - })(types = exports2.types || (exports2.types = {})); - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/set-lookup.js -var require_set_lookup = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/set-lookup.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/index.js -var require_types4 = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/types/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) - __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar(require_tokens(), exports2); - __exportStar(require_types3(), exports2); - __exportStar(require_set_lookup(), exports2); - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/sets.js -var require_sets = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/sets.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.anyChar = exports2.notWhitespace = exports2.whitespace = exports2.notInts = exports2.ints = exports2.notWords = exports2.words = void 0; - var types_1 = require_types4(); - var INTS = () => [{ type: types_1.types.RANGE, from: 48, to: 57 }]; - var WORDS = () => [ - { type: types_1.types.CHAR, value: 95 }, - { type: types_1.types.RANGE, from: 97, to: 122 }, - { type: types_1.types.RANGE, from: 65, to: 90 }, - { type: types_1.types.RANGE, from: 48, to: 57 } - ]; - var WHITESPACE = () => [ - { type: types_1.types.CHAR, value: 9 }, - { type: types_1.types.CHAR, value: 10 }, - { type: types_1.types.CHAR, value: 11 }, - { type: types_1.types.CHAR, value: 12 }, - { type: types_1.types.CHAR, value: 13 }, - { type: types_1.types.CHAR, value: 32 }, - { type: types_1.types.CHAR, value: 160 }, - { type: types_1.types.CHAR, value: 5760 }, - { type: types_1.types.RANGE, from: 8192, to: 8202 }, - { type: types_1.types.CHAR, value: 8232 }, - { type: types_1.types.CHAR, value: 8233 }, - { type: types_1.types.CHAR, value: 8239 }, - { type: types_1.types.CHAR, value: 8287 }, - { type: types_1.types.CHAR, value: 12288 }, - { type: types_1.types.CHAR, value: 65279 } - ]; - var NOTANYCHAR = () => [ - { type: types_1.types.CHAR, value: 10 }, - { type: types_1.types.CHAR, value: 13 }, - { type: types_1.types.CHAR, value: 8232 }, - { type: types_1.types.CHAR, value: 8233 } - ]; - exports2.words = () => ({ type: types_1.types.SET, set: WORDS(), not: false }); - exports2.notWords = () => ({ type: types_1.types.SET, set: WORDS(), not: true }); - exports2.ints = () => ({ type: types_1.types.SET, set: INTS(), not: false }); - exports2.notInts = () => ({ type: types_1.types.SET, set: INTS(), not: true }); - exports2.whitespace = () => ({ type: types_1.types.SET, set: WHITESPACE(), not: false }); - exports2.notWhitespace = () => ({ type: types_1.types.SET, set: WHITESPACE(), not: true }); - exports2.anyChar = () => ({ type: types_1.types.SET, set: NOTANYCHAR(), not: true }); - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/util.js -var require_util2 = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/util.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result, mod2, k); - } - __setModuleDefault(result, mod2); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tokenizeClass = exports2.strToChars = void 0; - var types_1 = require_types4(); - var sets = __importStar(require_sets()); - var CTRL = "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^ ?"; - exports2.strToChars = (str) => { - const charsRegex = /(\[\\b\])|(\\)?\\(?:u([A-F0-9]{4})|x([A-F0-9]{2})|c([@A-Z[\\\]^?])|([0tnvfr]))/g; - return str.replace(charsRegex, (s, b, lbs, a16, b16, dctrl, eslsh) => { - if (lbs) { - return s; - } - let code = b ? 8 : a16 ? parseInt(a16, 16) : b16 ? parseInt(b16, 16) : dctrl ? CTRL.indexOf(dctrl) : { - 0: 0, - t: 9, - n: 10, - v: 11, - f: 12, - r: 13 - }[eslsh]; - let c = String.fromCharCode(code); - return /[[\]{}^$.|?*+()]/.test(c) ? `\\${c}` : c; - }); - }; - exports2.tokenizeClass = (str, regexpStr) => { - var _a, _b, _c, _d, _e, _f, _g; - let tokens = [], rs, c; - const regexp = /\\(?:(w)|(d)|(s)|(W)|(D)|(S))|((?:(?:\\)(.)|([^\]\\]))-(((?:\\)])|(((?:\\)?([^\]])))))|(\])|(?:\\)?([^])/g; - while ((rs = regexp.exec(str)) !== null) { - const p = (_g = (_f = (_e = (_d = (_c = (_b = (_a = rs[1] && sets.words()) !== null && _a !== void 0 ? _a : rs[2] && sets.ints()) !== null && _b !== void 0 ? _b : rs[3] && sets.whitespace()) !== null && _c !== void 0 ? _c : rs[4] && sets.notWords()) !== null && _d !== void 0 ? _d : rs[5] && sets.notInts()) !== null && _e !== void 0 ? _e : rs[6] && sets.notWhitespace()) !== null && _f !== void 0 ? _f : rs[7] && { - type: types_1.types.RANGE, - from: (rs[8] || rs[9]).charCodeAt(0), - to: (c = rs[10]).charCodeAt(c.length - 1) - }) !== null && _g !== void 0 ? _g : (c = rs[16]) && { type: types_1.types.CHAR, value: c.charCodeAt(0) }; - if (p) { - tokens.push(p); - } else { - return [tokens, regexp.lastIndex]; - } - } - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Unterminated character class`); - }; - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/tokenizer.js -var require_tokenizer = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/tokenizer.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result, mod2, k); - } - __setModuleDefault(result, mod2); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.tokenizer = void 0; - var util = __importStar(require_util2()); - var types_1 = require_types4(); - var sets = __importStar(require_sets()); - var captureGroupFirstChar = /^[a-zA-Z_$]$/i; - var captureGroupChars = /^[a-zA-Z0-9_$]$/i; - var digit = /\d/; - exports2.tokenizer = (regexpStr) => { - let i = 0, c; - let start = { type: types_1.types.ROOT, stack: [] }; - let lastGroup = start; - let last = start.stack; - let groupStack = []; - let referenceQueue = []; - let groupCount = 0; - const repeatErr = (col) => { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Nothing to repeat at column ${col - 1}`); - }; - let str = util.strToChars(regexpStr); - while (i < str.length) { - switch (c = str[i++]) { - case "\\": - if (i === str.length) { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: \\ at end of pattern`); - } - switch (c = str[i++]) { - case "b": - last.push({ type: types_1.types.POSITION, value: "b" }); - break; - case "B": - last.push({ type: types_1.types.POSITION, value: "B" }); - break; - case "w": - last.push(sets.words()); - break; - case "W": - last.push(sets.notWords()); - break; - case "d": - last.push(sets.ints()); - break; - case "D": - last.push(sets.notInts()); - break; - case "s": - last.push(sets.whitespace()); - break; - case "S": - last.push(sets.notWhitespace()); - break; - default: - if (digit.test(c)) { - let digits = c; - while (i < str.length && digit.test(str[i])) { - digits += str[i++]; - } - let value = parseInt(digits, 10); - const reference = { type: types_1.types.REFERENCE, value }; - last.push(reference); - referenceQueue.push({ reference, stack: last, index: last.length - 1 }); - } else { - last.push({ type: types_1.types.CHAR, value: c.charCodeAt(0) }); - } - } - break; - case "^": - last.push({ type: types_1.types.POSITION, value: "^" }); - break; - case "$": - last.push({ type: types_1.types.POSITION, value: "$" }); - break; - case "[": { - let not; - if (str[i] === "^") { - not = true; - i++; - } else { - not = false; - } - let classTokens = util.tokenizeClass(str.slice(i), regexpStr); - i += classTokens[1]; - last.push({ - type: types_1.types.SET, - set: classTokens[0], - not - }); - break; - } - case ".": - last.push(sets.anyChar()); - break; - case "(": { - let group = { - type: types_1.types.GROUP, - stack: [], - remember: true - }; - if (str[i] === "?") { - c = str[i + 1]; - i += 2; - if (c === "=") { - group.followedBy = true; - group.remember = false; - } else if (c === "!") { - group.notFollowedBy = true; - group.remember = false; - } else if (c === "<") { - let name = ""; - if (captureGroupFirstChar.test(str[i])) { - name += str[i]; - i++; - } else { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Invalid capture group name, character '${str[i]}' after '<' at column ${i + 1}`); - } - while (i < str.length && captureGroupChars.test(str[i])) { - name += str[i]; - i++; - } - if (!name) { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Invalid capture group name, character '${str[i]}' after '<' at column ${i + 1}`); - } - if (str[i] !== ">") { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Unclosed capture group name, expected '>', found '${str[i]}' at column ${i + 1}`); - } - group.name = name; - i++; - } else if (c === ":") { - group.remember = false; - } else { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Invalid group, character '${c}' after '?' at column ${i - 1}`); - } - } else { - groupCount += 1; - } - last.push(group); - groupStack.push(lastGroup); - lastGroup = group; - last = group.stack; - break; - } - case ")": - if (groupStack.length === 0) { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Unmatched ) at column ${i - 1}`); - } - lastGroup = groupStack.pop(); - last = lastGroup.options ? lastGroup.options[lastGroup.options.length - 1] : lastGroup.stack; - break; - case "|": { - if (!lastGroup.options) { - lastGroup.options = [lastGroup.stack]; - delete lastGroup.stack; - } - let stack = []; - lastGroup.options.push(stack); - last = stack; - break; - } - case "{": { - let rs = /^(\d+)(,(\d+)?)?\}/.exec(str.slice(i)), min, max; - if (rs !== null) { - if (last.length === 0) { - repeatErr(i); - } - min = parseInt(rs[1], 10); - max = rs[2] ? rs[3] ? parseInt(rs[3], 10) : Infinity : min; - i += rs[0].length; - last.push({ - type: types_1.types.REPETITION, - min, - max, - value: last.pop() - }); - } else { - last.push({ - type: types_1.types.CHAR, - value: 123 - }); - } - break; - } - case "?": - if (last.length === 0) { - repeatErr(i); - } - last.push({ - type: types_1.types.REPETITION, - min: 0, - max: 1, - value: last.pop() - }); - break; - case "+": - if (last.length === 0) { - repeatErr(i); - } - last.push({ - type: types_1.types.REPETITION, - min: 1, - max: Infinity, - value: last.pop() - }); - break; - case "*": - if (last.length === 0) { - repeatErr(i); - } - last.push({ - type: types_1.types.REPETITION, - min: 0, - max: Infinity, - value: last.pop() - }); - break; - default: - last.push({ - type: types_1.types.CHAR, - value: c.charCodeAt(0) - }); - } - } - if (groupStack.length !== 0) { - throw new SyntaxError(`Invalid regular expression: /${regexpStr}/: Unterminated group`); - } - updateReferences(referenceQueue, groupCount); - return start; - }; - function updateReferences(referenceQueue, groupCount) { - for (const elem of referenceQueue.reverse()) { - if (groupCount < elem.reference.value) { - elem.reference.type = types_1.types.CHAR; - const valueString = elem.reference.value.toString(); - elem.reference.value = parseInt(valueString, 8); - if (!/^[0-7]+$/.test(valueString)) { - let i = 0; - while (valueString[i] !== "8" && valueString[i] !== "9") { - i += 1; - } - if (i === 0) { - elem.reference.value = valueString.charCodeAt(0); - i += 1; - } else { - elem.reference.value = parseInt(valueString.slice(0, i), 8); - } - if (valueString.length > i) { - const tail = elem.stack.splice(elem.index + 1); - for (const char of valueString.slice(i)) { - elem.stack.push({ - type: types_1.types.CHAR, - value: char.charCodeAt(0) - }); - } - elem.stack.push(...tail); - } - } - } - } - } - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/sets-lookup.js -var require_sets_lookup = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/sets-lookup.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result, mod2, k); - } - __setModuleDefault(result, mod2); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.NOTANYCHAR = exports2.WHITESPACE = exports2.WORDS = exports2.INTS = void 0; - var Sets = __importStar(require_sets()); - var types_1 = require_types4(); - function setToLookup(tokens) { - let lookup = {}; - let len = 0; - for (const token of tokens) { - if (token.type === types_1.types.CHAR) { - lookup[token.value] = true; - } - if (token.type === types_1.types.RANGE) { - lookup[`${token.from}-${token.to}`] = true; - } - len += 1; - } - return { - lookup: () => Object.assign({}, lookup), - len - }; - } - exports2.INTS = setToLookup(Sets.ints().set); - exports2.WORDS = setToLookup(Sets.words().set); - exports2.WHITESPACE = setToLookup(Sets.whitespace().set); - exports2.NOTANYCHAR = setToLookup(Sets.anyChar().set); - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/write-set-tokens.js -var require_write_set_tokens = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/write-set-tokens.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar = exports2 && exports2.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) - __createBinding(result, mod2, k); - } - __setModuleDefault(result, mod2); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.writeSetTokens = exports2.setChar = void 0; - var types_1 = require_types4(); - var sets = __importStar(require_sets_lookup()); - function setChar(charCode) { - return charCode === 94 ? "\\^" : charCode === 92 ? "\\\\" : charCode === 93 ? "\\]" : charCode === 45 ? "\\-" : String.fromCharCode(charCode); - } - exports2.setChar = setChar; - function isSameSet(set, { lookup, len }) { - if (len !== set.length) { - return false; - } - const map = lookup(); - for (const elem of set) { - if (elem.type === types_1.types.SET) { - return false; - } - const key = elem.type === types_1.types.CHAR ? elem.value : `${elem.from}-${elem.to}`; - if (map[key]) { - map[key] = false; - } else { - return false; - } - } - return true; - } - function writeSetTokens(set, isNested = false) { - if (isSameSet(set.set, sets.INTS)) { - return set.not ? "\\D" : "\\d"; - } - if (isSameSet(set.set, sets.WORDS)) { - return set.not ? "\\W" : "\\w"; - } - if (set.not && isSameSet(set.set, sets.NOTANYCHAR)) { - return "."; - } - if (isSameSet(set.set, sets.WHITESPACE)) { - return set.not ? "\\S" : "\\s"; - } - let tokenString = ""; - for (let i = 0; i < set.set.length; i++) { - const subset = set.set[i]; - tokenString += writeSetToken(subset); - } - const contents = `${set.not ? "^" : ""}${tokenString}`; - return isNested ? contents : `[${contents}]`; - } - exports2.writeSetTokens = writeSetTokens; - function writeSetToken(set) { - if (set.type === types_1.types.CHAR) { - return setChar(set.value); - } else if (set.type === types_1.types.RANGE) { - return `${setChar(set.from)}-${setChar(set.to)}`; - } - return writeSetTokens(set, true); - } - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/reconstruct.js -var require_reconstruct = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/reconstruct.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reconstruct = void 0; - var types_1 = require_types4(); - var write_set_tokens_1 = require_write_set_tokens(); - var reduceStack = (stack) => stack.map(exports2.reconstruct).join(""); - var createAlternate = (token) => { - if ("options" in token) { - return token.options.map(reduceStack).join("|"); - } else if ("stack" in token) { - return reduceStack(token.stack); - } else { - throw new Error(`options or stack must be Root or Group token`); - } - }; - exports2.reconstruct = (token) => { - switch (token.type) { - case types_1.types.ROOT: - return createAlternate(token); - case types_1.types.CHAR: { - const c = String.fromCharCode(token.value); - return (/[[\\{}$^.|?*+()]/.test(c) ? "\\" : "") + c; - } - case types_1.types.POSITION: - if (token.value === "^" || token.value === "$") { - return token.value; - } else { - return `\\${token.value}`; - } - case types_1.types.REFERENCE: - return `\\${token.value}`; - case types_1.types.SET: - return write_set_tokens_1.writeSetTokens(token); - case types_1.types.GROUP: { - const prefix = token.name ? `?<${token.name}>` : token.remember ? "" : token.followedBy ? "?=" : token.notFollowedBy ? "?!" : "?:"; - return `(${prefix}${createAlternate(token)})`; - } - case types_1.types.REPETITION: { - const { min, max } = token; - let endWith; - if (min === 0 && max === 1) { - endWith = "?"; - } else if (min === 1 && max === Infinity) { - endWith = "+"; - } else if (min === 0 && max === Infinity) { - endWith = "*"; - } else if (max === Infinity) { - endWith = `{${min},}`; - } else if (min === max) { - endWith = `{${min}}`; - } else { - endWith = `{${min},${max}}`; - } - return `${exports2.reconstruct(token.value)}${endWith}`; - } - case types_1.types.RANGE: - return `${write_set_tokens_1.setChar(token.from)}-${write_set_tokens_1.setChar(token.to)}`; - default: - throw new Error(`Invalid token type ${token}`); - } - }; - } -}); - -// ../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/index.js -var require_dist3 = __commonJS({ - "../../node_modules/.pnpm/ret@0.5.0/node_modules/ret/dist/index.js"(exports2, module2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) - __createBinding(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.types = void 0; - var types_1 = require_types4(); - Object.defineProperty(exports2, "types", { enumerable: true, get: function() { - return types_1.types; - } }); - __exportStar(require_tokenizer(), exports2); - __exportStar(require_reconstruct(), exports2); - var tokenizer_1 = require_tokenizer(); - var reconstruct_1 = require_reconstruct(); - __exportStar(require_types4(), exports2); - exports2.default = tokenizer_1.tokenizer; - module2.exports = tokenizer_1.tokenizer; - module2.exports.types = types_1.types; - module2.exports.reconstruct = reconstruct_1.reconstruct; - } -}); - -// ../../node_modules/.pnpm/safe-regex2@5.1.1/node_modules/safe-regex2/index.js -var require_safe_regex2 = __commonJS({ - "../../node_modules/.pnpm/safe-regex2@5.1.1/node_modules/safe-regex2/index.js"(exports2, module2) { - "use strict"; - var parse2 = require_dist3(); - var { types } = require_dist3(); - function walk(node, opts, starHeight) { - let i; - let ok; - let len; - if (node.type === types.REPETITION) { - starHeight++; - opts.reps++; - if (starHeight > 1) - return false; - if (opts.reps > opts.limit) - return false; - } - const options = node.options || node.value?.options; - if (options) { - for (i = 0, len = options.length; i < len; i++) { - ok = walk({ stack: options[i] }, opts, starHeight); - if (!ok) - return false; - } - } - const stack = node.stack || node.value?.stack; - if (!stack) - return true; - for (i = 0, len = stack.length; i < len; i++) { - ok = walk(stack[i], opts, starHeight); - if (!ok) - return false; - } - return true; - } - function safeRegex(re, options) { - const opts = { - reps: 0, - limit: options?.limit ?? 25 - }; - if (isRegExp(re)) - re = re.source; - else if (typeof re !== "string") - re = String(re); - try { - return walk(parse2(re), opts, 0); - } catch { - return false; - } - } - function isRegExp(x) { - return Object.prototype.toString.call(x) === "[object RegExp]"; - } - module2.exports = safeRegex; - module2.exports.default = safeRegex; - module2.exports.safeRegex = safeRegex; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/strategies/http-method.js -var require_http_method = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/strategies/http-method.js"(exports2, module2) { - "use strict"; - module2.exports = { - name: "__fmw_internal_strategy_merged_tree_http_method__", - storage: function() { - const handlers = /* @__PURE__ */ new Map(); - return { - get: (type2) => { - return handlers.get(type2) || null; - }, - set: (type2, store) => { - handlers.set(type2, store); - } - }; - }, - /* c8 ignore next 1 */ - deriveConstraint: (req) => req.method, - mustMatchWhenDerived: true - }; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/pretty-print.js -var require_pretty_print = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/pretty-print.js"(exports2, module2) { - "use strict"; - var deepEqual = require_fast_deep_equal(); - var httpMethodStrategy = require_http_method(); - var treeDataSymbol = Symbol("treeData"); - function printObjectTree(obj, parentPrefix = "") { - let tree = ""; - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - const value = obj[key]; - const isLast = i === keys.length - 1; - const nodePrefix = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 "; - const childPrefix = isLast ? " " : "\u2502 "; - const nodeData = value[treeDataSymbol] || ""; - const prefixedNodeData = nodeData.replaceAll("\n", "\n" + parentPrefix + childPrefix); - tree += parentPrefix + nodePrefix + key + prefixedNodeData + "\n"; - tree += printObjectTree(value, parentPrefix + childPrefix); - } - return tree; - } - function parseFunctionName(fn) { - let fName = fn.name || ""; - fName = fName.replace("bound", "").trim(); - fName = (fName || "anonymous") + "()"; - return fName; - } - function parseMeta(meta) { - if (Array.isArray(meta)) - return meta.map((m) => parseMeta(m)); - if (typeof meta === "symbol") - return meta.toString(); - if (typeof meta === "function") - return parseFunctionName(meta); - return meta; - } - function getRouteMetaData(route, options) { - if (!options.includeMeta) - return {}; - const metaDataObject = options.buildPrettyMeta(route); - const filteredMetaData = {}; - let includeMetaKeys = options.includeMeta; - if (!Array.isArray(includeMetaKeys)) { - includeMetaKeys = Reflect.ownKeys(metaDataObject); - } - for (const metaKey of includeMetaKeys) { - if (!Object.prototype.hasOwnProperty.call(metaDataObject, metaKey)) - continue; - const serializedKey = metaKey.toString(); - const metaValue = metaDataObject[metaKey]; - if (metaValue !== void 0 && metaValue !== null) { - const serializedValue = JSON.stringify(parseMeta(metaValue)); - filteredMetaData[serializedKey] = serializedValue; - } - } - return filteredMetaData; - } - function serializeMetaData(metaData) { - let serializedMetaData = ""; - for (const [key, value] of Object.entries(metaData)) { - serializedMetaData += ` -\u2022 (${key}) ${value}`; - } - return serializedMetaData; - } - function normalizeRoute(route) { - const constraints = { ...route.opts.constraints }; - const method = constraints[httpMethodStrategy.name]; - delete constraints[httpMethodStrategy.name]; - return { ...route, method, opts: { constraints } }; - } - function serializeRoute(route) { - let serializedRoute = ` (${route.method})`; - const constraints = route.opts.constraints || {}; - if (Object.keys(constraints).length !== 0) { - serializedRoute += " " + JSON.stringify(constraints); - } - serializedRoute += serializeMetaData(route.metaData); - return serializedRoute; - } - function mergeSimilarRoutes(routes) { - return routes.reduce((mergedRoutes, route) => { - for (const nodeRoute of mergedRoutes) { - if (deepEqual(route.opts.constraints, nodeRoute.opts.constraints) && deepEqual(route.metaData, nodeRoute.metaData)) { - nodeRoute.method += ", " + route.method; - return mergedRoutes; - } - } - mergedRoutes.push(route); - return mergedRoutes; - }, []); - } - function serializeNode(node, prefix, options) { - let routes = node.routes; - if (options.method === void 0) { - routes = routes.map(normalizeRoute); - } - routes = routes.map((route) => { - route.metaData = getRouteMetaData(route, options); - return route; - }); - if (options.method === void 0) { - routes = mergeSimilarRoutes(routes); - } - return routes.map(serializeRoute).join(` -${prefix}`); - } - function buildObjectTree(node, tree, prefix, options) { - if (node.isLeafNode || options.commonPrefix !== false) { - prefix = prefix || "(empty root node)"; - tree = tree[prefix] = {}; - if (node.isLeafNode) { - tree[treeDataSymbol] = serializeNode(node, prefix, options); - } - prefix = ""; - } - if (node.staticChildren) { - for (const child of Object.values(node.staticChildren)) { - buildObjectTree(child, tree, prefix + child.prefix, options); - } - } - if (node.parametricChildren) { - for (const child of Object.values(node.parametricChildren)) { - const childPrefix = Array.from(child.nodePaths).join("|"); - buildObjectTree(child, tree, prefix + childPrefix, options); - } - } - if (node.wildcardChild) { - buildObjectTree(node.wildcardChild, tree, "*", options); - } - } - function prettyPrintTree(root, options) { - const objectTree = {}; - buildObjectTree(root, objectTree, root.prefix, options); - return printObjectTree(objectTree); - } - module2.exports = { prettyPrintTree }; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/null-object.js -var require_null_object = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/null-object.js"(exports2, module2) { - "use strict"; - var NullObject = function() { - }; - NullObject.prototype = /* @__PURE__ */ Object.create(null); - module2.exports = { - NullObject - }; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/handler-storage.js -var require_handler_storage = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/handler-storage.js"(exports2, module2) { - "use strict"; - var { NullObject } = require_null_object(); - var httpMethodStrategy = require_http_method(); - var HandlerStorage = class { - constructor() { - this.unconstrainedHandler = null; - this.constraints = []; - this.handlers = []; - this.constrainedHandlerStores = null; - } - // This is the hot path for node handler finding -- change with care! - getMatchingHandler(derivedConstraints) { - if (derivedConstraints === void 0) { - return this.unconstrainedHandler; - } - return this._getHandlerMatchingConstraints(derivedConstraints); - } - addHandler(constrainer, route) { - const params = route.params; - const constraints = route.opts.constraints || {}; - const handlerObject = { - params, - constraints, - handler: route.handler, - store: route.store || null, - _createParamsObject: this._compileCreateParamsObject(params) - }; - const constraintsNames = Object.keys(constraints); - if (constraintsNames.length === 0) { - this.unconstrainedHandler = handlerObject; - } - for (const constraint of constraintsNames) { - if (!this.constraints.includes(constraint)) { - if (constraint === "version") { - this.constraints.unshift(constraint); - } else { - this.constraints.push(constraint); - } - } - } - const isMergedTree = constraintsNames.includes(httpMethodStrategy.name); - if (!isMergedTree && this.handlers.length >= 31) { - throw new Error("find-my-way supports a maximum of 31 route handlers per node when there are constraints, limit reached"); - } - this.handlers.push(handlerObject); - this.handlers.sort((a, b) => Object.keys(a.constraints).length - Object.keys(b.constraints).length); - if (!isMergedTree) { - this._compileGetHandlerMatchingConstraints(constrainer, constraints); - } - } - _compileCreateParamsObject(params) { - const fnBody = []; - fnBody.push("const fn = function _createParamsObject (paramsArray) {"); - fnBody.push("const params = new NullObject()"); - for (let i = 0; i < params.length; i++) { - fnBody.push(`params['${params[i]}'] = paramsArray[${i}]`); - } - fnBody.push("return params"); - fnBody.push("}"); - fnBody.push("return fn"); - return new Function("NullObject", fnBody.join("\n"))(NullObject); - } - _getHandlerMatchingConstraints() { - return null; - } - // Builds a store object that maps from constraint values to a bitmap of handler indexes which pass the constraint for a value - // So for a host constraint, this might look like { "fastify.io": 0b0010, "google.ca": 0b0101 }, meaning the 3rd handler is constrainted to fastify.io, and the 2nd and 4th handlers are constrained to google.ca. - // The store's implementation comes from the strategies provided to the Router. - _buildConstraintStore(store, constraint) { - for (let i = 0; i < this.handlers.length; i++) { - const handler = this.handlers[i]; - const constraintValue = handler.constraints[constraint]; - if (constraintValue !== void 0) { - let indexes = store.get(constraintValue) || 0; - indexes |= 1 << i; - store.set(constraintValue, indexes); - } - } - } - // Builds a bitmask for a given constraint that has a bit for each handler index that is 0 when that handler *is* constrained and 1 when the handler *isnt* constrainted. This is opposite to what might be obvious, but is just for convienience when doing the bitwise operations. - _constrainedIndexBitmask(constraint) { - let mask2 = 0; - for (let i = 0; i < this.handlers.length; i++) { - const handler = this.handlers[i]; - const constraintValue = handler.constraints[constraint]; - if (constraintValue !== void 0) { - mask2 |= 1 << i; - } - } - return ~mask2; - } - // Compile a fast function to match the handlers for this node - // The function implements a general case multi-constraint matching algorithm. - // The general idea is this: we have a bunch of handlers, each with a potentially different set of constraints, and sometimes none at all. We're given a list of constraint values and we have to use the constraint-value-comparison strategies to see which handlers match the constraint values passed in. - // We do this by asking each constraint store which handler indexes match the given constraint value for each store. Trickily, the handlers that a store says match are the handlers constrained by that store, but handlers that aren't constrained at all by that store could still match just fine. So, each constraint store can only describe matches for it, and it won't have any bearing on the handlers it doesn't care about. For this reason, we have to ask each stores which handlers match and track which have been matched (or not cared about) by all of them. - // We use bitmaps to represent these lists of matches so we can use bitwise operations to implement this efficiently. Bitmaps are cheap to allocate, let us implement this masking behaviour in one CPU instruction, and are quite compact in memory. We start with a bitmap set to all 1s representing every handler that is a match candidate, and then for each constraint, see which handlers match using the store, and then mask the result by the mask of handlers that that store applies to, and bitwise AND with the candidate list. Phew. - // We consider all this compiling function complexity to be worth it, because the naive implementation that just loops over the handlers asking which stores match is quite a bit slower. - _compileGetHandlerMatchingConstraints(constrainer) { - this.constrainedHandlerStores = {}; - for (const constraint of this.constraints) { - const store = constrainer.newStoreForConstraint(constraint); - this.constrainedHandlerStores[constraint] = store; - this._buildConstraintStore(store, constraint); - } - const lines = []; - lines.push(` - let candidates = ${(1 << this.handlers.length) - 1} - let mask, matches - `); - for (const constraint of this.constraints) { - lines.push(` - mask = ${this._constrainedIndexBitmask(constraint)} - value = derivedConstraints.${constraint} - `); - const strategy = constrainer.strategies[constraint]; - const matchMask = strategy.mustMatchWhenDerived ? "matches" : "(matches | mask)"; - lines.push(` - if (value === undefined) { - candidates &= mask - } else { - matches = this.constrainedHandlerStores.${constraint}.get(value) || 0 - candidates &= ${matchMask} - } - if (candidates === 0) return null; - `); - } - for (const constraint in constrainer.strategies) { - if (!Object.hasOwn(constrainer.strategies, constraint)) - continue; - const strategy = constrainer.strategies[constraint]; - if (strategy.mustMatchWhenDerived && !this.constraints.includes(constraint)) { - lines.push(`if (derivedConstraints.${constraint} !== undefined) return null`); - } - } - lines.push("return this.handlers[Math.floor(Math.log2(candidates))]"); - this._getHandlerMatchingConstraints = new Function("derivedConstraints", lines.join("\n")); - } - }; - module2.exports = HandlerStorage; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/node.js -var require_node = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/node.js"(exports2, module2) { - "use strict"; - var HandlerStorage = require_handler_storage(); - var NODE_TYPES = { - STATIC: 0, - PARAMETRIC: 1, - WILDCARD: 2 - }; - var Node = class { - constructor() { - this.isLeafNode = false; - this.routes = null; - this.handlerStorage = null; - } - addRoute(route, constrainer) { - if (this.routes === null) { - this.routes = []; - } - if (this.handlerStorage === null) { - this.handlerStorage = new HandlerStorage(); - } - this.isLeafNode = true; - this.routes.push(route); - this.handlerStorage.addHandler(constrainer, route); - } - }; - var ParentNode = class extends Node { - constructor() { - super(); - this.staticChildren = {}; - } - findStaticMatchingChild(path2, pathIndex) { - const staticChild = this.staticChildren[path2.charAt(pathIndex)]; - if (staticChild === void 0 || !staticChild.matchPrefix(path2, pathIndex)) { - return null; - } - return staticChild; - } - getStaticChild(path2, pathIndex = 0) { - if (path2.length === pathIndex) { - return this; - } - const staticChild = this.findStaticMatchingChild(path2, pathIndex); - if (staticChild) { - return staticChild.getStaticChild(path2, pathIndex + staticChild.prefix.length); - } - return null; - } - createStaticChild(path2) { - if (path2.length === 0) { - return this; - } - let staticChild = this.staticChildren[path2.charAt(0)]; - if (staticChild) { - let i = 1; - for (; i < staticChild.prefix.length; i++) { - if (path2.charCodeAt(i) !== staticChild.prefix.charCodeAt(i)) { - staticChild = staticChild.split(this, i); - break; - } - } - return staticChild.createStaticChild(path2.slice(i)); - } - const label = path2.charAt(0); - this.staticChildren[label] = new StaticNode(path2); - return this.staticChildren[label]; - } - }; - var StaticNode = class _StaticNode extends ParentNode { - constructor(prefix) { - super(); - this.prefix = prefix; - this.wildcardChild = null; - this.parametricChildren = []; - this.kind = NODE_TYPES.STATIC; - this._compilePrefixMatch(); - } - getParametricChild(regex) { - const regexpSource = regex && regex.source; - const parametricChild = this.parametricChildren.find((child) => { - const childRegexSource = child.regex && child.regex.source; - return childRegexSource === regexpSource; - }); - if (parametricChild) { - return parametricChild; - } - return null; - } - createParametricChild(regex, staticSuffix, nodePath) { - let parametricChild = this.getParametricChild(regex); - if (parametricChild) { - parametricChild.nodePaths.add(nodePath); - return parametricChild; - } - parametricChild = new ParametricNode(regex, staticSuffix, nodePath); - this.parametricChildren.push(parametricChild); - this.parametricChildren.sort((child1, child2) => { - if (!child1.isRegex) - return 1; - if (!child2.isRegex) - return -1; - if (child1.staticSuffix === null) - return 1; - if (child2.staticSuffix === null) - return -1; - if (child2.staticSuffix.endsWith(child1.staticSuffix)) - return 1; - if (child1.staticSuffix.endsWith(child2.staticSuffix)) - return -1; - return 0; - }); - return parametricChild; - } - getWildcardChild() { - return this.wildcardChild; - } - createWildcardChild() { - this.wildcardChild = this.getWildcardChild() || new WildcardNode(); - return this.wildcardChild; - } - split(parentNode, length) { - const parentPrefix = this.prefix.slice(0, length); - const childPrefix = this.prefix.slice(length); - this.prefix = childPrefix; - this._compilePrefixMatch(); - const staticNode = new _StaticNode(parentPrefix); - staticNode.staticChildren[childPrefix.charAt(0)] = this; - parentNode.staticChildren[parentPrefix.charAt(0)] = staticNode; - return staticNode; - } - getNextNode(path2, pathIndex, nodeStack, paramsCount) { - let node = this.findStaticMatchingChild(path2, pathIndex); - let parametricBrotherNodeIndex = 0; - if (node === null) { - if (this.parametricChildren.length === 0) { - return this.wildcardChild; - } - node = this.parametricChildren[0]; - parametricBrotherNodeIndex = 1; - } - if (this.wildcardChild !== null) { - nodeStack.push({ - paramsCount, - brotherPathIndex: pathIndex, - brotherNode: this.wildcardChild - }); - } - for (let i = this.parametricChildren.length - 1; i >= parametricBrotherNodeIndex; i--) { - nodeStack.push({ - paramsCount, - brotherPathIndex: pathIndex, - brotherNode: this.parametricChildren[i] - }); - } - return node; - } - _compilePrefixMatch() { - if (this.prefix.length === 1) { - this.matchPrefix = () => true; - return; - } - const lines = []; - for (let i = 1; i < this.prefix.length; i++) { - const charCode = this.prefix.charCodeAt(i); - lines.push(`path.charCodeAt(i + ${i}) === ${charCode}`); - } - this.matchPrefix = new Function("path", "i", `return ${lines.join(" && ")}`); - } - }; - var ParametricNode = class extends ParentNode { - constructor(regex, staticSuffix, nodePath) { - super(); - this.isRegex = !!regex; - this.regex = regex || null; - this.staticSuffix = staticSuffix || null; - this.kind = NODE_TYPES.PARAMETRIC; - this.nodePaths = /* @__PURE__ */ new Set([nodePath]); - } - getNextNode(path2, pathIndex) { - return this.findStaticMatchingChild(path2, pathIndex); - } - }; - var WildcardNode = class extends Node { - constructor() { - super(); - this.kind = NODE_TYPES.WILDCARD; - } - getNextNode() { - return null; - } - }; - module2.exports = { StaticNode, ParametricNode, WildcardNode, NODE_TYPES }; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/strategies/accept-version.js -var require_accept_version = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/strategies/accept-version.js"(exports2, module2) { - "use strict"; - var assert3 = require("node:assert"); - function SemVerStore() { - if (!(this instanceof SemVerStore)) { - return new SemVerStore(); - } - this.store = /* @__PURE__ */ new Map(); - this.maxMajor = 0; - this.maxMinors = {}; - this.maxPatches = {}; - } - SemVerStore.prototype.set = function(version2, store) { - if (typeof version2 !== "string") { - throw new TypeError("Version should be a string"); - } - let [major, minor, patch] = version2.split(".", 3); - if (isNaN(major)) { - throw new TypeError("Major version must be a numeric value"); - } - major = Number(major); - minor = Number(minor) || 0; - patch = Number(patch) || 0; - if (major >= this.maxMajor) { - this.maxMajor = major; - this.store.set("x", store); - this.store.set("*", store); - this.store.set("x.x", store); - this.store.set("x.x.x", store); - } - if (minor >= (this.maxMinors[major] || 0)) { - this.maxMinors[major] = minor; - this.store.set(`${major}.x`, store); - this.store.set(`${major}.x.x`, store); - } - if (patch >= (this.maxPatches[`${major}.${minor}`] || 0)) { - this.maxPatches[`${major}.${minor}`] = patch; - this.store.set(`${major}.${minor}.x`, store); - } - this.store.set(`${major}.${minor}.${patch}`, store); - return this; - }; - SemVerStore.prototype.get = function(version2) { - return this.store.get(version2); - }; - module2.exports = { - name: "version", - mustMatchWhenDerived: true, - storage: SemVerStore, - validate(value) { - assert3(typeof value === "string", "Version should be a string"); - } - }; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/strategies/accept-host.js -var require_accept_host = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/strategies/accept-host.js"(exports2, module2) { - "use strict"; - var assert3 = require("node:assert"); - function HostStorage() { - const hosts = /* @__PURE__ */ new Map(); - const regexHosts = []; - return { - get: (host) => { - const exact = hosts.get(host); - if (exact) { - return exact; - } - for (const regex of regexHosts) { - if (regex.host.test(host)) { - return regex.value; - } - } - }, - set: (host, value) => { - if (host instanceof RegExp) { - regexHosts.push({ host, value }); - } else { - hosts.set(host, value); - } - } - }; - } - module2.exports = { - name: "host", - mustMatchWhenDerived: false, - storage: HostStorage, - validate(value) { - assert3(typeof value === "string" || Object.prototype.toString.call(value) === "[object RegExp]", "Host should be a string or a RegExp"); - } - }; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/constrainer.js -var require_constrainer = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/constrainer.js"(exports2, module2) { - "use strict"; - var acceptVersionStrategy = require_accept_version(); - var acceptHostStrategy = require_accept_host(); - var assert3 = require("node:assert"); - var Constrainer = class { - constructor(customStrategies) { - this.strategies = { - version: acceptVersionStrategy, - host: acceptHostStrategy - }; - this.strategiesInUse = /* @__PURE__ */ new Set(); - this.asyncStrategiesInUse = /* @__PURE__ */ new Set(); - if (customStrategies) { - for (const strategy of Object.values(customStrategies)) { - this.addConstraintStrategy(strategy); - } - } - } - isStrategyUsed(strategyName) { - return this.strategiesInUse.has(strategyName) || this.asyncStrategiesInUse.has(strategyName); - } - hasConstraintStrategy(strategyName) { - const customConstraintStrategy = this.strategies[strategyName]; - if (customConstraintStrategy !== void 0) { - return customConstraintStrategy.isCustom || this.isStrategyUsed(strategyName); - } - return false; - } - addConstraintStrategy(strategy) { - assert3(typeof strategy.name === "string" && strategy.name !== "", "strategy.name is required."); - assert3(strategy.storage && typeof strategy.storage === "function", "strategy.storage function is required."); - assert3(strategy.deriveConstraint && typeof strategy.deriveConstraint === "function", "strategy.deriveConstraint function is required."); - if (this.strategies[strategy.name] && this.strategies[strategy.name].isCustom) { - throw new Error(`There already exists a custom constraint with the name ${strategy.name}.`); - } - if (this.isStrategyUsed(strategy.name)) { - throw new Error(`There already exists a route with ${strategy.name} constraint.`); - } - strategy.isCustom = true; - strategy.isAsync = strategy.deriveConstraint.length === 3; - this.strategies[strategy.name] = strategy; - if (strategy.mustMatchWhenDerived) { - this.noteUsage({ [strategy.name]: strategy }); - } - } - deriveConstraints(req, ctx, done) { - const constraints = this.deriveSyncConstraints(req, ctx); - if (done === void 0) { - return constraints; - } - this.deriveAsyncConstraints(constraints, req, ctx, done); - } - deriveSyncConstraints(req, ctx) { - return void 0; - } - // When new constraints start getting used, we need to rebuild the deriver to derive them. Do so if we see novel constraints used. - noteUsage(constraints) { - if (constraints) { - const beforeSize = this.strategiesInUse.size; - for (const key in constraints) { - if (!Object.hasOwn(constraints, key)) - continue; - const strategy = this.strategies[key]; - if (strategy.isAsync) { - this.asyncStrategiesInUse.add(key); - } else { - this.strategiesInUse.add(key); - } - } - if (beforeSize !== this.strategiesInUse.size) { - this._buildDeriveConstraints(); - } - } - } - newStoreForConstraint(constraint) { - if (!this.strategies[constraint]) { - throw new Error(`No strategy registered for constraint key ${constraint}`); - } - return this.strategies[constraint].storage(); - } - validateConstraints(constraints) { - for (const key in constraints) { - if (!Object.hasOwn(constraints, key)) - continue; - const value = constraints[key]; - if (typeof value === "undefined") { - throw new Error("Can't pass an undefined constraint value, must pass null or no key at all"); - } - const strategy = this.strategies[key]; - if (!strategy) { - throw new Error(`No strategy registered for constraint key ${key}`); - } - if (strategy.validate) { - strategy.validate(value); - } - } - } - deriveAsyncConstraints(constraints, req, ctx, done) { - let asyncConstraintsCount = this.asyncStrategiesInUse.size; - if (asyncConstraintsCount === 0) { - done(null, constraints); - return; - } - constraints = constraints || {}; - for (const key of this.asyncStrategiesInUse) { - const strategy = this.strategies[key]; - strategy.deriveConstraint(req, ctx, (err, constraintValue) => { - if (err !== null) { - done(err); - return; - } - constraints[key] = constraintValue; - if (--asyncConstraintsCount === 0) { - done(null, constraints); - } - }); - } - } - // Optimization: build a fast function for deriving the constraints for all the strategies at once. We inline the definitions of the version constraint and the host constraint for performance. - // If no constraining strategies are in use (no routes constrain on host, or version, or any custom strategies) then we don't need to derive constraints for each route match, so don't do anything special, and just return undefined - // This allows us to not allocate an object to hold constraint values if no constraints are defined. - _buildDeriveConstraints() { - if (this.strategiesInUse.size === 0) - return; - const lines = ["return {"]; - for (const key of this.strategiesInUse) { - const strategy = this.strategies[key]; - if (!strategy.isCustom) { - if (key === "version") { - lines.push(" version: req.headers['accept-version'],"); - } else { - lines.push(" host: req.headers.host || req.headers[':authority'],"); - } - } else { - lines.push(` ${strategy.name}: this.strategies.${key}.deriveConstraint(req, ctx),`); - } - } - lines.push("}"); - this.deriveSyncConstraints = new Function("req", "ctx", lines.join("\n")).bind(this); - } - }; - module2.exports = Constrainer; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/http-methods.js -var require_http_methods = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/http-methods.js"(exports2, module2) { - "use strict"; - var httpMethods = [ - "ACL", - "BIND", - "CHECKOUT", - "CONNECT", - "COPY", - "DELETE", - "GET", - "HEAD", - "LINK", - "LOCK", - "M-SEARCH", - "MERGE", - "MKACTIVITY", - "MKCALENDAR", - "MKCOL", - "MOVE", - "NOTIFY", - "OPTIONS", - "PATCH", - "POST", - "PROPFIND", - "PROPPATCH", - "PURGE", - "PUT", - "QUERY", - "REBIND", - "REPORT", - "SEARCH", - "SOURCE", - "SUBSCRIBE", - "TRACE", - "UNBIND", - "UNLINK", - "UNLOCK", - "UNSUBSCRIBE" - ]; - module2.exports = httpMethods; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/url-sanitizer.js -var require_url_sanitizer = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/lib/url-sanitizer.js"(exports2, module2) { - "use strict"; - function decodeComponentChar(highCharCode, lowCharCode) { - if (highCharCode === 50) { - if (lowCharCode === 53) - return "%"; - if (lowCharCode === 51) - return "#"; - if (lowCharCode === 52) - return "$"; - if (lowCharCode === 54) - return "&"; - if (lowCharCode === 66) - return "+"; - if (lowCharCode === 98) - return "+"; - if (lowCharCode === 67) - return ","; - if (lowCharCode === 99) - return ","; - if (lowCharCode === 70) - return "/"; - if (lowCharCode === 102) - return "/"; - return null; - } - if (highCharCode === 51) { - if (lowCharCode === 65) - return ":"; - if (lowCharCode === 97) - return ":"; - if (lowCharCode === 66) - return ";"; - if (lowCharCode === 98) - return ";"; - if (lowCharCode === 68) - return "="; - if (lowCharCode === 100) - return "="; - if (lowCharCode === 70) - return "?"; - if (lowCharCode === 102) - return "?"; - return null; - } - if (highCharCode === 52 && lowCharCode === 48) { - return "@"; - } - return null; - } - function safeDecodeURI(path2, useSemicolonDelimiter) { - let shouldDecode = false; - let shouldDecodeParam = false; - let querystring = ""; - for (let i = 1; i < path2.length; i++) { - const charCode = path2.charCodeAt(i); - if (charCode === 37) { - const highCharCode = path2.charCodeAt(i + 1); - const lowCharCode = path2.charCodeAt(i + 2); - if (decodeComponentChar(highCharCode, lowCharCode) === null) { - shouldDecode = true; - } else { - shouldDecodeParam = true; - if (highCharCode === 50 && lowCharCode === 53) { - shouldDecode = true; - path2 = path2.slice(0, i + 1) + "25" + path2.slice(i + 1); - i += 2; - } - i += 2; - } - } else if (charCode === 63 || charCode === 35 || charCode === 59 && useSemicolonDelimiter) { - querystring = path2.slice(i + 1); - path2 = path2.slice(0, i); - break; - } - } - const decodedPath = shouldDecode ? decodeURI(path2) : path2; - return { path: decodedPath, querystring, shouldDecodeParam }; - } - function safeDecodeURIComponent(uriComponent) { - const startIndex = uriComponent.indexOf("%"); - if (startIndex === -1) - return uriComponent; - let decoded = ""; - let lastIndex = startIndex; - for (let i = startIndex; i < uriComponent.length; i++) { - if (uriComponent.charCodeAt(i) === 37) { - const highCharCode = uriComponent.charCodeAt(i + 1); - const lowCharCode = uriComponent.charCodeAt(i + 2); - const decodedChar = decodeComponentChar(highCharCode, lowCharCode); - decoded += uriComponent.slice(lastIndex, i) + decodedChar; - lastIndex = i + 3; - } - } - return uriComponent.slice(0, startIndex) + decoded + uriComponent.slice(lastIndex); - } - module2.exports = { safeDecodeURI, safeDecodeURIComponent }; - } -}); - -// ../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/index.js -var require_find_my_way = __commonJS({ - "../../node_modules/.pnpm/find-my-way@9.5.0/node_modules/find-my-way/index.js"(exports2, module2) { - "use strict"; - var assert3 = require("node:assert"); - var querystring = require_lib(); - var isRegexSafe = require_safe_regex2(); - var deepEqual = require_fast_deep_equal(); - var { prettyPrintTree } = require_pretty_print(); - var { StaticNode, NODE_TYPES } = require_node(); - var Constrainer = require_constrainer(); - var httpMethods = require_http_methods(); - var httpMethodStrategy = require_http_method(); - var { safeDecodeURI, safeDecodeURIComponent } = require_url_sanitizer(); - var FULL_PATH_REGEXP = /^https?:\/\/.*?\//; - var OPTIONAL_PARAM_REGEXP = /(\/:[^/()]*?)\?(\/?)/; - var ESCAPE_REGEXP = /[.*+?^${}()|[\]\\]/g; - var REMOVE_DUPLICATE_SLASHES_REGEXP = /\/\/+/g; - if (!isRegexSafe(FULL_PATH_REGEXP)) { - throw new Error("the FULL_PATH_REGEXP is not safe, update this module"); - } - if (!isRegexSafe(OPTIONAL_PARAM_REGEXP)) { - throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module"); - } - if (!isRegexSafe(ESCAPE_REGEXP)) { - throw new Error("the ESCAPE_REGEXP is not safe, update this module"); - } - if (!isRegexSafe(REMOVE_DUPLICATE_SLASHES_REGEXP)) { - throw new Error("the REMOVE_DUPLICATE_SLASHES_REGEXP is not safe, update this module"); - } - function Router(opts) { - if (!(this instanceof Router)) { - return new Router(opts); - } - opts = opts || {}; - this._opts = opts; - if (opts.defaultRoute) { - assert3(typeof opts.defaultRoute === "function", "The default route must be a function"); - this.defaultRoute = opts.defaultRoute; - } else { - this.defaultRoute = null; - } - if (opts.onBadUrl) { - assert3(typeof opts.onBadUrl === "function", "The bad url handler must be a function"); - this.onBadUrl = opts.onBadUrl; - } else { - this.onBadUrl = null; - } - if (opts.buildPrettyMeta) { - assert3(typeof opts.buildPrettyMeta === "function", "buildPrettyMeta must be a function"); - this.buildPrettyMeta = opts.buildPrettyMeta; - } else { - this.buildPrettyMeta = defaultBuildPrettyMeta; - } - if (opts.querystringParser) { - assert3(typeof opts.querystringParser === "function", "querystringParser must be a function"); - this.querystringParser = opts.querystringParser; - } else { - this.querystringParser = (query) => query.length === 0 ? {} : querystring.parse(query); - } - this.caseSensitive = opts.caseSensitive === void 0 ? true : opts.caseSensitive; - this.ignoreTrailingSlash = opts.ignoreTrailingSlash || false; - this.ignoreDuplicateSlashes = opts.ignoreDuplicateSlashes || false; - this.maxParamLength = opts.maxParamLength || 100; - this.allowUnsafeRegex = opts.allowUnsafeRegex || false; - this.constrainer = new Constrainer(opts.constraints); - this.useSemicolonDelimiter = opts.useSemicolonDelimiter || false; - this.routes = []; - this.trees = {}; - } - Router.prototype.on = function on(method, path2, opts, handler, store) { - if (typeof opts === "function") { - if (handler !== void 0) { - store = handler; - } - handler = opts; - opts = {}; - } - assert3(typeof path2 === "string", "Path should be a string"); - assert3(path2.length > 0, "The path could not be empty"); - assert3(path2[0] === "/" || path2[0] === "*", "The first character of a path should be `/` or `*`"); - assert3(typeof handler === "function", "Handler should be a function"); - const optionalParamMatch = path2.match(OPTIONAL_PARAM_REGEXP); - if (optionalParamMatch) { - assert3(path2.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path"); - const pathFull = path2.replace(OPTIONAL_PARAM_REGEXP, "$1$2"); - const pathOptional = path2.replace(OPTIONAL_PARAM_REGEXP, "$2") || "/"; - this.on(method, pathFull, opts, handler, store); - this.on(method, pathOptional, opts, handler, store); - return; - } - const route = path2; - if (this.ignoreDuplicateSlashes) { - path2 = removeDuplicateSlashes(path2); - } - if (this.ignoreTrailingSlash) { - path2 = trimLastSlash(path2); - } - const methods = Array.isArray(method) ? method : [method]; - for (const method2 of methods) { - assert3(typeof method2 === "string", "Method should be a string"); - assert3(httpMethods.includes(method2), `Method '${method2}' is not an http method.`); - this._on(method2, path2, opts, handler, store, route); - } - }; - Router.prototype._on = function _on(method, path2, opts, handler, store) { - let constraints = {}; - if (opts.constraints !== void 0) { - assert3(typeof opts.constraints === "object" && opts.constraints !== null, "Constraints should be an object"); - if (Object.keys(opts.constraints).length !== 0) { - constraints = opts.constraints; - } - } - this.constrainer.validateConstraints(constraints); - this.constrainer.noteUsage(constraints); - if (this.trees[method] === void 0) { - this.trees[method] = new StaticNode("/"); - } - let pattern = path2; - if (pattern === "*" && this.trees[method].prefix.length !== 0) { - const currentRoot = this.trees[method]; - this.trees[method] = new StaticNode(""); - this.trees[method].staticChildren["/"] = currentRoot; - } - let currentNode = this.trees[method]; - let parentNodePathIndex = currentNode.prefix.length; - const params = []; - for (let i = 0; i <= pattern.length; i++) { - if (pattern.charCodeAt(i) === 58 && pattern.charCodeAt(i + 1) === 58) { - i++; - continue; - } - const isParametricNode = pattern.charCodeAt(i) === 58 && pattern.charCodeAt(i + 1) !== 58; - const isWildcardNode = pattern.charCodeAt(i) === 42; - if (isParametricNode || isWildcardNode || i === pattern.length && i !== parentNodePathIndex) { - let staticNodePath = pattern.slice(parentNodePathIndex, i); - if (!this.caseSensitive) { - staticNodePath = staticNodePath.toLowerCase(); - } - staticNodePath = staticNodePath.replaceAll("::", ":"); - staticNodePath = staticNodePath.replaceAll("%", "%25"); - currentNode = currentNode.createStaticChild(staticNodePath); - } - if (isParametricNode) { - let isRegexNode = false; - let isParamSafe = true; - let backtrack = ""; - const regexps = []; - let lastParamStartIndex = i + 1; - for (let j = lastParamStartIndex; ; j++) { - const charCode = pattern.charCodeAt(j); - const isRegexParam = charCode === 40; - const isStaticPart = charCode === 45 || charCode === 46; - const isEndOfNode = charCode === 47 || j === pattern.length; - if (isRegexParam || isStaticPart || isEndOfNode) { - const paramName = pattern.slice(lastParamStartIndex, j); - params.push(paramName); - isRegexNode = isRegexNode || isRegexParam || isStaticPart; - if (isRegexParam) { - const endOfRegexIndex = getClosingParenthensePosition(pattern, j); - const regexString = pattern.slice(j, endOfRegexIndex + 1); - if (!this.allowUnsafeRegex) { - assert3(isRegexSafe(new RegExp(regexString)), `The regex '${regexString}' is not safe!`); - } - regexps.push(trimRegExpStartAndEnd(regexString)); - j = endOfRegexIndex + 1; - isParamSafe = true; - } else { - regexps.push(isParamSafe ? "(.*?)" : `(${backtrack}|(?:(?!${backtrack}).)*)`); - isParamSafe = false; - } - const staticPartStartIndex = j; - for (; j < pattern.length; j++) { - const charCode2 = pattern.charCodeAt(j); - if (charCode2 === 47) - break; - if (charCode2 === 58) { - const nextCharCode = pattern.charCodeAt(j + 1); - if (nextCharCode === 58) - j++; - else - break; - } - } - let staticPart = pattern.slice(staticPartStartIndex, j); - if (staticPart) { - staticPart = staticPart.replaceAll("::", ":"); - staticPart = staticPart.replaceAll("%", "%25"); - regexps.push(backtrack = escapeRegExp(staticPart)); - } - lastParamStartIndex = j + 1; - if (isEndOfNode || pattern.charCodeAt(j) === 47 || j === pattern.length) { - const nodePattern = isRegexNode ? "()" + staticPart : staticPart; - const nodePath = pattern.slice(i, j); - pattern = pattern.slice(0, i + 1) + nodePattern + pattern.slice(j); - i += nodePattern.length; - const regex = isRegexNode ? new RegExp("^" + regexps.join("") + "$") : null; - currentNode = currentNode.createParametricChild(regex, staticPart || null, nodePath); - parentNodePathIndex = i + 1; - break; - } - } - } - } else if (isWildcardNode) { - params.push("*"); - currentNode = currentNode.createWildcardChild(); - parentNodePathIndex = i + 1; - if (i !== pattern.length - 1) { - throw new Error("Wildcard must be the last character in the route"); - } - } - } - if (!this.caseSensitive) { - pattern = pattern.toLowerCase(); - } - if (pattern === "*") { - pattern = "/*"; - } - for (const existRoute of this.routes) { - const routeConstraints = existRoute.opts.constraints || {}; - if (existRoute.method === method && existRoute.pattern === pattern && deepEqual(routeConstraints, constraints)) { - throw new Error(`Method '${method}' already declared for route '${pattern}' with constraints '${JSON.stringify(constraints)}'`); - } - } - const route = { method, path: path2, pattern, params, opts, handler, store }; - this.routes.push(route); - currentNode.addRoute(route, this.constrainer); - }; - Router.prototype.hasRoute = function hasRoute(method, path2, constraints) { - const route = this.findRoute(method, path2, constraints); - return route !== null; - }; - Router.prototype.findRoute = function findNode(method, path2, constraints = {}) { - if (this.trees[method] === void 0) { - return null; - } - let pattern = path2; - let currentNode = this.trees[method]; - let parentNodePathIndex = currentNode.prefix.length; - const params = []; - for (let i = 0; i <= pattern.length; i++) { - if (pattern.charCodeAt(i) === 58 && pattern.charCodeAt(i + 1) === 58) { - i++; - continue; - } - const isParametricNode = pattern.charCodeAt(i) === 58 && pattern.charCodeAt(i + 1) !== 58; - const isWildcardNode = pattern.charCodeAt(i) === 42; - if (isParametricNode || isWildcardNode || i === pattern.length && i !== parentNodePathIndex) { - let staticNodePath = pattern.slice(parentNodePathIndex, i); - if (!this.caseSensitive) { - staticNodePath = staticNodePath.toLowerCase(); - } - staticNodePath = staticNodePath.replaceAll("::", ":"); - staticNodePath = staticNodePath.replaceAll("%", "%25"); - currentNode = currentNode.getStaticChild(staticNodePath); - if (currentNode === null) { - return null; - } - } - if (isParametricNode) { - let isRegexNode = false; - let isParamSafe = true; - let backtrack = ""; - const regexps = []; - let lastParamStartIndex = i + 1; - for (let j = lastParamStartIndex; ; j++) { - const charCode = pattern.charCodeAt(j); - const isRegexParam = charCode === 40; - const isStaticPart = charCode === 45 || charCode === 46; - const isEndOfNode = charCode === 47 || j === pattern.length; - if (isRegexParam || isStaticPart || isEndOfNode) { - const paramName = pattern.slice(lastParamStartIndex, j); - params.push(paramName); - isRegexNode = isRegexNode || isRegexParam || isStaticPart; - if (isRegexParam) { - const endOfRegexIndex = getClosingParenthensePosition(pattern, j); - const regexString = pattern.slice(j, endOfRegexIndex + 1); - if (!this.allowUnsafeRegex) { - assert3(isRegexSafe(new RegExp(regexString)), `The regex '${regexString}' is not safe!`); - } - regexps.push(trimRegExpStartAndEnd(regexString)); - j = endOfRegexIndex + 1; - isParamSafe = false; - } else { - regexps.push(isParamSafe ? "(.*?)" : `(${backtrack}|(?:(?!${backtrack}).)*)`); - isParamSafe = false; - } - const staticPartStartIndex = j; - for (; j < pattern.length; j++) { - const charCode2 = pattern.charCodeAt(j); - if (charCode2 === 47) - break; - if (charCode2 === 58) { - const nextCharCode = pattern.charCodeAt(j + 1); - if (nextCharCode === 58) - j++; - else - break; - } - } - let staticPart = pattern.slice(staticPartStartIndex, j); - if (staticPart) { - staticPart = staticPart.replaceAll("::", ":"); - staticPart = staticPart.replaceAll("%", "%25"); - regexps.push(backtrack = escapeRegExp(staticPart)); - } - lastParamStartIndex = j + 1; - if (isEndOfNode || pattern.charCodeAt(j) === 47 || j === pattern.length) { - const nodePattern = isRegexNode ? "()" + staticPart : staticPart; - const nodePath = pattern.slice(i, j); - pattern = pattern.slice(0, i + 1) + nodePattern + pattern.slice(j); - i += nodePattern.length; - const regex = isRegexNode ? new RegExp("^" + regexps.join("") + "$") : null; - currentNode = currentNode.getParametricChild(regex, staticPart || null, nodePath); - if (currentNode === null) { - return null; - } - parentNodePathIndex = i + 1; - break; - } - } - } - } else if (isWildcardNode) { - params.push("*"); - currentNode = currentNode.getWildcardChild(); - parentNodePathIndex = i + 1; - if (i !== pattern.length - 1) { - throw new Error("Wildcard must be the last character in the route"); - } - } - } - if (!this.caseSensitive) { - pattern = pattern.toLowerCase(); - } - for (const existRoute of this.routes) { - const routeConstraints = existRoute.opts.constraints || {}; - if (existRoute.method === method && existRoute.pattern === pattern && deepEqual(routeConstraints, constraints)) { - return { - handler: existRoute.handler, - store: existRoute.store, - params: existRoute.params - }; - } - } - return null; - }; - Router.prototype.hasConstraintStrategy = function(strategyName) { - return this.constrainer.hasConstraintStrategy(strategyName); - }; - Router.prototype.addConstraintStrategy = function(constraints) { - this.constrainer.addConstraintStrategy(constraints); - this._rebuild(this.routes); - }; - Router.prototype.reset = function reset() { - this.trees = {}; - this.routes = []; - }; - Router.prototype.off = function off(method, path2, constraints) { - assert3(typeof path2 === "string", "Path should be a string"); - assert3(path2.length > 0, "The path could not be empty"); - assert3(path2[0] === "/" || path2[0] === "*", "The first character of a path should be `/` or `*`"); - assert3( - typeof constraints === "undefined" || typeof constraints === "object" && !Array.isArray(constraints) && constraints !== null, - "Constraints should be an object or undefined." - ); - const optionalParamMatch = path2.match(OPTIONAL_PARAM_REGEXP); - if (optionalParamMatch) { - assert3(path2.length === optionalParamMatch.index + optionalParamMatch[0].length, "Optional Parameter needs to be the last parameter of the path"); - const pathFull = path2.replace(OPTIONAL_PARAM_REGEXP, "$1$2"); - const pathOptional = path2.replace(OPTIONAL_PARAM_REGEXP, "$2"); - this.off(method, pathFull, constraints); - this.off(method, pathOptional, constraints); - return; - } - if (this.ignoreDuplicateSlashes) { - path2 = removeDuplicateSlashes(path2); - } - if (this.ignoreTrailingSlash) { - path2 = trimLastSlash(path2); - } - const methods = Array.isArray(method) ? method : [method]; - for (const method2 of methods) { - this._off(method2, path2, constraints); - } - }; - Router.prototype._off = function _off(method, path2, constraints) { - assert3(typeof method === "string", "Method should be a string"); - assert3(httpMethods.includes(method), `Method '${method}' is not an http method.`); - function matcherWithoutConstraints(route) { - return method !== route.method || path2 !== route.path; - } - function matcherWithConstraints(route) { - return matcherWithoutConstraints(route) || !deepEqual(constraints, route.opts.constraints || {}); - } - const predicate = constraints ? matcherWithConstraints : matcherWithoutConstraints; - const newRoutes = this.routes.filter(predicate); - this._rebuild(newRoutes); - }; - Router.prototype.lookup = function lookup(req, res, ctx, done) { - if (typeof ctx === "function") { - done = ctx; - ctx = void 0; - } - if (done === void 0) { - const constraints = this.constrainer.deriveConstraints(req, ctx); - const handle = this.find(req.method, req.url, constraints); - return this.callHandler(handle, req, res, ctx); - } - this.constrainer.deriveConstraints(req, ctx, (err, constraints) => { - if (err !== null) { - done(err); - return; - } - try { - const handle = this.find(req.method, req.url, constraints); - const result = this.callHandler(handle, req, res, ctx); - done(null, result); - } catch (err2) { - done(err2); - } - }); - }; - Router.prototype.callHandler = function callHandler(handle, req, res, ctx) { - if (handle === null) - return this._defaultRoute(req, res, ctx); - return ctx === void 0 ? handle.handler(req, res, handle.params, handle.store, handle.searchParams) : handle.handler.call(ctx, req, res, handle.params, handle.store, handle.searchParams); - }; - Router.prototype.find = function find2(method, path2, derivedConstraints) { - let currentNode = this.trees[method]; - if (currentNode === void 0) - return null; - if (path2.charCodeAt(0) !== 47) { - path2 = path2.replace(FULL_PATH_REGEXP, "/"); - } - if (this.ignoreDuplicateSlashes) { - path2 = removeDuplicateSlashes(path2); - } - let sanitizedUrl; - let querystring2; - let shouldDecodeParam; - try { - sanitizedUrl = safeDecodeURI(path2, this.useSemicolonDelimiter); - path2 = sanitizedUrl.path; - querystring2 = sanitizedUrl.querystring; - shouldDecodeParam = sanitizedUrl.shouldDecodeParam; - } catch (error) { - return this._onBadUrl(path2); - } - if (this.ignoreTrailingSlash) { - path2 = trimLastSlash(path2); - } - const originPath = path2; - if (this.caseSensitive === false) { - path2 = path2.toLowerCase(); - } - const maxParamLength = this.maxParamLength; - let pathIndex = currentNode.prefix.length; - const params = []; - const pathLen = path2.length; - const brothersNodesStack = []; - while (true) { - if (pathIndex === pathLen && currentNode.isLeafNode) { - const handle = currentNode.handlerStorage.getMatchingHandler(derivedConstraints); - if (handle !== null) { - return { - handler: handle.handler, - store: handle.store, - params: handle._createParamsObject(params), - searchParams: this.querystringParser(querystring2) - }; - } - } - let node = currentNode.getNextNode(path2, pathIndex, brothersNodesStack, params.length); - if (node === null) { - if (brothersNodesStack.length === 0) { - return null; - } - const brotherNodeState = brothersNodesStack.pop(); - pathIndex = brotherNodeState.brotherPathIndex; - params.splice(brotherNodeState.paramsCount); - node = brotherNodeState.brotherNode; - } - currentNode = node; - if (currentNode.kind === NODE_TYPES.STATIC) { - pathIndex += currentNode.prefix.length; - continue; - } - if (currentNode.kind === NODE_TYPES.WILDCARD) { - let param2 = originPath.slice(pathIndex); - if (shouldDecodeParam) { - param2 = safeDecodeURIComponent(param2); - } - params.push(param2); - pathIndex = pathLen; - continue; - } - let paramEndIndex = originPath.indexOf("/", pathIndex); - if (paramEndIndex === -1) { - paramEndIndex = pathLen; - } - let param = originPath.slice(pathIndex, paramEndIndex); - if (shouldDecodeParam) { - param = safeDecodeURIComponent(param); - } - if (currentNode.isRegex) { - const matchedParameters = currentNode.regex.exec(param); - if (matchedParameters === null) - continue; - for (let i = 1; i < matchedParameters.length; i++) { - const matchedParam = matchedParameters[i]; - if (matchedParam.length > maxParamLength) { - return null; - } - params.push(matchedParam); - } - } else { - if (param.length > maxParamLength) { - return null; - } - params.push(param); - } - pathIndex = paramEndIndex; - } - }; - Router.prototype._rebuild = function(routes) { - this.reset(); - for (const route of routes) { - const { method, path: path2, opts, handler, store } = route; - this._on(method, path2, opts, handler, store); - } - }; - Router.prototype._defaultRoute = function(req, res, ctx) { - if (this.defaultRoute !== null) { - return ctx === void 0 ? this.defaultRoute(req, res) : this.defaultRoute.call(ctx, req, res); - } else { - res.statusCode = 404; - res.end(); - } - }; - Router.prototype._onBadUrl = function(path2) { - if (this.onBadUrl === null) { - return null; - } - const onBadUrl = this.onBadUrl; - return { - handler: (req, res, ctx) => onBadUrl(path2, req, res), - params: {}, - store: null - }; - }; - Router.prototype.prettyPrint = function(options = {}) { - const method = options.method; - options.buildPrettyMeta = this.buildPrettyMeta.bind(this); - let tree = null; - if (method === void 0) { - const { version: version2, host, ...constraints } = this.constrainer.strategies; - constraints[httpMethodStrategy.name] = httpMethodStrategy; - const mergedRouter = new Router({ ...this._opts, constraints }); - const mergedRoutes = this.routes.map((route) => { - const constraints2 = { - ...route.opts.constraints, - [httpMethodStrategy.name]: route.method - }; - return { ...route, method: "MERGED", opts: { constraints: constraints2 } }; - }); - mergedRouter._rebuild(mergedRoutes); - tree = mergedRouter.trees.MERGED; - } else { - tree = this.trees[method]; - } - if (tree == null) - return "(empty tree)"; - return prettyPrintTree(tree, options); - }; - for (const i in httpMethods) { - if (!httpMethods.hasOwnProperty(i)) - continue; - const m = httpMethods[i]; - const methodName = m.toLowerCase(); - Router.prototype[methodName] = function(path2, handler, store) { - return this.on(m, path2, handler, store); - }; - } - Router.prototype.all = function(path2, handler, store) { - this.on(httpMethods, path2, handler, store); - }; - Router.sanitizeUrlPath = function sanitizeUrlPath(url, useSemicolonDelimiter) { - const decoded = safeDecodeURI(url, useSemicolonDelimiter); - if (decoded.shouldDecodeParam) { - return safeDecodeURIComponent(decoded.path); - } - return decoded.path; - }; - Router.removeDuplicateSlashes = removeDuplicateSlashes; - Router.trimLastSlash = trimLastSlash; - module2.exports = Router; - function escapeRegExp(string2) { - return string2.replace(ESCAPE_REGEXP, "\\$&"); - } - function removeDuplicateSlashes(path2) { - return path2.indexOf("//") !== -1 ? path2.replace(REMOVE_DUPLICATE_SLASHES_REGEXP, "/") : path2; - } - function trimLastSlash(path2) { - if (path2.length > 1 && path2.charCodeAt(path2.length - 1) === 47) { - return path2.slice(0, -1); - } - return path2; - } - function trimRegExpStartAndEnd(regexString) { - if (regexString.charCodeAt(1) === 94) { - regexString = regexString.slice(0, 1) + regexString.slice(2); - } - if (regexString.charCodeAt(regexString.length - 2) === 36) { - regexString = regexString.slice(0, regexString.length - 2) + regexString.slice(regexString.length - 1); - } - return regexString; - } - function getClosingParenthensePosition(path2, idx) { - let parentheses = 1; - while (idx < path2.length) { - idx++; - if (path2.charCodeAt(idx) === 92) { - idx++; - continue; - } - if (path2.charCodeAt(idx) === 41) { - parentheses--; - } else if (path2.charCodeAt(idx) === 40) { - parentheses++; - } - if (!parentheses) - return idx; - } - throw new TypeError('Invalid regexp expression in "' + path2 + '"'); - } - function defaultBuildPrettyMeta(route) { - if (!route) - return {}; - if (!route.store) - return {}; - return Object.assign({}, route.store); - } - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/head-route.js -var require_head_route = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/head-route.js"(exports2, module2) { - "use strict"; - function headRouteOnSendHandler(req, reply, payload, done) { - if (payload === void 0) { - reply.header("content-length", "0"); - done(null, null); - return; - } - if (typeof payload.resume === "function") { - payload.on("error", (err) => { - reply.log.error({ err }, "Error on Stream found for HEAD route"); - }); - payload.resume(); - done(null, null); - return; - } - if (typeof payload.getReader === "function") { - payload.cancel("Stream cancelled by HEAD route").catch((err) => { - reply.log.error({ err }, "Error on Stream found for HEAD route"); - }); - done(null, null); - return; - } - const size = "" + Buffer.byteLength(payload); - reply.header("content-length", size); - done(null, null); - } - function parseHeadOnSendHandlers(onSendHandlers) { - if (onSendHandlers == null) - return headRouteOnSendHandler; - return Array.isArray(onSendHandlers) ? [...onSendHandlers, headRouteOnSendHandler] : [onSendHandlers, headRouteOnSendHandler]; - } - module2.exports = { - parseHeadOnSendHandlers - }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/route.js -var require_route = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/route.js"(exports2, module2) { - "use strict"; - var FindMyWay = require_find_my_way(); - var Context = require_context(); - var handleRequest = require_handle_request(); - var { onRequestAbortHookRunner, lifecycleHooks, preParsingHookRunner, onTimeoutHookRunner, onRequestHookRunner } = require_hooks(); - var { normalizeSchema } = require_schemas(); - var { parseHeadOnSendHandlers } = require_head_route(); - var { - compileSchemasForValidation, - compileSchemasForSerialization - } = require_validation(); - var { - FST_ERR_SCH_VALIDATION_BUILD, - FST_ERR_SCH_SERIALIZATION_BUILD, - FST_ERR_DUPLICATED_ROUTE, - FST_ERR_INVALID_URL, - FST_ERR_HOOK_INVALID_HANDLER, - FST_ERR_ROUTE_OPTIONS_NOT_OBJ, - FST_ERR_ROUTE_DUPLICATED_HANDLER, - FST_ERR_ROUTE_HANDLER_NOT_FN, - FST_ERR_ROUTE_MISSING_HANDLER, - FST_ERR_ROUTE_METHOD_NOT_SUPPORTED, - FST_ERR_ROUTE_METHOD_INVALID, - FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED, - FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT, - FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT, - FST_ERR_HANDLER_TIMEOUT, - FST_ERR_HOOK_INVALID_ASYNC_HANDLER - } = require_errors2(); - var { - kRoutePrefix, - kSupportedHTTPMethods, - kLogLevel, - kLogSerializers, - kHooks, - kSchemaController, - kOptions, - kReplySerializerDefault, - kReplyIsError, - kRequestPayloadStream, - kDisableRequestLogging, - kSchemaErrorFormatter, - kErrorHandler, - kHasBeenDecorated, - kRequestAcceptVersion, - kRouteByFastify, - kRouteContext, - kRequestSignal, - kTimeoutTimer, - kOnAbort - } = require_symbols2(); - var { buildErrorHandler } = require_error_handler(); - var { createChildLogger } = require_logger_factory(); - var { getGenReqId } = require_req_id_gen_factory(); - var { FSTDEP022 } = require_warnings(); - var routerKeys = [ - "allowUnsafeRegex", - "buildPrettyMeta", - "caseSensitive", - "constraints", - "defaultRoute", - "ignoreDuplicateSlashes", - "ignoreTrailingSlash", - "maxParamLength", - "onBadUrl", - "querystringParser", - "useSemicolonDelimiter" - ]; - function buildRouting(options) { - const router = FindMyWay(options); - let avvio; - let fourOhFour; - let logger; - let hasLogger; - let setupResponseListeners; - let throwIfAlreadyStarted; - let disableRequestLogging; - let disableRequestLoggingFn; - let ignoreTrailingSlash; - let ignoreDuplicateSlashes; - let return503OnClosing; - let globalExposeHeadRoutes; - let keepAliveConnections; - let closing = false; - return { - /** - * @param {import('../fastify').FastifyServerOptions} options - * @param {*} fastifyArgs - */ - setup(options2, fastifyArgs) { - avvio = fastifyArgs.avvio; - fourOhFour = fastifyArgs.fourOhFour; - logger = options2.logger; - hasLogger = fastifyArgs.hasLogger; - setupResponseListeners = fastifyArgs.setupResponseListeners; - throwIfAlreadyStarted = fastifyArgs.throwIfAlreadyStarted; - globalExposeHeadRoutes = options2.exposeHeadRoutes; - disableRequestLogging = options2.disableRequestLogging; - if (typeof disableRequestLogging === "function") { - disableRequestLoggingFn = options2.disableRequestLogging; - } - ignoreTrailingSlash = options2.routerOptions.ignoreTrailingSlash; - ignoreDuplicateSlashes = options2.routerOptions.ignoreDuplicateSlashes; - return503OnClosing = Object.hasOwn(options2, "return503OnClosing") ? options2.return503OnClosing : true; - keepAliveConnections = fastifyArgs.keepAliveConnections; - }, - routing: router.lookup.bind(router), - // router func to find the right handler to call - route, - // configure a route in the fastify instance - hasRoute, - prepareRoute, - routeHandler, - closeRoutes: () => { - closing = true; - }, - printRoutes: router.prettyPrint.bind(router), - addConstraintStrategy, - hasConstraintStrategy, - isAsyncConstraint, - findRoute - }; - function addConstraintStrategy(strategy) { - throwIfAlreadyStarted("Cannot add constraint strategy!"); - return router.addConstraintStrategy(strategy); - } - function hasConstraintStrategy(strategyName) { - return router.hasConstraintStrategy(strategyName); - } - function isAsyncConstraint() { - return router.constrainer.asyncStrategiesInUse.size > 0; - } - function prepareRoute({ method, url, options: options2, handler, isFastify }) { - if (typeof url !== "string") { - throw new FST_ERR_INVALID_URL(typeof url); - } - if (!handler && typeof options2 === "function") { - handler = options2; - options2 = {}; - } else if (handler && typeof handler === "function") { - if (Object.prototype.toString.call(options2) !== "[object Object]") { - throw new FST_ERR_ROUTE_OPTIONS_NOT_OBJ(method, url); - } else if (options2.handler) { - if (typeof options2.handler === "function") { - throw new FST_ERR_ROUTE_DUPLICATED_HANDLER(method, url); - } else { - throw new FST_ERR_ROUTE_HANDLER_NOT_FN(method, url); - } - } - } - options2 = Object.assign({}, options2, { - method, - url, - path: url, - handler: handler || options2 && options2.handler - }); - return route.call(this, { options: options2, isFastify }); - } - function hasRoute({ options: options2 }) { - const normalizedMethod = options2.method?.toUpperCase() ?? ""; - return router.hasRoute( - normalizedMethod, - options2.url || "", - options2.constraints - ); - } - function findRoute(options2) { - const route2 = router.find( - options2.method, - options2.url || "", - options2.constraints - ); - if (route2) { - return { - handler: route2.handler, - params: route2.params, - searchParams: route2.searchParams - }; - } else { - return null; - } - } - function route({ options: options2, isFastify }) { - throwIfAlreadyStarted("Cannot add route!"); - const opts = { ...options2 }; - const path2 = opts.url || opts.path || ""; - if (!opts.handler) { - throw new FST_ERR_ROUTE_MISSING_HANDLER(opts.method, path2); - } - if (opts.errorHandler !== void 0 && typeof opts.errorHandler !== "function") { - throw new FST_ERR_ROUTE_HANDLER_NOT_FN(opts.method, path2); - } - validateBodyLimitOption(opts.bodyLimit); - validateHandlerTimeoutOption(opts.handlerTimeout); - const shouldExposeHead = opts.exposeHeadRoute ?? globalExposeHeadRoutes; - let isGetRoute = false; - let isHeadRoute = false; - if (Array.isArray(opts.method)) { - for (let i = 0; i < opts.method.length; ++i) { - opts.method[i] = normalizeAndValidateMethod.call(this, opts.method[i]); - validateSchemaBodyOption.call(this, opts.method[i], path2, opts.schema); - isGetRoute = opts.method.includes("GET"); - isHeadRoute = opts.method.includes("HEAD"); - } - } else { - opts.method = normalizeAndValidateMethod.call(this, opts.method); - validateSchemaBodyOption.call(this, opts.method, path2, opts.schema); - isGetRoute = opts.method === "GET"; - isHeadRoute = opts.method === "HEAD"; - } - const headOpts = shouldExposeHead && isGetRoute ? { ...options2 } : null; - const prefix = this[kRoutePrefix]; - if (path2 === "/" && prefix.length > 0 && opts.method !== "HEAD") { - switch (opts.prefixTrailingSlash) { - case "slash": - addNewRoute.call(this, { path: path2, isFastify }); - break; - case "no-slash": - addNewRoute.call(this, { path: "", isFastify }); - break; - case "both": - default: - addNewRoute.call(this, { path: "", isFastify }); - if (ignoreTrailingSlash !== true && (ignoreDuplicateSlashes !== true || !prefix.endsWith("/"))) { - addNewRoute.call(this, { path: path2, prefixing: true, isFastify }); - } - } - } else if (path2[0] === "/" && prefix.endsWith("/")) { - addNewRoute.call(this, { path: path2.slice(1), isFastify }); - } else { - addNewRoute.call(this, { path: path2, isFastify }); - } - return this; - function addNewRoute({ path: path3, prefixing = false, isFastify: isFastify2 = false }) { - const url = prefix + path3; - opts.url = url; - opts.path = url; - opts.routePath = path3; - opts.prefix = prefix; - opts.logLevel = opts.logLevel || this[kLogLevel]; - if (this[kLogSerializers] || opts.logSerializers) { - opts.logSerializers = Object.assign(Object.create(this[kLogSerializers]), opts.logSerializers); - } - if (opts.attachValidation == null) { - opts.attachValidation = false; - } - if (prefixing === false) { - for (const hook of this[kHooks].onRoute) { - hook.call(this, opts); - } - } - for (const hook of lifecycleHooks) { - if (opts && hook in opts) { - if (Array.isArray(opts[hook])) { - for (const func of opts[hook]) { - if (typeof func !== "function") { - throw new FST_ERR_HOOK_INVALID_HANDLER(hook, Object.prototype.toString.call(func)); - } - if (hook === "onSend" || hook === "preSerialization" || hook === "onError" || hook === "preParsing") { - if (func.constructor.name === "AsyncFunction" && func.length === 4) { - throw new FST_ERR_HOOK_INVALID_ASYNC_HANDLER(); - } - } else if (hook === "onRequestAbort") { - if (func.constructor.name === "AsyncFunction" && func.length !== 1) { - throw new FST_ERR_HOOK_INVALID_ASYNC_HANDLER(); - } - } else { - if (func.constructor.name === "AsyncFunction" && func.length === 3) { - throw new FST_ERR_HOOK_INVALID_ASYNC_HANDLER(); - } - } - } - } else if (opts[hook] !== void 0 && typeof opts[hook] !== "function") { - throw new FST_ERR_HOOK_INVALID_HANDLER(hook, Object.prototype.toString.call(opts[hook])); - } - } - } - const constraints = opts.constraints || {}; - const config = { - ...opts.config, - url, - method: opts.method - }; - const context = new Context({ - schema: opts.schema, - handler: opts.handler.bind(this), - config, - errorHandler: opts.errorHandler, - childLoggerFactory: opts.childLoggerFactory, - bodyLimit: opts.bodyLimit, - logLevel: opts.logLevel, - logSerializers: opts.logSerializers, - attachValidation: opts.attachValidation, - schemaErrorFormatter: opts.schemaErrorFormatter, - replySerializer: this[kReplySerializerDefault], - validatorCompiler: opts.validatorCompiler, - serializerCompiler: opts.serializerCompiler, - exposeHeadRoute: shouldExposeHead, - prefixTrailingSlash: opts.prefixTrailingSlash || "both", - server: this, - isFastify: isFastify2, - handlerTimeout: opts.handlerTimeout - }); - const headHandler = router.findRoute("HEAD", opts.url, constraints); - const hasHEADHandler = headHandler !== null; - try { - router.on(opts.method, opts.url, { constraints }, routeHandler, context); - } catch (error) { - if (!context[kRouteByFastify]) { - const isDuplicatedRoute = error.message.includes(`Method '${opts.method}' already declared for route`); - if (isDuplicatedRoute) { - throw new FST_ERR_DUPLICATED_ROUTE(opts.method, opts.url); - } - throw error; - } - } - this.after((notHandledErr, done) => { - context.errorHandler = opts.errorHandler ? buildErrorHandler(this[kErrorHandler], opts.errorHandler) : this[kErrorHandler]; - context._parserOptions.limit = opts.bodyLimit || null; - context.logLevel = opts.logLevel; - context.logSerializers = opts.logSerializers; - context.attachValidation = opts.attachValidation; - context[kReplySerializerDefault] = this[kReplySerializerDefault]; - context.schemaErrorFormatter = opts.schemaErrorFormatter || this[kSchemaErrorFormatter] || context.schemaErrorFormatter; - avvio.once("preReady", () => { - for (const hook of lifecycleHooks) { - const toSet = this[kHooks][hook].concat(opts[hook] || []).map((h) => h.bind(this)); - context[hook] = toSet.length ? toSet : null; - } - while (!context.Request[kHasBeenDecorated] && context.Request.parent) { - context.Request = context.Request.parent; - } - while (!context.Reply[kHasBeenDecorated] && context.Reply.parent) { - context.Reply = context.Reply.parent; - } - fourOhFour.setContext(this, context); - if (opts.schema) { - context.schema = normalizeSchema(context.schema, this.initialConfig); - const schemaController = this[kSchemaController]; - const hasValidationSchema = opts.schema.body || opts.schema.headers || opts.schema.querystring || opts.schema.params; - if (!opts.validatorCompiler && hasValidationSchema) { - schemaController.setupValidator(this[kOptions]); - } - try { - const isCustom = typeof opts?.validatorCompiler === "function" || schemaController.isCustomValidatorCompiler; - compileSchemasForValidation( - context, - opts.validatorCompiler || schemaController.validatorCompiler, - isCustom - ); - } catch (error) { - throw new FST_ERR_SCH_VALIDATION_BUILD(opts.method, url, error.message); - } - if (opts.schema.response && !opts.serializerCompiler) { - schemaController.setupSerializer(this[kOptions]); - } - try { - compileSchemasForSerialization(context, opts.serializerCompiler || schemaController.serializerCompiler); - } catch (error) { - throw new FST_ERR_SCH_SERIALIZATION_BUILD(opts.method, url, error.message); - } - } - }); - done(notHandledErr); - }); - if (shouldExposeHead && isGetRoute && !isHeadRoute && !hasHEADHandler) { - const onSendHandlers = parseHeadOnSendHandlers(headOpts.onSend); - prepareRoute.call(this, { method: "HEAD", url: path3, options: { ...headOpts, onSend: onSendHandlers }, isFastify: true }); - } - } - } - function routeHandler(req, res, params, context, query) { - const id = getGenReqId(context.server, req); - const loggerOpts = { - level: context.logLevel - }; - if (context.logSerializers) { - loggerOpts.serializers = context.logSerializers; - } - const childLogger = createChildLogger(context, logger, req, id, loggerOpts); - childLogger[kDisableRequestLogging] = disableRequestLoggingFn ? false : disableRequestLogging; - if (closing === true) { - if (req.httpVersionMajor !== 2) { - res.setHeader("Connection", "close"); - } - if (return503OnClosing) { - const headers = { - "Content-Type": "application/json", - "Content-Length": "80" - }; - res.writeHead(503, headers); - res.end('{"error":"Service Unavailable","message":"Service Unavailable","statusCode":503}'); - childLogger.info({ res: { statusCode: 503 } }, "request aborted - refusing to accept new requests as server is closing"); - return; - } - } - const connHeader = String.prototype.toLowerCase.call(req.headers.connection || ""); - if (connHeader === "keep-alive") { - if (keepAliveConnections.has(req.socket) === false) { - keepAliveConnections.add(req.socket); - req.socket.on("close", removeTrackedSocket.bind({ keepAliveConnections, socket: req.socket })); - } - } - if (req.headers[kRequestAcceptVersion] !== void 0) { - req.headers["accept-version"] = req.headers[kRequestAcceptVersion]; - req.headers[kRequestAcceptVersion] = void 0; - } - const request = new context.Request(id, params, req, query, childLogger, context); - const reply = new context.Reply(res, request, childLogger); - const resolvedDisableRequestLogging = disableRequestLoggingFn ? disableRequestLoggingFn(request) : disableRequestLogging; - childLogger[kDisableRequestLogging] = resolvedDisableRequestLogging; - if (resolvedDisableRequestLogging === false) { - childLogger.info({ req: request }, "incoming request"); - } - const handlerTimeout = context.handlerTimeout; - if (handlerTimeout > 0) { - const ac = new AbortController(); - request[kRequestSignal] = ac; - request[kTimeoutTimer] = setTimeout(() => { - if (!reply.sent) { - const err = new FST_ERR_HANDLER_TIMEOUT(handlerTimeout, context.config?.url); - ac.abort(err); - reply[kReplyIsError] = true; - reply.send(err); - } - }, handlerTimeout); - const onAbort = () => { - if (!ac.signal.aborted) { - ac.abort(); - } - clearTimeout(request[kTimeoutTimer]); - }; - req.on("close", onAbort); - request[kOnAbort] = onAbort; - } - if (hasLogger === true || context.onResponse !== null || handlerTimeout > 0) { - setupResponseListeners(reply); - } - if (context.onRequest !== null) { - onRequestHookRunner( - context.onRequest, - request, - reply, - runPreParsing - ); - } else { - runPreParsing(null, request, reply); - } - if (context.onRequestAbort !== null) { - req.on("close", () => { - if (req.aborted) { - onRequestAbortHookRunner( - context.onRequestAbort, - request, - handleOnRequestAbortHooksErrors.bind(null, reply) - ); - } - }); - } - if (context.onTimeout !== null) { - if (!request.raw.socket._meta) { - request.raw.socket.on("timeout", handleTimeout); - } - request.raw.socket._meta = { context, request, reply }; - } - } - } - function handleOnRequestAbortHooksErrors(reply, err) { - if (err) { - reply.log.error({ err }, "onRequestAborted hook failed"); - } - } - function handleTimeout() { - const { context, request, reply } = this._meta; - onTimeoutHookRunner( - context.onTimeout, - request, - reply, - noop - ); - } - function normalizeAndValidateMethod(method) { - if (typeof method !== "string") { - throw new FST_ERR_ROUTE_METHOD_INVALID(); - } - method = method.toUpperCase(); - if (!this[kSupportedHTTPMethods].bodyless.has(method) && !this[kSupportedHTTPMethods].bodywith.has(method)) { - throw new FST_ERR_ROUTE_METHOD_NOT_SUPPORTED(method); - } - return method; - } - function validateSchemaBodyOption(method, path2, schema) { - if (this[kSupportedHTTPMethods].bodyless.has(method) && schema?.body) { - throw new FST_ERR_ROUTE_BODY_VALIDATION_SCHEMA_NOT_SUPPORTED(method, path2); - } - } - function validateBodyLimitOption(bodyLimit) { - if (bodyLimit === void 0) - return; - if (!Number.isInteger(bodyLimit) || bodyLimit <= 0) { - throw new FST_ERR_ROUTE_BODY_LIMIT_OPTION_NOT_INT(bodyLimit); - } - } - function validateHandlerTimeoutOption(handlerTimeout) { - if (handlerTimeout === void 0) - return; - if (!Number.isInteger(handlerTimeout) || handlerTimeout <= 0) { - throw new FST_ERR_ROUTE_HANDLER_TIMEOUT_OPTION_NOT_INT(handlerTimeout); - } - } - function runPreParsing(err, request, reply) { - if (reply.sent === true) - return; - if (err != null) { - reply[kReplyIsError] = true; - reply.send(err); - return; - } - request[kRequestPayloadStream] = request.raw; - if (request[kRouteContext].preParsing !== null) { - preParsingHookRunner(request[kRouteContext].preParsing, request, reply, handleRequest.bind(request.server)); - } else { - handleRequest.call(request.server, null, request, reply); - } - } - function buildRouterOptions(options, defaultOptions) { - const routerOptions = options.routerOptions == null ? /* @__PURE__ */ Object.create(null) : Object.assign(/* @__PURE__ */ Object.create(null), options.routerOptions); - const usedDeprecatedOptions = routerKeys.filter((key) => Object.hasOwn(options, key)); - if (usedDeprecatedOptions.length > 0) { - FSTDEP022(usedDeprecatedOptions.join(", ")); - } - for (const key of routerKeys) { - if (!Object.hasOwn(routerOptions, key)) { - routerOptions[key] = options[key] ?? defaultOptions[key]; - } - } - return routerOptions; - } - function removeTrackedSocket() { - this.keepAliveConnections.delete(this.socket); - } - function noop() { - } - module2.exports = { buildRouting, validateBodyLimitOption, buildRouterOptions }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/four-oh-four.js -var require_four_oh_four = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/four-oh-four.js"(exports2, module2) { - "use strict"; - var FindMyWay = require_find_my_way(); - var Reply = require_reply(); - var Request2 = require_request(); - var Context = require_context(); - var { - kRoutePrefix, - kCanSetNotFoundHandler, - kFourOhFourLevelInstance, - kFourOhFourContext, - kHooks, - kErrorHandler - } = require_symbols2(); - var { lifecycleHooks } = require_hooks(); - var { buildErrorHandler } = require_error_handler(); - var { - FST_ERR_NOT_FOUND - } = require_errors2(); - var { createChildLogger } = require_logger_factory(); - var { getGenReqId } = require_req_id_gen_factory(); - function fourOhFour(options) { - const { logger, disableRequestLogging } = options; - const router = FindMyWay({ onBadUrl: createOnBadUrl(), defaultRoute: fourOhFourFallBack }); - let _onBadUrlHandler = null; - return { router, setNotFoundHandler, setContext, arrange404 }; - function arrange404(instance2) { - instance2[kFourOhFourLevelInstance] = instance2; - instance2[kCanSetNotFoundHandler] = true; - router.onBadUrl = router.onBadUrl.bind(instance2); - router.defaultRoute = router.defaultRoute.bind(instance2); - } - function basic404(request, reply) { - const { url, method } = request.raw; - const message = `Route ${method}:${url} not found`; - const resolvedDisableRequestLogging = typeof disableRequestLogging === "function" ? disableRequestLogging(request.raw) : disableRequestLogging; - if (!resolvedDisableRequestLogging) { - request.log.info(message); - } - reply.code(404).send({ - message, - error: "Not Found", - statusCode: 404 - }); - } - function createOnBadUrl() { - return function onBadUrl(path2, req, res) { - const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext]; - const id = getGenReqId(fourOhFourContext.server, req); - const childLogger = createChildLogger(fourOhFourContext, logger, req, id); - const request = new Request2(id, null, req, null, childLogger, fourOhFourContext); - const reply = new Reply(res, request, childLogger); - _onBadUrlHandler(request, reply); - }; - } - function setContext(instance2, context) { - const _404Context = Object.assign({}, instance2[kFourOhFourContext]); - _404Context.onSend = context.onSend; - context[kFourOhFourContext] = _404Context; - } - function setNotFoundHandler(opts, handler, avvio, routeHandler) { - if (this[kCanSetNotFoundHandler] === void 0) { - this[kCanSetNotFoundHandler] = true; - } - if (this[kFourOhFourContext] === void 0) { - this[kFourOhFourContext] = null; - } - const _fastify = this; - const prefix = this[kRoutePrefix] || "/"; - if (this[kCanSetNotFoundHandler] === false) { - throw new Error(`Not found handler already set for Fastify instance with prefix: '${prefix}'`); - } - if (typeof opts === "object") { - if (opts.preHandler) { - if (Array.isArray(opts.preHandler)) { - opts.preHandler = opts.preHandler.map((hook) => hook.bind(_fastify)); - } else { - opts.preHandler = opts.preHandler.bind(_fastify); - } - } - if (opts.preValidation) { - if (Array.isArray(opts.preValidation)) { - opts.preValidation = opts.preValidation.map((hook) => hook.bind(_fastify)); - } else { - opts.preValidation = opts.preValidation.bind(_fastify); - } - } - } - if (typeof opts === "function") { - handler = opts; - opts = void 0; - } - opts = opts || {}; - if (handler) { - this[kFourOhFourLevelInstance][kCanSetNotFoundHandler] = false; - handler = handler.bind(this); - _onBadUrlHandler = handler; - } else { - handler = basic404; - _onBadUrlHandler = basic404; - } - this.after((notHandledErr, done) => { - _setNotFoundHandler.call(this, prefix, opts, handler, avvio, routeHandler); - done(notHandledErr); - }); - } - function _setNotFoundHandler(prefix, opts, handler, avvio, routeHandler) { - const context = new Context({ - schema: opts.schema, - handler, - config: opts.config || {}, - server: this - }); - avvio.once("preReady", () => { - const context2 = this[kFourOhFourContext]; - for (const hook of lifecycleHooks) { - const toSet = this[kHooks][hook].concat(opts[hook] || []).map((h) => h.bind(this)); - context2[hook] = toSet.length ? toSet : null; - } - context2.errorHandler = opts.errorHandler ? buildErrorHandler(this[kErrorHandler], opts.errorHandler) : this[kErrorHandler]; - }); - if (this[kFourOhFourContext] !== null && prefix === "/") { - Object.assign(this[kFourOhFourContext], context); - return; - } - this[kFourOhFourLevelInstance][kFourOhFourContext] = context; - router.all(prefix + (prefix.endsWith("/") ? "*" : "/*"), routeHandler, context); - router.all(prefix, routeHandler, context); - } - function fourOhFourFallBack(req, res) { - const fourOhFourContext = this[kFourOhFourLevelInstance][kFourOhFourContext]; - const id = getGenReqId(fourOhFourContext.server, req); - const childLogger = createChildLogger(fourOhFourContext, logger, req, id); - childLogger.info({ req }, "incoming request"); - const request = new Request2(id, null, req, null, childLogger, fourOhFourContext); - const reply = new Reply(res, request, childLogger); - request.log.warn("the default handler for 404 did not catch this, this is likely a fastify bug, please report it"); - request.log.warn(router.prettyPrint()); - reply.code(404).send(new FST_ERR_NOT_FOUND()); - } - } - module2.exports = fourOhFour; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/config-validator.js -var require_config_validator = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/config-validator.js"(exports2, module2) { - "use strict"; - module2.exports = validate10; - module2.exports.default = validate10; - var schema11 = { "type": "object", "additionalProperties": false, "properties": { "connectionTimeout": { "type": "integer", "default": 0 }, "keepAliveTimeout": { "type": "integer", "default": 72e3 }, "forceCloseConnections": { "oneOf": [{ "type": "string", "pattern": "idle" }, { "type": "boolean" }] }, "maxRequestsPerSocket": { "type": "integer", "default": 0, "nullable": true }, "requestTimeout": { "type": "integer", "default": 0 }, "handlerTimeout": { "type": "integer", "default": 0 }, "bodyLimit": { "type": "integer", "default": 1048576 }, "caseSensitive": { "type": "boolean", "default": true }, "allowUnsafeRegex": { "type": "boolean", "default": false }, "http2": { "type": "boolean" }, "https": { "if": { "not": { "oneOf": [{ "type": "boolean" }, { "type": "null" }, { "type": "object", "additionalProperties": false, "required": ["allowHTTP1"], "properties": { "allowHTTP1": { "type": "boolean" } } }] } }, "then": { "setDefaultValue": true } }, "ignoreTrailingSlash": { "type": "boolean", "default": false }, "ignoreDuplicateSlashes": { "type": "boolean", "default": false }, "disableRequestLogging": { "default": false }, "maxParamLength": { "type": "integer", "default": 100 }, "onProtoPoisoning": { "type": "string", "default": "error" }, "onConstructorPoisoning": { "type": "string", "default": "error" }, "pluginTimeout": { "type": "integer", "default": 1e4 }, "requestIdHeader": { "anyOf": [{ "type": "boolean" }, { "type": "string" }], "default": false }, "requestIdLogLabel": { "type": "string", "default": "reqId" }, "http2SessionTimeout": { "type": "integer", "default": 72e3 }, "exposeHeadRoutes": { "type": "boolean", "default": true }, "useSemicolonDelimiter": { "type": "boolean", "default": false }, "routerOptions": { "type": "object", "additionalProperties": true, "properties": { "ignoreTrailingSlash": { "type": "boolean", "default": false }, "ignoreDuplicateSlashes": { "type": "boolean", "default": false }, "maxParamLength": { "type": "integer", "default": 100 }, "allowUnsafeRegex": { "type": "boolean", "default": false }, "useSemicolonDelimiter": { "type": "boolean", "default": false } } }, "constraints": { "type": "object", "additionalProperties": { "type": "object", "required": ["name", "storage", "validate", "deriveConstraint"], "additionalProperties": true, "properties": { "name": { "type": "string" }, "storage": {}, "validate": {}, "deriveConstraint": {} } } } } }; - var func2 = Object.prototype.hasOwnProperty; - var pattern0 = new RegExp("idle", "u"); - function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.connectionTimeout === void 0) { - data.connectionTimeout = 0; - } - if (data.keepAliveTimeout === void 0) { - data.keepAliveTimeout = 72e3; - } - if (data.maxRequestsPerSocket === void 0) { - data.maxRequestsPerSocket = 0; - } - if (data.requestTimeout === void 0) { - data.requestTimeout = 0; - } - if (data.handlerTimeout === void 0) { - data.handlerTimeout = 0; - } - if (data.bodyLimit === void 0) { - data.bodyLimit = 1048576; - } - if (data.caseSensitive === void 0) { - data.caseSensitive = true; - } - if (data.allowUnsafeRegex === void 0) { - data.allowUnsafeRegex = false; - } - if (data.ignoreTrailingSlash === void 0) { - data.ignoreTrailingSlash = false; - } - if (data.ignoreDuplicateSlashes === void 0) { - data.ignoreDuplicateSlashes = false; - } - if (data.disableRequestLogging === void 0) { - data.disableRequestLogging = false; - } - if (data.maxParamLength === void 0) { - data.maxParamLength = 100; - } - if (data.onProtoPoisoning === void 0) { - data.onProtoPoisoning = "error"; - } - if (data.onConstructorPoisoning === void 0) { - data.onConstructorPoisoning = "error"; - } - if (data.pluginTimeout === void 0) { - data.pluginTimeout = 1e4; - } - if (data.requestIdHeader === void 0) { - data.requestIdHeader = false; - } - if (data.requestIdLogLabel === void 0) { - data.requestIdLogLabel = "reqId"; - } - if (data.http2SessionTimeout === void 0) { - data.http2SessionTimeout = 72e3; - } - if (data.exposeHeadRoutes === void 0) { - data.exposeHeadRoutes = true; - } - if (data.useSemicolonDelimiter === void 0) { - data.useSemicolonDelimiter = false; - } - const _errs1 = errors; - for (const key0 in data) { - if (!func2.call(schema11.properties, key0)) { - delete data[key0]; - } - } - if (_errs1 === errors) { - let data0 = data.connectionTimeout; - const _errs2 = errors; - if (!(typeof data0 == "number" && (!(data0 % 1) && !isNaN(data0)) && isFinite(data0))) { - let dataType0 = typeof data0; - let coerced0 = void 0; - if (!(coerced0 !== void 0)) { - if (dataType0 === "boolean" || data0 === null || dataType0 === "string" && data0 && data0 == +data0 && !(data0 % 1)) { - coerced0 = +data0; - } else { - validate10.errors = [{ instancePath: instancePath + "/connectionTimeout", schemaPath: "#/properties/connectionTimeout/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced0 !== void 0) { - data0 = coerced0; - if (data !== void 0) { - data["connectionTimeout"] = coerced0; - } - } - } - var valid0 = _errs2 === errors; - if (valid0) { - let data1 = data.keepAliveTimeout; - const _errs4 = errors; - if (!(typeof data1 == "number" && (!(data1 % 1) && !isNaN(data1)) && isFinite(data1))) { - let dataType1 = typeof data1; - let coerced1 = void 0; - if (!(coerced1 !== void 0)) { - if (dataType1 === "boolean" || data1 === null || dataType1 === "string" && data1 && data1 == +data1 && !(data1 % 1)) { - coerced1 = +data1; - } else { - validate10.errors = [{ instancePath: instancePath + "/keepAliveTimeout", schemaPath: "#/properties/keepAliveTimeout/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced1 !== void 0) { - data1 = coerced1; - if (data !== void 0) { - data["keepAliveTimeout"] = coerced1; - } - } - } - var valid0 = _errs4 === errors; - if (valid0) { - if (data.forceCloseConnections !== void 0) { - let data2 = data.forceCloseConnections; - const _errs6 = errors; - const _errs7 = errors; - let valid1 = false; - let passing0 = null; - const _errs8 = errors; - if (typeof data2 !== "string") { - let dataType2 = typeof data2; - let coerced2 = void 0; - if (!(coerced2 !== void 0)) { - if (dataType2 == "number" || dataType2 == "boolean") { - coerced2 = "" + data2; - } else if (data2 === null) { - coerced2 = ""; - } else { - const err0 = { instancePath: instancePath + "/forceCloseConnections", schemaPath: "#/properties/forceCloseConnections/oneOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - if (coerced2 !== void 0) { - data2 = coerced2; - if (data !== void 0) { - data["forceCloseConnections"] = coerced2; - } - } - } - if (errors === _errs8) { - if (typeof data2 === "string") { - if (!pattern0.test(data2)) { - const err1 = { instancePath: instancePath + "/forceCloseConnections", schemaPath: "#/properties/forceCloseConnections/oneOf/0/pattern", keyword: "pattern", params: { pattern: "idle" }, message: 'must match pattern "idle"' }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - } - var _valid0 = _errs8 === errors; - if (_valid0) { - valid1 = true; - passing0 = 0; - } - const _errs10 = errors; - if (typeof data2 !== "boolean") { - let coerced3 = void 0; - if (!(coerced3 !== void 0)) { - if (data2 === "false" || data2 === 0 || data2 === null) { - coerced3 = false; - } else if (data2 === "true" || data2 === 1) { - coerced3 = true; - } else { - const err2 = { instancePath: instancePath + "/forceCloseConnections", schemaPath: "#/properties/forceCloseConnections/oneOf/1/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - } - } - if (coerced3 !== void 0) { - data2 = coerced3; - if (data !== void 0) { - data["forceCloseConnections"] = coerced3; - } - } - } - var _valid0 = _errs10 === errors; - if (_valid0 && valid1) { - valid1 = false; - passing0 = [passing0, 1]; - } else { - if (_valid0) { - valid1 = true; - passing0 = 1; - } - } - if (!valid1) { - const err3 = { instancePath: instancePath + "/forceCloseConnections", schemaPath: "#/properties/forceCloseConnections/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs7; - if (vErrors !== null) { - if (_errs7) { - vErrors.length = _errs7; - } else { - vErrors = null; - } - } - } - var valid0 = _errs6 === errors; - } else { - var valid0 = true; - } - if (valid0) { - let data3 = data.maxRequestsPerSocket; - const _errs12 = errors; - if (!(typeof data3 == "number" && (!(data3 % 1) && !isNaN(data3)) && isFinite(data3)) && data3 !== null) { - let dataType4 = typeof data3; - let coerced4 = void 0; - if (!(coerced4 !== void 0)) { - if (dataType4 === "boolean" || data3 === null || dataType4 === "string" && data3 && data3 == +data3 && !(data3 % 1)) { - coerced4 = +data3; - } else if (data3 === "" || data3 === 0 || data3 === false) { - coerced4 = null; - } else { - validate10.errors = [{ instancePath: instancePath + "/maxRequestsPerSocket", schemaPath: "#/properties/maxRequestsPerSocket/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced4 !== void 0) { - data3 = coerced4; - if (data !== void 0) { - data["maxRequestsPerSocket"] = coerced4; - } - } - } - var valid0 = _errs12 === errors; - if (valid0) { - let data4 = data.requestTimeout; - const _errs15 = errors; - if (!(typeof data4 == "number" && (!(data4 % 1) && !isNaN(data4)) && isFinite(data4))) { - let dataType5 = typeof data4; - let coerced5 = void 0; - if (!(coerced5 !== void 0)) { - if (dataType5 === "boolean" || data4 === null || dataType5 === "string" && data4 && data4 == +data4 && !(data4 % 1)) { - coerced5 = +data4; - } else { - validate10.errors = [{ instancePath: instancePath + "/requestTimeout", schemaPath: "#/properties/requestTimeout/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced5 !== void 0) { - data4 = coerced5; - if (data !== void 0) { - data["requestTimeout"] = coerced5; - } - } - } - var valid0 = _errs15 === errors; - if (valid0) { - let data5 = data.handlerTimeout; - const _errs17 = errors; - if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5)) && isFinite(data5))) { - let dataType6 = typeof data5; - let coerced6 = void 0; - if (!(coerced6 !== void 0)) { - if (dataType6 === "boolean" || data5 === null || dataType6 === "string" && data5 && data5 == +data5 && !(data5 % 1)) { - coerced6 = +data5; - } else { - validate10.errors = [{ instancePath: instancePath + "/handlerTimeout", schemaPath: "#/properties/handlerTimeout/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced6 !== void 0) { - data5 = coerced6; - if (data !== void 0) { - data["handlerTimeout"] = coerced6; - } - } - } - var valid0 = _errs17 === errors; - if (valid0) { - let data6 = data.bodyLimit; - const _errs19 = errors; - if (!(typeof data6 == "number" && (!(data6 % 1) && !isNaN(data6)) && isFinite(data6))) { - let dataType7 = typeof data6; - let coerced7 = void 0; - if (!(coerced7 !== void 0)) { - if (dataType7 === "boolean" || data6 === null || dataType7 === "string" && data6 && data6 == +data6 && !(data6 % 1)) { - coerced7 = +data6; - } else { - validate10.errors = [{ instancePath: instancePath + "/bodyLimit", schemaPath: "#/properties/bodyLimit/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced7 !== void 0) { - data6 = coerced7; - if (data !== void 0) { - data["bodyLimit"] = coerced7; - } - } - } - var valid0 = _errs19 === errors; - if (valid0) { - let data7 = data.caseSensitive; - const _errs21 = errors; - if (typeof data7 !== "boolean") { - let coerced8 = void 0; - if (!(coerced8 !== void 0)) { - if (data7 === "false" || data7 === 0 || data7 === null) { - coerced8 = false; - } else if (data7 === "true" || data7 === 1) { - coerced8 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/caseSensitive", schemaPath: "#/properties/caseSensitive/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced8 !== void 0) { - data7 = coerced8; - if (data !== void 0) { - data["caseSensitive"] = coerced8; - } - } - } - var valid0 = _errs21 === errors; - if (valid0) { - let data8 = data.allowUnsafeRegex; - const _errs23 = errors; - if (typeof data8 !== "boolean") { - let coerced9 = void 0; - if (!(coerced9 !== void 0)) { - if (data8 === "false" || data8 === 0 || data8 === null) { - coerced9 = false; - } else if (data8 === "true" || data8 === 1) { - coerced9 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/allowUnsafeRegex", schemaPath: "#/properties/allowUnsafeRegex/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced9 !== void 0) { - data8 = coerced9; - if (data !== void 0) { - data["allowUnsafeRegex"] = coerced9; - } - } - } - var valid0 = _errs23 === errors; - if (valid0) { - if (data.http2 !== void 0) { - let data9 = data.http2; - const _errs25 = errors; - if (typeof data9 !== "boolean") { - let coerced10 = void 0; - if (!(coerced10 !== void 0)) { - if (data9 === "false" || data9 === 0 || data9 === null) { - coerced10 = false; - } else if (data9 === "true" || data9 === 1) { - coerced10 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/http2", schemaPath: "#/properties/http2/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced10 !== void 0) { - data9 = coerced10; - if (data !== void 0) { - data["http2"] = coerced10; - } - } - } - var valid0 = _errs25 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.https !== void 0) { - let data10 = data.https; - const _errs27 = errors; - const _errs28 = errors; - let valid2 = true; - const _errs29 = errors; - const _errs30 = errors; - const _errs31 = errors; - const _errs32 = errors; - let valid4 = false; - let passing1 = null; - const _errs33 = errors; - if (typeof data10 !== "boolean") { - let coerced11 = void 0; - if (!(coerced11 !== void 0)) { - if (data10 === "false" || data10 === 0 || data10 === null) { - coerced11 = false; - } else if (data10 === "true" || data10 === 1) { - coerced11 = true; - } else { - const err4 = {}; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } - } - if (coerced11 !== void 0) { - data10 = coerced11; - if (data !== void 0) { - data["https"] = coerced11; - } - } - } - var _valid2 = _errs33 === errors; - if (_valid2) { - valid4 = true; - passing1 = 0; - } - const _errs35 = errors; - if (data10 !== null) { - let coerced12 = void 0; - if (!(coerced12 !== void 0)) { - if (data10 === "" || data10 === 0 || data10 === false) { - coerced12 = null; - } else { - const err5 = {}; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - if (coerced12 !== void 0) { - data10 = coerced12; - if (data !== void 0) { - data["https"] = coerced12; - } - } - } - var _valid2 = _errs35 === errors; - if (_valid2 && valid4) { - valid4 = false; - passing1 = [passing1, 1]; - } else { - if (_valid2) { - valid4 = true; - passing1 = 1; - } - const _errs37 = errors; - if (errors === _errs37) { - if (data10 && typeof data10 == "object" && !Array.isArray(data10)) { - let missing0; - if (data10.allowHTTP1 === void 0 && (missing0 = "allowHTTP1")) { - const err6 = {}; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } else { - const _errs39 = errors; - for (const key1 in data10) { - if (!(key1 === "allowHTTP1")) { - delete data10[key1]; - } - } - if (_errs39 === errors) { - if (data10.allowHTTP1 !== void 0) { - let data11 = data10.allowHTTP1; - if (typeof data11 !== "boolean") { - let coerced13 = void 0; - if (!(coerced13 !== void 0)) { - if (data11 === "false" || data11 === 0 || data11 === null) { - coerced13 = false; - } else if (data11 === "true" || data11 === 1) { - coerced13 = true; - } else { - const err7 = {}; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - } - if (coerced13 !== void 0) { - data11 = coerced13; - if (data10 !== void 0) { - data10["allowHTTP1"] = coerced13; - } - } - } - } - } - } - } else { - const err8 = {}; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - } - var _valid2 = _errs37 === errors; - if (_valid2 && valid4) { - valid4 = false; - passing1 = [passing1, 2]; - } else { - if (_valid2) { - valid4 = true; - passing1 = 2; - } - } - } - if (!valid4) { - const err9 = {}; - if (vErrors === null) { - vErrors = [err9]; - } else { - vErrors.push(err9); - } - errors++; - } else { - errors = _errs32; - if (vErrors !== null) { - if (_errs32) { - vErrors.length = _errs32; - } else { - vErrors = null; - } - } - } - var valid3 = _errs31 === errors; - if (valid3) { - const err10 = {}; - if (vErrors === null) { - vErrors = [err10]; - } else { - vErrors.push(err10); - } - errors++; - } else { - errors = _errs30; - if (vErrors !== null) { - if (_errs30) { - vErrors.length = _errs30; - } else { - vErrors = null; - } - } - } - var _valid1 = _errs29 === errors; - errors = _errs28; - if (vErrors !== null) { - if (_errs28) { - vErrors.length = _errs28; - } else { - vErrors = null; - } - } - if (_valid1) { - const _errs42 = errors; - data["https"] = true; - var _valid1 = _errs42 === errors; - valid2 = _valid1; - } - if (!valid2) { - const err11 = { instancePath: instancePath + "/https", schemaPath: "#/properties/https/if", keyword: "if", params: { failingKeyword: "then" }, message: 'must match "then" schema' }; - if (vErrors === null) { - vErrors = [err11]; - } else { - vErrors.push(err11); - } - errors++; - validate10.errors = vErrors; - return false; - } - var valid0 = _errs27 === errors; - } else { - var valid0 = true; - } - if (valid0) { - let data12 = data.ignoreTrailingSlash; - const _errs43 = errors; - if (typeof data12 !== "boolean") { - let coerced14 = void 0; - if (!(coerced14 !== void 0)) { - if (data12 === "false" || data12 === 0 || data12 === null) { - coerced14 = false; - } else if (data12 === "true" || data12 === 1) { - coerced14 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/ignoreTrailingSlash", schemaPath: "#/properties/ignoreTrailingSlash/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced14 !== void 0) { - data12 = coerced14; - if (data !== void 0) { - data["ignoreTrailingSlash"] = coerced14; - } - } - } - var valid0 = _errs43 === errors; - if (valid0) { - let data13 = data.ignoreDuplicateSlashes; - const _errs45 = errors; - if (typeof data13 !== "boolean") { - let coerced15 = void 0; - if (!(coerced15 !== void 0)) { - if (data13 === "false" || data13 === 0 || data13 === null) { - coerced15 = false; - } else if (data13 === "true" || data13 === 1) { - coerced15 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/ignoreDuplicateSlashes", schemaPath: "#/properties/ignoreDuplicateSlashes/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced15 !== void 0) { - data13 = coerced15; - if (data !== void 0) { - data["ignoreDuplicateSlashes"] = coerced15; - } - } - } - var valid0 = _errs45 === errors; - if (valid0) { - let data14 = data.maxParamLength; - const _errs47 = errors; - if (!(typeof data14 == "number" && (!(data14 % 1) && !isNaN(data14)) && isFinite(data14))) { - let dataType16 = typeof data14; - let coerced16 = void 0; - if (!(coerced16 !== void 0)) { - if (dataType16 === "boolean" || data14 === null || dataType16 === "string" && data14 && data14 == +data14 && !(data14 % 1)) { - coerced16 = +data14; - } else { - validate10.errors = [{ instancePath: instancePath + "/maxParamLength", schemaPath: "#/properties/maxParamLength/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced16 !== void 0) { - data14 = coerced16; - if (data !== void 0) { - data["maxParamLength"] = coerced16; - } - } - } - var valid0 = _errs47 === errors; - if (valid0) { - let data15 = data.onProtoPoisoning; - const _errs49 = errors; - if (typeof data15 !== "string") { - let dataType17 = typeof data15; - let coerced17 = void 0; - if (!(coerced17 !== void 0)) { - if (dataType17 == "number" || dataType17 == "boolean") { - coerced17 = "" + data15; - } else if (data15 === null) { - coerced17 = ""; - } else { - validate10.errors = [{ instancePath: instancePath + "/onProtoPoisoning", schemaPath: "#/properties/onProtoPoisoning/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - if (coerced17 !== void 0) { - data15 = coerced17; - if (data !== void 0) { - data["onProtoPoisoning"] = coerced17; - } - } - } - var valid0 = _errs49 === errors; - if (valid0) { - let data16 = data.onConstructorPoisoning; - const _errs51 = errors; - if (typeof data16 !== "string") { - let dataType18 = typeof data16; - let coerced18 = void 0; - if (!(coerced18 !== void 0)) { - if (dataType18 == "number" || dataType18 == "boolean") { - coerced18 = "" + data16; - } else if (data16 === null) { - coerced18 = ""; - } else { - validate10.errors = [{ instancePath: instancePath + "/onConstructorPoisoning", schemaPath: "#/properties/onConstructorPoisoning/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - if (coerced18 !== void 0) { - data16 = coerced18; - if (data !== void 0) { - data["onConstructorPoisoning"] = coerced18; - } - } - } - var valid0 = _errs51 === errors; - if (valid0) { - let data17 = data.pluginTimeout; - const _errs53 = errors; - if (!(typeof data17 == "number" && (!(data17 % 1) && !isNaN(data17)) && isFinite(data17))) { - let dataType19 = typeof data17; - let coerced19 = void 0; - if (!(coerced19 !== void 0)) { - if (dataType19 === "boolean" || data17 === null || dataType19 === "string" && data17 && data17 == +data17 && !(data17 % 1)) { - coerced19 = +data17; - } else { - validate10.errors = [{ instancePath: instancePath + "/pluginTimeout", schemaPath: "#/properties/pluginTimeout/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced19 !== void 0) { - data17 = coerced19; - if (data !== void 0) { - data["pluginTimeout"] = coerced19; - } - } - } - var valid0 = _errs53 === errors; - if (valid0) { - let data18 = data.requestIdHeader; - const _errs55 = errors; - const _errs56 = errors; - let valid6 = false; - const _errs57 = errors; - if (typeof data18 !== "boolean") { - let coerced20 = void 0; - if (!(coerced20 !== void 0)) { - if (data18 === "false" || data18 === 0 || data18 === null) { - coerced20 = false; - } else if (data18 === "true" || data18 === 1) { - coerced20 = true; - } else { - const err12 = { instancePath: instancePath + "/requestIdHeader", schemaPath: "#/properties/requestIdHeader/anyOf/0/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }; - if (vErrors === null) { - vErrors = [err12]; - } else { - vErrors.push(err12); - } - errors++; - } - } - if (coerced20 !== void 0) { - data18 = coerced20; - if (data !== void 0) { - data["requestIdHeader"] = coerced20; - } - } - } - var _valid3 = _errs57 === errors; - valid6 = valid6 || _valid3; - if (!valid6) { - const _errs59 = errors; - if (typeof data18 !== "string") { - let dataType21 = typeof data18; - let coerced21 = void 0; - if (!(coerced21 !== void 0)) { - if (dataType21 == "number" || dataType21 == "boolean") { - coerced21 = "" + data18; - } else if (data18 === null) { - coerced21 = ""; - } else { - const err13 = { instancePath: instancePath + "/requestIdHeader", schemaPath: "#/properties/requestIdHeader/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err13]; - } else { - vErrors.push(err13); - } - errors++; - } - } - if (coerced21 !== void 0) { - data18 = coerced21; - if (data !== void 0) { - data["requestIdHeader"] = coerced21; - } - } - } - var _valid3 = _errs59 === errors; - valid6 = valid6 || _valid3; - } - if (!valid6) { - const err14 = { instancePath: instancePath + "/requestIdHeader", schemaPath: "#/properties/requestIdHeader/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; - if (vErrors === null) { - vErrors = [err14]; - } else { - vErrors.push(err14); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs56; - if (vErrors !== null) { - if (_errs56) { - vErrors.length = _errs56; - } else { - vErrors = null; - } - } - } - var valid0 = _errs55 === errors; - if (valid0) { - let data19 = data.requestIdLogLabel; - const _errs61 = errors; - if (typeof data19 !== "string") { - let dataType22 = typeof data19; - let coerced22 = void 0; - if (!(coerced22 !== void 0)) { - if (dataType22 == "number" || dataType22 == "boolean") { - coerced22 = "" + data19; - } else if (data19 === null) { - coerced22 = ""; - } else { - validate10.errors = [{ instancePath: instancePath + "/requestIdLogLabel", schemaPath: "#/properties/requestIdLogLabel/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - if (coerced22 !== void 0) { - data19 = coerced22; - if (data !== void 0) { - data["requestIdLogLabel"] = coerced22; - } - } - } - var valid0 = _errs61 === errors; - if (valid0) { - let data20 = data.http2SessionTimeout; - const _errs63 = errors; - if (!(typeof data20 == "number" && (!(data20 % 1) && !isNaN(data20)) && isFinite(data20))) { - let dataType23 = typeof data20; - let coerced23 = void 0; - if (!(coerced23 !== void 0)) { - if (dataType23 === "boolean" || data20 === null || dataType23 === "string" && data20 && data20 == +data20 && !(data20 % 1)) { - coerced23 = +data20; - } else { - validate10.errors = [{ instancePath: instancePath + "/http2SessionTimeout", schemaPath: "#/properties/http2SessionTimeout/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced23 !== void 0) { - data20 = coerced23; - if (data !== void 0) { - data["http2SessionTimeout"] = coerced23; - } - } - } - var valid0 = _errs63 === errors; - if (valid0) { - let data21 = data.exposeHeadRoutes; - const _errs65 = errors; - if (typeof data21 !== "boolean") { - let coerced24 = void 0; - if (!(coerced24 !== void 0)) { - if (data21 === "false" || data21 === 0 || data21 === null) { - coerced24 = false; - } else if (data21 === "true" || data21 === 1) { - coerced24 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/exposeHeadRoutes", schemaPath: "#/properties/exposeHeadRoutes/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced24 !== void 0) { - data21 = coerced24; - if (data !== void 0) { - data["exposeHeadRoutes"] = coerced24; - } - } - } - var valid0 = _errs65 === errors; - if (valid0) { - let data22 = data.useSemicolonDelimiter; - const _errs67 = errors; - if (typeof data22 !== "boolean") { - let coerced25 = void 0; - if (!(coerced25 !== void 0)) { - if (data22 === "false" || data22 === 0 || data22 === null) { - coerced25 = false; - } else if (data22 === "true" || data22 === 1) { - coerced25 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/useSemicolonDelimiter", schemaPath: "#/properties/useSemicolonDelimiter/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced25 !== void 0) { - data22 = coerced25; - if (data !== void 0) { - data["useSemicolonDelimiter"] = coerced25; - } - } - } - var valid0 = _errs67 === errors; - if (valid0) { - if (data.routerOptions !== void 0) { - let data23 = data.routerOptions; - const _errs69 = errors; - if (errors === _errs69) { - if (data23 && typeof data23 == "object" && !Array.isArray(data23)) { - if (data23.ignoreTrailingSlash === void 0) { - data23.ignoreTrailingSlash = false; - } - if (data23.ignoreDuplicateSlashes === void 0) { - data23.ignoreDuplicateSlashes = false; - } - if (data23.maxParamLength === void 0) { - data23.maxParamLength = 100; - } - if (data23.allowUnsafeRegex === void 0) { - data23.allowUnsafeRegex = false; - } - if (data23.useSemicolonDelimiter === void 0) { - data23.useSemicolonDelimiter = false; - } - let data24 = data23.ignoreTrailingSlash; - const _errs72 = errors; - if (typeof data24 !== "boolean") { - let coerced26 = void 0; - if (!(coerced26 !== void 0)) { - if (data24 === "false" || data24 === 0 || data24 === null) { - coerced26 = false; - } else if (data24 === "true" || data24 === 1) { - coerced26 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/routerOptions/ignoreTrailingSlash", schemaPath: "#/properties/routerOptions/properties/ignoreTrailingSlash/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced26 !== void 0) { - data24 = coerced26; - if (data23 !== void 0) { - data23["ignoreTrailingSlash"] = coerced26; - } - } - } - var valid7 = _errs72 === errors; - if (valid7) { - let data25 = data23.ignoreDuplicateSlashes; - const _errs74 = errors; - if (typeof data25 !== "boolean") { - let coerced27 = void 0; - if (!(coerced27 !== void 0)) { - if (data25 === "false" || data25 === 0 || data25 === null) { - coerced27 = false; - } else if (data25 === "true" || data25 === 1) { - coerced27 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/routerOptions/ignoreDuplicateSlashes", schemaPath: "#/properties/routerOptions/properties/ignoreDuplicateSlashes/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced27 !== void 0) { - data25 = coerced27; - if (data23 !== void 0) { - data23["ignoreDuplicateSlashes"] = coerced27; - } - } - } - var valid7 = _errs74 === errors; - if (valid7) { - let data26 = data23.maxParamLength; - const _errs76 = errors; - if (!(typeof data26 == "number" && (!(data26 % 1) && !isNaN(data26)) && isFinite(data26))) { - let dataType28 = typeof data26; - let coerced28 = void 0; - if (!(coerced28 !== void 0)) { - if (dataType28 === "boolean" || data26 === null || dataType28 === "string" && data26 && data26 == +data26 && !(data26 % 1)) { - coerced28 = +data26; - } else { - validate10.errors = [{ instancePath: instancePath + "/routerOptions/maxParamLength", schemaPath: "#/properties/routerOptions/properties/maxParamLength/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }]; - return false; - } - } - if (coerced28 !== void 0) { - data26 = coerced28; - if (data23 !== void 0) { - data23["maxParamLength"] = coerced28; - } - } - } - var valid7 = _errs76 === errors; - if (valid7) { - let data27 = data23.allowUnsafeRegex; - const _errs78 = errors; - if (typeof data27 !== "boolean") { - let coerced29 = void 0; - if (!(coerced29 !== void 0)) { - if (data27 === "false" || data27 === 0 || data27 === null) { - coerced29 = false; - } else if (data27 === "true" || data27 === 1) { - coerced29 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/routerOptions/allowUnsafeRegex", schemaPath: "#/properties/routerOptions/properties/allowUnsafeRegex/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced29 !== void 0) { - data27 = coerced29; - if (data23 !== void 0) { - data23["allowUnsafeRegex"] = coerced29; - } - } - } - var valid7 = _errs78 === errors; - if (valid7) { - let data28 = data23.useSemicolonDelimiter; - const _errs80 = errors; - if (typeof data28 !== "boolean") { - let coerced30 = void 0; - if (!(coerced30 !== void 0)) { - if (data28 === "false" || data28 === 0 || data28 === null) { - coerced30 = false; - } else if (data28 === "true" || data28 === 1) { - coerced30 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/routerOptions/useSemicolonDelimiter", schemaPath: "#/properties/routerOptions/properties/useSemicolonDelimiter/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced30 !== void 0) { - data28 = coerced30; - if (data23 !== void 0) { - data23["useSemicolonDelimiter"] = coerced30; - } - } - } - var valid7 = _errs80 === errors; - } - } - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/routerOptions", schemaPath: "#/properties/routerOptions/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid0 = _errs69 === errors; - } else { - var valid0 = true; - } - if (valid0) { - if (data.constraints !== void 0) { - let data29 = data.constraints; - const _errs82 = errors; - if (errors === _errs82) { - if (data29 && typeof data29 == "object" && !Array.isArray(data29)) { - for (const key2 in data29) { - let data30 = data29[key2]; - const _errs85 = errors; - if (errors === _errs85) { - if (data30 && typeof data30 == "object" && !Array.isArray(data30)) { - let missing1; - if (data30.name === void 0 && (missing1 = "name") || data30.storage === void 0 && (missing1 = "storage") || data30.validate === void 0 && (missing1 = "validate") || data30.deriveConstraint === void 0 && (missing1 = "deriveConstraint")) { - validate10.errors = [{ instancePath: instancePath + "/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/constraints/additionalProperties/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }]; - return false; - } else { - if (data30.name !== void 0) { - let data31 = data30.name; - if (typeof data31 !== "string") { - let dataType31 = typeof data31; - let coerced31 = void 0; - if (!(coerced31 !== void 0)) { - if (dataType31 == "number" || dataType31 == "boolean") { - coerced31 = "" + data31; - } else if (data31 === null) { - coerced31 = ""; - } else { - validate10.errors = [{ instancePath: instancePath + "/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1") + "/name", schemaPath: "#/properties/constraints/additionalProperties/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - if (coerced31 !== void 0) { - data31 = coerced31; - if (data30 !== void 0) { - data30["name"] = coerced31; - } - } - } - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/properties/constraints/additionalProperties/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid8 = _errs85 === errors; - if (!valid8) { - break; - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/constraints", schemaPath: "#/properties/constraints/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid0 = _errs82 === errors; - } else { - var valid0 = true; - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } - } else { - validate10.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - validate10.errors = vErrors; - return errors === 0; - } - module2.exports.defaultInitOptions = { "connectionTimeout": 0, "keepAliveTimeout": 72e3, "maxRequestsPerSocket": 0, "requestTimeout": 0, "handlerTimeout": 0, "bodyLimit": 1048576, "caseSensitive": true, "allowUnsafeRegex": false, "disableRequestLogging": false, "ignoreTrailingSlash": false, "ignoreDuplicateSlashes": false, "maxParamLength": 100, "onProtoPoisoning": "error", "onConstructorPoisoning": "error", "pluginTimeout": 1e4, "requestIdHeader": false, "requestIdLogLabel": "reqId", "http2SessionTimeout": 72e3, "exposeHeadRoutes": true, "useSemicolonDelimiter": false, "allowErrorHandlerOverride": true, "routerOptions": { "ignoreTrailingSlash": false, "ignoreDuplicateSlashes": false, "maxParamLength": 100, "allowUnsafeRegex": false, "useSemicolonDelimiter": false } }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/initial-config-validation.js -var require_initial_config_validation = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/initial-config-validation.js"(exports2, module2) { - "use strict"; - var validate3 = require_config_validator(); - var deepClone = require_rfdc()({ circles: true, proto: false }); - var { FST_ERR_INIT_OPTS_INVALID } = require_errors2(); - function validateInitialConfig(options) { - const opts = deepClone(options); - if (!validate3(opts)) { - const error = new FST_ERR_INIT_OPTS_INVALID(JSON.stringify(validate3.errors.map((e) => e.message))); - error.errors = validate3.errors; - throw error; - } - return deepFreezeObject(opts); - } - function deepFreezeObject(object) { - const properties = Object.getOwnPropertyNames(object); - for (const name of properties) { - const value = object[name]; - if (ArrayBuffer.isView(value) && !(value instanceof DataView)) { - continue; - } - object[name] = value && typeof value === "object" ? deepFreezeObject(value) : value; - } - return Object.freeze(object); - } - module2.exports = validateInitialConfig; - module2.exports.defaultInitOptions = validate3.defaultInitOptions; - module2.exports.utils = { deepFreezeObject }; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/plugin-override.js -var require_plugin_override = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/lib/plugin-override.js"(exports2, module2) { - "use strict"; - var { - kAvvioBoot, - kChildren, - kRoutePrefix, - kLogLevel, - kLogSerializers, - kHooks, - kSchemaController, - kContentTypeParser, - kReply, - kRequest, - kFourOhFour, - kPluginNameChain, - kErrorHandlerAlreadySet - } = require_symbols2(); - var Reply = require_reply(); - var Request2 = require_request(); - var SchemaController = require_schema_controller(); - var ContentTypeParser = require_content_type_parser(); - var { buildHooks } = require_hooks(); - var pluginUtils = require_plugin_utils(); - module2.exports = function override(old, fn, opts) { - const shouldSkipOverride = pluginUtils.registerPlugin.call(old, fn); - const fnName = pluginUtils.getPluginName(fn) || pluginUtils.getFuncPreview(fn); - if (shouldSkipOverride) { - old[kPluginNameChain].push(fnName); - return old; - } - const instance2 = Object.create(old); - old[kChildren].push(instance2); - instance2.ready = old[kAvvioBoot].bind(instance2); - instance2[kChildren] = []; - instance2[kReply] = Reply.buildReply(instance2[kReply]); - instance2[kRequest] = Request2.buildRequest(instance2[kRequest]); - instance2[kContentTypeParser] = ContentTypeParser.helpers.buildContentTypeParser(instance2[kContentTypeParser]); - instance2[kHooks] = buildHooks(instance2[kHooks]); - instance2[kRoutePrefix] = buildRoutePrefix(instance2[kRoutePrefix], opts.prefix); - instance2[kLogLevel] = opts.logLevel || instance2[kLogLevel]; - instance2[kSchemaController] = SchemaController.buildSchemaController(old[kSchemaController]); - instance2.getSchema = instance2[kSchemaController].getSchema.bind(instance2[kSchemaController]); - instance2.getSchemas = instance2[kSchemaController].getSchemas.bind(instance2[kSchemaController]); - instance2[pluginUtils.kRegisteredPlugins] = Object.create(instance2[pluginUtils.kRegisteredPlugins]); - instance2[kPluginNameChain] = [fnName]; - instance2[kErrorHandlerAlreadySet] = false; - if (instance2[kLogSerializers] || opts.logSerializers) { - instance2[kLogSerializers] = Object.assign(Object.create(instance2[kLogSerializers]), opts.logSerializers); - } - if (opts.prefix) { - instance2[kFourOhFour].arrange404(instance2); - } - for (const hook of instance2[kHooks].onRegister) - hook.call(old, instance2, opts); - return instance2; - }; - function buildRoutePrefix(instancePrefix, pluginPrefix) { - if (!pluginPrefix) { - return instancePrefix; - } - if (instancePrefix.endsWith("/") && pluginPrefix[0] === "/") { - pluginPrefix = pluginPrefix.slice(1); - } else if (pluginPrefix[0] !== "/") { - pluginPrefix = "/" + pluginPrefix; - } - return instancePrefix + pluginPrefix; - } - } -}); - -// ../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js -var require_dist4 = __commonJS({ - "../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.parseCookie = parseCookie; - exports2.parse = parseCookie; - exports2.stringifyCookie = stringifyCookie; - exports2.stringifySetCookie = stringifySetCookie; - exports2.serialize = stringifySetCookie; - exports2.parseSetCookie = parseSetCookie; - exports2.stringifySetCookie = stringifySetCookie; - exports2.serialize = stringifySetCookie; - var cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/; - var cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/; - var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i; - var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/; - var maxAgeRegExp = /^-?\d+$/; - var __toString = Object.prototype.toString; - var NullObject = /* @__PURE__ */ (() => { - const C = function() { - }; - C.prototype = /* @__PURE__ */ Object.create(null); - return C; - })(); - function parseCookie(str, options) { - const obj = new NullObject(); - const len = str.length; - if (len < 2) - return obj; - const dec = options?.decode || decode; - let index = 0; - do { - const eqIdx = eqIndex(str, index, len); - if (eqIdx === -1) - break; - const endIdx = endIndex(str, index, len); - if (eqIdx > endIdx) { - index = str.lastIndexOf(";", eqIdx - 1) + 1; - continue; - } - const key = valueSlice(str, index, eqIdx); - if (obj[key] === void 0) { - obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx)); - } - index = endIdx + 1; - } while (index < len); - return obj; - } - function stringifyCookie(cookie, options) { - const enc = options?.encode || encodeURIComponent; - const cookieStrings = []; - for (const name of Object.keys(cookie)) { - const val = cookie[name]; - if (val === void 0) - continue; - if (!cookieNameRegExp.test(name)) { - throw new TypeError(`cookie name is invalid: ${name}`); - } - const value = enc(val); - if (!cookieValueRegExp.test(value)) { - throw new TypeError(`cookie val is invalid: ${val}`); - } - cookieStrings.push(`${name}=${value}`); - } - return cookieStrings.join("; "); - } - function stringifySetCookie(_name, _val, _opts) { - const cookie = typeof _name === "object" ? _name : { ..._opts, name: _name, value: String(_val) }; - const options = typeof _val === "object" ? _val : _opts; - const enc = options?.encode || encodeURIComponent; - if (!cookieNameRegExp.test(cookie.name)) { - throw new TypeError(`argument name is invalid: ${cookie.name}`); - } - const value = cookie.value ? enc(cookie.value) : ""; - if (!cookieValueRegExp.test(value)) { - throw new TypeError(`argument val is invalid: ${cookie.value}`); - } - let str = cookie.name + "=" + value; - if (cookie.maxAge !== void 0) { - if (!Number.isInteger(cookie.maxAge)) { - throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`); - } - str += "; Max-Age=" + cookie.maxAge; - } - if (cookie.domain) { - if (!domainValueRegExp.test(cookie.domain)) { - throw new TypeError(`option domain is invalid: ${cookie.domain}`); - } - str += "; Domain=" + cookie.domain; - } - if (cookie.path) { - if (!pathValueRegExp.test(cookie.path)) { - throw new TypeError(`option path is invalid: ${cookie.path}`); - } - str += "; Path=" + cookie.path; - } - if (cookie.expires) { - if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) { - throw new TypeError(`option expires is invalid: ${cookie.expires}`); - } - str += "; Expires=" + cookie.expires.toUTCString(); - } - if (cookie.httpOnly) { - str += "; HttpOnly"; - } - if (cookie.secure) { - str += "; Secure"; - } - if (cookie.partitioned) { - str += "; Partitioned"; - } - if (cookie.priority) { - const priority = typeof cookie.priority === "string" ? cookie.priority.toLowerCase() : void 0; - switch (priority) { - case "low": - str += "; Priority=Low"; - break; - case "medium": - str += "; Priority=Medium"; - break; - case "high": - str += "; Priority=High"; - break; - default: - throw new TypeError(`option priority is invalid: ${cookie.priority}`); - } - } - if (cookie.sameSite) { - const sameSite = typeof cookie.sameSite === "string" ? cookie.sameSite.toLowerCase() : cookie.sameSite; - switch (sameSite) { - case true: - case "strict": - str += "; SameSite=Strict"; - break; - case "lax": - str += "; SameSite=Lax"; - break; - case "none": - str += "; SameSite=None"; - break; - default: - throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`); - } - } - return str; - } - function parseSetCookie(str, options) { - const dec = options?.decode || decode; - const len = str.length; - const endIdx = endIndex(str, 0, len); - const eqIdx = eqIndex(str, 0, endIdx); - const setCookie = eqIdx === -1 ? { name: "", value: dec(valueSlice(str, 0, endIdx)) } : { - name: valueSlice(str, 0, eqIdx), - value: dec(valueSlice(str, eqIdx + 1, endIdx)) - }; - let index = endIdx + 1; - while (index < len) { - const endIdx2 = endIndex(str, index, len); - const eqIdx2 = eqIndex(str, index, endIdx2); - const attr = eqIdx2 === -1 ? valueSlice(str, index, endIdx2) : valueSlice(str, index, eqIdx2); - const val = eqIdx2 === -1 ? void 0 : valueSlice(str, eqIdx2 + 1, endIdx2); - switch (attr.toLowerCase()) { - case "httponly": - setCookie.httpOnly = true; - break; - case "secure": - setCookie.secure = true; - break; - case "partitioned": - setCookie.partitioned = true; - break; - case "domain": - setCookie.domain = val; - break; - case "path": - setCookie.path = val; - break; - case "max-age": - if (val && maxAgeRegExp.test(val)) - setCookie.maxAge = Number(val); - break; - case "expires": - if (!val) - break; - const date = new Date(val); - if (Number.isFinite(date.valueOf())) - setCookie.expires = date; - break; - case "priority": - if (!val) - break; - const priority = val.toLowerCase(); - if (priority === "low" || priority === "medium" || priority === "high") { - setCookie.priority = priority; - } - break; - case "samesite": - if (!val) - break; - const sameSite = val.toLowerCase(); - if (sameSite === "lax" || sameSite === "strict" || sameSite === "none") { - setCookie.sameSite = sameSite; - } - break; - } - index = endIdx2 + 1; - } - return setCookie; - } - function endIndex(str, min, len) { - const index = str.indexOf(";", min); - return index === -1 ? len : index; - } - function eqIndex(str, min, max) { - const index = str.indexOf("=", min); - return index < max ? index : -1; - } - function valueSlice(str, min, max) { - let start = min; - let end = max; - do { - const code = str.charCodeAt(start); - if (code !== 32 && code !== 9) - break; - } while (++start < end); - while (end > start) { - const code = str.charCodeAt(end - 1); - if (code !== 32 && code !== 9) - break; - end--; - } - return str.slice(start, end); - } - function decode(str) { - if (str.indexOf("%") === -1) - return str; - try { - return decodeURIComponent(str); - } catch (e) { - return str; - } - } - function isDate(val) { - return __toString.call(val) === "[object Date]"; - } - } -}); - -// ../../node_modules/.pnpm/process-warning@4.0.1/node_modules/process-warning/index.js -var require_process_warning2 = __commonJS({ - "../../node_modules/.pnpm/process-warning@4.0.1/node_modules/process-warning/index.js"(exports2, module2) { - "use strict"; - var { format } = require("node:util"); - function createDeprecation(params) { - return createWarning({ ...params, name: "DeprecationWarning" }); - } - function createWarning({ name, code, message, unlimited = false } = {}) { - if (!name) - throw new Error("Warning name must not be empty"); - if (!code) - throw new Error("Warning code must not be empty"); - if (!message) - throw new Error("Warning message must not be empty"); - if (typeof unlimited !== "boolean") - throw new Error("Warning opts.unlimited must be a boolean"); - code = code.toUpperCase(); - let warningContainer = { - [name]: function(a, b, c) { - if (warning.emitted === true && warning.unlimited !== true) { - return; - } - warning.emitted = true; - process.emitWarning(warning.format(a, b, c), warning.name, warning.code); - } - }; - if (unlimited) { - warningContainer = { - [name]: function(a, b, c) { - warning.emitted = true; - process.emitWarning(warning.format(a, b, c), warning.name, warning.code); - } - }; - } - const warning = warningContainer[name]; - warning.emitted = false; - warning.message = message; - warning.unlimited = unlimited; - warning.code = code; - warning.format = function(a, b, c) { - let formatted; - if (a && b && c) { - formatted = format(message, a, b, c); - } else if (a && b) { - formatted = format(message, a, b); - } else if (a) { - formatted = format(message, a); - } else { - formatted = message; - } - return formatted; - }; - return warning; - } - var out = { createWarning, createDeprecation }; - module2.exports = out; - module2.exports.default = out; - module2.exports.processWarning = out; - } -}); - -// ../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/parse-url.js -var require_parse_url = __commonJS({ - "../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/parse-url.js"(exports2, module2) { - "use strict"; - var { URL: URL4 } = require("node:url"); - var BASE_URL = "http://localhost"; - module2.exports = function parseURL2(url, query) { - if ((typeof url === "string" || Object.prototype.toString.call(url) === "[object String]") && url.startsWith("//")) { - url = BASE_URL + url; - } - const result = typeof url === "object" ? Object.assign(new URL4(BASE_URL), url) : new URL4(url, BASE_URL); - if (typeof query === "string") { - query = new URLSearchParams(query); - for (const key of query.keys()) { - result.searchParams.delete(key); - for (const value of query.getAll(key)) { - result.searchParams.append(key, value); - } - } - } else { - const merged = Object.assign({}, url.query, query); - for (const key in merged) { - const value = merged[key]; - if (Array.isArray(value)) { - result.searchParams.delete(key); - for (const param of value) { - result.searchParams.append(key, param); - } - } else { - result.searchParams.set(key, value); - } - } - } - return result; - }; - } -}); - -// ../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/form-data.js -var require_form_data = __commonJS({ - "../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/form-data.js"(exports2, module2) { - "use strict"; - var { randomUUID: randomUUID2 } = require("node:crypto"); - var { Readable: Readable2 } = require("node:stream"); - var textEncoder; - function isFormDataLike(payload) { - return payload && typeof payload === "object" && typeof payload.append === "function" && typeof payload.delete === "function" && typeof payload.get === "function" && typeof payload.getAll === "function" && typeof payload.has === "function" && typeof payload.set === "function" && payload[Symbol.toStringTag] === "FormData"; - } - function formDataToStream(formdata) { - textEncoder = textEncoder ?? new TextEncoder(); - const boundary = `----formdata-${randomUUID2()}`; - const prefix = `--${boundary}\r -Content-Disposition: form-data`; - const escape2 = (str) => str.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); - const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); - const linebreak = new Uint8Array([13, 10]); - async function* asyncIterator() { - for (const [name, value] of formdata) { - if (typeof value === "string") { - yield textEncoder.encode(`${prefix}; name="${escape2(normalizeLinefeeds(name))}"\r -\r -`); - yield textEncoder.encode(`${normalizeLinefeeds(value)}\r -`); - } else { - let header = `${prefix}; name="${escape2(normalizeLinefeeds(name))}"`; - value.name && (header += `; filename="${escape2(value.name)}"`); - header += `\r -Content-Type: ${value.type || "application/octet-stream"}\r -\r -`; - yield textEncoder.encode(header); - if (value.stream) { - yield* value.stream(); - } else { - yield value; - } - yield linebreak; - } - } - yield textEncoder.encode(`--${boundary}--`); - } - const stream = Readable2.from(asyncIterator()); - return { - stream, - contentType: `multipart/form-data; boundary=${boundary}` - }; - } - module2.exports.isFormDataLike = isFormDataLike; - module2.exports.formDataToStream = formDataToStream; - } -}); - -// ../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/request.js -var require_request2 = __commonJS({ - "../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/request.js"(exports2, module2) { - "use strict"; - var { Readable: Readable2, addAbortSignal } = require("node:stream"); - var util = require("node:util"); - var cookie = require_dist4(); - var assert3 = require("node:assert"); - var { createDeprecation } = require_process_warning2(); - var parseURL2 = require_parse_url(); - var { isFormDataLike, formDataToStream } = require_form_data(); - var { EventEmitter: EventEmitter2 } = require("node:events"); - var FST_LIGHTMYREQUEST_DEP01 = createDeprecation({ - name: "FastifyDeprecationLightMyRequest", - code: "FST_LIGHTMYREQUEST_DEP01", - message: 'You are accessing "request.connection", use "request.socket" instead.' - }); - function hostHeaderFromURL(parsedURL) { - return parsedURL.port ? parsedURL.host : parsedURL.hostname + (parsedURL.protocol === "https:" ? ":443" : ":80"); - } - var MockSocket = class extends EventEmitter2 { - constructor(remoteAddress) { - super(); - this.remoteAddress = remoteAddress; - } - }; - function CustomRequest(options) { - return new _CustomLMRRequest(this); - function _CustomLMRRequest(obj) { - Request2.call(obj, { - ...options, - Request: void 0 - }); - Object.assign(this, obj); - for (const fn of Object.keys(Request2.prototype)) { - this.constructor.prototype[fn] = Request2.prototype[fn]; - } - util.inherits(this.constructor, options.Request); - return this; - } - } - function Request2(options) { - Readable2.call(this, { - autoDestroy: false - }); - const parsedURL = parseURL2(options.url || options.path, options.query); - this.url = parsedURL.pathname + parsedURL.search; - this.aborted = false; - this.httpVersionMajor = 1; - this.httpVersionMinor = 1; - this.httpVersion = "1.1"; - this.method = options.method ? options.method.toUpperCase() : "GET"; - this.headers = {}; - this.rawHeaders = []; - const headers = options.headers || {}; - for (const field in headers) { - const fieldLowerCase = field.toLowerCase(); - if ((fieldLowerCase === "user-agent" || fieldLowerCase === "content-type") && headers[field] === void 0) { - this.headers[fieldLowerCase] = void 0; - continue; - } - const value = headers[field]; - assert3(value !== void 0, 'invalid value "undefined" for header ' + field); - this.headers[fieldLowerCase] = "" + value; - } - if ("user-agent" in this.headers === false) { - this.headers["user-agent"] = "lightMyRequest"; - } - this.headers.host = this.headers.host || options.authority || hostHeaderFromURL(parsedURL); - if (options.cookies) { - const { cookies } = options; - const cookieValues = Object.keys(cookies).map((key) => cookie.serialize(key, cookies[key])); - if (this.headers.cookie) { - cookieValues.unshift(this.headers.cookie); - } - this.headers.cookie = cookieValues.join("; "); - } - this.socket = new MockSocket(options.remoteAddress || "127.0.0.1"); - Object.defineProperty(this, "connection", { - get() { - FST_LIGHTMYREQUEST_DEP01(); - return this.socket; - }, - configurable: true - }); - let payload = options.payload || options.body || null; - let payloadResume = payload && typeof payload.resume === "function"; - if (isFormDataLike(payload)) { - const stream = formDataToStream(payload); - payload = stream.stream; - payloadResume = true; - this.headers["content-type"] = stream.contentType; - this.headers["transfer-encoding"] = "chunked"; - } - if (payload && typeof payload !== "string" && !payloadResume && !Buffer.isBuffer(payload)) { - payload = JSON.stringify(payload); - if ("content-type" in this.headers === false) { - this.headers["content-type"] = "application/json"; - } - } - if (payload && !payloadResume && !Object.hasOwn(this.headers, "content-length")) { - this.headers["content-length"] = (Buffer.isBuffer(payload) ? payload.length : Buffer.byteLength(payload)).toString(); - } - for (const header of Object.keys(this.headers)) { - this.rawHeaders.push(header, this.headers[header]); - } - this._lightMyRequest = { - payload, - isDone: false, - simulate: options.simulate || {}, - payloadAsStream: options.payloadAsStream, - signal: options.signal - }; - const signal = options.signal; - if (signal) { - addAbortSignal(signal, this); - } - { - const payload2 = this._lightMyRequest.payload; - if (payload2?._readableState) { - this._read = readStream; - payload2.on("error", (err) => { - this.destroy(err); - }); - payload2.on("end", () => { - this.push(null); - }); - } else { - this._read = readEverythingElse; - } - } - return this; - } - function readStream() { - const payload = this._lightMyRequest.payload; - let more = true; - let pushed = false; - let chunk; - while (more && (chunk = payload.read())) { - pushed = true; - more = this.push(chunk); - } - if (more && !pushed) { - this._lightMyRequest.payload.once("readable", this._read.bind(this)); - } - } - function readEverythingElse() { - setImmediate(() => { - if (this._lightMyRequest.isDone) { - if (this._lightMyRequest.simulate.end !== false) { - this.push(null); - } - return; - } - this._lightMyRequest.isDone = true; - if (this._lightMyRequest.payload) { - if (this._lightMyRequest.simulate.split) { - this.push(this._lightMyRequest.payload.slice(0, 1)); - this.push(this._lightMyRequest.payload.slice(1)); - } else { - this.push(this._lightMyRequest.payload); - } - } - if (this._lightMyRequest.simulate.error) { - this.emit("error", new Error("Simulated")); - } - if (this._lightMyRequest.simulate.close) { - this.emit("close"); - } - if (this._lightMyRequest.simulate.end !== false) { - this.push(null); - } - }); - } - util.inherits(Request2, Readable2); - util.inherits(CustomRequest, Request2); - Request2.prototype.destroy = function(error) { - if (this.destroyed || this._lightMyRequest.isDone) - return; - this.destroyed = true; - if (error) { - this._error = true; - process.nextTick(() => this.emit("error", error)); - } - process.nextTick(() => this.emit("close")); - }; - module2.exports = Request2; - module2.exports.Request = Request2; - module2.exports.CustomRequest = CustomRequest; - } -}); - -// ../../node_modules/.pnpm/set-cookie-parser@2.7.2/node_modules/set-cookie-parser/lib/set-cookie.js -var require_set_cookie = __commonJS({ - "../../node_modules/.pnpm/set-cookie-parser@2.7.2/node_modules/set-cookie-parser/lib/set-cookie.js"(exports2, module2) { - "use strict"; - var defaultParseOptions = { - decodeValues: true, - map: false, - silent: false - }; - function isForbiddenKey(key) { - return typeof key !== "string" || key in {}; - } - function createNullObj() { - return /* @__PURE__ */ Object.create(null); - } - function isNonEmptyString(str) { - return typeof str === "string" && !!str.trim(); - } - function parseString(setCookieValue, options) { - var parts = setCookieValue.split(";").filter(isNonEmptyString); - var nameValuePairStr = parts.shift(); - var parsed = parseNameValuePair(nameValuePairStr); - var name = parsed.name; - var value = parsed.value; - options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions; - if (isForbiddenKey(name)) { - return null; - } - try { - value = options.decodeValues ? decodeURIComponent(value) : value; - } catch (e) { - console.error( - "set-cookie-parser: failed to decode cookie value. Set options.decodeValues=false to disable decoding.", - e - ); - } - var cookie = createNullObj(); - cookie.name = name; - cookie.value = value; - parts.forEach(function(part) { - var sides = part.split("="); - var key = sides.shift().trimLeft().toLowerCase(); - if (isForbiddenKey(key)) { - return; - } - var value2 = sides.join("="); - if (key === "expires") { - cookie.expires = new Date(value2); - } else if (key === "max-age") { - var n = parseInt(value2, 10); - if (!Number.isNaN(n)) - cookie.maxAge = n; - } else if (key === "secure") { - cookie.secure = true; - } else if (key === "httponly") { - cookie.httpOnly = true; - } else if (key === "samesite") { - cookie.sameSite = value2; - } else if (key === "partitioned") { - cookie.partitioned = true; - } else if (key) { - cookie[key] = value2; - } - }); - return cookie; - } - function parseNameValuePair(nameValuePairStr) { - var name = ""; - var value = ""; - var nameValueArr = nameValuePairStr.split("="); - if (nameValueArr.length > 1) { - name = nameValueArr.shift(); - value = nameValueArr.join("="); - } else { - value = nameValuePairStr; - } - return { name, value }; - } - function parse2(input, options) { - options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions; - if (!input) { - if (!options.map) { - return []; - } else { - return createNullObj(); - } - } - if (input.headers) { - if (typeof input.headers.getSetCookie === "function") { - input = input.headers.getSetCookie(); - } else if (input.headers["set-cookie"]) { - input = input.headers["set-cookie"]; - } else { - var sch = input.headers[Object.keys(input.headers).find(function(key) { - return key.toLowerCase() === "set-cookie"; - })]; - if (!sch && input.headers.cookie && !options.silent) { - console.warn( - "Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning." - ); - } - input = sch; - } - } - if (!Array.isArray(input)) { - input = [input]; - } - if (!options.map) { - return input.filter(isNonEmptyString).map(function(str) { - return parseString(str, options); - }).filter(Boolean); - } else { - var cookies = createNullObj(); - return input.filter(isNonEmptyString).reduce(function(cookies2, str) { - var cookie = parseString(str, options); - if (cookie && !isForbiddenKey(cookie.name)) { - cookies2[cookie.name] = cookie; - } - return cookies2; - }, cookies); - } - } - function splitCookiesString(cookiesString) { - if (Array.isArray(cookiesString)) { - return cookiesString; - } - if (typeof cookiesString !== "string") { - return []; - } - var cookiesStrings = []; - var pos = 0; - var start; - var ch; - var lastComma; - var nextStart; - var cookiesSeparatorFound; - function skipWhitespace() { - while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) { - pos += 1; - } - return pos < cookiesString.length; - } - function notSpecialChar() { - ch = cookiesString.charAt(pos); - return ch !== "=" && ch !== ";" && ch !== ","; - } - while (pos < cookiesString.length) { - start = pos; - cookiesSeparatorFound = false; - while (skipWhitespace()) { - ch = cookiesString.charAt(pos); - if (ch === ",") { - lastComma = pos; - pos += 1; - skipWhitespace(); - nextStart = pos; - while (pos < cookiesString.length && notSpecialChar()) { - pos += 1; - } - if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") { - cookiesSeparatorFound = true; - pos = nextStart; - cookiesStrings.push(cookiesString.substring(start, lastComma)); - start = pos; - } else { - pos = lastComma + 1; - } - } else { - pos += 1; - } - } - if (!cookiesSeparatorFound || pos >= cookiesString.length) { - cookiesStrings.push(cookiesString.substring(start, cookiesString.length)); - } - } - return cookiesStrings; - } - module2.exports = parse2; - module2.exports.parse = parse2; - module2.exports.parseString = parseString; - module2.exports.splitCookiesString = splitCookiesString; - } -}); - -// ../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/response.js -var require_response = __commonJS({ - "../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/response.js"(exports2, module2) { - "use strict"; - var http2 = require("node:http"); - var { Writable, Readable: Readable2, addAbortSignal } = require("node:stream"); - var util = require("node:util"); - var setCookie = require_set_cookie(); - function Response2(req, onEnd, reject) { - http2.ServerResponse.call(this, req); - if (req._lightMyRequest?.payloadAsStream) { - const read = this.emit.bind(this, "drain"); - this._lightMyRequest = { headers: null, trailers: {}, stream: new Readable2({ read }) }; - const signal = req._lightMyRequest.signal; - if (signal) { - addAbortSignal(signal, this._lightMyRequest.stream); - } - } else { - this._lightMyRequest = { headers: null, trailers: {}, payloadChunks: [] }; - } - this.setHeader("foo", "bar"); - this.removeHeader("foo"); - this.assignSocket(getNullSocket()); - this._promiseCallback = typeof reject === "function"; - let called = false; - const onEndSuccess = (payload) => { - if (called) - return; - called = true; - if (this._promiseCallback) { - return process.nextTick(() => onEnd(payload)); - } - process.nextTick(() => onEnd(null, payload)); - }; - this._lightMyRequest.onEndSuccess = onEndSuccess; - let finished = false; - const onEndFailure = (err) => { - if (called) { - if (this._lightMyRequest.stream && !finished) { - if (!err) { - err = new Error("response destroyed before completion"); - err.code = "LIGHT_ECONNRESET"; - } - this._lightMyRequest.stream.destroy(err); - this._lightMyRequest.stream.on("error", () => { - }); - } - return; - } - called = true; - if (!err) { - err = new Error("response destroyed before completion"); - err.code = "LIGHT_ECONNRESET"; - } - if (this._promiseCallback) { - return process.nextTick(() => reject(err)); - } - process.nextTick(() => onEnd(err, null)); - }; - if (this._lightMyRequest.stream) { - this.once("finish", () => { - finished = true; - this._lightMyRequest.stream.push(null); - }); - } else { - this.once("finish", () => { - const res = generatePayload(this); - res.raw.req = req; - onEndSuccess(res); - }); - } - this.connection.once("error", onEndFailure); - this.once("error", onEndFailure); - this.once("close", onEndFailure); - } - util.inherits(Response2, http2.ServerResponse); - Response2.prototype.setTimeout = function(msecs, callback) { - this.timeoutHandle = setTimeout(() => { - this.emit("timeout"); - }, msecs); - this.on("timeout", callback); - return this; - }; - Response2.prototype.writeHead = function() { - const result = http2.ServerResponse.prototype.writeHead.apply(this, arguments); - copyHeaders(this); - if (this._lightMyRequest.stream) { - this._lightMyRequest.onEndSuccess(generatePayload(this)); - } - return result; - }; - Response2.prototype.write = function(data, encoding, callback) { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - } - http2.ServerResponse.prototype.write.call(this, data, encoding, callback); - if (this._lightMyRequest.stream) { - return this._lightMyRequest.stream.push(Buffer.from(data, encoding)); - } else { - this._lightMyRequest.payloadChunks.push(Buffer.from(data, encoding)); - return true; - } - }; - Response2.prototype.end = function(data, encoding, callback) { - if (data) { - this.write(data, encoding); - } - http2.ServerResponse.prototype.end.call(this, callback); - this.emit("finish"); - this.destroy(); - }; - Response2.prototype.destroy = function(error) { - if (this.destroyed) - return; - this.destroyed = true; - if (error) { - process.nextTick(() => this.emit("error", error)); - } - process.nextTick(() => this.emit("close")); - }; - Response2.prototype.addTrailers = function(trailers) { - for (const key in trailers) { - this._lightMyRequest.trailers[key.toLowerCase().trim()] = trailers[key].toString().trim(); - } - }; - function generatePayload(response) { - if (response._lightMyRequest.headers === null) { - copyHeaders(response); - } - serializeHeaders(response); - const res = { - raw: { - res: response - }, - headers: response._lightMyRequest.headers, - statusCode: response.statusCode, - statusMessage: response.statusMessage, - trailers: {}, - get cookies() { - return setCookie.parse(this); - } - }; - res.trailers = response._lightMyRequest.trailers; - if (response._lightMyRequest.payloadChunks) { - const rawBuffer = Buffer.concat(response._lightMyRequest.payloadChunks); - res.rawPayload = rawBuffer; - res.payload = rawBuffer.toString(); - res.body = res.payload; - res.json = function parseJsonPayload() { - return JSON.parse(res.payload); - }; - } else { - res.json = function() { - throw new Error("Response payload is not available with payloadAsStream: true"); - }; - } - res.stream = function streamPayload() { - if (response._lightMyRequest.stream) { - return response._lightMyRequest.stream; - } - return Readable2.from(response._lightMyRequest.payloadChunks); - }; - return res; - } - function getNullSocket() { - return new Writable({ - write(_chunk, _encoding, callback) { - setImmediate(callback); - } - }); - } - function serializeHeaders(response) { - const headers = response._lightMyRequest.headers; - for (const headerName of Object.keys(headers)) { - const headerValue = headers[headerName]; - if (Array.isArray(headerValue)) { - headers[headerName] = headerValue.map((value) => "" + value); - } else { - headers[headerName] = "" + headerValue; - } - } - } - function copyHeaders(response) { - response._lightMyRequest.headers = Object.assign({}, response.getHeaders()); - ["Date", "Connection", "Transfer-Encoding"].forEach((name) => { - const regex = new RegExp("\\r\\n" + name + ": ([^\\r]*)\\r\\n"); - const field = response._header?.match(regex); - if (field) { - response._lightMyRequest.headers[name.toLowerCase()] = field[1]; - } - }); - } - module2.exports = Response2; - } -}); - -// ../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/config-validator.js -var require_config_validator2 = __commonJS({ - "../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/lib/config-validator.js"(exports2, module2) { - "use strict"; - module2.exports = validate10; - module2.exports.default = validate10; - var schema11 = { "type": "object", "properties": { "url": { "oneOf": [{ "type": "string" }, { "type": "object", "properties": { "protocol": { "type": "string" }, "hostname": { "type": "string" }, "pathname": { "type": "string" } }, "additionalProperties": true, "required": ["pathname"] }] }, "path": { "oneOf": [{ "type": "string" }, { "type": "object", "properties": { "protocol": { "type": "string" }, "hostname": { "type": "string" }, "pathname": { "type": "string" } }, "additionalProperties": true, "required": ["pathname"] }] }, "cookies": { "type": "object", "additionalProperties": true }, "headers": { "type": "object", "additionalProperties": true }, "query": { "anyOf": [{ "type": "object", "additionalProperties": true }, { "type": "string" }] }, "simulate": { "type": "object", "properties": { "end": { "type": "boolean" }, "split": { "type": "boolean" }, "error": { "type": "boolean" }, "close": { "type": "boolean" } } }, "authority": { "type": "string" }, "remoteAddress": { "type": "string" }, "method": { "type": "string", "enum": ["ACL", "BIND", "CHECKOUT", "CONNECT", "COPY", "DELETE", "GET", "HEAD", "LINK", "LOCK", "M-SEARCH", "MERGE", "MKACTIVITY", "MKCALENDAR", "MKCOL", "MOVE", "NOTIFY", "OPTIONS", "PATCH", "POST", "PROPFIND", "PROPPATCH", "PURGE", "PUT", "QUERY", "REBIND", "REPORT", "SEARCH", "SOURCE", "SUBSCRIBE", "TRACE", "UNBIND", "UNLINK", "UNLOCK", "UNSUBSCRIBE", "acl", "bind", "checkout", "connect", "copy", "delete", "get", "head", "link", "lock", "m-search", "merge", "mkactivity", "mkcalendar", "mkcol", "move", "notify", "options", "patch", "post", "propfind", "proppatch", "purge", "put", "query", "rebind", "report", "search", "source", "subscribe", "trace", "unbind", "unlink", "unlock", "unsubscribe"] }, "validate": { "type": "boolean" } }, "additionalProperties": true, "oneOf": [{ "required": ["url"] }, { "required": ["path"] }] }; - function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { - let vErrors = null; - let errors = 0; - const _errs1 = errors; - let valid0 = false; - let passing0 = null; - const _errs2 = errors; - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing0; - if (data.url === void 0 && (missing0 = "url")) { - const err0 = { instancePath, schemaPath: "#/oneOf/0/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }; - if (vErrors === null) { - vErrors = [err0]; - } else { - vErrors.push(err0); - } - errors++; - } - } - var _valid0 = _errs2 === errors; - if (_valid0) { - valid0 = true; - passing0 = 0; - } - const _errs3 = errors; - if (data && typeof data == "object" && !Array.isArray(data)) { - let missing1; - if (data.path === void 0 && (missing1 = "path")) { - const err1 = { instancePath, schemaPath: "#/oneOf/1/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }; - if (vErrors === null) { - vErrors = [err1]; - } else { - vErrors.push(err1); - } - errors++; - } - } - var _valid0 = _errs3 === errors; - if (_valid0 && valid0) { - valid0 = false; - passing0 = [passing0, 1]; - } else { - if (_valid0) { - valid0 = true; - passing0 = 1; - } - } - if (!valid0) { - const err2 = { instancePath, schemaPath: "#/oneOf", keyword: "oneOf", params: { passingSchemas: passing0 }, message: "must match exactly one schema in oneOf" }; - if (vErrors === null) { - vErrors = [err2]; - } else { - vErrors.push(err2); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs1; - if (vErrors !== null) { - if (_errs1) { - vErrors.length = _errs1; - } else { - vErrors = null; - } - } - } - if (errors === 0) { - if (data && typeof data == "object" && !Array.isArray(data)) { - if (data.url !== void 0) { - let data0 = data.url; - const _errs5 = errors; - const _errs6 = errors; - let valid2 = false; - let passing1 = null; - const _errs7 = errors; - if (typeof data0 !== "string") { - let dataType0 = typeof data0; - let coerced0 = void 0; - if (!(coerced0 !== void 0)) { - if (dataType0 == "number" || dataType0 == "boolean") { - coerced0 = "" + data0; - } else if (data0 === null) { - coerced0 = ""; - } else { - const err3 = { instancePath: instancePath + "/url", schemaPath: "#/properties/url/oneOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err3]; - } else { - vErrors.push(err3); - } - errors++; - } - } - if (coerced0 !== void 0) { - data0 = coerced0; - if (data !== void 0) { - data["url"] = coerced0; - } - } - } - var _valid1 = _errs7 === errors; - if (_valid1) { - valid2 = true; - passing1 = 0; - } - const _errs9 = errors; - if (errors === _errs9) { - if (data0 && typeof data0 == "object" && !Array.isArray(data0)) { - let missing2; - if (data0.pathname === void 0 && (missing2 = "pathname")) { - const err4 = { instancePath: instancePath + "/url", schemaPath: "#/properties/url/oneOf/1/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" }; - if (vErrors === null) { - vErrors = [err4]; - } else { - vErrors.push(err4); - } - errors++; - } else { - if (data0.protocol !== void 0) { - let data1 = data0.protocol; - const _errs12 = errors; - if (typeof data1 !== "string") { - let dataType1 = typeof data1; - let coerced1 = void 0; - if (!(coerced1 !== void 0)) { - if (dataType1 == "number" || dataType1 == "boolean") { - coerced1 = "" + data1; - } else if (data1 === null) { - coerced1 = ""; - } else { - const err5 = { instancePath: instancePath + "/url/protocol", schemaPath: "#/properties/url/oneOf/1/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err5]; - } else { - vErrors.push(err5); - } - errors++; - } - } - if (coerced1 !== void 0) { - data1 = coerced1; - if (data0 !== void 0) { - data0["protocol"] = coerced1; - } - } - } - var valid3 = _errs12 === errors; - } else { - var valid3 = true; - } - if (valid3) { - if (data0.hostname !== void 0) { - let data2 = data0.hostname; - const _errs14 = errors; - if (typeof data2 !== "string") { - let dataType2 = typeof data2; - let coerced2 = void 0; - if (!(coerced2 !== void 0)) { - if (dataType2 == "number" || dataType2 == "boolean") { - coerced2 = "" + data2; - } else if (data2 === null) { - coerced2 = ""; - } else { - const err6 = { instancePath: instancePath + "/url/hostname", schemaPath: "#/properties/url/oneOf/1/properties/hostname/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err6]; - } else { - vErrors.push(err6); - } - errors++; - } - } - if (coerced2 !== void 0) { - data2 = coerced2; - if (data0 !== void 0) { - data0["hostname"] = coerced2; - } - } - } - var valid3 = _errs14 === errors; - } else { - var valid3 = true; - } - if (valid3) { - if (data0.pathname !== void 0) { - let data3 = data0.pathname; - const _errs16 = errors; - if (typeof data3 !== "string") { - let dataType3 = typeof data3; - let coerced3 = void 0; - if (!(coerced3 !== void 0)) { - if (dataType3 == "number" || dataType3 == "boolean") { - coerced3 = "" + data3; - } else if (data3 === null) { - coerced3 = ""; - } else { - const err7 = { instancePath: instancePath + "/url/pathname", schemaPath: "#/properties/url/oneOf/1/properties/pathname/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err7]; - } else { - vErrors.push(err7); - } - errors++; - } - } - if (coerced3 !== void 0) { - data3 = coerced3; - if (data0 !== void 0) { - data0["pathname"] = coerced3; - } - } - } - var valid3 = _errs16 === errors; - } else { - var valid3 = true; - } - } - } - } - } else { - const err8 = { instancePath: instancePath + "/url", schemaPath: "#/properties/url/oneOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }; - if (vErrors === null) { - vErrors = [err8]; - } else { - vErrors.push(err8); - } - errors++; - } - } - var _valid1 = _errs9 === errors; - if (_valid1 && valid2) { - valid2 = false; - passing1 = [passing1, 1]; - } else { - if (_valid1) { - valid2 = true; - passing1 = 1; - } - } - if (!valid2) { - const err9 = { instancePath: instancePath + "/url", schemaPath: "#/properties/url/oneOf", keyword: "oneOf", params: { passingSchemas: passing1 }, message: "must match exactly one schema in oneOf" }; - if (vErrors === null) { - vErrors = [err9]; - } else { - vErrors.push(err9); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs6; - if (vErrors !== null) { - if (_errs6) { - vErrors.length = _errs6; - } else { - vErrors = null; - } - } - } - var valid1 = _errs5 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.path !== void 0) { - let data4 = data.path; - const _errs18 = errors; - const _errs19 = errors; - let valid4 = false; - let passing2 = null; - const _errs20 = errors; - if (typeof data4 !== "string") { - let dataType4 = typeof data4; - let coerced4 = void 0; - if (!(coerced4 !== void 0)) { - if (dataType4 == "number" || dataType4 == "boolean") { - coerced4 = "" + data4; - } else if (data4 === null) { - coerced4 = ""; - } else { - const err10 = { instancePath: instancePath + "/path", schemaPath: "#/properties/path/oneOf/0/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err10]; - } else { - vErrors.push(err10); - } - errors++; - } - } - if (coerced4 !== void 0) { - data4 = coerced4; - if (data !== void 0) { - data["path"] = coerced4; - } - } - } - var _valid2 = _errs20 === errors; - if (_valid2) { - valid4 = true; - passing2 = 0; - } - const _errs22 = errors; - if (errors === _errs22) { - if (data4 && typeof data4 == "object" && !Array.isArray(data4)) { - let missing3; - if (data4.pathname === void 0 && (missing3 = "pathname")) { - const err11 = { instancePath: instancePath + "/path", schemaPath: "#/properties/path/oneOf/1/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" }; - if (vErrors === null) { - vErrors = [err11]; - } else { - vErrors.push(err11); - } - errors++; - } else { - if (data4.protocol !== void 0) { - let data5 = data4.protocol; - const _errs25 = errors; - if (typeof data5 !== "string") { - let dataType5 = typeof data5; - let coerced5 = void 0; - if (!(coerced5 !== void 0)) { - if (dataType5 == "number" || dataType5 == "boolean") { - coerced5 = "" + data5; - } else if (data5 === null) { - coerced5 = ""; - } else { - const err12 = { instancePath: instancePath + "/path/protocol", schemaPath: "#/properties/path/oneOf/1/properties/protocol/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err12]; - } else { - vErrors.push(err12); - } - errors++; - } - } - if (coerced5 !== void 0) { - data5 = coerced5; - if (data4 !== void 0) { - data4["protocol"] = coerced5; - } - } - } - var valid5 = _errs25 === errors; - } else { - var valid5 = true; - } - if (valid5) { - if (data4.hostname !== void 0) { - let data6 = data4.hostname; - const _errs27 = errors; - if (typeof data6 !== "string") { - let dataType6 = typeof data6; - let coerced6 = void 0; - if (!(coerced6 !== void 0)) { - if (dataType6 == "number" || dataType6 == "boolean") { - coerced6 = "" + data6; - } else if (data6 === null) { - coerced6 = ""; - } else { - const err13 = { instancePath: instancePath + "/path/hostname", schemaPath: "#/properties/path/oneOf/1/properties/hostname/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err13]; - } else { - vErrors.push(err13); - } - errors++; - } - } - if (coerced6 !== void 0) { - data6 = coerced6; - if (data4 !== void 0) { - data4["hostname"] = coerced6; - } - } - } - var valid5 = _errs27 === errors; - } else { - var valid5 = true; - } - if (valid5) { - if (data4.pathname !== void 0) { - let data7 = data4.pathname; - const _errs29 = errors; - if (typeof data7 !== "string") { - let dataType7 = typeof data7; - let coerced7 = void 0; - if (!(coerced7 !== void 0)) { - if (dataType7 == "number" || dataType7 == "boolean") { - coerced7 = "" + data7; - } else if (data7 === null) { - coerced7 = ""; - } else { - const err14 = { instancePath: instancePath + "/path/pathname", schemaPath: "#/properties/path/oneOf/1/properties/pathname/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err14]; - } else { - vErrors.push(err14); - } - errors++; - } - } - if (coerced7 !== void 0) { - data7 = coerced7; - if (data4 !== void 0) { - data4["pathname"] = coerced7; - } - } - } - var valid5 = _errs29 === errors; - } else { - var valid5 = true; - } - } - } - } - } else { - const err15 = { instancePath: instancePath + "/path", schemaPath: "#/properties/path/oneOf/1/type", keyword: "type", params: { type: "object" }, message: "must be object" }; - if (vErrors === null) { - vErrors = [err15]; - } else { - vErrors.push(err15); - } - errors++; - } - } - var _valid2 = _errs22 === errors; - if (_valid2 && valid4) { - valid4 = false; - passing2 = [passing2, 1]; - } else { - if (_valid2) { - valid4 = true; - passing2 = 1; - } - } - if (!valid4) { - const err16 = { instancePath: instancePath + "/path", schemaPath: "#/properties/path/oneOf", keyword: "oneOf", params: { passingSchemas: passing2 }, message: "must match exactly one schema in oneOf" }; - if (vErrors === null) { - vErrors = [err16]; - } else { - vErrors.push(err16); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs19; - if (vErrors !== null) { - if (_errs19) { - vErrors.length = _errs19; - } else { - vErrors = null; - } - } - } - var valid1 = _errs18 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.cookies !== void 0) { - let data8 = data.cookies; - const _errs31 = errors; - if (errors === _errs31) { - if (!(data8 && typeof data8 == "object" && !Array.isArray(data8))) { - validate10.errors = [{ instancePath: instancePath + "/cookies", schemaPath: "#/properties/cookies/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid1 = _errs31 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.headers !== void 0) { - let data9 = data.headers; - const _errs34 = errors; - if (errors === _errs34) { - if (!(data9 && typeof data9 == "object" && !Array.isArray(data9))) { - validate10.errors = [{ instancePath: instancePath + "/headers", schemaPath: "#/properties/headers/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid1 = _errs34 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.query !== void 0) { - let data10 = data.query; - const _errs37 = errors; - const _errs38 = errors; - let valid6 = false; - const _errs39 = errors; - if (errors === _errs39) { - if (!(data10 && typeof data10 == "object" && !Array.isArray(data10))) { - const err17 = { instancePath: instancePath + "/query", schemaPath: "#/properties/query/anyOf/0/type", keyword: "type", params: { type: "object" }, message: "must be object" }; - if (vErrors === null) { - vErrors = [err17]; - } else { - vErrors.push(err17); - } - errors++; - } - } - var _valid3 = _errs39 === errors; - valid6 = valid6 || _valid3; - if (!valid6) { - const _errs42 = errors; - if (typeof data10 !== "string") { - let dataType8 = typeof data10; - let coerced8 = void 0; - if (!(coerced8 !== void 0)) { - if (dataType8 == "number" || dataType8 == "boolean") { - coerced8 = "" + data10; - } else if (data10 === null) { - coerced8 = ""; - } else { - const err18 = { instancePath: instancePath + "/query", schemaPath: "#/properties/query/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" }; - if (vErrors === null) { - vErrors = [err18]; - } else { - vErrors.push(err18); - } - errors++; - } - } - if (coerced8 !== void 0) { - data10 = coerced8; - if (data !== void 0) { - data["query"] = coerced8; - } - } - } - var _valid3 = _errs42 === errors; - valid6 = valid6 || _valid3; - } - if (!valid6) { - const err19 = { instancePath: instancePath + "/query", schemaPath: "#/properties/query/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; - if (vErrors === null) { - vErrors = [err19]; - } else { - vErrors.push(err19); - } - errors++; - validate10.errors = vErrors; - return false; - } else { - errors = _errs38; - if (vErrors !== null) { - if (_errs38) { - vErrors.length = _errs38; - } else { - vErrors = null; - } - } - } - var valid1 = _errs37 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.simulate !== void 0) { - let data11 = data.simulate; - const _errs44 = errors; - if (errors === _errs44) { - if (data11 && typeof data11 == "object" && !Array.isArray(data11)) { - if (data11.end !== void 0) { - let data12 = data11.end; - const _errs46 = errors; - if (typeof data12 !== "boolean") { - let coerced9 = void 0; - if (!(coerced9 !== void 0)) { - if (data12 === "false" || data12 === 0 || data12 === null) { - coerced9 = false; - } else if (data12 === "true" || data12 === 1) { - coerced9 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/simulate/end", schemaPath: "#/properties/simulate/properties/end/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced9 !== void 0) { - data12 = coerced9; - if (data11 !== void 0) { - data11["end"] = coerced9; - } - } - } - var valid7 = _errs46 === errors; - } else { - var valid7 = true; - } - if (valid7) { - if (data11.split !== void 0) { - let data13 = data11.split; - const _errs48 = errors; - if (typeof data13 !== "boolean") { - let coerced10 = void 0; - if (!(coerced10 !== void 0)) { - if (data13 === "false" || data13 === 0 || data13 === null) { - coerced10 = false; - } else if (data13 === "true" || data13 === 1) { - coerced10 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/simulate/split", schemaPath: "#/properties/simulate/properties/split/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced10 !== void 0) { - data13 = coerced10; - if (data11 !== void 0) { - data11["split"] = coerced10; - } - } - } - var valid7 = _errs48 === errors; - } else { - var valid7 = true; - } - if (valid7) { - if (data11.error !== void 0) { - let data14 = data11.error; - const _errs50 = errors; - if (typeof data14 !== "boolean") { - let coerced11 = void 0; - if (!(coerced11 !== void 0)) { - if (data14 === "false" || data14 === 0 || data14 === null) { - coerced11 = false; - } else if (data14 === "true" || data14 === 1) { - coerced11 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/simulate/error", schemaPath: "#/properties/simulate/properties/error/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced11 !== void 0) { - data14 = coerced11; - if (data11 !== void 0) { - data11["error"] = coerced11; - } - } - } - var valid7 = _errs50 === errors; - } else { - var valid7 = true; - } - if (valid7) { - if (data11.close !== void 0) { - let data15 = data11.close; - const _errs52 = errors; - if (typeof data15 !== "boolean") { - let coerced12 = void 0; - if (!(coerced12 !== void 0)) { - if (data15 === "false" || data15 === 0 || data15 === null) { - coerced12 = false; - } else if (data15 === "true" || data15 === 1) { - coerced12 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/simulate/close", schemaPath: "#/properties/simulate/properties/close/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced12 !== void 0) { - data15 = coerced12; - if (data11 !== void 0) { - data11["close"] = coerced12; - } - } - } - var valid7 = _errs52 === errors; - } else { - var valid7 = true; - } - } - } - } - } else { - validate10.errors = [{ instancePath: instancePath + "/simulate", schemaPath: "#/properties/simulate/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - var valid1 = _errs44 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.authority !== void 0) { - let data16 = data.authority; - const _errs54 = errors; - if (typeof data16 !== "string") { - let dataType13 = typeof data16; - let coerced13 = void 0; - if (!(coerced13 !== void 0)) { - if (dataType13 == "number" || dataType13 == "boolean") { - coerced13 = "" + data16; - } else if (data16 === null) { - coerced13 = ""; - } else { - validate10.errors = [{ instancePath: instancePath + "/authority", schemaPath: "#/properties/authority/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - if (coerced13 !== void 0) { - data16 = coerced13; - if (data !== void 0) { - data["authority"] = coerced13; - } - } - } - var valid1 = _errs54 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.remoteAddress !== void 0) { - let data17 = data.remoteAddress; - const _errs56 = errors; - if (typeof data17 !== "string") { - let dataType14 = typeof data17; - let coerced14 = void 0; - if (!(coerced14 !== void 0)) { - if (dataType14 == "number" || dataType14 == "boolean") { - coerced14 = "" + data17; - } else if (data17 === null) { - coerced14 = ""; - } else { - validate10.errors = [{ instancePath: instancePath + "/remoteAddress", schemaPath: "#/properties/remoteAddress/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - if (coerced14 !== void 0) { - data17 = coerced14; - if (data !== void 0) { - data["remoteAddress"] = coerced14; - } - } - } - var valid1 = _errs56 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.method !== void 0) { - let data18 = data.method; - const _errs58 = errors; - if (typeof data18 !== "string") { - let dataType15 = typeof data18; - let coerced15 = void 0; - if (!(coerced15 !== void 0)) { - if (dataType15 == "number" || dataType15 == "boolean") { - coerced15 = "" + data18; - } else if (data18 === null) { - coerced15 = ""; - } else { - validate10.errors = [{ instancePath: instancePath + "/method", schemaPath: "#/properties/method/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; - return false; - } - } - if (coerced15 !== void 0) { - data18 = coerced15; - if (data !== void 0) { - data["method"] = coerced15; - } - } - } - if (!(data18 === "ACL" || data18 === "BIND" || data18 === "CHECKOUT" || data18 === "CONNECT" || data18 === "COPY" || data18 === "DELETE" || data18 === "GET" || data18 === "HEAD" || data18 === "LINK" || data18 === "LOCK" || data18 === "M-SEARCH" || data18 === "MERGE" || data18 === "MKACTIVITY" || data18 === "MKCALENDAR" || data18 === "MKCOL" || data18 === "MOVE" || data18 === "NOTIFY" || data18 === "OPTIONS" || data18 === "PATCH" || data18 === "POST" || data18 === "PROPFIND" || data18 === "PROPPATCH" || data18 === "PURGE" || data18 === "PUT" || data18 === "QUERY" || data18 === "REBIND" || data18 === "REPORT" || data18 === "SEARCH" || data18 === "SOURCE" || data18 === "SUBSCRIBE" || data18 === "TRACE" || data18 === "UNBIND" || data18 === "UNLINK" || data18 === "UNLOCK" || data18 === "UNSUBSCRIBE" || data18 === "acl" || data18 === "bind" || data18 === "checkout" || data18 === "connect" || data18 === "copy" || data18 === "delete" || data18 === "get" || data18 === "head" || data18 === "link" || data18 === "lock" || data18 === "m-search" || data18 === "merge" || data18 === "mkactivity" || data18 === "mkcalendar" || data18 === "mkcol" || data18 === "move" || data18 === "notify" || data18 === "options" || data18 === "patch" || data18 === "post" || data18 === "propfind" || data18 === "proppatch" || data18 === "purge" || data18 === "put" || data18 === "query" || data18 === "rebind" || data18 === "report" || data18 === "search" || data18 === "source" || data18 === "subscribe" || data18 === "trace" || data18 === "unbind" || data18 === "unlink" || data18 === "unlock" || data18 === "unsubscribe")) { - validate10.errors = [{ instancePath: instancePath + "/method", schemaPath: "#/properties/method/enum", keyword: "enum", params: { allowedValues: schema11.properties.method.enum }, message: "must be equal to one of the allowed values" }]; - return false; - } - var valid1 = _errs58 === errors; - } else { - var valid1 = true; - } - if (valid1) { - if (data.validate !== void 0) { - let data19 = data.validate; - const _errs60 = errors; - if (typeof data19 !== "boolean") { - let coerced16 = void 0; - if (!(coerced16 !== void 0)) { - if (data19 === "false" || data19 === 0 || data19 === null) { - coerced16 = false; - } else if (data19 === "true" || data19 === 1) { - coerced16 = true; - } else { - validate10.errors = [{ instancePath: instancePath + "/validate", schemaPath: "#/properties/validate/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }]; - return false; - } - } - if (coerced16 !== void 0) { - data19 = coerced16; - if (data !== void 0) { - data["validate"] = coerced16; - } - } - } - var valid1 = _errs60 === errors; - } else { - var valid1 = true; - } - } - } - } - } - } - } - } - } - } - } else { - validate10.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; - return false; - } - } - validate10.errors = vErrors; - return errors === 0; - } - } -}); - -// ../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/index.js -var require_light_my_request = __commonJS({ - "../../node_modules/.pnpm/light-my-request@6.6.0/node_modules/light-my-request/index.js"(exports2, module2) { - "use strict"; - var assert3 = require("node:assert"); - var Request2 = require_request2(); - var Response2 = require_response(); - var errorMessage = "The dispatch function has already been invoked"; - var optsValidator = require_config_validator2(); - function inject(dispatchFunc, options, callback) { - if (callback === void 0) { - return new Chain(dispatchFunc, options); - } else { - return doInject(dispatchFunc, options, callback); - } - } - function supportStream1(req, next) { - const payload = req._lightMyRequest.payload; - if (!payload || payload._readableState || typeof payload.resume !== "function") { - return next(); - } - const chunks = []; - payload.on("data", (chunk) => chunks.push(Buffer.from(chunk))); - payload.on("end", () => { - const payload2 = Buffer.concat(chunks); - req.headers["content-length"] = req.headers["content-length"] || "" + payload2.length; - delete req.headers["transfer-encoding"]; - req._lightMyRequest.payload = payload2; - return next(); - }); - payload.resume(); - } - function makeRequest(dispatchFunc, server, req, res) { - req.once("error", function(err) { - if (this.destroyed) - res.destroy(err); - }); - req.once("close", function() { - if (this.destroyed && !this._error) { - res.destroy(); - } - }); - return supportStream1(req, () => dispatchFunc.call(server, req, res)); - } - function doInject(dispatchFunc, options, callback) { - options = typeof options === "string" ? { url: options } : options; - if (options.validate !== false) { - assert3(typeof dispatchFunc === "function", "dispatchFunc should be a function"); - const isOptionValid = optsValidator(options); - if (!isOptionValid) { - throw new Error(optsValidator.errors.map((e) => e.message)); - } - } - const server = options.server || {}; - const RequestConstructor = options.Request ? Request2.CustomRequest : Request2; - if (dispatchFunc.request && dispatchFunc.request.app === dispatchFunc) { - Object.setPrototypeOf(Object.getPrototypeOf(dispatchFunc.request), RequestConstructor.prototype); - Object.setPrototypeOf(Object.getPrototypeOf(dispatchFunc.response), Response2.prototype); - } - if (typeof callback === "function") { - const req = new RequestConstructor(options); - const res = new Response2(req, callback); - return makeRequest(dispatchFunc, server, req, res); - } else { - return new Promise((resolve, reject) => { - const req = new RequestConstructor(options); - const res = new Response2(req, resolve, reject); - makeRequest(dispatchFunc, server, req, res); - }); - } - } - function Chain(dispatch, option) { - if (typeof option === "string") { - this.option = { url: option }; - } else { - this.option = Object.assign({}, option); - } - this.dispatch = dispatch; - this._hasInvoked = false; - this._promise = null; - if (this.option.autoStart !== false) { - process.nextTick(() => { - if (!this._hasInvoked) { - this.end(); - } - }); - } - } - var httpMethods = [ - "delete", - "get", - "head", - "options", - "patch", - "post", - "put", - "trace" - ]; - httpMethods.forEach((method) => { - Chain.prototype[method] = function(url) { - if (this._hasInvoked === true || this._promise) { - throw new Error(errorMessage); - } - this.option.url = url; - this.option.method = method.toUpperCase(); - return this; - }; - }); - var chainMethods = [ - "body", - "cookies", - "headers", - "payload", - "query" - ]; - chainMethods.forEach((method) => { - Chain.prototype[method] = function(value) { - if (this._hasInvoked === true || this._promise) { - throw new Error(errorMessage); - } - this.option[method] = value; - return this; - }; - }); - Chain.prototype.end = function(callback) { - if (this._hasInvoked === true || this._promise) { - throw new Error(errorMessage); - } - this._hasInvoked = true; - if (typeof callback === "function") { - doInject(this.dispatch, this.option, callback); - } else { - this._promise = doInject(this.dispatch, this.option); - return this._promise; - } - }; - Object.getOwnPropertyNames(Promise.prototype).forEach((method) => { - if (method === "constructor") - return; - Chain.prototype[method] = function(...args) { - if (!this._promise) { - if (this._hasInvoked === true) { - throw new Error(errorMessage); - } - this._hasInvoked = true; - this._promise = doInject(this.dispatch, this.option); - } - return this._promise[method](...args); - }; - }); - function isInjection(obj) { - return obj instanceof Request2 || obj instanceof Response2 || obj?.constructor?.name === "_CustomLMRRequest"; - } - module2.exports = inject; - module2.exports.default = inject; - module2.exports.inject = inject; - module2.exports.isInjection = isInjection; - } -}); - -// ../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/fastify.js -var require_fastify = __commonJS({ - "../../node_modules/.pnpm/fastify@5.8.5/node_modules/fastify/fastify.js"(exports2, module2) { - "use strict"; - var VERSION = "5.8.5"; - var Avvio = require_boot(); - var http2 = require("node:http"); - var diagnostics = require("node:diagnostics_channel"); - var lightMyRequest; - var { - kAvvioBoot, - kChildren, - kServerBindings, - kBodyLimit, - kSupportedHTTPMethods, - kRoutePrefix, - kLogLevel, - kLogSerializers, - kHooks, - kSchemaController, - kRequestAcceptVersion, - kReplySerializerDefault, - kContentTypeParser, - kReply, - kRequest, - kFourOhFour, - kState, - kOptions, - kPluginNameChain, - kSchemaErrorFormatter, - kErrorHandler, - kKeepAliveConnections, - kChildLoggerFactory, - kGenReqId, - kErrorHandlerAlreadySet, - kHandlerTimeout - } = require_symbols2(); - var { createServer } = require_server(); - var Reply = require_reply(); - var Request2 = require_request(); - var Context = require_context(); - var decorator = require_decorate(); - var ContentTypeParser = require_content_type_parser(); - var SchemaController = require_schema_controller(); - var { Hooks, hookRunnerApplication, supportedHooks } = require_hooks(); - var { createChildLogger, defaultChildLoggerFactory, createLogger } = require_logger_factory(); - var pluginUtils = require_plugin_utils(); - var { getGenReqId, reqIdGenFactory } = require_req_id_gen_factory(); - var { buildRouting, validateBodyLimitOption, buildRouterOptions } = require_route(); - var build404 = require_four_oh_four(); - var getSecuredInitialConfig = require_initial_config_validation(); - var override = require_plugin_override(); - var { - appendStackTrace, - AVVIO_ERRORS_MAP, - ...errorCodes - } = require_errors2(); - var PonyPromise = require_promise(); - var { defaultInitOptions } = getSecuredInitialConfig; - var { - FST_ERR_ASYNC_CONSTRAINT, - FST_ERR_BAD_URL, - FST_ERR_OPTIONS_NOT_OBJ, - FST_ERR_QSP_NOT_FN, - FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN, - FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ, - FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR, - FST_ERR_INSTANCE_ALREADY_LISTENING, - FST_ERR_REOPENED_CLOSE_SERVER, - FST_ERR_ROUTE_REWRITE_NOT_STR, - FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN, - FST_ERR_ERROR_HANDLER_NOT_FN, - FST_ERR_ERROR_HANDLER_ALREADY_SET, - FST_ERR_ROUTE_METHOD_INVALID - } = errorCodes; - var { buildErrorHandler } = require_error_handler(); - var { FSTWRN004 } = require_warnings(); - var initChannel = diagnostics.channel("fastify.initialization"); - function fastify(serverOptions) { - const { - options, - genReqId, - disableRequestLogging, - hasLogger, - initialConfig - } = processOptions(serverOptions, defaultRoute, onBadUrl); - const router = buildRouting(options.routerOptions); - const fourOhFour = build404(options); - const httpHandler = wrapRouting(router, options); - const { - server, - listen, - forceCloseConnections, - serverHasCloseAllConnections, - serverHasCloseHttp2Sessions, - keepAliveConnections - } = createServer(options, httpHandler); - const setupResponseListeners = Reply.setupResponseListeners; - const schemaController = SchemaController.buildSchemaController(null, options.schemaController); - const fastify2 = { - // Fastify internals - [kState]: { - listening: false, - closing: false, - started: false, - ready: false, - booting: false, - aborted: false, - readyResolver: null - }, - [kKeepAliveConnections]: keepAliveConnections, - [kSupportedHTTPMethods]: { - bodyless: /* @__PURE__ */ new Set([ - // Standard - "GET", - "HEAD", - "TRACE" - ]), - bodywith: /* @__PURE__ */ new Set([ - // Standard - "DELETE", - "OPTIONS", - "PATCH", - "PUT", - "POST" - ]) - }, - [kOptions]: options, - [kChildren]: [], - [kServerBindings]: [], - [kBodyLimit]: options.bodyLimit, - [kHandlerTimeout]: options.handlerTimeout, - [kRoutePrefix]: "", - [kLogLevel]: "", - [kLogSerializers]: null, - [kHooks]: new Hooks(), - [kSchemaController]: schemaController, - [kSchemaErrorFormatter]: null, - [kErrorHandler]: buildErrorHandler(), - [kErrorHandlerAlreadySet]: false, - [kChildLoggerFactory]: options.childLoggerFactory || defaultChildLoggerFactory, - [kReplySerializerDefault]: null, - [kContentTypeParser]: new ContentTypeParser( - options.bodyLimit, - options.onProtoPoisoning || defaultInitOptions.onProtoPoisoning, - options.onConstructorPoisoning || defaultInitOptions.onConstructorPoisoning - ), - [kReply]: Reply.buildReply(Reply), - [kRequest]: Request2.buildRequest(Request2, options.trustProxy), - [kFourOhFour]: fourOhFour, - [pluginUtils.kRegisteredPlugins]: [], - [kPluginNameChain]: ["fastify"], - [kAvvioBoot]: null, - [kGenReqId]: genReqId, - // routing method - routing: httpHandler, - // routes shorthand methods - delete: function _delete(url, options2, handler) { - return router.prepareRoute.call(this, { method: "DELETE", url, options: options2, handler }); - }, - get: function _get(url, options2, handler) { - return router.prepareRoute.call(this, { method: "GET", url, options: options2, handler }); - }, - head: function _head(url, options2, handler) { - return router.prepareRoute.call(this, { method: "HEAD", url, options: options2, handler }); - }, - trace: function _trace(url, options2, handler) { - return router.prepareRoute.call(this, { method: "TRACE", url, options: options2, handler }); - }, - patch: function _patch(url, options2, handler) { - return router.prepareRoute.call(this, { method: "PATCH", url, options: options2, handler }); - }, - post: function _post(url, options2, handler) { - return router.prepareRoute.call(this, { method: "POST", url, options: options2, handler }); - }, - put: function _put(url, options2, handler) { - return router.prepareRoute.call(this, { method: "PUT", url, options: options2, handler }); - }, - options: function _options(url, options2, handler) { - return router.prepareRoute.call(this, { method: "OPTIONS", url, options: options2, handler }); - }, - all: function _all(url, options2, handler) { - return router.prepareRoute.call(this, { method: this.supportedMethods, url, options: options2, handler }); - }, - // extended route - route: function _route(options2) { - return router.route.call(this, { options: options2 }); - }, - hasRoute: function _route(options2) { - return router.hasRoute.call(this, { options: options2 }); - }, - findRoute: function _findRoute(options2) { - return router.findRoute(options2); - }, - // expose logger instance - log: options.logger, - // type provider - withTypeProvider, - // hooks - addHook, - // schemas - addSchema, - getSchema: schemaController.getSchema.bind(schemaController), - getSchemas: schemaController.getSchemas.bind(schemaController), - setValidatorCompiler, - setSerializerCompiler, - setSchemaController, - setReplySerializer, - setSchemaErrorFormatter, - // set generated request id - setGenReqId, - // custom parsers - addContentTypeParser: ContentTypeParser.helpers.addContentTypeParser, - hasContentTypeParser: ContentTypeParser.helpers.hasContentTypeParser, - getDefaultJsonParser: ContentTypeParser.defaultParsers.getDefaultJsonParser, - defaultTextParser: ContentTypeParser.defaultParsers.defaultTextParser, - removeContentTypeParser: ContentTypeParser.helpers.removeContentTypeParser, - removeAllContentTypeParsers: ContentTypeParser.helpers.removeAllContentTypeParsers, - // Fastify architecture methods (initialized by Avvio) - register: null, - after: null, - ready: null, - onClose: null, - close: null, - printPlugins: null, - hasPlugin: function(name) { - return this[pluginUtils.kRegisteredPlugins].includes(name) || this[kPluginNameChain].includes(name); - }, - // http server - listen, - server, - addresses: function() { - const binded = this[kServerBindings].map((b) => b.address()); - binded.push(this.server.address()); - return binded.filter((adr) => adr); - }, - // extend fastify objects - decorate: decorator.add, - hasDecorator: decorator.exist, - decorateReply: decorator.decorateReply, - decorateRequest: decorator.decorateRequest, - hasRequestDecorator: decorator.existRequest, - hasReplyDecorator: decorator.existReply, - getDecorator: decorator.getInstanceDecorator, - addHttpMethod, - // fake http injection - inject, - // pretty print of the registered routes - printRoutes, - // custom error handling - setNotFoundHandler, - setErrorHandler, - // child logger - setChildLoggerFactory, - // Set fastify initial configuration options read-only object - initialConfig, - // constraint strategies - addConstraintStrategy: router.addConstraintStrategy.bind(router), - hasConstraintStrategy: router.hasConstraintStrategy.bind(router) - }; - Object.defineProperties(fastify2, { - listeningOrigin: { - get() { - const address = this.addresses().slice(-1).pop(); - if (typeof address === "string") { - return address; - } - const host = address.family === "IPv6" ? `[${address.address}]` : address.address; - return `${this[kOptions].https ? "https" : "http"}://${host}:${address.port}`; - } - }, - pluginName: { - configurable: true, - get() { - if (this[kPluginNameChain].length > 1) { - return this[kPluginNameChain].join(" -> "); - } - return this[kPluginNameChain][0]; - } - }, - prefix: { - configurable: true, - get() { - return this[kRoutePrefix]; - } - }, - validatorCompiler: { - configurable: true, - get() { - return this[kSchemaController].getValidatorCompiler(); - } - }, - serializerCompiler: { - configurable: true, - get() { - return this[kSchemaController].getSerializerCompiler(); - } - }, - childLoggerFactory: { - configurable: true, - get() { - return this[kChildLoggerFactory]; - } - }, - version: { - configurable: true, - get() { - return VERSION; - } - }, - errorHandler: { - configurable: true, - get() { - return this[kErrorHandler].func; - } - }, - genReqId: { - configurable: true, - get() { - return this[kGenReqId]; - } - }, - supportedMethods: { - configurable: false, - get() { - return [ - ...this[kSupportedHTTPMethods].bodyless, - ...this[kSupportedHTTPMethods].bodywith - ]; - } - } - }); - if (options.schemaErrorFormatter) { - validateSchemaErrorFormatter(options.schemaErrorFormatter); - fastify2[kSchemaErrorFormatter] = options.schemaErrorFormatter.bind(fastify2); - } - const avvioPluginTimeout = Number(options.pluginTimeout); - const avvio = Avvio(fastify2, { - autostart: false, - timeout: isNaN(avvioPluginTimeout) === false ? avvioPluginTimeout : defaultInitOptions.pluginTimeout, - expose: { - use: "register" - } - }); - avvio.override = override; - avvio.on("start", () => fastify2[kState].started = true); - fastify2[kAvvioBoot] = fastify2.ready; - fastify2.ready = ready; - fastify2.printPlugins = avvio.prettyPrint.bind(avvio); - avvio.once("preReady", () => { - fastify2.onClose((instance2, done) => { - fastify2[kState].closing = true; - router.closeRoutes(); - hookRunnerApplication("preClose", fastify2[kAvvioBoot], fastify2, function() { - if (fastify2[kState].listening) { - if (forceCloseConnections === "idle") { - instance2.server.closeIdleConnections(); - } else if (serverHasCloseAllConnections && forceCloseConnections) { - instance2.server.closeAllConnections(); - } else if (forceCloseConnections === true) { - for (const conn of fastify2[kKeepAliveConnections]) { - conn.destroy(); - fastify2[kKeepAliveConnections].delete(conn); - } - } - } - if (serverHasCloseHttp2Sessions) { - instance2.server.closeHttp2Sessions(); - } - if (!options.serverFactory || fastify2[kState].listening) { - instance2.server.close(function(err) { - if (err && err.code !== "ERR_SERVER_NOT_RUNNING") { - done(null); - } else { - done(); - } - }); - } else { - process.nextTick(done, null); - } - }); - }); - }); - const onBadUrlContext = new Context({ - server: fastify2, - config: {} - }); - fastify2.setNotFoundHandler(); - fourOhFour.arrange404(fastify2); - router.setup(options, { - avvio, - fourOhFour, - hasLogger, - setupResponseListeners, - throwIfAlreadyStarted, - keepAliveConnections - }); - server.on("clientError", options.clientErrorHandler.bind(fastify2)); - if (initChannel.hasSubscribers) { - initChannel.publish({ fastify: fastify2 }); - } - if ("asyncDispose" in Symbol) { - fastify2[Symbol.asyncDispose] = function dispose() { - return fastify2.close(); - }; - } - return fastify2; - function throwIfAlreadyStarted(msg) { - if (fastify2[kState].started) - throw new FST_ERR_INSTANCE_ALREADY_LISTENING(msg); - } - function inject(opts, cb) { - if (lightMyRequest === void 0) { - lightMyRequest = require_light_my_request(); - } - if (fastify2[kState].started) { - if (fastify2[kState].closing) { - const error = new FST_ERR_REOPENED_CLOSE_SERVER(); - if (cb) { - cb(error); - return; - } else { - return Promise.reject(error); - } - } - return lightMyRequest(httpHandler, opts, cb); - } - if (cb) { - this.ready((err) => { - if (err) - cb(err, null); - else - lightMyRequest(httpHandler, opts, cb); - }); - } else { - return lightMyRequest((req, res) => { - this.ready(function(err) { - if (err) { - res.emit("error", err); - return; - } - httpHandler(req, res); - }); - }, opts); - } - } - function ready(cb) { - if (this[kState].readyResolver !== null) { - if (cb != null) { - this[kState].readyResolver.promise.then(() => cb(null, fastify2), cb); - return; - } - return this[kState].readyResolver.promise; - } - process.nextTick(runHooks); - this[kState].readyResolver = PonyPromise.withResolvers(); - if (!cb) { - return this[kState].readyResolver.promise; - } else { - this[kState].readyResolver.promise.then(() => cb(null, fastify2), cb); - } - function runHooks() { - fastify2[kAvvioBoot]((err, done) => { - if (err || fastify2[kState].started || fastify2[kState].ready || fastify2[kState].booting) { - manageErr(err); - } else { - fastify2[kState].booting = true; - hookRunnerApplication("onReady", fastify2[kAvvioBoot], fastify2, manageErr); - } - done(); - }); - } - function manageErr(err) { - err = err != null && AVVIO_ERRORS_MAP[err.code] != null ? appendStackTrace(err, new AVVIO_ERRORS_MAP[err.code](err.message)) : err; - if (err) { - return fastify2[kState].readyResolver.reject(err); - } - fastify2[kState].readyResolver.resolve(fastify2); - fastify2[kState].booting = false; - fastify2[kState].ready = true; - fastify2[kState].readyResolver = null; - } - } - function withTypeProvider() { - return this; - } - function addHook(name, fn) { - throwIfAlreadyStarted('Cannot call "addHook"!'); - if (fn == null) { - throw new errorCodes.FST_ERR_HOOK_INVALID_HANDLER(name, fn); - } - if (name === "onSend" || name === "preSerialization" || name === "onError" || name === "preParsing") { - if (fn.constructor.name === "AsyncFunction" && fn.length === 4) { - throw new errorCodes.FST_ERR_HOOK_INVALID_ASYNC_HANDLER(); - } - } else if (name === "onReady" || name === "onListen") { - if (fn.constructor.name === "AsyncFunction" && fn.length !== 0) { - throw new errorCodes.FST_ERR_HOOK_INVALID_ASYNC_HANDLER(); - } - } else if (name === "onRequestAbort") { - if (fn.constructor.name === "AsyncFunction" && fn.length !== 1) { - throw new errorCodes.FST_ERR_HOOK_INVALID_ASYNC_HANDLER(); - } - } else { - if (fn.constructor.name === "AsyncFunction" && fn.length === 3) { - throw new errorCodes.FST_ERR_HOOK_INVALID_ASYNC_HANDLER(); - } - } - if (name === "onClose") { - this.onClose(fn.bind(this)); - } else if (name === "onReady" || name === "onListen" || name === "onRoute") { - this[kHooks].add(name, fn); - } else { - this.after((err, done) => { - try { - _addHook.call(this, name, fn); - done(err); - } catch (err2) { - done(err2); - } - }); - } - return this; - function _addHook(name2, fn2) { - this[kHooks].add(name2, fn2); - this[kChildren].forEach((child) => _addHook.call(child, name2, fn2)); - } - } - function addSchema(schema) { - throwIfAlreadyStarted('Cannot call "addSchema"!'); - this[kSchemaController].add(schema); - this[kChildren].forEach((child) => child.addSchema(schema)); - return this; - } - function defaultRoute(req, res) { - if (req.headers["accept-version"] !== void 0) { - req.headers[kRequestAcceptVersion] = req.headers["accept-version"]; - req.headers["accept-version"] = void 0; - } - fourOhFour.router.lookup(req, res); - } - function onBadUrl(path2, req, res) { - if (options.frameworkErrors) { - const id = getGenReqId(onBadUrlContext.server, req); - const childLogger = createChildLogger(onBadUrlContext, options.logger, req, id); - const request = new Request2(id, null, req, null, childLogger, onBadUrlContext); - const reply = new Reply(res, request, childLogger); - const resolvedDisableRequestLogging = typeof disableRequestLogging === "function" ? disableRequestLogging(req) : disableRequestLogging; - if (resolvedDisableRequestLogging === false) { - childLogger.info({ req: request }, "incoming request"); - } - return options.frameworkErrors(new FST_ERR_BAD_URL(path2), request, reply); - } - const body = JSON.stringify({ - error: "Bad Request", - code: "FST_ERR_BAD_URL", - message: `'${path2}' is not a valid url component`, - statusCode: 400 - }); - res.writeHead(400, { - "Content-Type": "application/json", - "Content-Length": Buffer.byteLength(body) - }); - res.end(body); - } - function buildAsyncConstraintCallback(isAsync, req, res) { - if (isAsync === false) - return void 0; - return function onAsyncConstraintError(err) { - if (err) { - if (options.frameworkErrors) { - const id = getGenReqId(onBadUrlContext.server, req); - const childLogger = createChildLogger(onBadUrlContext, options.logger, req, id); - const request = new Request2(id, null, req, null, childLogger, onBadUrlContext); - const reply = new Reply(res, request, childLogger); - const resolvedDisableRequestLogging = typeof disableRequestLogging === "function" ? disableRequestLogging(req) : disableRequestLogging; - if (resolvedDisableRequestLogging === false) { - childLogger.info({ req: request }, "incoming request"); - } - return options.frameworkErrors(new FST_ERR_ASYNC_CONSTRAINT(), request, reply); - } - const body = '{"error":"Internal Server Error","message":"Unexpected error from async constraint","statusCode":500}'; - res.writeHead(500, { - "Content-Type": "application/json", - "Content-Length": body.length - }); - res.end(body); - } - }; - } - function setNotFoundHandler(opts, handler) { - throwIfAlreadyStarted('Cannot call "setNotFoundHandler"!'); - fourOhFour.setNotFoundHandler.call(this, opts, handler, avvio, router.routeHandler); - return this; - } - function setValidatorCompiler(validatorCompiler) { - throwIfAlreadyStarted('Cannot call "setValidatorCompiler"!'); - this[kSchemaController].setValidatorCompiler(validatorCompiler); - return this; - } - function setSchemaErrorFormatter(errorFormatter) { - throwIfAlreadyStarted('Cannot call "setSchemaErrorFormatter"!'); - validateSchemaErrorFormatter(errorFormatter); - this[kSchemaErrorFormatter] = errorFormatter.bind(this); - return this; - } - function setSerializerCompiler(serializerCompiler) { - throwIfAlreadyStarted('Cannot call "setSerializerCompiler"!'); - this[kSchemaController].setSerializerCompiler(serializerCompiler); - return this; - } - function setSchemaController(schemaControllerOpts) { - throwIfAlreadyStarted('Cannot call "setSchemaController"!'); - const old = this[kSchemaController]; - const schemaController2 = SchemaController.buildSchemaController( - old, - Object.assign({}, old.opts, schemaControllerOpts) - ); - this[kSchemaController] = schemaController2; - this.getSchema = schemaController2.getSchema.bind(schemaController2); - this.getSchemas = schemaController2.getSchemas.bind(schemaController2); - return this; - } - function setReplySerializer(replySerializer) { - throwIfAlreadyStarted('Cannot call "setReplySerializer"!'); - this[kReplySerializerDefault] = replySerializer; - return this; - } - function setErrorHandler(func) { - throwIfAlreadyStarted('Cannot call "setErrorHandler"!'); - if (typeof func !== "function") { - throw new FST_ERR_ERROR_HANDLER_NOT_FN(); - } - if (!options.allowErrorHandlerOverride && this[kErrorHandlerAlreadySet]) { - throw new FST_ERR_ERROR_HANDLER_ALREADY_SET(); - } else if (this[kErrorHandlerAlreadySet]) { - FSTWRN004("To disable this behavior, set 'allowErrorHandlerOverride' to false or ignore this message. For more information, visit: https://fastify.dev/docs/latest/Reference/Server/#allowerrorhandleroverride"); - } - this[kErrorHandlerAlreadySet] = true; - this[kErrorHandler] = buildErrorHandler(this[kErrorHandler], func.bind(this)); - return this; - } - function setChildLoggerFactory(factory) { - throwIfAlreadyStarted('Cannot call "setChildLoggerFactory"!'); - this[kChildLoggerFactory] = factory; - return this; - } - function printRoutes(opts = {}) { - opts.includeMeta = opts.includeHooks ? opts.includeMeta ? supportedHooks.concat(opts.includeMeta) : supportedHooks : opts.includeMeta; - return router.printRoutes(opts); - } - function wrapRouting(router2, { rewriteUrl, logger }) { - let isAsync; - return function preRouting(req, res) { - if (isAsync === void 0) - isAsync = router2.isAsyncConstraint(); - if (rewriteUrl) { - req.originalUrl = req.url; - const url = rewriteUrl.call(fastify2, req); - if (typeof url === "string") { - req.url = url; - } else { - const err = new FST_ERR_ROUTE_REWRITE_NOT_STR(req.url, typeof url); - req.destroy(err); - } - } - router2.routing(req, res, buildAsyncConstraintCallback(isAsync, req, res)); - }; - } - function setGenReqId(func) { - throwIfAlreadyStarted('Cannot call "setGenReqId"!'); - this[kGenReqId] = reqIdGenFactory(this[kOptions].requestIdHeader, func); - return this; - } - function addHttpMethod(method, { hasBody = false } = {}) { - if (typeof method !== "string" || http2.METHODS.indexOf(method) === -1) { - throw new FST_ERR_ROUTE_METHOD_INVALID(); - } - if (hasBody === true) { - this[kSupportedHTTPMethods].bodywith.add(method); - this[kSupportedHTTPMethods].bodyless.delete(method); - } else { - this[kSupportedHTTPMethods].bodywith.delete(method); - this[kSupportedHTTPMethods].bodyless.add(method); - } - const _method = method.toLowerCase(); - if (!this.hasDecorator(_method)) { - this.decorate(_method, function(url, options2, handler) { - return router.prepareRoute.call(this, { method, url, options: options2, handler }); - }); - } - return this; - } - } - function processOptions(options, defaultRoute, onBadUrl) { - if (options && typeof options !== "object") { - throw new FST_ERR_OPTIONS_NOT_OBJ(); - } else { - options = Object.assign({}, options); - } - if (options.querystringParser && typeof options.querystringParser !== "function" || options.routerOptions?.querystringParser && typeof options.routerOptions.querystringParser !== "function") { - throw new FST_ERR_QSP_NOT_FN(typeof (options.querystringParser ?? options.routerOptions.querystringParser)); - } - if (options.schemaController && options.schemaController.bucket && typeof options.schemaController.bucket !== "function") { - throw new FST_ERR_SCHEMA_CONTROLLER_BUCKET_OPT_NOT_FN(typeof options.schemaController.bucket); - } - validateBodyLimitOption(options.bodyLimit); - const requestIdHeader = typeof options.requestIdHeader === "string" && options.requestIdHeader.length !== 0 ? options.requestIdHeader.toLowerCase() : options.requestIdHeader === true && "request-id"; - const genReqId = reqIdGenFactory(requestIdHeader, options.genReqId); - const requestIdLogLabel = options.requestIdLogLabel || "reqId"; - options.bodyLimit = options.bodyLimit || defaultInitOptions.bodyLimit; - const disableRequestLogging = options.disableRequestLogging || false; - const ajvOptions = Object.assign({ - customOptions: {}, - plugins: [] - }, options.ajv); - if (!ajvOptions.customOptions || Object.prototype.toString.call(ajvOptions.customOptions) !== "[object Object]") { - throw new FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_OBJ(typeof ajvOptions.customOptions); - } - if (!ajvOptions.plugins || !Array.isArray(ajvOptions.plugins)) { - throw new FST_ERR_AJV_CUSTOM_OPTIONS_OPT_NOT_ARR(typeof ajvOptions.plugins); - } - const { logger, hasLogger } = createLogger(options); - options.connectionTimeout = options.connectionTimeout || defaultInitOptions.connectionTimeout; - options.keepAliveTimeout = options.keepAliveTimeout || defaultInitOptions.keepAliveTimeout; - options.maxRequestsPerSocket = options.maxRequestsPerSocket || defaultInitOptions.maxRequestsPerSocket; - options.requestTimeout = options.requestTimeout || defaultInitOptions.requestTimeout; - options.logger = logger; - options.requestIdHeader = requestIdHeader; - options.requestIdLogLabel = requestIdLogLabel; - options.disableRequestLogging = disableRequestLogging; - options.ajv = ajvOptions; - options.clientErrorHandler = options.clientErrorHandler || defaultClientErrorHandler; - options.allowErrorHandlerOverride = options.allowErrorHandlerOverride ?? defaultInitOptions.allowErrorHandlerOverride; - const initialConfig = getSecuredInitialConfig(options); - options.exposeHeadRoutes = initialConfig.exposeHeadRoutes; - options.http2SessionTimeout = initialConfig.http2SessionTimeout; - options.routerOptions = buildRouterOptions(options, { - defaultRoute, - onBadUrl, - ignoreTrailingSlash: defaultInitOptions.ignoreTrailingSlash, - ignoreDuplicateSlashes: defaultInitOptions.ignoreDuplicateSlashes, - maxParamLength: defaultInitOptions.maxParamLength, - allowUnsafeRegex: defaultInitOptions.allowUnsafeRegex, - buildPrettyMeta: defaultBuildPrettyMeta, - useSemicolonDelimiter: defaultInitOptions.useSemicolonDelimiter - }); - return { - options, - genReqId, - disableRequestLogging, - hasLogger, - initialConfig - }; - } - function defaultBuildPrettyMeta(route) { - const cleanKeys = {}; - const allowedProps = ["errorHandler", "logLevel", "logSerializers"]; - allowedProps.concat(supportedHooks).forEach((k) => { - cleanKeys[k] = route.store[k]; - }); - return Object.assign({}, cleanKeys); - } - function defaultClientErrorHandler(err, socket) { - if (err.code === "ECONNRESET" || socket.destroyed) { - return; - } - let body, errorCode, errorStatus, errorLabel; - if (err.code === "ERR_HTTP_REQUEST_TIMEOUT") { - errorCode = "408"; - errorStatus = http2.STATUS_CODES[errorCode]; - body = `{"error":"${errorStatus}","message":"Client Timeout","statusCode":408}`; - errorLabel = "timeout"; - } else if (err.code === "HPE_HEADER_OVERFLOW") { - errorCode = "431"; - errorStatus = http2.STATUS_CODES[errorCode]; - body = `{"error":"${errorStatus}","message":"Exceeded maximum allowed HTTP header size","statusCode":431}`; - errorLabel = "header_overflow"; - } else { - errorCode = "400"; - errorStatus = http2.STATUS_CODES[errorCode]; - body = `{"error":"${errorStatus}","message":"Client Error","statusCode":400}`; - errorLabel = "error"; - } - this.log.trace({ err }, `client ${errorLabel}`); - if (socket.writable) { - socket.write(`HTTP/1.1 ${errorCode} ${errorStatus}\r -Content-Length: ${body.length}\r -Content-Type: application/json\r -\r -${body}`); - } - socket.destroy(err); - } - function validateSchemaErrorFormatter(schemaErrorFormatter) { - if (typeof schemaErrorFormatter !== "function") { - throw new FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN(typeof schemaErrorFormatter); - } else if (schemaErrorFormatter.constructor.name === "AsyncFunction") { - throw new FST_ERR_SCHEMA_ERROR_FORMATTER_NOT_FN("AsyncFunction"); - } - } - module2.exports = fastify; - module2.exports.errorCodes = errorCodes; - module2.exports.fastify = fastify; - module2.exports.default = fastify; - } -}); - -// ../../node_modules/.pnpm/fastify-plugin@5.1.0/node_modules/fastify-plugin/lib/getPluginName.js -var require_getPluginName = __commonJS({ - "../../node_modules/.pnpm/fastify-plugin@5.1.0/node_modules/fastify-plugin/lib/getPluginName.js"(exports2, module2) { - "use strict"; - var fpStackTracePattern = /at\s(?:.*\.)?plugin\s.*\n\s*(.*)/; - var fileNamePattern = /(\w*(\.\w*)*)\..*/; - module2.exports = function getPluginName(fn) { - if (fn.name.length > 0) - return fn.name; - const stackTraceLimit = Error.stackTraceLimit; - Error.stackTraceLimit = 10; - try { - throw new Error("anonymous function"); - } catch (e) { - Error.stackTraceLimit = stackTraceLimit; - return extractPluginName(e.stack); - } - }; - function extractPluginName(stack) { - const m = stack.match(fpStackTracePattern); - return m ? m[1].split(/[/\\]/).slice(-1)[0].match(fileNamePattern)[1] : "anonymous"; - } - module2.exports.extractPluginName = extractPluginName; - } -}); - -// ../../node_modules/.pnpm/fastify-plugin@5.1.0/node_modules/fastify-plugin/lib/toCamelCase.js -var require_toCamelCase = __commonJS({ - "../../node_modules/.pnpm/fastify-plugin@5.1.0/node_modules/fastify-plugin/lib/toCamelCase.js"(exports2, module2) { - "use strict"; - module2.exports = function toCamelCase(name) { - if (name[0] === "@") { - name = name.slice(1).replace("/", "-"); - } - return name.replace(/-(.)/g, function(match, g1) { - return g1.toUpperCase(); - }); - }; - } -}); - -// ../../node_modules/.pnpm/fastify-plugin@5.1.0/node_modules/fastify-plugin/plugin.js -var require_plugin2 = __commonJS({ - "../../node_modules/.pnpm/fastify-plugin@5.1.0/node_modules/fastify-plugin/plugin.js"(exports2, module2) { - "use strict"; - var getPluginName = require_getPluginName(); - var toCamelCase = require_toCamelCase(); - var count = 0; - function plugin(fn, options = {}) { - let autoName = false; - if (fn.default !== void 0) { - fn = fn.default; - } - if (typeof fn !== "function") { - throw new TypeError( - `fastify-plugin expects a function, instead got a '${typeof fn}'` - ); - } - if (typeof options === "string") { - options = { - fastify: options - }; - } - if (typeof options !== "object" || Array.isArray(options) || options === null) { - throw new TypeError("The options object should be an object"); - } - if (options.fastify !== void 0 && typeof options.fastify !== "string") { - throw new TypeError(`fastify-plugin expects a version string, instead got '${typeof options.fastify}'`); - } - if (!options.name) { - autoName = true; - options.name = getPluginName(fn) + "-auto-" + count++; - } - fn[Symbol.for("skip-override")] = options.encapsulate !== true; - fn[Symbol.for("fastify.display-name")] = options.name; - fn[Symbol.for("plugin-meta")] = options; - if (!fn.default) { - fn.default = fn; - } - const camelCase = toCamelCase(options.name); - if (!autoName && !fn[camelCase]) { - fn[camelCase] = fn; - } - return fn; - } - module2.exports = plugin; - module2.exports.default = plugin; - module2.exports.fastifyPlugin = plugin; - } -}); - -// ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/iterator.js -var require_iterator = __commonJS({ - "../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/iterator.js"(exports2, module2) { - function Iterator(next) { - if (typeof next !== "function") - throw new Error("obliterator/iterator: expecting a function!"); - this.next = next; - } - if (typeof Symbol !== "undefined") - Iterator.prototype[Symbol.iterator] = function() { - return this; - }; - Iterator.of = function() { - var args = arguments, l = args.length, i = 0; - return new Iterator(function() { - if (i >= l) - return { done: true }; - return { done: false, value: args[i++] }; - }); - }; - Iterator.empty = function() { - var iterator = new Iterator(function() { - return { done: true }; - }); - return iterator; - }; - Iterator.fromSequence = function(sequence) { - var i = 0, l = sequence.length; - return new Iterator(function() { - if (i >= l) - return { done: true }; - return { done: false, value: sequence[i++] }; - }); - }; - Iterator.is = function(value) { - if (value instanceof Iterator) - return true; - return typeof value === "object" && value !== null && typeof value.next === "function"; - }; - module2.exports = Iterator; - } -}); - -// ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/support.js -var require_support = __commonJS({ - "../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/support.js"(exports2) { - exports2.ARRAY_BUFFER_SUPPORT = typeof ArrayBuffer !== "undefined"; - exports2.SYMBOL_SUPPORT = typeof Symbol !== "undefined"; - } -}); - -// ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/foreach.js -var require_foreach = __commonJS({ - "../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/foreach.js"(exports2, module2) { - var support = require_support(); - var ARRAY_BUFFER_SUPPORT = support.ARRAY_BUFFER_SUPPORT; - var SYMBOL_SUPPORT = support.SYMBOL_SUPPORT; - module2.exports = function forEach(iterable, callback) { - var iterator, k, i, l, s; - if (!iterable) - throw new Error("obliterator/forEach: invalid iterable."); - if (typeof callback !== "function") - throw new Error("obliterator/forEach: expecting a callback."); - if (Array.isArray(iterable) || ARRAY_BUFFER_SUPPORT && ArrayBuffer.isView(iterable) || typeof iterable === "string" || iterable.toString() === "[object Arguments]") { - for (i = 0, l = iterable.length; i < l; i++) - callback(iterable[i], i); - return; - } - if (typeof iterable.forEach === "function") { - iterable.forEach(callback); - return; - } - if (SYMBOL_SUPPORT && Symbol.iterator in iterable && typeof iterable.next !== "function") { - iterable = iterable[Symbol.iterator](); - } - if (typeof iterable.next === "function") { - iterator = iterable; - i = 0; - while (s = iterator.next(), s.done !== true) { - callback(s.value, i); - i++; - } - return; - } - for (k in iterable) { - if (iterable.hasOwnProperty(k)) { - callback(iterable[k], k); - } - } - return; - }; - } -}); - -// ../../node_modules/.pnpm/mnemonist@0.40.0/node_modules/mnemonist/utils/typed-arrays.js -var require_typed_arrays = __commonJS({ - "../../node_modules/.pnpm/mnemonist@0.40.0/node_modules/mnemonist/utils/typed-arrays.js"(exports2) { - var MAX_8BIT_INTEGER = Math.pow(2, 8) - 1; - var MAX_16BIT_INTEGER = Math.pow(2, 16) - 1; - var MAX_32BIT_INTEGER = Math.pow(2, 32) - 1; - var MAX_SIGNED_8BIT_INTEGER = Math.pow(2, 7) - 1; - var MAX_SIGNED_16BIT_INTEGER = Math.pow(2, 15) - 1; - var MAX_SIGNED_32BIT_INTEGER = Math.pow(2, 31) - 1; - exports2.getPointerArray = function(size) { - var maxIndex = size - 1; - if (maxIndex <= MAX_8BIT_INTEGER) - return Uint8Array; - if (maxIndex <= MAX_16BIT_INTEGER) - return Uint16Array; - if (maxIndex <= MAX_32BIT_INTEGER) - return Uint32Array; - throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported."); - }; - exports2.getSignedPointerArray = function(size) { - var maxIndex = size - 1; - if (maxIndex <= MAX_SIGNED_8BIT_INTEGER) - return Int8Array; - if (maxIndex <= MAX_SIGNED_16BIT_INTEGER) - return Int16Array; - if (maxIndex <= MAX_SIGNED_32BIT_INTEGER) - return Int32Array; - return Float64Array; - }; - exports2.getNumberType = function(value) { - if (value === (value | 0)) { - if (Math.sign(value) === -1) { - if (value <= 127 && value >= -128) - return Int8Array; - if (value <= 32767 && value >= -32768) - return Int16Array; - return Int32Array; - } else { - if (value <= 255) - return Uint8Array; - if (value <= 65535) - return Uint16Array; - return Uint32Array; - } - } - return Float64Array; - }; - var TYPE_PRIORITY = { - Uint8Array: 1, - Int8Array: 2, - Uint16Array: 3, - Int16Array: 4, - Uint32Array: 5, - Int32Array: 6, - Float32Array: 7, - Float64Array: 8 - }; - exports2.getMinimalRepresentation = function(array2, getter) { - var maxType = null, maxPriority = 0, p, t, v, i, l; - for (i = 0, l = array2.length; i < l; i++) { - v = getter ? getter(array2[i]) : array2[i]; - t = exports2.getNumberType(v); - p = TYPE_PRIORITY[t.name]; - if (p > maxPriority) { - maxPriority = p; - maxType = t; - } - } - return maxType; - }; - exports2.isTypedArray = function(value) { - return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value); - }; - exports2.concat = function() { - var length = 0, i, o, l; - for (i = 0, l = arguments.length; i < l; i++) - length += arguments[i].length; - var array2 = new arguments[0].constructor(length); - for (i = 0, o = 0; i < l; i++) { - array2.set(arguments[i], o); - o += arguments[i].length; - } - return array2; - }; - exports2.indices = function(length) { - var PointerArray = exports2.getPointerArray(length); - var array2 = new PointerArray(length); - for (var i = 0; i < length; i++) - array2[i] = i; - return array2; - }; - } -}); - -// ../../node_modules/.pnpm/mnemonist@0.40.0/node_modules/mnemonist/utils/iterables.js -var require_iterables = __commonJS({ - "../../node_modules/.pnpm/mnemonist@0.40.0/node_modules/mnemonist/utils/iterables.js"(exports2) { - var forEach = require_foreach(); - var typed = require_typed_arrays(); - function isArrayLike(target) { - return Array.isArray(target) || typed.isTypedArray(target); - } - function guessLength(target) { - if (typeof target.length === "number") - return target.length; - if (typeof target.size === "number") - return target.size; - return; - } - function toArray(target) { - var l = guessLength(target); - var array2 = typeof l === "number" ? new Array(l) : []; - var i = 0; - forEach(target, function(value) { - array2[i++] = value; - }); - return array2; - } - function toArrayWithIndices(target) { - var l = guessLength(target); - var IndexArray = typeof l === "number" ? typed.getPointerArray(l) : Array; - var array2 = typeof l === "number" ? new Array(l) : []; - var indices = typeof l === "number" ? new IndexArray(l) : []; - var i = 0; - forEach(target, function(value) { - array2[i] = value; - indices[i] = i++; - }); - return [array2, indices]; - } - exports2.isArrayLike = isArrayLike; - exports2.guessLength = guessLength; - exports2.toArray = toArray; - exports2.toArrayWithIndices = toArrayWithIndices; - } -}); - -// ../../node_modules/.pnpm/mnemonist@0.40.0/node_modules/mnemonist/lru-cache.js -var require_lru_cache = __commonJS({ - "../../node_modules/.pnpm/mnemonist@0.40.0/node_modules/mnemonist/lru-cache.js"(exports2, module2) { - var Iterator = require_iterator(); - var forEach = require_foreach(); - var typed = require_typed_arrays(); - var iterables = require_iterables(); - function LRUCache(Keys, Values, capacity) { - if (arguments.length < 2) { - capacity = Keys; - Keys = null; - Values = null; - } - this.capacity = capacity; - if (typeof this.capacity !== "number" || this.capacity <= 0) - throw new Error("mnemonist/lru-cache: capacity should be positive number."); - else if (!isFinite(this.capacity) || Math.floor(this.capacity) !== this.capacity) - throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer."); - var PointerArray = typed.getPointerArray(capacity); - this.forward = new PointerArray(capacity); - this.backward = new PointerArray(capacity); - this.K = typeof Keys === "function" ? new Keys(capacity) : new Array(capacity); - this.V = typeof Values === "function" ? new Values(capacity) : new Array(capacity); - this.size = 0; - this.head = 0; - this.tail = 0; - this.items = {}; - } - LRUCache.prototype.clear = function() { - this.size = 0; - this.head = 0; - this.tail = 0; - this.items = {}; - }; - LRUCache.prototype.splayOnTop = function(pointer) { - var oldHead = this.head; - if (this.head === pointer) - return this; - var previous = this.backward[pointer], next = this.forward[pointer]; - if (this.tail === pointer) { - this.tail = previous; - } else { - this.backward[next] = previous; - } - this.forward[previous] = next; - this.backward[oldHead] = pointer; - this.head = pointer; - this.forward[pointer] = oldHead; - return this; - }; - LRUCache.prototype.set = function(key, value) { - var pointer = this.items[key]; - if (typeof pointer !== "undefined") { - this.splayOnTop(pointer); - this.V[pointer] = value; - return; - } - if (this.size < this.capacity) { - pointer = this.size++; - } else { - pointer = this.tail; - this.tail = this.backward[pointer]; - delete this.items[this.K[pointer]]; - } - this.items[key] = pointer; - this.K[pointer] = key; - this.V[pointer] = value; - this.forward[pointer] = this.head; - this.backward[this.head] = pointer; - this.head = pointer; - }; - LRUCache.prototype.setpop = function(key, value) { - var oldValue = null; - var oldKey = null; - var pointer = this.items[key]; - if (typeof pointer !== "undefined") { - this.splayOnTop(pointer); - oldValue = this.V[pointer]; - this.V[pointer] = value; - return { evicted: false, key, value: oldValue }; - } - if (this.size < this.capacity) { - pointer = this.size++; - } else { - pointer = this.tail; - this.tail = this.backward[pointer]; - oldValue = this.V[pointer]; - oldKey = this.K[pointer]; - delete this.items[oldKey]; - } - this.items[key] = pointer; - this.K[pointer] = key; - this.V[pointer] = value; - this.forward[pointer] = this.head; - this.backward[this.head] = pointer; - this.head = pointer; - if (oldKey) { - return { evicted: true, key: oldKey, value: oldValue }; - } else { - return null; - } - }; - LRUCache.prototype.has = function(key) { - return key in this.items; - }; - LRUCache.prototype.get = function(key) { - var pointer = this.items[key]; - if (typeof pointer === "undefined") - return; - this.splayOnTop(pointer); - return this.V[pointer]; - }; - LRUCache.prototype.peek = function(key) { - var pointer = this.items[key]; - if (typeof pointer === "undefined") - return; - return this.V[pointer]; - }; - LRUCache.prototype.forEach = function(callback, scope) { - scope = arguments.length > 1 ? scope : this; - var i = 0, l = this.size; - var pointer = this.head, keys = this.K, values = this.V, forward = this.forward; - while (i < l) { - callback.call(scope, values[pointer], keys[pointer], this); - pointer = forward[pointer]; - i++; - } - }; - LRUCache.prototype.keys = function() { - var i = 0, l = this.size; - var pointer = this.head, keys = this.K, forward = this.forward; - return new Iterator(function() { - if (i >= l) - return { done: true }; - var key = keys[pointer]; - i++; - if (i < l) - pointer = forward[pointer]; - return { - done: false, - value: key - }; - }); - }; - LRUCache.prototype.values = function() { - var i = 0, l = this.size; - var pointer = this.head, values = this.V, forward = this.forward; - return new Iterator(function() { - if (i >= l) - return { done: true }; - var value = values[pointer]; - i++; - if (i < l) - pointer = forward[pointer]; - return { - done: false, - value - }; - }); - }; - LRUCache.prototype.entries = function() { - var i = 0, l = this.size; - var pointer = this.head, keys = this.K, values = this.V, forward = this.forward; - return new Iterator(function() { - if (i >= l) - return { done: true }; - var key = keys[pointer], value = values[pointer]; - i++; - if (i < l) - pointer = forward[pointer]; - return { - done: false, - value: [key, value] - }; - }); - }; - if (typeof Symbol !== "undefined") - LRUCache.prototype[Symbol.iterator] = LRUCache.prototype.entries; - LRUCache.prototype.inspect = function() { - var proxy = /* @__PURE__ */ new Map(); - var iterator = this.entries(), step; - while (step = iterator.next(), !step.done) - proxy.set(step.value[0], step.value[1]); - Object.defineProperty(proxy, "constructor", { - value: LRUCache, - enumerable: false - }); - return proxy; - }; - if (typeof Symbol !== "undefined") - LRUCache.prototype[Symbol.for("nodejs.util.inspect.custom")] = LRUCache.prototype.inspect; - LRUCache.from = function(iterable, Keys, Values, capacity) { - if (arguments.length < 2) { - capacity = iterables.guessLength(iterable); - if (typeof capacity !== "number") - throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument."); - } else if (arguments.length === 2) { - capacity = Keys; - Keys = null; - Values = null; - } - var cache = new LRUCache(Keys, Values, capacity); - forEach(iterable, function(value, key) { - cache.set(key, value); - }); - return cache; - }; - module2.exports = LRUCache; - } -}); - -// ../../node_modules/.pnpm/@fastify+cors@10.1.0/node_modules/@fastify/cors/vary.js -var require_vary = __commonJS({ - "../../node_modules/.pnpm/@fastify+cors@10.1.0/node_modules/@fastify/cors/vary.js"(exports2, module2) { - "use strict"; - var LRUCache = require_lru_cache(); - var validFieldnameRE = /^[!#$%&'*+\-.^\w`|~]+$/u; - function validateFieldname(fieldname) { - if (validFieldnameRE.test(fieldname) === false) { - throw new TypeError("Fieldname contains invalid characters."); - } - } - function parse2(header) { - header = header.trim().toLowerCase(); - const result = []; - if (header.length === 0) { - } else if (header.indexOf(",") === -1) { - result.push(header); - } else { - const il = header.length; - let i = 0; - let pos = 0; - let char; - for (i; i < il; ++i) { - char = header[i]; - if (char === " ") { - pos = i + 1; - } else if (char === ",") { - if (pos !== i) { - result.push(header.slice(pos, i)); - } - pos = i + 1; - } - } - if (pos !== i) { - result.push(header.slice(pos, i)); - } - } - return result; - } - function createAddFieldnameToVary(fieldname) { - const headerCache = new LRUCache(1e3); - validateFieldname(fieldname); - return function(reply) { - let header = reply.getHeader("Vary"); - if (!header) { - reply.header("Vary", fieldname); - return; - } - if (header === "*") { - return; - } - if (fieldname === "*") { - reply.header("Vary", "*"); - return; - } - if (Array.isArray(header)) { - header = header.join(", "); - } - if (!headerCache.has(header)) { - const vals = parse2(header); - if (vals.indexOf("*") !== -1) { - headerCache.set(header, "*"); - } else if (vals.indexOf(fieldname.toLowerCase()) === -1) { - headerCache.set(header, header + ", " + fieldname); - } else { - headerCache.set(header, null); - } - } - const cached = headerCache.get(header); - if (cached !== null) { - reply.header("Vary", cached); - } - }; - } - module2.exports.createAddFieldnameToVary = createAddFieldnameToVary; - module2.exports.addOriginToVaryHeader = createAddFieldnameToVary("Origin"); - module2.exports.addAccessControlRequestHeadersToVaryHeader = createAddFieldnameToVary("Access-Control-Request-Headers"); - module2.exports.parse = parse2; - } -}); - -// ../../node_modules/.pnpm/@fastify+cors@10.1.0/node_modules/@fastify/cors/index.js -var require_cors = __commonJS({ - "../../node_modules/.pnpm/@fastify+cors@10.1.0/node_modules/@fastify/cors/index.js"(exports2, module2) { - "use strict"; - var fp = require_plugin2(); - var { - addAccessControlRequestHeadersToVaryHeader, - addOriginToVaryHeader - } = require_vary(); - var defaultOptions = { - origin: "*", - methods: "GET,HEAD,PUT,PATCH,POST,DELETE", - hook: "onRequest", - preflightContinue: false, - optionsSuccessStatus: 204, - credentials: false, - exposedHeaders: null, - allowedHeaders: null, - maxAge: null, - preflight: true, - strictPreflight: true - }; - var validHooks = [ - "onRequest", - "preParsing", - "preValidation", - "preHandler", - "preSerialization", - "onSend" - ]; - var hookWithPayload = [ - "preSerialization", - "preParsing", - "onSend" - ]; - function validateHook(value, next) { - if (validHooks.indexOf(value) !== -1) { - return; - } - next(new TypeError("@fastify/cors: Invalid hook option provided.")); - } - function fastifyCors(fastify, opts, next) { - fastify.decorateRequest("corsPreflightEnabled", false); - let hideOptionsRoute = true; - if (typeof opts === "function") { - handleCorsOptionsDelegator(opts, fastify, { hook: defaultOptions.hook }, next); - } else if (opts.delegator) { - const { delegator, ...options } = opts; - handleCorsOptionsDelegator(delegator, fastify, options, next); - } else { - if (opts.hideOptionsRoute !== void 0) - hideOptionsRoute = opts.hideOptionsRoute; - const corsOptions = normalizeCorsOptions(opts); - validateHook(corsOptions.hook, next); - if (hookWithPayload.indexOf(corsOptions.hook) !== -1) { - fastify.addHook(corsOptions.hook, function handleCors(req, reply, _payload, next2) { - addCorsHeadersHandler(fastify, corsOptions, req, reply, next2); - }); - } else { - fastify.addHook(corsOptions.hook, function handleCors(req, reply, next2) { - addCorsHeadersHandler(fastify, corsOptions, req, reply, next2); - }); - } - } - fastify.options("*", { schema: { hide: hideOptionsRoute } }, (req, reply) => { - if (!req.corsPreflightEnabled) { - reply.callNotFound(); - return; - } - reply.send(); - }); - next(); - } - function handleCorsOptionsDelegator(optionsResolver, fastify, opts, next) { - const hook = opts?.hook || defaultOptions.hook; - validateHook(hook, next); - if (optionsResolver.length === 2) { - if (hookWithPayload.indexOf(hook) !== -1) { - fastify.addHook(hook, function handleCors(req, reply, _payload, next2) { - handleCorsOptionsCallbackDelegator(optionsResolver, fastify, req, reply, next2); - }); - } else { - fastify.addHook(hook, function handleCors(req, reply, next2) { - handleCorsOptionsCallbackDelegator(optionsResolver, fastify, req, reply, next2); - }); - } - } else { - if (hookWithPayload.indexOf(hook) !== -1) { - fastify.addHook(hook, function handleCors(req, reply, _payload, next2) { - const ret = optionsResolver(req); - if (ret && typeof ret.then === "function") { - ret.then((options) => addCorsHeadersHandler(fastify, normalizeCorsOptions(options, true), req, reply, next2)).catch(next2); - return; - } - next2(new Error("Invalid CORS origin option")); - }); - } else { - fastify.addHook(hook, function handleCors(req, reply, next2) { - const ret = optionsResolver(req); - if (ret && typeof ret.then === "function") { - ret.then((options) => addCorsHeadersHandler(fastify, normalizeCorsOptions(options, true), req, reply, next2)).catch(next2); - return; - } - next2(new Error("Invalid CORS origin option")); - }); - } - } - } - function handleCorsOptionsCallbackDelegator(optionsResolver, fastify, req, reply, next) { - optionsResolver(req, (err, options) => { - if (err) { - next(err); - } else { - addCorsHeadersHandler(fastify, normalizeCorsOptions(options, true), req, reply, next); - } - }); - } - function normalizeCorsOptions(opts, dynamic) { - const corsOptions = { ...defaultOptions, ...opts }; - if (Array.isArray(opts.origin) && opts.origin.indexOf("*") !== -1) { - corsOptions.origin = "*"; - } - if (Number.isInteger(corsOptions.cacheControl)) { - corsOptions.cacheControl = `max-age=${corsOptions.cacheControl}`; - } else if (typeof corsOptions.cacheControl !== "string") { - corsOptions.cacheControl = null; - } - corsOptions.dynamic = dynamic || false; - return corsOptions; - } - function addCorsHeadersHandler(fastify, options, req, reply, next) { - if (typeof options.origin !== "string" && options.origin !== false || options.dynamic) { - addOriginToVaryHeader(reply); - } - const resolveOriginOption = typeof options.origin === "function" ? resolveOriginWrapper(fastify, options.origin) : (_, cb) => cb(null, options.origin); - resolveOriginOption(req, (error, resolvedOriginOption) => { - if (error !== null) { - return next(error); - } - if (resolvedOriginOption === false) { - return next(); - } - if (req.routeOptions.config?.cors === false) { - return next(); - } - if (!resolvedOriginOption) { - return next(new Error("Invalid CORS origin option")); - } - addCorsHeaders(req, reply, resolvedOriginOption, options); - if (req.raw.method === "OPTIONS" && options.preflight === true) { - if (options.strictPreflight === true && (!req.headers.origin || !req.headers["access-control-request-method"])) { - reply.status(400).type("text/plain").send("Invalid Preflight Request"); - return; - } - req.corsPreflightEnabled = true; - addPreflightHeaders(req, reply, options); - if (!options.preflightContinue) { - reply.code(options.optionsSuccessStatus).header("Content-Length", "0").send(); - return; - } - } - return next(); - }); - } - function addCorsHeaders(req, reply, originOption, corsOptions) { - const origin = getAccessControlAllowOriginHeader(req.headers.origin, originOption); - if (origin) { - reply.header("Access-Control-Allow-Origin", origin); - } - if (corsOptions.credentials) { - reply.header("Access-Control-Allow-Credentials", "true"); - } - if (corsOptions.exposedHeaders !== null) { - reply.header( - "Access-Control-Expose-Headers", - Array.isArray(corsOptions.exposedHeaders) ? corsOptions.exposedHeaders.join(", ") : corsOptions.exposedHeaders - ); - } - } - function addPreflightHeaders(req, reply, corsOptions) { - reply.header( - "Access-Control-Allow-Methods", - Array.isArray(corsOptions.methods) ? corsOptions.methods.join(", ") : corsOptions.methods - ); - if (corsOptions.allowedHeaders === null) { - addAccessControlRequestHeadersToVaryHeader(reply); - const reqAllowedHeaders = req.headers["access-control-request-headers"]; - if (reqAllowedHeaders !== void 0) { - reply.header("Access-Control-Allow-Headers", reqAllowedHeaders); - } - } else { - reply.header( - "Access-Control-Allow-Headers", - Array.isArray(corsOptions.allowedHeaders) ? corsOptions.allowedHeaders.join(", ") : corsOptions.allowedHeaders - ); - } - if (corsOptions.maxAge !== null) { - reply.header("Access-Control-Max-Age", String(corsOptions.maxAge)); - } - if (corsOptions.cacheControl) { - reply.header("Cache-Control", corsOptions.cacheControl); - } - } - function resolveOriginWrapper(fastify, origin) { - return function(req, cb) { - const result = origin.call(fastify, req.headers.origin, cb); - if (result && typeof result.then === "function") { - result.then((res) => cb(null, res), cb); - } - }; - } - function getAccessControlAllowOriginHeader(reqOrigin, originOption) { - if (typeof originOption === "string") { - return originOption; - } - return isRequestOriginAllowed(reqOrigin, originOption) ? reqOrigin : false; - } - function isRequestOriginAllowed(reqOrigin, allowedOrigin) { - if (Array.isArray(allowedOrigin)) { - for (let i = 0; i < allowedOrigin.length; ++i) { - if (isRequestOriginAllowed(reqOrigin, allowedOrigin[i])) { - return true; - } - } - return false; - } else if (typeof allowedOrigin === "string") { - return reqOrigin === allowedOrigin; - } else if (allowedOrigin instanceof RegExp) { - allowedOrigin.lastIndex = 0; - return allowedOrigin.test(reqOrigin); - } else { - return !!allowedOrigin; - } - } - var _fastifyCors = fp(fastifyCors, { - fastify: "5.x", - name: "@fastify/cors" - }); - module2.exports = _fastifyCors; - module2.exports.fastifyCors = _fastifyCors; - module2.exports.default = _fastifyCors; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.js -var require_cryptoNode = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/cryptoNode.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.crypto = void 0; - var nc2 = require("node:crypto"); - exports2.crypto = nc2 && typeof nc2 === "object" && "webcrypto" in nc2 ? nc2.webcrypto : nc2 && typeof nc2 === "object" && "randomBytes" in nc2 ? nc2 : void 0; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/utils.js -var require_utils2 = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.wrapXOFConstructorWithOpts = exports2.wrapConstructorWithOpts = exports2.wrapConstructor = exports2.Hash = exports2.nextTick = exports2.swap32IfBE = exports2.byteSwapIfBE = exports2.swap8IfBE = exports2.isLE = void 0; - exports2.isBytes = isBytes2; - exports2.anumber = anumber2; - exports2.abytes = abytes2; - exports2.ahash = ahash2; - exports2.aexists = aexists2; - exports2.aoutput = aoutput2; - exports2.u8 = u82; - exports2.u32 = u323; - exports2.clean = clean2; - exports2.createView = createView2; - exports2.rotr = rotr2; - exports2.rotl = rotl; - exports2.byteSwap = byteSwap2; - exports2.byteSwap32 = byteSwap322; - exports2.bytesToHex = bytesToHex2; - exports2.hexToBytes = hexToBytes2; - exports2.asyncLoop = asyncLoop; - exports2.utf8ToBytes = utf8ToBytes2; - exports2.bytesToUtf8 = bytesToUtf82; - exports2.toBytes = toBytes2; - exports2.kdfInputToBytes = kdfInputToBytes; - exports2.concatBytes = concatBytes2; - exports2.checkOpts = checkOpts; - exports2.createHasher = createHasher2; - exports2.createOptHasher = createOptHasher; - exports2.createXOFer = createXOFer2; - exports2.randomBytes = randomBytes3; - var crypto_1 = require_cryptoNode(); - function isBytes2(a) { - return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array"; - } - function anumber2(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error("positive integer expected, got " + n); - } - function abytes2(b, ...lengths) { - if (!isBytes2(b)) - throw new Error("Uint8Array expected"); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length); - } - function ahash2(h) { - if (typeof h !== "function" || typeof h.create !== "function") - throw new Error("Hash should be wrapped by utils.createHasher"); - anumber2(h.outputLen); - anumber2(h.blockLen); - } - function aexists2(instance2, checkFinished = true) { - if (instance2.destroyed) - throw new Error("Hash instance has been destroyed"); - if (checkFinished && instance2.finished) - throw new Error("Hash#digest() has already been called"); - } - function aoutput2(out, instance2) { - abytes2(out); - const min = instance2.outputLen; - if (out.length < min) { - throw new Error("digestInto() expects output buffer of length at least " + min); - } - } - function u82(arr) { - return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength); - } - function u323(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - } - function clean2(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } - } - function createView2(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - } - function rotr2(word, shift) { - return word << 32 - shift | word >>> shift; - } - function rotl(word, shift) { - return word << shift | word >>> 32 - shift >>> 0; - } - exports2.isLE = (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)(); - function byteSwap2(word) { - return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255; - } - exports2.swap8IfBE = exports2.isLE ? (n) => n : (n) => byteSwap2(n); - exports2.byteSwapIfBE = exports2.swap8IfBE; - function byteSwap322(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap2(arr[i]); - } - return arr; - } - exports2.swap32IfBE = exports2.isLE ? (u) => u : byteSwap322; - var hasHexBuiltin2 = /* @__PURE__ */ (() => ( - // @ts-ignore - typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function" - ))(); - var hexes2 = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0")); - function bytesToHex2(bytes) { - abytes2(bytes); - if (hasHexBuiltin2) - return bytes.toHex(); - let hex = ""; - for (let i = 0; i < bytes.length; i++) { - hex += hexes2[bytes[i]]; - } - return hex; - } - var asciis2 = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; - function asciiToBase162(ch) { - if (ch >= asciis2._0 && ch <= asciis2._9) - return ch - asciis2._0; - if (ch >= asciis2.A && ch <= asciis2.F) - return ch - (asciis2.A - 10); - if (ch >= asciis2.a && ch <= asciis2.f) - return ch - (asciis2.a - 10); - return; - } - function hexToBytes2(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - if (hasHexBuiltin2) - return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error("hex string expected, got unpadded hex of length " + hl); - const array2 = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase162(hex.charCodeAt(hi)); - const n2 = asciiToBase162(hex.charCodeAt(hi + 1)); - if (n1 === void 0 || n2 === void 0) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array2[ai] = n1 * 16 + n2; - } - return array2; - } - var nextTick = async () => { - }; - exports2.nextTick = nextTick; - async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await (0, exports2.nextTick)(); - ts += diff; - } - } - function utf8ToBytes2(str) { - if (typeof str !== "string") - throw new Error("string expected"); - return new Uint8Array(new TextEncoder().encode(str)); - } - function bytesToUtf82(bytes) { - return new TextDecoder().decode(bytes); - } - function toBytes2(data) { - if (typeof data === "string") - data = utf8ToBytes2(data); - abytes2(data); - return data; - } - function kdfInputToBytes(data) { - if (typeof data === "string") - data = utf8ToBytes2(data); - abytes2(data); - return data; - } - function concatBytes2(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes2(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; - } - function checkOpts(defaults, opts) { - if (opts !== void 0 && {}.toString.call(opts) !== "[object Object]") - throw new Error("options should be object or undefined"); - const merged = Object.assign(defaults, opts); - return merged; - } - var Hash2 = class { - }; - exports2.Hash = Hash2; - function createHasher2(hashCons) { - const hashC = (msg) => hashCons().update(toBytes2(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; - } - function createOptHasher(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; - } - function createXOFer2(hashCons) { - const hashC = (msg, opts) => hashCons(opts).update(toBytes2(msg)).digest(); - const tmp = hashCons({}); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = (opts) => hashCons(opts); - return hashC; - } - exports2.wrapConstructor = createHasher2; - exports2.wrapConstructorWithOpts = createOptHasher; - exports2.wrapXOFConstructorWithOpts = createXOFer2; - function randomBytes3(bytesLength = 32) { - if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === "function") { - return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength)); - } - if (crypto_1.crypto && typeof crypto_1.crypto.randomBytes === "function") { - return Uint8Array.from(crypto_1.crypto.randomBytes(bytesLength)); - } - throw new Error("crypto.getRandomValues must be defined"); - } - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_md.js -var require_md = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_md.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SHA512_IV = exports2.SHA384_IV = exports2.SHA224_IV = exports2.SHA256_IV = exports2.HashMD = void 0; - exports2.setBigUint64 = setBigUint642; - exports2.Chi = Chi2; - exports2.Maj = Maj2; - var utils_ts_1 = require_utils2(); - function setBigUint642(view, byteOffset, value, isLE2) { - if (typeof view.setBigUint64 === "function") - return view.setBigUint64(byteOffset, value, isLE2); - const _32n2 = BigInt(32); - const _u32_max = BigInt(4294967295); - const wh = Number(value >> _32n2 & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE2 ? 4 : 0; - const l = isLE2 ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE2); - view.setUint32(byteOffset + l, wl, isLE2); - } - function Chi2(a, b, c) { - return a & b ^ ~a & c; - } - function Maj2(a, b, c) { - return a & b ^ a & c ^ b & c; - } - var HashMD2 = class extends utils_ts_1.Hash { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.buffer = new Uint8Array(blockLen); - this.view = (0, utils_ts_1.createView)(this.buffer); - } - update(data) { - (0, utils_ts_1.aexists)(this); - data = (0, utils_ts_1.toBytes)(data); - (0, utils_ts_1.abytes)(data); - const { view, buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - if (take === blockLen) { - const dataView = (0, utils_ts_1.createView)(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.aoutput)(out, this); - this.finished = true; - const { buffer, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer[pos++] = 128; - (0, utils_ts_1.clean)(this.buffer.subarray(pos)); - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - setBigUint642(view, blockLen - 8, BigInt(this.length * 8), isLE2); - this.process(view, 0); - const oview = (0, utils_ts_1.createView)(out); - const len = this.outputLen; - if (len % 4) - throw new Error("_sha2: outputLen should be aligned to 32bit"); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error("_sha2: outputLen bigger than state"); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE2); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - clone() { - return this._cloneInto(); - } - }; - exports2.HashMD = HashMD2; - exports2.SHA256_IV = Uint32Array.from([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]); - exports2.SHA224_IV = Uint32Array.from([ - 3238371032, - 914150663, - 812702999, - 4144912697, - 4290775857, - 1750603025, - 1694076839, - 3204075428 - ]); - exports2.SHA384_IV = Uint32Array.from([ - 3418070365, - 3238371032, - 1654270250, - 914150663, - 2438529370, - 812702999, - 355462360, - 4144912697, - 1731405415, - 4290775857, - 2394180231, - 1750603025, - 3675008525, - 1694076839, - 1203062813, - 3204075428 - ]); - exports2.SHA512_IV = Uint32Array.from([ - 1779033703, - 4089235720, - 3144134277, - 2227873595, - 1013904242, - 4271175723, - 2773480762, - 1595750129, - 1359893119, - 2917565137, - 2600822924, - 725511199, - 528734635, - 4215389547, - 1541459225, - 327033209 - ]); - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_u64.js -var require_u64 = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/_u64.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toBig = exports2.shrSL = exports2.shrSH = exports2.rotrSL = exports2.rotrSH = exports2.rotrBL = exports2.rotrBH = exports2.rotr32L = exports2.rotr32H = exports2.rotlSL = exports2.rotlSH = exports2.rotlBL = exports2.rotlBH = exports2.add5L = exports2.add5H = exports2.add4L = exports2.add4H = exports2.add3L = exports2.add3H = void 0; - exports2.add = add2; - exports2.fromBig = fromBig2; - exports2.split = split2; - var U32_MASK642 = /* @__PURE__ */ BigInt(2 ** 32 - 1); - var _32n2 = /* @__PURE__ */ BigInt(32); - function fromBig2(n, le = false) { - if (le) - return { h: Number(n & U32_MASK642), l: Number(n >> _32n2 & U32_MASK642) }; - return { h: Number(n >> _32n2 & U32_MASK642) | 0, l: Number(n & U32_MASK642) | 0 }; - } - function split2(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig2(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; - } - var toBig = (h, l) => BigInt(h >>> 0) << _32n2 | BigInt(l >>> 0); - exports2.toBig = toBig; - var shrSH2 = (h, _l, s) => h >>> s; - exports2.shrSH = shrSH2; - var shrSL2 = (h, l, s) => h << 32 - s | l >>> s; - exports2.shrSL = shrSL2; - var rotrSH2 = (h, l, s) => h >>> s | l << 32 - s; - exports2.rotrSH = rotrSH2; - var rotrSL2 = (h, l, s) => h << 32 - s | l >>> s; - exports2.rotrSL = rotrSL2; - var rotrBH2 = (h, l, s) => h << 64 - s | l >>> s - 32; - exports2.rotrBH = rotrBH2; - var rotrBL2 = (h, l, s) => h >>> s - 32 | l << 64 - s; - exports2.rotrBL = rotrBL2; - var rotr32H = (_h, l) => l; - exports2.rotr32H = rotr32H; - var rotr32L = (h, _l) => h; - exports2.rotr32L = rotr32L; - var rotlSH2 = (h, l, s) => h << s | l >>> 32 - s; - exports2.rotlSH = rotlSH2; - var rotlSL2 = (h, l, s) => l << s | h >>> 32 - s; - exports2.rotlSL = rotlSL2; - var rotlBH2 = (h, l, s) => l << s - 32 | h >>> 64 - s; - exports2.rotlBH = rotlBH2; - var rotlBL2 = (h, l, s) => h << s - 32 | l >>> 64 - s; - exports2.rotlBL = rotlBL2; - function add2(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; - } - var add3L2 = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); - exports2.add3L = add3L2; - var add3H2 = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; - exports2.add3H = add3H2; - var add4L2 = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); - exports2.add4L = add4L2; - var add4H2 = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; - exports2.add4H = add4H2; - var add5L2 = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); - exports2.add5L = add5L2; - var add5H2 = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; - exports2.add5H = add5H2; - var u642 = { - fromBig: fromBig2, - split: split2, - toBig, - shrSH: shrSH2, - shrSL: shrSL2, - rotrSH: rotrSH2, - rotrSL: rotrSL2, - rotrBH: rotrBH2, - rotrBL: rotrBL2, - rotr32H, - rotr32L, - rotlSH: rotlSH2, - rotlSL: rotlSL2, - rotlBH: rotlBH2, - rotlBL: rotlBL2, - add: add2, - add3L: add3L2, - add3H: add3H2, - add4L: add4L2, - add4H: add4H2, - add5H: add5H2, - add5L: add5L2 - }; - exports2.default = u642; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha2.js -var require_sha2 = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sha512_224 = exports2.sha512_256 = exports2.sha384 = exports2.sha512 = exports2.sha224 = exports2.sha256 = exports2.SHA512_256 = exports2.SHA512_224 = exports2.SHA384 = exports2.SHA512 = exports2.SHA224 = exports2.SHA256 = void 0; - var _md_ts_1 = require_md(); - var u642 = require_u64(); - var utils_ts_1 = require_utils2(); - var SHA256_K2 = /* @__PURE__ */ Uint32Array.from([ - 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 - ]); - var SHA256_W2 = /* @__PURE__ */ new Uint32Array(64); - var SHA2562 = class extends _md_ts_1.HashMD { - constructor(outputLen = 32) { - super(64, outputLen, 8, false); - this.A = _md_ts_1.SHA256_IV[0] | 0; - this.B = _md_ts_1.SHA256_IV[1] | 0; - this.C = _md_ts_1.SHA256_IV[2] | 0; - this.D = _md_ts_1.SHA256_IV[3] | 0; - this.E = _md_ts_1.SHA256_IV[4] | 0; - this.F = _md_ts_1.SHA256_IV[5] | 0; - this.G = _md_ts_1.SHA256_IV[6] | 0; - this.H = _md_ts_1.SHA256_IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset2) { - for (let i = 0; i < 16; i++, offset2 += 4) - SHA256_W2[i] = view.getUint32(offset2, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W2[i - 15]; - const W2 = SHA256_W2[i - 2]; - const s0 = (0, utils_ts_1.rotr)(W15, 7) ^ (0, utils_ts_1.rotr)(W15, 18) ^ W15 >>> 3; - const s1 = (0, utils_ts_1.rotr)(W2, 17) ^ (0, utils_ts_1.rotr)(W2, 19) ^ W2 >>> 10; - SHA256_W2[i] = s1 + SHA256_W2[i - 7] + s0 + SHA256_W2[i - 16] | 0; - } - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = (0, utils_ts_1.rotr)(E, 6) ^ (0, utils_ts_1.rotr)(E, 11) ^ (0, utils_ts_1.rotr)(E, 25); - const T1 = H + sigma1 + (0, _md_ts_1.Chi)(E, F, G) + SHA256_K2[i] + SHA256_W2[i] | 0; - const sigma0 = (0, utils_ts_1.rotr)(A, 2) ^ (0, utils_ts_1.rotr)(A, 13) ^ (0, utils_ts_1.rotr)(A, 22); - const T2 = sigma0 + (0, _md_ts_1.Maj)(A, B, C) | 0; - H = G; - G = F; - F = E; - E = D + T1 | 0; - D = C; - C = B; - B = A; - A = T1 + T2 | 0; - } - A = A + this.A | 0; - B = B + this.B | 0; - C = C + this.C | 0; - D = D + this.D | 0; - E = E + this.E | 0; - F = F + this.F | 0; - G = G + this.G | 0; - H = H + this.H | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - (0, utils_ts_1.clean)(SHA256_W2); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - (0, utils_ts_1.clean)(this.buffer); - } - }; - exports2.SHA256 = SHA2562; - var SHA2242 = class extends SHA2562 { - constructor() { - super(28); - this.A = _md_ts_1.SHA224_IV[0] | 0; - this.B = _md_ts_1.SHA224_IV[1] | 0; - this.C = _md_ts_1.SHA224_IV[2] | 0; - this.D = _md_ts_1.SHA224_IV[3] | 0; - this.E = _md_ts_1.SHA224_IV[4] | 0; - this.F = _md_ts_1.SHA224_IV[5] | 0; - this.G = _md_ts_1.SHA224_IV[6] | 0; - this.H = _md_ts_1.SHA224_IV[7] | 0; - } - }; - exports2.SHA224 = SHA2242; - var K5122 = /* @__PURE__ */ (() => u642.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((n) => BigInt(n))))(); - var SHA512_Kh2 = /* @__PURE__ */ (() => K5122[0])(); - var SHA512_Kl2 = /* @__PURE__ */ (() => K5122[1])(); - var SHA512_W_H2 = /* @__PURE__ */ new Uint32Array(80); - var SHA512_W_L2 = /* @__PURE__ */ new Uint32Array(80); - var SHA5122 = class extends _md_ts_1.HashMD { - constructor(outputLen = 64) { - super(128, outputLen, 16, false); - this.Ah = _md_ts_1.SHA512_IV[0] | 0; - this.Al = _md_ts_1.SHA512_IV[1] | 0; - this.Bh = _md_ts_1.SHA512_IV[2] | 0; - this.Bl = _md_ts_1.SHA512_IV[3] | 0; - this.Ch = _md_ts_1.SHA512_IV[4] | 0; - this.Cl = _md_ts_1.SHA512_IV[5] | 0; - this.Dh = _md_ts_1.SHA512_IV[6] | 0; - this.Dl = _md_ts_1.SHA512_IV[7] | 0; - this.Eh = _md_ts_1.SHA512_IV[8] | 0; - this.El = _md_ts_1.SHA512_IV[9] | 0; - this.Fh = _md_ts_1.SHA512_IV[10] | 0; - this.Fl = _md_ts_1.SHA512_IV[11] | 0; - this.Gh = _md_ts_1.SHA512_IV[12] | 0; - this.Gl = _md_ts_1.SHA512_IV[13] | 0; - this.Hh = _md_ts_1.SHA512_IV[14] | 0; - this.Hl = _md_ts_1.SHA512_IV[15] | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset2) { - for (let i = 0; i < 16; i++, offset2 += 4) { - SHA512_W_H2[i] = view.getUint32(offset2); - SHA512_W_L2[i] = view.getUint32(offset2 += 4); - } - for (let i = 16; i < 80; i++) { - const W15h = SHA512_W_H2[i - 15] | 0; - const W15l = SHA512_W_L2[i - 15] | 0; - const s0h = u642.rotrSH(W15h, W15l, 1) ^ u642.rotrSH(W15h, W15l, 8) ^ u642.shrSH(W15h, W15l, 7); - const s0l = u642.rotrSL(W15h, W15l, 1) ^ u642.rotrSL(W15h, W15l, 8) ^ u642.shrSL(W15h, W15l, 7); - const W2h = SHA512_W_H2[i - 2] | 0; - const W2l = SHA512_W_L2[i - 2] | 0; - const s1h = u642.rotrSH(W2h, W2l, 19) ^ u642.rotrBH(W2h, W2l, 61) ^ u642.shrSH(W2h, W2l, 6); - const s1l = u642.rotrSL(W2h, W2l, 19) ^ u642.rotrBL(W2h, W2l, 61) ^ u642.shrSL(W2h, W2l, 6); - const SUMl = u642.add4L(s0l, s1l, SHA512_W_L2[i - 7], SHA512_W_L2[i - 16]); - const SUMh = u642.add4H(SUMl, s0h, s1h, SHA512_W_H2[i - 7], SHA512_W_H2[i - 16]); - SHA512_W_H2[i] = SUMh | 0; - SHA512_W_L2[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - for (let i = 0; i < 80; i++) { - const sigma1h = u642.rotrSH(Eh, El, 14) ^ u642.rotrSH(Eh, El, 18) ^ u642.rotrBH(Eh, El, 41); - const sigma1l = u642.rotrSL(Eh, El, 14) ^ u642.rotrSL(Eh, El, 18) ^ u642.rotrBL(Eh, El, 41); - const CHIh = Eh & Fh ^ ~Eh & Gh; - const CHIl = El & Fl ^ ~El & Gl; - const T1ll = u642.add5L(Hl, sigma1l, CHIl, SHA512_Kl2[i], SHA512_W_L2[i]); - const T1h = u642.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh2[i], SHA512_W_H2[i]); - const T1l = T1ll | 0; - const sigma0h = u642.rotrSH(Ah, Al, 28) ^ u642.rotrBH(Ah, Al, 34) ^ u642.rotrBH(Ah, Al, 39); - const sigma0l = u642.rotrSL(Ah, Al, 28) ^ u642.rotrBL(Ah, Al, 34) ^ u642.rotrBL(Ah, Al, 39); - const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch; - const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u642.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u642.add3L(T1l, sigma0l, MAJl); - Ah = u642.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - ({ h: Ah, l: Al } = u642.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u642.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u642.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u642.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u642.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u642.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u642.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u642.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - (0, utils_ts_1.clean)(SHA512_W_H2, SHA512_W_L2); - } - destroy() { - (0, utils_ts_1.clean)(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - }; - exports2.SHA512 = SHA5122; - var SHA384 = class extends SHA5122 { - constructor() { - super(48); - this.Ah = _md_ts_1.SHA384_IV[0] | 0; - this.Al = _md_ts_1.SHA384_IV[1] | 0; - this.Bh = _md_ts_1.SHA384_IV[2] | 0; - this.Bl = _md_ts_1.SHA384_IV[3] | 0; - this.Ch = _md_ts_1.SHA384_IV[4] | 0; - this.Cl = _md_ts_1.SHA384_IV[5] | 0; - this.Dh = _md_ts_1.SHA384_IV[6] | 0; - this.Dl = _md_ts_1.SHA384_IV[7] | 0; - this.Eh = _md_ts_1.SHA384_IV[8] | 0; - this.El = _md_ts_1.SHA384_IV[9] | 0; - this.Fh = _md_ts_1.SHA384_IV[10] | 0; - this.Fl = _md_ts_1.SHA384_IV[11] | 0; - this.Gh = _md_ts_1.SHA384_IV[12] | 0; - this.Gl = _md_ts_1.SHA384_IV[13] | 0; - this.Hh = _md_ts_1.SHA384_IV[14] | 0; - this.Hl = _md_ts_1.SHA384_IV[15] | 0; - } - }; - exports2.SHA384 = SHA384; - var T224_IV = /* @__PURE__ */ Uint32Array.from([ - 2352822216, - 424955298, - 1944164710, - 2312950998, - 502970286, - 855612546, - 1738396948, - 1479516111, - 258812777, - 2077511080, - 2011393907, - 79989058, - 1067287976, - 1780299464, - 286451373, - 2446758561 - ]); - var T256_IV = /* @__PURE__ */ Uint32Array.from([ - 573645204, - 4230739756, - 2673172387, - 3360449730, - 596883563, - 1867755857, - 2520282905, - 1497426621, - 2519219938, - 2827943907, - 3193839141, - 1401305490, - 721525244, - 746961066, - 246885852, - 2177182882 - ]); - var SHA512_224 = class extends SHA5122 { - constructor() { - super(28); - this.Ah = T224_IV[0] | 0; - this.Al = T224_IV[1] | 0; - this.Bh = T224_IV[2] | 0; - this.Bl = T224_IV[3] | 0; - this.Ch = T224_IV[4] | 0; - this.Cl = T224_IV[5] | 0; - this.Dh = T224_IV[6] | 0; - this.Dl = T224_IV[7] | 0; - this.Eh = T224_IV[8] | 0; - this.El = T224_IV[9] | 0; - this.Fh = T224_IV[10] | 0; - this.Fl = T224_IV[11] | 0; - this.Gh = T224_IV[12] | 0; - this.Gl = T224_IV[13] | 0; - this.Hh = T224_IV[14] | 0; - this.Hl = T224_IV[15] | 0; - } - }; - exports2.SHA512_224 = SHA512_224; - var SHA512_256 = class extends SHA5122 { - constructor() { - super(32); - this.Ah = T256_IV[0] | 0; - this.Al = T256_IV[1] | 0; - this.Bh = T256_IV[2] | 0; - this.Bl = T256_IV[3] | 0; - this.Ch = T256_IV[4] | 0; - this.Cl = T256_IV[5] | 0; - this.Dh = T256_IV[6] | 0; - this.Dl = T256_IV[7] | 0; - this.Eh = T256_IV[8] | 0; - this.El = T256_IV[9] | 0; - this.Fh = T256_IV[10] | 0; - this.Fl = T256_IV[11] | 0; - this.Gh = T256_IV[12] | 0; - this.Gl = T256_IV[13] | 0; - this.Hh = T256_IV[14] | 0; - this.Hl = T256_IV[15] | 0; - } - }; - exports2.SHA512_256 = SHA512_256; - exports2.sha256 = (0, utils_ts_1.createHasher)(() => new SHA2562()); - exports2.sha224 = (0, utils_ts_1.createHasher)(() => new SHA2242()); - exports2.sha512 = (0, utils_ts_1.createHasher)(() => new SHA5122()); - exports2.sha384 = (0, utils_ts_1.createHasher)(() => new SHA384()); - exports2.sha512_256 = (0, utils_ts_1.createHasher)(() => new SHA512_256()); - exports2.sha512_224 = (0, utils_ts_1.createHasher)(() => new SHA512_224()); - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha256.js -var require_sha256 = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sha224 = exports2.SHA224 = exports2.sha256 = exports2.SHA256 = void 0; - var sha2_ts_1 = require_sha2(); - exports2.SHA256 = sha2_ts_1.SHA256; - exports2.sha256 = sha2_ts_1.sha256; - exports2.SHA224 = sha2_ts_1.SHA224; - exports2.sha224 = sha2_ts_1.sha224; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha512.js -var require_sha512 = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/sha512.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.sha512_256 = exports2.SHA512_256 = exports2.sha512_224 = exports2.SHA512_224 = exports2.sha384 = exports2.SHA384 = exports2.sha512 = exports2.SHA512 = void 0; - var sha2_ts_1 = require_sha2(); - exports2.SHA512 = sha2_ts_1.SHA512; - exports2.sha512 = sha2_ts_1.sha512; - exports2.SHA384 = sha2_ts_1.SHA384; - exports2.sha384 = sha2_ts_1.sha384; - exports2.SHA512_224 = sha2_ts_1.SHA512_224; - exports2.sha512_224 = sha2_ts_1.sha512_224; - exports2.SHA512_256 = sha2_ts_1.SHA512_256; - exports2.sha512_256 = sha2_ts_1.sha512_256; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/hmac.js -var require_hmac = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/hmac.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hmac = exports2.HMAC = void 0; - var utils_ts_1 = require_utils2(); - var HMAC2 = class extends utils_ts_1.Hash { - constructor(hash, _key) { - super(); - this.finished = false; - this.destroyed = false; - (0, utils_ts_1.ahash)(hash); - const key = (0, utils_ts_1.toBytes)(_key); - this.iHash = hash.create(); - if (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 blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 54; - this.iHash.update(pad); - this.oHash = hash.create(); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 54 ^ 92; - this.oHash.update(pad); - (0, utils_ts_1.clean)(pad); - } - update(buf) { - (0, utils_ts_1.aexists)(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - (0, utils_ts_1.aexists)(this); - (0, utils_ts_1.abytes)(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone() { - return this._cloneInto(); - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } - }; - exports2.HMAC = HMAC2; - var hmac2 = (hash, key, message) => new HMAC2(hash, key).update(message).digest(); - exports2.hmac = hmac2; - exports2.hmac.create = (hash, key) => new HMAC2(hash, key); - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/pbkdf2.js -var require_pbkdf2 = __commonJS({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/pbkdf2.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.pbkdf2 = pbkdf2; - exports2.pbkdf2Async = pbkdf2Async; - var hmac_ts_1 = require_hmac(); - var utils_ts_1 = require_utils2(); - function pbkdf2Init(hash, _password, _salt, _opts) { - (0, utils_ts_1.ahash)(hash); - const opts = (0, utils_ts_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - (0, utils_ts_1.anumber)(c); - (0, utils_ts_1.anumber)(dkLen); - (0, utils_ts_1.anumber)(asyncTick); - if (c < 1) - throw new Error("iterations (c) should be >= 1"); - const password = (0, utils_ts_1.kdfInputToBytes)(_password); - const salt = (0, utils_ts_1.kdfInputToBytes)(_salt); - const DK = new Uint8Array(dkLen); - const PRF = hmac_ts_1.hmac.create(hash, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; - } - function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - (0, utils_ts_1.clean)(u); - return DK; - } - function pbkdf2(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; - const arr = new Uint8Array(4); - const view = (0, utils_ts_1.createView)(arr); - const u = new Uint8Array(PRF.outputLen); - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); - } - async function pbkdf2Async(hash, password, salt, opts) { - const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; - const arr = new Uint8Array(4); - const view = (0, utils_ts_1.createView)(arr); - const u = new Uint8Array(PRF.outputLen); - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - await (0, utils_ts_1.asyncLoop)(c - 1, asyncTick, () => { - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - }); - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); - } - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/czech.json -var require_czech = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/czech.json"(exports2, module2) { - module2.exports = [ - "abdikace", - "abeceda", - "adresa", - "agrese", - "akce", - "aktovka", - "alej", - "alkohol", - "amputace", - "ananas", - "andulka", - "anekdota", - "anketa", - "antika", - "anulovat", - "archa", - "arogance", - "asfalt", - "asistent", - "aspirace", - "astma", - "astronom", - "atlas", - "atletika", - "atol", - "autobus", - "azyl", - "babka", - "bachor", - "bacil", - "baculka", - "badatel", - "bageta", - "bagr", - "bahno", - "bakterie", - "balada", - "baletka", - "balkon", - "balonek", - "balvan", - "balza", - "bambus", - "bankomat", - "barbar", - "baret", - "barman", - "baroko", - "barva", - "baterka", - "batoh", - "bavlna", - "bazalka", - "bazilika", - "bazuka", - "bedna", - "beran", - "beseda", - "bestie", - "beton", - "bezinka", - "bezmoc", - "beztak", - "bicykl", - "bidlo", - "biftek", - "bikiny", - "bilance", - "biograf", - "biolog", - "bitva", - "bizon", - "blahobyt", - "blatouch", - "blecha", - "bledule", - "blesk", - "blikat", - "blizna", - "blokovat", - "bloudit", - "blud", - "bobek", - "bobr", - "bodlina", - "bodnout", - "bohatost", - "bojkot", - "bojovat", - "bokorys", - "bolest", - "borec", - "borovice", - "bota", - "boubel", - "bouchat", - "bouda", - "boule", - "bourat", - "boxer", - "bradavka", - "brambora", - "branka", - "bratr", - "brepta", - "briketa", - "brko", - "brloh", - "bronz", - "broskev", - "brunetka", - "brusinka", - "brzda", - "brzy", - "bublina", - "bubnovat", - "buchta", - "buditel", - "budka", - "budova", - "bufet", - "bujarost", - "bukvice", - "buldok", - "bulva", - "bunda", - "bunkr", - "burza", - "butik", - "buvol", - "buzola", - "bydlet", - "bylina", - "bytovka", - "bzukot", - "capart", - "carevna", - "cedr", - "cedule", - "cejch", - "cejn", - "cela", - "celer", - "celkem", - "celnice", - "cenina", - "cennost", - "cenovka", - "centrum", - "cenzor", - "cestopis", - "cetka", - "chalupa", - "chapadlo", - "charita", - "chata", - "chechtat", - "chemie", - "chichot", - "chirurg", - "chlad", - "chleba", - "chlubit", - "chmel", - "chmura", - "chobot", - "chochol", - "chodba", - "cholera", - "chomout", - "chopit", - "choroba", - "chov", - "chrapot", - "chrlit", - "chrt", - "chrup", - "chtivost", - "chudina", - "chutnat", - "chvat", - "chvilka", - "chvost", - "chyba", - "chystat", - "chytit", - "cibule", - "cigareta", - "cihelna", - "cihla", - "cinkot", - "cirkus", - "cisterna", - "citace", - "citrus", - "cizinec", - "cizost", - "clona", - "cokoliv", - "couvat", - "ctitel", - "ctnost", - "cudnost", - "cuketa", - "cukr", - "cupot", - "cvaknout", - "cval", - "cvik", - "cvrkot", - "cyklista", - "daleko", - "dareba", - "datel", - "datum", - "dcera", - "debata", - "dechovka", - "decibel", - "deficit", - "deflace", - "dekl", - "dekret", - "demokrat", - "deprese", - "derby", - "deska", - "detektiv", - "dikobraz", - "diktovat", - "dioda", - "diplom", - "disk", - "displej", - "divadlo", - "divoch", - "dlaha", - "dlouho", - "dluhopis", - "dnes", - "dobro", - "dobytek", - "docent", - "dochutit", - "dodnes", - "dohled", - "dohoda", - "dohra", - "dojem", - "dojnice", - "doklad", - "dokola", - "doktor", - "dokument", - "dolar", - "doleva", - "dolina", - "doma", - "dominant", - "domluvit", - "domov", - "donutit", - "dopad", - "dopis", - "doplnit", - "doposud", - "doprovod", - "dopustit", - "dorazit", - "dorost", - "dort", - "dosah", - "doslov", - "dostatek", - "dosud", - "dosyta", - "dotaz", - "dotek", - "dotknout", - "doufat", - "doutnat", - "dovozce", - "dozadu", - "doznat", - "dozorce", - "drahota", - "drak", - "dramatik", - "dravec", - "draze", - "drdol", - "drobnost", - "drogerie", - "drozd", - "drsnost", - "drtit", - "drzost", - "duben", - "duchovno", - "dudek", - "duha", - "duhovka", - "dusit", - "dusno", - "dutost", - "dvojice", - "dvorec", - "dynamit", - "ekolog", - "ekonomie", - "elektron", - "elipsa", - "email", - "emise", - "emoce", - "empatie", - "epizoda", - "epocha", - "epopej", - "epos", - "esej", - "esence", - "eskorta", - "eskymo", - "etiketa", - "euforie", - "evoluce", - "exekuce", - "exkurze", - "expedice", - "exploze", - "export", - "extrakt", - "facka", - "fajfka", - "fakulta", - "fanatik", - "fantazie", - "farmacie", - "favorit", - "fazole", - "federace", - "fejeton", - "fenka", - "fialka", - "figurant", - "filozof", - "filtr", - "finance", - "finta", - "fixace", - "fjord", - "flanel", - "flirt", - "flotila", - "fond", - "fosfor", - "fotbal", - "fotka", - "foton", - "frakce", - "freska", - "fronta", - "fukar", - "funkce", - "fyzika", - "galeje", - "garant", - "genetika", - "geolog", - "gilotina", - "glazura", - "glejt", - "golem", - "golfista", - "gotika", - "graf", - "gramofon", - "granule", - "grep", - "gril", - "grog", - "groteska", - "guma", - "hadice", - "hadr", - "hala", - "halenka", - "hanba", - "hanopis", - "harfa", - "harpuna", - "havran", - "hebkost", - "hejkal", - "hejno", - "hejtman", - "hektar", - "helma", - "hematom", - "herec", - "herna", - "heslo", - "hezky", - "historik", - "hladovka", - "hlasivky", - "hlava", - "hledat", - "hlen", - "hlodavec", - "hloh", - "hloupost", - "hltat", - "hlubina", - "hluchota", - "hmat", - "hmota", - "hmyz", - "hnis", - "hnojivo", - "hnout", - "hoblina", - "hoboj", - "hoch", - "hodiny", - "hodlat", - "hodnota", - "hodovat", - "hojnost", - "hokej", - "holinka", - "holka", - "holub", - "homole", - "honitba", - "honorace", - "horal", - "horda", - "horizont", - "horko", - "horlivec", - "hormon", - "hornina", - "horoskop", - "horstvo", - "hospoda", - "hostina", - "hotovost", - "houba", - "houf", - "houpat", - "houska", - "hovor", - "hradba", - "hranice", - "hravost", - "hrazda", - "hrbolek", - "hrdina", - "hrdlo", - "hrdost", - "hrnek", - "hrobka", - "hromada", - "hrot", - "hrouda", - "hrozen", - "hrstka", - "hrubost", - "hryzat", - "hubenost", - "hubnout", - "hudba", - "hukot", - "humr", - "husita", - "hustota", - "hvozd", - "hybnost", - "hydrant", - "hygiena", - "hymna", - "hysterik", - "idylka", - "ihned", - "ikona", - "iluze", - "imunita", - "infekce", - "inflace", - "inkaso", - "inovace", - "inspekce", - "internet", - "invalida", - "investor", - "inzerce", - "ironie", - "jablko", - "jachta", - "jahoda", - "jakmile", - "jakost", - "jalovec", - "jantar", - "jarmark", - "jaro", - "jasan", - "jasno", - "jatka", - "javor", - "jazyk", - "jedinec", - "jedle", - "jednatel", - "jehlan", - "jekot", - "jelen", - "jelito", - "jemnost", - "jenom", - "jepice", - "jeseter", - "jevit", - "jezdec", - "jezero", - "jinak", - "jindy", - "jinoch", - "jiskra", - "jistota", - "jitrnice", - "jizva", - "jmenovat", - "jogurt", - "jurta", - "kabaret", - "kabel", - "kabinet", - "kachna", - "kadet", - "kadidlo", - "kahan", - "kajak", - "kajuta", - "kakao", - "kaktus", - "kalamita", - "kalhoty", - "kalibr", - "kalnost", - "kamera", - "kamkoliv", - "kamna", - "kanibal", - "kanoe", - "kantor", - "kapalina", - "kapela", - "kapitola", - "kapka", - "kaple", - "kapota", - "kapr", - "kapusta", - "kapybara", - "karamel", - "karotka", - "karton", - "kasa", - "katalog", - "katedra", - "kauce", - "kauza", - "kavalec", - "kazajka", - "kazeta", - "kazivost", - "kdekoliv", - "kdesi", - "kedluben", - "kemp", - "keramika", - "kino", - "klacek", - "kladivo", - "klam", - "klapot", - "klasika", - "klaun", - "klec", - "klenba", - "klepat", - "klesnout", - "klid", - "klima", - "klisna", - "klobouk", - "klokan", - "klopa", - "kloub", - "klubovna", - "klusat", - "kluzkost", - "kmen", - "kmitat", - "kmotr", - "kniha", - "knot", - "koalice", - "koberec", - "kobka", - "kobliha", - "kobyla", - "kocour", - "kohout", - "kojenec", - "kokos", - "koktejl", - "kolaps", - "koleda", - "kolize", - "kolo", - "komando", - "kometa", - "komik", - "komnata", - "komora", - "kompas", - "komunita", - "konat", - "koncept", - "kondice", - "konec", - "konfese", - "kongres", - "konina", - "konkurs", - "kontakt", - "konzerva", - "kopanec", - "kopie", - "kopnout", - "koprovka", - "korbel", - "korektor", - "kormidlo", - "koroptev", - "korpus", - "koruna", - "koryto", - "korzet", - "kosatec", - "kostka", - "kotel", - "kotleta", - "kotoul", - "koukat", - "koupelna", - "kousek", - "kouzlo", - "kovboj", - "koza", - "kozoroh", - "krabice", - "krach", - "krajina", - "kralovat", - "krasopis", - "kravata", - "kredit", - "krejcar", - "kresba", - "kreveta", - "kriket", - "kritik", - "krize", - "krkavec", - "krmelec", - "krmivo", - "krocan", - "krok", - "kronika", - "kropit", - "kroupa", - "krovka", - "krtek", - "kruhadlo", - "krupice", - "krutost", - "krvinka", - "krychle", - "krypta", - "krystal", - "kryt", - "kudlanka", - "kufr", - "kujnost", - "kukla", - "kulajda", - "kulich", - "kulka", - "kulomet", - "kultura", - "kuna", - "kupodivu", - "kurt", - "kurzor", - "kutil", - "kvalita", - "kvasinka", - "kvestor", - "kynolog", - "kyselina", - "kytara", - "kytice", - "kytka", - "kytovec", - "kyvadlo", - "labrador", - "lachtan", - "ladnost", - "laik", - "lakomec", - "lamela", - "lampa", - "lanovka", - "lasice", - "laso", - "lastura", - "latinka", - "lavina", - "lebka", - "leckdy", - "leden", - "lednice", - "ledovka", - "ledvina", - "legenda", - "legie", - "legrace", - "lehce", - "lehkost", - "lehnout", - "lektvar", - "lenochod", - "lentilka", - "lepenka", - "lepidlo", - "letadlo", - "letec", - "letmo", - "letokruh", - "levhart", - "levitace", - "levobok", - "libra", - "lichotka", - "lidojed", - "lidskost", - "lihovina", - "lijavec", - "lilek", - "limetka", - "linie", - "linka", - "linoleum", - "listopad", - "litina", - "litovat", - "lobista", - "lodivod", - "logika", - "logoped", - "lokalita", - "loket", - "lomcovat", - "lopata", - "lopuch", - "lord", - "losos", - "lotr", - "loudal", - "louh", - "louka", - "louskat", - "lovec", - "lstivost", - "lucerna", - "lucifer", - "lump", - "lusk", - "lustrace", - "lvice", - "lyra", - "lyrika", - "lysina", - "madam", - "madlo", - "magistr", - "mahagon", - "majetek", - "majitel", - "majorita", - "makak", - "makovice", - "makrela", - "malba", - "malina", - "malovat", - "malvice", - "maminka", - "mandle", - "manko", - "marnost", - "masakr", - "maskot", - "masopust", - "matice", - "matrika", - "maturita", - "mazanec", - "mazivo", - "mazlit", - "mazurka", - "mdloba", - "mechanik", - "meditace", - "medovina", - "melasa", - "meloun", - "mentolka", - "metla", - "metoda", - "metr", - "mezera", - "migrace", - "mihnout", - "mihule", - "mikina", - "mikrofon", - "milenec", - "milimetr", - "milost", - "mimika", - "mincovna", - "minibar", - "minomet", - "minulost", - "miska", - "mistr", - "mixovat", - "mladost", - "mlha", - "mlhovina", - "mlok", - "mlsat", - "mluvit", - "mnich", - "mnohem", - "mobil", - "mocnost", - "modelka", - "modlitba", - "mohyla", - "mokro", - "molekula", - "momentka", - "monarcha", - "monokl", - "monstrum", - "montovat", - "monzun", - "mosaz", - "moskyt", - "most", - "motivace", - "motorka", - "motyka", - "moucha", - "moudrost", - "mozaika", - "mozek", - "mozol", - "mramor", - "mravenec", - "mrkev", - "mrtvola", - "mrzet", - "mrzutost", - "mstitel", - "mudrc", - "muflon", - "mulat", - "mumie", - "munice", - "muset", - "mutace", - "muzeum", - "muzikant", - "myslivec", - "mzda", - "nabourat", - "nachytat", - "nadace", - "nadbytek", - "nadhoz", - "nadobro", - "nadpis", - "nahlas", - "nahnat", - "nahodile", - "nahradit", - "naivita", - "najednou", - "najisto", - "najmout", - "naklonit", - "nakonec", - "nakrmit", - "nalevo", - "namazat", - "namluvit", - "nanometr", - "naoko", - "naopak", - "naostro", - "napadat", - "napevno", - "naplnit", - "napnout", - "naposled", - "naprosto", - "narodit", - "naruby", - "narychlo", - "nasadit", - "nasekat", - "naslepo", - "nastat", - "natolik", - "navenek", - "navrch", - "navzdory", - "nazvat", - "nebe", - "nechat", - "necky", - "nedaleko", - "nedbat", - "neduh", - "negace", - "nehet", - "nehoda", - "nejen", - "nejprve", - "neklid", - "nelibost", - "nemilost", - "nemoc", - "neochota", - "neonka", - "nepokoj", - "nerost", - "nerv", - "nesmysl", - "nesoulad", - "netvor", - "neuron", - "nevina", - "nezvykle", - "nicota", - "nijak", - "nikam", - "nikdy", - "nikl", - "nikterak", - "nitro", - "nocleh", - "nohavice", - "nominace", - "nora", - "norek", - "nositel", - "nosnost", - "nouze", - "noviny", - "novota", - "nozdra", - "nuda", - "nudle", - "nuget", - "nutit", - "nutnost", - "nutrie", - "nymfa", - "obal", - "obarvit", - "obava", - "obdiv", - "obec", - "obehnat", - "obejmout", - "obezita", - "obhajoba", - "obilnice", - "objasnit", - "objekt", - "obklopit", - "oblast", - "oblek", - "obliba", - "obloha", - "obluda", - "obnos", - "obohatit", - "obojek", - "obout", - "obrazec", - "obrna", - "obruba", - "obrys", - "obsah", - "obsluha", - "obstarat", - "obuv", - "obvaz", - "obvinit", - "obvod", - "obvykle", - "obyvatel", - "obzor", - "ocas", - "ocel", - "ocenit", - "ochladit", - "ochota", - "ochrana", - "ocitnout", - "odboj", - "odbyt", - "odchod", - "odcizit", - "odebrat", - "odeslat", - "odevzdat", - "odezva", - "odhadce", - "odhodit", - "odjet", - "odjinud", - "odkaz", - "odkoupit", - "odliv", - "odluka", - "odmlka", - "odolnost", - "odpad", - "odpis", - "odplout", - "odpor", - "odpustit", - "odpykat", - "odrazka", - "odsoudit", - "odstup", - "odsun", - "odtok", - "odtud", - "odvaha", - "odveta", - "odvolat", - "odvracet", - "odznak", - "ofina", - "ofsajd", - "ohlas", - "ohnisko", - "ohrada", - "ohrozit", - "ohryzek", - "okap", - "okenice", - "oklika", - "okno", - "okouzlit", - "okovy", - "okrasa", - "okres", - "okrsek", - "okruh", - "okupant", - "okurka", - "okusit", - "olejnina", - "olizovat", - "omak", - "omeleta", - "omezit", - "omladina", - "omlouvat", - "omluva", - "omyl", - "onehdy", - "opakovat", - "opasek", - "operace", - "opice", - "opilost", - "opisovat", - "opora", - "opozice", - "opravdu", - "oproti", - "orbital", - "orchestr", - "orgie", - "orlice", - "orloj", - "ortel", - "osada", - "oschnout", - "osika", - "osivo", - "oslava", - "oslepit", - "oslnit", - "oslovit", - "osnova", - "osoba", - "osolit", - "ospalec", - "osten", - "ostraha", - "ostuda", - "ostych", - "osvojit", - "oteplit", - "otisk", - "otop", - "otrhat", - "otrlost", - "otrok", - "otruby", - "otvor", - "ovanout", - "ovar", - "oves", - "ovlivnit", - "ovoce", - "oxid", - "ozdoba", - "pachatel", - "pacient", - "padouch", - "pahorek", - "pakt", - "palanda", - "palec", - "palivo", - "paluba", - "pamflet", - "pamlsek", - "panenka", - "panika", - "panna", - "panovat", - "panstvo", - "pantofle", - "paprika", - "parketa", - "parodie", - "parta", - "paruka", - "paryba", - "paseka", - "pasivita", - "pastelka", - "patent", - "patrona", - "pavouk", - "pazneht", - "pazourek", - "pecka", - "pedagog", - "pejsek", - "peklo", - "peloton", - "penalta", - "pendrek", - "penze", - "periskop", - "pero", - "pestrost", - "petarda", - "petice", - "petrolej", - "pevnina", - "pexeso", - "pianista", - "piha", - "pijavice", - "pikle", - "piknik", - "pilina", - "pilnost", - "pilulka", - "pinzeta", - "pipeta", - "pisatel", - "pistole", - "pitevna", - "pivnice", - "pivovar", - "placenta", - "plakat", - "plamen", - "planeta", - "plastika", - "platit", - "plavidlo", - "plaz", - "plech", - "plemeno", - "plenta", - "ples", - "pletivo", - "plevel", - "plivat", - "plnit", - "plno", - "plocha", - "plodina", - "plomba", - "plout", - "pluk", - "plyn", - "pobavit", - "pobyt", - "pochod", - "pocit", - "poctivec", - "podat", - "podcenit", - "podepsat", - "podhled", - "podivit", - "podklad", - "podmanit", - "podnik", - "podoba", - "podpora", - "podraz", - "podstata", - "podvod", - "podzim", - "poezie", - "pohanka", - "pohnutka", - "pohovor", - "pohroma", - "pohyb", - "pointa", - "pojistka", - "pojmout", - "pokazit", - "pokles", - "pokoj", - "pokrok", - "pokuta", - "pokyn", - "poledne", - "polibek", - "polknout", - "poloha", - "polynom", - "pomalu", - "pominout", - "pomlka", - "pomoc", - "pomsta", - "pomyslet", - "ponechat", - "ponorka", - "ponurost", - "popadat", - "popel", - "popisek", - "poplach", - "poprosit", - "popsat", - "popud", - "poradce", - "porce", - "porod", - "porucha", - "poryv", - "posadit", - "posed", - "posila", - "poskok", - "poslanec", - "posoudit", - "pospolu", - "postava", - "posudek", - "posyp", - "potah", - "potkan", - "potlesk", - "potomek", - "potrava", - "potupa", - "potvora", - "poukaz", - "pouto", - "pouzdro", - "povaha", - "povidla", - "povlak", - "povoz", - "povrch", - "povstat", - "povyk", - "povzdech", - "pozdrav", - "pozemek", - "poznatek", - "pozor", - "pozvat", - "pracovat", - "prahory", - "praktika", - "prales", - "praotec", - "praporek", - "prase", - "pravda", - "princip", - "prkno", - "probudit", - "procento", - "prodej", - "profese", - "prohra", - "projekt", - "prolomit", - "promile", - "pronikat", - "propad", - "prorok", - "prosba", - "proton", - "proutek", - "provaz", - "prskavka", - "prsten", - "prudkost", - "prut", - "prvek", - "prvohory", - "psanec", - "psovod", - "pstruh", - "ptactvo", - "puberta", - "puch", - "pudl", - "pukavec", - "puklina", - "pukrle", - "pult", - "pumpa", - "punc", - "pupen", - "pusa", - "pusinka", - "pustina", - "putovat", - "putyka", - "pyramida", - "pysk", - "pytel", - "racek", - "rachot", - "radiace", - "radnice", - "radon", - "raft", - "ragby", - "raketa", - "rakovina", - "rameno", - "rampouch", - "rande", - "rarach", - "rarita", - "rasovna", - "rastr", - "ratolest", - "razance", - "razidlo", - "reagovat", - "reakce", - "recept", - "redaktor", - "referent", - "reflex", - "rejnok", - "reklama", - "rekord", - "rekrut", - "rektor", - "reputace", - "revize", - "revma", - "revolver", - "rezerva", - "riskovat", - "riziko", - "robotika", - "rodokmen", - "rohovka", - "rokle", - "rokoko", - "romaneto", - "ropovod", - "ropucha", - "rorejs", - "rosol", - "rostlina", - "rotmistr", - "rotoped", - "rotunda", - "roubenka", - "roucho", - "roup", - "roura", - "rovina", - "rovnice", - "rozbor", - "rozchod", - "rozdat", - "rozeznat", - "rozhodce", - "rozinka", - "rozjezd", - "rozkaz", - "rozloha", - "rozmar", - "rozpad", - "rozruch", - "rozsah", - "roztok", - "rozum", - "rozvod", - "rubrika", - "ruchadlo", - "rukavice", - "rukopis", - "ryba", - "rybolov", - "rychlost", - "rydlo", - "rypadlo", - "rytina", - "ryzost", - "sadista", - "sahat", - "sako", - "samec", - "samizdat", - "samota", - "sanitka", - "sardinka", - "sasanka", - "satelit", - "sazba", - "sazenice", - "sbor", - "schovat", - "sebranka", - "secese", - "sedadlo", - "sediment", - "sedlo", - "sehnat", - "sejmout", - "sekera", - "sekta", - "sekunda", - "sekvoje", - "semeno", - "seno", - "servis", - "sesadit", - "seshora", - "seskok", - "seslat", - "sestra", - "sesuv", - "sesypat", - "setba", - "setina", - "setkat", - "setnout", - "setrvat", - "sever", - "seznam", - "shoda", - "shrnout", - "sifon", - "silnice", - "sirka", - "sirotek", - "sirup", - "situace", - "skafandr", - "skalisko", - "skanzen", - "skaut", - "skeptik", - "skica", - "skladba", - "sklenice", - "sklo", - "skluz", - "skoba", - "skokan", - "skoro", - "skripta", - "skrz", - "skupina", - "skvost", - "skvrna", - "slabika", - "sladidlo", - "slanina", - "slast", - "slavnost", - "sledovat", - "slepec", - "sleva", - "slezina", - "slib", - "slina", - "sliznice", - "slon", - "sloupek", - "slovo", - "sluch", - "sluha", - "slunce", - "slupka", - "slza", - "smaragd", - "smetana", - "smilstvo", - "smlouva", - "smog", - "smrad", - "smrk", - "smrtka", - "smutek", - "smysl", - "snad", - "snaha", - "snob", - "sobota", - "socha", - "sodovka", - "sokol", - "sopka", - "sotva", - "souboj", - "soucit", - "soudce", - "souhlas", - "soulad", - "soumrak", - "souprava", - "soused", - "soutok", - "souviset", - "spalovna", - "spasitel", - "spis", - "splav", - "spodek", - "spojenec", - "spolu", - "sponzor", - "spornost", - "spousta", - "sprcha", - "spustit", - "sranda", - "sraz", - "srdce", - "srna", - "srnec", - "srovnat", - "srpen", - "srst", - "srub", - "stanice", - "starosta", - "statika", - "stavba", - "stehno", - "stezka", - "stodola", - "stolek", - "stopa", - "storno", - "stoupat", - "strach", - "stres", - "strhnout", - "strom", - "struna", - "studna", - "stupnice", - "stvol", - "styk", - "subjekt", - "subtropy", - "suchar", - "sudost", - "sukno", - "sundat", - "sunout", - "surikata", - "surovina", - "svah", - "svalstvo", - "svetr", - "svatba", - "svazek", - "svisle", - "svitek", - "svoboda", - "svodidlo", - "svorka", - "svrab", - "sykavka", - "sykot", - "synek", - "synovec", - "sypat", - "sypkost", - "syrovost", - "sysel", - "sytost", - "tabletka", - "tabule", - "tahoun", - "tajemno", - "tajfun", - "tajga", - "tajit", - "tajnost", - "taktika", - "tamhle", - "tampon", - "tancovat", - "tanec", - "tanker", - "tapeta", - "tavenina", - "tazatel", - "technika", - "tehdy", - "tekutina", - "telefon", - "temnota", - "tendence", - "tenista", - "tenor", - "teplota", - "tepna", - "teprve", - "terapie", - "termoska", - "textil", - "ticho", - "tiskopis", - "titulek", - "tkadlec", - "tkanina", - "tlapka", - "tleskat", - "tlukot", - "tlupa", - "tmel", - "toaleta", - "topinka", - "topol", - "torzo", - "touha", - "toulec", - "tradice", - "traktor", - "tramp", - "trasa", - "traverza", - "trefit", - "trest", - "trezor", - "trhavina", - "trhlina", - "trochu", - "trojice", - "troska", - "trouba", - "trpce", - "trpitel", - "trpkost", - "trubec", - "truchlit", - "truhlice", - "trus", - "trvat", - "tudy", - "tuhnout", - "tuhost", - "tundra", - "turista", - "turnaj", - "tuzemsko", - "tvaroh", - "tvorba", - "tvrdost", - "tvrz", - "tygr", - "tykev", - "ubohost", - "uboze", - "ubrat", - "ubrousek", - "ubrus", - "ubytovna", - "ucho", - "uctivost", - "udivit", - "uhradit", - "ujednat", - "ujistit", - "ujmout", - "ukazatel", - "uklidnit", - "uklonit", - "ukotvit", - "ukrojit", - "ulice", - "ulita", - "ulovit", - "umyvadlo", - "unavit", - "uniforma", - "uniknout", - "upadnout", - "uplatnit", - "uplynout", - "upoutat", - "upravit", - "uran", - "urazit", - "usednout", - "usilovat", - "usmrtit", - "usnadnit", - "usnout", - "usoudit", - "ustlat", - "ustrnout", - "utahovat", - "utkat", - "utlumit", - "utonout", - "utopenec", - "utrousit", - "uvalit", - "uvolnit", - "uvozovka", - "uzdravit", - "uzel", - "uzenina", - "uzlina", - "uznat", - "vagon", - "valcha", - "valoun", - "vana", - "vandal", - "vanilka", - "varan", - "varhany", - "varovat", - "vcelku", - "vchod", - "vdova", - "vedro", - "vegetace", - "vejce", - "velbloud", - "veletrh", - "velitel", - "velmoc", - "velryba", - "venkov", - "veranda", - "verze", - "veselka", - "veskrze", - "vesnice", - "vespodu", - "vesta", - "veterina", - "veverka", - "vibrace", - "vichr", - "videohra", - "vidina", - "vidle", - "vila", - "vinice", - "viset", - "vitalita", - "vize", - "vizitka", - "vjezd", - "vklad", - "vkus", - "vlajka", - "vlak", - "vlasec", - "vlevo", - "vlhkost", - "vliv", - "vlnovka", - "vloupat", - "vnucovat", - "vnuk", - "voda", - "vodivost", - "vodoznak", - "vodstvo", - "vojensky", - "vojna", - "vojsko", - "volant", - "volba", - "volit", - "volno", - "voskovka", - "vozidlo", - "vozovna", - "vpravo", - "vrabec", - "vracet", - "vrah", - "vrata", - "vrba", - "vrcholek", - "vrhat", - "vrstva", - "vrtule", - "vsadit", - "vstoupit", - "vstup", - "vtip", - "vybavit", - "vybrat", - "vychovat", - "vydat", - "vydra", - "vyfotit", - "vyhledat", - "vyhnout", - "vyhodit", - "vyhradit", - "vyhubit", - "vyjasnit", - "vyjet", - "vyjmout", - "vyklopit", - "vykonat", - "vylekat", - "vymazat", - "vymezit", - "vymizet", - "vymyslet", - "vynechat", - "vynikat", - "vynutit", - "vypadat", - "vyplatit", - "vypravit", - "vypustit", - "vyrazit", - "vyrovnat", - "vyrvat", - "vyslovit", - "vysoko", - "vystavit", - "vysunout", - "vysypat", - "vytasit", - "vytesat", - "vytratit", - "vyvinout", - "vyvolat", - "vyvrhel", - "vyzdobit", - "vyznat", - "vzadu", - "vzbudit", - "vzchopit", - "vzdor", - "vzduch", - "vzdychat", - "vzestup", - "vzhledem", - "vzkaz", - "vzlykat", - "vznik", - "vzorek", - "vzpoura", - "vztah", - "vztek", - "xylofon", - "zabrat", - "zabydlet", - "zachovat", - "zadarmo", - "zadusit", - "zafoukat", - "zahltit", - "zahodit", - "zahrada", - "zahynout", - "zajatec", - "zajet", - "zajistit", - "zaklepat", - "zakoupit", - "zalepit", - "zamezit", - "zamotat", - "zamyslet", - "zanechat", - "zanikat", - "zaplatit", - "zapojit", - "zapsat", - "zarazit", - "zastavit", - "zasunout", - "zatajit", - "zatemnit", - "zatknout", - "zaujmout", - "zavalit", - "zavelet", - "zavinit", - "zavolat", - "zavrtat", - "zazvonit", - "zbavit", - "zbrusu", - "zbudovat", - "zbytek", - "zdaleka", - "zdarma", - "zdatnost", - "zdivo", - "zdobit", - "zdroj", - "zdvih", - "zdymadlo", - "zelenina", - "zeman", - "zemina", - "zeptat", - "zezadu", - "zezdola", - "zhatit", - "zhltnout", - "zhluboka", - "zhotovit", - "zhruba", - "zima", - "zimnice", - "zjemnit", - "zklamat", - "zkoumat", - "zkratka", - "zkumavka", - "zlato", - "zlehka", - "zloba", - "zlom", - "zlost", - "zlozvyk", - "zmapovat", - "zmar", - "zmatek", - "zmije", - "zmizet", - "zmocnit", - "zmodrat", - "zmrzlina", - "zmutovat", - "znak", - "znalost", - "znamenat", - "znovu", - "zobrazit", - "zotavit", - "zoubek", - "zoufale", - "zplodit", - "zpomalit", - "zprava", - "zprostit", - "zprudka", - "zprvu", - "zrada", - "zranit", - "zrcadlo", - "zrnitost", - "zrno", - "zrovna", - "zrychlit", - "zrzavost", - "zticha", - "ztratit", - "zubovina", - "zubr", - "zvednout", - "zvenku", - "zvesela", - "zvon", - "zvrat", - "zvukovod", - "zvyk" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/chinese_simplified.json -var require_chinese_simplified = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/chinese_simplified.json"(exports2, module2) { - module2.exports = [ - "\u7684", - "\u4E00", - "\u662F", - "\u5728", - "\u4E0D", - "\u4E86", - "\u6709", - "\u548C", - "\u4EBA", - "\u8FD9", - "\u4E2D", - "\u5927", - "\u4E3A", - "\u4E0A", - "\u4E2A", - "\u56FD", - "\u6211", - "\u4EE5", - "\u8981", - "\u4ED6", - "\u65F6", - "\u6765", - "\u7528", - "\u4EEC", - "\u751F", - "\u5230", - "\u4F5C", - "\u5730", - "\u4E8E", - "\u51FA", - "\u5C31", - "\u5206", - "\u5BF9", - "\u6210", - "\u4F1A", - "\u53EF", - "\u4E3B", - "\u53D1", - "\u5E74", - "\u52A8", - "\u540C", - "\u5DE5", - "\u4E5F", - "\u80FD", - "\u4E0B", - "\u8FC7", - "\u5B50", - "\u8BF4", - "\u4EA7", - "\u79CD", - "\u9762", - "\u800C", - "\u65B9", - "\u540E", - "\u591A", - "\u5B9A", - "\u884C", - "\u5B66", - "\u6CD5", - "\u6240", - "\u6C11", - "\u5F97", - "\u7ECF", - "\u5341", - "\u4E09", - "\u4E4B", - "\u8FDB", - "\u7740", - "\u7B49", - "\u90E8", - "\u5EA6", - "\u5BB6", - "\u7535", - "\u529B", - "\u91CC", - "\u5982", - "\u6C34", - "\u5316", - "\u9AD8", - "\u81EA", - "\u4E8C", - "\u7406", - "\u8D77", - "\u5C0F", - "\u7269", - "\u73B0", - "\u5B9E", - "\u52A0", - "\u91CF", - "\u90FD", - "\u4E24", - "\u4F53", - "\u5236", - "\u673A", - "\u5F53", - "\u4F7F", - "\u70B9", - "\u4ECE", - "\u4E1A", - "\u672C", - "\u53BB", - "\u628A", - "\u6027", - "\u597D", - "\u5E94", - "\u5F00", - "\u5B83", - "\u5408", - "\u8FD8", - "\u56E0", - "\u7531", - "\u5176", - "\u4E9B", - "\u7136", - "\u524D", - "\u5916", - "\u5929", - "\u653F", - "\u56DB", - "\u65E5", - "\u90A3", - "\u793E", - "\u4E49", - "\u4E8B", - "\u5E73", - "\u5F62", - "\u76F8", - "\u5168", - "\u8868", - "\u95F4", - "\u6837", - "\u4E0E", - "\u5173", - "\u5404", - "\u91CD", - "\u65B0", - "\u7EBF", - "\u5185", - "\u6570", - "\u6B63", - "\u5FC3", - "\u53CD", - "\u4F60", - "\u660E", - "\u770B", - "\u539F", - "\u53C8", - "\u4E48", - "\u5229", - "\u6BD4", - "\u6216", - "\u4F46", - "\u8D28", - "\u6C14", - "\u7B2C", - "\u5411", - "\u9053", - "\u547D", - "\u6B64", - "\u53D8", - "\u6761", - "\u53EA", - "\u6CA1", - "\u7ED3", - "\u89E3", - "\u95EE", - "\u610F", - "\u5EFA", - "\u6708", - "\u516C", - "\u65E0", - "\u7CFB", - "\u519B", - "\u5F88", - "\u60C5", - "\u8005", - "\u6700", - "\u7ACB", - "\u4EE3", - "\u60F3", - "\u5DF2", - "\u901A", - "\u5E76", - "\u63D0", - "\u76F4", - "\u9898", - "\u515A", - "\u7A0B", - "\u5C55", - "\u4E94", - "\u679C", - "\u6599", - "\u8C61", - "\u5458", - "\u9769", - "\u4F4D", - "\u5165", - "\u5E38", - "\u6587", - "\u603B", - "\u6B21", - "\u54C1", - "\u5F0F", - "\u6D3B", - "\u8BBE", - "\u53CA", - "\u7BA1", - "\u7279", - "\u4EF6", - "\u957F", - "\u6C42", - "\u8001", - "\u5934", - "\u57FA", - "\u8D44", - "\u8FB9", - "\u6D41", - "\u8DEF", - "\u7EA7", - "\u5C11", - "\u56FE", - "\u5C71", - "\u7EDF", - "\u63A5", - "\u77E5", - "\u8F83", - "\u5C06", - "\u7EC4", - "\u89C1", - "\u8BA1", - "\u522B", - "\u5979", - "\u624B", - "\u89D2", - "\u671F", - "\u6839", - "\u8BBA", - "\u8FD0", - "\u519C", - "\u6307", - "\u51E0", - "\u4E5D", - "\u533A", - "\u5F3A", - "\u653E", - "\u51B3", - "\u897F", - "\u88AB", - "\u5E72", - "\u505A", - "\u5FC5", - "\u6218", - "\u5148", - "\u56DE", - "\u5219", - "\u4EFB", - "\u53D6", - "\u636E", - "\u5904", - "\u961F", - "\u5357", - "\u7ED9", - "\u8272", - "\u5149", - "\u95E8", - "\u5373", - "\u4FDD", - "\u6CBB", - "\u5317", - "\u9020", - "\u767E", - "\u89C4", - "\u70ED", - "\u9886", - "\u4E03", - "\u6D77", - "\u53E3", - "\u4E1C", - "\u5BFC", - "\u5668", - "\u538B", - "\u5FD7", - "\u4E16", - "\u91D1", - "\u589E", - "\u4E89", - "\u6D4E", - "\u9636", - "\u6CB9", - "\u601D", - "\u672F", - "\u6781", - "\u4EA4", - "\u53D7", - "\u8054", - "\u4EC0", - "\u8BA4", - "\u516D", - "\u5171", - "\u6743", - "\u6536", - "\u8BC1", - "\u6539", - "\u6E05", - "\u7F8E", - "\u518D", - "\u91C7", - "\u8F6C", - "\u66F4", - "\u5355", - "\u98CE", - "\u5207", - "\u6253", - "\u767D", - "\u6559", - "\u901F", - "\u82B1", - "\u5E26", - "\u5B89", - "\u573A", - "\u8EAB", - "\u8F66", - "\u4F8B", - "\u771F", - "\u52A1", - "\u5177", - "\u4E07", - "\u6BCF", - "\u76EE", - "\u81F3", - "\u8FBE", - "\u8D70", - "\u79EF", - "\u793A", - "\u8BAE", - "\u58F0", - "\u62A5", - "\u6597", - "\u5B8C", - "\u7C7B", - "\u516B", - "\u79BB", - "\u534E", - "\u540D", - "\u786E", - "\u624D", - "\u79D1", - "\u5F20", - "\u4FE1", - "\u9A6C", - "\u8282", - "\u8BDD", - "\u7C73", - "\u6574", - "\u7A7A", - "\u5143", - "\u51B5", - "\u4ECA", - "\u96C6", - "\u6E29", - "\u4F20", - "\u571F", - "\u8BB8", - "\u6B65", - "\u7FA4", - "\u5E7F", - "\u77F3", - "\u8BB0", - "\u9700", - "\u6BB5", - "\u7814", - "\u754C", - "\u62C9", - "\u6797", - "\u5F8B", - "\u53EB", - "\u4E14", - "\u7A76", - "\u89C2", - "\u8D8A", - "\u7EC7", - "\u88C5", - "\u5F71", - "\u7B97", - "\u4F4E", - "\u6301", - "\u97F3", - "\u4F17", - "\u4E66", - "\u5E03", - "\u590D", - "\u5BB9", - "\u513F", - "\u987B", - "\u9645", - "\u5546", - "\u975E", - "\u9A8C", - "\u8FDE", - "\u65AD", - "\u6DF1", - "\u96BE", - "\u8FD1", - "\u77FF", - "\u5343", - "\u5468", - "\u59D4", - "\u7D20", - "\u6280", - "\u5907", - "\u534A", - "\u529E", - "\u9752", - "\u7701", - "\u5217", - "\u4E60", - "\u54CD", - "\u7EA6", - "\u652F", - "\u822C", - "\u53F2", - "\u611F", - "\u52B3", - "\u4FBF", - "\u56E2", - "\u5F80", - "\u9178", - "\u5386", - "\u5E02", - "\u514B", - "\u4F55", - "\u9664", - "\u6D88", - "\u6784", - "\u5E9C", - "\u79F0", - "\u592A", - "\u51C6", - "\u7CBE", - "\u503C", - "\u53F7", - "\u7387", - "\u65CF", - "\u7EF4", - "\u5212", - "\u9009", - "\u6807", - "\u5199", - "\u5B58", - "\u5019", - "\u6BDB", - "\u4EB2", - "\u5FEB", - "\u6548", - "\u65AF", - "\u9662", - "\u67E5", - "\u6C5F", - "\u578B", - "\u773C", - "\u738B", - "\u6309", - "\u683C", - "\u517B", - "\u6613", - "\u7F6E", - "\u6D3E", - "\u5C42", - "\u7247", - "\u59CB", - "\u5374", - "\u4E13", - "\u72B6", - "\u80B2", - "\u5382", - "\u4EAC", - "\u8BC6", - "\u9002", - "\u5C5E", - "\u5706", - "\u5305", - "\u706B", - "\u4F4F", - "\u8C03", - "\u6EE1", - "\u53BF", - "\u5C40", - "\u7167", - "\u53C2", - "\u7EA2", - "\u7EC6", - "\u5F15", - "\u542C", - "\u8BE5", - "\u94C1", - "\u4EF7", - "\u4E25", - "\u9996", - "\u5E95", - "\u6DB2", - "\u5B98", - "\u5FB7", - "\u968F", - "\u75C5", - "\u82CF", - "\u5931", - "\u5C14", - "\u6B7B", - "\u8BB2", - "\u914D", - "\u5973", - "\u9EC4", - "\u63A8", - "\u663E", - "\u8C08", - "\u7F6A", - "\u795E", - "\u827A", - "\u5462", - "\u5E2D", - "\u542B", - "\u4F01", - "\u671B", - "\u5BC6", - "\u6279", - "\u8425", - "\u9879", - "\u9632", - "\u4E3E", - "\u7403", - "\u82F1", - "\u6C27", - "\u52BF", - "\u544A", - "\u674E", - "\u53F0", - "\u843D", - "\u6728", - "\u5E2E", - "\u8F6E", - "\u7834", - "\u4E9A", - "\u5E08", - "\u56F4", - "\u6CE8", - "\u8FDC", - "\u5B57", - "\u6750", - "\u6392", - "\u4F9B", - "\u6CB3", - "\u6001", - "\u5C01", - "\u53E6", - "\u65BD", - "\u51CF", - "\u6811", - "\u6EB6", - "\u600E", - "\u6B62", - "\u6848", - "\u8A00", - "\u58EB", - "\u5747", - "\u6B66", - "\u56FA", - "\u53F6", - "\u9C7C", - "\u6CE2", - "\u89C6", - "\u4EC5", - "\u8D39", - "\u7D27", - "\u7231", - "\u5DE6", - "\u7AE0", - "\u65E9", - "\u671D", - "\u5BB3", - "\u7EED", - "\u8F7B", - "\u670D", - "\u8BD5", - "\u98DF", - "\u5145", - "\u5175", - "\u6E90", - "\u5224", - "\u62A4", - "\u53F8", - "\u8DB3", - "\u67D0", - "\u7EC3", - "\u5DEE", - "\u81F4", - "\u677F", - "\u7530", - "\u964D", - "\u9ED1", - "\u72AF", - "\u8D1F", - "\u51FB", - "\u8303", - "\u7EE7", - "\u5174", - "\u4F3C", - "\u4F59", - "\u575A", - "\u66F2", - "\u8F93", - "\u4FEE", - "\u6545", - "\u57CE", - "\u592B", - "\u591F", - "\u9001", - "\u7B14", - "\u8239", - "\u5360", - "\u53F3", - "\u8D22", - "\u5403", - "\u5BCC", - "\u6625", - "\u804C", - "\u89C9", - "\u6C49", - "\u753B", - "\u529F", - "\u5DF4", - "\u8DDF", - "\u867D", - "\u6742", - "\u98DE", - "\u68C0", - "\u5438", - "\u52A9", - "\u5347", - "\u9633", - "\u4E92", - "\u521D", - "\u521B", - "\u6297", - "\u8003", - "\u6295", - "\u574F", - "\u7B56", - "\u53E4", - "\u5F84", - "\u6362", - "\u672A", - "\u8DD1", - "\u7559", - "\u94A2", - "\u66FE", - "\u7AEF", - "\u8D23", - "\u7AD9", - "\u7B80", - "\u8FF0", - "\u94B1", - "\u526F", - "\u5C3D", - "\u5E1D", - "\u5C04", - "\u8349", - "\u51B2", - "\u627F", - "\u72EC", - "\u4EE4", - "\u9650", - "\u963F", - "\u5BA3", - "\u73AF", - "\u53CC", - "\u8BF7", - "\u8D85", - "\u5FAE", - "\u8BA9", - "\u63A7", - "\u5DDE", - "\u826F", - "\u8F74", - "\u627E", - "\u5426", - "\u7EAA", - "\u76CA", - "\u4F9D", - "\u4F18", - "\u9876", - "\u7840", - "\u8F7D", - "\u5012", - "\u623F", - "\u7A81", - "\u5750", - "\u7C89", - "\u654C", - "\u7565", - "\u5BA2", - "\u8881", - "\u51B7", - "\u80DC", - "\u7EDD", - "\u6790", - "\u5757", - "\u5242", - "\u6D4B", - "\u4E1D", - "\u534F", - "\u8BC9", - "\u5FF5", - "\u9648", - "\u4ECD", - "\u7F57", - "\u76D0", - "\u53CB", - "\u6D0B", - "\u9519", - "\u82E6", - "\u591C", - "\u5211", - "\u79FB", - "\u9891", - "\u9010", - "\u9760", - "\u6DF7", - "\u6BCD", - "\u77ED", - "\u76AE", - "\u7EC8", - "\u805A", - "\u6C7D", - "\u6751", - "\u4E91", - "\u54EA", - "\u65E2", - "\u8DDD", - "\u536B", - "\u505C", - "\u70C8", - "\u592E", - "\u5BDF", - "\u70E7", - "\u8FC5", - "\u5883", - "\u82E5", - "\u5370", - "\u6D32", - "\u523B", - "\u62EC", - "\u6FC0", - "\u5B54", - "\u641E", - "\u751A", - "\u5BA4", - "\u5F85", - "\u6838", - "\u6821", - "\u6563", - "\u4FB5", - "\u5427", - "\u7532", - "\u6E38", - "\u4E45", - "\u83DC", - "\u5473", - "\u65E7", - "\u6A21", - "\u6E56", - "\u8D27", - "\u635F", - "\u9884", - "\u963B", - "\u6BEB", - "\u666E", - "\u7A33", - "\u4E59", - "\u5988", - "\u690D", - "\u606F", - "\u6269", - "\u94F6", - "\u8BED", - "\u6325", - "\u9152", - "\u5B88", - "\u62FF", - "\u5E8F", - "\u7EB8", - "\u533B", - "\u7F3A", - "\u96E8", - "\u5417", - "\u9488", - "\u5218", - "\u554A", - "\u6025", - "\u5531", - "\u8BEF", - "\u8BAD", - "\u613F", - "\u5BA1", - "\u9644", - "\u83B7", - "\u8336", - "\u9C9C", - "\u7CAE", - "\u65A4", - "\u5B69", - "\u8131", - "\u786B", - "\u80A5", - "\u5584", - "\u9F99", - "\u6F14", - "\u7236", - "\u6E10", - "\u8840", - "\u6B22", - "\u68B0", - "\u638C", - "\u6B4C", - "\u6C99", - "\u521A", - "\u653B", - "\u8C13", - "\u76FE", - "\u8BA8", - "\u665A", - "\u7C92", - "\u4E71", - "\u71C3", - "\u77DB", - "\u4E4E", - "\u6740", - "\u836F", - "\u5B81", - "\u9C81", - "\u8D35", - "\u949F", - "\u7164", - "\u8BFB", - "\u73ED", - "\u4F2F", - "\u9999", - "\u4ECB", - "\u8FEB", - "\u53E5", - "\u4E30", - "\u57F9", - "\u63E1", - "\u5170", - "\u62C5", - "\u5F26", - "\u86CB", - "\u6C89", - "\u5047", - "\u7A7F", - "\u6267", - "\u7B54", - "\u4E50", - "\u8C01", - "\u987A", - "\u70DF", - "\u7F29", - "\u5F81", - "\u8138", - "\u559C", - "\u677E", - "\u811A", - "\u56F0", - "\u5F02", - "\u514D", - "\u80CC", - "\u661F", - "\u798F", - "\u4E70", - "\u67D3", - "\u4E95", - "\u6982", - "\u6162", - "\u6015", - "\u78C1", - "\u500D", - "\u7956", - "\u7687", - "\u4FC3", - "\u9759", - "\u8865", - "\u8BC4", - "\u7FFB", - "\u8089", - "\u8DF5", - "\u5C3C", - "\u8863", - "\u5BBD", - "\u626C", - "\u68C9", - "\u5E0C", - "\u4F24", - "\u64CD", - "\u5782", - "\u79CB", - "\u5B9C", - "\u6C22", - "\u5957", - "\u7763", - "\u632F", - "\u67B6", - "\u4EAE", - "\u672B", - "\u5BAA", - "\u5E86", - "\u7F16", - "\u725B", - "\u89E6", - "\u6620", - "\u96F7", - "\u9500", - "\u8BD7", - "\u5EA7", - "\u5C45", - "\u6293", - "\u88C2", - "\u80DE", - "\u547C", - "\u5A18", - "\u666F", - "\u5A01", - "\u7EFF", - "\u6676", - "\u539A", - "\u76DF", - "\u8861", - "\u9E21", - "\u5B59", - "\u5EF6", - "\u5371", - "\u80F6", - "\u5C4B", - "\u4E61", - "\u4E34", - "\u9646", - "\u987E", - "\u6389", - "\u5440", - "\u706F", - "\u5C81", - "\u63AA", - "\u675F", - "\u8010", - "\u5267", - "\u7389", - "\u8D75", - "\u8DF3", - "\u54E5", - "\u5B63", - "\u8BFE", - "\u51EF", - "\u80E1", - "\u989D", - "\u6B3E", - "\u7ECD", - "\u5377", - "\u9F50", - "\u4F1F", - "\u84B8", - "\u6B96", - "\u6C38", - "\u5B97", - "\u82D7", - "\u5DDD", - "\u7089", - "\u5CA9", - "\u5F31", - "\u96F6", - "\u6768", - "\u594F", - "\u6CBF", - "\u9732", - "\u6746", - "\u63A2", - "\u6ED1", - "\u9547", - "\u996D", - "\u6D53", - "\u822A", - "\u6000", - "\u8D76", - "\u5E93", - "\u593A", - "\u4F0A", - "\u7075", - "\u7A0E", - "\u9014", - "\u706D", - "\u8D5B", - "\u5F52", - "\u53EC", - "\u9F13", - "\u64AD", - "\u76D8", - "\u88C1", - "\u9669", - "\u5EB7", - "\u552F", - "\u5F55", - "\u83CC", - "\u7EAF", - "\u501F", - "\u7CD6", - "\u76D6", - "\u6A2A", - "\u7B26", - "\u79C1", - "\u52AA", - "\u5802", - "\u57DF", - "\u67AA", - "\u6DA6", - "\u5E45", - "\u54C8", - "\u7ADF", - "\u719F", - "\u866B", - "\u6CFD", - "\u8111", - "\u58E4", - "\u78B3", - "\u6B27", - "\u904D", - "\u4FA7", - "\u5BE8", - "\u6562", - "\u5F7B", - "\u8651", - "\u659C", - "\u8584", - "\u5EAD", - "\u7EB3", - "\u5F39", - "\u9972", - "\u4F38", - "\u6298", - "\u9EA6", - "\u6E7F", - "\u6697", - "\u8377", - "\u74E6", - "\u585E", - "\u5E8A", - "\u7B51", - "\u6076", - "\u6237", - "\u8BBF", - "\u5854", - "\u5947", - "\u900F", - "\u6881", - "\u5200", - "\u65CB", - "\u8FF9", - "\u5361", - "\u6C2F", - "\u9047", - "\u4EFD", - "\u6BD2", - "\u6CE5", - "\u9000", - "\u6D17", - "\u6446", - "\u7070", - "\u5F69", - "\u5356", - "\u8017", - "\u590F", - "\u62E9", - "\u5FD9", - "\u94DC", - "\u732E", - "\u786C", - "\u4E88", - "\u7E41", - "\u5708", - "\u96EA", - "\u51FD", - "\u4EA6", - "\u62BD", - "\u7BC7", - "\u9635", - "\u9634", - "\u4E01", - "\u5C3A", - "\u8FFD", - "\u5806", - "\u96C4", - "\u8FCE", - "\u6CDB", - "\u7238", - "\u697C", - "\u907F", - "\u8C0B", - "\u5428", - "\u91CE", - "\u732A", - "\u65D7", - "\u7D2F", - "\u504F", - "\u5178", - "\u9986", - "\u7D22", - "\u79E6", - "\u8102", - "\u6F6E", - "\u7237", - "\u8C46", - "\u5FFD", - "\u6258", - "\u60CA", - "\u5851", - "\u9057", - "\u6108", - "\u6731", - "\u66FF", - "\u7EA4", - "\u7C97", - "\u503E", - "\u5C1A", - "\u75DB", - "\u695A", - "\u8C22", - "\u594B", - "\u8D2D", - "\u78E8", - "\u541B", - "\u6C60", - "\u65C1", - "\u788E", - "\u9AA8", - "\u76D1", - "\u6355", - "\u5F1F", - "\u66B4", - "\u5272", - "\u8D2F", - "\u6B8A", - "\u91CA", - "\u8BCD", - "\u4EA1", - "\u58C1", - "\u987F", - "\u5B9D", - "\u5348", - "\u5C18", - "\u95FB", - "\u63ED", - "\u70AE", - "\u6B8B", - "\u51AC", - "\u6865", - "\u5987", - "\u8B66", - "\u7EFC", - "\u62DB", - "\u5434", - "\u4ED8", - "\u6D6E", - "\u906D", - "\u5F90", - "\u60A8", - "\u6447", - "\u8C37", - "\u8D5E", - "\u7BB1", - "\u9694", - "\u8BA2", - "\u7537", - "\u5439", - "\u56ED", - "\u7EB7", - "\u5510", - "\u8D25", - "\u5B8B", - "\u73BB", - "\u5DE8", - "\u8015", - "\u5766", - "\u8363", - "\u95ED", - "\u6E7E", - "\u952E", - "\u51E1", - "\u9A7B", - "\u9505", - "\u6551", - "\u6069", - "\u5265", - "\u51DD", - "\u78B1", - "\u9F7F", - "\u622A", - "\u70BC", - "\u9EBB", - "\u7EBA", - "\u7981", - "\u5E9F", - "\u76DB", - "\u7248", - "\u7F13", - "\u51C0", - "\u775B", - "\u660C", - "\u5A5A", - "\u6D89", - "\u7B52", - "\u5634", - "\u63D2", - "\u5CB8", - "\u6717", - "\u5E84", - "\u8857", - "\u85CF", - "\u59D1", - "\u8D38", - "\u8150", - "\u5974", - "\u5566", - "\u60EF", - "\u4E58", - "\u4F19", - "\u6062", - "\u5300", - "\u7EB1", - "\u624E", - "\u8FA9", - "\u8033", - "\u5F6A", - "\u81E3", - "\u4EBF", - "\u7483", - "\u62B5", - "\u8109", - "\u79C0", - "\u8428", - "\u4FC4", - "\u7F51", - "\u821E", - "\u5E97", - "\u55B7", - "\u7EB5", - "\u5BF8", - "\u6C57", - "\u6302", - "\u6D2A", - "\u8D3A", - "\u95EA", - "\u67EC", - "\u7206", - "\u70EF", - "\u6D25", - "\u7A3B", - "\u5899", - "\u8F6F", - "\u52C7", - "\u50CF", - "\u6EDA", - "\u5398", - "\u8499", - "\u82B3", - "\u80AF", - "\u5761", - "\u67F1", - "\u8361", - "\u817F", - "\u4EEA", - "\u65C5", - "\u5C3E", - "\u8F67", - "\u51B0", - "\u8D21", - "\u767B", - "\u9ECE", - "\u524A", - "\u94BB", - "\u52D2", - "\u9003", - "\u969C", - "\u6C28", - "\u90ED", - "\u5CF0", - "\u5E01", - "\u6E2F", - "\u4F0F", - "\u8F68", - "\u4EA9", - "\u6BD5", - "\u64E6", - "\u83AB", - "\u523A", - "\u6D6A", - "\u79D8", - "\u63F4", - "\u682A", - "\u5065", - "\u552E", - "\u80A1", - "\u5C9B", - "\u7518", - "\u6CE1", - "\u7761", - "\u7AE5", - "\u94F8", - "\u6C64", - "\u9600", - "\u4F11", - "\u6C47", - "\u820D", - "\u7267", - "\u7ED5", - "\u70B8", - "\u54F2", - "\u78F7", - "\u7EE9", - "\u670B", - "\u6DE1", - "\u5C16", - "\u542F", - "\u9677", - "\u67F4", - "\u5448", - "\u5F92", - "\u989C", - "\u6CEA", - "\u7A0D", - "\u5FD8", - "\u6CF5", - "\u84DD", - "\u62D6", - "\u6D1E", - "\u6388", - "\u955C", - "\u8F9B", - "\u58EE", - "\u950B", - "\u8D2B", - "\u865A", - "\u5F2F", - "\u6469", - "\u6CF0", - "\u5E7C", - "\u5EF7", - "\u5C0A", - "\u7A97", - "\u7EB2", - "\u5F04", - "\u96B6", - "\u7591", - "\u6C0F", - "\u5BAB", - "\u59D0", - "\u9707", - "\u745E", - "\u602A", - "\u5C24", - "\u7434", - "\u5FAA", - "\u63CF", - "\u819C", - "\u8FDD", - "\u5939", - "\u8170", - "\u7F18", - "\u73E0", - "\u7A77", - "\u68EE", - "\u679D", - "\u7AF9", - "\u6C9F", - "\u50AC", - "\u7EF3", - "\u5FC6", - "\u90A6", - "\u5269", - "\u5E78", - "\u6D46", - "\u680F", - "\u62E5", - "\u7259", - "\u8D2E", - "\u793C", - "\u6EE4", - "\u94A0", - "\u7EB9", - "\u7F62", - "\u62CD", - "\u54B1", - "\u558A", - "\u8896", - "\u57C3", - "\u52E4", - "\u7F5A", - "\u7126", - "\u6F5C", - "\u4F0D", - "\u58A8", - "\u6B32", - "\u7F1D", - "\u59D3", - "\u520A", - "\u9971", - "\u4EFF", - "\u5956", - "\u94DD", - "\u9B3C", - "\u4E3D", - "\u8DE8", - "\u9ED8", - "\u6316", - "\u94FE", - "\u626B", - "\u559D", - "\u888B", - "\u70AD", - "\u6C61", - "\u5E55", - "\u8BF8", - "\u5F27", - "\u52B1", - "\u6885", - "\u5976", - "\u6D01", - "\u707E", - "\u821F", - "\u9274", - "\u82EF", - "\u8BBC", - "\u62B1", - "\u6BC1", - "\u61C2", - "\u5BD2", - "\u667A", - "\u57D4", - "\u5BC4", - "\u5C4A", - "\u8DC3", - "\u6E21", - "\u6311", - "\u4E39", - "\u8270", - "\u8D1D", - "\u78B0", - "\u62D4", - "\u7239", - "\u6234", - "\u7801", - "\u68A6", - "\u82BD", - "\u7194", - "\u8D64", - "\u6E14", - "\u54ED", - "\u656C", - "\u9897", - "\u5954", - "\u94C5", - "\u4EF2", - "\u864E", - "\u7A00", - "\u59B9", - "\u4E4F", - "\u73CD", - "\u7533", - "\u684C", - "\u9075", - "\u5141", - "\u9686", - "\u87BA", - "\u4ED3", - "\u9B4F", - "\u9510", - "\u6653", - "\u6C2E", - "\u517C", - "\u9690", - "\u788D", - "\u8D6B", - "\u62E8", - "\u5FE0", - "\u8083", - "\u7F38", - "\u7275", - "\u62A2", - "\u535A", - "\u5DE7", - "\u58F3", - "\u5144", - "\u675C", - "\u8BAF", - "\u8BDA", - "\u78A7", - "\u7965", - "\u67EF", - "\u9875", - "\u5DE1", - "\u77E9", - "\u60B2", - "\u704C", - "\u9F84", - "\u4F26", - "\u7968", - "\u5BFB", - "\u6842", - "\u94FA", - "\u5723", - "\u6050", - "\u6070", - "\u90D1", - "\u8DA3", - "\u62AC", - "\u8352", - "\u817E", - "\u8D34", - "\u67D4", - "\u6EF4", - "\u731B", - "\u9614", - "\u8F86", - "\u59BB", - "\u586B", - "\u64A4", - "\u50A8", - "\u7B7E", - "\u95F9", - "\u6270", - "\u7D2B", - "\u7802", - "\u9012", - "\u620F", - "\u540A", - "\u9676", - "\u4F10", - "\u5582", - "\u7597", - "\u74F6", - "\u5A46", - "\u629A", - "\u81C2", - "\u6478", - "\u5FCD", - "\u867E", - "\u8721", - "\u90BB", - "\u80F8", - "\u5DE9", - "\u6324", - "\u5076", - "\u5F03", - "\u69FD", - "\u52B2", - "\u4E73", - "\u9093", - "\u5409", - "\u4EC1", - "\u70C2", - "\u7816", - "\u79DF", - "\u4E4C", - "\u8230", - "\u4F34", - "\u74DC", - "\u6D45", - "\u4E19", - "\u6682", - "\u71E5", - "\u6A61", - "\u67F3", - "\u8FF7", - "\u6696", - "\u724C", - "\u79E7", - "\u80C6", - "\u8BE6", - "\u7C27", - "\u8E0F", - "\u74F7", - "\u8C31", - "\u5446", - "\u5BBE", - "\u7CCA", - "\u6D1B", - "\u8F89", - "\u6124", - "\u7ADE", - "\u9699", - "\u6012", - "\u7C98", - "\u4E43", - "\u7EEA", - "\u80A9", - "\u7C4D", - "\u654F", - "\u6D82", - "\u7199", - "\u7686", - "\u4FA6", - "\u60AC", - "\u6398", - "\u4EAB", - "\u7EA0", - "\u9192", - "\u72C2", - "\u9501", - "\u6DC0", - "\u6068", - "\u7272", - "\u9738", - "\u722C", - "\u8D4F", - "\u9006", - "\u73A9", - "\u9675", - "\u795D", - "\u79D2", - "\u6D59", - "\u8C8C", - "\u5F79", - "\u5F7C", - "\u6089", - "\u9E2D", - "\u8D8B", - "\u51E4", - "\u6668", - "\u755C", - "\u8F88", - "\u79E9", - "\u5375", - "\u7F72", - "\u68AF", - "\u708E", - "\u6EE9", - "\u68CB", - "\u9A71", - "\u7B5B", - "\u5CE1", - "\u5192", - "\u5565", - "\u5BFF", - "\u8BD1", - "\u6D78", - "\u6CC9", - "\u5E3D", - "\u8FDF", - "\u7845", - "\u7586", - "\u8D37", - "\u6F0F", - "\u7A3F", - "\u51A0", - "\u5AE9", - "\u80C1", - "\u82AF", - "\u7262", - "\u53DB", - "\u8680", - "\u5965", - "\u9E23", - "\u5CAD", - "\u7F8A", - "\u51ED", - "\u4E32", - "\u5858", - "\u7ED8", - "\u9175", - "\u878D", - "\u76C6", - "\u9521", - "\u5E99", - "\u7B79", - "\u51BB", - "\u8F85", - "\u6444", - "\u88AD", - "\u7B4B", - "\u62D2", - "\u50DA", - "\u65F1", - "\u94BE", - "\u9E1F", - "\u6F06", - "\u6C88", - "\u7709", - "\u758F", - "\u6DFB", - "\u68D2", - "\u7A57", - "\u785D", - "\u97E9", - "\u903C", - "\u626D", - "\u4FA8", - "\u51C9", - "\u633A", - "\u7897", - "\u683D", - "\u7092", - "\u676F", - "\u60A3", - "\u998F", - "\u529D", - "\u8C6A", - "\u8FBD", - "\u52C3", - "\u9E3F", - "\u65E6", - "\u540F", - "\u62DC", - "\u72D7", - "\u57CB", - "\u8F8A", - "\u63A9", - "\u996E", - "\u642C", - "\u9A82", - "\u8F9E", - "\u52FE", - "\u6263", - "\u4F30", - "\u848B", - "\u7ED2", - "\u96FE", - "\u4E08", - "\u6735", - "\u59C6", - "\u62DF", - "\u5B87", - "\u8F91", - "\u9655", - "\u96D5", - "\u507F", - "\u84C4", - "\u5D07", - "\u526A", - "\u5021", - "\u5385", - "\u54AC", - "\u9A76", - "\u85AF", - "\u5237", - "\u65A5", - "\u756A", - "\u8D4B", - "\u5949", - "\u4F5B", - "\u6D47", - "\u6F2B", - "\u66FC", - "\u6247", - "\u9499", - "\u6843", - "\u6276", - "\u4ED4", - "\u8FD4", - "\u4FD7", - "\u4E8F", - "\u8154", - "\u978B", - "\u68F1", - "\u8986", - "\u6846", - "\u6084", - "\u53D4", - "\u649E", - "\u9A97", - "\u52D8", - "\u65FA", - "\u6CB8", - "\u5B64", - "\u5410", - "\u5B5F", - "\u6E20", - "\u5C48", - "\u75BE", - "\u5999", - "\u60DC", - "\u4EF0", - "\u72E0", - "\u80C0", - "\u8C10", - "\u629B", - "\u9709", - "\u6851", - "\u5C97", - "\u561B", - "\u8870", - "\u76D7", - "\u6E17", - "\u810F", - "\u8D56", - "\u6D8C", - "\u751C", - "\u66F9", - "\u9605", - "\u808C", - "\u54E9", - "\u5389", - "\u70C3", - "\u7EAC", - "\u6BC5", - "\u6628", - "\u4F2A", - "\u75C7", - "\u716E", - "\u53F9", - "\u9489", - "\u642D", - "\u830E", - "\u7B3C", - "\u9177", - "\u5077", - "\u5F13", - "\u9525", - "\u6052", - "\u6770", - "\u5751", - "\u9F3B", - "\u7FFC", - "\u7EB6", - "\u53D9", - "\u72F1", - "\u902E", - "\u7F50", - "\u7EDC", - "\u68DA", - "\u6291", - "\u81A8", - "\u852C", - "\u5BFA", - "\u9AA4", - "\u7A46", - "\u51B6", - "\u67AF", - "\u518C", - "\u5C38", - "\u51F8", - "\u7EC5", - "\u576F", - "\u727A", - "\u7130", - "\u8F70", - "\u6B23", - "\u664B", - "\u7626", - "\u5FA1", - "\u952D", - "\u9526", - "\u4E27", - "\u65EC", - "\u953B", - "\u5784", - "\u641C", - "\u6251", - "\u9080", - "\u4EAD", - "\u916F", - "\u8FC8", - "\u8212", - "\u8106", - "\u9176", - "\u95F2", - "\u5FE7", - "\u915A", - "\u987D", - "\u7FBD", - "\u6DA8", - "\u5378", - "\u4ED7", - "\u966A", - "\u8F9F", - "\u60E9", - "\u676D", - "\u59DA", - "\u809A", - "\u6349", - "\u98D8", - "\u6F02", - "\u6606", - "\u6B3A", - "\u543E", - "\u90CE", - "\u70F7", - "\u6C41", - "\u5475", - "\u9970", - "\u8427", - "\u96C5", - "\u90AE", - "\u8FC1", - "\u71D5", - "\u6492", - "\u59FB", - "\u8D74", - "\u5BB4", - "\u70E6", - "\u503A", - "\u5E10", - "\u6591", - "\u94C3", - "\u65E8", - "\u9187", - "\u8463", - "\u997C", - "\u96CF", - "\u59FF", - "\u62CC", - "\u5085", - "\u8179", - "\u59A5", - "\u63C9", - "\u8D24", - "\u62C6", - "\u6B6A", - "\u8461", - "\u80FA", - "\u4E22", - "\u6D69", - "\u5FBD", - "\u6602", - "\u57AB", - "\u6321", - "\u89C8", - "\u8D2A", - "\u6170", - "\u7F34", - "\u6C6A", - "\u614C", - "\u51AF", - "\u8BFA", - "\u59DC", - "\u8C0A", - "\u51F6", - "\u52A3", - "\u8BEC", - "\u8000", - "\u660F", - "\u8EBA", - "\u76C8", - "\u9A91", - "\u4E54", - "\u6EAA", - "\u4E1B", - "\u5362", - "\u62B9", - "\u95F7", - "\u54A8", - "\u522E", - "\u9A7E", - "\u7F06", - "\u609F", - "\u6458", - "\u94D2", - "\u63B7", - "\u9887", - "\u5E7B", - "\u67C4", - "\u60E0", - "\u60E8", - "\u4F73", - "\u4EC7", - "\u814A", - "\u7A9D", - "\u6DA4", - "\u5251", - "\u77A7", - "\u5821", - "\u6CFC", - "\u8471", - "\u7F69", - "\u970D", - "\u635E", - "\u80CE", - "\u82CD", - "\u6EE8", - "\u4FE9", - "\u6345", - "\u6E58", - "\u780D", - "\u971E", - "\u90B5", - "\u8404", - "\u75AF", - "\u6DEE", - "\u9042", - "\u718A", - "\u7CAA", - "\u70D8", - "\u5BBF", - "\u6863", - "\u6208", - "\u9A73", - "\u5AC2", - "\u88D5", - "\u5F99", - "\u7BAD", - "\u6350", - "\u80A0", - "\u6491", - "\u6652", - "\u8FA8", - "\u6BBF", - "\u83B2", - "\u644A", - "\u6405", - "\u9171", - "\u5C4F", - "\u75AB", - "\u54C0", - "\u8521", - "\u5835", - "\u6CAB", - "\u76B1", - "\u7545", - "\u53E0", - "\u9601", - "\u83B1", - "\u6572", - "\u8F96", - "\u94A9", - "\u75D5", - "\u575D", - "\u5DF7", - "\u997F", - "\u7978", - "\u4E18", - "\u7384", - "\u6E9C", - "\u66F0", - "\u903B", - "\u5F6D", - "\u5C1D", - "\u537F", - "\u59A8", - "\u8247", - "\u541E", - "\u97E6", - "\u6028", - "\u77EE", - "\u6B47" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/chinese_traditional.json -var require_chinese_traditional = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/chinese_traditional.json"(exports2, module2) { - module2.exports = [ - "\u7684", - "\u4E00", - "\u662F", - "\u5728", - "\u4E0D", - "\u4E86", - "\u6709", - "\u548C", - "\u4EBA", - "\u9019", - "\u4E2D", - "\u5927", - "\u70BA", - "\u4E0A", - "\u500B", - "\u570B", - "\u6211", - "\u4EE5", - "\u8981", - "\u4ED6", - "\u6642", - "\u4F86", - "\u7528", - "\u5011", - "\u751F", - "\u5230", - "\u4F5C", - "\u5730", - "\u65BC", - "\u51FA", - "\u5C31", - "\u5206", - "\u5C0D", - "\u6210", - "\u6703", - "\u53EF", - "\u4E3B", - "\u767C", - "\u5E74", - "\u52D5", - "\u540C", - "\u5DE5", - "\u4E5F", - "\u80FD", - "\u4E0B", - "\u904E", - "\u5B50", - "\u8AAA", - "\u7522", - "\u7A2E", - "\u9762", - "\u800C", - "\u65B9", - "\u5F8C", - "\u591A", - "\u5B9A", - "\u884C", - "\u5B78", - "\u6CD5", - "\u6240", - "\u6C11", - "\u5F97", - "\u7D93", - "\u5341", - "\u4E09", - "\u4E4B", - "\u9032", - "\u8457", - "\u7B49", - "\u90E8", - "\u5EA6", - "\u5BB6", - "\u96FB", - "\u529B", - "\u88E1", - "\u5982", - "\u6C34", - "\u5316", - "\u9AD8", - "\u81EA", - "\u4E8C", - "\u7406", - "\u8D77", - "\u5C0F", - "\u7269", - "\u73FE", - "\u5BE6", - "\u52A0", - "\u91CF", - "\u90FD", - "\u5169", - "\u9AD4", - "\u5236", - "\u6A5F", - "\u7576", - "\u4F7F", - "\u9EDE", - "\u5F9E", - "\u696D", - "\u672C", - "\u53BB", - "\u628A", - "\u6027", - "\u597D", - "\u61C9", - "\u958B", - "\u5B83", - "\u5408", - "\u9084", - "\u56E0", - "\u7531", - "\u5176", - "\u4E9B", - "\u7136", - "\u524D", - "\u5916", - "\u5929", - "\u653F", - "\u56DB", - "\u65E5", - "\u90A3", - "\u793E", - "\u7FA9", - "\u4E8B", - "\u5E73", - "\u5F62", - "\u76F8", - "\u5168", - "\u8868", - "\u9593", - "\u6A23", - "\u8207", - "\u95DC", - "\u5404", - "\u91CD", - "\u65B0", - "\u7DDA", - "\u5167", - "\u6578", - "\u6B63", - "\u5FC3", - "\u53CD", - "\u4F60", - "\u660E", - "\u770B", - "\u539F", - "\u53C8", - "\u9EBC", - "\u5229", - "\u6BD4", - "\u6216", - "\u4F46", - "\u8CEA", - "\u6C23", - "\u7B2C", - "\u5411", - "\u9053", - "\u547D", - "\u6B64", - "\u8B8A", - "\u689D", - "\u53EA", - "\u6C92", - "\u7D50", - "\u89E3", - "\u554F", - "\u610F", - "\u5EFA", - "\u6708", - "\u516C", - "\u7121", - "\u7CFB", - "\u8ECD", - "\u5F88", - "\u60C5", - "\u8005", - "\u6700", - "\u7ACB", - "\u4EE3", - "\u60F3", - "\u5DF2", - "\u901A", - "\u4E26", - "\u63D0", - "\u76F4", - "\u984C", - "\u9EE8", - "\u7A0B", - "\u5C55", - "\u4E94", - "\u679C", - "\u6599", - "\u8C61", - "\u54E1", - "\u9769", - "\u4F4D", - "\u5165", - "\u5E38", - "\u6587", - "\u7E3D", - "\u6B21", - "\u54C1", - "\u5F0F", - "\u6D3B", - "\u8A2D", - "\u53CA", - "\u7BA1", - "\u7279", - "\u4EF6", - "\u9577", - "\u6C42", - "\u8001", - "\u982D", - "\u57FA", - "\u8CC7", - "\u908A", - "\u6D41", - "\u8DEF", - "\u7D1A", - "\u5C11", - "\u5716", - "\u5C71", - "\u7D71", - "\u63A5", - "\u77E5", - "\u8F03", - "\u5C07", - "\u7D44", - "\u898B", - "\u8A08", - "\u5225", - "\u5979", - "\u624B", - "\u89D2", - "\u671F", - "\u6839", - "\u8AD6", - "\u904B", - "\u8FB2", - "\u6307", - "\u5E7E", - "\u4E5D", - "\u5340", - "\u5F37", - "\u653E", - "\u6C7A", - "\u897F", - "\u88AB", - "\u5E79", - "\u505A", - "\u5FC5", - "\u6230", - "\u5148", - "\u56DE", - "\u5247", - "\u4EFB", - "\u53D6", - "\u64DA", - "\u8655", - "\u968A", - "\u5357", - "\u7D66", - "\u8272", - "\u5149", - "\u9580", - "\u5373", - "\u4FDD", - "\u6CBB", - "\u5317", - "\u9020", - "\u767E", - "\u898F", - "\u71B1", - "\u9818", - "\u4E03", - "\u6D77", - "\u53E3", - "\u6771", - "\u5C0E", - "\u5668", - "\u58D3", - "\u5FD7", - "\u4E16", - "\u91D1", - "\u589E", - "\u722D", - "\u6FDF", - "\u968E", - "\u6CB9", - "\u601D", - "\u8853", - "\u6975", - "\u4EA4", - "\u53D7", - "\u806F", - "\u4EC0", - "\u8A8D", - "\u516D", - "\u5171", - "\u6B0A", - "\u6536", - "\u8B49", - "\u6539", - "\u6E05", - "\u7F8E", - "\u518D", - "\u63A1", - "\u8F49", - "\u66F4", - "\u55AE", - "\u98A8", - "\u5207", - "\u6253", - "\u767D", - "\u6559", - "\u901F", - "\u82B1", - "\u5E36", - "\u5B89", - "\u5834", - "\u8EAB", - "\u8ECA", - "\u4F8B", - "\u771F", - "\u52D9", - "\u5177", - "\u842C", - "\u6BCF", - "\u76EE", - "\u81F3", - "\u9054", - "\u8D70", - "\u7A4D", - "\u793A", - "\u8B70", - "\u8072", - "\u5831", - "\u9B25", - "\u5B8C", - "\u985E", - "\u516B", - "\u96E2", - "\u83EF", - "\u540D", - "\u78BA", - "\u624D", - "\u79D1", - "\u5F35", - "\u4FE1", - "\u99AC", - "\u7BC0", - "\u8A71", - "\u7C73", - "\u6574", - "\u7A7A", - "\u5143", - "\u6CC1", - "\u4ECA", - "\u96C6", - "\u6EAB", - "\u50B3", - "\u571F", - "\u8A31", - "\u6B65", - "\u7FA4", - "\u5EE3", - "\u77F3", - "\u8A18", - "\u9700", - "\u6BB5", - "\u7814", - "\u754C", - "\u62C9", - "\u6797", - "\u5F8B", - "\u53EB", - "\u4E14", - "\u7A76", - "\u89C0", - "\u8D8A", - "\u7E54", - "\u88DD", - "\u5F71", - "\u7B97", - "\u4F4E", - "\u6301", - "\u97F3", - "\u773E", - "\u66F8", - "\u5E03", - "\u590D", - "\u5BB9", - "\u5152", - "\u9808", - "\u969B", - "\u5546", - "\u975E", - "\u9A57", - "\u9023", - "\u65B7", - "\u6DF1", - "\u96E3", - "\u8FD1", - "\u7926", - "\u5343", - "\u9031", - "\u59D4", - "\u7D20", - "\u6280", - "\u5099", - "\u534A", - "\u8FA6", - "\u9752", - "\u7701", - "\u5217", - "\u7FD2", - "\u97FF", - "\u7D04", - "\u652F", - "\u822C", - "\u53F2", - "\u611F", - "\u52DE", - "\u4FBF", - "\u5718", - "\u5F80", - "\u9178", - "\u6B77", - "\u5E02", - "\u514B", - "\u4F55", - "\u9664", - "\u6D88", - "\u69CB", - "\u5E9C", - "\u7A31", - "\u592A", - "\u6E96", - "\u7CBE", - "\u503C", - "\u865F", - "\u7387", - "\u65CF", - "\u7DAD", - "\u5283", - "\u9078", - "\u6A19", - "\u5BEB", - "\u5B58", - "\u5019", - "\u6BDB", - "\u89AA", - "\u5FEB", - "\u6548", - "\u65AF", - "\u9662", - "\u67E5", - "\u6C5F", - "\u578B", - "\u773C", - "\u738B", - "\u6309", - "\u683C", - "\u990A", - "\u6613", - "\u7F6E", - "\u6D3E", - "\u5C64", - "\u7247", - "\u59CB", - "\u537B", - "\u5C08", - "\u72C0", - "\u80B2", - "\u5EE0", - "\u4EAC", - "\u8B58", - "\u9069", - "\u5C6C", - "\u5713", - "\u5305", - "\u706B", - "\u4F4F", - "\u8ABF", - "\u6EFF", - "\u7E23", - "\u5C40", - "\u7167", - "\u53C3", - "\u7D05", - "\u7D30", - "\u5F15", - "\u807D", - "\u8A72", - "\u9435", - "\u50F9", - "\u56B4", - "\u9996", - "\u5E95", - "\u6DB2", - "\u5B98", - "\u5FB7", - "\u96A8", - "\u75C5", - "\u8607", - "\u5931", - "\u723E", - "\u6B7B", - "\u8B1B", - "\u914D", - "\u5973", - "\u9EC3", - "\u63A8", - "\u986F", - "\u8AC7", - "\u7F6A", - "\u795E", - "\u85DD", - "\u5462", - "\u5E2D", - "\u542B", - "\u4F01", - "\u671B", - "\u5BC6", - "\u6279", - "\u71DF", - "\u9805", - "\u9632", - "\u8209", - "\u7403", - "\u82F1", - "\u6C27", - "\u52E2", - "\u544A", - "\u674E", - "\u53F0", - "\u843D", - "\u6728", - "\u5E6B", - "\u8F2A", - "\u7834", - "\u4E9E", - "\u5E2B", - "\u570D", - "\u6CE8", - "\u9060", - "\u5B57", - "\u6750", - "\u6392", - "\u4F9B", - "\u6CB3", - "\u614B", - "\u5C01", - "\u53E6", - "\u65BD", - "\u6E1B", - "\u6A39", - "\u6EB6", - "\u600E", - "\u6B62", - "\u6848", - "\u8A00", - "\u58EB", - "\u5747", - "\u6B66", - "\u56FA", - "\u8449", - "\u9B5A", - "\u6CE2", - "\u8996", - "\u50C5", - "\u8CBB", - "\u7DCA", - "\u611B", - "\u5DE6", - "\u7AE0", - "\u65E9", - "\u671D", - "\u5BB3", - "\u7E8C", - "\u8F15", - "\u670D", - "\u8A66", - "\u98DF", - "\u5145", - "\u5175", - "\u6E90", - "\u5224", - "\u8B77", - "\u53F8", - "\u8DB3", - "\u67D0", - "\u7DF4", - "\u5DEE", - "\u81F4", - "\u677F", - "\u7530", - "\u964D", - "\u9ED1", - "\u72AF", - "\u8CA0", - "\u64CA", - "\u8303", - "\u7E7C", - "\u8208", - "\u4F3C", - "\u9918", - "\u5805", - "\u66F2", - "\u8F38", - "\u4FEE", - "\u6545", - "\u57CE", - "\u592B", - "\u5920", - "\u9001", - "\u7B46", - "\u8239", - "\u4F54", - "\u53F3", - "\u8CA1", - "\u5403", - "\u5BCC", - "\u6625", - "\u8077", - "\u89BA", - "\u6F22", - "\u756B", - "\u529F", - "\u5DF4", - "\u8DDF", - "\u96D6", - "\u96DC", - "\u98DB", - "\u6AA2", - "\u5438", - "\u52A9", - "\u6607", - "\u967D", - "\u4E92", - "\u521D", - "\u5275", - "\u6297", - "\u8003", - "\u6295", - "\u58DE", - "\u7B56", - "\u53E4", - "\u5F91", - "\u63DB", - "\u672A", - "\u8DD1", - "\u7559", - "\u92FC", - "\u66FE", - "\u7AEF", - "\u8CAC", - "\u7AD9", - "\u7C21", - "\u8FF0", - "\u9322", - "\u526F", - "\u76E1", - "\u5E1D", - "\u5C04", - "\u8349", - "\u885D", - "\u627F", - "\u7368", - "\u4EE4", - "\u9650", - "\u963F", - "\u5BA3", - "\u74B0", - "\u96D9", - "\u8ACB", - "\u8D85", - "\u5FAE", - "\u8B93", - "\u63A7", - "\u5DDE", - "\u826F", - "\u8EF8", - "\u627E", - "\u5426", - "\u7D00", - "\u76CA", - "\u4F9D", - "\u512A", - "\u9802", - "\u790E", - "\u8F09", - "\u5012", - "\u623F", - "\u7A81", - "\u5750", - "\u7C89", - "\u6575", - "\u7565", - "\u5BA2", - "\u8881", - "\u51B7", - "\u52DD", - "\u7D55", - "\u6790", - "\u584A", - "\u5291", - "\u6E2C", - "\u7D72", - "\u5354", - "\u8A34", - "\u5FF5", - "\u9673", - "\u4ECD", - "\u7F85", - "\u9E7D", - "\u53CB", - "\u6D0B", - "\u932F", - "\u82E6", - "\u591C", - "\u5211", - "\u79FB", - "\u983B", - "\u9010", - "\u9760", - "\u6DF7", - "\u6BCD", - "\u77ED", - "\u76AE", - "\u7D42", - "\u805A", - "\u6C7D", - "\u6751", - "\u96F2", - "\u54EA", - "\u65E2", - "\u8DDD", - "\u885B", - "\u505C", - "\u70C8", - "\u592E", - "\u5BDF", - "\u71D2", - "\u8FC5", - "\u5883", - "\u82E5", - "\u5370", - "\u6D32", - "\u523B", - "\u62EC", - "\u6FC0", - "\u5B54", - "\u641E", - "\u751A", - "\u5BA4", - "\u5F85", - "\u6838", - "\u6821", - "\u6563", - "\u4FB5", - "\u5427", - "\u7532", - "\u904A", - "\u4E45", - "\u83DC", - "\u5473", - "\u820A", - "\u6A21", - "\u6E56", - "\u8CA8", - "\u640D", - "\u9810", - "\u963B", - "\u6BEB", - "\u666E", - "\u7A69", - "\u4E59", - "\u5ABD", - "\u690D", - "\u606F", - "\u64F4", - "\u9280", - "\u8A9E", - "\u63EE", - "\u9152", - "\u5B88", - "\u62FF", - "\u5E8F", - "\u7D19", - "\u91AB", - "\u7F3A", - "\u96E8", - "\u55CE", - "\u91DD", - "\u5289", - "\u554A", - "\u6025", - "\u5531", - "\u8AA4", - "\u8A13", - "\u9858", - "\u5BE9", - "\u9644", - "\u7372", - "\u8336", - "\u9BAE", - "\u7CE7", - "\u65A4", - "\u5B69", - "\u812B", - "\u786B", - "\u80A5", - "\u5584", - "\u9F8D", - "\u6F14", - "\u7236", - "\u6F38", - "\u8840", - "\u6B61", - "\u68B0", - "\u638C", - "\u6B4C", - "\u6C99", - "\u525B", - "\u653B", - "\u8B02", - "\u76FE", - "\u8A0E", - "\u665A", - "\u7C92", - "\u4E82", - "\u71C3", - "\u77DB", - "\u4E4E", - "\u6BBA", - "\u85E5", - "\u5BE7", - "\u9B6F", - "\u8CB4", - "\u9418", - "\u7164", - "\u8B80", - "\u73ED", - "\u4F2F", - "\u9999", - "\u4ECB", - "\u8FEB", - "\u53E5", - "\u8C50", - "\u57F9", - "\u63E1", - "\u862D", - "\u64D4", - "\u5F26", - "\u86CB", - "\u6C89", - "\u5047", - "\u7A7F", - "\u57F7", - "\u7B54", - "\u6A02", - "\u8AB0", - "\u9806", - "\u7159", - "\u7E2E", - "\u5FB5", - "\u81C9", - "\u559C", - "\u677E", - "\u8173", - "\u56F0", - "\u7570", - "\u514D", - "\u80CC", - "\u661F", - "\u798F", - "\u8CB7", - "\u67D3", - "\u4E95", - "\u6982", - "\u6162", - "\u6015", - "\u78C1", - "\u500D", - "\u7956", - "\u7687", - "\u4FC3", - "\u975C", - "\u88DC", - "\u8A55", - "\u7FFB", - "\u8089", - "\u8E10", - "\u5C3C", - "\u8863", - "\u5BEC", - "\u63DA", - "\u68C9", - "\u5E0C", - "\u50B7", - "\u64CD", - "\u5782", - "\u79CB", - "\u5B9C", - "\u6C2B", - "\u5957", - "\u7763", - "\u632F", - "\u67B6", - "\u4EAE", - "\u672B", - "\u61B2", - "\u6176", - "\u7DE8", - "\u725B", - "\u89F8", - "\u6620", - "\u96F7", - "\u92B7", - "\u8A69", - "\u5EA7", - "\u5C45", - "\u6293", - "\u88C2", - "\u80DE", - "\u547C", - "\u5A18", - "\u666F", - "\u5A01", - "\u7DA0", - "\u6676", - "\u539A", - "\u76DF", - "\u8861", - "\u96DE", - "\u5B6B", - "\u5EF6", - "\u5371", - "\u81A0", - "\u5C4B", - "\u9109", - "\u81E8", - "\u9678", - "\u9867", - "\u6389", - "\u5440", - "\u71C8", - "\u6B72", - "\u63AA", - "\u675F", - "\u8010", - "\u5287", - "\u7389", - "\u8D99", - "\u8DF3", - "\u54E5", - "\u5B63", - "\u8AB2", - "\u51F1", - "\u80E1", - "\u984D", - "\u6B3E", - "\u7D39", - "\u5377", - "\u9F4A", - "\u5049", - "\u84B8", - "\u6B96", - "\u6C38", - "\u5B97", - "\u82D7", - "\u5DDD", - "\u7210", - "\u5CA9", - "\u5F31", - "\u96F6", - "\u694A", - "\u594F", - "\u6CBF", - "\u9732", - "\u687F", - "\u63A2", - "\u6ED1", - "\u93AE", - "\u98EF", - "\u6FC3", - "\u822A", - "\u61F7", - "\u8D95", - "\u5EAB", - "\u596A", - "\u4F0A", - "\u9748", - "\u7A05", - "\u9014", - "\u6EC5", - "\u8CFD", - "\u6B78", - "\u53EC", - "\u9F13", - "\u64AD", - "\u76E4", - "\u88C1", - "\u96AA", - "\u5EB7", - "\u552F", - "\u9304", - "\u83CC", - "\u7D14", - "\u501F", - "\u7CD6", - "\u84CB", - "\u6A6B", - "\u7B26", - "\u79C1", - "\u52AA", - "\u5802", - "\u57DF", - "\u69CD", - "\u6F64", - "\u5E45", - "\u54C8", - "\u7ADF", - "\u719F", - "\u87F2", - "\u6FA4", - "\u8166", - "\u58E4", - "\u78B3", - "\u6B50", - "\u904D", - "\u5074", - "\u5BE8", - "\u6562", - "\u5FB9", - "\u616E", - "\u659C", - "\u8584", - "\u5EAD", - "\u7D0D", - "\u5F48", - "\u98FC", - "\u4F38", - "\u6298", - "\u9EA5", - "\u6FD5", - "\u6697", - "\u8377", - "\u74E6", - "\u585E", - "\u5E8A", - "\u7BC9", - "\u60E1", - "\u6236", - "\u8A2A", - "\u5854", - "\u5947", - "\u900F", - "\u6881", - "\u5200", - "\u65CB", - "\u8DE1", - "\u5361", - "\u6C2F", - "\u9047", - "\u4EFD", - "\u6BD2", - "\u6CE5", - "\u9000", - "\u6D17", - "\u64FA", - "\u7070", - "\u5F69", - "\u8CE3", - "\u8017", - "\u590F", - "\u64C7", - "\u5FD9", - "\u9285", - "\u737B", - "\u786C", - "\u4E88", - "\u7E41", - "\u5708", - "\u96EA", - "\u51FD", - "\u4EA6", - "\u62BD", - "\u7BC7", - "\u9663", - "\u9670", - "\u4E01", - "\u5C3A", - "\u8FFD", - "\u5806", - "\u96C4", - "\u8FCE", - "\u6CDB", - "\u7238", - "\u6A13", - "\u907F", - "\u8B00", - "\u5678", - "\u91CE", - "\u8C6C", - "\u65D7", - "\u7D2F", - "\u504F", - "\u5178", - "\u9928", - "\u7D22", - "\u79E6", - "\u8102", - "\u6F6E", - "\u723A", - "\u8C46", - "\u5FFD", - "\u6258", - "\u9A5A", - "\u5851", - "\u907A", - "\u6108", - "\u6731", - "\u66FF", - "\u7E96", - "\u7C97", - "\u50BE", - "\u5C1A", - "\u75DB", - "\u695A", - "\u8B1D", - "\u596E", - "\u8CFC", - "\u78E8", - "\u541B", - "\u6C60", - "\u65C1", - "\u788E", - "\u9AA8", - "\u76E3", - "\u6355", - "\u5F1F", - "\u66B4", - "\u5272", - "\u8CAB", - "\u6B8A", - "\u91CB", - "\u8A5E", - "\u4EA1", - "\u58C1", - "\u9813", - "\u5BF6", - "\u5348", - "\u5875", - "\u805E", - "\u63ED", - "\u70AE", - "\u6B98", - "\u51AC", - "\u6A4B", - "\u5A66", - "\u8B66", - "\u7D9C", - "\u62DB", - "\u5433", - "\u4ED8", - "\u6D6E", - "\u906D", - "\u5F90", - "\u60A8", - "\u6416", - "\u8C37", - "\u8D0A", - "\u7BB1", - "\u9694", - "\u8A02", - "\u7537", - "\u5439", - "\u5712", - "\u7D1B", - "\u5510", - "\u6557", - "\u5B8B", - "\u73BB", - "\u5DE8", - "\u8015", - "\u5766", - "\u69AE", - "\u9589", - "\u7063", - "\u9375", - "\u51E1", - "\u99D0", - "\u934B", - "\u6551", - "\u6069", - "\u525D", - "\u51DD", - "\u9E7C", - "\u9F52", - "\u622A", - "\u7149", - "\u9EBB", - "\u7D21", - "\u7981", - "\u5EE2", - "\u76DB", - "\u7248", - "\u7DE9", - "\u6DE8", - "\u775B", - "\u660C", - "\u5A5A", - "\u6D89", - "\u7B52", - "\u5634", - "\u63D2", - "\u5CB8", - "\u6717", - "\u838A", - "\u8857", - "\u85CF", - "\u59D1", - "\u8CBF", - "\u8150", - "\u5974", - "\u5566", - "\u6163", - "\u4E58", - "\u5925", - "\u6062", - "\u52FB", - "\u7D17", - "\u624E", - "\u8FAF", - "\u8033", - "\u5F6A", - "\u81E3", - "\u5104", - "\u7483", - "\u62B5", - "\u8108", - "\u79C0", - "\u85A9", - "\u4FC4", - "\u7DB2", - "\u821E", - "\u5E97", - "\u5674", - "\u7E31", - "\u5BF8", - "\u6C57", - "\u639B", - "\u6D2A", - "\u8CC0", - "\u9583", - "\u67EC", - "\u7206", - "\u70EF", - "\u6D25", - "\u7A3B", - "\u7246", - "\u8EDF", - "\u52C7", - "\u50CF", - "\u6EFE", - "\u5398", - "\u8499", - "\u82B3", - "\u80AF", - "\u5761", - "\u67F1", - "\u76EA", - "\u817F", - "\u5100", - "\u65C5", - "\u5C3E", - "\u8ECB", - "\u51B0", - "\u8CA2", - "\u767B", - "\u9ECE", - "\u524A", - "\u947D", - "\u52D2", - "\u9003", - "\u969C", - "\u6C28", - "\u90ED", - "\u5CF0", - "\u5E63", - "\u6E2F", - "\u4F0F", - "\u8ECC", - "\u755D", - "\u7562", - "\u64E6", - "\u83AB", - "\u523A", - "\u6D6A", - "\u79D8", - "\u63F4", - "\u682A", - "\u5065", - "\u552E", - "\u80A1", - "\u5CF6", - "\u7518", - "\u6CE1", - "\u7761", - "\u7AE5", - "\u9444", - "\u6E6F", - "\u95A5", - "\u4F11", - "\u532F", - "\u820D", - "\u7267", - "\u7E5E", - "\u70B8", - "\u54F2", - "\u78F7", - "\u7E3E", - "\u670B", - "\u6DE1", - "\u5C16", - "\u555F", - "\u9677", - "\u67F4", - "\u5448", - "\u5F92", - "\u984F", - "\u6DDA", - "\u7A0D", - "\u5FD8", - "\u6CF5", - "\u85CD", - "\u62D6", - "\u6D1E", - "\u6388", - "\u93E1", - "\u8F9B", - "\u58EF", - "\u92D2", - "\u8CA7", - "\u865B", - "\u5F4E", - "\u6469", - "\u6CF0", - "\u5E7C", - "\u5EF7", - "\u5C0A", - "\u7A97", - "\u7DB1", - "\u5F04", - "\u96B8", - "\u7591", - "\u6C0F", - "\u5BAE", - "\u59D0", - "\u9707", - "\u745E", - "\u602A", - "\u5C24", - "\u7434", - "\u5FAA", - "\u63CF", - "\u819C", - "\u9055", - "\u593E", - "\u8170", - "\u7DE3", - "\u73E0", - "\u7AAE", - "\u68EE", - "\u679D", - "\u7AF9", - "\u6E9D", - "\u50AC", - "\u7E69", - "\u61B6", - "\u90A6", - "\u5269", - "\u5E78", - "\u6F3F", - "\u6B04", - "\u64C1", - "\u7259", - "\u8CAF", - "\u79AE", - "\u6FFE", - "\u9209", - "\u7D0B", - "\u7F77", - "\u62CD", - "\u54B1", - "\u558A", - "\u8896", - "\u57C3", - "\u52E4", - "\u7F70", - "\u7126", - "\u6F5B", - "\u4F0D", - "\u58A8", - "\u6B32", - "\u7E2B", - "\u59D3", - "\u520A", - "\u98FD", - "\u4EFF", - "\u734E", - "\u92C1", - "\u9B3C", - "\u9E97", - "\u8DE8", - "\u9ED8", - "\u6316", - "\u93C8", - "\u6383", - "\u559D", - "\u888B", - "\u70AD", - "\u6C61", - "\u5E55", - "\u8AF8", - "\u5F27", - "\u52F5", - "\u6885", - "\u5976", - "\u6F54", - "\u707D", - "\u821F", - "\u9451", - "\u82EF", - "\u8A1F", - "\u62B1", - "\u6BC0", - "\u61C2", - "\u5BD2", - "\u667A", - "\u57D4", - "\u5BC4", - "\u5C46", - "\u8E8D", - "\u6E21", - "\u6311", - "\u4E39", - "\u8271", - "\u8C9D", - "\u78B0", - "\u62D4", - "\u7239", - "\u6234", - "\u78BC", - "\u5922", - "\u82BD", - "\u7194", - "\u8D64", - "\u6F01", - "\u54ED", - "\u656C", - "\u9846", - "\u5954", - "\u925B", - "\u4EF2", - "\u864E", - "\u7A00", - "\u59B9", - "\u4E4F", - "\u73CD", - "\u7533", - "\u684C", - "\u9075", - "\u5141", - "\u9686", - "\u87BA", - "\u5009", - "\u9B4F", - "\u92B3", - "\u66C9", - "\u6C2E", - "\u517C", - "\u96B1", - "\u7919", - "\u8D6B", - "\u64A5", - "\u5FE0", - "\u8085", - "\u7F38", - "\u727D", - "\u6436", - "\u535A", - "\u5DE7", - "\u6BBC", - "\u5144", - "\u675C", - "\u8A0A", - "\u8AA0", - "\u78A7", - "\u7965", - "\u67EF", - "\u9801", - "\u5DE1", - "\u77E9", - "\u60B2", - "\u704C", - "\u9F61", - "\u502B", - "\u7968", - "\u5C0B", - "\u6842", - "\u92EA", - "\u8056", - "\u6050", - "\u6070", - "\u912D", - "\u8DA3", - "\u62AC", - "\u8352", - "\u9A30", - "\u8CBC", - "\u67D4", - "\u6EF4", - "\u731B", - "\u95CA", - "\u8F1B", - "\u59BB", - "\u586B", - "\u64A4", - "\u5132", - "\u7C3D", - "\u9B27", - "\u64FE", - "\u7D2B", - "\u7802", - "\u905E", - "\u6232", - "\u540A", - "\u9676", - "\u4F10", - "\u9935", - "\u7642", - "\u74F6", - "\u5A46", - "\u64AB", - "\u81C2", - "\u6478", - "\u5FCD", - "\u8766", - "\u881F", - "\u9130", - "\u80F8", - "\u978F", - "\u64E0", - "\u5076", - "\u68C4", - "\u69FD", - "\u52C1", - "\u4E73", - "\u9127", - "\u5409", - "\u4EC1", - "\u721B", - "\u78DA", - "\u79DF", - "\u70CF", - "\u8266", - "\u4F34", - "\u74DC", - "\u6DFA", - "\u4E19", - "\u66AB", - "\u71E5", - "\u6A61", - "\u67F3", - "\u8FF7", - "\u6696", - "\u724C", - "\u79E7", - "\u81BD", - "\u8A73", - "\u7C27", - "\u8E0F", - "\u74F7", - "\u8B5C", - "\u5446", - "\u8CD3", - "\u7CCA", - "\u6D1B", - "\u8F1D", - "\u61A4", - "\u7AF6", - "\u9699", - "\u6012", - "\u7C98", - "\u4E43", - "\u7DD2", - "\u80A9", - "\u7C4D", - "\u654F", - "\u5857", - "\u7199", - "\u7686", - "\u5075", - "\u61F8", - "\u6398", - "\u4EAB", - "\u7CFE", - "\u9192", - "\u72C2", - "\u9396", - "\u6DC0", - "\u6068", - "\u7272", - "\u9738", - "\u722C", - "\u8CDE", - "\u9006", - "\u73A9", - "\u9675", - "\u795D", - "\u79D2", - "\u6D59", - "\u8C8C", - "\u5F79", - "\u5F7C", - "\u6089", - "\u9D28", - "\u8DA8", - "\u9CF3", - "\u6668", - "\u755C", - "\u8F29", - "\u79E9", - "\u5375", - "\u7F72", - "\u68AF", - "\u708E", - "\u7058", - "\u68CB", - "\u9A45", - "\u7BE9", - "\u5CFD", - "\u5192", - "\u5565", - "\u58FD", - "\u8B6F", - "\u6D78", - "\u6CC9", - "\u5E3D", - "\u9072", - "\u77FD", - "\u7586", - "\u8CB8", - "\u6F0F", - "\u7A3F", - "\u51A0", - "\u5AE9", - "\u8105", - "\u82AF", - "\u7262", - "\u53DB", - "\u8755", - "\u5967", - "\u9CF4", - "\u5DBA", - "\u7F8A", - "\u6191", - "\u4E32", - "\u5858", - "\u7E6A", - "\u9175", - "\u878D", - "\u76C6", - "\u932B", - "\u5EDF", - "\u7C4C", - "\u51CD", - "\u8F14", - "\u651D", - "\u8972", - "\u7B4B", - "\u62D2", - "\u50DA", - "\u65F1", - "\u9240", - "\u9CE5", - "\u6F06", - "\u6C88", - "\u7709", - "\u758F", - "\u6DFB", - "\u68D2", - "\u7A57", - "\u785D", - "\u97D3", - "\u903C", - "\u626D", - "\u50D1", - "\u6DBC", - "\u633A", - "\u7897", - "\u683D", - "\u7092", - "\u676F", - "\u60A3", - "\u993E", - "\u52F8", - "\u8C6A", - "\u907C", - "\u52C3", - "\u9D3B", - "\u65E6", - "\u540F", - "\u62DC", - "\u72D7", - "\u57CB", - "\u8F25", - "\u63A9", - "\u98F2", - "\u642C", - "\u7F75", - "\u8FAD", - "\u52FE", - "\u6263", - "\u4F30", - "\u8523", - "\u7D68", - "\u9727", - "\u4E08", - "\u6735", - "\u59C6", - "\u64EC", - "\u5B87", - "\u8F2F", - "\u965D", - "\u96D5", - "\u511F", - "\u84C4", - "\u5D07", - "\u526A", - "\u5021", - "\u5EF3", - "\u54AC", - "\u99DB", - "\u85AF", - "\u5237", - "\u65A5", - "\u756A", - "\u8CE6", - "\u5949", - "\u4F5B", - "\u6F86", - "\u6F2B", - "\u66FC", - "\u6247", - "\u9223", - "\u6843", - "\u6276", - "\u4ED4", - "\u8FD4", - "\u4FD7", - "\u8667", - "\u8154", - "\u978B", - "\u68F1", - "\u8986", - "\u6846", - "\u6084", - "\u53D4", - "\u649E", - "\u9A19", - "\u52D8", - "\u65FA", - "\u6CB8", - "\u5B64", - "\u5410", - "\u5B5F", - "\u6E20", - "\u5C48", - "\u75BE", - "\u5999", - "\u60DC", - "\u4EF0", - "\u72E0", - "\u8139", - "\u8AE7", - "\u62CB", - "\u9EF4", - "\u6851", - "\u5D17", - "\u561B", - "\u8870", - "\u76DC", - "\u6EF2", - "\u81DF", - "\u8CF4", - "\u6E67", - "\u751C", - "\u66F9", - "\u95B1", - "\u808C", - "\u54E9", - "\u53B2", - "\u70F4", - "\u7DEF", - "\u6BC5", - "\u6628", - "\u507D", - "\u75C7", - "\u716E", - "\u5606", - "\u91D8", - "\u642D", - "\u8396", - "\u7C60", - "\u9177", - "\u5077", - "\u5F13", - "\u9310", - "\u6046", - "\u5091", - "\u5751", - "\u9F3B", - "\u7FFC", - "\u7DB8", - "\u6558", - "\u7344", - "\u902E", - "\u7F50", - "\u7D61", - "\u68DA", - "\u6291", - "\u81A8", - "\u852C", - "\u5BFA", - "\u9A5F", - "\u7A46", - "\u51B6", - "\u67AF", - "\u518A", - "\u5C4D", - "\u51F8", - "\u7D33", - "\u576F", - "\u72A7", - "\u7130", - "\u8F5F", - "\u6B23", - "\u6649", - "\u7626", - "\u79A6", - "\u9320", - "\u9326", - "\u55AA", - "\u65EC", - "\u935B", - "\u58DF", - "\u641C", - "\u64B2", - "\u9080", - "\u4EAD", - "\u916F", - "\u9081", - "\u8212", - "\u8106", - "\u9176", - "\u9592", - "\u6182", - "\u915A", - "\u9811", - "\u7FBD", - "\u6F32", - "\u5378", - "\u4ED7", - "\u966A", - "\u95E2", - "\u61F2", - "\u676D", - "\u59DA", - "\u809A", - "\u6349", - "\u98C4", - "\u6F02", - "\u6606", - "\u6B3A", - "\u543E", - "\u90CE", - "\u70F7", - "\u6C41", - "\u5475", - "\u98FE", - "\u856D", - "\u96C5", - "\u90F5", - "\u9077", - "\u71D5", - "\u6492", - "\u59FB", - "\u8D74", - "\u5BB4", - "\u7169", - "\u50B5", - "\u5E33", - "\u6591", - "\u9234", - "\u65E8", - "\u9187", - "\u8463", - "\u9905", - "\u96DB", - "\u59FF", - "\u62CC", - "\u5085", - "\u8179", - "\u59A5", - "\u63C9", - "\u8CE2", - "\u62C6", - "\u6B6A", - "\u8461", - "\u80FA", - "\u4E1F", - "\u6D69", - "\u5FBD", - "\u6602", - "\u588A", - "\u64CB", - "\u89BD", - "\u8CAA", - "\u6170", - "\u7E73", - "\u6C6A", - "\u614C", - "\u99AE", - "\u8AFE", - "\u59DC", - "\u8ABC", - "\u5147", - "\u52A3", - "\u8AA3", - "\u8000", - "\u660F", - "\u8EBA", - "\u76C8", - "\u9A0E", - "\u55AC", - "\u6EAA", - "\u53E2", - "\u76E7", - "\u62B9", - "\u60B6", - "\u8AEE", - "\u522E", - "\u99D5", - "\u7E9C", - "\u609F", - "\u6458", - "\u927A", - "\u64F2", - "\u9817", - "\u5E7B", - "\u67C4", - "\u60E0", - "\u6158", - "\u4F73", - "\u4EC7", - "\u81D8", - "\u7AA9", - "\u6ECC", - "\u528D", - "\u77A7", - "\u5821", - "\u6F51", - "\u8525", - "\u7F69", - "\u970D", - "\u6488", - "\u80CE", - "\u84BC", - "\u6FF1", - "\u5006", - "\u6345", - "\u6E58", - "\u780D", - "\u971E", - "\u90B5", - "\u8404", - "\u760B", - "\u6DEE", - "\u9042", - "\u718A", - "\u7CDE", - "\u70D8", - "\u5BBF", - "\u6A94", - "\u6208", - "\u99C1", - "\u5AC2", - "\u88D5", - "\u5F99", - "\u7BAD", - "\u6350", - "\u8178", - "\u6490", - "\u66EC", - "\u8FA8", - "\u6BBF", - "\u84EE", - "\u6524", - "\u652A", - "\u91AC", - "\u5C4F", - "\u75AB", - "\u54C0", - "\u8521", - "\u5835", - "\u6CAB", - "\u76BA", - "\u66A2", - "\u758A", - "\u95A3", - "\u840A", - "\u6572", - "\u8F44", - "\u9264", - "\u75D5", - "\u58E9", - "\u5DF7", - "\u9913", - "\u798D", - "\u4E18", - "\u7384", - "\u6E9C", - "\u66F0", - "\u908F", - "\u5F6D", - "\u5617", - "\u537F", - "\u59A8", - "\u8247", - "\u541E", - "\u97CB", - "\u6028", - "\u77EE", - "\u6B47" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/korean.json -var require_korean = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/korean.json"(exports2, module2) { - module2.exports = [ - "\u1100\u1161\u1100\u1167\u11A8", - "\u1100\u1161\u1101\u1173\u11B7", - "\u1100\u1161\u1102\u1161\u11AB", - "\u1100\u1161\u1102\u1173\u11BC", - "\u1100\u1161\u1103\u1173\u11A8", - "\u1100\u1161\u1105\u1173\u110E\u1175\u11B7", - "\u1100\u1161\u1106\u116E\u11B7", - "\u1100\u1161\u1107\u1161\u11BC", - "\u1100\u1161\u1109\u1161\u11BC", - "\u1100\u1161\u1109\u1173\u11B7", - "\u1100\u1161\u110B\u116E\u11AB\u1103\u1166", - "\u1100\u1161\u110B\u1173\u11AF", - "\u1100\u1161\u110B\u1175\u1103\u1173", - "\u1100\u1161\u110B\u1175\u11B8", - "\u1100\u1161\u110C\u1161\u11BC", - "\u1100\u1161\u110C\u1165\u11BC", - "\u1100\u1161\u110C\u1169\u11A8", - "\u1100\u1161\u110C\u116E\u11A8", - "\u1100\u1161\u11A8\u110B\u1169", - "\u1100\u1161\u11A8\u110C\u1161", - "\u1100\u1161\u11AB\u1100\u1167\u11A8", - "\u1100\u1161\u11AB\u1107\u116E", - "\u1100\u1161\u11AB\u1109\u1165\u11B8", - "\u1100\u1161\u11AB\u110C\u1161\u11BC", - "\u1100\u1161\u11AB\u110C\u1165\u11B8", - "\u1100\u1161\u11AB\u1111\u1161\u11AB", - "\u1100\u1161\u11AF\u1103\u1173\u11BC", - "\u1100\u1161\u11AF\u1107\u1175", - "\u1100\u1161\u11AF\u1109\u1162\u11A8", - "\u1100\u1161\u11AF\u110C\u1173\u11BC", - "\u1100\u1161\u11B7\u1100\u1161\u11A8", - "\u1100\u1161\u11B7\u1100\u1175", - "\u1100\u1161\u11B7\u1109\u1169", - "\u1100\u1161\u11B7\u1109\u116E\u1109\u1165\u11BC", - "\u1100\u1161\u11B7\u110C\u1161", - "\u1100\u1161\u11B7\u110C\u1165\u11BC", - "\u1100\u1161\u11B8\u110C\u1161\u1100\u1175", - "\u1100\u1161\u11BC\u1102\u1161\u11B7", - "\u1100\u1161\u11BC\u1103\u1161\u11BC", - "\u1100\u1161\u11BC\u1103\u1169", - "\u1100\u1161\u11BC\u1105\u1167\u11A8\u1112\u1175", - "\u1100\u1161\u11BC\u1107\u1167\u11AB", - "\u1100\u1161\u11BC\u1107\u116E\u11A8", - "\u1100\u1161\u11BC\u1109\u1161", - "\u1100\u1161\u11BC\u1109\u116E\u1105\u1163\u11BC", - "\u1100\u1161\u11BC\u110B\u1161\u110C\u1175", - "\u1100\u1161\u11BC\u110B\u116F\u11AB\u1103\u1169", - "\u1100\u1161\u11BC\u110B\u1174", - "\u1100\u1161\u11BC\u110C\u1166", - "\u1100\u1161\u11BC\u110C\u1169", - "\u1100\u1161\u11C0\u110B\u1175", - "\u1100\u1162\u1100\u116E\u1105\u1175", - "\u1100\u1162\u1102\u1161\u1105\u1175", - "\u1100\u1162\u1107\u1161\u11BC", - "\u1100\u1162\u1107\u1167\u11AF", - "\u1100\u1162\u1109\u1165\u11AB", - "\u1100\u1162\u1109\u1165\u11BC", - "\u1100\u1162\u110B\u1175\u11AB", - "\u1100\u1162\u11A8\u1100\u116A\u11AB\u110C\u1165\u11A8", - "\u1100\u1165\u1109\u1175\u11AF", - "\u1100\u1165\u110B\u1162\u11A8", - "\u1100\u1165\u110B\u116E\u11AF", - "\u1100\u1165\u110C\u1175\u11BA", - "\u1100\u1165\u1111\u116E\u11B7", - "\u1100\u1165\u11A8\u110C\u1165\u11BC", - "\u1100\u1165\u11AB\u1100\u1161\u11BC", - "\u1100\u1165\u11AB\u1106\u116E\u11AF", - "\u1100\u1165\u11AB\u1109\u1165\u11AF", - "\u1100\u1165\u11AB\u110C\u1169", - "\u1100\u1165\u11AB\u110E\u116E\u11A8", - "\u1100\u1165\u11AF\u110B\u1173\u11B7", - "\u1100\u1165\u11B7\u1109\u1161", - "\u1100\u1165\u11B7\u1110\u1169", - "\u1100\u1166\u1109\u1175\u1111\u1161\u11AB", - "\u1100\u1166\u110B\u1175\u11B7", - "\u1100\u1167\u110B\u116E\u11AF", - "\u1100\u1167\u11AB\u1112\u1162", - "\u1100\u1167\u11AF\u1100\u116A", - "\u1100\u1167\u11AF\u1100\u116E\u11A8", - "\u1100\u1167\u11AF\u1105\u1169\u11AB", - "\u1100\u1167\u11AF\u1109\u1165\u11A8", - "\u1100\u1167\u11AF\u1109\u1173\u11BC", - "\u1100\u1167\u11AF\u1109\u1175\u11B7", - "\u1100\u1167\u11AF\u110C\u1165\u11BC", - "\u1100\u1167\u11AF\u1112\u1169\u11AB", - "\u1100\u1167\u11BC\u1100\u1168", - "\u1100\u1167\u11BC\u1100\u1169", - "\u1100\u1167\u11BC\u1100\u1175", - "\u1100\u1167\u11BC\u1105\u1167\u11A8", - "\u1100\u1167\u11BC\u1107\u1169\u11A8\u1100\u116E\u11BC", - "\u1100\u1167\u11BC\u1107\u1175", - "\u1100\u1167\u11BC\u1109\u1161\u11BC\u1103\u1169", - "\u1100\u1167\u11BC\u110B\u1167\u11BC", - "\u1100\u1167\u11BC\u110B\u116E", - "\u1100\u1167\u11BC\u110C\u1162\u11BC", - "\u1100\u1167\u11BC\u110C\u1166", - "\u1100\u1167\u11BC\u110C\u116E", - "\u1100\u1167\u11BC\u110E\u1161\u11AF", - "\u1100\u1167\u11BC\u110E\u1175", - "\u1100\u1167\u11BC\u1112\u1163\u11BC", - "\u1100\u1167\u11BC\u1112\u1165\u11B7", - "\u1100\u1168\u1100\u1169\u11A8", - "\u1100\u1168\u1103\u1161\u11AB", - "\u1100\u1168\u1105\u1161\u11AB", - "\u1100\u1168\u1109\u1161\u11AB", - "\u1100\u1168\u1109\u1169\u11A8", - "\u1100\u1168\u110B\u1163\u11A8", - "\u1100\u1168\u110C\u1165\u11AF", - "\u1100\u1168\u110E\u1173\u11BC", - "\u1100\u1168\u1112\u116C\u11A8", - "\u1100\u1169\u1100\u1162\u11A8", - "\u1100\u1169\u1100\u116E\u1105\u1167", - "\u1100\u1169\u1100\u116E\u11BC", - "\u1100\u1169\u1100\u1173\u11B8", - "\u1100\u1169\u1103\u1173\u11BC\u1112\u1161\u11A8\u1109\u1162\u11BC", - "\u1100\u1169\u1106\u116E\u1109\u1175\u11AB", - "\u1100\u1169\u1106\u1175\u11AB", - "\u1100\u1169\u110B\u1163\u11BC\u110B\u1175", - "\u1100\u1169\u110C\u1161\u11BC", - "\u1100\u1169\u110C\u1165\u11AB", - "\u1100\u1169\u110C\u1175\u11B8", - "\u1100\u1169\u110E\u116E\u11BA\u1100\u1161\u1105\u116E", - "\u1100\u1169\u1110\u1169\u11BC", - "\u1100\u1169\u1112\u1163\u11BC", - "\u1100\u1169\u11A8\u1109\u1175\u11A8", - "\u1100\u1169\u11AF\u1106\u1169\u11A8", - "\u1100\u1169\u11AF\u110D\u1161\u1100\u1175", - "\u1100\u1169\u11AF\u1111\u1173", - "\u1100\u1169\u11BC\u1100\u1161\u11AB", - "\u1100\u1169\u11BC\u1100\u1162", - "\u1100\u1169\u11BC\u1100\u1167\u11A8", - "\u1100\u1169\u11BC\u1100\u116E\u11AB", - "\u1100\u1169\u11BC\u1100\u1173\u11B8", - "\u1100\u1169\u11BC\u1100\u1175", - "\u1100\u1169\u11BC\u1103\u1169\u11BC", - "\u1100\u1169\u11BC\u1106\u116E\u110B\u116F\u11AB", - "\u1100\u1169\u11BC\u1107\u116E", - "\u1100\u1169\u11BC\u1109\u1161", - "\u1100\u1169\u11BC\u1109\u1175\u11A8", - "\u1100\u1169\u11BC\u110B\u1165\u11B8", - "\u1100\u1169\u11BC\u110B\u1167\u11AB", - "\u1100\u1169\u11BC\u110B\u116F\u11AB", - "\u1100\u1169\u11BC\u110C\u1161\u11BC", - "\u1100\u1169\u11BC\u110D\u1161", - "\u1100\u1169\u11BC\u110E\u1162\u11A8", - "\u1100\u1169\u11BC\u1110\u1169\u11BC", - "\u1100\u1169\u11BC\u1111\u1169", - "\u1100\u1169\u11BC\u1112\u1161\u11BC", - "\u1100\u1169\u11BC\u1112\u1172\u110B\u1175\u11AF", - "\u1100\u116A\u1106\u1169\u11A8", - "\u1100\u116A\u110B\u1175\u11AF", - "\u1100\u116A\u110C\u1161\u11BC", - "\u1100\u116A\u110C\u1165\u11BC", - "\u1100\u116A\u1112\u1161\u11A8", - "\u1100\u116A\u11AB\u1100\u1162\u11A8", - "\u1100\u116A\u11AB\u1100\u1168", - "\u1100\u116A\u11AB\u1100\u116A\u11BC", - "\u1100\u116A\u11AB\u1102\u1167\u11B7", - "\u1100\u116A\u11AB\u1105\u1161\u11B7", - "\u1100\u116A\u11AB\u1105\u1167\u11AB", - "\u1100\u116A\u11AB\u1105\u1175", - "\u1100\u116A\u11AB\u1109\u1173\u11B8", - "\u1100\u116A\u11AB\u1109\u1175\u11B7", - "\u1100\u116A\u11AB\u110C\u1165\u11B7", - "\u1100\u116A\u11AB\u110E\u1161\u11AF", - "\u1100\u116A\u11BC\u1100\u1167\u11BC", - "\u1100\u116A\u11BC\u1100\u1169", - "\u1100\u116A\u11BC\u110C\u1161\u11BC", - "\u1100\u116A\u11BC\u110C\u116E", - "\u1100\u116C\u1105\u1169\u110B\u116E\u11B7", - "\u1100\u116C\u11BC\u110C\u1161\u11BC\u1112\u1175", - "\u1100\u116D\u1100\u116A\u1109\u1165", - "\u1100\u116D\u1106\u116E\u11AB", - "\u1100\u116D\u1107\u1169\u11A8", - "\u1100\u116D\u1109\u1175\u11AF", - "\u1100\u116D\u110B\u1163\u11BC", - "\u1100\u116D\u110B\u1172\u11A8", - "\u1100\u116D\u110C\u1161\u11BC", - "\u1100\u116D\u110C\u1175\u11A8", - "\u1100\u116D\u1110\u1169\u11BC", - "\u1100\u116D\u1112\u116A\u11AB", - "\u1100\u116D\u1112\u116E\u11AB", - "\u1100\u116E\u1100\u1167\u11BC", - "\u1100\u116E\u1105\u1173\u11B7", - "\u1100\u116E\u1106\u1165\u11BC", - "\u1100\u116E\u1107\u1167\u11AF", - "\u1100\u116E\u1107\u116E\u11AB", - "\u1100\u116E\u1109\u1165\u11A8", - "\u1100\u116E\u1109\u1165\u11BC", - "\u1100\u116E\u1109\u1169\u11A8", - "\u1100\u116E\u110B\u1167\u11A8", - "\u1100\u116E\u110B\u1175\u11B8", - "\u1100\u116E\u110E\u1165\u11BC", - "\u1100\u116E\u110E\u1166\u110C\u1165\u11A8", - "\u1100\u116E\u11A8\u1100\u1161", - "\u1100\u116E\u11A8\u1100\u1175", - "\u1100\u116E\u11A8\u1102\u1162", - "\u1100\u116E\u11A8\u1105\u1175\u11B8", - "\u1100\u116E\u11A8\u1106\u116E\u11AF", - "\u1100\u116E\u11A8\u1106\u1175\u11AB", - "\u1100\u116E\u11A8\u1109\u116E", - "\u1100\u116E\u11A8\u110B\u1165", - "\u1100\u116E\u11A8\u110B\u116A\u11BC", - "\u1100\u116E\u11A8\u110C\u1165\u11A8", - "\u1100\u116E\u11A8\u110C\u1166", - "\u1100\u116E\u11A8\u1112\u116C", - "\u1100\u116E\u11AB\u1103\u1162", - "\u1100\u116E\u11AB\u1109\u1161", - "\u1100\u116E\u11AB\u110B\u1175\u11AB", - "\u1100\u116E\u11BC\u1100\u1173\u11A8\u110C\u1165\u11A8", - "\u1100\u116F\u11AB\u1105\u1175", - "\u1100\u116F\u11AB\u110B\u1171", - "\u1100\u116F\u11AB\u1110\u116E", - "\u1100\u1171\u1100\u116E\u11A8", - "\u1100\u1171\u1109\u1175\u11AB", - "\u1100\u1172\u110C\u1165\u11BC", - "\u1100\u1172\u110E\u1175\u11A8", - "\u1100\u1172\u11AB\u1112\u1167\u11BC", - "\u1100\u1173\u1102\u1161\u11AF", - "\u1100\u1173\u1102\u1163\u11BC", - "\u1100\u1173\u1102\u1173\u11AF", - "\u1100\u1173\u1105\u1165\u1102\u1161", - "\u1100\u1173\u1105\u116E\u11B8", - "\u1100\u1173\u1105\u1173\u11BA", - "\u1100\u1173\u1105\u1175\u11B7", - "\u1100\u1173\u110C\u1166\u1109\u1165\u110B\u1163", - "\u1100\u1173\u1110\u1169\u1105\u1169\u11A8", - "\u1100\u1173\u11A8\u1107\u1169\u11A8", - "\u1100\u1173\u11A8\u1112\u1175", - "\u1100\u1173\u11AB\u1100\u1165", - "\u1100\u1173\u11AB\u1100\u116D", - "\u1100\u1173\u11AB\u1105\u1162", - "\u1100\u1173\u11AB\u1105\u1169", - "\u1100\u1173\u11AB\u1106\u116E", - "\u1100\u1173\u11AB\u1107\u1169\u11AB", - "\u1100\u1173\u11AB\u110B\u116F\u11AB", - "\u1100\u1173\u11AB\u110B\u1172\u11A8", - "\u1100\u1173\u11AB\u110E\u1165", - "\u1100\u1173\u11AF\u110A\u1175", - "\u1100\u1173\u11AF\u110C\u1161", - "\u1100\u1173\u11B7\u1100\u1161\u11BC\u1109\u1161\u11AB", - "\u1100\u1173\u11B7\u1100\u1169", - "\u1100\u1173\u11B7\u1102\u1167\u11AB", - "\u1100\u1173\u11B7\u1106\u1166\u1103\u1161\u11AF", - "\u1100\u1173\u11B7\u110B\u1162\u11A8", - "\u1100\u1173\u11B7\u110B\u1167\u11AB", - "\u1100\u1173\u11B7\u110B\u116D\u110B\u1175\u11AF", - "\u1100\u1173\u11B7\u110C\u1175", - "\u1100\u1173\u11BC\u110C\u1165\u11BC\u110C\u1165\u11A8", - "\u1100\u1175\u1100\u1161\u11AB", - "\u1100\u1175\u1100\u116A\u11AB", - "\u1100\u1175\u1102\u1167\u11B7", - "\u1100\u1175\u1102\u1173\u11BC", - "\u1100\u1175\u1103\u1169\u11A8\u1100\u116D", - "\u1100\u1175\u1103\u116E\u11BC", - "\u1100\u1175\u1105\u1169\u11A8", - "\u1100\u1175\u1105\u1173\u11B7", - "\u1100\u1175\u1107\u1165\u11B8", - "\u1100\u1175\u1107\u1169\u11AB", - "\u1100\u1175\u1107\u116E\u11AB", - "\u1100\u1175\u1108\u1173\u11B7", - "\u1100\u1175\u1109\u116E\u11A8\u1109\u1161", - "\u1100\u1175\u1109\u116E\u11AF", - "\u1100\u1175\u110B\u1165\u11A8", - "\u1100\u1175\u110B\u1165\u11B8", - "\u1100\u1175\u110B\u1169\u11AB", - "\u1100\u1175\u110B\u116E\u11AB", - "\u1100\u1175\u110B\u116F\u11AB", - "\u1100\u1175\u110C\u1165\u11A8", - "\u1100\u1175\u110C\u116E\u11AB", - "\u1100\u1175\u110E\u1175\u11B7", - "\u1100\u1175\u1112\u1169\u11AB", - "\u1100\u1175\u1112\u116C\u11A8", - "\u1100\u1175\u11AB\u1100\u1173\u11B8", - "\u1100\u1175\u11AB\u110C\u1161\u11BC", - "\u1100\u1175\u11AF\u110B\u1175", - "\u1100\u1175\u11B7\u1107\u1161\u11B8", - "\u1100\u1175\u11B7\u110E\u1175", - "\u1100\u1175\u11B7\u1111\u1169\u1100\u1169\u11BC\u1112\u1161\u11BC", - "\u1101\u1161\u11A8\u1103\u116E\u1100\u1175", - "\u1101\u1161\u11B7\u1108\u1161\u11A8", - "\u1101\u1162\u1103\u1161\u11AF\u110B\u1173\u11B7", - "\u1101\u1162\u1109\u1169\u1100\u1173\u11B7", - "\u1101\u1165\u11B8\u110C\u1175\u11AF", - "\u1101\u1169\u11A8\u1103\u1162\u1100\u1175", - "\u1101\u1169\u11BE\u110B\u1175\u11C1", - "\u1102\u1161\u1103\u1173\u11AF\u110B\u1175", - "\u1102\u1161\u1105\u1161\u11AB\u1112\u1175", - "\u1102\u1161\u1106\u1165\u110C\u1175", - "\u1102\u1161\u1106\u116E\u11AF", - "\u1102\u1161\u110E\u1175\u11B7\u1107\u1161\u11AB", - "\u1102\u1161\u1112\u1173\u11AF", - "\u1102\u1161\u11A8\u110B\u1167\u11B8", - "\u1102\u1161\u11AB\u1107\u1161\u11BC", - "\u1102\u1161\u11AF\u1100\u1162", - "\u1102\u1161\u11AF\u110A\u1175", - "\u1102\u1161\u11AF\u110D\u1161", - "\u1102\u1161\u11B7\u1102\u1167", - "\u1102\u1161\u11B7\u1103\u1162\u1106\u116E\u11AB", - "\u1102\u1161\u11B7\u1106\u1162", - "\u1102\u1161\u11B7\u1109\u1161\u11AB", - "\u1102\u1161\u11B7\u110C\u1161", - "\u1102\u1161\u11B7\u1111\u1167\u11AB", - "\u1102\u1161\u11B7\u1112\u1161\u11A8\u1109\u1162\u11BC", - "\u1102\u1161\u11BC\u1107\u1175", - "\u1102\u1161\u11C0\u1106\u1161\u11AF", - "\u1102\u1162\u1102\u1167\u11AB", - "\u1102\u1162\u110B\u116D\u11BC", - "\u1102\u1162\u110B\u1175\u11AF", - "\u1102\u1162\u11B7\u1107\u1175", - "\u1102\u1162\u11B7\u1109\u1162", - "\u1102\u1162\u11BA\u1106\u116E\u11AF", - "\u1102\u1162\u11BC\u1103\u1169\u11BC", - "\u1102\u1162\u11BC\u1106\u1167\u11AB", - "\u1102\u1162\u11BC\u1107\u1161\u11BC", - "\u1102\u1162\u11BC\u110C\u1161\u11BC\u1100\u1169", - "\u1102\u1166\u11A8\u1110\u1161\u110B\u1175", - "\u1102\u1166\u11BA\u110D\u1162", - "\u1102\u1169\u1103\u1169\u11BC", - "\u1102\u1169\u1105\u1161\u11AB\u1109\u1162\u11A8", - "\u1102\u1169\u1105\u1167\u11A8", - "\u1102\u1169\u110B\u1175\u11AB", - "\u1102\u1169\u11A8\u110B\u1173\u11B7", - "\u1102\u1169\u11A8\u110E\u1161", - "\u1102\u1169\u11A8\u1112\u116A", - "\u1102\u1169\u11AB\u1105\u1175", - "\u1102\u1169\u11AB\u1106\u116E\u11AB", - "\u1102\u1169\u11AB\u110C\u1162\u11BC", - "\u1102\u1169\u11AF\u110B\u1175", - "\u1102\u1169\u11BC\u1100\u116E", - "\u1102\u1169\u11BC\u1103\u1161\u11B7", - "\u1102\u1169\u11BC\u1106\u1175\u11AB", - "\u1102\u1169\u11BC\u1107\u116E", - "\u1102\u1169\u11BC\u110B\u1165\u11B8", - "\u1102\u1169\u11BC\u110C\u1161\u11BC", - "\u1102\u1169\u11BC\u110E\u1169\u11AB", - "\u1102\u1169\u11C1\u110B\u1175", - "\u1102\u116E\u11AB\u1103\u1169\u11BC\u110C\u1161", - "\u1102\u116E\u11AB\u1106\u116E\u11AF", - "\u1102\u116E\u11AB\u110A\u1165\u11B8", - "\u1102\u1172\u110B\u116D\u11A8", - "\u1102\u1173\u1101\u1175\u11B7", - "\u1102\u1173\u11A8\u1103\u1162", - "\u1102\u1173\u11BC\u1103\u1169\u11BC\u110C\u1165\u11A8", - "\u1102\u1173\u11BC\u1105\u1167\u11A8", - "\u1103\u1161\u1107\u1161\u11BC", - "\u1103\u1161\u110B\u1163\u11BC\u1109\u1165\u11BC", - "\u1103\u1161\u110B\u1173\u11B7", - "\u1103\u1161\u110B\u1175\u110B\u1165\u1110\u1173", - "\u1103\u1161\u1112\u1162\u11BC", - "\u1103\u1161\u11AB\u1100\u1168", - "\u1103\u1161\u11AB\u1100\u1169\u11AF", - "\u1103\u1161\u11AB\u1103\u1169\u11A8", - "\u1103\u1161\u11AB\u1106\u1161\u11BA", - "\u1103\u1161\u11AB\u1109\u116E\u11AB", - "\u1103\u1161\u11AB\u110B\u1165", - "\u1103\u1161\u11AB\u110B\u1171", - "\u1103\u1161\u11AB\u110C\u1165\u11B7", - "\u1103\u1161\u11AB\u110E\u1166", - "\u1103\u1161\u11AB\u110E\u116E", - "\u1103\u1161\u11AB\u1111\u1167\u11AB", - "\u1103\u1161\u11AB\u1111\u116E\u11BC", - "\u1103\u1161\u11AF\u1100\u1163\u11AF", - "\u1103\u1161\u11AF\u1105\u1165", - "\u1103\u1161\u11AF\u1105\u1167\u11A8", - "\u1103\u1161\u11AF\u1105\u1175", - "\u1103\u1161\u11B0\u1100\u1169\u1100\u1175", - "\u1103\u1161\u11B7\u1103\u1161\u11BC", - "\u1103\u1161\u11B7\u1107\u1162", - "\u1103\u1161\u11B7\u110B\u116D", - "\u1103\u1161\u11B7\u110B\u1175\u11B7", - "\u1103\u1161\u11B8\u1107\u1167\u11AB", - "\u1103\u1161\u11B8\u110C\u1161\u11BC", - "\u1103\u1161\u11BC\u1100\u1173\u11AB", - "\u1103\u1161\u11BC\u1107\u116E\u11AB\u1100\u1161\u11AB", - "\u1103\u1161\u11BC\u110B\u1167\u11AB\u1112\u1175", - "\u1103\u1161\u11BC\u110C\u1161\u11BC", - "\u1103\u1162\u1100\u1172\u1106\u1169", - "\u1103\u1162\u1102\u1161\u11BD", - "\u1103\u1162\u1103\u1161\u11AB\u1112\u1175", - "\u1103\u1162\u1103\u1161\u11B8", - "\u1103\u1162\u1103\u1169\u1109\u1175", - "\u1103\u1162\u1105\u1163\u11A8", - "\u1103\u1162\u1105\u1163\u11BC", - "\u1103\u1162\u1105\u1172\u11A8", - "\u1103\u1162\u1106\u116E\u11AB", - "\u1103\u1162\u1107\u116E\u1107\u116E\u11AB", - "\u1103\u1162\u1109\u1175\u11AB", - "\u1103\u1162\u110B\u1173\u11BC", - "\u1103\u1162\u110C\u1161\u11BC", - "\u1103\u1162\u110C\u1165\u11AB", - "\u1103\u1162\u110C\u1165\u11B8", - "\u1103\u1162\u110C\u116E\u11BC", - "\u1103\u1162\u110E\u1162\u11A8", - "\u1103\u1162\u110E\u116E\u11AF", - "\u1103\u1162\u110E\u116E\u11BC", - "\u1103\u1162\u1110\u1169\u11BC\u1105\u1167\u11BC", - "\u1103\u1162\u1112\u1161\u11A8", - "\u1103\u1162\u1112\u1161\u11AB\u1106\u1175\u11AB\u1100\u116E\u11A8", - "\u1103\u1162\u1112\u1161\u11B8\u1109\u1175\u11AF", - "\u1103\u1162\u1112\u1167\u11BC", - "\u1103\u1165\u11BC\u110B\u1165\u1105\u1175", - "\u1103\u1166\u110B\u1175\u1110\u1173", - "\u1103\u1169\u1103\u1162\u110E\u1166", - "\u1103\u1169\u1103\u1165\u11A8", - "\u1103\u1169\u1103\u116E\u11A8", - "\u1103\u1169\u1106\u1161\u11BC", - "\u1103\u1169\u1109\u1165\u1100\u116A\u11AB", - "\u1103\u1169\u1109\u1175\u11B7", - "\u1103\u1169\u110B\u116E\u11B7", - "\u1103\u1169\u110B\u1175\u11B8", - "\u1103\u1169\u110C\u1161\u1100\u1175", - "\u1103\u1169\u110C\u1165\u1112\u1175", - "\u1103\u1169\u110C\u1165\u11AB", - "\u1103\u1169\u110C\u116E\u11BC", - "\u1103\u1169\u110E\u1161\u11A8", - "\u1103\u1169\u11A8\u1100\u1161\u11B7", - "\u1103\u1169\u11A8\u1105\u1175\u11B8", - "\u1103\u1169\u11A8\u1109\u1165", - "\u1103\u1169\u11A8\u110B\u1175\u11AF", - "\u1103\u1169\u11A8\u110E\u1161\u11BC\u110C\u1165\u11A8", - "\u1103\u1169\u11BC\u1112\u116A\u110E\u1162\u11A8", - "\u1103\u1171\u11BA\u1106\u1169\u1109\u1173\u11B8", - "\u1103\u1171\u11BA\u1109\u1161\u11AB", - "\u1104\u1161\u11AF\u110B\u1161\u110B\u1175", - "\u1106\u1161\u1102\u116E\u1105\u1161", - "\u1106\u1161\u1102\u1173\u11AF", - "\u1106\u1161\u1103\u1161\u11BC", - "\u1106\u1161\u1105\u1161\u1110\u1169\u11AB", - "\u1106\u1161\u1105\u1167\u11AB", - "\u1106\u1161\u1106\u116E\u1105\u1175", - "\u1106\u1161\u1109\u1161\u110C\u1175", - "\u1106\u1161\u110B\u1163\u11A8", - "\u1106\u1161\u110B\u116D\u1102\u1166\u110C\u1173", - "\u1106\u1161\u110B\u1173\u11AF", - "\u1106\u1161\u110B\u1173\u11B7", - "\u1106\u1161\u110B\u1175\u110F\u1173", - "\u1106\u1161\u110C\u116E\u11BC", - "\u1106\u1161\u110C\u1175\u1106\u1161\u11A8", - "\u1106\u1161\u110E\u1161\u11AB\u1100\u1161\u110C\u1175", - "\u1106\u1161\u110E\u1161\u11AF", - "\u1106\u1161\u1112\u1173\u11AB", - "\u1106\u1161\u11A8\u1100\u1165\u11AF\u1105\u1175", - "\u1106\u1161\u11A8\u1102\u1162", - "\u1106\u1161\u11A8\u1109\u1161\u11BC", - "\u1106\u1161\u11AB\u1102\u1161\u11B7", - "\u1106\u1161\u11AB\u1103\u116E", - "\u1106\u1161\u11AB\u1109\u1166", - "\u1106\u1161\u11AB\u110B\u1163\u11A8", - "\u1106\u1161\u11AB\u110B\u1175\u11AF", - "\u1106\u1161\u11AB\u110C\u1165\u11B7", - "\u1106\u1161\u11AB\u110C\u1169\u11A8", - "\u1106\u1161\u11AB\u1112\u116A", - "\u1106\u1161\u11AD\u110B\u1175", - "\u1106\u1161\u11AF\u1100\u1175", - "\u1106\u1161\u11AF\u110A\u1173\u11B7", - "\u1106\u1161\u11AF\u1110\u116E", - "\u1106\u1161\u11B7\u1103\u1162\u1105\u1169", - "\u1106\u1161\u11BC\u110B\u116F\u11AB\u1100\u1167\u11BC", - "\u1106\u1162\u1102\u1167\u11AB", - "\u1106\u1162\u1103\u1161\u11AF", - "\u1106\u1162\u1105\u1167\u11A8", - "\u1106\u1162\u1107\u1165\u11AB", - "\u1106\u1162\u1109\u1173\u110F\u1165\u11B7", - "\u1106\u1162\u110B\u1175\u11AF", - "\u1106\u1162\u110C\u1161\u11BC", - "\u1106\u1162\u11A8\u110C\u116E", - "\u1106\u1165\u11A8\u110B\u1175", - "\u1106\u1165\u11AB\u110C\u1165", - "\u1106\u1165\u11AB\u110C\u1175", - "\u1106\u1165\u11AF\u1105\u1175", - "\u1106\u1166\u110B\u1175\u11AF", - "\u1106\u1167\u1102\u1173\u1105\u1175", - "\u1106\u1167\u110E\u1175\u11AF", - "\u1106\u1167\u11AB\u1103\u1161\u11B7", - "\u1106\u1167\u11AF\u110E\u1175", - "\u1106\u1167\u11BC\u1103\u1161\u11AB", - "\u1106\u1167\u11BC\u1105\u1167\u11BC", - "\u1106\u1167\u11BC\u110B\u1168", - "\u1106\u1167\u11BC\u110B\u1174", - "\u1106\u1167\u11BC\u110C\u1165\u11AF", - "\u1106\u1167\u11BC\u110E\u1175\u11BC", - "\u1106\u1167\u11BC\u1112\u1161\u11B7", - "\u1106\u1169\u1100\u1173\u11B7", - "\u1106\u1169\u1102\u1175\u1110\u1165", - "\u1106\u1169\u1103\u1166\u11AF", - "\u1106\u1169\u1103\u1173\u11AB", - "\u1106\u1169\u1107\u1165\u11B7", - "\u1106\u1169\u1109\u1173\u11B8", - "\u1106\u1169\u110B\u1163\u11BC", - "\u1106\u1169\u110B\u1175\u11B7", - "\u1106\u1169\u110C\u1169\u1105\u1175", - "\u1106\u1169\u110C\u1175\u11B8", - "\u1106\u1169\u1110\u116E\u11BC\u110B\u1175", - "\u1106\u1169\u11A8\u1100\u1165\u11AF\u110B\u1175", - "\u1106\u1169\u11A8\u1105\u1169\u11A8", - "\u1106\u1169\u11A8\u1109\u1161", - "\u1106\u1169\u11A8\u1109\u1169\u1105\u1175", - "\u1106\u1169\u11A8\u1109\u116E\u11B7", - "\u1106\u1169\u11A8\u110C\u1165\u11A8", - "\u1106\u1169\u11A8\u1111\u116D", - "\u1106\u1169\u11AF\u1105\u1162", - "\u1106\u1169\u11B7\u1106\u1162", - "\u1106\u1169\u11B7\u1106\u116E\u1100\u1166", - "\u1106\u1169\u11B7\u1109\u1161\u11AF", - "\u1106\u1169\u11B7\u1109\u1169\u11A8", - "\u1106\u1169\u11B7\u110C\u1175\u11BA", - "\u1106\u1169\u11B7\u1110\u1169\u11BC", - "\u1106\u1169\u11B8\u1109\u1175", - "\u1106\u116E\u1100\u116A\u11AB\u1109\u1175\u11B7", - "\u1106\u116E\u1100\u116E\u11BC\u1112\u116A", - "\u1106\u116E\u1103\u1165\u110B\u1171", - "\u1106\u116E\u1103\u1165\u11B7", - "\u1106\u116E\u1105\u1173\u11C1", - "\u1106\u116E\u1109\u1173\u11AB", - "\u1106\u116E\u110B\u1165\u11BA", - "\u1106\u116E\u110B\u1167\u11A8", - "\u1106\u116E\u110B\u116D\u11BC", - "\u1106\u116E\u110C\u1169\u1100\u1165\u11AB", - "\u1106\u116E\u110C\u1175\u1100\u1162", - "\u1106\u116E\u110E\u1165\u11A8", - "\u1106\u116E\u11AB\u1100\u116E", - "\u1106\u116E\u11AB\u1103\u1173\u11A8", - "\u1106\u116E\u11AB\u1107\u1165\u11B8", - "\u1106\u116E\u11AB\u1109\u1165", - "\u1106\u116E\u11AB\u110C\u1166", - "\u1106\u116E\u11AB\u1112\u1161\u11A8", - "\u1106\u116E\u11AB\u1112\u116A", - "\u1106\u116E\u11AF\u1100\u1161", - "\u1106\u116E\u11AF\u1100\u1165\u11AB", - "\u1106\u116E\u11AF\u1100\u1167\u11AF", - "\u1106\u116E\u11AF\u1100\u1169\u1100\u1175", - "\u1106\u116E\u11AF\u1105\u1169\u11AB", - "\u1106\u116E\u11AF\u1105\u1175\u1112\u1161\u11A8", - "\u1106\u116E\u11AF\u110B\u1173\u11B7", - "\u1106\u116E\u11AF\u110C\u1175\u11AF", - "\u1106\u116E\u11AF\u110E\u1166", - "\u1106\u1175\u1100\u116E\u11A8", - "\u1106\u1175\u1103\u1175\u110B\u1165", - "\u1106\u1175\u1109\u1161\u110B\u1175\u11AF", - "\u1106\u1175\u1109\u116E\u11AF", - "\u1106\u1175\u110B\u1167\u11A8", - "\u1106\u1175\u110B\u116D\u11BC\u1109\u1175\u11AF", - "\u1106\u1175\u110B\u116E\u11B7", - "\u1106\u1175\u110B\u1175\u11AB", - "\u1106\u1175\u1110\u1175\u11BC", - "\u1106\u1175\u1112\u1169\u11AB", - "\u1106\u1175\u11AB\u1100\u1161\u11AB", - "\u1106\u1175\u11AB\u110C\u1169\u11A8", - "\u1106\u1175\u11AB\u110C\u116E", - "\u1106\u1175\u11AE\u110B\u1173\u11B7", - "\u1106\u1175\u11AF\u1100\u1161\u1105\u116E", - "\u1106\u1175\u11AF\u1105\u1175\u1106\u1175\u1110\u1165", - "\u1106\u1175\u11C0\u1107\u1161\u1103\u1161\u11A8", - "\u1107\u1161\u1100\u1161\u110C\u1175", - "\u1107\u1161\u1100\u116E\u1102\u1175", - "\u1107\u1161\u1102\u1161\u1102\u1161", - "\u1107\u1161\u1102\u1173\u11AF", - "\u1107\u1161\u1103\u1161\u11A8", - "\u1107\u1161\u1103\u1161\u11BA\u1100\u1161", - "\u1107\u1161\u1105\u1161\u11B7", - "\u1107\u1161\u110B\u1175\u1105\u1165\u1109\u1173", - "\u1107\u1161\u1110\u1161\u11BC", - "\u1107\u1161\u11A8\u1106\u116E\u11AF\u1100\u116A\u11AB", - "\u1107\u1161\u11A8\u1109\u1161", - "\u1107\u1161\u11A8\u1109\u116E", - "\u1107\u1161\u11AB\u1103\u1162", - "\u1107\u1161\u11AB\u1103\u1173\u1109\u1175", - "\u1107\u1161\u11AB\u1106\u1161\u11AF", - "\u1107\u1161\u11AB\u1107\u1161\u11AF", - "\u1107\u1161\u11AB\u1109\u1165\u11BC", - "\u1107\u1161\u11AB\u110B\u1173\u11BC", - "\u1107\u1161\u11AB\u110C\u1161\u11BC", - "\u1107\u1161\u11AB\u110C\u116E\u11A8", - "\u1107\u1161\u11AB\u110C\u1175", - "\u1107\u1161\u11AB\u110E\u1161\u11AB", - "\u1107\u1161\u11AE\u110E\u1175\u11B7", - "\u1107\u1161\u11AF\u1100\u1161\u1105\u1161\u11A8", - "\u1107\u1161\u11AF\u1100\u1165\u11AF\u110B\u1173\u11B7", - "\u1107\u1161\u11AF\u1100\u1167\u11AB", - "\u1107\u1161\u11AF\u1103\u1161\u11AF", - "\u1107\u1161\u11AF\u1105\u1166", - "\u1107\u1161\u11AF\u1106\u1169\u11A8", - "\u1107\u1161\u11AF\u1107\u1161\u1103\u1161\u11A8", - "\u1107\u1161\u11AF\u1109\u1162\u11BC", - "\u1107\u1161\u11AF\u110B\u1173\u11B7", - "\u1107\u1161\u11AF\u110C\u1161\u1100\u116E\u11A8", - "\u1107\u1161\u11AF\u110C\u1165\u11AB", - "\u1107\u1161\u11AF\u1110\u1169\u11B8", - "\u1107\u1161\u11AF\u1111\u116D", - "\u1107\u1161\u11B7\u1112\u1161\u1102\u1173\u11AF", - "\u1107\u1161\u11B8\u1100\u1173\u1105\u1173\u11BA", - "\u1107\u1161\u11B8\u1106\u1161\u11BA", - "\u1107\u1161\u11B8\u1109\u1161\u11BC", - "\u1107\u1161\u11B8\u1109\u1169\u11C0", - "\u1107\u1161\u11BC\u1100\u1173\u11B7", - "\u1107\u1161\u11BC\u1106\u1167\u11AB", - "\u1107\u1161\u11BC\u1106\u116E\u11AB", - "\u1107\u1161\u11BC\u1107\u1161\u1103\u1161\u11A8", - "\u1107\u1161\u11BC\u1107\u1165\u11B8", - "\u1107\u1161\u11BC\u1109\u1169\u11BC", - "\u1107\u1161\u11BC\u1109\u1175\u11A8", - "\u1107\u1161\u11BC\u110B\u1161\u11AB", - "\u1107\u1161\u11BC\u110B\u116E\u11AF", - "\u1107\u1161\u11BC\u110C\u1175", - "\u1107\u1161\u11BC\u1112\u1161\u11A8", - "\u1107\u1161\u11BC\u1112\u1162", - "\u1107\u1161\u11BC\u1112\u1163\u11BC", - "\u1107\u1162\u1100\u1167\u11BC", - "\u1107\u1162\u1101\u1169\u11B8", - "\u1107\u1162\u1103\u1161\u11AF", - "\u1107\u1162\u1103\u1173\u1106\u1175\u11AB\u1110\u1165\u11AB", - "\u1107\u1162\u11A8\u1103\u116E\u1109\u1161\u11AB", - "\u1107\u1162\u11A8\u1109\u1162\u11A8", - "\u1107\u1162\u11A8\u1109\u1165\u11BC", - "\u1107\u1162\u11A8\u110B\u1175\u11AB", - "\u1107\u1162\u11A8\u110C\u1166", - "\u1107\u1162\u11A8\u1112\u116A\u110C\u1165\u11B7", - "\u1107\u1165\u1105\u1173\u11BA", - "\u1107\u1165\u1109\u1165\u11BA", - "\u1107\u1165\u1110\u1173\u11AB", - "\u1107\u1165\u11AB\u1100\u1162", - "\u1107\u1165\u11AB\u110B\u1167\u11A8", - "\u1107\u1165\u11AB\u110C\u1175", - "\u1107\u1165\u11AB\u1112\u1169", - "\u1107\u1165\u11AF\u1100\u1173\u11B7", - "\u1107\u1165\u11AF\u1105\u1166", - "\u1107\u1165\u11AF\u110A\u1165", - "\u1107\u1165\u11B7\u110B\u1171", - "\u1107\u1165\u11B7\u110B\u1175\u11AB", - "\u1107\u1165\u11B7\u110C\u116C", - "\u1107\u1165\u11B8\u1105\u1172\u11AF", - "\u1107\u1165\u11B8\u110B\u116F\u11AB", - "\u1107\u1165\u11B8\u110C\u1165\u11A8", - "\u1107\u1165\u11B8\u110E\u1175\u11A8", - "\u1107\u1166\u110B\u1175\u110C\u1175\u11BC", - "\u1107\u1166\u11AF\u1110\u1173", - "\u1107\u1167\u11AB\u1100\u1167\u11BC", - "\u1107\u1167\u11AB\u1103\u1169\u11BC", - "\u1107\u1167\u11AB\u1106\u1167\u11BC", - "\u1107\u1167\u11AB\u1109\u1175\u11AB", - "\u1107\u1167\u11AB\u1112\u1169\u1109\u1161", - "\u1107\u1167\u11AB\u1112\u116A", - "\u1107\u1167\u11AF\u1103\u1169", - "\u1107\u1167\u11AF\u1106\u1167\u11BC", - "\u1107\u1167\u11AF\u110B\u1175\u11AF", - "\u1107\u1167\u11BC\u1109\u1175\u11AF", - "\u1107\u1167\u11BC\u110B\u1161\u1105\u1175", - "\u1107\u1167\u11BC\u110B\u116F\u11AB", - "\u1107\u1169\u1100\u116A\u11AB", - "\u1107\u1169\u1102\u1165\u1109\u1173", - "\u1107\u1169\u1105\u1161\u1109\u1162\u11A8", - "\u1107\u1169\u1105\u1161\u11B7", - "\u1107\u1169\u1105\u1173\u11B7", - "\u1107\u1169\u1109\u1161\u11BC", - "\u1107\u1169\u110B\u1161\u11AB", - "\u1107\u1169\u110C\u1161\u1100\u1175", - "\u1107\u1169\u110C\u1161\u11BC", - "\u1107\u1169\u110C\u1165\u11AB", - "\u1107\u1169\u110C\u1169\u11AB", - "\u1107\u1169\u1110\u1169\u11BC", - "\u1107\u1169\u1111\u1167\u11AB\u110C\u1165\u11A8", - "\u1107\u1169\u1112\u1165\u11B7", - "\u1107\u1169\u11A8\u1103\u1169", - "\u1107\u1169\u11A8\u1109\u1161", - "\u1107\u1169\u11A8\u1109\u116E\u11BC\u110B\u1161", - "\u1107\u1169\u11A8\u1109\u1173\u11B8", - "\u1107\u1169\u11A9\u110B\u1173\u11B7", - "\u1107\u1169\u11AB\u1100\u1167\u11A8\u110C\u1165\u11A8", - "\u1107\u1169\u11AB\u1105\u1162", - "\u1107\u1169\u11AB\u1107\u116E", - "\u1107\u1169\u11AB\u1109\u1161", - "\u1107\u1169\u11AB\u1109\u1165\u11BC", - "\u1107\u1169\u11AB\u110B\u1175\u11AB", - "\u1107\u1169\u11AB\u110C\u1175\u11AF", - "\u1107\u1169\u11AF\u1111\u1166\u11AB", - "\u1107\u1169\u11BC\u1109\u1161", - "\u1107\u1169\u11BC\u110C\u1175", - "\u1107\u1169\u11BC\u1110\u116E", - "\u1107\u116E\u1100\u1173\u11AB", - "\u1107\u116E\u1101\u1173\u1105\u1165\u110B\u116E\u11B7", - "\u1107\u116E\u1103\u1161\u11B7", - "\u1107\u116E\u1103\u1169\u11BC\u1109\u1161\u11AB", - "\u1107\u116E\u1106\u116E\u11AB", - "\u1107\u116E\u1107\u116E\u11AB", - "\u1107\u116E\u1109\u1161\u11AB", - "\u1107\u116E\u1109\u1161\u11BC", - "\u1107\u116E\u110B\u1165\u11BF", - "\u1107\u116E\u110B\u1175\u11AB", - "\u1107\u116E\u110C\u1161\u11A8\u110B\u116D\u11BC", - "\u1107\u116E\u110C\u1161\u11BC", - "\u1107\u116E\u110C\u1165\u11BC", - "\u1107\u116E\u110C\u1169\u11A8", - "\u1107\u116E\u110C\u1175\u1105\u1165\u11AB\u1112\u1175", - "\u1107\u116E\u110E\u1175\u11AB", - "\u1107\u116E\u1110\u1161\u11A8", - "\u1107\u116E\u1111\u116E\u11B7", - "\u1107\u116E\u1112\u116C\u110C\u1161\u11BC", - "\u1107\u116E\u11A8\u1107\u116E", - "\u1107\u116E\u11A8\u1112\u1161\u11AB", - "\u1107\u116E\u11AB\u1102\u1169", - "\u1107\u116E\u11AB\u1105\u1163\u11BC", - "\u1107\u116E\u11AB\u1105\u1175", - "\u1107\u116E\u11AB\u1106\u1167\u11BC", - "\u1107\u116E\u11AB\u1109\u1165\u11A8", - "\u1107\u116E\u11AB\u110B\u1163", - "\u1107\u116E\u11AB\u110B\u1171\u1100\u1175", - "\u1107\u116E\u11AB\u1111\u1175\u11AF", - "\u1107\u116E\u11AB\u1112\u1169\u11BC\u1109\u1162\u11A8", - "\u1107\u116E\u11AF\u1100\u1169\u1100\u1175", - "\u1107\u116E\u11AF\u1100\u116A", - "\u1107\u116E\u11AF\u1100\u116D", - "\u1107\u116E\u11AF\u1101\u1169\u11BE", - "\u1107\u116E\u11AF\u1106\u1161\u11AB", - "\u1107\u116E\u11AF\u1107\u1165\u11B8", - "\u1107\u116E\u11AF\u1107\u1175\u11BE", - "\u1107\u116E\u11AF\u110B\u1161\u11AB", - "\u1107\u116E\u11AF\u110B\u1175\u110B\u1175\u11A8", - "\u1107\u116E\u11AF\u1112\u1162\u11BC", - "\u1107\u1173\u1105\u1162\u11AB\u1103\u1173", - "\u1107\u1175\u1100\u1173\u11A8", - "\u1107\u1175\u1102\u1161\u11AB", - "\u1107\u1175\u1102\u1175\u11AF", - "\u1107\u1175\u1103\u116E\u11AF\u1100\u1175", - "\u1107\u1175\u1103\u1175\u110B\u1169", - "\u1107\u1175\u1105\u1169\u1109\u1169", - "\u1107\u1175\u1106\u1161\u11AB", - "\u1107\u1175\u1106\u1167\u11BC", - "\u1107\u1175\u1106\u1175\u11AF", - "\u1107\u1175\u1107\u1161\u1105\u1161\u11B7", - "\u1107\u1175\u1107\u1175\u11B7\u1107\u1161\u11B8", - "\u1107\u1175\u1109\u1161\u11BC", - "\u1107\u1175\u110B\u116D\u11BC", - "\u1107\u1175\u110B\u1172\u11AF", - "\u1107\u1175\u110C\u116E\u11BC", - "\u1107\u1175\u1110\u1161\u1106\u1175\u11AB", - "\u1107\u1175\u1111\u1161\u11AB", - "\u1107\u1175\u11AF\u1103\u1175\u11BC", - "\u1107\u1175\u11BA\u1106\u116E\u11AF", - "\u1107\u1175\u11BA\u1107\u1161\u11BC\u110B\u116E\u11AF", - "\u1107\u1175\u11BA\u110C\u116E\u11AF\u1100\u1175", - "\u1107\u1175\u11BE\u1101\u1161\u11AF", - "\u1108\u1161\u11AF\u1100\u1161\u11AB\u1109\u1162\u11A8", - "\u1108\u1161\u11AF\u1105\u1162", - "\u1108\u1161\u11AF\u1105\u1175", - "\u1109\u1161\u1100\u1165\u11AB", - "\u1109\u1161\u1100\u1168\u110C\u1165\u11AF", - "\u1109\u1161\u1102\u1161\u110B\u1175", - "\u1109\u1161\u1102\u1163\u11BC", - "\u1109\u1161\u1105\u1161\u11B7", - "\u1109\u1161\u1105\u1161\u11BC", - "\u1109\u1161\u1105\u1175\u11B8", - "\u1109\u1161\u1106\u1169\u1102\u1175\u11B7", - "\u1109\u1161\u1106\u116E\u11AF", - "\u1109\u1161\u1107\u1161\u11BC", - "\u1109\u1161\u1109\u1161\u11BC", - "\u1109\u1161\u1109\u1162\u11BC\u1112\u116A\u11AF", - "\u1109\u1161\u1109\u1165\u11AF", - "\u1109\u1161\u1109\u1173\u11B7", - "\u1109\u1161\u1109\u1175\u11AF", - "\u1109\u1161\u110B\u1165\u11B8", - "\u1109\u1161\u110B\u116D\u11BC", - "\u1109\u1161\u110B\u116F\u11AF", - "\u1109\u1161\u110C\u1161\u11BC", - "\u1109\u1161\u110C\u1165\u11AB", - "\u1109\u1161\u110C\u1175\u11AB", - "\u1109\u1161\u110E\u1169\u11AB", - "\u1109\u1161\u110E\u116E\u11AB\u1100\u1175", - "\u1109\u1161\u1110\u1161\u11BC", - "\u1109\u1161\u1110\u116E\u1105\u1175", - "\u1109\u1161\u1112\u1173\u11AF", - "\u1109\u1161\u11AB\u1100\u1175\u11AF", - "\u1109\u1161\u11AB\u1107\u116E\u110B\u1175\u11AB\u1100\u116A", - "\u1109\u1161\u11AB\u110B\u1165\u11B8", - "\u1109\u1161\u11AB\u110E\u1162\u11A8", - "\u1109\u1161\u11AF\u1105\u1175\u11B7", - "\u1109\u1161\u11AF\u110B\u1175\u11AB", - "\u1109\u1161\u11AF\u110D\u1161\u11A8", - "\u1109\u1161\u11B7\u1100\u1168\u1110\u1161\u11BC", - "\u1109\u1161\u11B7\u1100\u116E\u11A8", - "\u1109\u1161\u11B7\u1109\u1175\u11B8", - "\u1109\u1161\u11B7\u110B\u116F\u11AF", - "\u1109\u1161\u11B7\u110E\u1169\u11AB", - "\u1109\u1161\u11BC\u1100\u116A\u11AB", - "\u1109\u1161\u11BC\u1100\u1173\u11B7", - "\u1109\u1161\u11BC\u1103\u1162", - "\u1109\u1161\u11BC\u1105\u1172", - "\u1109\u1161\u11BC\u1107\u1161\u11AB\u1100\u1175", - "\u1109\u1161\u11BC\u1109\u1161\u11BC", - "\u1109\u1161\u11BC\u1109\u1175\u11A8", - "\u1109\u1161\u11BC\u110B\u1165\u11B8", - "\u1109\u1161\u11BC\u110B\u1175\u11AB", - "\u1109\u1161\u11BC\u110C\u1161", - "\u1109\u1161\u11BC\u110C\u1165\u11B7", - "\u1109\u1161\u11BC\u110E\u1165", - "\u1109\u1161\u11BC\u110E\u116E", - "\u1109\u1161\u11BC\u1110\u1162", - "\u1109\u1161\u11BC\u1111\u116D", - "\u1109\u1161\u11BC\u1111\u116E\u11B7", - "\u1109\u1161\u11BC\u1112\u116A\u11BC", - "\u1109\u1162\u1107\u1167\u11A8", - "\u1109\u1162\u11A8\u1101\u1161\u11AF", - "\u1109\u1162\u11A8\u110B\u1167\u11AB\u1111\u1175\u11AF", - "\u1109\u1162\u11BC\u1100\u1161\u11A8", - "\u1109\u1162\u11BC\u1106\u1167\u11BC", - "\u1109\u1162\u11BC\u1106\u116E\u11AF", - "\u1109\u1162\u11BC\u1107\u1161\u11BC\u1109\u1169\u11BC", - "\u1109\u1162\u11BC\u1109\u1161\u11AB", - "\u1109\u1162\u11BC\u1109\u1165\u11AB", - "\u1109\u1162\u11BC\u1109\u1175\u11AB", - "\u1109\u1162\u11BC\u110B\u1175\u11AF", - "\u1109\u1162\u11BC\u1112\u116A\u11AF", - "\u1109\u1165\u1105\u1161\u11B8", - "\u1109\u1165\u1105\u1173\u11AB", - "\u1109\u1165\u1106\u1167\u11BC", - "\u1109\u1165\u1106\u1175\u11AB", - "\u1109\u1165\u1107\u1175\u1109\u1173", - "\u1109\u1165\u110B\u1163\u11BC", - "\u1109\u1165\u110B\u116E\u11AF", - "\u1109\u1165\u110C\u1165\u11A8", - "\u1109\u1165\u110C\u1165\u11B7", - "\u1109\u1165\u110D\u1169\u11A8", - "\u1109\u1165\u110F\u1173\u11AF", - "\u1109\u1165\u11A8\u1109\u1161", - "\u1109\u1165\u11A8\u110B\u1172", - "\u1109\u1165\u11AB\u1100\u1165", - "\u1109\u1165\u11AB\u1106\u116E\u11AF", - "\u1109\u1165\u11AB\u1107\u1162", - "\u1109\u1165\u11AB\u1109\u1162\u11BC", - "\u1109\u1165\u11AB\u1109\u116E", - "\u1109\u1165\u11AB\u110B\u116F\u11AB", - "\u1109\u1165\u11AB\u110C\u1161\u11BC", - "\u1109\u1165\u11AB\u110C\u1165\u11AB", - "\u1109\u1165\u11AB\u1110\u1162\u11A8", - "\u1109\u1165\u11AB\u1111\u116E\u11BC\u1100\u1175", - "\u1109\u1165\u11AF\u1100\u1165\u110C\u1175", - "\u1109\u1165\u11AF\u1102\u1161\u11AF", - "\u1109\u1165\u11AF\u1105\u1165\u11BC\u1110\u1161\u11BC", - "\u1109\u1165\u11AF\u1106\u1167\u11BC", - "\u1109\u1165\u11AF\u1106\u116E\u11AB", - "\u1109\u1165\u11AF\u1109\u1161", - "\u1109\u1165\u11AF\u110B\u1161\u11A8\u1109\u1161\u11AB", - "\u1109\u1165\u11AF\u110E\u1175", - "\u1109\u1165\u11AF\u1110\u1161\u11BC", - "\u1109\u1165\u11B8\u110A\u1175", - "\u1109\u1165\u11BC\u1100\u1169\u11BC", - "\u1109\u1165\u11BC\u1103\u1161\u11BC", - "\u1109\u1165\u11BC\u1106\u1167\u11BC", - "\u1109\u1165\u11BC\u1107\u1167\u11AF", - "\u1109\u1165\u11BC\u110B\u1175\u11AB", - "\u1109\u1165\u11BC\u110C\u1161\u11BC", - "\u1109\u1165\u11BC\u110C\u1165\u11A8", - "\u1109\u1165\u11BC\u110C\u1175\u11AF", - "\u1109\u1165\u11BC\u1112\u1161\u11B7", - "\u1109\u1166\u1100\u1173\u11B7", - "\u1109\u1166\u1106\u1175\u1102\u1161", - "\u1109\u1166\u1109\u1161\u11BC", - "\u1109\u1166\u110B\u116F\u11AF", - "\u1109\u1166\u110C\u1169\u11BC\u1103\u1162\u110B\u116A\u11BC", - "\u1109\u1166\u1110\u1161\u11A8", - "\u1109\u1166\u11AB\u1110\u1165", - "\u1109\u1166\u11AB\u1110\u1175\u1106\u1175\u1110\u1165", - "\u1109\u1166\u11BA\u110D\u1162", - "\u1109\u1169\u1100\u1172\u1106\u1169", - "\u1109\u1169\u1100\u1173\u11A8\u110C\u1165\u11A8", - "\u1109\u1169\u1100\u1173\u11B7", - "\u1109\u1169\u1102\u1161\u1100\u1175", - "\u1109\u1169\u1102\u1167\u11AB", - "\u1109\u1169\u1103\u1173\u11A8", - "\u1109\u1169\u1106\u1161\u11BC", - "\u1109\u1169\u1106\u116E\u11AB", - "\u1109\u1169\u1109\u1165\u11AF", - "\u1109\u1169\u1109\u1169\u11A8", - "\u1109\u1169\u110B\u1161\u1100\u116A", - "\u1109\u1169\u110B\u116D\u11BC", - "\u1109\u1169\u110B\u116F\u11AB", - "\u1109\u1169\u110B\u1173\u11B7", - "\u1109\u1169\u110C\u116E\u11BC\u1112\u1175", - "\u1109\u1169\u110C\u1175\u1111\u116E\u11B7", - "\u1109\u1169\u110C\u1175\u11AF", - "\u1109\u1169\u1111\u116E\u11BC", - "\u1109\u1169\u1112\u1167\u11BC", - "\u1109\u1169\u11A8\u1103\u1161\u11B7", - "\u1109\u1169\u11A8\u1103\u1169", - "\u1109\u1169\u11A8\u110B\u1169\u11BA", - "\u1109\u1169\u11AB\u1100\u1161\u1105\u1161\u11A8", - "\u1109\u1169\u11AB\u1100\u1175\u11AF", - "\u1109\u1169\u11AB\u1102\u1167", - "\u1109\u1169\u11AB\u1102\u1175\u11B7", - "\u1109\u1169\u11AB\u1103\u1173\u11BC", - "\u1109\u1169\u11AB\u1106\u1169\u11A8", - "\u1109\u1169\u11AB\u1108\u1167\u11A8", - "\u1109\u1169\u11AB\u1109\u1175\u11AF", - "\u1109\u1169\u11AB\u110C\u1175\u11AF", - "\u1109\u1169\u11AB\u1110\u1169\u11B8", - "\u1109\u1169\u11AB\u1112\u1162", - "\u1109\u1169\u11AF\u110C\u1175\u11A8\u1112\u1175", - "\u1109\u1169\u11B7\u110A\u1175", - "\u1109\u1169\u11BC\u110B\u1161\u110C\u1175", - "\u1109\u1169\u11BC\u110B\u1175", - "\u1109\u1169\u11BC\u1111\u1167\u11AB", - "\u1109\u116C\u1100\u1169\u1100\u1175", - "\u1109\u116D\u1111\u1175\u11BC", - "\u1109\u116E\u1100\u1165\u11AB", - "\u1109\u116E\u1102\u1167\u11AB", - "\u1109\u116E\u1103\u1161\u11AB", - "\u1109\u116E\u1103\u1169\u11BA\u1106\u116E\u11AF", - "\u1109\u116E\u1103\u1169\u11BC\u110C\u1165\u11A8", - "\u1109\u116E\u1106\u1167\u11AB", - "\u1109\u116E\u1106\u1167\u11BC", - "\u1109\u116E\u1107\u1161\u11A8", - "\u1109\u116E\u1109\u1161\u11BC", - "\u1109\u116E\u1109\u1165\u11A8", - "\u1109\u116E\u1109\u116E\u11AF", - "\u1109\u116E\u1109\u1175\u1105\u1169", - "\u1109\u116E\u110B\u1165\u11B8", - "\u1109\u116E\u110B\u1167\u11B7", - "\u1109\u116E\u110B\u1167\u11BC", - "\u1109\u116E\u110B\u1175\u11B8", - "\u1109\u116E\u110C\u116E\u11AB", - "\u1109\u116E\u110C\u1175\u11B8", - "\u1109\u116E\u110E\u116E\u11AF", - "\u1109\u116E\u110F\u1165\u11BA", - "\u1109\u116E\u1111\u1175\u11AF", - "\u1109\u116E\u1112\u1161\u11A8", - "\u1109\u116E\u1112\u1165\u11B7\u1109\u1162\u11BC", - "\u1109\u116E\u1112\u116A\u1100\u1175", - "\u1109\u116E\u11A8\u1102\u1167", - "\u1109\u116E\u11A8\u1109\u1169", - "\u1109\u116E\u11A8\u110C\u1166", - "\u1109\u116E\u11AB\u1100\u1161\u11AB", - "\u1109\u116E\u11AB\u1109\u1165", - "\u1109\u116E\u11AB\u1109\u116E", - "\u1109\u116E\u11AB\u1109\u1175\u11A8\u1100\u1161\u11AB", - "\u1109\u116E\u11AB\u110B\u1171", - "\u1109\u116E\u11AE\u1100\u1161\u1105\u1161\u11A8", - "\u1109\u116E\u11AF\u1107\u1167\u11BC", - "\u1109\u116E\u11AF\u110C\u1175\u11B8", - "\u1109\u116E\u11BA\u110C\u1161", - "\u1109\u1173\u1102\u1175\u11B7", - "\u1109\u1173\u1106\u116E\u11AF", - "\u1109\u1173\u1109\u1173\u1105\u1169", - "\u1109\u1173\u1109\u1173\u11BC", - "\u1109\u1173\u110B\u1170\u1110\u1165", - "\u1109\u1173\u110B\u1171\u110E\u1175", - "\u1109\u1173\u110F\u1166\u110B\u1175\u1110\u1173", - "\u1109\u1173\u1110\u1172\u1103\u1175\u110B\u1169", - "\u1109\u1173\u1110\u1173\u1105\u1166\u1109\u1173", - "\u1109\u1173\u1111\u1169\u110E\u1173", - "\u1109\u1173\u11AF\u110D\u1165\u11A8", - "\u1109\u1173\u11AF\u1111\u1173\u11B7", - "\u1109\u1173\u11B8\u1100\u116A\u11AB", - "\u1109\u1173\u11B8\u1100\u1175", - "\u1109\u1173\u11BC\u1100\u1162\u11A8", - "\u1109\u1173\u11BC\u1105\u1175", - "\u1109\u1173\u11BC\u1107\u116E", - "\u1109\u1173\u11BC\u110B\u116D\u11BC\u110E\u1161", - "\u1109\u1173\u11BC\u110C\u1175\u11AB", - "\u1109\u1175\u1100\u1161\u11A8", - "\u1109\u1175\u1100\u1161\u11AB", - "\u1109\u1175\u1100\u1169\u11AF", - "\u1109\u1175\u1100\u1173\u11B7\u110E\u1175", - "\u1109\u1175\u1102\u1161\u1105\u1175\u110B\u1169", - "\u1109\u1175\u1103\u1162\u11A8", - "\u1109\u1175\u1105\u1175\u110C\u1173", - "\u1109\u1175\u1106\u1166\u11AB\u1110\u1173", - "\u1109\u1175\u1106\u1175\u11AB", - "\u1109\u1175\u1107\u116E\u1106\u1169", - "\u1109\u1175\u1109\u1165\u11AB", - "\u1109\u1175\u1109\u1165\u11AF", - "\u1109\u1175\u1109\u1173\u1110\u1166\u11B7", - "\u1109\u1175\u110B\u1161\u1107\u1165\u110C\u1175", - "\u1109\u1175\u110B\u1165\u1106\u1165\u1102\u1175", - "\u1109\u1175\u110B\u116F\u11AF", - "\u1109\u1175\u110B\u1175\u11AB", - "\u1109\u1175\u110B\u1175\u11AF", - "\u1109\u1175\u110C\u1161\u11A8", - "\u1109\u1175\u110C\u1161\u11BC", - "\u1109\u1175\u110C\u1165\u11AF", - "\u1109\u1175\u110C\u1165\u11B7", - "\u1109\u1175\u110C\u116E\u11BC", - "\u1109\u1175\u110C\u1173\u11AB", - "\u1109\u1175\u110C\u1175\u11B8", - "\u1109\u1175\u110E\u1165\u11BC", - "\u1109\u1175\u1112\u1161\u11B8", - "\u1109\u1175\u1112\u1165\u11B7", - "\u1109\u1175\u11A8\u1100\u116E", - "\u1109\u1175\u11A8\u1100\u1175", - "\u1109\u1175\u11A8\u1103\u1161\u11BC", - "\u1109\u1175\u11A8\u1105\u1163\u11BC", - "\u1109\u1175\u11A8\u1105\u116D\u1111\u116E\u11B7", - "\u1109\u1175\u11A8\u1106\u116E\u11AF", - "\u1109\u1175\u11A8\u1108\u1161\u11BC", - "\u1109\u1175\u11A8\u1109\u1161", - "\u1109\u1175\u11A8\u1109\u1162\u11BC\u1112\u116A\u11AF", - "\u1109\u1175\u11A8\u110E\u1169", - "\u1109\u1175\u11A8\u1110\u1161\u11A8", - "\u1109\u1175\u11A8\u1111\u116E\u11B7", - "\u1109\u1175\u11AB\u1100\u1169", - "\u1109\u1175\u11AB\u1100\u1172", - "\u1109\u1175\u11AB\u1102\u1167\u11B7", - "\u1109\u1175\u11AB\u1106\u116E\u11AB", - "\u1109\u1175\u11AB\u1107\u1161\u11AF", - "\u1109\u1175\u11AB\u1107\u1175", - "\u1109\u1175\u11AB\u1109\u1161", - "\u1109\u1175\u11AB\u1109\u1166", - "\u1109\u1175\u11AB\u110B\u116D\u11BC", - "\u1109\u1175\u11AB\u110C\u1166\u1111\u116E\u11B7", - "\u1109\u1175\u11AB\u110E\u1165\u11BC", - "\u1109\u1175\u11AB\u110E\u1166", - "\u1109\u1175\u11AB\u1112\u116A", - "\u1109\u1175\u11AF\u1100\u1161\u11B7", - "\u1109\u1175\u11AF\u1102\u1162", - "\u1109\u1175\u11AF\u1105\u1167\u11A8", - "\u1109\u1175\u11AF\u1105\u1168", - "\u1109\u1175\u11AF\u1106\u1161\u11BC", - "\u1109\u1175\u11AF\u1109\u116E", - "\u1109\u1175\u11AF\u1109\u1173\u11B8", - "\u1109\u1175\u11AF\u1109\u1175", - "\u1109\u1175\u11AF\u110C\u1161\u11BC", - "\u1109\u1175\u11AF\u110C\u1165\u11BC", - "\u1109\u1175\u11AF\u110C\u1175\u11AF\u110C\u1165\u11A8", - "\u1109\u1175\u11AF\u110E\u1165\u11AB", - "\u1109\u1175\u11AF\u110E\u1166", - "\u1109\u1175\u11AF\u110F\u1165\u11BA", - "\u1109\u1175\u11AF\u1110\u1162", - "\u1109\u1175\u11AF\u1111\u1162", - "\u1109\u1175\u11AF\u1112\u1165\u11B7", - "\u1109\u1175\u11AF\u1112\u1167\u11AB", - "\u1109\u1175\u11B7\u1105\u1175", - "\u1109\u1175\u11B7\u1107\u116E\u1105\u1173\u11B7", - "\u1109\u1175\u11B7\u1109\u1161", - "\u1109\u1175\u11B7\u110C\u1161\u11BC", - "\u1109\u1175\u11B7\u110C\u1165\u11BC", - "\u1109\u1175\u11B7\u1111\u1161\u11AB", - "\u110A\u1161\u11BC\u1103\u116E\u11BC\u110B\u1175", - "\u110A\u1175\u1105\u1173\u11B7", - "\u110A\u1175\u110B\u1161\u11BA", - "\u110B\u1161\u1100\u1161\u110A\u1175", - "\u110B\u1161\u1102\u1161\u110B\u116E\u11AB\u1109\u1165", - "\u110B\u1161\u1103\u1173\u1102\u1175\u11B7", - "\u110B\u1161\u1103\u1173\u11AF", - "\u110B\u1161\u1109\u1171\u110B\u116E\u11B7", - "\u110B\u1161\u1109\u1173\u1111\u1161\u11AF\u1110\u1173", - "\u110B\u1161\u1109\u1175\u110B\u1161", - "\u110B\u1161\u110B\u116E\u11AF\u1105\u1165", - "\u110B\u1161\u110C\u1165\u110A\u1175", - "\u110B\u1161\u110C\u116E\u11B7\u1106\u1161", - "\u110B\u1161\u110C\u1175\u11A8", - "\u110B\u1161\u110E\u1175\u11B7", - "\u110B\u1161\u1111\u1161\u1110\u1173", - "\u110B\u1161\u1111\u1173\u1105\u1175\u110F\u1161", - "\u110B\u1161\u1111\u1173\u11B7", - "\u110B\u1161\u1112\u1169\u11B8", - "\u110B\u1161\u1112\u1173\u11AB", - "\u110B\u1161\u11A8\u1100\u1175", - "\u110B\u1161\u11A8\u1106\u1169\u11BC", - "\u110B\u1161\u11A8\u1109\u116E", - "\u110B\u1161\u11AB\u1100\u1162", - "\u110B\u1161\u11AB\u1100\u1167\u11BC", - "\u110B\u1161\u11AB\u1100\u116A", - "\u110B\u1161\u11AB\u1102\u1162", - "\u110B\u1161\u11AB\u1102\u1167\u11BC", - "\u110B\u1161\u11AB\u1103\u1169\u11BC", - "\u110B\u1161\u11AB\u1107\u1161\u11BC", - "\u110B\u1161\u11AB\u1107\u116E", - "\u110B\u1161\u11AB\u110C\u116E", - "\u110B\u1161\u11AF\u1105\u116E\u1106\u1175\u1102\u1172\u11B7", - "\u110B\u1161\u11AF\u110F\u1169\u110B\u1169\u11AF", - "\u110B\u1161\u11B7\u1109\u1175", - "\u110B\u1161\u11B7\u110F\u1165\u11BA", - "\u110B\u1161\u11B8\u1105\u1167\u11A8", - "\u110B\u1161\u11C1\u1102\u1161\u11AF", - "\u110B\u1161\u11C1\u1106\u116E\u11AB", - "\u110B\u1162\u110B\u1175\u11AB", - "\u110B\u1162\u110C\u1165\u11BC", - "\u110B\u1162\u11A8\u1109\u116E", - "\u110B\u1162\u11AF\u1107\u1165\u11B7", - "\u110B\u1163\u1100\u1161\u11AB", - "\u110B\u1163\u1103\u1161\u11AB", - "\u110B\u1163\u110B\u1169\u11BC", - "\u110B\u1163\u11A8\u1100\u1161\u11AB", - "\u110B\u1163\u11A8\u1100\u116E\u11A8", - "\u110B\u1163\u11A8\u1109\u1169\u11A8", - "\u110B\u1163\u11A8\u1109\u116E", - "\u110B\u1163\u11A8\u110C\u1165\u11B7", - "\u110B\u1163\u11A8\u1111\u116E\u11B7", - "\u110B\u1163\u11A8\u1112\u1169\u11AB\u1102\u1167", - "\u110B\u1163\u11BC\u1102\u1167\u11B7", - "\u110B\u1163\u11BC\u1105\u1167\u11A8", - "\u110B\u1163\u11BC\u1106\u1161\u11AF", - "\u110B\u1163\u11BC\u1107\u1162\u110E\u116E", - "\u110B\u1163\u11BC\u110C\u116E", - "\u110B\u1163\u11BC\u1111\u1161", - "\u110B\u1165\u1103\u116E\u11B7", - "\u110B\u1165\u1105\u1167\u110B\u116E\u11B7", - "\u110B\u1165\u1105\u1173\u11AB", - "\u110B\u1165\u110C\u1166\u11BA\u1107\u1161\u11B7", - "\u110B\u1165\u110D\u1162\u11BB\u1103\u1173\u11AB", - "\u110B\u1165\u110D\u1165\u1103\u1161\u1100\u1161", - "\u110B\u1165\u110D\u1165\u11AB\u110C\u1175", - "\u110B\u1165\u11AB\u1102\u1175", - "\u110B\u1165\u11AB\u1103\u1165\u11A8", - "\u110B\u1165\u11AB\u1105\u1169\u11AB", - "\u110B\u1165\u11AB\u110B\u1165", - "\u110B\u1165\u11AF\u1100\u116E\u11AF", - "\u110B\u1165\u11AF\u1105\u1173\u11AB", - "\u110B\u1165\u11AF\u110B\u1173\u11B7", - "\u110B\u1165\u11AF\u1111\u1175\u11BA", - "\u110B\u1165\u11B7\u1106\u1161", - "\u110B\u1165\u11B8\u1106\u116E", - "\u110B\u1165\u11B8\u110C\u1169\u11BC", - "\u110B\u1165\u11B8\u110E\u1166", - "\u110B\u1165\u11BC\u1103\u1165\u11BC\u110B\u1175", - "\u110B\u1165\u11BC\u1106\u1161\u11BC", - "\u110B\u1165\u11BC\u1110\u1165\u1105\u1175", - "\u110B\u1165\u11BD\u1100\u1173\u110C\u1166", - "\u110B\u1166\u1102\u1165\u110C\u1175", - "\u110B\u1166\u110B\u1165\u110F\u1165\u11AB", - "\u110B\u1166\u11AB\u110C\u1175\u11AB", - "\u110B\u1167\u1100\u1165\u11AB", - "\u110B\u1167\u1100\u1169\u1109\u1162\u11BC", - "\u110B\u1167\u1100\u116A\u11AB", - "\u110B\u1167\u1100\u116E\u11AB", - "\u110B\u1167\u1100\u116F\u11AB", - "\u110B\u1167\u1103\u1162\u1109\u1162\u11BC", - "\u110B\u1167\u1103\u1165\u11B2", - "\u110B\u1167\u1103\u1169\u11BC\u1109\u1162\u11BC", - "\u110B\u1167\u1103\u1173\u11AB", - "\u110B\u1167\u1105\u1169\u11AB", - "\u110B\u1167\u1105\u1173\u11B7", - "\u110B\u1167\u1109\u1165\u11BA", - "\u110B\u1167\u1109\u1165\u11BC", - "\u110B\u1167\u110B\u116A\u11BC", - "\u110B\u1167\u110B\u1175\u11AB", - "\u110B\u1167\u110C\u1165\u11AB\u1112\u1175", - "\u110B\u1167\u110C\u1175\u11A8\u110B\u116F\u11AB", - "\u110B\u1167\u1112\u1161\u11A8\u1109\u1162\u11BC", - "\u110B\u1167\u1112\u1162\u11BC", - "\u110B\u1167\u11A8\u1109\u1161", - "\u110B\u1167\u11A8\u1109\u1175", - "\u110B\u1167\u11A8\u1112\u1161\u11AF", - "\u110B\u1167\u11AB\u1100\u1167\u11AF", - "\u110B\u1167\u11AB\u1100\u116E", - "\u110B\u1167\u11AB\u1100\u1173\u11A8", - "\u110B\u1167\u11AB\u1100\u1175", - "\u110B\u1167\u11AB\u1105\u1161\u11A8", - "\u110B\u1167\u11AB\u1109\u1165\u11AF", - "\u110B\u1167\u11AB\u1109\u1166", - "\u110B\u1167\u11AB\u1109\u1169\u11A8", - "\u110B\u1167\u11AB\u1109\u1173\u11B8", - "\u110B\u1167\u11AB\u110B\u1162", - "\u110B\u1167\u11AB\u110B\u1168\u110B\u1175\u11AB", - "\u110B\u1167\u11AB\u110B\u1175\u11AB", - "\u110B\u1167\u11AB\u110C\u1161\u11BC", - "\u110B\u1167\u11AB\u110C\u116E", - "\u110B\u1167\u11AB\u110E\u116E\u11AF", - "\u110B\u1167\u11AB\u1111\u1175\u11AF", - "\u110B\u1167\u11AB\u1112\u1161\u11B8", - "\u110B\u1167\u11AB\u1112\u1172", - "\u110B\u1167\u11AF\u1100\u1175", - "\u110B\u1167\u11AF\u1106\u1162", - "\u110B\u1167\u11AF\u1109\u116C", - "\u110B\u1167\u11AF\u1109\u1175\u11B7\u1112\u1175", - "\u110B\u1167\u11AF\u110C\u1165\u11BC", - "\u110B\u1167\u11AF\u110E\u1161", - "\u110B\u1167\u11AF\u1112\u1173\u11AF", - "\u110B\u1167\u11B7\u1105\u1167", - "\u110B\u1167\u11B8\u1109\u1165", - "\u110B\u1167\u11BC\u1100\u116E\u11A8", - "\u110B\u1167\u11BC\u1102\u1161\u11B7", - "\u110B\u1167\u11BC\u1109\u1161\u11BC", - "\u110B\u1167\u11BC\u110B\u1163\u11BC", - "\u110B\u1167\u11BC\u110B\u1167\u11A8", - "\u110B\u1167\u11BC\u110B\u116E\u11BC", - "\u110B\u1167\u11BC\u110B\u116F\u11AB\u1112\u1175", - "\u110B\u1167\u11BC\u1112\u1161", - "\u110B\u1167\u11BC\u1112\u1163\u11BC", - "\u110B\u1167\u11BC\u1112\u1169\u11AB", - "\u110B\u1167\u11BC\u1112\u116A", - "\u110B\u1167\u11C1\u1100\u116E\u1105\u1175", - "\u110B\u1167\u11C1\u1107\u1161\u11BC", - "\u110B\u1167\u11C1\u110C\u1175\u11B8", - "\u110B\u1168\u1100\u1161\u11B7", - "\u110B\u1168\u1100\u1173\u11B7", - "\u110B\u1168\u1107\u1161\u11BC", - "\u110B\u1168\u1109\u1161\u11AB", - "\u110B\u1168\u1109\u1161\u11BC", - "\u110B\u1168\u1109\u1165\u11AB", - "\u110B\u1168\u1109\u116E\u11AF", - "\u110B\u1168\u1109\u1173\u11B8", - "\u110B\u1168\u1109\u1175\u11A8\u110C\u1161\u11BC", - "\u110B\u1168\u110B\u1163\u11A8", - "\u110B\u1168\u110C\u1165\u11AB", - "\u110B\u1168\u110C\u1165\u11AF", - "\u110B\u1168\u110C\u1165\u11BC", - "\u110B\u1168\u110F\u1165\u11AB\u1103\u1162", - "\u110B\u1168\u11BA\u1102\u1161\u11AF", - "\u110B\u1169\u1102\u1173\u11AF", - "\u110B\u1169\u1105\u1161\u11A8", - "\u110B\u1169\u1105\u1162\u11BA\u1103\u1169\u11BC\u110B\u1161\u11AB", - "\u110B\u1169\u1105\u1166\u11AB\u110C\u1175", - "\u110B\u1169\u1105\u1169\u110C\u1175", - "\u110B\u1169\u1105\u1173\u11AB\u1107\u1161\u11AF", - "\u110B\u1169\u1107\u1173\u11AB", - "\u110B\u1169\u1109\u1175\u11B8", - "\u110B\u1169\u110B\u1167\u11B7", - "\u110B\u1169\u110B\u116F\u11AF", - "\u110B\u1169\u110C\u1165\u11AB", - "\u110B\u1169\u110C\u1175\u11A8", - "\u110B\u1169\u110C\u1175\u11BC\u110B\u1165", - "\u110B\u1169\u1111\u1166\u1105\u1161", - "\u110B\u1169\u1111\u1175\u1109\u1173\u1110\u1166\u11AF", - "\u110B\u1169\u1112\u1175\u1105\u1167", - "\u110B\u1169\u11A8\u1109\u1161\u11BC", - "\u110B\u1169\u11A8\u1109\u116E\u1109\u116E", - "\u110B\u1169\u11AB\u1100\u1161\u11BD", - "\u110B\u1169\u11AB\u1105\u1161\u110B\u1175\u11AB", - "\u110B\u1169\u11AB\u1106\u1169\u11B7", - "\u110B\u1169\u11AB\u110C\u1169\u11BC\u110B\u1175\u11AF", - "\u110B\u1169\u11AB\u1110\u1169\u11BC", - "\u110B\u1169\u11AF\u1100\u1161\u110B\u1173\u11AF", - "\u110B\u1169\u11AF\u1105\u1175\u11B7\u1111\u1175\u11A8", - "\u110B\u1169\u11AF\u1112\u1162", - "\u110B\u1169\u11BA\u110E\u1161\u1105\u1175\u11B7", - "\u110B\u116A\u110B\u1175\u1109\u1167\u110E\u1173", - "\u110B\u116A\u110B\u1175\u11AB", - "\u110B\u116A\u11AB\u1109\u1165\u11BC", - "\u110B\u116A\u11AB\u110C\u1165\u11AB", - "\u110B\u116A\u11BC\u1107\u1175", - "\u110B\u116A\u11BC\u110C\u1161", - "\u110B\u116B\u1102\u1163\u1112\u1161\u1106\u1167\u11AB", - "\u110B\u116B\u11AB\u110C\u1175", - "\u110B\u116C\u1100\u1161\u11BA\u110C\u1175\u11B8", - "\u110B\u116C\u1100\u116E\u11A8", - "\u110B\u116C\u1105\u1169\u110B\u116E\u11B7", - "\u110B\u116C\u1109\u1161\u11B7\u110E\u1169\u11AB", - "\u110B\u116C\u110E\u116E\u11AF", - "\u110B\u116C\u110E\u1175\u11B7", - "\u110B\u116C\u1112\u1161\u11AF\u1106\u1165\u1102\u1175", - "\u110B\u116C\u11AB\u1107\u1161\u11AF", - "\u110B\u116C\u11AB\u1109\u1169\u11AB", - "\u110B\u116C\u11AB\u110D\u1169\u11A8", - "\u110B\u116D\u1100\u1173\u11B7", - "\u110B\u116D\u110B\u1175\u11AF", - "\u110B\u116D\u110C\u1173\u11B7", - "\u110B\u116D\u110E\u1165\u11BC", - "\u110B\u116D\u11BC\u1100\u1175", - "\u110B\u116D\u11BC\u1109\u1165", - "\u110B\u116D\u11BC\u110B\u1165", - "\u110B\u116E\u1109\u1161\u11AB", - "\u110B\u116E\u1109\u1165\u11AB", - "\u110B\u116E\u1109\u1173\u11BC", - "\u110B\u116E\u110B\u1167\u11AB\u1112\u1175", - "\u110B\u116E\u110C\u1165\u11BC", - "\u110B\u116E\u110E\u1166\u1100\u116E\u11A8", - "\u110B\u116E\u1111\u1167\u11AB", - "\u110B\u116E\u11AB\u1103\u1169\u11BC", - "\u110B\u116E\u11AB\u1106\u1167\u11BC", - "\u110B\u116E\u11AB\u1107\u1161\u11AB", - "\u110B\u116E\u11AB\u110C\u1165\u11AB", - "\u110B\u116E\u11AB\u1112\u1162\u11BC", - "\u110B\u116E\u11AF\u1109\u1161\u11AB", - "\u110B\u116E\u11AF\u110B\u1173\u11B7", - "\u110B\u116E\u11B7\u110C\u1175\u11A8\u110B\u1175\u11B7", - "\u110B\u116E\u11BA\u110B\u1165\u1105\u1173\u11AB", - "\u110B\u116E\u11BA\u110B\u1173\u11B7", - "\u110B\u116F\u1102\u1161\u11A8", - "\u110B\u116F\u11AB\u1100\u1169", - "\u110B\u116F\u11AB\u1105\u1162", - "\u110B\u116F\u11AB\u1109\u1165", - "\u110B\u116F\u11AB\u1109\u116E\u11BC\u110B\u1175", - "\u110B\u116F\u11AB\u110B\u1175\u11AB", - "\u110B\u116F\u11AB\u110C\u1161\u11BC", - "\u110B\u116F\u11AB\u1111\u1175\u1109\u1173", - "\u110B\u116F\u11AF\u1100\u1173\u11B8", - "\u110B\u116F\u11AF\u1103\u1173\u110F\u1165\u11B8", - "\u110B\u116F\u11AF\u1109\u1166", - "\u110B\u116F\u11AF\u110B\u116D\u110B\u1175\u11AF", - "\u110B\u1170\u110B\u1175\u1110\u1165", - "\u110B\u1171\u1107\u1161\u11AB", - "\u110B\u1171\u1107\u1165\u11B8", - "\u110B\u1171\u1109\u1165\u11BC", - "\u110B\u1171\u110B\u116F\u11AB", - "\u110B\u1171\u1112\u1165\u11B7", - "\u110B\u1171\u1112\u1167\u11B8", - "\u110B\u1171\u11BA\u1109\u1161\u1105\u1161\u11B7", - "\u110B\u1172\u1102\u1161\u11AB\u1112\u1175", - "\u110B\u1172\u1105\u1165\u11B8", - "\u110B\u1172\u1106\u1167\u11BC", - "\u110B\u1172\u1106\u116E\u11AF", - "\u110B\u1172\u1109\u1161\u11AB", - "\u110B\u1172\u110C\u1165\u11A8", - "\u110B\u1172\u110E\u1175\u110B\u116F\u11AB", - "\u110B\u1172\u1112\u1161\u11A8", - "\u110B\u1172\u1112\u1162\u11BC", - "\u110B\u1172\u1112\u1167\u11BC", - "\u110B\u1172\u11A8\u1100\u116E\u11AB", - "\u110B\u1172\u11A8\u1109\u1161\u11BC", - "\u110B\u1172\u11A8\u1109\u1175\u11B8", - "\u110B\u1172\u11A8\u110E\u1166", - "\u110B\u1173\u11AB\u1112\u1162\u11BC", - "\u110B\u1173\u11B7\u1105\u1167\u11A8", - "\u110B\u1173\u11B7\u1105\u116D", - "\u110B\u1173\u11B7\u1107\u1161\u11AB", - "\u110B\u1173\u11B7\u1109\u1165\u11BC", - "\u110B\u1173\u11B7\u1109\u1175\u11A8", - "\u110B\u1173\u11B7\u110B\u1161\u11A8", - "\u110B\u1173\u11B7\u110C\u116E", - "\u110B\u1174\u1100\u1167\u11AB", - "\u110B\u1174\u1102\u1169\u11AB", - "\u110B\u1174\u1106\u116E\u11AB", - "\u110B\u1174\u1107\u1169\u11A8", - "\u110B\u1174\u1109\u1175\u11A8", - "\u110B\u1174\u1109\u1175\u11B7", - "\u110B\u1174\u110B\u116C\u1105\u1169", - "\u110B\u1174\u110B\u116D\u11A8", - "\u110B\u1174\u110B\u116F\u11AB", - "\u110B\u1174\u1112\u1161\u11A8", - "\u110B\u1175\u1100\u1165\u11BA", - "\u110B\u1175\u1100\u1169\u11BA", - "\u110B\u1175\u1102\u1167\u11B7", - "\u110B\u1175\u1102\u1169\u11B7", - "\u110B\u1175\u1103\u1161\u11AF", - "\u110B\u1175\u1103\u1162\u1105\u1169", - "\u110B\u1175\u1103\u1169\u11BC", - "\u110B\u1175\u1105\u1165\u11C2\u1100\u1166", - "\u110B\u1175\u1105\u1167\u11A8\u1109\u1165", - "\u110B\u1175\u1105\u1169\u11AB\u110C\u1165\u11A8", - "\u110B\u1175\u1105\u1173\u11B7", - "\u110B\u1175\u1106\u1175\u11AB", - "\u110B\u1175\u1107\u1161\u11AF\u1109\u1169", - "\u110B\u1175\u1107\u1167\u11AF", - "\u110B\u1175\u1107\u116E\u11AF", - "\u110B\u1175\u1108\u1161\u11AF", - "\u110B\u1175\u1109\u1161\u11BC", - "\u110B\u1175\u1109\u1165\u11BC", - "\u110B\u1175\u1109\u1173\u11AF", - "\u110B\u1175\u110B\u1163\u1100\u1175", - "\u110B\u1175\u110B\u116D\u11BC", - "\u110B\u1175\u110B\u116E\u11BA", - "\u110B\u1175\u110B\u116F\u11AF", - "\u110B\u1175\u110B\u1173\u11A8\u1100\u1169", - "\u110B\u1175\u110B\u1175\u11A8", - "\u110B\u1175\u110C\u1165\u11AB", - "\u110B\u1175\u110C\u116E\u11BC", - "\u110B\u1175\u1110\u1173\u11AE\u1102\u1161\u11AF", - "\u110B\u1175\u1110\u1173\u11AF", - "\u110B\u1175\u1112\u1169\u11AB", - "\u110B\u1175\u11AB\u1100\u1161\u11AB", - "\u110B\u1175\u11AB\u1100\u1167\u11A8", - "\u110B\u1175\u11AB\u1100\u1169\u11BC", - "\u110B\u1175\u11AB\u1100\u116E", - "\u110B\u1175\u11AB\u1100\u1173\u11AB", - "\u110B\u1175\u11AB\u1100\u1175", - "\u110B\u1175\u11AB\u1103\u1169", - "\u110B\u1175\u11AB\u1105\u1172", - "\u110B\u1175\u11AB\u1106\u116E\u11AF", - "\u110B\u1175\u11AB\u1109\u1162\u11BC", - "\u110B\u1175\u11AB\u1109\u116B", - "\u110B\u1175\u11AB\u110B\u1167\u11AB", - "\u110B\u1175\u11AB\u110B\u116F\u11AB", - "\u110B\u1175\u11AB\u110C\u1162", - "\u110B\u1175\u11AB\u110C\u1169\u11BC", - "\u110B\u1175\u11AB\u110E\u1165\u11AB", - "\u110B\u1175\u11AB\u110E\u1166", - "\u110B\u1175\u11AB\u1110\u1165\u1102\u1166\u11BA", - "\u110B\u1175\u11AB\u1112\u1161", - "\u110B\u1175\u11AB\u1112\u1167\u11BC", - "\u110B\u1175\u11AF\u1100\u1169\u11B8", - "\u110B\u1175\u11AF\u1100\u1175", - "\u110B\u1175\u11AF\u1103\u1161\u11AB", - "\u110B\u1175\u11AF\u1103\u1162", - "\u110B\u1175\u11AF\u1103\u1173\u11BC", - "\u110B\u1175\u11AF\u1107\u1161\u11AB", - "\u110B\u1175\u11AF\u1107\u1169\u11AB", - "\u110B\u1175\u11AF\u1107\u116E", - "\u110B\u1175\u11AF\u1109\u1161\u11BC", - "\u110B\u1175\u11AF\u1109\u1162\u11BC", - "\u110B\u1175\u11AF\u1109\u1169\u11AB", - "\u110B\u1175\u11AF\u110B\u116D\u110B\u1175\u11AF", - "\u110B\u1175\u11AF\u110B\u116F\u11AF", - "\u110B\u1175\u11AF\u110C\u1165\u11BC", - "\u110B\u1175\u11AF\u110C\u1169\u11BC", - "\u110B\u1175\u11AF\u110C\u116E\u110B\u1175\u11AF", - "\u110B\u1175\u11AF\u110D\u1175\u11A8", - "\u110B\u1175\u11AF\u110E\u1166", - "\u110B\u1175\u11AF\u110E\u1175", - "\u110B\u1175\u11AF\u1112\u1162\u11BC", - "\u110B\u1175\u11AF\u1112\u116C\u110B\u116D\u11BC", - "\u110B\u1175\u11B7\u1100\u1173\u11B7", - "\u110B\u1175\u11B7\u1106\u116E", - "\u110B\u1175\u11B8\u1103\u1162", - "\u110B\u1175\u11B8\u1105\u1167\u11A8", - "\u110B\u1175\u11B8\u1106\u1161\u11BA", - "\u110B\u1175\u11B8\u1109\u1161", - "\u110B\u1175\u11B8\u1109\u116E\u11AF", - "\u110B\u1175\u11B8\u1109\u1175", - "\u110B\u1175\u11B8\u110B\u116F\u11AB", - "\u110B\u1175\u11B8\u110C\u1161\u11BC", - "\u110B\u1175\u11B8\u1112\u1161\u11A8", - "\u110C\u1161\u1100\u1161\u110B\u116D\u11BC", - "\u110C\u1161\u1100\u1167\u11A8", - "\u110C\u1161\u1100\u1173\u11A8", - "\u110C\u1161\u1103\u1169\u11BC", - "\u110C\u1161\u1105\u1161\u11BC", - "\u110C\u1161\u1107\u116E\u1109\u1175\u11B7", - "\u110C\u1161\u1109\u1175\u11A8", - "\u110C\u1161\u1109\u1175\u11AB", - "\u110C\u1161\u110B\u1167\u11AB", - "\u110C\u1161\u110B\u116F\u11AB", - "\u110C\u1161\u110B\u1172\u11AF", - "\u110C\u1161\u110C\u1165\u11AB\u1100\u1165", - "\u110C\u1161\u110C\u1165\u11BC", - "\u110C\u1161\u110C\u1169\u11AB\u1109\u1175\u11B7", - "\u110C\u1161\u1111\u1161\u11AB", - "\u110C\u1161\u11A8\u1100\u1161", - "\u110C\u1161\u11A8\u1102\u1167\u11AB", - "\u110C\u1161\u11A8\u1109\u1165\u11BC", - "\u110C\u1161\u11A8\u110B\u1165\u11B8", - "\u110C\u1161\u11A8\u110B\u116D\u11BC", - "\u110C\u1161\u11A8\u110B\u1173\u11AB\u1104\u1161\u11AF", - "\u110C\u1161\u11A8\u1111\u116E\u11B7", - "\u110C\u1161\u11AB\u1103\u1175", - "\u110C\u1161\u11AB\u1104\u1173\u11A8", - "\u110C\u1161\u11AB\u110E\u1175", - "\u110C\u1161\u11AF\u1106\u1169\u11BA", - "\u110C\u1161\u11B7\u1101\u1161\u11AB", - "\u110C\u1161\u11B7\u1109\u116E\u1112\u1161\u11B7", - "\u110C\u1161\u11B7\u1109\u1175", - "\u110C\u1161\u11B7\u110B\u1169\u11BA", - "\u110C\u1161\u11B7\u110C\u1161\u1105\u1175", - "\u110C\u1161\u11B8\u110C\u1175", - "\u110C\u1161\u11BC\u1100\u116A\u11AB", - "\u110C\u1161\u11BC\u1100\u116E\u11AB", - "\u110C\u1161\u11BC\u1100\u1175\u1100\u1161\u11AB", - "\u110C\u1161\u11BC\u1105\u1162", - "\u110C\u1161\u11BC\u1105\u1168", - "\u110C\u1161\u11BC\u1105\u1173", - "\u110C\u1161\u11BC\u1106\u1161", - "\u110C\u1161\u11BC\u1106\u1167\u11AB", - "\u110C\u1161\u11BC\u1106\u1169", - "\u110C\u1161\u11BC\u1106\u1175", - "\u110C\u1161\u11BC\u1107\u1175", - "\u110C\u1161\u11BC\u1109\u1161", - "\u110C\u1161\u11BC\u1109\u1169", - "\u110C\u1161\u11BC\u1109\u1175\u11A8", - "\u110C\u1161\u11BC\u110B\u1162\u110B\u1175\u11AB", - "\u110C\u1161\u11BC\u110B\u1175\u11AB", - "\u110C\u1161\u11BC\u110C\u1165\u11B7", - "\u110C\u1161\u11BC\u110E\u1161", - "\u110C\u1161\u11BC\u1112\u1161\u11A8\u1100\u1173\u11B7", - "\u110C\u1162\u1102\u1173\u11BC", - "\u110C\u1162\u1108\u1161\u11AF\u1105\u1175", - "\u110C\u1162\u1109\u1161\u11AB", - "\u110C\u1162\u1109\u1162\u11BC", - "\u110C\u1162\u110C\u1161\u11A8\u1102\u1167\u11AB", - "\u110C\u1162\u110C\u1165\u11BC", - "\u110C\u1162\u110E\u1162\u1100\u1175", - "\u110C\u1162\u1111\u1161\u11AB", - "\u110C\u1162\u1112\u1161\u11A8", - "\u110C\u1162\u1112\u116A\u11AF\u110B\u116D\u11BC", - "\u110C\u1165\u1100\u1165\u11BA", - "\u110C\u1165\u1100\u1169\u1105\u1175", - "\u110C\u1165\u1100\u1169\u11BA", - "\u110C\u1165\u1102\u1167\u11A8", - "\u110C\u1165\u1105\u1165\u11AB", - "\u110C\u1165\u1105\u1165\u11C2\u1100\u1166", - "\u110C\u1165\u1107\u1165\u11AB", - "\u110C\u1165\u110B\u116E\u11AF", - "\u110C\u1165\u110C\u1165\u11AF\u1105\u1169", - "\u110C\u1165\u110E\u116E\u11A8", - "\u110C\u1165\u11A8\u1100\u1173\u11A8", - "\u110C\u1165\u11A8\u1103\u1161\u11BC\u1112\u1175", - "\u110C\u1165\u11A8\u1109\u1165\u11BC", - "\u110C\u1165\u11A8\u110B\u116D\u11BC", - "\u110C\u1165\u11A8\u110B\u1173\u11BC", - "\u110C\u1165\u11AB\u1100\u1162", - "\u110C\u1165\u11AB\u1100\u1169\u11BC", - "\u110C\u1165\u11AB\u1100\u1175", - "\u110C\u1165\u11AB\u1103\u1161\u11AF", - "\u110C\u1165\u11AB\u1105\u1161\u1103\u1169", - "\u110C\u1165\u11AB\u1106\u1161\u11BC", - "\u110C\u1165\u11AB\u1106\u116E\u11AB", - "\u110C\u1165\u11AB\u1107\u1161\u11AB", - "\u110C\u1165\u11AB\u1107\u116E", - "\u110C\u1165\u11AB\u1109\u1166", - "\u110C\u1165\u11AB\u1109\u1175", - "\u110C\u1165\u11AB\u110B\u116D\u11BC", - "\u110C\u1165\u11AB\u110C\u1161", - "\u110C\u1165\u11AB\u110C\u1162\u11BC", - "\u110C\u1165\u11AB\u110C\u116E", - "\u110C\u1165\u11AB\u110E\u1165\u11AF", - "\u110C\u1165\u11AB\u110E\u1166", - "\u110C\u1165\u11AB\u1110\u1169\u11BC", - "\u110C\u1165\u11AB\u1112\u1167", - "\u110C\u1165\u11AB\u1112\u116E", - "\u110C\u1165\u11AF\u1103\u1162", - "\u110C\u1165\u11AF\u1106\u1161\u11BC", - "\u110C\u1165\u11AF\u1107\u1161\u11AB", - "\u110C\u1165\u11AF\u110B\u1163\u11A8", - "\u110C\u1165\u11AF\u110E\u1161", - "\u110C\u1165\u11B7\u1100\u1165\u11B7", - "\u110C\u1165\u11B7\u1109\u116E", - "\u110C\u1165\u11B7\u1109\u1175\u11B7", - "\u110C\u1165\u11B7\u110B\u116F\u11AB", - "\u110C\u1165\u11B7\u110C\u1165\u11B7", - "\u110C\u1165\u11B7\u110E\u1161", - "\u110C\u1165\u11B8\u1100\u1173\u11AB", - "\u110C\u1165\u11B8\u1109\u1175", - "\u110C\u1165\u11B8\u110E\u1169\u11A8", - "\u110C\u1165\u11BA\u1100\u1161\u1105\u1161\u11A8", - "\u110C\u1165\u11BC\u1100\u1165\u110C\u1161\u11BC", - "\u110C\u1165\u11BC\u1103\u1169", - "\u110C\u1165\u11BC\u1105\u1172\u110C\u1161\u11BC", - "\u110C\u1165\u11BC\u1105\u1175", - "\u110C\u1165\u11BC\u1106\u1161\u11AF", - "\u110C\u1165\u11BC\u1106\u1167\u11AB", - "\u110C\u1165\u11BC\u1106\u116E\u11AB", - "\u110C\u1165\u11BC\u1107\u1161\u11AB\u1103\u1162", - "\u110C\u1165\u11BC\u1107\u1169", - "\u110C\u1165\u11BC\u1107\u116E", - "\u110C\u1165\u11BC\u1107\u1175", - "\u110C\u1165\u11BC\u1109\u1161\u11BC", - "\u110C\u1165\u11BC\u1109\u1165\u11BC", - "\u110C\u1165\u11BC\u110B\u1169", - "\u110C\u1165\u11BC\u110B\u116F\u11AB", - "\u110C\u1165\u11BC\u110C\u1161\u11BC", - "\u110C\u1165\u11BC\u110C\u1175", - "\u110C\u1165\u11BC\u110E\u1175", - "\u110C\u1165\u11BC\u1112\u116A\u11A8\u1112\u1175", - "\u110C\u1166\u1100\u1169\u11BC", - "\u110C\u1166\u1100\u116A\u110C\u1165\u11B7", - "\u110C\u1166\u1103\u1162\u1105\u1169", - "\u110C\u1166\u1106\u1169\u11A8", - "\u110C\u1166\u1107\u1161\u11AF", - "\u110C\u1166\u1107\u1165\u11B8", - "\u110C\u1166\u1109\u1161\u11BA\u1102\u1161\u11AF", - "\u110C\u1166\u110B\u1161\u11AB", - "\u110C\u1166\u110B\u1175\u11AF", - "\u110C\u1166\u110C\u1161\u11A8", - "\u110C\u1166\u110C\u116E\u1103\u1169", - "\u110C\u1166\u110E\u116E\u11AF", - "\u110C\u1166\u1111\u116E\u11B7", - "\u110C\u1166\u1112\u1161\u11AB", - "\u110C\u1169\u1100\u1161\u11A8", - "\u110C\u1169\u1100\u1165\u11AB", - "\u110C\u1169\u1100\u1173\u11B7", - "\u110C\u1169\u1100\u1175\u11BC", - "\u110C\u1169\u1106\u1167\u11BC", - "\u110C\u1169\u1106\u1175\u1105\u116D", - "\u110C\u1169\u1109\u1161\u11BC", - "\u110C\u1169\u1109\u1165\u11AB", - "\u110C\u1169\u110B\u116D\u11BC\u1112\u1175", - "\u110C\u1169\u110C\u1165\u11AF", - "\u110C\u1169\u110C\u1165\u11BC", - "\u110C\u1169\u110C\u1175\u11A8", - "\u110C\u1169\u11AB\u1103\u1162\u11BA\u1106\u1161\u11AF", - "\u110C\u1169\u11AB\u110C\u1162", - "\u110C\u1169\u11AF\u110B\u1165\u11B8", - "\u110C\u1169\u11AF\u110B\u1173\u11B7", - "\u110C\u1169\u11BC\u1100\u116D", - "\u110C\u1169\u11BC\u1105\u1169", - "\u110C\u1169\u11BC\u1105\u1172", - "\u110C\u1169\u11BC\u1109\u1169\u1105\u1175", - "\u110C\u1169\u11BC\u110B\u1165\u11B8\u110B\u116F\u11AB", - "\u110C\u1169\u11BC\u110C\u1169\u11BC", - "\u110C\u1169\u11BC\u1112\u1161\u11B8", - "\u110C\u116A\u1109\u1165\u11A8", - "\u110C\u116C\u110B\u1175\u11AB", - "\u110C\u116E\u1100\u116A\u11AB\u110C\u1165\u11A8", - "\u110C\u116E\u1105\u1173\u11B7", - "\u110C\u116E\u1106\u1161\u11AF", - "\u110C\u116E\u1106\u1165\u1102\u1175", - "\u110C\u116E\u1106\u1165\u11A8", - "\u110C\u116E\u1106\u116E\u11AB", - "\u110C\u116E\u1106\u1175\u11AB", - "\u110C\u116E\u1107\u1161\u11BC", - "\u110C\u116E\u1107\u1167\u11AB", - "\u110C\u116E\u1109\u1175\u11A8", - "\u110C\u116E\u110B\u1175\u11AB", - "\u110C\u116E\u110B\u1175\u11AF", - "\u110C\u116E\u110C\u1161\u11BC", - "\u110C\u116E\u110C\u1165\u11AB\u110C\u1161", - "\u110C\u116E\u1110\u1162\u11A8", - "\u110C\u116E\u11AB\u1107\u1175", - "\u110C\u116E\u11AF\u1100\u1165\u1105\u1175", - "\u110C\u116E\u11AF\u1100\u1175", - "\u110C\u116E\u11AF\u1106\u116E\u1102\u1174", - "\u110C\u116E\u11BC\u1100\u1161\u11AB", - "\u110C\u116E\u11BC\u1100\u1168\u1107\u1161\u11BC\u1109\u1169\u11BC", - "\u110C\u116E\u11BC\u1100\u116E\u11A8", - "\u110C\u116E\u11BC\u1102\u1167\u11AB", - "\u110C\u116E\u11BC\u1103\u1161\u11AB", - "\u110C\u116E\u11BC\u1103\u1169\u11A8", - "\u110C\u116E\u11BC\u1107\u1161\u11AB", - "\u110C\u116E\u11BC\u1107\u116E", - "\u110C\u116E\u11BC\u1109\u1166", - "\u110C\u116E\u11BC\u1109\u1169\u1100\u1175\u110B\u1165\u11B8", - "\u110C\u116E\u11BC\u1109\u116E\u11AB", - "\u110C\u116E\u11BC\u110B\u1161\u11BC", - "\u110C\u116E\u11BC\u110B\u116D", - "\u110C\u116E\u11BC\u1112\u1161\u11A8\u1100\u116D", - "\u110C\u1173\u11A8\u1109\u1165\u11A8", - "\u110C\u1173\u11A8\u1109\u1175", - "\u110C\u1173\u11AF\u1100\u1165\u110B\u116E\u11B7", - "\u110C\u1173\u11BC\u1100\u1161", - "\u110C\u1173\u11BC\u1100\u1165", - "\u110C\u1173\u11BC\u1100\u116F\u11AB", - "\u110C\u1173\u11BC\u1109\u1161\u11BC", - "\u110C\u1173\u11BC\u1109\u1166", - "\u110C\u1175\u1100\u1161\u11A8", - "\u110C\u1175\u1100\u1161\u11B8", - "\u110C\u1175\u1100\u1167\u11BC", - "\u110C\u1175\u1100\u1173\u11A8\u1112\u1175", - "\u110C\u1175\u1100\u1173\u11B7", - "\u110C\u1175\u1100\u1173\u11B8", - "\u110C\u1175\u1102\u1173\u11BC", - "\u110C\u1175\u1105\u1173\u11B7\u1100\u1175\u11AF", - "\u110C\u1175\u1105\u1175\u1109\u1161\u11AB", - "\u110C\u1175\u1107\u1161\u11BC", - "\u110C\u1175\u1107\u116E\u11BC", - "\u110C\u1175\u1109\u1175\u11A8", - "\u110C\u1175\u110B\u1167\u11A8", - "\u110C\u1175\u110B\u116E\u1100\u1162", - "\u110C\u1175\u110B\u116F\u11AB", - "\u110C\u1175\u110C\u1165\u11A8", - "\u110C\u1175\u110C\u1165\u11B7", - "\u110C\u1175\u110C\u1175\u11AB", - "\u110C\u1175\u110E\u116E\u11AF", - "\u110C\u1175\u11A8\u1109\u1165\u11AB", - "\u110C\u1175\u11A8\u110B\u1165\u11B8", - "\u110C\u1175\u11A8\u110B\u116F\u11AB", - "\u110C\u1175\u11A8\u110C\u1161\u11BC", - "\u110C\u1175\u11AB\u1100\u1173\u11B8", - "\u110C\u1175\u11AB\u1103\u1169\u11BC", - "\u110C\u1175\u11AB\u1105\u1169", - "\u110C\u1175\u11AB\u1105\u116D", - "\u110C\u1175\u11AB\u1105\u1175", - "\u110C\u1175\u11AB\u110D\u1161", - "\u110C\u1175\u11AB\u110E\u1161\u11AF", - "\u110C\u1175\u11AB\u110E\u116E\u11AF", - "\u110C\u1175\u11AB\u1110\u1169\u11BC", - "\u110C\u1175\u11AB\u1112\u1162\u11BC", - "\u110C\u1175\u11AF\u1106\u116E\u11AB", - "\u110C\u1175\u11AF\u1107\u1167\u11BC", - "\u110C\u1175\u11AF\u1109\u1165", - "\u110C\u1175\u11B7\u110C\u1161\u11A8", - "\u110C\u1175\u11B8\u1103\u1161\u11AB", - "\u110C\u1175\u11B8\u110B\u1161\u11AB", - "\u110C\u1175\u11B8\u110C\u116E\u11BC", - "\u110D\u1161\u110C\u1173\u11BC", - "\u110D\u1175\u1101\u1165\u1100\u1175", - "\u110E\u1161\u1102\u1161\u11B7", - "\u110E\u1161\u1105\u1161\u1105\u1175", - "\u110E\u1161\u1105\u1163\u11BC", - "\u110E\u1161\u1105\u1175\u11B7", - "\u110E\u1161\u1107\u1167\u11AF", - "\u110E\u1161\u1109\u1165\u11AB", - "\u110E\u1161\u110E\u1173\u11B7", - "\u110E\u1161\u11A8\u1100\u1161\u11A8", - "\u110E\u1161\u11AB\u1106\u116E\u11AF", - "\u110E\u1161\u11AB\u1109\u1165\u11BC", - "\u110E\u1161\u11B7\u1100\u1161", - "\u110E\u1161\u11B7\u1100\u1175\u1105\u1173\u11B7", - "\u110E\u1161\u11B7\u1109\u1162", - "\u110E\u1161\u11B7\u1109\u1165\u11A8", - "\u110E\u1161\u11B7\u110B\u1167", - "\u110E\u1161\u11B7\u110B\u116C", - "\u110E\u1161\u11B7\u110C\u1169", - "\u110E\u1161\u11BA\u110C\u1161\u11AB", - "\u110E\u1161\u11BC\u1100\u1161", - "\u110E\u1161\u11BC\u1100\u1169", - "\u110E\u1161\u11BC\u1100\u116E", - "\u110E\u1161\u11BC\u1106\u116E\u11AB", - "\u110E\u1161\u11BC\u1107\u1161\u11A9", - "\u110E\u1161\u11BC\u110C\u1161\u11A8", - "\u110E\u1161\u11BC\u110C\u1169", - "\u110E\u1162\u1102\u1165\u11AF", - "\u110E\u1162\u110C\u1165\u11B7", - "\u110E\u1162\u11A8\u1100\u1161\u1107\u1161\u11BC", - "\u110E\u1162\u11A8\u1107\u1161\u11BC", - "\u110E\u1162\u11A8\u1109\u1161\u11BC", - "\u110E\u1162\u11A8\u110B\u1175\u11B7", - "\u110E\u1162\u11B7\u1111\u1175\u110B\u1165\u11AB", - "\u110E\u1165\u1107\u1165\u11AF", - "\u110E\u1165\u110B\u1173\u11B7", - "\u110E\u1165\u11AB\u1100\u116E\u11A8", - "\u110E\u1165\u11AB\u1103\u116E\u11BC", - "\u110E\u1165\u11AB\u110C\u1161\u11BC", - "\u110E\u1165\u11AB\u110C\u1162", - "\u110E\u1165\u11AB\u110E\u1165\u11AB\u1112\u1175", - "\u110E\u1165\u11AF\u1103\u1169", - "\u110E\u1165\u11AF\u110C\u1165\u1112\u1175", - "\u110E\u1165\u11AF\u1112\u1161\u11A8", - "\u110E\u1165\u11BA\u1102\u1161\u11AF", - "\u110E\u1165\u11BA\u110D\u1162", - "\u110E\u1165\u11BC\u1102\u1167\u11AB", - "\u110E\u1165\u11BC\u1107\u1161\u110C\u1175", - "\u110E\u1165\u11BC\u1109\u1169", - "\u110E\u1165\u11BC\u110E\u116E\u11AB", - "\u110E\u1166\u1100\u1168", - "\u110E\u1166\u1105\u1167\u11A8", - "\u110E\u1166\u110B\u1169\u11AB", - "\u110E\u1166\u110B\u1172\u11A8", - "\u110E\u1166\u110C\u116E\u11BC", - "\u110E\u1166\u1112\u1165\u11B7", - "\u110E\u1169\u1103\u1173\u11BC\u1112\u1161\u11A8\u1109\u1162\u11BC", - "\u110E\u1169\u1107\u1161\u11AB", - "\u110E\u1169\u1107\u1161\u11B8", - "\u110E\u1169\u1109\u1161\u11BC\u1112\u116A", - "\u110E\u1169\u1109\u116E\u11AB", - "\u110E\u1169\u110B\u1167\u1105\u1173\u11B7", - "\u110E\u1169\u110B\u116F\u11AB", - "\u110E\u1169\u110C\u1165\u1102\u1167\u11A8", - "\u110E\u1169\u110C\u1165\u11B7", - "\u110E\u1169\u110E\u1165\u11BC", - "\u110E\u1169\u110F\u1169\u11AF\u1105\u1175\u11BA", - "\u110E\u1169\u11BA\u1107\u116E\u11AF", - "\u110E\u1169\u11BC\u1100\u1161\u11A8", - "\u110E\u1169\u11BC\u1105\u1175", - "\u110E\u1169\u11BC\u110C\u1161\u11BC", - "\u110E\u116A\u11AF\u110B\u1167\u11BC", - "\u110E\u116C\u1100\u1173\u11AB", - "\u110E\u116C\u1109\u1161\u11BC", - "\u110E\u116C\u1109\u1165\u11AB", - "\u110E\u116C\u1109\u1175\u11AB", - "\u110E\u116C\u110B\u1161\u11A8", - "\u110E\u116C\u110C\u1169\u11BC", - "\u110E\u116E\u1109\u1165\u11A8", - "\u110E\u116E\u110B\u1165\u11A8", - "\u110E\u116E\u110C\u1175\u11AB", - "\u110E\u116E\u110E\u1165\u11AB", - "\u110E\u116E\u110E\u1173\u11A8", - "\u110E\u116E\u11A8\u1100\u116E", - "\u110E\u116E\u11A8\u1109\u1169", - "\u110E\u116E\u11A8\u110C\u1166", - "\u110E\u116E\u11A8\u1112\u1161", - "\u110E\u116E\u11AF\u1100\u1173\u11AB", - "\u110E\u116E\u11AF\u1107\u1161\u11AF", - "\u110E\u116E\u11AF\u1109\u1161\u11AB", - "\u110E\u116E\u11AF\u1109\u1175\u11AB", - "\u110E\u116E\u11AF\u110B\u1167\u11AB", - "\u110E\u116E\u11AF\u110B\u1175\u11B8", - "\u110E\u116E\u11AF\u110C\u1161\u11BC", - "\u110E\u116E\u11AF\u1111\u1161\u11AB", - "\u110E\u116E\u11BC\u1100\u1167\u11A8", - "\u110E\u116E\u11BC\u1100\u1169", - "\u110E\u116E\u11BC\u1103\u1169\u11AF", - "\u110E\u116E\u11BC\u1107\u116E\u11AB\u1112\u1175", - "\u110E\u116E\u11BC\u110E\u1165\u11BC\u1103\u1169", - "\u110E\u1171\u110B\u1165\u11B8", - "\u110E\u1171\u110C\u1175\u11A8", - "\u110E\u1171\u1112\u1163\u11BC", - "\u110E\u1175\u110B\u1163\u11A8", - "\u110E\u1175\u11AB\u1100\u116E", - "\u110E\u1175\u11AB\u110E\u1165\u11A8", - "\u110E\u1175\u11AF\u1109\u1175\u11B8", - "\u110E\u1175\u11AF\u110B\u116F\u11AF", - "\u110E\u1175\u11AF\u1111\u1161\u11AB", - "\u110E\u1175\u11B7\u1103\u1162", - "\u110E\u1175\u11B7\u1106\u116E\u11A8", - "\u110E\u1175\u11B7\u1109\u1175\u11AF", - "\u110E\u1175\u11BA\u1109\u1169\u11AF", - "\u110E\u1175\u11BC\u110E\u1161\u11AB", - "\u110F\u1161\u1106\u1166\u1105\u1161", - "\u110F\u1161\u110B\u116E\u11AB\u1110\u1165", - "\u110F\u1161\u11AF\u1100\u116E\u11A8\u1109\u116E", - "\u110F\u1162\u1105\u1175\u11A8\u1110\u1165", - "\u110F\u1162\u11B7\u1111\u1165\u1109\u1173", - "\u110F\u1162\u11B7\u1111\u1166\u110B\u1175\u11AB", - "\u110F\u1165\u1110\u1173\u11AB", - "\u110F\u1165\u11AB\u1103\u1175\u1109\u1167\u11AB", - "\u110F\u1165\u11AF\u1105\u1165", - "\u110F\u1165\u11B7\u1111\u1172\u1110\u1165", - "\u110F\u1169\u1101\u1175\u1105\u1175", - "\u110F\u1169\u1106\u1175\u1103\u1175", - "\u110F\u1169\u11AB\u1109\u1165\u1110\u1173", - "\u110F\u1169\u11AF\u1105\u1161", - "\u110F\u1169\u11B7\u1111\u1173\u11AF\u1105\u1166\u11A8\u1109\u1173", - "\u110F\u1169\u11BC\u1102\u1161\u1106\u116E\u11AF", - "\u110F\u116B\u1100\u1161\u11B7", - "\u110F\u116E\u1103\u1166\u1110\u1161", - "\u110F\u1173\u1105\u1175\u11B7", - "\u110F\u1173\u11AB\u1100\u1175\u11AF", - "\u110F\u1173\u11AB\u1104\u1161\u11AF", - "\u110F\u1173\u11AB\u1109\u1169\u1105\u1175", - "\u110F\u1173\u11AB\u110B\u1161\u1103\u1173\u11AF", - "\u110F\u1173\u11AB\u110B\u1165\u1106\u1165\u1102\u1175", - "\u110F\u1173\u11AB\u110B\u1175\u11AF", - "\u110F\u1173\u11AB\u110C\u1165\u11AF", - "\u110F\u1173\u11AF\u1105\u1162\u1109\u1175\u11A8", - "\u110F\u1173\u11AF\u1105\u1165\u11B8", - "\u110F\u1175\u11AF\u1105\u1169", - "\u1110\u1161\u110B\u1175\u11B8", - "\u1110\u1161\u110C\u1161\u1100\u1175", - "\u1110\u1161\u11A8\u1100\u116E", - "\u1110\u1161\u11A8\u110C\u1161", - "\u1110\u1161\u11AB\u1109\u1162\u11BC", - "\u1110\u1162\u1100\u116F\u11AB\u1103\u1169", - "\u1110\u1162\u110B\u1163\u11BC", - "\u1110\u1162\u1111\u116E\u11BC", - "\u1110\u1162\u11A8\u1109\u1175", - "\u1110\u1162\u11AF\u1105\u1165\u11AB\u1110\u1173", - "\u1110\u1165\u1102\u1165\u11AF", - "\u1110\u1165\u1106\u1175\u1102\u1165\u11AF", - "\u1110\u1166\u1102\u1175\u1109\u1173", - "\u1110\u1166\u1109\u1173\u1110\u1173", - "\u1110\u1166\u110B\u1175\u1107\u1173\u11AF", - "\u1110\u1166\u11AF\u1105\u1166\u1107\u1175\u110C\u1165\u11AB", - "\u1110\u1169\u1105\u1169\u11AB", - "\u1110\u1169\u1106\u1161\u1110\u1169", - "\u1110\u1169\u110B\u116D\u110B\u1175\u11AF", - "\u1110\u1169\u11BC\u1100\u1168", - "\u1110\u1169\u11BC\u1100\u116A", - "\u1110\u1169\u11BC\u1105\u1169", - "\u1110\u1169\u11BC\u1109\u1175\u11AB", - "\u1110\u1169\u11BC\u110B\u1167\u11A8", - "\u1110\u1169\u11BC\u110B\u1175\u11AF", - "\u1110\u1169\u11BC\u110C\u1161\u11BC", - "\u1110\u1169\u11BC\u110C\u1166", - "\u1110\u1169\u11BC\u110C\u1173\u11BC", - "\u1110\u1169\u11BC\u1112\u1161\u11B8", - "\u1110\u1169\u11BC\u1112\u116A", - "\u1110\u116C\u1100\u1173\u11AB", - "\u1110\u116C\u110B\u116F\u11AB", - "\u1110\u116C\u110C\u1175\u11A8\u1100\u1173\u11B7", - "\u1110\u1171\u1100\u1175\u11B7", - "\u1110\u1173\u1105\u1165\u11A8", - "\u1110\u1173\u11A8\u1100\u1173\u11B8", - "\u1110\u1173\u11A8\u1107\u1167\u11AF", - "\u1110\u1173\u11A8\u1109\u1165\u11BC", - "\u1110\u1173\u11A8\u1109\u116E", - "\u1110\u1173\u11A8\u110C\u1175\u11BC", - "\u1110\u1173\u11A8\u1112\u1175", - "\u1110\u1173\u11AB\u1110\u1173\u11AB\u1112\u1175", - "\u1110\u1175\u1109\u1167\u110E\u1173", - "\u1111\u1161\u1105\u1161\u11AB\u1109\u1162\u11A8", - "\u1111\u1161\u110B\u1175\u11AF", - "\u1111\u1161\u110E\u116E\u11AF\u1109\u1169", - "\u1111\u1161\u11AB\u1100\u1167\u11AF", - "\u1111\u1161\u11AB\u1103\u1161\u11AB", - "\u1111\u1161\u11AB\u1106\u1162", - "\u1111\u1161\u11AB\u1109\u1161", - "\u1111\u1161\u11AF\u1109\u1175\u11B8", - "\u1111\u1161\u11AF\u110B\u116F\u11AF", - "\u1111\u1161\u11B8\u1109\u1169\u11BC", - "\u1111\u1162\u1109\u1167\u11AB", - "\u1111\u1162\u11A8\u1109\u1173", - "\u1111\u1162\u11A8\u1109\u1175\u1106\u1175\u11AF\u1105\u1175", - "\u1111\u1162\u11AB\u1110\u1175", - "\u1111\u1165\u1109\u1166\u11AB\u1110\u1173", - "\u1111\u1166\u110B\u1175\u11AB\u1110\u1173", - "\u1111\u1167\u11AB\u1100\u1167\u11AB", - "\u1111\u1167\u11AB\u110B\u1174", - "\u1111\u1167\u11AB\u110C\u1175", - "\u1111\u1167\u11AB\u1112\u1175", - "\u1111\u1167\u11BC\u1100\u1161", - "\u1111\u1167\u11BC\u1100\u1172\u11AB", - "\u1111\u1167\u11BC\u1109\u1162\u11BC", - "\u1111\u1167\u11BC\u1109\u1169", - "\u1111\u1167\u11BC\u110B\u1163\u11BC", - "\u1111\u1167\u11BC\u110B\u1175\u11AF", - "\u1111\u1167\u11BC\u1112\u116A", - "\u1111\u1169\u1109\u1173\u1110\u1165", - "\u1111\u1169\u110B\u1175\u11AB\u1110\u1173", - "\u1111\u1169\u110C\u1161\u11BC", - "\u1111\u1169\u1112\u1161\u11B7", - "\u1111\u116D\u1106\u1167\u11AB", - "\u1111\u116D\u110C\u1165\u11BC", - "\u1111\u116D\u110C\u116E\u11AB", - "\u1111\u116D\u1112\u1167\u11AB", - "\u1111\u116E\u11B7\u1106\u1169\u11A8", - "\u1111\u116E\u11B7\u110C\u1175\u11AF", - "\u1111\u116E\u11BC\u1100\u1167\u11BC", - "\u1111\u116E\u11BC\u1109\u1169\u11A8", - "\u1111\u116E\u11BC\u1109\u1173\u11B8", - "\u1111\u1173\u1105\u1161\u11BC\u1109\u1173", - "\u1111\u1173\u1105\u1175\u11AB\u1110\u1165", - "\u1111\u1173\u11AF\u1105\u1161\u1109\u1173\u1110\u1175\u11A8", - "\u1111\u1175\u1100\u1169\u11AB", - "\u1111\u1175\u1106\u1161\u11BC", - "\u1111\u1175\u110B\u1161\u1102\u1169", - "\u1111\u1175\u11AF\u1105\u1173\u11B7", - "\u1111\u1175\u11AF\u1109\u116E", - "\u1111\u1175\u11AF\u110B\u116D", - "\u1111\u1175\u11AF\u110C\u1161", - "\u1111\u1175\u11AF\u1110\u1169\u11BC", - "\u1111\u1175\u11BC\u1100\u1168", - "\u1112\u1161\u1102\u1173\u1102\u1175\u11B7", - "\u1112\u1161\u1102\u1173\u11AF", - "\u1112\u1161\u1103\u1173\u110B\u1170\u110B\u1165", - "\u1112\u1161\u1105\u116E\u11BA\u1107\u1161\u11B7", - "\u1112\u1161\u1107\u1161\u11AB\u1100\u1175", - "\u1112\u1161\u1109\u116E\u11A8\u110C\u1175\u11B8", - "\u1112\u1161\u1109\u116E\u11AB", - "\u1112\u1161\u110B\u1167\u1110\u1173\u11AB", - "\u1112\u1161\u110C\u1175\u1106\u1161\u11AB", - "\u1112\u1161\u110E\u1165\u11AB", - "\u1112\u1161\u1111\u116E\u11B7", - "\u1112\u1161\u1111\u1175\u11AF", - "\u1112\u1161\u11A8\u1100\u116A", - "\u1112\u1161\u11A8\u1100\u116D", - "\u1112\u1161\u11A8\u1100\u1173\u11B8", - "\u1112\u1161\u11A8\u1100\u1175", - "\u1112\u1161\u11A8\u1102\u1167\u11AB", - "\u1112\u1161\u11A8\u1105\u1167\u11A8", - "\u1112\u1161\u11A8\u1107\u1165\u11AB", - "\u1112\u1161\u11A8\u1107\u116E\u1106\u1169", - "\u1112\u1161\u11A8\u1107\u1175", - "\u1112\u1161\u11A8\u1109\u1162\u11BC", - "\u1112\u1161\u11A8\u1109\u116E\u11AF", - "\u1112\u1161\u11A8\u1109\u1173\u11B8", - "\u1112\u1161\u11A8\u110B\u116D\u11BC\u1111\u116E\u11B7", - "\u1112\u1161\u11A8\u110B\u116F\u11AB", - "\u1112\u1161\u11A8\u110B\u1171", - "\u1112\u1161\u11A8\u110C\u1161", - "\u1112\u1161\u11A8\u110C\u1165\u11B7", - "\u1112\u1161\u11AB\u1100\u1168", - "\u1112\u1161\u11AB\u1100\u1173\u11AF", - "\u1112\u1161\u11AB\u1101\u1165\u1107\u1165\u11AB\u110B\u1166", - "\u1112\u1161\u11AB\u1102\u1161\u11BD", - "\u1112\u1161\u11AB\u1102\u116E\u11AB", - "\u1112\u1161\u11AB\u1103\u1169\u11BC\u110B\u1161\u11AB", - "\u1112\u1161\u11AB\u1104\u1162", - "\u1112\u1161\u11AB\u1105\u1161\u1109\u1161\u11AB", - "\u1112\u1161\u11AB\u1106\u1161\u1103\u1175", - "\u1112\u1161\u11AB\u1106\u116E\u11AB", - "\u1112\u1161\u11AB\u1107\u1165\u11AB", - "\u1112\u1161\u11AB\u1107\u1169\u11A8", - "\u1112\u1161\u11AB\u1109\u1175\u11A8", - "\u1112\u1161\u11AB\u110B\u1167\u1105\u1173\u11B7", - "\u1112\u1161\u11AB\u110D\u1169\u11A8", - "\u1112\u1161\u11AF\u1106\u1165\u1102\u1175", - "\u1112\u1161\u11AF\u110B\u1161\u1107\u1165\u110C\u1175", - "\u1112\u1161\u11AF\u110B\u1175\u11AB", - "\u1112\u1161\u11B7\u1101\u1166", - "\u1112\u1161\u11B7\u1107\u116E\u1105\u1169", - "\u1112\u1161\u11B8\u1100\u1167\u11A8", - "\u1112\u1161\u11B8\u1105\u1175\u110C\u1165\u11A8", - "\u1112\u1161\u11BC\u1100\u1169\u11BC", - "\u1112\u1161\u11BC\u1100\u116E", - "\u1112\u1161\u11BC\u1109\u1161\u11BC", - "\u1112\u1161\u11BC\u110B\u1174", - "\u1112\u1162\u1100\u1167\u11AF", - "\u1112\u1162\u1100\u116E\u11AB", - "\u1112\u1162\u1103\u1161\u11B8", - "\u1112\u1162\u1103\u1161\u11BC", - "\u1112\u1162\u1106\u116E\u11AF", - "\u1112\u1162\u1109\u1165\u11A8", - "\u1112\u1162\u1109\u1165\u11AF", - "\u1112\u1162\u1109\u116E\u110B\u116D\u11A8\u110C\u1161\u11BC", - "\u1112\u1162\u110B\u1161\u11AB", - "\u1112\u1162\u11A8\u1109\u1175\u11B7", - "\u1112\u1162\u11AB\u1103\u1173\u1107\u1162\u11A8", - "\u1112\u1162\u11B7\u1107\u1165\u1100\u1165", - "\u1112\u1162\u11BA\u1107\u1167\u11C0", - "\u1112\u1162\u11BA\u1109\u1161\u11AF", - "\u1112\u1162\u11BC\u1103\u1169\u11BC", - "\u1112\u1162\u11BC\u1107\u1169\u11A8", - "\u1112\u1162\u11BC\u1109\u1161", - "\u1112\u1162\u11BC\u110B\u116E\u11AB", - "\u1112\u1162\u11BC\u110B\u1171", - "\u1112\u1163\u11BC\u1100\u1175", - "\u1112\u1163\u11BC\u1109\u1161\u11BC", - "\u1112\u1163\u11BC\u1109\u116E", - "\u1112\u1165\u1105\u1161\u11A8", - "\u1112\u1165\u110B\u116D\u11BC", - "\u1112\u1166\u11AF\u1100\u1175", - "\u1112\u1167\u11AB\u1100\u116A\u11AB", - "\u1112\u1167\u11AB\u1100\u1173\u11B7", - "\u1112\u1167\u11AB\u1103\u1162", - "\u1112\u1167\u11AB\u1109\u1161\u11BC", - "\u1112\u1167\u11AB\u1109\u1175\u11AF", - "\u1112\u1167\u11AB\u110C\u1161\u11BC", - "\u1112\u1167\u11AB\u110C\u1162", - "\u1112\u1167\u11AB\u110C\u1175", - "\u1112\u1167\u11AF\u110B\u1162\u11A8", - "\u1112\u1167\u11B8\u1105\u1167\u11A8", - "\u1112\u1167\u11BC\u1107\u116E", - "\u1112\u1167\u11BC\u1109\u1161", - "\u1112\u1167\u11BC\u1109\u116E", - "\u1112\u1167\u11BC\u1109\u1175\u11A8", - "\u1112\u1167\u11BC\u110C\u1166", - "\u1112\u1167\u11BC\u1110\u1162", - "\u1112\u1167\u11BC\u1111\u1167\u11AB", - "\u1112\u1168\u1110\u1162\u11A8", - "\u1112\u1169\u1100\u1175\u1109\u1175\u11B7", - "\u1112\u1169\u1102\u1161\u11B7", - "\u1112\u1169\u1105\u1161\u11BC\u110B\u1175", - "\u1112\u1169\u1107\u1161\u11A8", - "\u1112\u1169\u1110\u1166\u11AF", - "\u1112\u1169\u1112\u1173\u11B8", - "\u1112\u1169\u11A8\u1109\u1175", - "\u1112\u1169\u11AF\u1105\u1169", - "\u1112\u1169\u11B7\u1111\u1166\u110B\u1175\u110C\u1175", - "\u1112\u1169\u11BC\u1107\u1169", - "\u1112\u1169\u11BC\u1109\u116E", - "\u1112\u1169\u11BC\u110E\u1161", - "\u1112\u116A\u1106\u1167\u11AB", - "\u1112\u116A\u1107\u116E\u11AB", - "\u1112\u116A\u1109\u1161\u11AF", - "\u1112\u116A\u110B\u116D\u110B\u1175\u11AF", - "\u1112\u116A\u110C\u1161\u11BC", - "\u1112\u116A\u1112\u1161\u11A8", - "\u1112\u116A\u11A8\u1107\u1169", - "\u1112\u116A\u11A8\u110B\u1175\u11AB", - "\u1112\u116A\u11A8\u110C\u1161\u11BC", - "\u1112\u116A\u11A8\u110C\u1165\u11BC", - "\u1112\u116A\u11AB\u1100\u1161\u11B8", - "\u1112\u116A\u11AB\u1100\u1167\u11BC", - "\u1112\u116A\u11AB\u110B\u1167\u11BC", - "\u1112\u116A\u11AB\u110B\u1172\u11AF", - "\u1112\u116A\u11AB\u110C\u1161", - "\u1112\u116A\u11AF\u1100\u1175", - "\u1112\u116A\u11AF\u1103\u1169\u11BC", - "\u1112\u116A\u11AF\u1107\u1161\u11AF\u1112\u1175", - "\u1112\u116A\u11AF\u110B\u116D\u11BC", - "\u1112\u116A\u11AF\u110D\u1161\u11A8", - "\u1112\u116C\u1100\u1167\u11AB", - "\u1112\u116C\u1100\u116A\u11AB", - "\u1112\u116C\u1107\u1169\u11A8", - "\u1112\u116C\u1109\u1162\u11A8", - "\u1112\u116C\u110B\u116F\u11AB", - "\u1112\u116C\u110C\u1161\u11BC", - "\u1112\u116C\u110C\u1165\u11AB", - "\u1112\u116C\u11BA\u1109\u116E", - "\u1112\u116C\u11BC\u1103\u1161\u11AB\u1107\u1169\u1103\u1169", - "\u1112\u116D\u110B\u1172\u11AF\u110C\u1165\u11A8", - "\u1112\u116E\u1107\u1161\u11AB", - "\u1112\u116E\u110E\u116E\u11BA\u1100\u1161\u1105\u116E", - "\u1112\u116E\u11AB\u1105\u1167\u11AB", - "\u1112\u116F\u11AF\u110A\u1175\u11AB", - "\u1112\u1172\u1109\u1175\u11A8", - "\u1112\u1172\u110B\u1175\u11AF", - "\u1112\u1172\u11BC\u1102\u1162", - "\u1112\u1173\u1105\u1173\u11B7", - "\u1112\u1173\u11A8\u1107\u1162\u11A8", - "\u1112\u1173\u11A8\u110B\u1175\u11AB", - "\u1112\u1173\u11AB\u110C\u1165\u11A8", - "\u1112\u1173\u11AB\u1112\u1175", - "\u1112\u1173\u11BC\u1106\u1175", - "\u1112\u1173\u11BC\u1107\u116E\u11AB", - "\u1112\u1174\u1100\u1169\u11A8", - "\u1112\u1174\u1106\u1161\u11BC", - "\u1112\u1174\u1109\u1162\u11BC", - "\u1112\u1174\u11AB\u1109\u1162\u11A8", - "\u1112\u1175\u11B7\u1101\u1165\u11BA" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/french.json -var require_french = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/french.json"(exports2, module2) { - module2.exports = [ - "abaisser", - "abandon", - "abdiquer", - "abeille", - "abolir", - "aborder", - "aboutir", - "aboyer", - "abrasif", - "abreuver", - "abriter", - "abroger", - "abrupt", - "absence", - "absolu", - "absurde", - "abusif", - "abyssal", - "acade\u0301mie", - "acajou", - "acarien", - "accabler", - "accepter", - "acclamer", - "accolade", - "accroche", - "accuser", - "acerbe", - "achat", - "acheter", - "aciduler", - "acier", - "acompte", - "acque\u0301rir", - "acronyme", - "acteur", - "actif", - "actuel", - "adepte", - "ade\u0301quat", - "adhe\u0301sif", - "adjectif", - "adjuger", - "admettre", - "admirer", - "adopter", - "adorer", - "adoucir", - "adresse", - "adroit", - "adulte", - "adverbe", - "ae\u0301rer", - "ae\u0301ronef", - "affaire", - "affecter", - "affiche", - "affreux", - "affubler", - "agacer", - "agencer", - "agile", - "agiter", - "agrafer", - "agre\u0301able", - "agrume", - "aider", - "aiguille", - "ailier", - "aimable", - "aisance", - "ajouter", - "ajuster", - "alarmer", - "alchimie", - "alerte", - "alge\u0300bre", - "algue", - "alie\u0301ner", - "aliment", - "alle\u0301ger", - "alliage", - "allouer", - "allumer", - "alourdir", - "alpaga", - "altesse", - "alve\u0301ole", - "amateur", - "ambigu", - "ambre", - "ame\u0301nager", - "amertume", - "amidon", - "amiral", - "amorcer", - "amour", - "amovible", - "amphibie", - "ampleur", - "amusant", - "analyse", - "anaphore", - "anarchie", - "anatomie", - "ancien", - "ane\u0301antir", - "angle", - "angoisse", - "anguleux", - "animal", - "annexer", - "annonce", - "annuel", - "anodin", - "anomalie", - "anonyme", - "anormal", - "antenne", - "antidote", - "anxieux", - "apaiser", - "ape\u0301ritif", - "aplanir", - "apologie", - "appareil", - "appeler", - "apporter", - "appuyer", - "aquarium", - "aqueduc", - "arbitre", - "arbuste", - "ardeur", - "ardoise", - "argent", - "arlequin", - "armature", - "armement", - "armoire", - "armure", - "arpenter", - "arracher", - "arriver", - "arroser", - "arsenic", - "arte\u0301riel", - "article", - "aspect", - "asphalte", - "aspirer", - "assaut", - "asservir", - "assiette", - "associer", - "assurer", - "asticot", - "astre", - "astuce", - "atelier", - "atome", - "atrium", - "atroce", - "attaque", - "attentif", - "attirer", - "attraper", - "aubaine", - "auberge", - "audace", - "audible", - "augurer", - "aurore", - "automne", - "autruche", - "avaler", - "avancer", - "avarice", - "avenir", - "averse", - "aveugle", - "aviateur", - "avide", - "avion", - "aviser", - "avoine", - "avouer", - "avril", - "axial", - "axiome", - "badge", - "bafouer", - "bagage", - "baguette", - "baignade", - "balancer", - "balcon", - "baleine", - "balisage", - "bambin", - "bancaire", - "bandage", - "banlieue", - "bannie\u0300re", - "banquier", - "barbier", - "baril", - "baron", - "barque", - "barrage", - "bassin", - "bastion", - "bataille", - "bateau", - "batterie", - "baudrier", - "bavarder", - "belette", - "be\u0301lier", - "belote", - "be\u0301ne\u0301fice", - "berceau", - "berger", - "berline", - "bermuda", - "besace", - "besogne", - "be\u0301tail", - "beurre", - "biberon", - "bicycle", - "bidule", - "bijou", - "bilan", - "bilingue", - "billard", - "binaire", - "biologie", - "biopsie", - "biotype", - "biscuit", - "bison", - "bistouri", - "bitume", - "bizarre", - "blafard", - "blague", - "blanchir", - "blessant", - "blinder", - "blond", - "bloquer", - "blouson", - "bobard", - "bobine", - "boire", - "boiser", - "bolide", - "bonbon", - "bondir", - "bonheur", - "bonifier", - "bonus", - "bordure", - "borne", - "botte", - "boucle", - "boueux", - "bougie", - "boulon", - "bouquin", - "bourse", - "boussole", - "boutique", - "boxeur", - "branche", - "brasier", - "brave", - "brebis", - "bre\u0300che", - "breuvage", - "bricoler", - "brigade", - "brillant", - "brioche", - "brique", - "brochure", - "broder", - "bronzer", - "brousse", - "broyeur", - "brume", - "brusque", - "brutal", - "bruyant", - "buffle", - "buisson", - "bulletin", - "bureau", - "burin", - "bustier", - "butiner", - "butoir", - "buvable", - "buvette", - "cabanon", - "cabine", - "cachette", - "cadeau", - "cadre", - "cafe\u0301ine", - "caillou", - "caisson", - "calculer", - "calepin", - "calibre", - "calmer", - "calomnie", - "calvaire", - "camarade", - "came\u0301ra", - "camion", - "campagne", - "canal", - "caneton", - "canon", - "cantine", - "canular", - "capable", - "caporal", - "caprice", - "capsule", - "capter", - "capuche", - "carabine", - "carbone", - "caresser", - "caribou", - "carnage", - "carotte", - "carreau", - "carton", - "cascade", - "casier", - "casque", - "cassure", - "causer", - "caution", - "cavalier", - "caverne", - "caviar", - "ce\u0301dille", - "ceinture", - "ce\u0301leste", - "cellule", - "cendrier", - "censurer", - "central", - "cercle", - "ce\u0301re\u0301bral", - "cerise", - "cerner", - "cerveau", - "cesser", - "chagrin", - "chaise", - "chaleur", - "chambre", - "chance", - "chapitre", - "charbon", - "chasseur", - "chaton", - "chausson", - "chavirer", - "chemise", - "chenille", - "che\u0301quier", - "chercher", - "cheval", - "chien", - "chiffre", - "chignon", - "chime\u0300re", - "chiot", - "chlorure", - "chocolat", - "choisir", - "chose", - "chouette", - "chrome", - "chute", - "cigare", - "cigogne", - "cimenter", - "cine\u0301ma", - "cintrer", - "circuler", - "cirer", - "cirque", - "citerne", - "citoyen", - "citron", - "civil", - "clairon", - "clameur", - "claquer", - "classe", - "clavier", - "client", - "cligner", - "climat", - "clivage", - "cloche", - "clonage", - "cloporte", - "cobalt", - "cobra", - "cocasse", - "cocotier", - "coder", - "codifier", - "coffre", - "cogner", - "cohe\u0301sion", - "coiffer", - "coincer", - "cole\u0300re", - "colibri", - "colline", - "colmater", - "colonel", - "combat", - "come\u0301die", - "commande", - "compact", - "concert", - "conduire", - "confier", - "congeler", - "connoter", - "consonne", - "contact", - "convexe", - "copain", - "copie", - "corail", - "corbeau", - "cordage", - "corniche", - "corpus", - "correct", - "corte\u0300ge", - "cosmique", - "costume", - "coton", - "coude", - "coupure", - "courage", - "couteau", - "couvrir", - "coyote", - "crabe", - "crainte", - "cravate", - "crayon", - "cre\u0301ature", - "cre\u0301diter", - "cre\u0301meux", - "creuser", - "crevette", - "cribler", - "crier", - "cristal", - "crite\u0300re", - "croire", - "croquer", - "crotale", - "crucial", - "cruel", - "crypter", - "cubique", - "cueillir", - "cuille\u0300re", - "cuisine", - "cuivre", - "culminer", - "cultiver", - "cumuler", - "cupide", - "curatif", - "curseur", - "cyanure", - "cycle", - "cylindre", - "cynique", - "daigner", - "damier", - "danger", - "danseur", - "dauphin", - "de\u0301battre", - "de\u0301biter", - "de\u0301border", - "de\u0301brider", - "de\u0301butant", - "de\u0301caler", - "de\u0301cembre", - "de\u0301chirer", - "de\u0301cider", - "de\u0301clarer", - "de\u0301corer", - "de\u0301crire", - "de\u0301cupler", - "de\u0301dale", - "de\u0301ductif", - "de\u0301esse", - "de\u0301fensif", - "de\u0301filer", - "de\u0301frayer", - "de\u0301gager", - "de\u0301givrer", - "de\u0301glutir", - "de\u0301grafer", - "de\u0301jeuner", - "de\u0301lice", - "de\u0301loger", - "demander", - "demeurer", - "de\u0301molir", - "de\u0301nicher", - "de\u0301nouer", - "dentelle", - "de\u0301nuder", - "de\u0301part", - "de\u0301penser", - "de\u0301phaser", - "de\u0301placer", - "de\u0301poser", - "de\u0301ranger", - "de\u0301rober", - "de\u0301sastre", - "descente", - "de\u0301sert", - "de\u0301signer", - "de\u0301sobe\u0301ir", - "dessiner", - "destrier", - "de\u0301tacher", - "de\u0301tester", - "de\u0301tourer", - "de\u0301tresse", - "devancer", - "devenir", - "deviner", - "devoir", - "diable", - "dialogue", - "diamant", - "dicter", - "diffe\u0301rer", - "dige\u0301rer", - "digital", - "digne", - "diluer", - "dimanche", - "diminuer", - "dioxyde", - "directif", - "diriger", - "discuter", - "disposer", - "dissiper", - "distance", - "divertir", - "diviser", - "docile", - "docteur", - "dogme", - "doigt", - "domaine", - "domicile", - "dompter", - "donateur", - "donjon", - "donner", - "dopamine", - "dortoir", - "dorure", - "dosage", - "doseur", - "dossier", - "dotation", - "douanier", - "double", - "douceur", - "douter", - "doyen", - "dragon", - "draper", - "dresser", - "dribbler", - "droiture", - "duperie", - "duplexe", - "durable", - "durcir", - "dynastie", - "e\u0301blouir", - "e\u0301carter", - "e\u0301charpe", - "e\u0301chelle", - "e\u0301clairer", - "e\u0301clipse", - "e\u0301clore", - "e\u0301cluse", - "e\u0301cole", - "e\u0301conomie", - "e\u0301corce", - "e\u0301couter", - "e\u0301craser", - "e\u0301cre\u0301mer", - "e\u0301crivain", - "e\u0301crou", - "e\u0301cume", - "e\u0301cureuil", - "e\u0301difier", - "e\u0301duquer", - "effacer", - "effectif", - "effigie", - "effort", - "effrayer", - "effusion", - "e\u0301galiser", - "e\u0301garer", - "e\u0301jecter", - "e\u0301laborer", - "e\u0301largir", - "e\u0301lectron", - "e\u0301le\u0301gant", - "e\u0301le\u0301phant", - "e\u0301le\u0300ve", - "e\u0301ligible", - "e\u0301litisme", - "e\u0301loge", - "e\u0301lucider", - "e\u0301luder", - "emballer", - "embellir", - "embryon", - "e\u0301meraude", - "e\u0301mission", - "emmener", - "e\u0301motion", - "e\u0301mouvoir", - "empereur", - "employer", - "emporter", - "emprise", - "e\u0301mulsion", - "encadrer", - "enche\u0300re", - "enclave", - "encoche", - "endiguer", - "endosser", - "endroit", - "enduire", - "e\u0301nergie", - "enfance", - "enfermer", - "enfouir", - "engager", - "engin", - "englober", - "e\u0301nigme", - "enjamber", - "enjeu", - "enlever", - "ennemi", - "ennuyeux", - "enrichir", - "enrobage", - "enseigne", - "entasser", - "entendre", - "entier", - "entourer", - "entraver", - "e\u0301nume\u0301rer", - "envahir", - "enviable", - "envoyer", - "enzyme", - "e\u0301olien", - "e\u0301paissir", - "e\u0301pargne", - "e\u0301patant", - "e\u0301paule", - "e\u0301picerie", - "e\u0301pide\u0301mie", - "e\u0301pier", - "e\u0301pilogue", - "e\u0301pine", - "e\u0301pisode", - "e\u0301pitaphe", - "e\u0301poque", - "e\u0301preuve", - "e\u0301prouver", - "e\u0301puisant", - "e\u0301querre", - "e\u0301quipe", - "e\u0301riger", - "e\u0301rosion", - "erreur", - "e\u0301ruption", - "escalier", - "espadon", - "espe\u0300ce", - "espie\u0300gle", - "espoir", - "esprit", - "esquiver", - "essayer", - "essence", - "essieu", - "essorer", - "estime", - "estomac", - "estrade", - "e\u0301tage\u0300re", - "e\u0301taler", - "e\u0301tanche", - "e\u0301tatique", - "e\u0301teindre", - "e\u0301tendoir", - "e\u0301ternel", - "e\u0301thanol", - "e\u0301thique", - "ethnie", - "e\u0301tirer", - "e\u0301toffer", - "e\u0301toile", - "e\u0301tonnant", - "e\u0301tourdir", - "e\u0301trange", - "e\u0301troit", - "e\u0301tude", - "euphorie", - "e\u0301valuer", - "e\u0301vasion", - "e\u0301ventail", - "e\u0301vidence", - "e\u0301viter", - "e\u0301volutif", - "e\u0301voquer", - "exact", - "exage\u0301rer", - "exaucer", - "exceller", - "excitant", - "exclusif", - "excuse", - "exe\u0301cuter", - "exemple", - "exercer", - "exhaler", - "exhorter", - "exigence", - "exiler", - "exister", - "exotique", - "expe\u0301dier", - "explorer", - "exposer", - "exprimer", - "exquis", - "extensif", - "extraire", - "exulter", - "fable", - "fabuleux", - "facette", - "facile", - "facture", - "faiblir", - "falaise", - "fameux", - "famille", - "farceur", - "farfelu", - "farine", - "farouche", - "fasciner", - "fatal", - "fatigue", - "faucon", - "fautif", - "faveur", - "favori", - "fe\u0301brile", - "fe\u0301conder", - "fe\u0301de\u0301rer", - "fe\u0301lin", - "femme", - "fe\u0301mur", - "fendoir", - "fe\u0301odal", - "fermer", - "fe\u0301roce", - "ferveur", - "festival", - "feuille", - "feutre", - "fe\u0301vrier", - "fiasco", - "ficeler", - "fictif", - "fide\u0300le", - "figure", - "filature", - "filetage", - "filie\u0300re", - "filleul", - "filmer", - "filou", - "filtrer", - "financer", - "finir", - "fiole", - "firme", - "fissure", - "fixer", - "flairer", - "flamme", - "flasque", - "flatteur", - "fle\u0301au", - "fle\u0300che", - "fleur", - "flexion", - "flocon", - "flore", - "fluctuer", - "fluide", - "fluvial", - "folie", - "fonderie", - "fongible", - "fontaine", - "forcer", - "forgeron", - "formuler", - "fortune", - "fossile", - "foudre", - "fouge\u0300re", - "fouiller", - "foulure", - "fourmi", - "fragile", - "fraise", - "franchir", - "frapper", - "frayeur", - "fre\u0301gate", - "freiner", - "frelon", - "fre\u0301mir", - "fre\u0301ne\u0301sie", - "fre\u0300re", - "friable", - "friction", - "frisson", - "frivole", - "froid", - "fromage", - "frontal", - "frotter", - "fruit", - "fugitif", - "fuite", - "fureur", - "furieux", - "furtif", - "fusion", - "futur", - "gagner", - "galaxie", - "galerie", - "gambader", - "garantir", - "gardien", - "garnir", - "garrigue", - "gazelle", - "gazon", - "ge\u0301ant", - "ge\u0301latine", - "ge\u0301lule", - "gendarme", - "ge\u0301ne\u0301ral", - "ge\u0301nie", - "genou", - "gentil", - "ge\u0301ologie", - "ge\u0301ome\u0300tre", - "ge\u0301ranium", - "germe", - "gestuel", - "geyser", - "gibier", - "gicler", - "girafe", - "givre", - "glace", - "glaive", - "glisser", - "globe", - "gloire", - "glorieux", - "golfeur", - "gomme", - "gonfler", - "gorge", - "gorille", - "goudron", - "gouffre", - "goulot", - "goupille", - "gourmand", - "goutte", - "graduel", - "graffiti", - "graine", - "grand", - "grappin", - "gratuit", - "gravir", - "grenat", - "griffure", - "griller", - "grimper", - "grogner", - "gronder", - "grotte", - "groupe", - "gruger", - "grutier", - "gruye\u0300re", - "gue\u0301pard", - "guerrier", - "guide", - "guimauve", - "guitare", - "gustatif", - "gymnaste", - "gyrostat", - "habitude", - "hachoir", - "halte", - "hameau", - "hangar", - "hanneton", - "haricot", - "harmonie", - "harpon", - "hasard", - "he\u0301lium", - "he\u0301matome", - "herbe", - "he\u0301risson", - "hermine", - "he\u0301ron", - "he\u0301siter", - "heureux", - "hiberner", - "hibou", - "hilarant", - "histoire", - "hiver", - "homard", - "hommage", - "homoge\u0300ne", - "honneur", - "honorer", - "honteux", - "horde", - "horizon", - "horloge", - "hormone", - "horrible", - "houleux", - "housse", - "hublot", - "huileux", - "humain", - "humble", - "humide", - "humour", - "hurler", - "hydromel", - "hygie\u0300ne", - "hymne", - "hypnose", - "idylle", - "ignorer", - "iguane", - "illicite", - "illusion", - "image", - "imbiber", - "imiter", - "immense", - "immobile", - "immuable", - "impact", - "impe\u0301rial", - "implorer", - "imposer", - "imprimer", - "imputer", - "incarner", - "incendie", - "incident", - "incliner", - "incolore", - "indexer", - "indice", - "inductif", - "ine\u0301dit", - "ineptie", - "inexact", - "infini", - "infliger", - "informer", - "infusion", - "inge\u0301rer", - "inhaler", - "inhiber", - "injecter", - "injure", - "innocent", - "inoculer", - "inonder", - "inscrire", - "insecte", - "insigne", - "insolite", - "inspirer", - "instinct", - "insulter", - "intact", - "intense", - "intime", - "intrigue", - "intuitif", - "inutile", - "invasion", - "inventer", - "inviter", - "invoquer", - "ironique", - "irradier", - "irre\u0301el", - "irriter", - "isoler", - "ivoire", - "ivresse", - "jaguar", - "jaillir", - "jambe", - "janvier", - "jardin", - "jauger", - "jaune", - "javelot", - "jetable", - "jeton", - "jeudi", - "jeunesse", - "joindre", - "joncher", - "jongler", - "joueur", - "jouissif", - "journal", - "jovial", - "joyau", - "joyeux", - "jubiler", - "jugement", - "junior", - "jupon", - "juriste", - "justice", - "juteux", - "juve\u0301nile", - "kayak", - "kimono", - "kiosque", - "label", - "labial", - "labourer", - "lace\u0301rer", - "lactose", - "lagune", - "laine", - "laisser", - "laitier", - "lambeau", - "lamelle", - "lampe", - "lanceur", - "langage", - "lanterne", - "lapin", - "largeur", - "larme", - "laurier", - "lavabo", - "lavoir", - "lecture", - "le\u0301gal", - "le\u0301ger", - "le\u0301gume", - "lessive", - "lettre", - "levier", - "lexique", - "le\u0301zard", - "liasse", - "libe\u0301rer", - "libre", - "licence", - "licorne", - "lie\u0300ge", - "lie\u0300vre", - "ligature", - "ligoter", - "ligue", - "limer", - "limite", - "limonade", - "limpide", - "line\u0301aire", - "lingot", - "lionceau", - "liquide", - "lisie\u0300re", - "lister", - "lithium", - "litige", - "littoral", - "livreur", - "logique", - "lointain", - "loisir", - "lombric", - "loterie", - "louer", - "lourd", - "loutre", - "louve", - "loyal", - "lubie", - "lucide", - "lucratif", - "lueur", - "lugubre", - "luisant", - "lumie\u0300re", - "lunaire", - "lundi", - "luron", - "lutter", - "luxueux", - "machine", - "magasin", - "magenta", - "magique", - "maigre", - "maillon", - "maintien", - "mairie", - "maison", - "majorer", - "malaxer", - "male\u0301fice", - "malheur", - "malice", - "mallette", - "mammouth", - "mandater", - "maniable", - "manquant", - "manteau", - "manuel", - "marathon", - "marbre", - "marchand", - "mardi", - "maritime", - "marqueur", - "marron", - "marteler", - "mascotte", - "massif", - "mate\u0301riel", - "matie\u0300re", - "matraque", - "maudire", - "maussade", - "mauve", - "maximal", - "me\u0301chant", - "me\u0301connu", - "me\u0301daille", - "me\u0301decin", - "me\u0301diter", - "me\u0301duse", - "meilleur", - "me\u0301lange", - "me\u0301lodie", - "membre", - "me\u0301moire", - "menacer", - "mener", - "menhir", - "mensonge", - "mentor", - "mercredi", - "me\u0301rite", - "merle", - "messager", - "mesure", - "me\u0301tal", - "me\u0301te\u0301ore", - "me\u0301thode", - "me\u0301tier", - "meuble", - "miauler", - "microbe", - "miette", - "mignon", - "migrer", - "milieu", - "million", - "mimique", - "mince", - "mine\u0301ral", - "minimal", - "minorer", - "minute", - "miracle", - "miroiter", - "missile", - "mixte", - "mobile", - "moderne", - "moelleux", - "mondial", - "moniteur", - "monnaie", - "monotone", - "monstre", - "montagne", - "monument", - "moqueur", - "morceau", - "morsure", - "mortier", - "moteur", - "motif", - "mouche", - "moufle", - "moulin", - "mousson", - "mouton", - "mouvant", - "multiple", - "munition", - "muraille", - "mure\u0300ne", - "murmure", - "muscle", - "muse\u0301um", - "musicien", - "mutation", - "muter", - "mutuel", - "myriade", - "myrtille", - "myste\u0300re", - "mythique", - "nageur", - "nappe", - "narquois", - "narrer", - "natation", - "nation", - "nature", - "naufrage", - "nautique", - "navire", - "ne\u0301buleux", - "nectar", - "ne\u0301faste", - "ne\u0301gation", - "ne\u0301gliger", - "ne\u0301gocier", - "neige", - "nerveux", - "nettoyer", - "neurone", - "neutron", - "neveu", - "niche", - "nickel", - "nitrate", - "niveau", - "noble", - "nocif", - "nocturne", - "noirceur", - "noisette", - "nomade", - "nombreux", - "nommer", - "normatif", - "notable", - "notifier", - "notoire", - "nourrir", - "nouveau", - "novateur", - "novembre", - "novice", - "nuage", - "nuancer", - "nuire", - "nuisible", - "nume\u0301ro", - "nuptial", - "nuque", - "nutritif", - "obe\u0301ir", - "objectif", - "obliger", - "obscur", - "observer", - "obstacle", - "obtenir", - "obturer", - "occasion", - "occuper", - "oce\u0301an", - "octobre", - "octroyer", - "octupler", - "oculaire", - "odeur", - "odorant", - "offenser", - "officier", - "offrir", - "ogive", - "oiseau", - "oisillon", - "olfactif", - "olivier", - "ombrage", - "omettre", - "onctueux", - "onduler", - "one\u0301reux", - "onirique", - "opale", - "opaque", - "ope\u0301rer", - "opinion", - "opportun", - "opprimer", - "opter", - "optique", - "orageux", - "orange", - "orbite", - "ordonner", - "oreille", - "organe", - "orgueil", - "orifice", - "ornement", - "orque", - "ortie", - "osciller", - "osmose", - "ossature", - "otarie", - "ouragan", - "ourson", - "outil", - "outrager", - "ouvrage", - "ovation", - "oxyde", - "oxyge\u0300ne", - "ozone", - "paisible", - "palace", - "palmare\u0300s", - "palourde", - "palper", - "panache", - "panda", - "pangolin", - "paniquer", - "panneau", - "panorama", - "pantalon", - "papaye", - "papier", - "papoter", - "papyrus", - "paradoxe", - "parcelle", - "paresse", - "parfumer", - "parler", - "parole", - "parrain", - "parsemer", - "partager", - "parure", - "parvenir", - "passion", - "paste\u0300que", - "paternel", - "patience", - "patron", - "pavillon", - "pavoiser", - "payer", - "paysage", - "peigne", - "peintre", - "pelage", - "pe\u0301lican", - "pelle", - "pelouse", - "peluche", - "pendule", - "pe\u0301ne\u0301trer", - "pe\u0301nible", - "pensif", - "pe\u0301nurie", - "pe\u0301pite", - "pe\u0301plum", - "perdrix", - "perforer", - "pe\u0301riode", - "permuter", - "perplexe", - "persil", - "perte", - "peser", - "pe\u0301tale", - "petit", - "pe\u0301trir", - "peuple", - "pharaon", - "phobie", - "phoque", - "photon", - "phrase", - "physique", - "piano", - "pictural", - "pie\u0300ce", - "pierre", - "pieuvre", - "pilote", - "pinceau", - "pipette", - "piquer", - "pirogue", - "piscine", - "piston", - "pivoter", - "pixel", - "pizza", - "placard", - "plafond", - "plaisir", - "planer", - "plaque", - "plastron", - "plateau", - "pleurer", - "plexus", - "pliage", - "plomb", - "plonger", - "pluie", - "plumage", - "pochette", - "poe\u0301sie", - "poe\u0300te", - "pointe", - "poirier", - "poisson", - "poivre", - "polaire", - "policier", - "pollen", - "polygone", - "pommade", - "pompier", - "ponctuel", - "ponde\u0301rer", - "poney", - "portique", - "position", - "posse\u0301der", - "posture", - "potager", - "poteau", - "potion", - "pouce", - "poulain", - "poumon", - "pourpre", - "poussin", - "pouvoir", - "prairie", - "pratique", - "pre\u0301cieux", - "pre\u0301dire", - "pre\u0301fixe", - "pre\u0301lude", - "pre\u0301nom", - "pre\u0301sence", - "pre\u0301texte", - "pre\u0301voir", - "primitif", - "prince", - "prison", - "priver", - "proble\u0300me", - "proce\u0301der", - "prodige", - "profond", - "progre\u0300s", - "proie", - "projeter", - "prologue", - "promener", - "propre", - "prospe\u0300re", - "prote\u0301ger", - "prouesse", - "proverbe", - "prudence", - "pruneau", - "psychose", - "public", - "puceron", - "puiser", - "pulpe", - "pulsar", - "punaise", - "punitif", - "pupitre", - "purifier", - "puzzle", - "pyramide", - "quasar", - "querelle", - "question", - "quie\u0301tude", - "quitter", - "quotient", - "racine", - "raconter", - "radieux", - "ragondin", - "raideur", - "raisin", - "ralentir", - "rallonge", - "ramasser", - "rapide", - "rasage", - "ratisser", - "ravager", - "ravin", - "rayonner", - "re\u0301actif", - "re\u0301agir", - "re\u0301aliser", - "re\u0301animer", - "recevoir", - "re\u0301citer", - "re\u0301clamer", - "re\u0301colter", - "recruter", - "reculer", - "recycler", - "re\u0301diger", - "redouter", - "refaire", - "re\u0301flexe", - "re\u0301former", - "refrain", - "refuge", - "re\u0301galien", - "re\u0301gion", - "re\u0301glage", - "re\u0301gulier", - "re\u0301ite\u0301rer", - "rejeter", - "rejouer", - "relatif", - "relever", - "relief", - "remarque", - "reme\u0300de", - "remise", - "remonter", - "remplir", - "remuer", - "renard", - "renfort", - "renifler", - "renoncer", - "rentrer", - "renvoi", - "replier", - "reporter", - "reprise", - "reptile", - "requin", - "re\u0301serve", - "re\u0301sineux", - "re\u0301soudre", - "respect", - "rester", - "re\u0301sultat", - "re\u0301tablir", - "retenir", - "re\u0301ticule", - "retomber", - "retracer", - "re\u0301union", - "re\u0301ussir", - "revanche", - "revivre", - "re\u0301volte", - "re\u0301vulsif", - "richesse", - "rideau", - "rieur", - "rigide", - "rigoler", - "rincer", - "riposter", - "risible", - "risque", - "rituel", - "rival", - "rivie\u0300re", - "rocheux", - "romance", - "rompre", - "ronce", - "rondin", - "roseau", - "rosier", - "rotatif", - "rotor", - "rotule", - "rouge", - "rouille", - "rouleau", - "routine", - "royaume", - "ruban", - "rubis", - "ruche", - "ruelle", - "rugueux", - "ruiner", - "ruisseau", - "ruser", - "rustique", - "rythme", - "sabler", - "saboter", - "sabre", - "sacoche", - "safari", - "sagesse", - "saisir", - "salade", - "salive", - "salon", - "saluer", - "samedi", - "sanction", - "sanglier", - "sarcasme", - "sardine", - "saturer", - "saugrenu", - "saumon", - "sauter", - "sauvage", - "savant", - "savonner", - "scalpel", - "scandale", - "sce\u0301le\u0301rat", - "sce\u0301nario", - "sceptre", - "sche\u0301ma", - "science", - "scinder", - "score", - "scrutin", - "sculpter", - "se\u0301ance", - "se\u0301cable", - "se\u0301cher", - "secouer", - "se\u0301cre\u0301ter", - "se\u0301datif", - "se\u0301duire", - "seigneur", - "se\u0301jour", - "se\u0301lectif", - "semaine", - "sembler", - "semence", - "se\u0301minal", - "se\u0301nateur", - "sensible", - "sentence", - "se\u0301parer", - "se\u0301quence", - "serein", - "sergent", - "se\u0301rieux", - "serrure", - "se\u0301rum", - "service", - "se\u0301same", - "se\u0301vir", - "sevrage", - "sextuple", - "side\u0301ral", - "sie\u0300cle", - "sie\u0301ger", - "siffler", - "sigle", - "signal", - "silence", - "silicium", - "simple", - "since\u0300re", - "sinistre", - "siphon", - "sirop", - "sismique", - "situer", - "skier", - "social", - "socle", - "sodium", - "soigneux", - "soldat", - "soleil", - "solitude", - "soluble", - "sombre", - "sommeil", - "somnoler", - "sonde", - "songeur", - "sonnette", - "sonore", - "sorcier", - "sortir", - "sosie", - "sottise", - "soucieux", - "soudure", - "souffle", - "soulever", - "soupape", - "source", - "soutirer", - "souvenir", - "spacieux", - "spatial", - "spe\u0301cial", - "sphe\u0300re", - "spiral", - "stable", - "station", - "sternum", - "stimulus", - "stipuler", - "strict", - "studieux", - "stupeur", - "styliste", - "sublime", - "substrat", - "subtil", - "subvenir", - "succe\u0300s", - "sucre", - "suffixe", - "sugge\u0301rer", - "suiveur", - "sulfate", - "superbe", - "supplier", - "surface", - "suricate", - "surmener", - "surprise", - "sursaut", - "survie", - "suspect", - "syllabe", - "symbole", - "syme\u0301trie", - "synapse", - "syntaxe", - "syste\u0300me", - "tabac", - "tablier", - "tactile", - "tailler", - "talent", - "talisman", - "talonner", - "tambour", - "tamiser", - "tangible", - "tapis", - "taquiner", - "tarder", - "tarif", - "tartine", - "tasse", - "tatami", - "tatouage", - "taupe", - "taureau", - "taxer", - "te\u0301moin", - "temporel", - "tenaille", - "tendre", - "teneur", - "tenir", - "tension", - "terminer", - "terne", - "terrible", - "te\u0301tine", - "texte", - "the\u0300me", - "the\u0301orie", - "the\u0301rapie", - "thorax", - "tibia", - "tie\u0300de", - "timide", - "tirelire", - "tiroir", - "tissu", - "titane", - "titre", - "tituber", - "toboggan", - "tole\u0301rant", - "tomate", - "tonique", - "tonneau", - "toponyme", - "torche", - "tordre", - "tornade", - "torpille", - "torrent", - "torse", - "tortue", - "totem", - "toucher", - "tournage", - "tousser", - "toxine", - "traction", - "trafic", - "tragique", - "trahir", - "train", - "trancher", - "travail", - "tre\u0300fle", - "tremper", - "tre\u0301sor", - "treuil", - "triage", - "tribunal", - "tricoter", - "trilogie", - "triomphe", - "tripler", - "triturer", - "trivial", - "trombone", - "tronc", - "tropical", - "troupeau", - "tuile", - "tulipe", - "tumulte", - "tunnel", - "turbine", - "tuteur", - "tutoyer", - "tuyau", - "tympan", - "typhon", - "typique", - "tyran", - "ubuesque", - "ultime", - "ultrason", - "unanime", - "unifier", - "union", - "unique", - "unitaire", - "univers", - "uranium", - "urbain", - "urticant", - "usage", - "usine", - "usuel", - "usure", - "utile", - "utopie", - "vacarme", - "vaccin", - "vagabond", - "vague", - "vaillant", - "vaincre", - "vaisseau", - "valable", - "valise", - "vallon", - "valve", - "vampire", - "vanille", - "vapeur", - "varier", - "vaseux", - "vassal", - "vaste", - "vecteur", - "vedette", - "ve\u0301ge\u0301tal", - "ve\u0301hicule", - "veinard", - "ve\u0301loce", - "vendredi", - "ve\u0301ne\u0301rer", - "venger", - "venimeux", - "ventouse", - "verdure", - "ve\u0301rin", - "vernir", - "verrou", - "verser", - "vertu", - "veston", - "ve\u0301te\u0301ran", - "ve\u0301tuste", - "vexant", - "vexer", - "viaduc", - "viande", - "victoire", - "vidange", - "vide\u0301o", - "vignette", - "vigueur", - "vilain", - "village", - "vinaigre", - "violon", - "vipe\u0300re", - "virement", - "virtuose", - "virus", - "visage", - "viseur", - "vision", - "visqueux", - "visuel", - "vital", - "vitesse", - "viticole", - "vitrine", - "vivace", - "vivipare", - "vocation", - "voguer", - "voile", - "voisin", - "voiture", - "volaille", - "volcan", - "voltiger", - "volume", - "vorace", - "vortex", - "voter", - "vouloir", - "voyage", - "voyelle", - "wagon", - "xe\u0301non", - "yacht", - "ze\u0300bre", - "ze\u0301nith", - "zeste", - "zoologie" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/italian.json -var require_italian = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/italian.json"(exports2, module2) { - module2.exports = [ - "abaco", - "abbaglio", - "abbinato", - "abete", - "abisso", - "abolire", - "abrasivo", - "abrogato", - "accadere", - "accenno", - "accusato", - "acetone", - "achille", - "acido", - "acqua", - "acre", - "acrilico", - "acrobata", - "acuto", - "adagio", - "addebito", - "addome", - "adeguato", - "aderire", - "adipe", - "adottare", - "adulare", - "affabile", - "affetto", - "affisso", - "affranto", - "aforisma", - "afoso", - "africano", - "agave", - "agente", - "agevole", - "aggancio", - "agire", - "agitare", - "agonismo", - "agricolo", - "agrumeto", - "aguzzo", - "alabarda", - "alato", - "albatro", - "alberato", - "albo", - "albume", - "alce", - "alcolico", - "alettone", - "alfa", - "algebra", - "aliante", - "alibi", - "alimento", - "allagato", - "allegro", - "allievo", - "allodola", - "allusivo", - "almeno", - "alogeno", - "alpaca", - "alpestre", - "altalena", - "alterno", - "alticcio", - "altrove", - "alunno", - "alveolo", - "alzare", - "amalgama", - "amanita", - "amarena", - "ambito", - "ambrato", - "ameba", - "america", - "ametista", - "amico", - "ammasso", - "ammenda", - "ammirare", - "ammonito", - "amore", - "ampio", - "ampliare", - "amuleto", - "anacardo", - "anagrafe", - "analista", - "anarchia", - "anatra", - "anca", - "ancella", - "ancora", - "andare", - "andrea", - "anello", - "angelo", - "angolare", - "angusto", - "anima", - "annegare", - "annidato", - "anno", - "annuncio", - "anonimo", - "anticipo", - "anzi", - "apatico", - "apertura", - "apode", - "apparire", - "appetito", - "appoggio", - "approdo", - "appunto", - "aprile", - "arabica", - "arachide", - "aragosta", - "araldica", - "arancio", - "aratura", - "arazzo", - "arbitro", - "archivio", - "ardito", - "arenile", - "argento", - "argine", - "arguto", - "aria", - "armonia", - "arnese", - "arredato", - "arringa", - "arrosto", - "arsenico", - "arso", - "artefice", - "arzillo", - "asciutto", - "ascolto", - "asepsi", - "asettico", - "asfalto", - "asino", - "asola", - "aspirato", - "aspro", - "assaggio", - "asse", - "assoluto", - "assurdo", - "asta", - "astenuto", - "astice", - "astratto", - "atavico", - "ateismo", - "atomico", - "atono", - "attesa", - "attivare", - "attorno", - "attrito", - "attuale", - "ausilio", - "austria", - "autista", - "autonomo", - "autunno", - "avanzato", - "avere", - "avvenire", - "avviso", - "avvolgere", - "azione", - "azoto", - "azzimo", - "azzurro", - "babele", - "baccano", - "bacino", - "baco", - "badessa", - "badilata", - "bagnato", - "baita", - "balcone", - "baldo", - "balena", - "ballata", - "balzano", - "bambino", - "bandire", - "baraonda", - "barbaro", - "barca", - "baritono", - "barlume", - "barocco", - "basilico", - "basso", - "batosta", - "battuto", - "baule", - "bava", - "bavosa", - "becco", - "beffa", - "belgio", - "belva", - "benda", - "benevole", - "benigno", - "benzina", - "bere", - "berlina", - "beta", - "bibita", - "bici", - "bidone", - "bifido", - "biga", - "bilancia", - "bimbo", - "binocolo", - "biologo", - "bipede", - "bipolare", - "birbante", - "birra", - "biscotto", - "bisesto", - "bisnonno", - "bisonte", - "bisturi", - "bizzarro", - "blando", - "blatta", - "bollito", - "bonifico", - "bordo", - "bosco", - "botanico", - "bottino", - "bozzolo", - "braccio", - "bradipo", - "brama", - "branca", - "bravura", - "bretella", - "brevetto", - "brezza", - "briglia", - "brillante", - "brindare", - "broccolo", - "brodo", - "bronzina", - "brullo", - "bruno", - "bubbone", - "buca", - "budino", - "buffone", - "buio", - "bulbo", - "buono", - "burlone", - "burrasca", - "bussola", - "busta", - "cadetto", - "caduco", - "calamaro", - "calcolo", - "calesse", - "calibro", - "calmo", - "caloria", - "cambusa", - "camerata", - "camicia", - "cammino", - "camola", - "campale", - "canapa", - "candela", - "cane", - "canino", - "canotto", - "cantina", - "capace", - "capello", - "capitolo", - "capogiro", - "cappero", - "capra", - "capsula", - "carapace", - "carcassa", - "cardo", - "carisma", - "carovana", - "carretto", - "cartolina", - "casaccio", - "cascata", - "caserma", - "caso", - "cassone", - "castello", - "casuale", - "catasta", - "catena", - "catrame", - "cauto", - "cavillo", - "cedibile", - "cedrata", - "cefalo", - "celebre", - "cellulare", - "cena", - "cenone", - "centesimo", - "ceramica", - "cercare", - "certo", - "cerume", - "cervello", - "cesoia", - "cespo", - "ceto", - "chela", - "chiaro", - "chicca", - "chiedere", - "chimera", - "china", - "chirurgo", - "chitarra", - "ciao", - "ciclismo", - "cifrare", - "cigno", - "cilindro", - "ciottolo", - "circa", - "cirrosi", - "citrico", - "cittadino", - "ciuffo", - "civetta", - "civile", - "classico", - "clinica", - "cloro", - "cocco", - "codardo", - "codice", - "coerente", - "cognome", - "collare", - "colmato", - "colore", - "colposo", - "coltivato", - "colza", - "coma", - "cometa", - "commando", - "comodo", - "computer", - "comune", - "conciso", - "condurre", - "conferma", - "congelare", - "coniuge", - "connesso", - "conoscere", - "consumo", - "continuo", - "convegno", - "coperto", - "copione", - "coppia", - "copricapo", - "corazza", - "cordata", - "coricato", - "cornice", - "corolla", - "corpo", - "corredo", - "corsia", - "cortese", - "cosmico", - "costante", - "cottura", - "covato", - "cratere", - "cravatta", - "creato", - "credere", - "cremoso", - "crescita", - "creta", - "criceto", - "crinale", - "crisi", - "critico", - "croce", - "cronaca", - "crostata", - "cruciale", - "crusca", - "cucire", - "cuculo", - "cugino", - "cullato", - "cupola", - "curatore", - "cursore", - "curvo", - "cuscino", - "custode", - "dado", - "daino", - "dalmata", - "damerino", - "daniela", - "dannoso", - "danzare", - "datato", - "davanti", - "davvero", - "debutto", - "decennio", - "deciso", - "declino", - "decollo", - "decreto", - "dedicato", - "definito", - "deforme", - "degno", - "delegare", - "delfino", - "delirio", - "delta", - "demenza", - "denotato", - "dentro", - "deposito", - "derapata", - "derivare", - "deroga", - "descritto", - "deserto", - "desiderio", - "desumere", - "detersivo", - "devoto", - "diametro", - "dicembre", - "diedro", - "difeso", - "diffuso", - "digerire", - "digitale", - "diluvio", - "dinamico", - "dinnanzi", - "dipinto", - "diploma", - "dipolo", - "diradare", - "dire", - "dirotto", - "dirupo", - "disagio", - "discreto", - "disfare", - "disgelo", - "disposto", - "distanza", - "disumano", - "dito", - "divano", - "divelto", - "dividere", - "divorato", - "doblone", - "docente", - "doganale", - "dogma", - "dolce", - "domato", - "domenica", - "dominare", - "dondolo", - "dono", - "dormire", - "dote", - "dottore", - "dovuto", - "dozzina", - "drago", - "druido", - "dubbio", - "dubitare", - "ducale", - "duna", - "duomo", - "duplice", - "duraturo", - "ebano", - "eccesso", - "ecco", - "eclissi", - "economia", - "edera", - "edicola", - "edile", - "editoria", - "educare", - "egemonia", - "egli", - "egoismo", - "egregio", - "elaborato", - "elargire", - "elegante", - "elencato", - "eletto", - "elevare", - "elfico", - "elica", - "elmo", - "elsa", - "eluso", - "emanato", - "emblema", - "emesso", - "emiro", - "emotivo", - "emozione", - "empirico", - "emulo", - "endemico", - "enduro", - "energia", - "enfasi", - "enoteca", - "entrare", - "enzima", - "epatite", - "epilogo", - "episodio", - "epocale", - "eppure", - "equatore", - "erario", - "erba", - "erboso", - "erede", - "eremita", - "erigere", - "ermetico", - "eroe", - "erosivo", - "errante", - "esagono", - "esame", - "esanime", - "esaudire", - "esca", - "esempio", - "esercito", - "esibito", - "esigente", - "esistere", - "esito", - "esofago", - "esortato", - "esoso", - "espanso", - "espresso", - "essenza", - "esso", - "esteso", - "estimare", - "estonia", - "estroso", - "esultare", - "etilico", - "etnico", - "etrusco", - "etto", - "euclideo", - "europa", - "evaso", - "evidenza", - "evitato", - "evoluto", - "evviva", - "fabbrica", - "faccenda", - "fachiro", - "falco", - "famiglia", - "fanale", - "fanfara", - "fango", - "fantasma", - "fare", - "farfalla", - "farinoso", - "farmaco", - "fascia", - "fastoso", - "fasullo", - "faticare", - "fato", - "favoloso", - "febbre", - "fecola", - "fede", - "fegato", - "felpa", - "feltro", - "femmina", - "fendere", - "fenomeno", - "fermento", - "ferro", - "fertile", - "fessura", - "festivo", - "fetta", - "feudo", - "fiaba", - "fiducia", - "fifa", - "figurato", - "filo", - "finanza", - "finestra", - "finire", - "fiore", - "fiscale", - "fisico", - "fiume", - "flacone", - "flamenco", - "flebo", - "flemma", - "florido", - "fluente", - "fluoro", - "fobico", - "focaccia", - "focoso", - "foderato", - "foglio", - "folata", - "folclore", - "folgore", - "fondente", - "fonetico", - "fonia", - "fontana", - "forbito", - "forchetta", - "foresta", - "formica", - "fornaio", - "foro", - "fortezza", - "forzare", - "fosfato", - "fosso", - "fracasso", - "frana", - "frassino", - "fratello", - "freccetta", - "frenata", - "fresco", - "frigo", - "frollino", - "fronde", - "frugale", - "frutta", - "fucilata", - "fucsia", - "fuggente", - "fulmine", - "fulvo", - "fumante", - "fumetto", - "fumoso", - "fune", - "funzione", - "fuoco", - "furbo", - "furgone", - "furore", - "fuso", - "futile", - "gabbiano", - "gaffe", - "galateo", - "gallina", - "galoppo", - "gambero", - "gamma", - "garanzia", - "garbo", - "garofano", - "garzone", - "gasdotto", - "gasolio", - "gastrico", - "gatto", - "gaudio", - "gazebo", - "gazzella", - "geco", - "gelatina", - "gelso", - "gemello", - "gemmato", - "gene", - "genitore", - "gennaio", - "genotipo", - "gergo", - "ghepardo", - "ghiaccio", - "ghisa", - "giallo", - "gilda", - "ginepro", - "giocare", - "gioiello", - "giorno", - "giove", - "girato", - "girone", - "gittata", - "giudizio", - "giurato", - "giusto", - "globulo", - "glutine", - "gnomo", - "gobba", - "golf", - "gomito", - "gommone", - "gonfio", - "gonna", - "governo", - "gracile", - "grado", - "grafico", - "grammo", - "grande", - "grattare", - "gravoso", - "grazia", - "greca", - "gregge", - "grifone", - "grigio", - "grinza", - "grotta", - "gruppo", - "guadagno", - "guaio", - "guanto", - "guardare", - "gufo", - "guidare", - "ibernato", - "icona", - "identico", - "idillio", - "idolo", - "idra", - "idrico", - "idrogeno", - "igiene", - "ignaro", - "ignorato", - "ilare", - "illeso", - "illogico", - "illudere", - "imballo", - "imbevuto", - "imbocco", - "imbuto", - "immane", - "immerso", - "immolato", - "impacco", - "impeto", - "impiego", - "importo", - "impronta", - "inalare", - "inarcare", - "inattivo", - "incanto", - "incendio", - "inchino", - "incisivo", - "incluso", - "incontro", - "incrocio", - "incubo", - "indagine", - "india", - "indole", - "inedito", - "infatti", - "infilare", - "inflitto", - "ingaggio", - "ingegno", - "inglese", - "ingordo", - "ingrosso", - "innesco", - "inodore", - "inoltrare", - "inondato", - "insano", - "insetto", - "insieme", - "insonnia", - "insulina", - "intasato", - "intero", - "intonaco", - "intuito", - "inumidire", - "invalido", - "invece", - "invito", - "iperbole", - "ipnotico", - "ipotesi", - "ippica", - "iride", - "irlanda", - "ironico", - "irrigato", - "irrorare", - "isolato", - "isotopo", - "isterico", - "istituto", - "istrice", - "italia", - "iterare", - "labbro", - "labirinto", - "lacca", - "lacerato", - "lacrima", - "lacuna", - "laddove", - "lago", - "lampo", - "lancetta", - "lanterna", - "lardoso", - "larga", - "laringe", - "lastra", - "latenza", - "latino", - "lattuga", - "lavagna", - "lavoro", - "legale", - "leggero", - "lembo", - "lentezza", - "lenza", - "leone", - "lepre", - "lesivo", - "lessato", - "lesto", - "letterale", - "leva", - "levigato", - "libero", - "lido", - "lievito", - "lilla", - "limatura", - "limitare", - "limpido", - "lineare", - "lingua", - "liquido", - "lira", - "lirica", - "lisca", - "lite", - "litigio", - "livrea", - "locanda", - "lode", - "logica", - "lombare", - "londra", - "longevo", - "loquace", - "lorenzo", - "loto", - "lotteria", - "luce", - "lucidato", - "lumaca", - "luminoso", - "lungo", - "lupo", - "luppolo", - "lusinga", - "lusso", - "lutto", - "macabro", - "macchina", - "macero", - "macinato", - "madama", - "magico", - "maglia", - "magnete", - "magro", - "maiolica", - "malafede", - "malgrado", - "malinteso", - "malsano", - "malto", - "malumore", - "mana", - "mancia", - "mandorla", - "mangiare", - "manifesto", - "mannaro", - "manovra", - "mansarda", - "mantide", - "manubrio", - "mappa", - "maratona", - "marcire", - "maretta", - "marmo", - "marsupio", - "maschera", - "massaia", - "mastino", - "materasso", - "matricola", - "mattone", - "maturo", - "mazurca", - "meandro", - "meccanico", - "mecenate", - "medesimo", - "meditare", - "mega", - "melassa", - "melis", - "melodia", - "meninge", - "meno", - "mensola", - "mercurio", - "merenda", - "merlo", - "meschino", - "mese", - "messere", - "mestolo", - "metallo", - "metodo", - "mettere", - "miagolare", - "mica", - "micelio", - "michele", - "microbo", - "midollo", - "miele", - "migliore", - "milano", - "milite", - "mimosa", - "minerale", - "mini", - "minore", - "mirino", - "mirtillo", - "miscela", - "missiva", - "misto", - "misurare", - "mitezza", - "mitigare", - "mitra", - "mittente", - "mnemonico", - "modello", - "modifica", - "modulo", - "mogano", - "mogio", - "mole", - "molosso", - "monastero", - "monco", - "mondina", - "monetario", - "monile", - "monotono", - "monsone", - "montato", - "monviso", - "mora", - "mordere", - "morsicato", - "mostro", - "motivato", - "motosega", - "motto", - "movenza", - "movimento", - "mozzo", - "mucca", - "mucosa", - "muffa", - "mughetto", - "mugnaio", - "mulatto", - "mulinello", - "multiplo", - "mummia", - "munto", - "muovere", - "murale", - "musa", - "muscolo", - "musica", - "mutevole", - "muto", - "nababbo", - "nafta", - "nanometro", - "narciso", - "narice", - "narrato", - "nascere", - "nastrare", - "naturale", - "nautica", - "naviglio", - "nebulosa", - "necrosi", - "negativo", - "negozio", - "nemmeno", - "neofita", - "neretto", - "nervo", - "nessuno", - "nettuno", - "neutrale", - "neve", - "nevrotico", - "nicchia", - "ninfa", - "nitido", - "nobile", - "nocivo", - "nodo", - "nome", - "nomina", - "nordico", - "normale", - "norvegese", - "nostrano", - "notare", - "notizia", - "notturno", - "novella", - "nucleo", - "nulla", - "numero", - "nuovo", - "nutrire", - "nuvola", - "nuziale", - "oasi", - "obbedire", - "obbligo", - "obelisco", - "oblio", - "obolo", - "obsoleto", - "occasione", - "occhio", - "occidente", - "occorrere", - "occultare", - "ocra", - "oculato", - "odierno", - "odorare", - "offerta", - "offrire", - "offuscato", - "oggetto", - "oggi", - "ognuno", - "olandese", - "olfatto", - "oliato", - "oliva", - "ologramma", - "oltre", - "omaggio", - "ombelico", - "ombra", - "omega", - "omissione", - "ondoso", - "onere", - "onice", - "onnivoro", - "onorevole", - "onta", - "operato", - "opinione", - "opposto", - "oracolo", - "orafo", - "ordine", - "orecchino", - "orefice", - "orfano", - "organico", - "origine", - "orizzonte", - "orma", - "ormeggio", - "ornativo", - "orologio", - "orrendo", - "orribile", - "ortensia", - "ortica", - "orzata", - "orzo", - "osare", - "oscurare", - "osmosi", - "ospedale", - "ospite", - "ossa", - "ossidare", - "ostacolo", - "oste", - "otite", - "otre", - "ottagono", - "ottimo", - "ottobre", - "ovale", - "ovest", - "ovino", - "oviparo", - "ovocito", - "ovunque", - "ovviare", - "ozio", - "pacchetto", - "pace", - "pacifico", - "padella", - "padrone", - "paese", - "paga", - "pagina", - "palazzina", - "palesare", - "pallido", - "palo", - "palude", - "pandoro", - "pannello", - "paolo", - "paonazzo", - "paprica", - "parabola", - "parcella", - "parere", - "pargolo", - "pari", - "parlato", - "parola", - "partire", - "parvenza", - "parziale", - "passivo", - "pasticca", - "patacca", - "patologia", - "pattume", - "pavone", - "peccato", - "pedalare", - "pedonale", - "peggio", - "peloso", - "penare", - "pendice", - "penisola", - "pennuto", - "penombra", - "pensare", - "pentola", - "pepe", - "pepita", - "perbene", - "percorso", - "perdonato", - "perforare", - "pergamena", - "periodo", - "permesso", - "perno", - "perplesso", - "persuaso", - "pertugio", - "pervaso", - "pesatore", - "pesista", - "peso", - "pestifero", - "petalo", - "pettine", - "petulante", - "pezzo", - "piacere", - "pianta", - "piattino", - "piccino", - "picozza", - "piega", - "pietra", - "piffero", - "pigiama", - "pigolio", - "pigro", - "pila", - "pilifero", - "pillola", - "pilota", - "pimpante", - "pineta", - "pinna", - "pinolo", - "pioggia", - "piombo", - "piramide", - "piretico", - "pirite", - "pirolisi", - "pitone", - "pizzico", - "placebo", - "planare", - "plasma", - "platano", - "plenario", - "pochezza", - "poderoso", - "podismo", - "poesia", - "poggiare", - "polenta", - "poligono", - "pollice", - "polmonite", - "polpetta", - "polso", - "poltrona", - "polvere", - "pomice", - "pomodoro", - "ponte", - "popoloso", - "porfido", - "poroso", - "porpora", - "porre", - "portata", - "posa", - "positivo", - "possesso", - "postulato", - "potassio", - "potere", - "pranzo", - "prassi", - "pratica", - "precluso", - "predica", - "prefisso", - "pregiato", - "prelievo", - "premere", - "prenotare", - "preparato", - "presenza", - "pretesto", - "prevalso", - "prima", - "principe", - "privato", - "problema", - "procura", - "produrre", - "profumo", - "progetto", - "prolunga", - "promessa", - "pronome", - "proposta", - "proroga", - "proteso", - "prova", - "prudente", - "prugna", - "prurito", - "psiche", - "pubblico", - "pudica", - "pugilato", - "pugno", - "pulce", - "pulito", - "pulsante", - "puntare", - "pupazzo", - "pupilla", - "puro", - "quadro", - "qualcosa", - "quasi", - "querela", - "quota", - "raccolto", - "raddoppio", - "radicale", - "radunato", - "raffica", - "ragazzo", - "ragione", - "ragno", - "ramarro", - "ramingo", - "ramo", - "randagio", - "rantolare", - "rapato", - "rapina", - "rappreso", - "rasatura", - "raschiato", - "rasente", - "rassegna", - "rastrello", - "rata", - "ravveduto", - "reale", - "recepire", - "recinto", - "recluta", - "recondito", - "recupero", - "reddito", - "redimere", - "regalato", - "registro", - "regola", - "regresso", - "relazione", - "remare", - "remoto", - "renna", - "replica", - "reprimere", - "reputare", - "resa", - "residente", - "responso", - "restauro", - "rete", - "retina", - "retorica", - "rettifica", - "revocato", - "riassunto", - "ribadire", - "ribelle", - "ribrezzo", - "ricarica", - "ricco", - "ricevere", - "riciclato", - "ricordo", - "ricreduto", - "ridicolo", - "ridurre", - "rifasare", - "riflesso", - "riforma", - "rifugio", - "rigare", - "rigettato", - "righello", - "rilassato", - "rilevato", - "rimanere", - "rimbalzo", - "rimedio", - "rimorchio", - "rinascita", - "rincaro", - "rinforzo", - "rinnovo", - "rinomato", - "rinsavito", - "rintocco", - "rinuncia", - "rinvenire", - "riparato", - "ripetuto", - "ripieno", - "riportare", - "ripresa", - "ripulire", - "risata", - "rischio", - "riserva", - "risibile", - "riso", - "rispetto", - "ristoro", - "risultato", - "risvolto", - "ritardo", - "ritegno", - "ritmico", - "ritrovo", - "riunione", - "riva", - "riverso", - "rivincita", - "rivolto", - "rizoma", - "roba", - "robotico", - "robusto", - "roccia", - "roco", - "rodaggio", - "rodere", - "roditore", - "rogito", - "rollio", - "romantico", - "rompere", - "ronzio", - "rosolare", - "rospo", - "rotante", - "rotondo", - "rotula", - "rovescio", - "rubizzo", - "rubrica", - "ruga", - "rullino", - "rumine", - "rumoroso", - "ruolo", - "rupe", - "russare", - "rustico", - "sabato", - "sabbiare", - "sabotato", - "sagoma", - "salasso", - "saldatura", - "salgemma", - "salivare", - "salmone", - "salone", - "saltare", - "saluto", - "salvo", - "sapere", - "sapido", - "saporito", - "saraceno", - "sarcasmo", - "sarto", - "sassoso", - "satellite", - "satira", - "satollo", - "saturno", - "savana", - "savio", - "saziato", - "sbadiglio", - "sbalzo", - "sbancato", - "sbarra", - "sbattere", - "sbavare", - "sbendare", - "sbirciare", - "sbloccato", - "sbocciato", - "sbrinare", - "sbruffone", - "sbuffare", - "scabroso", - "scadenza", - "scala", - "scambiare", - "scandalo", - "scapola", - "scarso", - "scatenare", - "scavato", - "scelto", - "scenico", - "scettro", - "scheda", - "schiena", - "sciarpa", - "scienza", - "scindere", - "scippo", - "sciroppo", - "scivolo", - "sclerare", - "scodella", - "scolpito", - "scomparto", - "sconforto", - "scoprire", - "scorta", - "scossone", - "scozzese", - "scriba", - "scrollare", - "scrutinio", - "scuderia", - "scultore", - "scuola", - "scuro", - "scusare", - "sdebitare", - "sdoganare", - "seccatura", - "secondo", - "sedano", - "seggiola", - "segnalato", - "segregato", - "seguito", - "selciato", - "selettivo", - "sella", - "selvaggio", - "semaforo", - "sembrare", - "seme", - "seminato", - "sempre", - "senso", - "sentire", - "sepolto", - "sequenza", - "serata", - "serbato", - "sereno", - "serio", - "serpente", - "serraglio", - "servire", - "sestina", - "setola", - "settimana", - "sfacelo", - "sfaldare", - "sfamato", - "sfarzoso", - "sfaticato", - "sfera", - "sfida", - "sfilato", - "sfinge", - "sfocato", - "sfoderare", - "sfogo", - "sfoltire", - "sforzato", - "sfratto", - "sfruttato", - "sfuggito", - "sfumare", - "sfuso", - "sgabello", - "sgarbato", - "sgonfiare", - "sgorbio", - "sgrassato", - "sguardo", - "sibilo", - "siccome", - "sierra", - "sigla", - "signore", - "silenzio", - "sillaba", - "simbolo", - "simpatico", - "simulato", - "sinfonia", - "singolo", - "sinistro", - "sino", - "sintesi", - "sinusoide", - "sipario", - "sisma", - "sistole", - "situato", - "slitta", - "slogatura", - "sloveno", - "smarrito", - "smemorato", - "smentito", - "smeraldo", - "smilzo", - "smontare", - "smottato", - "smussato", - "snellire", - "snervato", - "snodo", - "sobbalzo", - "sobrio", - "soccorso", - "sociale", - "sodale", - "soffitto", - "sogno", - "soldato", - "solenne", - "solido", - "sollazzo", - "solo", - "solubile", - "solvente", - "somatico", - "somma", - "sonda", - "sonetto", - "sonnifero", - "sopire", - "soppeso", - "sopra", - "sorgere", - "sorpasso", - "sorriso", - "sorso", - "sorteggio", - "sorvolato", - "sospiro", - "sosta", - "sottile", - "spada", - "spalla", - "spargere", - "spatola", - "spavento", - "spazzola", - "specie", - "spedire", - "spegnere", - "spelatura", - "speranza", - "spessore", - "spettrale", - "spezzato", - "spia", - "spigoloso", - "spillato", - "spinoso", - "spirale", - "splendido", - "sportivo", - "sposo", - "spranga", - "sprecare", - "spronato", - "spruzzo", - "spuntino", - "squillo", - "sradicare", - "srotolato", - "stabile", - "stacco", - "staffa", - "stagnare", - "stampato", - "stantio", - "starnuto", - "stasera", - "statuto", - "stelo", - "steppa", - "sterzo", - "stiletto", - "stima", - "stirpe", - "stivale", - "stizzoso", - "stonato", - "storico", - "strappo", - "stregato", - "stridulo", - "strozzare", - "strutto", - "stuccare", - "stufo", - "stupendo", - "subentro", - "succoso", - "sudore", - "suggerito", - "sugo", - "sultano", - "suonare", - "superbo", - "supporto", - "surgelato", - "surrogato", - "sussurro", - "sutura", - "svagare", - "svedese", - "sveglio", - "svelare", - "svenuto", - "svezia", - "sviluppo", - "svista", - "svizzera", - "svolta", - "svuotare", - "tabacco", - "tabulato", - "tacciare", - "taciturno", - "tale", - "talismano", - "tampone", - "tannino", - "tara", - "tardivo", - "targato", - "tariffa", - "tarpare", - "tartaruga", - "tasto", - "tattico", - "taverna", - "tavolata", - "tazza", - "teca", - "tecnico", - "telefono", - "temerario", - "tempo", - "temuto", - "tendone", - "tenero", - "tensione", - "tentacolo", - "teorema", - "terme", - "terrazzo", - "terzetto", - "tesi", - "tesserato", - "testato", - "tetro", - "tettoia", - "tifare", - "tigella", - "timbro", - "tinto", - "tipico", - "tipografo", - "tiraggio", - "tiro", - "titanio", - "titolo", - "titubante", - "tizio", - "tizzone", - "toccare", - "tollerare", - "tolto", - "tombola", - "tomo", - "tonfo", - "tonsilla", - "topazio", - "topologia", - "toppa", - "torba", - "tornare", - "torrone", - "tortora", - "toscano", - "tossire", - "tostatura", - "totano", - "trabocco", - "trachea", - "trafila", - "tragedia", - "tralcio", - "tramonto", - "transito", - "trapano", - "trarre", - "trasloco", - "trattato", - "trave", - "treccia", - "tremolio", - "trespolo", - "tributo", - "tricheco", - "trifoglio", - "trillo", - "trincea", - "trio", - "tristezza", - "triturato", - "trivella", - "tromba", - "trono", - "troppo", - "trottola", - "trovare", - "truccato", - "tubatura", - "tuffato", - "tulipano", - "tumulto", - "tunisia", - "turbare", - "turchino", - "tuta", - "tutela", - "ubicato", - "uccello", - "uccisore", - "udire", - "uditivo", - "uffa", - "ufficio", - "uguale", - "ulisse", - "ultimato", - "umano", - "umile", - "umorismo", - "uncinetto", - "ungere", - "ungherese", - "unicorno", - "unificato", - "unisono", - "unitario", - "unte", - "uovo", - "upupa", - "uragano", - "urgenza", - "urlo", - "usanza", - "usato", - "uscito", - "usignolo", - "usuraio", - "utensile", - "utilizzo", - "utopia", - "vacante", - "vaccinato", - "vagabondo", - "vagliato", - "valanga", - "valgo", - "valico", - "valletta", - "valoroso", - "valutare", - "valvola", - "vampata", - "vangare", - "vanitoso", - "vano", - "vantaggio", - "vanvera", - "vapore", - "varano", - "varcato", - "variante", - "vasca", - "vedetta", - "vedova", - "veduto", - "vegetale", - "veicolo", - "velcro", - "velina", - "velluto", - "veloce", - "venato", - "vendemmia", - "vento", - "verace", - "verbale", - "vergogna", - "verifica", - "vero", - "verruca", - "verticale", - "vescica", - "vessillo", - "vestale", - "veterano", - "vetrina", - "vetusto", - "viandante", - "vibrante", - "vicenda", - "vichingo", - "vicinanza", - "vidimare", - "vigilia", - "vigneto", - "vigore", - "vile", - "villano", - "vimini", - "vincitore", - "viola", - "vipera", - "virgola", - "virologo", - "virulento", - "viscoso", - "visione", - "vispo", - "vissuto", - "visura", - "vita", - "vitello", - "vittima", - "vivanda", - "vivido", - "viziare", - "voce", - "voga", - "volatile", - "volere", - "volpe", - "voragine", - "vulcano", - "zampogna", - "zanna", - "zappato", - "zattera", - "zavorra", - "zefiro", - "zelante", - "zelo", - "zenzero", - "zerbino", - "zibetto", - "zinco", - "zircone", - "zitto", - "zolla", - "zotico", - "zucchero", - "zufolo", - "zulu", - "zuppa" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/spanish.json -var require_spanish = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/spanish.json"(exports2, module2) { - module2.exports = [ - "a\u0301baco", - "abdomen", - "abeja", - "abierto", - "abogado", - "abono", - "aborto", - "abrazo", - "abrir", - "abuelo", - "abuso", - "acabar", - "academia", - "acceso", - "accio\u0301n", - "aceite", - "acelga", - "acento", - "aceptar", - "a\u0301cido", - "aclarar", - "acne\u0301", - "acoger", - "acoso", - "activo", - "acto", - "actriz", - "actuar", - "acudir", - "acuerdo", - "acusar", - "adicto", - "admitir", - "adoptar", - "adorno", - "aduana", - "adulto", - "ae\u0301reo", - "afectar", - "aficio\u0301n", - "afinar", - "afirmar", - "a\u0301gil", - "agitar", - "agoni\u0301a", - "agosto", - "agotar", - "agregar", - "agrio", - "agua", - "agudo", - "a\u0301guila", - "aguja", - "ahogo", - "ahorro", - "aire", - "aislar", - "ajedrez", - "ajeno", - "ajuste", - "alacra\u0301n", - "alambre", - "alarma", - "alba", - "a\u0301lbum", - "alcalde", - "aldea", - "alegre", - "alejar", - "alerta", - "aleta", - "alfiler", - "alga", - "algodo\u0301n", - "aliado", - "aliento", - "alivio", - "alma", - "almeja", - "almi\u0301bar", - "altar", - "alteza", - "altivo", - "alto", - "altura", - "alumno", - "alzar", - "amable", - "amante", - "amapola", - "amargo", - "amasar", - "a\u0301mbar", - "a\u0301mbito", - "ameno", - "amigo", - "amistad", - "amor", - "amparo", - "amplio", - "ancho", - "anciano", - "ancla", - "andar", - "ande\u0301n", - "anemia", - "a\u0301ngulo", - "anillo", - "a\u0301nimo", - "ani\u0301s", - "anotar", - "antena", - "antiguo", - "antojo", - "anual", - "anular", - "anuncio", - "an\u0303adir", - "an\u0303ejo", - "an\u0303o", - "apagar", - "aparato", - "apetito", - "apio", - "aplicar", - "apodo", - "aporte", - "apoyo", - "aprender", - "aprobar", - "apuesta", - "apuro", - "arado", - "aran\u0303a", - "arar", - "a\u0301rbitro", - "a\u0301rbol", - "arbusto", - "archivo", - "arco", - "arder", - "ardilla", - "arduo", - "a\u0301rea", - "a\u0301rido", - "aries", - "armoni\u0301a", - "arne\u0301s", - "aroma", - "arpa", - "arpo\u0301n", - "arreglo", - "arroz", - "arruga", - "arte", - "artista", - "asa", - "asado", - "asalto", - "ascenso", - "asegurar", - "aseo", - "asesor", - "asiento", - "asilo", - "asistir", - "asno", - "asombro", - "a\u0301spero", - "astilla", - "astro", - "astuto", - "asumir", - "asunto", - "atajo", - "ataque", - "atar", - "atento", - "ateo", - "a\u0301tico", - "atleta", - "a\u0301tomo", - "atraer", - "atroz", - "atu\u0301n", - "audaz", - "audio", - "auge", - "aula", - "aumento", - "ausente", - "autor", - "aval", - "avance", - "avaro", - "ave", - "avellana", - "avena", - "avestruz", - "avio\u0301n", - "aviso", - "ayer", - "ayuda", - "ayuno", - "azafra\u0301n", - "azar", - "azote", - "azu\u0301car", - "azufre", - "azul", - "baba", - "babor", - "bache", - "bahi\u0301a", - "baile", - "bajar", - "balanza", - "balco\u0301n", - "balde", - "bambu\u0301", - "banco", - "banda", - "ban\u0303o", - "barba", - "barco", - "barniz", - "barro", - "ba\u0301scula", - "basto\u0301n", - "basura", - "batalla", - "bateri\u0301a", - "batir", - "batuta", - "bau\u0301l", - "bazar", - "bebe\u0301", - "bebida", - "bello", - "besar", - "beso", - "bestia", - "bicho", - "bien", - "bingo", - "blanco", - "bloque", - "blusa", - "boa", - "bobina", - "bobo", - "boca", - "bocina", - "boda", - "bodega", - "boina", - "bola", - "bolero", - "bolsa", - "bomba", - "bondad", - "bonito", - "bono", - "bonsa\u0301i", - "borde", - "borrar", - "bosque", - "bote", - "boti\u0301n", - "bo\u0301veda", - "bozal", - "bravo", - "brazo", - "brecha", - "breve", - "brillo", - "brinco", - "brisa", - "broca", - "broma", - "bronce", - "brote", - "bruja", - "brusco", - "bruto", - "buceo", - "bucle", - "bueno", - "buey", - "bufanda", - "bufo\u0301n", - "bu\u0301ho", - "buitre", - "bulto", - "burbuja", - "burla", - "burro", - "buscar", - "butaca", - "buzo\u0301n", - "caballo", - "cabeza", - "cabina", - "cabra", - "cacao", - "cada\u0301ver", - "cadena", - "caer", - "cafe\u0301", - "cai\u0301da", - "caima\u0301n", - "caja", - "cajo\u0301n", - "cal", - "calamar", - "calcio", - "caldo", - "calidad", - "calle", - "calma", - "calor", - "calvo", - "cama", - "cambio", - "camello", - "camino", - "campo", - "ca\u0301ncer", - "candil", - "canela", - "canguro", - "canica", - "canto", - "can\u0303a", - "can\u0303o\u0301n", - "caoba", - "caos", - "capaz", - "capita\u0301n", - "capote", - "captar", - "capucha", - "cara", - "carbo\u0301n", - "ca\u0301rcel", - "careta", - "carga", - "carin\u0303o", - "carne", - "carpeta", - "carro", - "carta", - "casa", - "casco", - "casero", - "caspa", - "castor", - "catorce", - "catre", - "caudal", - "causa", - "cazo", - "cebolla", - "ceder", - "cedro", - "celda", - "ce\u0301lebre", - "celoso", - "ce\u0301lula", - "cemento", - "ceniza", - "centro", - "cerca", - "cerdo", - "cereza", - "cero", - "cerrar", - "certeza", - "ce\u0301sped", - "cetro", - "chacal", - "chaleco", - "champu\u0301", - "chancla", - "chapa", - "charla", - "chico", - "chiste", - "chivo", - "choque", - "choza", - "chuleta", - "chupar", - "ciclo\u0301n", - "ciego", - "cielo", - "cien", - "cierto", - "cifra", - "cigarro", - "cima", - "cinco", - "cine", - "cinta", - "cipre\u0301s", - "circo", - "ciruela", - "cisne", - "cita", - "ciudad", - "clamor", - "clan", - "claro", - "clase", - "clave", - "cliente", - "clima", - "cli\u0301nica", - "cobre", - "coccio\u0301n", - "cochino", - "cocina", - "coco", - "co\u0301digo", - "codo", - "cofre", - "coger", - "cohete", - "coji\u0301n", - "cojo", - "cola", - "colcha", - "colegio", - "colgar", - "colina", - "collar", - "colmo", - "columna", - "combate", - "comer", - "comida", - "co\u0301modo", - "compra", - "conde", - "conejo", - "conga", - "conocer", - "consejo", - "contar", - "copa", - "copia", - "corazo\u0301n", - "corbata", - "corcho", - "cordo\u0301n", - "corona", - "correr", - "coser", - "cosmos", - "costa", - "cra\u0301neo", - "cra\u0301ter", - "crear", - "crecer", - "crei\u0301do", - "crema", - "cri\u0301a", - "crimen", - "cripta", - "crisis", - "cromo", - "cro\u0301nica", - "croqueta", - "crudo", - "cruz", - "cuadro", - "cuarto", - "cuatro", - "cubo", - "cubrir", - "cuchara", - "cuello", - "cuento", - "cuerda", - "cuesta", - "cueva", - "cuidar", - "culebra", - "culpa", - "culto", - "cumbre", - "cumplir", - "cuna", - "cuneta", - "cuota", - "cupo\u0301n", - "cu\u0301pula", - "curar", - "curioso", - "curso", - "curva", - "cutis", - "dama", - "danza", - "dar", - "dardo", - "da\u0301til", - "deber", - "de\u0301bil", - "de\u0301cada", - "decir", - "dedo", - "defensa", - "definir", - "dejar", - "delfi\u0301n", - "delgado", - "delito", - "demora", - "denso", - "dental", - "deporte", - "derecho", - "derrota", - "desayuno", - "deseo", - "desfile", - "desnudo", - "destino", - "desvi\u0301o", - "detalle", - "detener", - "deuda", - "di\u0301a", - "diablo", - "diadema", - "diamante", - "diana", - "diario", - "dibujo", - "dictar", - "diente", - "dieta", - "diez", - "difi\u0301cil", - "digno", - "dilema", - "diluir", - "dinero", - "directo", - "dirigir", - "disco", - "disen\u0303o", - "disfraz", - "diva", - "divino", - "doble", - "doce", - "dolor", - "domingo", - "don", - "donar", - "dorado", - "dormir", - "dorso", - "dos", - "dosis", - "drago\u0301n", - "droga", - "ducha", - "duda", - "duelo", - "duen\u0303o", - "dulce", - "du\u0301o", - "duque", - "durar", - "dureza", - "duro", - "e\u0301bano", - "ebrio", - "echar", - "eco", - "ecuador", - "edad", - "edicio\u0301n", - "edificio", - "editor", - "educar", - "efecto", - "eficaz", - "eje", - "ejemplo", - "elefante", - "elegir", - "elemento", - "elevar", - "elipse", - "e\u0301lite", - "elixir", - "elogio", - "eludir", - "embudo", - "emitir", - "emocio\u0301n", - "empate", - "empen\u0303o", - "empleo", - "empresa", - "enano", - "encargo", - "enchufe", - "enci\u0301a", - "enemigo", - "enero", - "enfado", - "enfermo", - "engan\u0303o", - "enigma", - "enlace", - "enorme", - "enredo", - "ensayo", - "ensen\u0303ar", - "entero", - "entrar", - "envase", - "envi\u0301o", - "e\u0301poca", - "equipo", - "erizo", - "escala", - "escena", - "escolar", - "escribir", - "escudo", - "esencia", - "esfera", - "esfuerzo", - "espada", - "espejo", - "espi\u0301a", - "esposa", - "espuma", - "esqui\u0301", - "estar", - "este", - "estilo", - "estufa", - "etapa", - "eterno", - "e\u0301tica", - "etnia", - "evadir", - "evaluar", - "evento", - "evitar", - "exacto", - "examen", - "exceso", - "excusa", - "exento", - "exigir", - "exilio", - "existir", - "e\u0301xito", - "experto", - "explicar", - "exponer", - "extremo", - "fa\u0301brica", - "fa\u0301bula", - "fachada", - "fa\u0301cil", - "factor", - "faena", - "faja", - "falda", - "fallo", - "falso", - "faltar", - "fama", - "familia", - "famoso", - "farao\u0301n", - "farmacia", - "farol", - "farsa", - "fase", - "fatiga", - "fauna", - "favor", - "fax", - "febrero", - "fecha", - "feliz", - "feo", - "feria", - "feroz", - "fe\u0301rtil", - "fervor", - "festi\u0301n", - "fiable", - "fianza", - "fiar", - "fibra", - "ficcio\u0301n", - "ficha", - "fideo", - "fiebre", - "fiel", - "fiera", - "fiesta", - "figura", - "fijar", - "fijo", - "fila", - "filete", - "filial", - "filtro", - "fin", - "finca", - "fingir", - "finito", - "firma", - "flaco", - "flauta", - "flecha", - "flor", - "flota", - "fluir", - "flujo", - "flu\u0301or", - "fobia", - "foca", - "fogata", - "fogo\u0301n", - "folio", - "folleto", - "fondo", - "forma", - "forro", - "fortuna", - "forzar", - "fosa", - "foto", - "fracaso", - "fra\u0301gil", - "franja", - "frase", - "fraude", - "frei\u0301r", - "freno", - "fresa", - "fri\u0301o", - "frito", - "fruta", - "fuego", - "fuente", - "fuerza", - "fuga", - "fumar", - "funcio\u0301n", - "funda", - "furgo\u0301n", - "furia", - "fusil", - "fu\u0301tbol", - "futuro", - "gacela", - "gafas", - "gaita", - "gajo", - "gala", - "galeri\u0301a", - "gallo", - "gamba", - "ganar", - "gancho", - "ganga", - "ganso", - "garaje", - "garza", - "gasolina", - "gastar", - "gato", - "gavila\u0301n", - "gemelo", - "gemir", - "gen", - "ge\u0301nero", - "genio", - "gente", - "geranio", - "gerente", - "germen", - "gesto", - "gigante", - "gimnasio", - "girar", - "giro", - "glaciar", - "globo", - "gloria", - "gol", - "golfo", - "goloso", - "golpe", - "goma", - "gordo", - "gorila", - "gorra", - "gota", - "goteo", - "gozar", - "grada", - "gra\u0301fico", - "grano", - "grasa", - "gratis", - "grave", - "grieta", - "grillo", - "gripe", - "gris", - "grito", - "grosor", - "gru\u0301a", - "grueso", - "grumo", - "grupo", - "guante", - "guapo", - "guardia", - "guerra", - "gui\u0301a", - "guin\u0303o", - "guion", - "guiso", - "guitarra", - "gusano", - "gustar", - "haber", - "ha\u0301bil", - "hablar", - "hacer", - "hacha", - "hada", - "hallar", - "hamaca", - "harina", - "haz", - "hazan\u0303a", - "hebilla", - "hebra", - "hecho", - "helado", - "helio", - "hembra", - "herir", - "hermano", - "he\u0301roe", - "hervir", - "hielo", - "hierro", - "hi\u0301gado", - "higiene", - "hijo", - "himno", - "historia", - "hocico", - "hogar", - "hoguera", - "hoja", - "hombre", - "hongo", - "honor", - "honra", - "hora", - "hormiga", - "horno", - "hostil", - "hoyo", - "hueco", - "huelga", - "huerta", - "hueso", - "huevo", - "huida", - "huir", - "humano", - "hu\u0301medo", - "humilde", - "humo", - "hundir", - "huraca\u0301n", - "hurto", - "icono", - "ideal", - "idioma", - "i\u0301dolo", - "iglesia", - "iglu\u0301", - "igual", - "ilegal", - "ilusio\u0301n", - "imagen", - "ima\u0301n", - "imitar", - "impar", - "imperio", - "imponer", - "impulso", - "incapaz", - "i\u0301ndice", - "inerte", - "infiel", - "informe", - "ingenio", - "inicio", - "inmenso", - "inmune", - "innato", - "insecto", - "instante", - "intere\u0301s", - "i\u0301ntimo", - "intuir", - "inu\u0301til", - "invierno", - "ira", - "iris", - "ironi\u0301a", - "isla", - "islote", - "jabali\u0301", - "jabo\u0301n", - "jamo\u0301n", - "jarabe", - "jardi\u0301n", - "jarra", - "jaula", - "jazmi\u0301n", - "jefe", - "jeringa", - "jinete", - "jornada", - "joroba", - "joven", - "joya", - "juerga", - "jueves", - "juez", - "jugador", - "jugo", - "juguete", - "juicio", - "junco", - "jungla", - "junio", - "juntar", - "ju\u0301piter", - "jurar", - "justo", - "juvenil", - "juzgar", - "kilo", - "koala", - "labio", - "lacio", - "lacra", - "lado", - "ladro\u0301n", - "lagarto", - "la\u0301grima", - "laguna", - "laico", - "lamer", - "la\u0301mina", - "la\u0301mpara", - "lana", - "lancha", - "langosta", - "lanza", - "la\u0301piz", - "largo", - "larva", - "la\u0301stima", - "lata", - "la\u0301tex", - "latir", - "laurel", - "lavar", - "lazo", - "leal", - "leccio\u0301n", - "leche", - "lector", - "leer", - "legio\u0301n", - "legumbre", - "lejano", - "lengua", - "lento", - "len\u0303a", - "leo\u0301n", - "leopardo", - "lesio\u0301n", - "letal", - "letra", - "leve", - "leyenda", - "libertad", - "libro", - "licor", - "li\u0301der", - "lidiar", - "lienzo", - "liga", - "ligero", - "lima", - "li\u0301mite", - "limo\u0301n", - "limpio", - "lince", - "lindo", - "li\u0301nea", - "lingote", - "lino", - "linterna", - "li\u0301quido", - "liso", - "lista", - "litera", - "litio", - "litro", - "llaga", - "llama", - "llanto", - "llave", - "llegar", - "llenar", - "llevar", - "llorar", - "llover", - "lluvia", - "lobo", - "locio\u0301n", - "loco", - "locura", - "lo\u0301gica", - "logro", - "lombriz", - "lomo", - "lonja", - "lote", - "lucha", - "lucir", - "lugar", - "lujo", - "luna", - "lunes", - "lupa", - "lustro", - "luto", - "luz", - "maceta", - "macho", - "madera", - "madre", - "maduro", - "maestro", - "mafia", - "magia", - "mago", - "mai\u0301z", - "maldad", - "maleta", - "malla", - "malo", - "mama\u0301", - "mambo", - "mamut", - "manco", - "mando", - "manejar", - "manga", - "maniqui\u0301", - "manjar", - "mano", - "manso", - "manta", - "man\u0303ana", - "mapa", - "ma\u0301quina", - "mar", - "marco", - "marea", - "marfil", - "margen", - "marido", - "ma\u0301rmol", - "marro\u0301n", - "martes", - "marzo", - "masa", - "ma\u0301scara", - "masivo", - "matar", - "materia", - "matiz", - "matriz", - "ma\u0301ximo", - "mayor", - "mazorca", - "mecha", - "medalla", - "medio", - "me\u0301dula", - "mejilla", - "mejor", - "melena", - "melo\u0301n", - "memoria", - "menor", - "mensaje", - "mente", - "menu\u0301", - "mercado", - "merengue", - "me\u0301rito", - "mes", - "meso\u0301n", - "meta", - "meter", - "me\u0301todo", - "metro", - "mezcla", - "miedo", - "miel", - "miembro", - "miga", - "mil", - "milagro", - "militar", - "millo\u0301n", - "mimo", - "mina", - "minero", - "mi\u0301nimo", - "minuto", - "miope", - "mirar", - "misa", - "miseria", - "misil", - "mismo", - "mitad", - "mito", - "mochila", - "mocio\u0301n", - "moda", - "modelo", - "moho", - "mojar", - "molde", - "moler", - "molino", - "momento", - "momia", - "monarca", - "moneda", - "monja", - "monto", - "mon\u0303o", - "morada", - "morder", - "moreno", - "morir", - "morro", - "morsa", - "mortal", - "mosca", - "mostrar", - "motivo", - "mover", - "mo\u0301vil", - "mozo", - "mucho", - "mudar", - "mueble", - "muela", - "muerte", - "muestra", - "mugre", - "mujer", - "mula", - "muleta", - "multa", - "mundo", - "mun\u0303eca", - "mural", - "muro", - "mu\u0301sculo", - "museo", - "musgo", - "mu\u0301sica", - "muslo", - "na\u0301car", - "nacio\u0301n", - "nadar", - "naipe", - "naranja", - "nariz", - "narrar", - "nasal", - "natal", - "nativo", - "natural", - "na\u0301usea", - "naval", - "nave", - "navidad", - "necio", - "ne\u0301ctar", - "negar", - "negocio", - "negro", - "neo\u0301n", - "nervio", - "neto", - "neutro", - "nevar", - "nevera", - "nicho", - "nido", - "niebla", - "nieto", - "nin\u0303ez", - "nin\u0303o", - "ni\u0301tido", - "nivel", - "nobleza", - "noche", - "no\u0301mina", - "noria", - "norma", - "norte", - "nota", - "noticia", - "novato", - "novela", - "novio", - "nube", - "nuca", - "nu\u0301cleo", - "nudillo", - "nudo", - "nuera", - "nueve", - "nuez", - "nulo", - "nu\u0301mero", - "nutria", - "oasis", - "obeso", - "obispo", - "objeto", - "obra", - "obrero", - "observar", - "obtener", - "obvio", - "oca", - "ocaso", - "oce\u0301ano", - "ochenta", - "ocho", - "ocio", - "ocre", - "octavo", - "octubre", - "oculto", - "ocupar", - "ocurrir", - "odiar", - "odio", - "odisea", - "oeste", - "ofensa", - "oferta", - "oficio", - "ofrecer", - "ogro", - "oi\u0301do", - "oi\u0301r", - "ojo", - "ola", - "oleada", - "olfato", - "olivo", - "olla", - "olmo", - "olor", - "olvido", - "ombligo", - "onda", - "onza", - "opaco", - "opcio\u0301n", - "o\u0301pera", - "opinar", - "oponer", - "optar", - "o\u0301ptica", - "opuesto", - "oracio\u0301n", - "orador", - "oral", - "o\u0301rbita", - "orca", - "orden", - "oreja", - "o\u0301rgano", - "orgi\u0301a", - "orgullo", - "oriente", - "origen", - "orilla", - "oro", - "orquesta", - "oruga", - "osadi\u0301a", - "oscuro", - "osezno", - "oso", - "ostra", - "oton\u0303o", - "otro", - "oveja", - "o\u0301vulo", - "o\u0301xido", - "oxi\u0301geno", - "oyente", - "ozono", - "pacto", - "padre", - "paella", - "pa\u0301gina", - "pago", - "pai\u0301s", - "pa\u0301jaro", - "palabra", - "palco", - "paleta", - "pa\u0301lido", - "palma", - "paloma", - "palpar", - "pan", - "panal", - "pa\u0301nico", - "pantera", - "pan\u0303uelo", - "papa\u0301", - "papel", - "papilla", - "paquete", - "parar", - "parcela", - "pared", - "parir", - "paro", - "pa\u0301rpado", - "parque", - "pa\u0301rrafo", - "parte", - "pasar", - "paseo", - "pasio\u0301n", - "paso", - "pasta", - "pata", - "patio", - "patria", - "pausa", - "pauta", - "pavo", - "payaso", - "peato\u0301n", - "pecado", - "pecera", - "pecho", - "pedal", - "pedir", - "pegar", - "peine", - "pelar", - "peldan\u0303o", - "pelea", - "peligro", - "pellejo", - "pelo", - "peluca", - "pena", - "pensar", - "pen\u0303o\u0301n", - "peo\u0301n", - "peor", - "pepino", - "pequen\u0303o", - "pera", - "percha", - "perder", - "pereza", - "perfil", - "perico", - "perla", - "permiso", - "perro", - "persona", - "pesa", - "pesca", - "pe\u0301simo", - "pestan\u0303a", - "pe\u0301talo", - "petro\u0301leo", - "pez", - "pezun\u0303a", - "picar", - "picho\u0301n", - "pie", - "piedra", - "pierna", - "pieza", - "pijama", - "pilar", - "piloto", - "pimienta", - "pino", - "pintor", - "pinza", - "pin\u0303a", - "piojo", - "pipa", - "pirata", - "pisar", - "piscina", - "piso", - "pista", - "pito\u0301n", - "pizca", - "placa", - "plan", - "plata", - "playa", - "plaza", - "pleito", - "pleno", - "plomo", - "pluma", - "plural", - "pobre", - "poco", - "poder", - "podio", - "poema", - "poesi\u0301a", - "poeta", - "polen", - "polici\u0301a", - "pollo", - "polvo", - "pomada", - "pomelo", - "pomo", - "pompa", - "poner", - "porcio\u0301n", - "portal", - "posada", - "poseer", - "posible", - "poste", - "potencia", - "potro", - "pozo", - "prado", - "precoz", - "pregunta", - "premio", - "prensa", - "preso", - "previo", - "primo", - "pri\u0301ncipe", - "prisio\u0301n", - "privar", - "proa", - "probar", - "proceso", - "producto", - "proeza", - "profesor", - "programa", - "prole", - "promesa", - "pronto", - "propio", - "pro\u0301ximo", - "prueba", - "pu\u0301blico", - "puchero", - "pudor", - "pueblo", - "puerta", - "puesto", - "pulga", - "pulir", - "pulmo\u0301n", - "pulpo", - "pulso", - "puma", - "punto", - "pun\u0303al", - "pun\u0303o", - "pupa", - "pupila", - "pure\u0301", - "quedar", - "queja", - "quemar", - "querer", - "queso", - "quieto", - "qui\u0301mica", - "quince", - "quitar", - "ra\u0301bano", - "rabia", - "rabo", - "racio\u0301n", - "radical", - "rai\u0301z", - "rama", - "rampa", - "rancho", - "rango", - "rapaz", - "ra\u0301pido", - "rapto", - "rasgo", - "raspa", - "rato", - "rayo", - "raza", - "razo\u0301n", - "reaccio\u0301n", - "realidad", - "reban\u0303o", - "rebote", - "recaer", - "receta", - "rechazo", - "recoger", - "recreo", - "recto", - "recurso", - "red", - "redondo", - "reducir", - "reflejo", - "reforma", - "refra\u0301n", - "refugio", - "regalo", - "regir", - "regla", - "regreso", - "rehe\u0301n", - "reino", - "rei\u0301r", - "reja", - "relato", - "relevo", - "relieve", - "relleno", - "reloj", - "remar", - "remedio", - "remo", - "rencor", - "rendir", - "renta", - "reparto", - "repetir", - "reposo", - "reptil", - "res", - "rescate", - "resina", - "respeto", - "resto", - "resumen", - "retiro", - "retorno", - "retrato", - "reunir", - "reve\u0301s", - "revista", - "rey", - "rezar", - "rico", - "riego", - "rienda", - "riesgo", - "rifa", - "ri\u0301gido", - "rigor", - "rinco\u0301n", - "rin\u0303o\u0301n", - "ri\u0301o", - "riqueza", - "risa", - "ritmo", - "rito", - "rizo", - "roble", - "roce", - "rociar", - "rodar", - "rodeo", - "rodilla", - "roer", - "rojizo", - "rojo", - "romero", - "romper", - "ron", - "ronco", - "ronda", - "ropa", - "ropero", - "rosa", - "rosca", - "rostro", - "rotar", - "rubi\u0301", - "rubor", - "rudo", - "rueda", - "rugir", - "ruido", - "ruina", - "ruleta", - "rulo", - "rumbo", - "rumor", - "ruptura", - "ruta", - "rutina", - "sa\u0301bado", - "saber", - "sabio", - "sable", - "sacar", - "sagaz", - "sagrado", - "sala", - "saldo", - "salero", - "salir", - "salmo\u0301n", - "salo\u0301n", - "salsa", - "salto", - "salud", - "salvar", - "samba", - "sancio\u0301n", - "sandi\u0301a", - "sanear", - "sangre", - "sanidad", - "sano", - "santo", - "sapo", - "saque", - "sardina", - "sarte\u0301n", - "sastre", - "sata\u0301n", - "sauna", - "saxofo\u0301n", - "seccio\u0301n", - "seco", - "secreto", - "secta", - "sed", - "seguir", - "seis", - "sello", - "selva", - "semana", - "semilla", - "senda", - "sensor", - "sen\u0303al", - "sen\u0303or", - "separar", - "sepia", - "sequi\u0301a", - "ser", - "serie", - "sermo\u0301n", - "servir", - "sesenta", - "sesio\u0301n", - "seta", - "setenta", - "severo", - "sexo", - "sexto", - "sidra", - "siesta", - "siete", - "siglo", - "signo", - "si\u0301laba", - "silbar", - "silencio", - "silla", - "si\u0301mbolo", - "simio", - "sirena", - "sistema", - "sitio", - "situar", - "sobre", - "socio", - "sodio", - "sol", - "solapa", - "soldado", - "soledad", - "so\u0301lido", - "soltar", - "solucio\u0301n", - "sombra", - "sondeo", - "sonido", - "sonoro", - "sonrisa", - "sopa", - "soplar", - "soporte", - "sordo", - "sorpresa", - "sorteo", - "soste\u0301n", - "so\u0301tano", - "suave", - "subir", - "suceso", - "sudor", - "suegra", - "suelo", - "suen\u0303o", - "suerte", - "sufrir", - "sujeto", - "sulta\u0301n", - "sumar", - "superar", - "suplir", - "suponer", - "supremo", - "sur", - "surco", - "suren\u0303o", - "surgir", - "susto", - "sutil", - "tabaco", - "tabique", - "tabla", - "tabu\u0301", - "taco", - "tacto", - "tajo", - "talar", - "talco", - "talento", - "talla", - "talo\u0301n", - "taman\u0303o", - "tambor", - "tango", - "tanque", - "tapa", - "tapete", - "tapia", - "tapo\u0301n", - "taquilla", - "tarde", - "tarea", - "tarifa", - "tarjeta", - "tarot", - "tarro", - "tarta", - "tatuaje", - "tauro", - "taza", - "tazo\u0301n", - "teatro", - "techo", - "tecla", - "te\u0301cnica", - "tejado", - "tejer", - "tejido", - "tela", - "tele\u0301fono", - "tema", - "temor", - "templo", - "tenaz", - "tender", - "tener", - "tenis", - "tenso", - "teori\u0301a", - "terapia", - "terco", - "te\u0301rmino", - "ternura", - "terror", - "tesis", - "tesoro", - "testigo", - "tetera", - "texto", - "tez", - "tibio", - "tiburo\u0301n", - "tiempo", - "tienda", - "tierra", - "tieso", - "tigre", - "tijera", - "tilde", - "timbre", - "ti\u0301mido", - "timo", - "tinta", - "ti\u0301o", - "ti\u0301pico", - "tipo", - "tira", - "tiro\u0301n", - "tita\u0301n", - "ti\u0301tere", - "ti\u0301tulo", - "tiza", - "toalla", - "tobillo", - "tocar", - "tocino", - "todo", - "toga", - "toldo", - "tomar", - "tono", - "tonto", - "topar", - "tope", - "toque", - "to\u0301rax", - "torero", - "tormenta", - "torneo", - "toro", - "torpedo", - "torre", - "torso", - "tortuga", - "tos", - "tosco", - "toser", - "to\u0301xico", - "trabajo", - "tractor", - "traer", - "tra\u0301fico", - "trago", - "traje", - "tramo", - "trance", - "trato", - "trauma", - "trazar", - "tre\u0301bol", - "tregua", - "treinta", - "tren", - "trepar", - "tres", - "tribu", - "trigo", - "tripa", - "triste", - "triunfo", - "trofeo", - "trompa", - "tronco", - "tropa", - "trote", - "trozo", - "truco", - "trueno", - "trufa", - "tuberi\u0301a", - "tubo", - "tuerto", - "tumba", - "tumor", - "tu\u0301nel", - "tu\u0301nica", - "turbina", - "turismo", - "turno", - "tutor", - "ubicar", - "u\u0301lcera", - "umbral", - "unidad", - "unir", - "universo", - "uno", - "untar", - "un\u0303a", - "urbano", - "urbe", - "urgente", - "urna", - "usar", - "usuario", - "u\u0301til", - "utopi\u0301a", - "uva", - "vaca", - "vaci\u0301o", - "vacuna", - "vagar", - "vago", - "vaina", - "vajilla", - "vale", - "va\u0301lido", - "valle", - "valor", - "va\u0301lvula", - "vampiro", - "vara", - "variar", - "varo\u0301n", - "vaso", - "vecino", - "vector", - "vehi\u0301culo", - "veinte", - "vejez", - "vela", - "velero", - "veloz", - "vena", - "vencer", - "venda", - "veneno", - "vengar", - "venir", - "venta", - "venus", - "ver", - "verano", - "verbo", - "verde", - "vereda", - "verja", - "verso", - "verter", - "vi\u0301a", - "viaje", - "vibrar", - "vicio", - "vi\u0301ctima", - "vida", - "vi\u0301deo", - "vidrio", - "viejo", - "viernes", - "vigor", - "vil", - "villa", - "vinagre", - "vino", - "vin\u0303edo", - "violi\u0301n", - "viral", - "virgo", - "virtud", - "visor", - "vi\u0301spera", - "vista", - "vitamina", - "viudo", - "vivaz", - "vivero", - "vivir", - "vivo", - "volca\u0301n", - "volumen", - "volver", - "voraz", - "votar", - "voto", - "voz", - "vuelo", - "vulgar", - "yacer", - "yate", - "yegua", - "yema", - "yerno", - "yeso", - "yodo", - "yoga", - "yogur", - "zafiro", - "zanja", - "zapato", - "zarza", - "zona", - "zorro", - "zumo", - "zurdo" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/japanese.json -var require_japanese = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/japanese.json"(exports2, module2) { - module2.exports = [ - "\u3042\u3044\u3053\u304F\u3057\u3093", - "\u3042\u3044\u3055\u3064", - "\u3042\u3044\u305F\u3099", - "\u3042\u304A\u305D\u3099\u3089", - "\u3042\u304B\u3061\u3083\u3093", - "\u3042\u304D\u308B", - "\u3042\u3051\u304B\u3099\u305F", - "\u3042\u3051\u308B", - "\u3042\u3053\u304B\u3099\u308C\u308B", - "\u3042\u3055\u3044", - "\u3042\u3055\u3072", - "\u3042\u3057\u3042\u3068", - "\u3042\u3057\u3099\u308F\u3046", - "\u3042\u3059\u3099\u304B\u308B", - "\u3042\u3059\u3099\u304D", - "\u3042\u305D\u3075\u3099", - "\u3042\u305F\u3048\u308B", - "\u3042\u305F\u305F\u3081\u308B", - "\u3042\u305F\u308A\u307E\u3048", - "\u3042\u305F\u308B", - "\u3042\u3064\u3044", - "\u3042\u3064\u304B\u3046", - "\u3042\u3063\u3057\u3085\u304F", - "\u3042\u3064\u307E\u308A", - "\u3042\u3064\u3081\u308B", - "\u3042\u3066\u306A", - "\u3042\u3066\u306F\u307E\u308B", - "\u3042\u3072\u308B", - "\u3042\u3075\u3099\u3089", - "\u3042\u3075\u3099\u308B", - "\u3042\u3075\u308C\u308B", - "\u3042\u307E\u3044", - "\u3042\u307E\u3068\u3099", - "\u3042\u307E\u3084\u304B\u3059", - "\u3042\u307E\u308A", - "\u3042\u307F\u3082\u306E", - "\u3042\u3081\u308A\u304B", - "\u3042\u3084\u307E\u308B", - "\u3042\u3086\u3080", - "\u3042\u3089\u3044\u304F\u3099\u307E", - "\u3042\u3089\u3057", - "\u3042\u3089\u3059\u3057\u3099", - "\u3042\u3089\u305F\u3081\u308B", - "\u3042\u3089\u3086\u308B", - "\u3042\u3089\u308F\u3059", - "\u3042\u308A\u304B\u3099\u3068\u3046", - "\u3042\u308F\u305B\u308B", - "\u3042\u308F\u3066\u308B", - "\u3042\u3093\u3044", - "\u3042\u3093\u304B\u3099\u3044", - "\u3042\u3093\u3053", - "\u3042\u3093\u305B\u3099\u3093", - "\u3042\u3093\u3066\u3044", - "\u3042\u3093\u306A\u3044", - "\u3042\u3093\u307E\u308A", - "\u3044\u3044\u305F\u3099\u3059", - "\u3044\u304A\u3093", - "\u3044\u304B\u3099\u3044", - "\u3044\u304B\u3099\u304F", - "\u3044\u304D\u304A\u3044", - "\u3044\u304D\u306A\u308A", - "\u3044\u304D\u3082\u306E", - "\u3044\u304D\u308B", - "\u3044\u304F\u3057\u3099", - "\u3044\u304F\u3075\u3099\u3093", - "\u3044\u3051\u306F\u3099\u306A", - "\u3044\u3051\u3093", - "\u3044\u3053\u3046", - "\u3044\u3053\u304F", - "\u3044\u3053\u3064", - "\u3044\u3055\u307E\u3057\u3044", - "\u3044\u3055\u3093", - "\u3044\u3057\u304D", - "\u3044\u3057\u3099\u3085\u3046", - "\u3044\u3057\u3099\u3087\u3046", - "\u3044\u3057\u3099\u308F\u308B", - "\u3044\u3059\u3099\u307F", - "\u3044\u3059\u3099\u308C", - "\u3044\u305B\u3044", - "\u3044\u305B\u3048\u3072\u3099", - "\u3044\u305B\u304B\u3044", - "\u3044\u305B\u304D", - "\u3044\u305B\u3099\u3093", - "\u3044\u305D\u3046\u308D\u3046", - "\u3044\u305D\u304B\u3099\u3057\u3044", - "\u3044\u305F\u3099\u3044", - "\u3044\u305F\u3099\u304F", - "\u3044\u305F\u3059\u3099\u3089", - "\u3044\u305F\u307F", - "\u3044\u305F\u308A\u3042", - "\u3044\u3061\u304A\u3046", - "\u3044\u3061\u3057\u3099", - "\u3044\u3061\u3068\u3099", - "\u3044\u3061\u306F\u3099", - "\u3044\u3061\u3075\u3099", - "\u3044\u3061\u308A\u3085\u3046", - "\u3044\u3064\u304B", - "\u3044\u3063\u3057\u3085\u3093", - "\u3044\u3063\u305B\u3044", - "\u3044\u3063\u305D\u3046", - "\u3044\u3063\u305F\u3093", - "\u3044\u3063\u3061", - "\u3044\u3063\u3066\u3044", - "\u3044\u3063\u307B\u309A\u3046", - "\u3044\u3066\u3055\u3099", - "\u3044\u3066\u3093", - "\u3044\u3068\u3099\u3046", - "\u3044\u3068\u3053", - "\u3044\u306A\u3044", - "\u3044\u306A\u304B", - "\u3044\u306D\u3080\u308A", - "\u3044\u306E\u3061", - "\u3044\u306E\u308B", - "\u3044\u306F\u3064", - "\u3044\u306F\u3099\u308B", - "\u3044\u306F\u3093", - "\u3044\u3072\u3099\u304D", - "\u3044\u3072\u3093", - "\u3044\u3075\u304F", - "\u3044\u3078\u3093", - "\u3044\u307B\u3046", - "\u3044\u307F\u3093", - "\u3044\u3082\u3046\u3068", - "\u3044\u3082\u305F\u308C", - "\u3044\u3082\u308A", - "\u3044\u3084\u304B\u3099\u308B", - "\u3044\u3084\u3059", - "\u3044\u3088\u304B\u3093", - "\u3044\u3088\u304F", - "\u3044\u3089\u3044", - "\u3044\u3089\u3059\u3068", - "\u3044\u308A\u304F\u3099\u3061", - "\u3044\u308A\u3087\u3046", - "\u3044\u308C\u3044", - "\u3044\u308C\u3082\u306E", - "\u3044\u308C\u308B", - "\u3044\u308D\u3048\u3093\u3072\u309A\u3064", - "\u3044\u308F\u3044", - "\u3044\u308F\u3046", - "\u3044\u308F\u304B\u3093", - "\u3044\u308F\u306F\u3099", - "\u3044\u308F\u3086\u308B", - "\u3044\u3093\u3051\u3099\u3093\u307E\u3081", - "\u3044\u3093\u3055\u3064", - "\u3044\u3093\u3057\u3087\u3046", - "\u3044\u3093\u3088\u3046", - "\u3046\u3048\u304D", - "\u3046\u3048\u308B", - "\u3046\u304A\u3055\u3099", - "\u3046\u304B\u3099\u3044", - "\u3046\u304B\u3075\u3099", - "\u3046\u304B\u3078\u3099\u308B", - "\u3046\u304D\u308F", - "\u3046\u304F\u3089\u3044\u306A", - "\u3046\u304F\u308C\u308C", - "\u3046\u3051\u305F\u307E\u308F\u308B", - "\u3046\u3051\u3064\u3051", - "\u3046\u3051\u3068\u308B", - "\u3046\u3051\u3082\u3064", - "\u3046\u3051\u308B", - "\u3046\u3053\u3099\u304B\u3059", - "\u3046\u3053\u3099\u304F", - "\u3046\u3053\u3093", - "\u3046\u3055\u304D\u3099", - "\u3046\u3057\u306A\u3046", - "\u3046\u3057\u308D\u304B\u3099\u307F", - "\u3046\u3059\u3044", - "\u3046\u3059\u304D\u3099", - "\u3046\u3059\u304F\u3099\u3089\u3044", - "\u3046\u3059\u3081\u308B", - "\u3046\u305B\u3064", - "\u3046\u3061\u3042\u308F\u305B", - "\u3046\u3061\u304B\u3099\u308F", - "\u3046\u3061\u304D", - "\u3046\u3061\u3085\u3046", - "\u3046\u3063\u304B\u308A", - "\u3046\u3064\u304F\u3057\u3044", - "\u3046\u3063\u305F\u3048\u308B", - "\u3046\u3064\u308B", - "\u3046\u3068\u3099\u3093", - "\u3046\u306A\u304D\u3099", - "\u3046\u306A\u3057\u3099", - "\u3046\u306A\u3059\u3099\u304F", - "\u3046\u306A\u308B", - "\u3046\u306D\u308B", - "\u3046\u306E\u3046", - "\u3046\u3075\u3099\u3051\u3099", - "\u3046\u3075\u3099\u3053\u3099\u3048", - "\u3046\u307E\u308C\u308B", - "\u3046\u3081\u308B", - "\u3046\u3082\u3046", - "\u3046\u3084\u307E\u3046", - "\u3046\u3088\u304F", - "\u3046\u3089\u304B\u3099\u3048\u3059", - "\u3046\u3089\u304F\u3099\u3061", - "\u3046\u3089\u306A\u3044", - "\u3046\u308A\u3042\u3051\u3099", - "\u3046\u308A\u304D\u308C", - "\u3046\u308B\u3055\u3044", - "\u3046\u308C\u3057\u3044", - "\u3046\u308C\u3086\u304D", - "\u3046\u308C\u308B", - "\u3046\u308D\u3053", - "\u3046\u308F\u304D", - "\u3046\u308F\u3055", - "\u3046\u3093\u3053\u3046", - "\u3046\u3093\u3061\u3093", - "\u3046\u3093\u3066\u3093", - "\u3046\u3093\u3068\u3099\u3046", - "\u3048\u3044\u3048\u3093", - "\u3048\u3044\u304B\u3099", - "\u3048\u3044\u304D\u3087\u3046", - "\u3048\u3044\u3053\u3099", - "\u3048\u3044\u305B\u3044", - "\u3048\u3044\u3075\u3099\u3093", - "\u3048\u3044\u3088\u3046", - "\u3048\u3044\u308F", - "\u3048\u304A\u308A", - "\u3048\u304B\u3099\u304A", - "\u3048\u304B\u3099\u304F", - "\u3048\u304D\u305F\u3044", - "\u3048\u304F\u305B\u308B", - "\u3048\u3057\u3083\u304F", - "\u3048\u3059\u3066", - "\u3048\u3064\u3089\u3093", - "\u3048\u306E\u304F\u3099", - "\u3048\u307B\u3046\u307E\u304D", - "\u3048\u307B\u3093", - "\u3048\u307E\u304D", - "\u3048\u3082\u3057\u3099", - "\u3048\u3082\u306E", - "\u3048\u3089\u3044", - "\u3048\u3089\u3075\u3099", - "\u3048\u308A\u3042", - "\u3048\u3093\u3048\u3093", - "\u3048\u3093\u304B\u3044", - "\u3048\u3093\u304D\u3099", - "\u3048\u3093\u3051\u3099\u304D", - "\u3048\u3093\u3057\u3085\u3046", - "\u3048\u3093\u305B\u3099\u3064", - "\u3048\u3093\u305D\u304F", - "\u3048\u3093\u3061\u3087\u3046", - "\u3048\u3093\u3068\u3064", - "\u304A\u3044\u304B\u3051\u308B", - "\u304A\u3044\u3053\u3059", - "\u304A\u3044\u3057\u3044", - "\u304A\u3044\u3064\u304F", - "\u304A\u3046\u3048\u3093", - "\u304A\u3046\u3055\u307E", - "\u304A\u3046\u3057\u3099", - "\u304A\u3046\u305B\u3064", - "\u304A\u3046\u305F\u3044", - "\u304A\u3046\u3075\u304F", - "\u304A\u3046\u3078\u3099\u3044", - "\u304A\u3046\u3088\u3046", - "\u304A\u3048\u308B", - "\u304A\u304A\u3044", - "\u304A\u304A\u3046", - "\u304A\u304A\u3068\u3099\u304A\u308A", - "\u304A\u304A\u3084", - "\u304A\u304A\u3088\u305D", - "\u304A\u304B\u3048\u308A", - "\u304A\u304B\u3059\u3099", - "\u304A\u304B\u3099\u3080", - "\u304A\u304B\u308F\u308A", - "\u304A\u304D\u3099\u306A\u3046", - "\u304A\u304D\u308B", - "\u304A\u304F\u3055\u307E", - "\u304A\u304F\u3057\u3099\u3087\u3046", - "\u304A\u304F\u308A\u304B\u3099\u306A", - "\u304A\u304F\u308B", - "\u304A\u304F\u308C\u308B", - "\u304A\u3053\u3059", - "\u304A\u3053\u306A\u3046", - "\u304A\u3053\u308B", - "\u304A\u3055\u3048\u308B", - "\u304A\u3055\u306A\u3044", - "\u304A\u3055\u3081\u308B", - "\u304A\u3057\u3044\u308C", - "\u304A\u3057\u3048\u308B", - "\u304A\u3057\u3099\u304D\u3099", - "\u304A\u3057\u3099\u3055\u3093", - "\u304A\u3057\u3083\u308C", - "\u304A\u305D\u3089\u304F", - "\u304A\u305D\u308F\u308B", - "\u304A\u305F\u304B\u3099\u3044", - "\u304A\u305F\u304F", - "\u304A\u305F\u3099\u3084\u304B", - "\u304A\u3061\u3064\u304F", - "\u304A\u3063\u3068", - "\u304A\u3064\u308A", - "\u304A\u3066\u3099\u304B\u3051", - "\u304A\u3068\u3057\u3082\u306E", - "\u304A\u3068\u306A\u3057\u3044", - "\u304A\u3068\u3099\u308A", - "\u304A\u3068\u3099\u308D\u304B\u3059", - "\u304A\u306F\u3099\u3055\u3093", - "\u304A\u307E\u3044\u308A", - "\u304A\u3081\u3066\u3099\u3068\u3046", - "\u304A\u3082\u3044\u3066\u3099", - "\u304A\u3082\u3046", - "\u304A\u3082\u305F\u3044", - "\u304A\u3082\u3061\u3083", - "\u304A\u3084\u3064", - "\u304A\u3084\u3086\u3072\u3099", - "\u304A\u3088\u307B\u3099\u3059", - "\u304A\u3089\u3093\u305F\u3099", - "\u304A\u308D\u3059", - "\u304A\u3093\u304B\u3099\u304F", - "\u304A\u3093\u3051\u3044", - "\u304A\u3093\u3057\u3083", - "\u304A\u3093\u305B\u3093", - "\u304A\u3093\u305F\u3099\u3093", - "\u304A\u3093\u3061\u3085\u3046", - "\u304A\u3093\u3068\u3099\u3051\u3044", - "\u304B\u3042\u3064", - "\u304B\u3044\u304B\u3099", - "\u304B\u3099\u3044\u304D", - "\u304B\u3099\u3044\u3051\u3093", - "\u304B\u3099\u3044\u3053\u3046", - "\u304B\u3044\u3055\u3064", - "\u304B\u3044\u3057\u3083", - "\u304B\u3044\u3059\u3044\u3088\u304F", - "\u304B\u3044\u305B\u3099\u3093", - "\u304B\u3044\u305D\u3099\u3046\u3068\u3099", - "\u304B\u3044\u3064\u3046", - "\u304B\u3044\u3066\u3093", - "\u304B\u3044\u3068\u3046", - "\u304B\u3044\u3075\u304F", - "\u304B\u3099\u3044\u3078\u304D", - "\u304B\u3044\u307B\u3046", - "\u304B\u3044\u3088\u3046", - "\u304B\u3099\u3044\u3089\u3044", - "\u304B\u3044\u308F", - "\u304B\u3048\u308B", - "\u304B\u304A\u308A", - "\u304B\u304B\u3048\u308B", - "\u304B\u304B\u3099\u304F", - "\u304B\u304B\u3099\u3057", - "\u304B\u304B\u3099\u307F", - "\u304B\u304F\u3053\u3099", - "\u304B\u304F\u3068\u304F", - "\u304B\u3055\u3099\u308B", - "\u304B\u3099\u305D\u3099\u3046", - "\u304B\u305F\u3044", - "\u304B\u305F\u3061", - "\u304B\u3099\u3061\u3087\u3046", - "\u304B\u3099\u3063\u304D\u3085\u3046", - "\u304B\u3099\u3063\u3053\u3046", - "\u304B\u3099\u3063\u3055\u3093", - "\u304B\u3099\u3063\u3057\u3087\u3046", - "\u304B\u306A\u3055\u3099\u308F\u3057", - "\u304B\u306E\u3046", - "\u304B\u3099\u306F\u304F", - "\u304B\u3075\u3099\u304B", - "\u304B\u307B\u3046", - "\u304B\u307B\u3053\u3099", - "\u304B\u307E\u3046", - "\u304B\u307E\u307B\u3099\u3053", - "\u304B\u3081\u308C\u304A\u3093", - "\u304B\u3086\u3044", - "\u304B\u3088\u3046\u3072\u3099", - "\u304B\u3089\u3044", - "\u304B\u308B\u3044", - "\u304B\u308D\u3046", - "\u304B\u308F\u304F", - "\u304B\u308F\u3089", - "\u304B\u3099\u3093\u304B", - "\u304B\u3093\u3051\u3044", - "\u304B\u3093\u3053\u3046", - "\u304B\u3093\u3057\u3083", - "\u304B\u3093\u305D\u3046", - "\u304B\u3093\u305F\u3093", - "\u304B\u3093\u3061", - "\u304B\u3099\u3093\u306F\u3099\u308B", - "\u304D\u3042\u3044", - "\u304D\u3042\u3064", - "\u304D\u3044\u308D", - "\u304D\u3099\u3044\u3093", - "\u304D\u3046\u3044", - "\u304D\u3046\u3093", - "\u304D\u3048\u308B", - "\u304D\u304A\u3046", - "\u304D\u304A\u304F", - "\u304D\u304A\u3061", - "\u304D\u304A\u3093", - "\u304D\u304B\u3044", - "\u304D\u304B\u304F", - "\u304D\u304B\u3093\u3057\u3083", - "\u304D\u304D\u3066", - "\u304D\u304F\u306F\u3099\u308A", - "\u304D\u304F\u3089\u3051\u3099", - "\u304D\u3051\u3093\u305B\u3044", - "\u304D\u3053\u3046", - "\u304D\u3053\u3048\u308B", - "\u304D\u3053\u304F", - "\u304D\u3055\u3044", - "\u304D\u3055\u304F", - "\u304D\u3055\u307E", - "\u304D\u3055\u3089\u304D\u3099", - "\u304D\u3099\u3057\u3099\u304B\u304B\u3099\u304F", - "\u304D\u3099\u3057\u304D", - "\u304D\u3099\u3057\u3099\u305F\u3044\u3051\u3093", - "\u304D\u3099\u3057\u3099\u306B\u3063\u3066\u3044", - "\u304D\u3099\u3057\u3099\u3085\u3064\u3057\u3083", - "\u304D\u3059\u3046", - "\u304D\u305B\u3044", - "\u304D\u305B\u304D", - "\u304D\u305B\u3064", - "\u304D\u305D\u3046", - "\u304D\u305D\u3099\u304F", - "\u304D\u305D\u3099\u3093", - "\u304D\u305F\u3048\u308B", - "\u304D\u3061\u3087\u3046", - "\u304D\u3064\u3048\u3093", - "\u304D\u3099\u3063\u3061\u308A", - "\u304D\u3064\u3064\u304D", - "\u304D\u3064\u306D", - "\u304D\u3066\u3044", - "\u304D\u3068\u3099\u3046", - "\u304D\u3068\u3099\u304F", - "\u304D\u306A\u3044", - "\u304D\u306A\u304B\u3099", - "\u304D\u306A\u3053", - "\u304D\u306C\u3053\u3099\u3057", - "\u304D\u306D\u3093", - "\u304D\u306E\u3046", - "\u304D\u306E\u3057\u305F", - "\u304D\u306F\u304F", - "\u304D\u3072\u3099\u3057\u3044", - "\u304D\u3072\u3093", - "\u304D\u3075\u304F", - "\u304D\u3075\u3099\u3093", - "\u304D\u307B\u3099\u3046", - "\u304D\u307B\u3093", - "\u304D\u307E\u308B", - "\u304D\u307F\u3064", - "\u304D\u3080\u3059\u3099\u304B\u3057\u3044", - "\u304D\u3081\u308B", - "\u304D\u3082\u305F\u3099\u3081\u3057", - "\u304D\u3082\u3061", - "\u304D\u3082\u306E", - "\u304D\u3083\u304F", - "\u304D\u3084\u304F", - "\u304D\u3099\u3085\u3046\u306B\u304F", - "\u304D\u3088\u3046", - "\u304D\u3087\u3046\u308A\u3085\u3046", - "\u304D\u3089\u3044", - "\u304D\u3089\u304F", - "\u304D\u308A\u3093", - "\u304D\u308C\u3044", - "\u304D\u308C\u3064", - "\u304D\u308D\u304F", - "\u304D\u3099\u308D\u3093", - "\u304D\u308F\u3081\u308B", - "\u304D\u3099\u3093\u3044\u308D", - "\u304D\u3093\u304B\u304F\u3057\u3099", - "\u304D\u3093\u3057\u3099\u3087", - "\u304D\u3093\u3088\u3046\u3072\u3099", - "\u304F\u3099\u3042\u3044", - "\u304F\u3044\u3059\u3099", - "\u304F\u3046\u304B\u3093", - "\u304F\u3046\u304D", - "\u304F\u3046\u304F\u3099\u3093", - "\u304F\u3046\u3053\u3046", - "\u304F\u3099\u3046\u305B\u3044", - "\u304F\u3046\u305D\u3046", - "\u304F\u3099\u3046\u305F\u3089", - "\u304F\u3046\u3075\u304F", - "\u304F\u3046\u307B\u3099", - "\u304F\u304B\u3093", - "\u304F\u304D\u3087\u3046", - "\u304F\u3051\u3099\u3093", - "\u304F\u3099\u3053\u3046", - "\u304F\u3055\u3044", - "\u304F\u3055\u304D", - "\u304F\u3055\u306F\u3099\u306A", - "\u304F\u3055\u308B", - "\u304F\u3057\u3083\u307F", - "\u304F\u3057\u3087\u3046", - "\u304F\u3059\u306E\u304D", - "\u304F\u3059\u308A\u3086\u3072\u3099", - "\u304F\u305B\u3051\u3099", - "\u304F\u305B\u3093", - "\u304F\u3099\u305F\u3044\u3066\u304D", - "\u304F\u305F\u3099\u3055\u308B", - "\u304F\u305F\u3072\u3099\u308C\u308B", - "\u304F\u3061\u3053\u307F", - "\u304F\u3061\u3055\u304D", - "\u304F\u3064\u3057\u305F", - "\u304F\u3099\u3063\u3059\u308A", - "\u304F\u3064\u308D\u304F\u3099", - "\u304F\u3068\u3046\u3066\u3093", - "\u304F\u3068\u3099\u304F", - "\u304F\u306A\u3093", - "\u304F\u306D\u304F\u306D", - "\u304F\u306E\u3046", - "\u304F\u3075\u3046", - "\u304F\u307F\u3042\u308F\u305B", - "\u304F\u307F\u305F\u3066\u308B", - "\u304F\u3081\u308B", - "\u304F\u3084\u304F\u3057\u3087", - "\u304F\u3089\u3059", - "\u304F\u3089\u3078\u3099\u308B", - "\u304F\u308B\u307E", - "\u304F\u308C\u308B", - "\u304F\u308D\u3046", - "\u304F\u308F\u3057\u3044", - "\u304F\u3099\u3093\u304B\u3093", - "\u304F\u3099\u3093\u3057\u3087\u304F", - "\u304F\u3099\u3093\u305F\u3044", - "\u304F\u3099\u3093\u3066", - "\u3051\u3042\u306A", - "\u3051\u3044\u304B\u304F", - "\u3051\u3044\u3051\u3093", - "\u3051\u3044\u3053", - "\u3051\u3044\u3055\u3064", - "\u3051\u3099\u3044\u3057\u3099\u3085\u3064", - "\u3051\u3044\u305F\u3044", - "\u3051\u3099\u3044\u306E\u3046\u3057\u3099\u3093", - "\u3051\u3044\u308C\u304D", - "\u3051\u3044\u308D", - "\u3051\u304A\u3068\u3059", - "\u3051\u304A\u308A\u3082\u306E", - "\u3051\u3099\u304D\u304B", - "\u3051\u3099\u304D\u3051\u3099\u3093", - "\u3051\u3099\u304D\u305F\u3099\u3093", - "\u3051\u3099\u304D\u3061\u3093", - "\u3051\u3099\u304D\u3068\u3064", - "\u3051\u3099\u304D\u306F", - "\u3051\u3099\u304D\u3084\u304F", - "\u3051\u3099\u3053\u3046", - "\u3051\u3099\u3053\u304F\u3057\u3099\u3087\u3046", - "\u3051\u3099\u3055\u3099\u3044", - "\u3051\u3055\u304D", - "\u3051\u3099\u3055\u3099\u3093", - "\u3051\u3057\u304D", - "\u3051\u3057\u3053\u3099\u3080", - "\u3051\u3057\u3087\u3046", - "\u3051\u3099\u3059\u3068", - "\u3051\u305F\u306F\u3099", - "\u3051\u3061\u3083\u3063\u3075\u309A", - "\u3051\u3061\u3089\u3059", - "\u3051\u3064\u3042\u3064", - "\u3051\u3064\u3044", - "\u3051\u3064\u3048\u304D", - "\u3051\u3063\u3053\u3093", - "\u3051\u3064\u3057\u3099\u3087", - "\u3051\u3063\u305B\u304D", - "\u3051\u3063\u3066\u3044", - "\u3051\u3064\u307E\u3064", - "\u3051\u3099\u3064\u3088\u3046\u3072\u3099", - "\u3051\u3099\u3064\u308C\u3044", - "\u3051\u3064\u308D\u3093", - "\u3051\u3099\u3068\u3099\u304F", - "\u3051\u3068\u306F\u3099\u3059", - "\u3051\u3068\u308B", - "\u3051\u306A\u3051\u3099", - "\u3051\u306A\u3059", - "\u3051\u306A\u307F", - "\u3051\u306C\u304D", - "\u3051\u3099\u306D\u3064", - "\u3051\u306D\u3093", - "\u3051\u306F\u3044", - "\u3051\u3099\u3072\u3093", - "\u3051\u3075\u3099\u304B\u3044", - "\u3051\u3099\u307B\u3099\u304F", - "\u3051\u307E\u308A", - "\u3051\u307F\u304B\u308B", - "\u3051\u3080\u3057", - "\u3051\u3080\u308A", - "\u3051\u3082\u306E", - "\u3051\u3089\u3044", - "\u3051\u308D\u3051\u308D", - "\u3051\u308F\u3057\u3044", - "\u3051\u3093\u3044", - "\u3051\u3093\u3048\u3064", - "\u3051\u3093\u304A", - "\u3051\u3093\u304B", - "\u3051\u3099\u3093\u304D", - "\u3051\u3093\u3051\u3099\u3093", - "\u3051\u3093\u3053\u3046", - "\u3051\u3093\u3055\u304F", - "\u3051\u3093\u3057\u3085\u3046", - "\u3051\u3093\u3059\u3046", - "\u3051\u3099\u3093\u305D\u3046", - "\u3051\u3093\u3061\u304F", - "\u3051\u3093\u3066\u3044", - "\u3051\u3093\u3068\u3046", - "\u3051\u3093\u306A\u3044", - "\u3051\u3093\u306B\u3093", - "\u3051\u3099\u3093\u3075\u3099\u3064", - "\u3051\u3093\u307E", - "\u3051\u3093\u307F\u3093", - "\u3051\u3093\u3081\u3044", - "\u3051\u3093\u3089\u3093", - "\u3051\u3093\u308A", - "\u3053\u3042\u304F\u307E", - "\u3053\u3044\u306C", - "\u3053\u3044\u3072\u3099\u3068", - "\u3053\u3099\u3046\u3044", - "\u3053\u3046\u3048\u3093", - "\u3053\u3046\u304A\u3093", - "\u3053\u3046\u304B\u3093", - "\u3053\u3099\u3046\u304D\u3085\u3046", - "\u3053\u3099\u3046\u3051\u3044", - "\u3053\u3046\u3053\u3046", - "\u3053\u3046\u3055\u3044", - "\u3053\u3046\u3057\u3099", - "\u3053\u3046\u3059\u3044", - "\u3053\u3099\u3046\u305B\u3044", - "\u3053\u3046\u305D\u304F", - "\u3053\u3046\u305F\u3044", - "\u3053\u3046\u3061\u3083", - "\u3053\u3046\u3064\u3046", - "\u3053\u3046\u3066\u3044", - "\u3053\u3046\u3068\u3099\u3046", - "\u3053\u3046\u306A\u3044", - "\u3053\u3046\u306F\u3044", - "\u3053\u3099\u3046\u307B\u3046", - "\u3053\u3099\u3046\u307E\u3093", - "\u3053\u3046\u3082\u304F", - "\u3053\u3046\u308A\u3064", - "\u3053\u3048\u308B", - "\u3053\u304A\u308A", - "\u3053\u3099\u304B\u3044", - "\u3053\u3099\u304B\u3099\u3064", - "\u3053\u3099\u304B\u3093", - "\u3053\u304F\u3053\u3099", - "\u3053\u304F\u3055\u3044", - "\u3053\u304F\u3068\u3046", - "\u3053\u304F\u306A\u3044", - "\u3053\u304F\u306F\u304F", - "\u3053\u304F\u3099\u307E", - "\u3053\u3051\u3044", - "\u3053\u3051\u308B", - "\u3053\u3053\u306E\u304B", - "\u3053\u3053\u308D", - "\u3053\u3055\u3081", - "\u3053\u3057\u3064", - "\u3053\u3059\u3046", - "\u3053\u305B\u3044", - "\u3053\u305B\u304D", - "\u3053\u305B\u3099\u3093", - "\u3053\u305D\u305F\u3099\u3066", - "\u3053\u305F\u3044", - "\u3053\u305F\u3048\u308B", - "\u3053\u305F\u3064", - "\u3053\u3061\u3087\u3046", - "\u3053\u3063\u304B", - "\u3053\u3064\u3053\u3064", - "\u3053\u3064\u306F\u3099\u3093", - "\u3053\u3064\u3075\u3099", - "\u3053\u3066\u3044", - "\u3053\u3066\u3093", - "\u3053\u3068\u304B\u3099\u3089", - "\u3053\u3068\u3057", - "\u3053\u3068\u306F\u3099", - "\u3053\u3068\u308A", - "\u3053\u306A\u3053\u3099\u306A", - "\u3053\u306D\u3053\u306D", - "\u3053\u306E\u307E\u307E", - "\u3053\u306E\u307F", - "\u3053\u306E\u3088", - "\u3053\u3099\u306F\u3093", - "\u3053\u3072\u3064\u3057\u3099", - "\u3053\u3075\u3046", - "\u3053\u3075\u3093", - "\u3053\u307B\u3099\u308C\u308B", - "\u3053\u3099\u307E\u3042\u3075\u3099\u3089", - "\u3053\u307E\u304B\u3044", - "\u3053\u3099\u307E\u3059\u308A", - "\u3053\u307E\u3064\u306A", - "\u3053\u307E\u308B", - "\u3053\u3080\u304D\u3099\u3053", - "\u3053\u3082\u3057\u3099", - "\u3053\u3082\u3061", - "\u3053\u3082\u306E", - "\u3053\u3082\u3093", - "\u3053\u3084\u304F", - "\u3053\u3084\u307E", - "\u3053\u3086\u3046", - "\u3053\u3086\u3072\u3099", - "\u3053\u3088\u3044", - "\u3053\u3088\u3046", - "\u3053\u308A\u308B", - "\u3053\u308C\u304F\u3057\u3087\u3093", - "\u3053\u308D\u3063\u3051", - "\u3053\u308F\u3082\u3066", - "\u3053\u308F\u308C\u308B", - "\u3053\u3093\u3044\u3093", - "\u3053\u3093\u304B\u3044", - "\u3053\u3093\u304D", - "\u3053\u3093\u3057\u3085\u3046", - "\u3053\u3093\u3059\u3044", - "\u3053\u3093\u305F\u3099\u3066", - "\u3053\u3093\u3068\u3093", - "\u3053\u3093\u306A\u3093", - "\u3053\u3093\u3072\u3099\u306B", - "\u3053\u3093\u307B\u309A\u3093", - "\u3053\u3093\u307E\u3051", - "\u3053\u3093\u3084", - "\u3053\u3093\u308C\u3044", - "\u3053\u3093\u308F\u304F", - "\u3055\u3099\u3044\u3048\u304D", - "\u3055\u3044\u304B\u3044", - "\u3055\u3044\u304D\u3093", - "\u3055\u3099\u3044\u3051\u3099\u3093", - "\u3055\u3099\u3044\u3053", - "\u3055\u3044\u3057\u3087", - "\u3055\u3044\u305B\u3044", - "\u3055\u3099\u3044\u305F\u304F", - "\u3055\u3099\u3044\u3061\u3085\u3046", - "\u3055\u3044\u3066\u304D", - "\u3055\u3099\u3044\u308A\u3087\u3046", - "\u3055\u3046\u306A", - "\u3055\u304B\u3044\u3057", - "\u3055\u304B\u3099\u3059", - "\u3055\u304B\u306A", - "\u3055\u304B\u307F\u3061", - "\u3055\u304B\u3099\u308B", - "\u3055\u304D\u3099\u3087\u3046", - "\u3055\u304F\u3057", - "\u3055\u304F\u3072\u3093", - "\u3055\u304F\u3089", - "\u3055\u3053\u304F", - "\u3055\u3053\u3064", - "\u3055\u3059\u3099\u304B\u308B", - "\u3055\u3099\u305B\u304D", - "\u3055\u305F\u3093", - "\u3055\u3064\u3048\u3044", - "\u3055\u3099\u3064\u304A\u3093", - "\u3055\u3099\u3063\u304B", - "\u3055\u3099\u3064\u304B\u3099\u304F", - "\u3055\u3063\u304D\u3087\u304F", - "\u3055\u3099\u3063\u3057", - "\u3055\u3064\u3057\u3099\u3093", - "\u3055\u3099\u3063\u305D\u3046", - "\u3055\u3064\u305F\u306F\u3099", - "\u3055\u3064\u307E\u3044\u3082", - "\u3055\u3066\u3044", - "\u3055\u3068\u3044\u3082", - "\u3055\u3068\u3046", - "\u3055\u3068\u304A\u3084", - "\u3055\u3068\u3057", - "\u3055\u3068\u308B", - "\u3055\u306E\u3046", - "\u3055\u306F\u3099\u304F", - "\u3055\u3072\u3099\u3057\u3044", - "\u3055\u3078\u3099\u3064", - "\u3055\u307B\u3046", - "\u3055\u307B\u3068\u3099", - "\u3055\u307E\u3059", - "\u3055\u307F\u3057\u3044", - "\u3055\u307F\u305F\u3099\u308C", - "\u3055\u3080\u3051", - "\u3055\u3081\u308B", - "\u3055\u3084\u3048\u3093\u3068\u3099\u3046", - "\u3055\u3086\u3046", - "\u3055\u3088\u3046", - "\u3055\u3088\u304F", - "\u3055\u3089\u305F\u3099", - "\u3055\u3099\u308B\u305D\u306F\u3099", - "\u3055\u308F\u3084\u304B", - "\u3055\u308F\u308B", - "\u3055\u3093\u3044\u3093", - "\u3055\u3093\u304B", - "\u3055\u3093\u304D\u3083\u304F", - "\u3055\u3093\u3053\u3046", - "\u3055\u3093\u3055\u3044", - "\u3055\u3099\u3093\u3057\u3087", - "\u3055\u3093\u3059\u3046", - "\u3055\u3093\u305B\u3044", - "\u3055\u3093\u305D", - "\u3055\u3093\u3061", - "\u3055\u3093\u307E", - "\u3055\u3093\u307F", - "\u3055\u3093\u3089\u3093", - "\u3057\u3042\u3044", - "\u3057\u3042\u3051\u3099", - "\u3057\u3042\u3055\u3063\u3066", - "\u3057\u3042\u308F\u305B", - "\u3057\u3044\u304F", - "\u3057\u3044\u3093", - "\u3057\u3046\u3061", - "\u3057\u3048\u3044", - "\u3057\u304A\u3051", - "\u3057\u304B\u3044", - "\u3057\u304B\u304F", - "\u3057\u3099\u304B\u3093", - "\u3057\u3053\u3099\u3068", - "\u3057\u3059\u3046", - "\u3057\u3099\u305F\u3099\u3044", - "\u3057\u305F\u3046\u3051", - "\u3057\u305F\u304D\u3099", - "\u3057\u305F\u3066", - "\u3057\u305F\u307F", - "\u3057\u3061\u3087\u3046", - "\u3057\u3061\u308A\u3093", - "\u3057\u3063\u304B\u308A", - "\u3057\u3064\u3057\u3099", - "\u3057\u3064\u3082\u3093", - "\u3057\u3066\u3044", - "\u3057\u3066\u304D", - "\u3057\u3066\u3064", - "\u3057\u3099\u3066\u3093", - "\u3057\u3099\u3068\u3099\u3046", - "\u3057\u306A\u304D\u3099\u308C", - "\u3057\u306A\u3082\u306E", - "\u3057\u306A\u3093", - "\u3057\u306D\u307E", - "\u3057\u306D\u3093", - "\u3057\u306E\u304F\u3099", - "\u3057\u306E\u3075\u3099", - "\u3057\u306F\u3044", - "\u3057\u306F\u3099\u304B\u308A", - "\u3057\u306F\u3064", - "\u3057\u306F\u3089\u3044", - "\u3057\u306F\u3093", - "\u3057\u3072\u3087\u3046", - "\u3057\u3075\u304F", - "\u3057\u3099\u3075\u3099\u3093", - "\u3057\u3078\u3044", - "\u3057\u307B\u3046", - "\u3057\u307B\u3093", - "\u3057\u307E\u3046", - "\u3057\u307E\u308B", - "\u3057\u307F\u3093", - "\u3057\u3080\u3051\u308B", - "\u3057\u3099\u3080\u3057\u3087", - "\u3057\u3081\u3044", - "\u3057\u3081\u308B", - "\u3057\u3082\u3093", - "\u3057\u3083\u3044\u3093", - "\u3057\u3083\u3046\u3093", - "\u3057\u3083\u304A\u3093", - "\u3057\u3099\u3083\u304B\u3099\u3044\u3082", - "\u3057\u3084\u304F\u3057\u3087", - "\u3057\u3083\u304F\u307B\u3046", - "\u3057\u3083\u3051\u3093", - "\u3057\u3083\u3053", - "\u3057\u3083\u3055\u3099\u3044", - "\u3057\u3083\u3057\u3093", - "\u3057\u3083\u305B\u3093", - "\u3057\u3083\u305D\u3046", - "\u3057\u3083\u305F\u3044", - "\u3057\u3083\u3061\u3087\u3046", - "\u3057\u3083\u3063\u304D\u3093", - "\u3057\u3099\u3083\u307E", - "\u3057\u3083\u308A\u3093", - "\u3057\u3083\u308C\u3044", - "\u3057\u3099\u3086\u3046", - "\u3057\u3099\u3085\u3046\u3057\u3087", - "\u3057\u3085\u304F\u306F\u304F", - "\u3057\u3099\u3085\u3057\u3093", - "\u3057\u3085\u3063\u305B\u304D", - "\u3057\u3085\u307F", - "\u3057\u3085\u3089\u306F\u3099", - "\u3057\u3099\u3085\u3093\u306F\u3099\u3093", - "\u3057\u3087\u3046\u304B\u3044", - "\u3057\u3087\u304F\u305F\u304F", - "\u3057\u3087\u3063\u3051\u3093", - "\u3057\u3087\u3068\u3099\u3046", - "\u3057\u3087\u3082\u3064", - "\u3057\u3089\u305B\u308B", - "\u3057\u3089\u3078\u3099\u308B", - "\u3057\u3093\u304B", - "\u3057\u3093\u3053\u3046", - "\u3057\u3099\u3093\u3057\u3099\u3083", - "\u3057\u3093\u305B\u3044\u3057\u3099", - "\u3057\u3093\u3061\u304F", - "\u3057\u3093\u308A\u3093", - "\u3059\u3042\u3051\u3099", - "\u3059\u3042\u3057", - "\u3059\u3042\u306A", - "\u3059\u3099\u3042\u3093", - "\u3059\u3044\u3048\u3044", - "\u3059\u3044\u304B", - "\u3059\u3044\u3068\u3046", - "\u3059\u3099\u3044\u3075\u3099\u3093", - "\u3059\u3044\u3088\u3046\u3072\u3099", - "\u3059\u3046\u304B\u3099\u304F", - "\u3059\u3046\u3057\u3099\u3064", - "\u3059\u3046\u305B\u3093", - "\u3059\u304A\u3068\u3099\u308A", - "\u3059\u304D\u307E", - "\u3059\u304F\u3046", - "\u3059\u304F\u306A\u3044", - "\u3059\u3051\u308B", - "\u3059\u3053\u3099\u3044", - "\u3059\u3053\u3057", - "\u3059\u3099\u3055\u3093", - "\u3059\u3059\u3099\u3057\u3044", - "\u3059\u3059\u3080", - "\u3059\u3059\u3081\u308B", - "\u3059\u3063\u304B\u308A", - "\u3059\u3099\u3063\u3057\u308A", - "\u3059\u3099\u3063\u3068", - "\u3059\u3066\u304D", - "\u3059\u3066\u308B", - "\u3059\u306D\u308B", - "\u3059\u306E\u3053", - "\u3059\u306F\u305F\u3099", - "\u3059\u306F\u3099\u3089\u3057\u3044", - "\u3059\u3099\u3072\u3087\u3046", - "\u3059\u3099\u3075\u3099\u306C\u308C", - "\u3059\u3075\u3099\u308A", - "\u3059\u3075\u308C", - "\u3059\u3078\u3099\u3066", - "\u3059\u3078\u3099\u308B", - "\u3059\u3099\u307B\u3046", - "\u3059\u307B\u3099\u3093", - "\u3059\u307E\u3044", - "\u3059\u3081\u3057", - "\u3059\u3082\u3046", - "\u3059\u3084\u304D", - "\u3059\u3089\u3059\u3089", - "\u3059\u308B\u3081", - "\u3059\u308C\u3061\u304B\u3099\u3046", - "\u3059\u308D\u3063\u3068", - "\u3059\u308F\u308B", - "\u3059\u3093\u305B\u3099\u3093", - "\u3059\u3093\u307B\u309A\u3046", - "\u305B\u3042\u3075\u3099\u3089", - "\u305B\u3044\u304B\u3064", - "\u305B\u3044\u3051\u3099\u3093", - "\u305B\u3044\u3057\u3099", - "\u305B\u3044\u3088\u3046", - "\u305B\u304A\u3046", - "\u305B\u304B\u3044\u304B\u3093", - "\u305B\u304D\u306B\u3093", - "\u305B\u304D\u3080", - "\u305B\u304D\u3086", - "\u305B\u304D\u3089\u3093\u3046\u3093", - "\u305B\u3051\u3093", - "\u305B\u3053\u3046", - "\u305B\u3059\u3057\u3099", - "\u305B\u305F\u3044", - "\u305B\u305F\u3051", - "\u305B\u3063\u304B\u304F", - "\u305B\u3063\u304D\u3083\u304F", - "\u305B\u3099\u3063\u304F", - "\u305B\u3063\u3051\u3093", - "\u305B\u3063\u3053\u3064", - "\u305B\u3063\u3055\u305F\u304F\u307E", - "\u305B\u3064\u305D\u3099\u304F", - "\u305B\u3064\u305F\u3099\u3093", - "\u305B\u3064\u3066\u3099\u3093", - "\u305B\u3063\u306F\u309A\u3093", - "\u305B\u3064\u3072\u3099", - "\u305B\u3064\u3075\u3099\u3093", - "\u305B\u3064\u3081\u3044", - "\u305B\u3064\u308A\u3064", - "\u305B\u306A\u304B", - "\u305B\u306E\u3072\u3099", - "\u305B\u306F\u306F\u3099", - "\u305B\u3072\u3099\u308D", - "\u305B\u307B\u3099\u306D", - "\u305B\u307E\u3044", - "\u305B\u307E\u308B", - "\u305B\u3081\u308B", - "\u305B\u3082\u305F\u308C", - "\u305B\u308A\u3075", - "\u305B\u3099\u3093\u3042\u304F", - "\u305B\u3093\u3044", - "\u305B\u3093\u3048\u3044", - "\u305B\u3093\u304B", - "\u305B\u3093\u304D\u3087", - "\u305B\u3093\u304F", - "\u305B\u3093\u3051\u3099\u3093", - "\u305B\u3099\u3093\u3053\u3099", - "\u305B\u3093\u3055\u3044", - "\u305B\u3093\u3057\u3085", - "\u305B\u3093\u3059\u3044", - "\u305B\u3093\u305B\u3044", - "\u305B\u3093\u305D\u3099", - "\u305B\u3093\u305F\u304F", - "\u305B\u3093\u3061\u3087\u3046", - "\u305B\u3093\u3066\u3044", - "\u305B\u3093\u3068\u3046", - "\u305B\u3093\u306C\u304D", - "\u305B\u3093\u306D\u3093", - "\u305B\u3093\u306F\u309A\u3044", - "\u305B\u3099\u3093\u3075\u3099", - "\u305B\u3099\u3093\u307B\u309A\u3046", - "\u305B\u3093\u3080", - "\u305B\u3093\u3081\u3093\u3057\u3099\u3087", - "\u305B\u3093\u3082\u3093", - "\u305B\u3093\u3084\u304F", - "\u305B\u3093\u3086\u3046", - "\u305B\u3093\u3088\u3046", - "\u305B\u3099\u3093\u3089", - "\u305B\u3099\u3093\u308A\u3083\u304F", - "\u305B\u3093\u308C\u3044", - "\u305B\u3093\u308D", - "\u305D\u3042\u304F", - "\u305D\u3044\u3068\u3051\u3099\u308B", - "\u305D\u3044\u306D", - "\u305D\u3046\u304B\u3099\u3093\u304D\u3087\u3046", - "\u305D\u3046\u304D", - "\u305D\u3046\u3053\u3099", - "\u305D\u3046\u3057\u3093", - "\u305D\u3046\u305F\u3099\u3093", - "\u305D\u3046\u306A\u3093", - "\u305D\u3046\u3072\u3099", - "\u305D\u3046\u3081\u3093", - "\u305D\u3046\u308A", - "\u305D\u3048\u3082\u306E", - "\u305D\u3048\u3093", - "\u305D\u304B\u3099\u3044", - "\u305D\u3051\u3099\u304D", - "\u305D\u3053\u3046", - "\u305D\u3053\u305D\u3053", - "\u305D\u3055\u3099\u3044", - "\u305D\u3057\u306A", - "\u305D\u305B\u3044", - "\u305D\u305B\u3093", - "\u305D\u305D\u304F\u3099", - "\u305D\u305F\u3099\u3066\u308B", - "\u305D\u3064\u3046", - "\u305D\u3064\u3048\u3093", - "\u305D\u3063\u304B\u3093", - "\u305D\u3064\u304D\u3099\u3087\u3046", - "\u305D\u3063\u3051\u3064", - "\u305D\u3063\u3053\u3046", - "\u305D\u3063\u305B\u3093", - "\u305D\u3063\u3068", - "\u305D\u3068\u304B\u3099\u308F", - "\u305D\u3068\u3064\u3099\u3089", - "\u305D\u306A\u3048\u308B", - "\u305D\u306A\u305F", - "\u305D\u3075\u307B\u3099", - "\u305D\u307B\u3099\u304F", - "\u305D\u307B\u3099\u308D", - "\u305D\u307E\u3064", - "\u305D\u307E\u308B", - "\u305D\u3080\u304F", - "\u305D\u3080\u308A\u3048", - "\u305D\u3081\u308B", - "\u305D\u3082\u305D\u3082", - "\u305D\u3088\u304B\u305B\u3099", - "\u305D\u3089\u307E\u3081", - "\u305D\u308D\u3046", - "\u305D\u3093\u304B\u3044", - "\u305D\u3093\u3051\u3044", - "\u305D\u3093\u3055\u3099\u3044", - "\u305D\u3093\u3057\u3064", - "\u305D\u3093\u305D\u3099\u304F", - "\u305D\u3093\u3061\u3087\u3046", - "\u305D\u3099\u3093\u3072\u3099", - "\u305D\u3099\u3093\u3075\u3099\u3093", - "\u305D\u3093\u307F\u3093", - "\u305F\u3042\u3044", - "\u305F\u3044\u3044\u3093", - "\u305F\u3044\u3046\u3093", - "\u305F\u3044\u3048\u304D", - "\u305F\u3044\u304A\u3046", - "\u305F\u3099\u3044\u304B\u3099\u304F", - "\u305F\u3044\u304D", - "\u305F\u3044\u304F\u3099\u3046", - "\u305F\u3044\u3051\u3093", - "\u305F\u3044\u3053", - "\u305F\u3044\u3055\u3099\u3044", - "\u305F\u3099\u3044\u3057\u3099\u3087\u3046\u3075\u3099", - "\u305F\u3099\u3044\u3059\u304D", - "\u305F\u3044\u305B\u3064", - "\u305F\u3044\u305D\u3046", - "\u305F\u3099\u3044\u305F\u3044", - "\u305F\u3044\u3061\u3087\u3046", - "\u305F\u3044\u3066\u3044", - "\u305F\u3099\u3044\u3068\u3099\u3053\u308D", - "\u305F\u3044\u306A\u3044", - "\u305F\u3044\u306D\u3064", - "\u305F\u3044\u306E\u3046", - "\u305F\u3044\u306F\u3093", - "\u305F\u3099\u3044\u3072\u3087\u3046", - "\u305F\u3044\u3075\u3046", - "\u305F\u3044\u3078\u3093", - "\u305F\u3044\u307B", - "\u305F\u3044\u307E\u3064\u306F\u3099\u306A", - "\u305F\u3044\u307F\u3093\u304F\u3099", - "\u305F\u3044\u3080", - "\u305F\u3044\u3081\u3093", - "\u305F\u3044\u3084\u304D", - "\u305F\u3044\u3088\u3046", - "\u305F\u3044\u3089", - "\u305F\u3044\u308A\u3087\u304F", - "\u305F\u3044\u308B", - "\u305F\u3044\u308F\u3093", - "\u305F\u3046\u3048", - "\u305F\u3048\u308B", - "\u305F\u304A\u3059", - "\u305F\u304A\u308B", - "\u305F\u304A\u308C\u308B", - "\u305F\u304B\u3044", - "\u305F\u304B\u306D", - "\u305F\u304D\u3072\u3099", - "\u305F\u304F\u3055\u3093", - "\u305F\u3053\u304F", - "\u305F\u3053\u3084\u304D", - "\u305F\u3055\u3044", - "\u305F\u3057\u3055\u3099\u3093", - "\u305F\u3099\u3057\u3099\u3083\u308C", - "\u305F\u3059\u3051\u308B", - "\u305F\u3059\u3099\u3055\u308F\u308B", - "\u305F\u305D\u304B\u3099\u308C", - "\u305F\u305F\u304B\u3046", - "\u305F\u305F\u304F", - "\u305F\u305F\u3099\u3057\u3044", - "\u305F\u305F\u307F", - "\u305F\u3061\u306F\u3099\u306A", - "\u305F\u3099\u3063\u304B\u3044", - "\u305F\u3099\u3063\u304D\u3083\u304F", - "\u305F\u3099\u3063\u3053", - "\u305F\u3099\u3063\u3057\u3085\u3064", - "\u305F\u3099\u3063\u305F\u3044", - "\u305F\u3066\u308B", - "\u305F\u3068\u3048\u308B", - "\u305F\u306A\u306F\u3099\u305F", - "\u305F\u306B\u3093", - "\u305F\u306C\u304D", - "\u305F\u306E\u3057\u307F", - "\u305F\u306F\u3064", - "\u305F\u3075\u3099\u3093", - "\u305F\u3078\u3099\u308B", - "\u305F\u307B\u3099\u3046", - "\u305F\u307E\u3053\u3099", - "\u305F\u307E\u308B", - "\u305F\u3099\u3080\u308B", - "\u305F\u3081\u3044\u304D", - "\u305F\u3081\u3059", - "\u305F\u3081\u308B", - "\u305F\u3082\u3064", - "\u305F\u3084\u3059\u3044", - "\u305F\u3088\u308B", - "\u305F\u3089\u3059", - "\u305F\u308A\u304D\u307B\u3093\u304B\u3099\u3093", - "\u305F\u308A\u3087\u3046", - "\u305F\u308A\u308B", - "\u305F\u308B\u3068", - "\u305F\u308C\u308B", - "\u305F\u308C\u3093\u3068", - "\u305F\u308D\u3063\u3068", - "\u305F\u308F\u3080\u308C\u308B", - "\u305F\u3099\u3093\u3042\u3064", - "\u305F\u3093\u3044", - "\u305F\u3093\u304A\u3093", - "\u305F\u3093\u304B", - "\u305F\u3093\u304D", - "\u305F\u3093\u3051\u3093", - "\u305F\u3093\u3053\u3099", - "\u305F\u3093\u3055\u3093", - "\u305F\u3093\u3057\u3099\u3087\u3046\u3072\u3099", - "\u305F\u3099\u3093\u305B\u3044", - "\u305F\u3093\u305D\u304F", - "\u305F\u3093\u305F\u3044", - "\u305F\u3099\u3093\u3061", - "\u305F\u3093\u3066\u3044", - "\u305F\u3093\u3068\u3046", - "\u305F\u3099\u3093\u306A", - "\u305F\u3093\u306B\u3093", - "\u305F\u3099\u3093\u306D\u3064", - "\u305F\u3093\u306E\u3046", - "\u305F\u3093\u3072\u309A\u3093", - "\u305F\u3099\u3093\u307B\u3099\u3046", - "\u305F\u3093\u307E\u3064", - "\u305F\u3093\u3081\u3044", - "\u305F\u3099\u3093\u308C\u3064", - "\u305F\u3099\u3093\u308D", - "\u305F\u3099\u3093\u308F", - "\u3061\u3042\u3044", - "\u3061\u3042\u3093", - "\u3061\u3044\u304D", - "\u3061\u3044\u3055\u3044", - "\u3061\u3048\u3093", - "\u3061\u304B\u3044", - "\u3061\u304B\u3089", - "\u3061\u304D\u3085\u3046", - "\u3061\u304D\u3093", - "\u3061\u3051\u3044\u3059\u3099", - "\u3061\u3051\u3093", - "\u3061\u3053\u304F", - "\u3061\u3055\u3044", - "\u3061\u3057\u304D", - "\u3061\u3057\u308A\u3087\u3046", - "\u3061\u305B\u3044", - "\u3061\u305D\u3046", - "\u3061\u305F\u3044", - "\u3061\u305F\u3093", - "\u3061\u3061\u304A\u3084", - "\u3061\u3064\u3057\u3099\u3087", - "\u3061\u3066\u304D", - "\u3061\u3066\u3093", - "\u3061\u306C\u304D", - "\u3061\u306C\u308A", - "\u3061\u306E\u3046", - "\u3061\u3072\u3087\u3046", - "\u3061\u3078\u3044\u305B\u3093", - "\u3061\u307B\u3046", - "\u3061\u307E\u305F", - "\u3061\u307F\u3064", - "\u3061\u307F\u3068\u3099\u308D", - "\u3061\u3081\u3044\u3068\u3099", - "\u3061\u3083\u3093\u3053\u306A\u3078\u3099", - "\u3061\u3085\u3046\u3044", - "\u3061\u3086\u308A\u3087\u304F", - "\u3061\u3087\u3046\u3057", - "\u3061\u3087\u3055\u304F\u3051\u3093", - "\u3061\u3089\u3057", - "\u3061\u3089\u307F", - "\u3061\u308A\u304B\u3099\u307F", - "\u3061\u308A\u3087\u3046", - "\u3061\u308B\u3068\u3099", - "\u3061\u308F\u308F", - "\u3061\u3093\u305F\u3044", - "\u3061\u3093\u3082\u304F", - "\u3064\u3044\u304B", - "\u3064\u3044\u305F\u3061", - "\u3064\u3046\u304B", - "\u3064\u3046\u3057\u3099\u3087\u3046", - "\u3064\u3046\u306F\u3093", - "\u3064\u3046\u308F", - "\u3064\u304B\u3046", - "\u3064\u304B\u308C\u308B", - "\u3064\u304F\u306D", - "\u3064\u304F\u308B", - "\u3064\u3051\u306D", - "\u3064\u3051\u308B", - "\u3064\u3053\u3099\u3046", - "\u3064\u305F\u3048\u308B", - "\u3064\u3064\u3099\u304F", - "\u3064\u3064\u3057\u3099", - "\u3064\u3064\u3080", - "\u3064\u3068\u3081\u308B", - "\u3064\u306A\u304B\u3099\u308B", - "\u3064\u306A\u307F", - "\u3064\u306D\u3064\u3099\u306D", - "\u3064\u306E\u308B", - "\u3064\u3075\u3099\u3059", - "\u3064\u307E\u3089\u306A\u3044", - "\u3064\u307E\u308B", - "\u3064\u307F\u304D", - "\u3064\u3081\u305F\u3044", - "\u3064\u3082\u308A", - "\u3064\u3082\u308B", - "\u3064\u3088\u3044", - "\u3064\u308B\u307B\u3099", - "\u3064\u308B\u307F\u304F", - "\u3064\u308F\u3082\u306E", - "\u3064\u308F\u308A", - "\u3066\u3042\u3057", - "\u3066\u3042\u3066", - "\u3066\u3042\u307F", - "\u3066\u3044\u304A\u3093", - "\u3066\u3044\u304B", - "\u3066\u3044\u304D", - "\u3066\u3044\u3051\u3044", - "\u3066\u3044\u3053\u304F", - "\u3066\u3044\u3055\u3064", - "\u3066\u3044\u3057", - "\u3066\u3044\u305B\u3044", - "\u3066\u3044\u305F\u3044", - "\u3066\u3044\u3068\u3099", - "\u3066\u3044\u306D\u3044", - "\u3066\u3044\u3072\u3087\u3046", - "\u3066\u3044\u3078\u3093", - "\u3066\u3044\u307B\u3099\u3046", - "\u3066\u3046\u3061", - "\u3066\u304A\u304F\u308C", - "\u3066\u304D\u3068\u3046", - "\u3066\u304F\u3072\u3099", - "\u3066\u3099\u3053\u307B\u3099\u3053", - "\u3066\u3055\u304D\u3099\u3087\u3046", - "\u3066\u3055\u3051\u3099", - "\u3066\u3059\u308A", - "\u3066\u305D\u3046", - "\u3066\u3061\u304B\u3099\u3044", - "\u3066\u3061\u3087\u3046", - "\u3066\u3064\u304B\u3099\u304F", - "\u3066\u3064\u3064\u3099\u304D", - "\u3066\u3099\u3063\u306F\u309A", - "\u3066\u3064\u307B\u3099\u3046", - "\u3066\u3064\u3084", - "\u3066\u3099\u306C\u304B\u3048", - "\u3066\u306C\u304D", - "\u3066\u306C\u304F\u3099\u3044", - "\u3066\u306E\u3072\u3089", - "\u3066\u306F\u3044", - "\u3066\u3075\u3099\u304F\u308D", - "\u3066\u3075\u305F\u3099", - "\u3066\u307B\u3068\u3099\u304D", - "\u3066\u307B\u3093", - "\u3066\u307E\u3048", - "\u3066\u307E\u304D\u3059\u3099\u3057", - "\u3066\u307F\u3057\u3099\u304B", - "\u3066\u307F\u3084\u3051\u3099", - "\u3066\u3089\u3059", - "\u3066\u308C\u3072\u3099", - "\u3066\u308F\u3051", - "\u3066\u308F\u305F\u3057", - "\u3066\u3099\u3093\u3042\u3064", - "\u3066\u3093\u3044\u3093", - "\u3066\u3093\u304B\u3044", - "\u3066\u3093\u304D", - "\u3066\u3093\u304F\u3099", - "\u3066\u3093\u3051\u3093", - "\u3066\u3093\u3053\u3099\u304F", - "\u3066\u3093\u3055\u3044", - "\u3066\u3093\u3057", - "\u3066\u3093\u3059\u3046", - "\u3066\u3099\u3093\u3061", - "\u3066\u3093\u3066\u304D", - "\u3066\u3093\u3068\u3046", - "\u3066\u3093\u306A\u3044", - "\u3066\u3093\u3075\u309A\u3089", - "\u3066\u3093\u307B\u3099\u3046\u305F\u3099\u3044", - "\u3066\u3093\u3081\u3064", - "\u3066\u3093\u3089\u3093\u304B\u3044", - "\u3066\u3099\u3093\u308A\u3087\u304F", - "\u3066\u3099\u3093\u308F", - "\u3068\u3099\u3042\u3044", - "\u3068\u3044\u308C", - "\u3068\u3099\u3046\u304B\u3093", - "\u3068\u3046\u304D\u3085\u3046", - "\u3068\u3099\u3046\u304F\u3099", - "\u3068\u3046\u3057", - "\u3068\u3046\u3080\u304D\u3099", - "\u3068\u304A\u3044", - "\u3068\u304A\u304B", - "\u3068\u304A\u304F", - "\u3068\u304A\u3059", - "\u3068\u304A\u308B", - "\u3068\u304B\u3044", - "\u3068\u304B\u3059", - "\u3068\u304D\u304A\u308A", - "\u3068\u304D\u3068\u3099\u304D", - "\u3068\u304F\u3044", - "\u3068\u304F\u3057\u3085\u3046", - "\u3068\u304F\u3066\u3093", - "\u3068\u304F\u306B", - "\u3068\u304F\u3078\u3099\u3064", - "\u3068\u3051\u3044", - "\u3068\u3051\u308B", - "\u3068\u3053\u3084", - "\u3068\u3055\u304B", - "\u3068\u3057\u3087\u304B\u3093", - "\u3068\u305D\u3046", - "\u3068\u305F\u3093", - "\u3068\u3061\u3085\u3046", - "\u3068\u3063\u304D\u3085\u3046", - "\u3068\u3063\u304F\u3093", - "\u3068\u3064\u305B\u3099\u3093", - "\u3068\u3064\u306B\u3085\u3046", - "\u3068\u3068\u3099\u3051\u308B", - "\u3068\u3068\u306E\u3048\u308B", - "\u3068\u306A\u3044", - "\u3068\u306A\u3048\u308B", - "\u3068\u306A\u308A", - "\u3068\u306E\u3055\u307E", - "\u3068\u306F\u3099\u3059", - "\u3068\u3099\u3075\u3099\u304B\u3099\u308F", - "\u3068\u307B\u3046", - "\u3068\u307E\u308B", - "\u3068\u3081\u308B", - "\u3068\u3082\u305F\u3099\u3061", - "\u3068\u3082\u308B", - "\u3068\u3099\u3088\u3046\u3072\u3099", - "\u3068\u3089\u3048\u308B", - "\u3068\u3093\u304B\u3064", - "\u3068\u3099\u3093\u3075\u3099\u308A", - "\u306A\u3044\u304B\u304F", - "\u306A\u3044\u3053\u3046", - "\u306A\u3044\u3057\u3087", - "\u306A\u3044\u3059", - "\u306A\u3044\u305B\u3093", - "\u306A\u3044\u305D\u3046", - "\u306A\u304A\u3059", - "\u306A\u304B\u3099\u3044", - "\u306A\u304F\u3059", - "\u306A\u3051\u3099\u308B", - "\u306A\u3053\u3046\u3068\u3099", - "\u306A\u3055\u3051", - "\u306A\u305F\u3066\u3099\u3053\u3053", - "\u306A\u3063\u3068\u3046", - "\u306A\u3064\u3084\u3059\u307F", - "\u306A\u306A\u304A\u3057", - "\u306A\u306B\u3053\u3099\u3068", - "\u306A\u306B\u3082\u306E", - "\u306A\u306B\u308F", - "\u306A\u306E\u304B", - "\u306A\u3075\u305F\u3099", - "\u306A\u307E\u3044\u304D", - "\u306A\u307E\u3048", - "\u306A\u307E\u307F", - "\u306A\u307F\u305F\u3099", - "\u306A\u3081\u3089\u304B", - "\u306A\u3081\u308B", - "\u306A\u3084\u3080", - "\u306A\u3089\u3046", - "\u306A\u3089\u3072\u3099", - "\u306A\u3089\u3075\u3099", - "\u306A\u308C\u308B", - "\u306A\u308F\u3068\u3072\u3099", - "\u306A\u308F\u306F\u3099\u308A", - "\u306B\u3042\u3046", - "\u306B\u3044\u304B\u3099\u305F", - "\u306B\u3046\u3051", - "\u306B\u304A\u3044", - "\u306B\u304B\u3044", - "\u306B\u304B\u3099\u3066", - "\u306B\u304D\u3072\u3099", - "\u306B\u304F\u3057\u307F", - "\u306B\u304F\u307E\u3093", - "\u306B\u3051\u3099\u308B", - "\u306B\u3055\u3093\u304B\u305F\u3093\u305D", - "\u306B\u3057\u304D", - "\u306B\u305B\u3082\u306E", - "\u306B\u3061\u3057\u3099\u3087\u3046", - "\u306B\u3061\u3088\u3046\u3072\u3099", - "\u306B\u3063\u304B", - "\u306B\u3063\u304D", - "\u306B\u3063\u3051\u3044", - "\u306B\u3063\u3053\u3046", - "\u306B\u3063\u3055\u3093", - "\u306B\u3063\u3057\u3087\u304F", - "\u306B\u3063\u3059\u3046", - "\u306B\u3063\u305B\u304D", - "\u306B\u3063\u3066\u3044", - "\u306B\u306A\u3046", - "\u306B\u307B\u3093", - "\u306B\u307E\u3081", - "\u306B\u3082\u3064", - "\u306B\u3084\u308A", - "\u306B\u3085\u3046\u3044\u3093", - "\u306B\u308A\u3093\u3057\u3083", - "\u306B\u308F\u3068\u308A", - "\u306B\u3093\u3044", - "\u306B\u3093\u304B", - "\u306B\u3093\u304D", - "\u306B\u3093\u3051\u3099\u3093", - "\u306B\u3093\u3057\u304D", - "\u306B\u3093\u3059\u3099\u3046", - "\u306B\u3093\u305D\u3046", - "\u306B\u3093\u305F\u3044", - "\u306B\u3093\u3061", - "\u306B\u3093\u3066\u3044", - "\u306B\u3093\u306B\u304F", - "\u306B\u3093\u3075\u309A", - "\u306B\u3093\u307E\u308A", - "\u306B\u3093\u3080", - "\u306B\u3093\u3081\u3044", - "\u306B\u3093\u3088\u3046", - "\u306C\u3044\u304F\u304D\u3099", - "\u306C\u304B\u3059", - "\u306C\u304F\u3099\u3044\u3068\u308B", - "\u306C\u304F\u3099\u3046", - "\u306C\u304F\u3082\u308A", - "\u306C\u3059\u3080", - "\u306C\u307E\u3048\u3072\u3099", - "\u306C\u3081\u308A", - "\u306C\u3089\u3059", - "\u306C\u3093\u3061\u3083\u304F", - "\u306D\u3042\u3051\u3099", - "\u306D\u3044\u304D", - "\u306D\u3044\u308B", - "\u306D\u3044\u308D", - "\u306D\u304F\u3099\u305B", - "\u306D\u304F\u305F\u3044", - "\u306D\u304F\u3089", - "\u306D\u3053\u305B\u3099", - "\u306D\u3053\u3080", - "\u306D\u3055\u3051\u3099", - "\u306D\u3059\u3053\u3099\u3059", - "\u306D\u305D\u3078\u3099\u308B", - "\u306D\u305F\u3099\u3093", - "\u306D\u3064\u3044", - "\u306D\u3063\u3057\u3093", - "\u306D\u3064\u305D\u3099\u3046", - "\u306D\u3063\u305F\u3044\u304D\u3099\u3087", - "\u306D\u3075\u3099\u305D\u304F", - "\u306D\u3075\u305F\u3099", - "\u306D\u307B\u3099\u3046", - "\u306D\u307B\u308A\u306F\u307B\u308A", - "\u306D\u307E\u304D", - "\u306D\u307E\u308F\u3057", - "\u306D\u307F\u307F", - "\u306D\u3080\u3044", - "\u306D\u3080\u305F\u3044", - "\u306D\u3082\u3068", - "\u306D\u3089\u3046", - "\u306D\u308F\u3055\u3099", - "\u306D\u3093\u3044\u308A", - "\u306D\u3093\u304A\u3057", - "\u306D\u3093\u304B\u3093", - "\u306D\u3093\u304D\u3093", - "\u306D\u3093\u304F\u3099", - "\u306D\u3093\u3055\u3099", - "\u306D\u3093\u3057", - "\u306D\u3093\u3061\u3083\u304F", - "\u306D\u3093\u3068\u3099", - "\u306D\u3093\u3072\u309A", - "\u306D\u3093\u3075\u3099\u3064", - "\u306D\u3093\u307E\u3064", - "\u306D\u3093\u308A\u3087\u3046", - "\u306D\u3093\u308C\u3044", - "\u306E\u3044\u3059\u3099", - "\u306E\u304A\u3064\u3099\u307E", - "\u306E\u304B\u3099\u3059", - "\u306E\u304D\u306A\u307F", - "\u306E\u3053\u304D\u3099\u308A", - "\u306E\u3053\u3059", - "\u306E\u3053\u308B", - "\u306E\u305B\u308B", - "\u306E\u305D\u3099\u304F", - "\u306E\u305D\u3099\u3080", - "\u306E\u305F\u307E\u3046", - "\u306E\u3061\u307B\u3068\u3099", - "\u306E\u3063\u304F", - "\u306E\u306F\u3099\u3059", - "\u306E\u306F\u3089", - "\u306E\u3078\u3099\u308B", - "\u306E\u307B\u3099\u308B", - "\u306E\u307F\u3082\u306E", - "\u306E\u3084\u307E", - "\u306E\u3089\u3044\u306C", - "\u306E\u3089\u306D\u3053", - "\u306E\u308A\u3082\u306E", - "\u306E\u308A\u3086\u304D", - "\u306E\u308C\u3093", - "\u306E\u3093\u304D", - "\u306F\u3099\u3042\u3044", - "\u306F\u3042\u304F", - "\u306F\u3099\u3042\u3055\u3093", - "\u306F\u3099\u3044\u304B", - "\u306F\u3099\u3044\u304F", - "\u306F\u3044\u3051\u3093", - "\u306F\u3044\u3053\u3099", - "\u306F\u3044\u3057\u3093", - "\u306F\u3044\u3059\u3044", - "\u306F\u3044\u305B\u3093", - "\u306F\u3044\u305D\u3046", - "\u306F\u3044\u3061", - "\u306F\u3099\u3044\u306F\u3099\u3044", - "\u306F\u3044\u308C\u3064", - "\u306F\u3048\u308B", - "\u306F\u304A\u308B", - "\u306F\u304B\u3044", - "\u306F\u3099\u304B\u308A", - "\u306F\u304B\u308B", - "\u306F\u304F\u3057\u3085", - "\u306F\u3051\u3093", - "\u306F\u3053\u3075\u3099", - "\u306F\u3055\u307F", - "\u306F\u3055\u3093", - "\u306F\u3057\u3053\u3099", - "\u306F\u3099\u3057\u3087", - "\u306F\u3057\u308B", - "\u306F\u305B\u308B", - "\u306F\u309A\u305D\u3053\u3093", - "\u306F\u305D\u3093", - "\u306F\u305F\u3093", - "\u306F\u3061\u307F\u3064", - "\u306F\u3064\u304A\u3093", - "\u306F\u3063\u304B\u304F", - "\u306F\u3064\u3099\u304D", - "\u306F\u3063\u304D\u308A", - "\u306F\u3063\u304F\u3064", - "\u306F\u3063\u3051\u3093", - "\u306F\u3063\u3053\u3046", - "\u306F\u3063\u3055\u3093", - "\u306F\u3063\u3057\u3093", - "\u306F\u3063\u305F\u3064", - "\u306F\u3063\u3061\u3085\u3046", - "\u306F\u3063\u3066\u3093", - "\u306F\u3063\u3072\u309A\u3087\u3046", - "\u306F\u3063\u307B\u309A\u3046", - "\u306F\u306A\u3059", - "\u306F\u306A\u3072\u3099", - "\u306F\u306B\u304B\u3080", - "\u306F\u3075\u3099\u3089\u3057", - "\u306F\u307F\u304B\u3099\u304D", - "\u306F\u3080\u304B\u3046", - "\u306F\u3081\u3064", - "\u306F\u3084\u3044", - "\u306F\u3084\u3057", - "\u306F\u3089\u3046", - "\u306F\u308D\u3046\u3043\u3093", - "\u306F\u308F\u3044", - "\u306F\u3093\u3044", - "\u306F\u3093\u3048\u3044", - "\u306F\u3093\u304A\u3093", - "\u306F\u3093\u304B\u304F", - "\u306F\u3093\u304D\u3087\u3046", - "\u306F\u3099\u3093\u304F\u3099\u307F", - "\u306F\u3093\u3053", - "\u306F\u3093\u3057\u3083", - "\u306F\u3093\u3059\u3046", - "\u306F\u3093\u305F\u3099\u3093", - "\u306F\u309A\u3093\u3061", - "\u306F\u309A\u3093\u3064", - "\u306F\u3093\u3066\u3044", - "\u306F\u3093\u3068\u3057", - "\u306F\u3093\u306E\u3046", - "\u306F\u3093\u306F\u309A", - "\u306F\u3093\u3075\u3099\u3093", - "\u306F\u3093\u3078\u309A\u3093", - "\u306F\u3093\u307B\u3099\u3046\u304D", - "\u306F\u3093\u3081\u3044", - "\u306F\u3093\u3089\u3093", - "\u306F\u3093\u308D\u3093", - "\u3072\u3044\u304D", - "\u3072\u3046\u3093", - "\u3072\u3048\u308B", - "\u3072\u304B\u304F", - "\u3072\u304B\u308A", - "\u3072\u304B\u308B", - "\u3072\u304B\u3093", - "\u3072\u304F\u3044", - "\u3072\u3051\u3064", - "\u3072\u3053\u3046\u304D", - "\u3072\u3053\u304F", - "\u3072\u3055\u3044", - "\u3072\u3055\u3057\u3075\u3099\u308A", - "\u3072\u3055\u3093", - "\u3072\u3099\u3057\u3099\u3085\u3064\u304B\u3093", - "\u3072\u3057\u3087", - "\u3072\u305D\u304B", - "\u3072\u305D\u3080", - "\u3072\u305F\u3080\u304D", - "\u3072\u305F\u3099\u308A", - "\u3072\u305F\u308B", - "\u3072\u3064\u304D\u3099", - "\u3072\u3063\u3053\u3057", - "\u3072\u3063\u3057", - "\u3072\u3064\u3057\u3099\u3085\u3072\u3093", - "\u3072\u3063\u3059", - "\u3072\u3064\u305B\u3099\u3093", - "\u3072\u309A\u3063\u305F\u308A", - "\u3072\u309A\u3063\u3061\u308A", - "\u3072\u3064\u3088\u3046", - "\u3072\u3066\u3044", - "\u3072\u3068\u3053\u3099\u307F", - "\u3072\u306A\u307E\u3064\u308A", - "\u3072\u306A\u3093", - "\u3072\u306D\u308B", - "\u3072\u306F\u3093", - "\u3072\u3072\u3099\u304F", - "\u3072\u3072\u3087\u3046", - "\u3072\u307B\u3046", - "\u3072\u307E\u308F\u308A", - "\u3072\u307E\u3093", - "\u3072\u307F\u3064", - "\u3072\u3081\u3044", - "\u3072\u3081\u3057\u3099\u3057", - "\u3072\u3084\u3051", - "\u3072\u3084\u3059", - "\u3072\u3088\u3046", - "\u3072\u3099\u3087\u3046\u304D", - "\u3072\u3089\u304B\u3099\u306A", - "\u3072\u3089\u304F", - "\u3072\u308A\u3064", - "\u3072\u308A\u3087\u3046", - "\u3072\u308B\u307E", - "\u3072\u308B\u3084\u3059\u307F", - "\u3072\u308C\u3044", - "\u3072\u308D\u3044", - "\u3072\u308D\u3046", - "\u3072\u308D\u304D", - "\u3072\u308D\u3086\u304D", - "\u3072\u3093\u304B\u304F", - "\u3072\u3093\u3051\u3064", - "\u3072\u3093\u3053\u3093", - "\u3072\u3093\u3057\u3085", - "\u3072\u3093\u305D\u3046", - "\u3072\u309A\u3093\u3061", - "\u3072\u3093\u306F\u309A\u3093", - "\u3072\u3099\u3093\u307B\u3099\u3046", - "\u3075\u3042\u3093", - "\u3075\u3044\u3046\u3061", - "\u3075\u3046\u3051\u3044", - "\u3075\u3046\u305B\u3093", - "\u3075\u309A\u3046\u305F\u308D\u3046", - "\u3075\u3046\u3068\u3046", - "\u3075\u3046\u3075", - "\u3075\u3048\u308B", - "\u3075\u304A\u3093", - "\u3075\u304B\u3044", - "\u3075\u304D\u3093", - "\u3075\u304F\u3055\u3099\u3064", - "\u3075\u304F\u3075\u3099\u304F\u308D", - "\u3075\u3053\u3046", - "\u3075\u3055\u3044", - "\u3075\u3057\u304D\u3099", - "\u3075\u3057\u3099\u307F", - "\u3075\u3059\u307E", - "\u3075\u305B\u3044", - "\u3075\u305B\u304F\u3099", - "\u3075\u305D\u304F", - "\u3075\u3099\u305F\u306B\u304F", - "\u3075\u305F\u3093", - "\u3075\u3061\u3087\u3046", - "\u3075\u3064\u3046", - "\u3075\u3064\u304B", - "\u3075\u3063\u304B\u3064", - "\u3075\u3063\u304D", - "\u3075\u3063\u3053\u304F", - "\u3075\u3099\u3068\u3099\u3046", - "\u3075\u3068\u308B", - "\u3075\u3068\u3093", - "\u3075\u306E\u3046", - "\u3075\u306F\u3044", - "\u3075\u3072\u3087\u3046", - "\u3075\u3078\u3093", - "\u3075\u307E\u3093", - "\u3075\u307F\u3093", - "\u3075\u3081\u3064", - "\u3075\u3081\u3093", - "\u3075\u3088\u3046", - "\u3075\u308A\u3053", - "\u3075\u308A\u308B", - "\u3075\u308B\u3044", - "\u3075\u3093\u3044\u304D", - "\u3075\u3099\u3093\u304B\u3099\u304F", - "\u3075\u3099\u3093\u304F\u3099", - "\u3075\u3093\u3057\u3064", - "\u3075\u3099\u3093\u305B\u304D", - "\u3075\u3093\u305D\u3046", - "\u3075\u3099\u3093\u307B\u309A\u3046", - "\u3078\u3044\u3042\u3093", - "\u3078\u3044\u304A\u3093", - "\u3078\u3044\u304B\u3099\u3044", - "\u3078\u3044\u304D", - "\u3078\u3044\u3051\u3099\u3093", - "\u3078\u3044\u3053\u3046", - "\u3078\u3044\u3055", - "\u3078\u3044\u3057\u3083", - "\u3078\u3044\u305B\u3064", - "\u3078\u3044\u305D", - "\u3078\u3044\u305F\u304F", - "\u3078\u3044\u3066\u3093", - "\u3078\u3044\u306D\u3064", - "\u3078\u3044\u308F", - "\u3078\u304D\u304B\u3099", - "\u3078\u3053\u3080", - "\u3078\u3099\u306B\u3044\u308D", - "\u3078\u3099\u306B\u3057\u3087\u3046\u304B\u3099", - "\u3078\u3089\u3059", - "\u3078\u3093\u304B\u3093", - "\u3078\u3099\u3093\u304D\u3087\u3046", - "\u3078\u3099\u3093\u3053\u3099\u3057", - "\u3078\u3093\u3055\u3044", - "\u3078\u3093\u305F\u3044", - "\u3078\u3099\u3093\u308A", - "\u307B\u3042\u3093", - "\u307B\u3044\u304F", - "\u307B\u3099\u3046\u304D\u3099\u3087", - "\u307B\u3046\u3053\u304F", - "\u307B\u3046\u305D\u3046", - "\u307B\u3046\u307B\u3046", - "\u307B\u3046\u3082\u3093", - "\u307B\u3046\u308A\u3064", - "\u307B\u3048\u308B", - "\u307B\u304A\u3093", - "\u307B\u304B\u3093", - "\u307B\u304D\u3087\u3046", - "\u307B\u3099\u304D\u3093", - "\u307B\u304F\u308D", - "\u307B\u3051\u3064", - "\u307B\u3051\u3093", - "\u307B\u3053\u3046", - "\u307B\u3053\u308B", - "\u307B\u3057\u3044", - "\u307B\u3057\u3064", - "\u307B\u3057\u3085", - "\u307B\u3057\u3087\u3046", - "\u307B\u305B\u3044", - "\u307B\u305D\u3044", - "\u307B\u305D\u304F", - "\u307B\u305F\u3066", - "\u307B\u305F\u308B", - "\u307B\u309A\u3061\u3075\u3099\u304F\u308D", - "\u307B\u3063\u304D\u3087\u304F", - "\u307B\u3063\u3055", - "\u307B\u3063\u305F\u3093", - "\u307B\u3068\u3093\u3068\u3099", - "\u307B\u3081\u308B", - "\u307B\u3093\u3044", - "\u307B\u3093\u304D", - "\u307B\u3093\u3051", - "\u307B\u3093\u3057\u3064", - "\u307B\u3093\u3084\u304F", - "\u307E\u3044\u306B\u3061", - "\u307E\u304B\u3044", - "\u307E\u304B\u305B\u308B", - "\u307E\u304B\u3099\u308B", - "\u307E\u3051\u308B", - "\u307E\u3053\u3068", - "\u307E\u3055\u3064", - "\u307E\u3057\u3099\u3081", - "\u307E\u3059\u304F", - "\u307E\u305B\u3099\u308B", - "\u307E\u3064\u308A", - "\u307E\u3068\u3081", - "\u307E\u306A\u3075\u3099", - "\u307E\u306C\u3051", - "\u307E\u306D\u304F", - "\u307E\u307B\u3046", - "\u307E\u3082\u308B", - "\u307E\u3086\u3051\u3099", - "\u307E\u3088\u3046", - "\u307E\u308D\u3084\u304B", - "\u307E\u308F\u3059", - "\u307E\u308F\u308A", - "\u307E\u308F\u308B", - "\u307E\u3093\u304B\u3099", - "\u307E\u3093\u304D\u3064", - "\u307E\u3093\u305D\u3099\u304F", - "\u307E\u3093\u306A\u304B", - "\u307F\u3044\u3089", - "\u307F\u3046\u3061", - "\u307F\u3048\u308B", - "\u307F\u304B\u3099\u304F", - "\u307F\u304B\u305F", - "\u307F\u304B\u3093", - "\u307F\u3051\u3093", - "\u307F\u3053\u3093", - "\u307F\u3057\u3099\u304B\u3044", - "\u307F\u3059\u3044", - "\u307F\u3059\u3048\u308B", - "\u307F\u305B\u308B", - "\u307F\u3063\u304B", - "\u307F\u3064\u304B\u308B", - "\u307F\u3064\u3051\u308B", - "\u307F\u3066\u3044", - "\u307F\u3068\u3081\u308B", - "\u307F\u306A\u3068", - "\u307F\u306A\u307F\u304B\u3055\u3044", - "\u307F\u306D\u3089\u308B", - "\u307F\u306E\u3046", - "\u307F\u306E\u304B\u3099\u3059", - "\u307F\u307B\u3093", - "\u307F\u3082\u3068", - "\u307F\u3084\u3051\u3099", - "\u307F\u3089\u3044", - "\u307F\u308A\u3087\u304F", - "\u307F\u308F\u304F", - "\u307F\u3093\u304B", - "\u307F\u3093\u305D\u3099\u304F", - "\u3080\u3044\u304B", - "\u3080\u3048\u304D", - "\u3080\u3048\u3093", - "\u3080\u304B\u3044", - "\u3080\u304B\u3046", - "\u3080\u304B\u3048", - "\u3080\u304B\u3057", - "\u3080\u304D\u3099\u3061\u3083", - "\u3080\u3051\u308B", - "\u3080\u3051\u3099\u3093", - "\u3080\u3055\u307B\u3099\u308B", - "\u3080\u3057\u3042\u3064\u3044", - "\u3080\u3057\u306F\u3099", - "\u3080\u3057\u3099\u3085\u3093", - "\u3080\u3057\u308D", - "\u3080\u3059\u3046", - "\u3080\u3059\u3053", - "\u3080\u3059\u3075\u3099", - "\u3080\u3059\u3081", - "\u3080\u305B\u308B", - "\u3080\u305B\u3093", - "\u3080\u3061\u3085\u3046", - "\u3080\u306A\u3057\u3044", - "\u3080\u306E\u3046", - "\u3080\u3084\u307F", - "\u3080\u3088\u3046", - "\u3080\u3089\u3055\u304D", - "\u3080\u308A\u3087\u3046", - "\u3080\u308D\u3093", - "\u3081\u3044\u3042\u3093", - "\u3081\u3044\u3046\u3093", - "\u3081\u3044\u3048\u3093", - "\u3081\u3044\u304B\u304F", - "\u3081\u3044\u304D\u3087\u304F", - "\u3081\u3044\u3055\u3044", - "\u3081\u3044\u3057", - "\u3081\u3044\u305D\u3046", - "\u3081\u3044\u3075\u3099\u3064", - "\u3081\u3044\u308C\u3044", - "\u3081\u3044\u308F\u304F", - "\u3081\u304F\u3099\u307E\u308C\u308B", - "\u3081\u3055\u3099\u3059", - "\u3081\u3057\u305F", - "\u3081\u3059\u3099\u3089\u3057\u3044", - "\u3081\u305F\u3099\u3064", - "\u3081\u307E\u3044", - "\u3081\u3084\u3059", - "\u3081\u3093\u304D\u3087", - "\u3081\u3093\u305B\u304D", - "\u3081\u3093\u3068\u3099\u3046", - "\u3082\u3046\u3057\u3042\u3051\u3099\u308B", - "\u3082\u3046\u3068\u3099\u3046\u3051\u3093", - "\u3082\u3048\u308B", - "\u3082\u304F\u3057", - "\u3082\u304F\u3066\u304D", - "\u3082\u304F\u3088\u3046\u3072\u3099", - "\u3082\u3061\u308D\u3093", - "\u3082\u3068\u3099\u308B", - "\u3082\u3089\u3046", - "\u3082\u3093\u304F", - "\u3082\u3093\u305F\u3099\u3044", - "\u3084\u304A\u3084", - "\u3084\u3051\u308B", - "\u3084\u3055\u3044", - "\u3084\u3055\u3057\u3044", - "\u3084\u3059\u3044", - "\u3084\u3059\u305F\u308D\u3046", - "\u3084\u3059\u307F", - "\u3084\u305B\u308B", - "\u3084\u305D\u3046", - "\u3084\u305F\u3044", - "\u3084\u3061\u3093", - "\u3084\u3063\u3068", - "\u3084\u3063\u306F\u309A\u308A", - "\u3084\u3075\u3099\u308B", - "\u3084\u3081\u308B", - "\u3084\u3084\u3053\u3057\u3044", - "\u3084\u3088\u3044", - "\u3084\u308F\u3089\u304B\u3044", - "\u3086\u3046\u304D", - "\u3086\u3046\u3072\u3099\u3093\u304D\u3087\u304F", - "\u3086\u3046\u3078\u3099", - "\u3086\u3046\u3081\u3044", - "\u3086\u3051\u3064", - "\u3086\u3057\u3085\u3064", - "\u3086\u305B\u3093", - "\u3086\u305D\u3046", - "\u3086\u305F\u304B", - "\u3086\u3061\u3083\u304F", - "\u3086\u3066\u3099\u308B", - "\u3086\u306B\u3085\u3046", - "\u3086\u3072\u3099\u308F", - "\u3086\u3089\u3044", - "\u3086\u308C\u308B", - "\u3088\u3046\u3044", - "\u3088\u3046\u304B", - "\u3088\u3046\u304D\u3085\u3046", - "\u3088\u3046\u3057\u3099", - "\u3088\u3046\u3059", - "\u3088\u3046\u3061\u3048\u3093", - "\u3088\u304B\u305B\u3099", - "\u3088\u304B\u3093", - "\u3088\u304D\u3093", - "\u3088\u304F\u305B\u3044", - "\u3088\u304F\u307B\u3099\u3046", - "\u3088\u3051\u3044", - "\u3088\u3053\u3099\u308C\u308B", - "\u3088\u3055\u3093", - "\u3088\u3057\u3085\u3046", - "\u3088\u305D\u3046", - "\u3088\u305D\u304F", - "\u3088\u3063\u304B", - "\u3088\u3066\u3044", - "\u3088\u3068\u3099\u304B\u3099\u308F\u304F", - "\u3088\u306D\u3064", - "\u3088\u3084\u304F", - "\u3088\u3086\u3046", - "\u3088\u308D\u3053\u3075\u3099", - "\u3088\u308D\u3057\u3044", - "\u3089\u3044\u3046", - "\u3089\u304F\u304B\u3099\u304D", - "\u3089\u304F\u3053\u3099", - "\u3089\u304F\u3055\u3064", - "\u3089\u304F\u305F\u3099", - "\u3089\u3057\u3093\u306F\u3099\u3093", - "\u3089\u305B\u3093", - "\u3089\u305D\u3099\u304F", - "\u3089\u305F\u3044", - "\u3089\u3063\u304B", - "\u3089\u308C\u3064", - "\u308A\u3048\u304D", - "\u308A\u304B\u3044", - "\u308A\u304D\u3055\u304F", - "\u308A\u304D\u305B\u3064", - "\u308A\u304F\u304F\u3099\u3093", - "\u308A\u304F\u3064", - "\u308A\u3051\u3093", - "\u308A\u3053\u3046", - "\u308A\u305B\u3044", - "\u308A\u305D\u3046", - "\u308A\u305D\u304F", - "\u308A\u3066\u3093", - "\u308A\u306D\u3093", - "\u308A\u3086\u3046", - "\u308A\u3085\u3046\u304B\u3099\u304F", - "\u308A\u3088\u3046", - "\u308A\u3087\u3046\u308A", - "\u308A\u3087\u304B\u3093", - "\u308A\u3087\u304F\u3061\u3083", - "\u308A\u3087\u3053\u3046", - "\u308A\u308A\u304F", - "\u308A\u308C\u304D", - "\u308A\u308D\u3093", - "\u308A\u3093\u3053\u3099", - "\u308B\u3044\u3051\u3044", - "\u308B\u3044\u3055\u3044", - "\u308B\u3044\u3057\u3099", - "\u308B\u3044\u305B\u304D", - "\u308B\u3059\u306F\u3099\u3093", - "\u308B\u308A\u304B\u3099\u308F\u3089", - "\u308C\u3044\u304B\u3093", - "\u308C\u3044\u304D\u3099", - "\u308C\u3044\u305B\u3044", - "\u308C\u3044\u305D\u3099\u3046\u3053", - "\u308C\u3044\u3068\u3046", - "\u308C\u3044\u307B\u3099\u3046", - "\u308C\u304D\u3057", - "\u308C\u304D\u305F\u3099\u3044", - "\u308C\u3093\u3042\u3044", - "\u308C\u3093\u3051\u3044", - "\u308C\u3093\u3053\u3093", - "\u308C\u3093\u3055\u3044", - "\u308C\u3093\u3057\u3085\u3046", - "\u308C\u3093\u305D\u3099\u304F", - "\u308C\u3093\u3089\u304F", - "\u308D\u3046\u304B", - "\u308D\u3046\u3053\u3099", - "\u308D\u3046\u3057\u3099\u3093", - "\u308D\u3046\u305D\u304F", - "\u308D\u304F\u304B\u3099", - "\u308D\u3053\u3064", - "\u308D\u3057\u3099\u3046\u3089", - "\u308D\u3057\u3085\u3064", - "\u308D\u305B\u3093", - "\u308D\u3066\u3093", - "\u308D\u3081\u3093", - "\u308D\u308C\u3064", - "\u308D\u3093\u304D\u3099", - "\u308D\u3093\u306F\u309A", - "\u308D\u3093\u3075\u3099\u3093", - "\u308D\u3093\u308A", - "\u308F\u304B\u3059", - "\u308F\u304B\u3081", - "\u308F\u304B\u3084\u307E", - "\u308F\u304B\u308C\u308B", - "\u308F\u3057\u3064", - "\u308F\u3057\u3099\u307E\u3057", - "\u308F\u3059\u308C\u3082\u306E", - "\u308F\u3089\u3046", - "\u308F\u308C\u308B" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/portuguese.json -var require_portuguese = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/portuguese.json"(exports2, module2) { - module2.exports = [ - "abacate", - "abaixo", - "abalar", - "abater", - "abduzir", - "abelha", - "aberto", - "abismo", - "abotoar", - "abranger", - "abreviar", - "abrigar", - "abrupto", - "absinto", - "absoluto", - "absurdo", - "abutre", - "acabado", - "acalmar", - "acampar", - "acanhar", - "acaso", - "aceitar", - "acelerar", - "acenar", - "acervo", - "acessar", - "acetona", - "achatar", - "acidez", - "acima", - "acionado", - "acirrar", - "aclamar", - "aclive", - "acolhida", - "acomodar", - "acoplar", - "acordar", - "acumular", - "acusador", - "adaptar", - "adega", - "adentro", - "adepto", - "adequar", - "aderente", - "adesivo", - "adeus", - "adiante", - "aditivo", - "adjetivo", - "adjunto", - "admirar", - "adorar", - "adquirir", - "adubo", - "adverso", - "advogado", - "aeronave", - "afastar", - "aferir", - "afetivo", - "afinador", - "afivelar", - "aflito", - "afluente", - "afrontar", - "agachar", - "agarrar", - "agasalho", - "agenciar", - "agilizar", - "agiota", - "agitado", - "agora", - "agradar", - "agreste", - "agrupar", - "aguardar", - "agulha", - "ajoelhar", - "ajudar", - "ajustar", - "alameda", - "alarme", - "alastrar", - "alavanca", - "albergue", - "albino", - "alcatra", - "aldeia", - "alecrim", - "alegria", - "alertar", - "alface", - "alfinete", - "algum", - "alheio", - "aliar", - "alicate", - "alienar", - "alinhar", - "aliviar", - "almofada", - "alocar", - "alpiste", - "alterar", - "altitude", - "alucinar", - "alugar", - "aluno", - "alusivo", - "alvo", - "amaciar", - "amador", - "amarelo", - "amassar", - "ambas", - "ambiente", - "ameixa", - "amenizar", - "amido", - "amistoso", - "amizade", - "amolador", - "amontoar", - "amoroso", - "amostra", - "amparar", - "ampliar", - "ampola", - "anagrama", - "analisar", - "anarquia", - "anatomia", - "andaime", - "anel", - "anexo", - "angular", - "animar", - "anjo", - "anomalia", - "anotado", - "ansioso", - "anterior", - "anuidade", - "anunciar", - "anzol", - "apagador", - "apalpar", - "apanhado", - "apego", - "apelido", - "apertada", - "apesar", - "apetite", - "apito", - "aplauso", - "aplicada", - "apoio", - "apontar", - "aposta", - "aprendiz", - "aprovar", - "aquecer", - "arame", - "aranha", - "arara", - "arcada", - "ardente", - "areia", - "arejar", - "arenito", - "aresta", - "argiloso", - "argola", - "arma", - "arquivo", - "arraial", - "arrebate", - "arriscar", - "arroba", - "arrumar", - "arsenal", - "arterial", - "artigo", - "arvoredo", - "asfaltar", - "asilado", - "aspirar", - "assador", - "assinar", - "assoalho", - "assunto", - "astral", - "atacado", - "atadura", - "atalho", - "atarefar", - "atear", - "atender", - "aterro", - "ateu", - "atingir", - "atirador", - "ativo", - "atoleiro", - "atracar", - "atrevido", - "atriz", - "atual", - "atum", - "auditor", - "aumentar", - "aura", - "aurora", - "autismo", - "autoria", - "autuar", - "avaliar", - "avante", - "avaria", - "avental", - "avesso", - "aviador", - "avisar", - "avulso", - "axila", - "azarar", - "azedo", - "azeite", - "azulejo", - "babar", - "babosa", - "bacalhau", - "bacharel", - "bacia", - "bagagem", - "baiano", - "bailar", - "baioneta", - "bairro", - "baixista", - "bajular", - "baleia", - "baliza", - "balsa", - "banal", - "bandeira", - "banho", - "banir", - "banquete", - "barato", - "barbado", - "baronesa", - "barraca", - "barulho", - "baseado", - "bastante", - "batata", - "batedor", - "batida", - "batom", - "batucar", - "baunilha", - "beber", - "beijo", - "beirada", - "beisebol", - "beldade", - "beleza", - "belga", - "beliscar", - "bendito", - "bengala", - "benzer", - "berimbau", - "berlinda", - "berro", - "besouro", - "bexiga", - "bezerro", - "bico", - "bicudo", - "bienal", - "bifocal", - "bifurcar", - "bigorna", - "bilhete", - "bimestre", - "bimotor", - "biologia", - "biombo", - "biosfera", - "bipolar", - "birrento", - "biscoito", - "bisneto", - "bispo", - "bissexto", - "bitola", - "bizarro", - "blindado", - "bloco", - "bloquear", - "boato", - "bobagem", - "bocado", - "bocejo", - "bochecha", - "boicotar", - "bolada", - "boletim", - "bolha", - "bolo", - "bombeiro", - "bonde", - "boneco", - "bonita", - "borbulha", - "borda", - "boreal", - "borracha", - "bovino", - "boxeador", - "branco", - "brasa", - "braveza", - "breu", - "briga", - "brilho", - "brincar", - "broa", - "brochura", - "bronzear", - "broto", - "bruxo", - "bucha", - "budismo", - "bufar", - "bule", - "buraco", - "busca", - "busto", - "buzina", - "cabana", - "cabelo", - "cabide", - "cabo", - "cabrito", - "cacau", - "cacetada", - "cachorro", - "cacique", - "cadastro", - "cadeado", - "cafezal", - "caiaque", - "caipira", - "caixote", - "cajado", - "caju", - "calafrio", - "calcular", - "caldeira", - "calibrar", - "calmante", - "calota", - "camada", - "cambista", - "camisa", - "camomila", - "campanha", - "camuflar", - "canavial", - "cancelar", - "caneta", - "canguru", - "canhoto", - "canivete", - "canoa", - "cansado", - "cantar", - "canudo", - "capacho", - "capela", - "capinar", - "capotar", - "capricho", - "captador", - "capuz", - "caracol", - "carbono", - "cardeal", - "careca", - "carimbar", - "carneiro", - "carpete", - "carreira", - "cartaz", - "carvalho", - "casaco", - "casca", - "casebre", - "castelo", - "casulo", - "catarata", - "cativar", - "caule", - "causador", - "cautelar", - "cavalo", - "caverna", - "cebola", - "cedilha", - "cegonha", - "celebrar", - "celular", - "cenoura", - "censo", - "centeio", - "cercar", - "cerrado", - "certeiro", - "cerveja", - "cetim", - "cevada", - "chacota", - "chaleira", - "chamado", - "chapada", - "charme", - "chatice", - "chave", - "chefe", - "chegada", - "cheiro", - "cheque", - "chicote", - "chifre", - "chinelo", - "chocalho", - "chover", - "chumbo", - "chutar", - "chuva", - "cicatriz", - "ciclone", - "cidade", - "cidreira", - "ciente", - "cigana", - "cimento", - "cinto", - "cinza", - "ciranda", - "circuito", - "cirurgia", - "citar", - "clareza", - "clero", - "clicar", - "clone", - "clube", - "coado", - "coagir", - "cobaia", - "cobertor", - "cobrar", - "cocada", - "coelho", - "coentro", - "coeso", - "cogumelo", - "coibir", - "coifa", - "coiote", - "colar", - "coleira", - "colher", - "colidir", - "colmeia", - "colono", - "coluna", - "comando", - "combinar", - "comentar", - "comitiva", - "comover", - "complexo", - "comum", - "concha", - "condor", - "conectar", - "confuso", - "congelar", - "conhecer", - "conjugar", - "consumir", - "contrato", - "convite", - "cooperar", - "copeiro", - "copiador", - "copo", - "coquetel", - "coragem", - "cordial", - "corneta", - "coronha", - "corporal", - "correio", - "cortejo", - "coruja", - "corvo", - "cosseno", - "costela", - "cotonete", - "couro", - "couve", - "covil", - "cozinha", - "cratera", - "cravo", - "creche", - "credor", - "creme", - "crer", - "crespo", - "criada", - "criminal", - "crioulo", - "crise", - "criticar", - "crosta", - "crua", - "cruzeiro", - "cubano", - "cueca", - "cuidado", - "cujo", - "culatra", - "culminar", - "culpar", - "cultura", - "cumprir", - "cunhado", - "cupido", - "curativo", - "curral", - "cursar", - "curto", - "cuspir", - "custear", - "cutelo", - "damasco", - "datar", - "debater", - "debitar", - "deboche", - "debulhar", - "decalque", - "decimal", - "declive", - "decote", - "decretar", - "dedal", - "dedicado", - "deduzir", - "defesa", - "defumar", - "degelo", - "degrau", - "degustar", - "deitado", - "deixar", - "delator", - "delegado", - "delinear", - "delonga", - "demanda", - "demitir", - "demolido", - "dentista", - "depenado", - "depilar", - "depois", - "depressa", - "depurar", - "deriva", - "derramar", - "desafio", - "desbotar", - "descanso", - "desenho", - "desfiado", - "desgaste", - "desigual", - "deslize", - "desmamar", - "desova", - "despesa", - "destaque", - "desviar", - "detalhar", - "detentor", - "detonar", - "detrito", - "deusa", - "dever", - "devido", - "devotado", - "dezena", - "diagrama", - "dialeto", - "didata", - "difuso", - "digitar", - "dilatado", - "diluente", - "diminuir", - "dinastia", - "dinheiro", - "diocese", - "direto", - "discreta", - "disfarce", - "disparo", - "disquete", - "dissipar", - "distante", - "ditador", - "diurno", - "diverso", - "divisor", - "divulgar", - "dizer", - "dobrador", - "dolorido", - "domador", - "dominado", - "donativo", - "donzela", - "dormente", - "dorsal", - "dosagem", - "dourado", - "doutor", - "drenagem", - "drible", - "drogaria", - "duelar", - "duende", - "dueto", - "duplo", - "duquesa", - "durante", - "duvidoso", - "eclodir", - "ecoar", - "ecologia", - "edificar", - "edital", - "educado", - "efeito", - "efetivar", - "ejetar", - "elaborar", - "eleger", - "eleitor", - "elenco", - "elevador", - "eliminar", - "elogiar", - "embargo", - "embolado", - "embrulho", - "embutido", - "emenda", - "emergir", - "emissor", - "empatia", - "empenho", - "empinado", - "empolgar", - "emprego", - "empurrar", - "emulador", - "encaixe", - "encenado", - "enchente", - "encontro", - "endeusar", - "endossar", - "enfaixar", - "enfeite", - "enfim", - "engajado", - "engenho", - "englobar", - "engomado", - "engraxar", - "enguia", - "enjoar", - "enlatar", - "enquanto", - "enraizar", - "enrolado", - "enrugar", - "ensaio", - "enseada", - "ensino", - "ensopado", - "entanto", - "enteado", - "entidade", - "entortar", - "entrada", - "entulho", - "envergar", - "enviado", - "envolver", - "enxame", - "enxerto", - "enxofre", - "enxuto", - "epiderme", - "equipar", - "ereto", - "erguido", - "errata", - "erva", - "ervilha", - "esbanjar", - "esbelto", - "escama", - "escola", - "escrita", - "escuta", - "esfinge", - "esfolar", - "esfregar", - "esfumado", - "esgrima", - "esmalte", - "espanto", - "espelho", - "espiga", - "esponja", - "espreita", - "espumar", - "esquerda", - "estaca", - "esteira", - "esticar", - "estofado", - "estrela", - "estudo", - "esvaziar", - "etanol", - "etiqueta", - "euforia", - "europeu", - "evacuar", - "evaporar", - "evasivo", - "eventual", - "evidente", - "evoluir", - "exagero", - "exalar", - "examinar", - "exato", - "exausto", - "excesso", - "excitar", - "exclamar", - "executar", - "exemplo", - "exibir", - "exigente", - "exonerar", - "expandir", - "expelir", - "expirar", - "explanar", - "exposto", - "expresso", - "expulsar", - "externo", - "extinto", - "extrato", - "fabricar", - "fabuloso", - "faceta", - "facial", - "fada", - "fadiga", - "faixa", - "falar", - "falta", - "familiar", - "fandango", - "fanfarra", - "fantoche", - "fardado", - "farelo", - "farinha", - "farofa", - "farpa", - "fartura", - "fatia", - "fator", - "favorita", - "faxina", - "fazenda", - "fechado", - "feijoada", - "feirante", - "felino", - "feminino", - "fenda", - "feno", - "fera", - "feriado", - "ferrugem", - "ferver", - "festejar", - "fetal", - "feudal", - "fiapo", - "fibrose", - "ficar", - "ficheiro", - "figurado", - "fileira", - "filho", - "filme", - "filtrar", - "firmeza", - "fisgada", - "fissura", - "fita", - "fivela", - "fixador", - "fixo", - "flacidez", - "flamingo", - "flanela", - "flechada", - "flora", - "flutuar", - "fluxo", - "focal", - "focinho", - "fofocar", - "fogo", - "foguete", - "foice", - "folgado", - "folheto", - "forjar", - "formiga", - "forno", - "forte", - "fosco", - "fossa", - "fragata", - "fralda", - "frango", - "frasco", - "fraterno", - "freira", - "frente", - "fretar", - "frieza", - "friso", - "fritura", - "fronha", - "frustrar", - "fruteira", - "fugir", - "fulano", - "fuligem", - "fundar", - "fungo", - "funil", - "furador", - "furioso", - "futebol", - "gabarito", - "gabinete", - "gado", - "gaiato", - "gaiola", - "gaivota", - "galega", - "galho", - "galinha", - "galocha", - "ganhar", - "garagem", - "garfo", - "gargalo", - "garimpo", - "garoupa", - "garrafa", - "gasoduto", - "gasto", - "gata", - "gatilho", - "gaveta", - "gazela", - "gelado", - "geleia", - "gelo", - "gemada", - "gemer", - "gemido", - "generoso", - "gengiva", - "genial", - "genoma", - "genro", - "geologia", - "gerador", - "germinar", - "gesso", - "gestor", - "ginasta", - "gincana", - "gingado", - "girafa", - "girino", - "glacial", - "glicose", - "global", - "glorioso", - "goela", - "goiaba", - "golfe", - "golpear", - "gordura", - "gorjeta", - "gorro", - "gostoso", - "goteira", - "governar", - "gracejo", - "gradual", - "grafite", - "gralha", - "grampo", - "granada", - "gratuito", - "graveto", - "graxa", - "grego", - "grelhar", - "greve", - "grilo", - "grisalho", - "gritaria", - "grosso", - "grotesco", - "grudado", - "grunhido", - "gruta", - "guache", - "guarani", - "guaxinim", - "guerrear", - "guiar", - "guincho", - "guisado", - "gula", - "guloso", - "guru", - "habitar", - "harmonia", - "haste", - "haver", - "hectare", - "herdar", - "heresia", - "hesitar", - "hiato", - "hibernar", - "hidratar", - "hiena", - "hino", - "hipismo", - "hipnose", - "hipoteca", - "hoje", - "holofote", - "homem", - "honesto", - "honrado", - "hormonal", - "hospedar", - "humorado", - "iate", - "ideia", - "idoso", - "ignorado", - "igreja", - "iguana", - "ileso", - "ilha", - "iludido", - "iluminar", - "ilustrar", - "imagem", - "imediato", - "imenso", - "imersivo", - "iminente", - "imitador", - "imortal", - "impacto", - "impedir", - "implante", - "impor", - "imprensa", - "impune", - "imunizar", - "inalador", - "inapto", - "inativo", - "incenso", - "inchar", - "incidir", - "incluir", - "incolor", - "indeciso", - "indireto", - "indutor", - "ineficaz", - "inerente", - "infantil", - "infestar", - "infinito", - "inflamar", - "informal", - "infrator", - "ingerir", - "inibido", - "inicial", - "inimigo", - "injetar", - "inocente", - "inodoro", - "inovador", - "inox", - "inquieto", - "inscrito", - "inseto", - "insistir", - "inspetor", - "instalar", - "insulto", - "intacto", - "integral", - "intimar", - "intocado", - "intriga", - "invasor", - "inverno", - "invicto", - "invocar", - "iogurte", - "iraniano", - "ironizar", - "irreal", - "irritado", - "isca", - "isento", - "isolado", - "isqueiro", - "italiano", - "janeiro", - "jangada", - "janta", - "jararaca", - "jardim", - "jarro", - "jasmim", - "jato", - "javali", - "jazida", - "jejum", - "joaninha", - "joelhada", - "jogador", - "joia", - "jornal", - "jorrar", - "jovem", - "juba", - "judeu", - "judoca", - "juiz", - "julgador", - "julho", - "jurado", - "jurista", - "juro", - "justa", - "labareda", - "laboral", - "lacre", - "lactante", - "ladrilho", - "lagarta", - "lagoa", - "laje", - "lamber", - "lamentar", - "laminar", - "lampejo", - "lanche", - "lapidar", - "lapso", - "laranja", - "lareira", - "largura", - "lasanha", - "lastro", - "lateral", - "latido", - "lavanda", - "lavoura", - "lavrador", - "laxante", - "lazer", - "lealdade", - "lebre", - "legado", - "legendar", - "legista", - "leigo", - "leiloar", - "leitura", - "lembrete", - "leme", - "lenhador", - "lentilha", - "leoa", - "lesma", - "leste", - "letivo", - "letreiro", - "levar", - "leveza", - "levitar", - "liberal", - "libido", - "liderar", - "ligar", - "ligeiro", - "limitar", - "limoeiro", - "limpador", - "linda", - "linear", - "linhagem", - "liquidez", - "listagem", - "lisura", - "litoral", - "livro", - "lixa", - "lixeira", - "locador", - "locutor", - "lojista", - "lombo", - "lona", - "longe", - "lontra", - "lorde", - "lotado", - "loteria", - "loucura", - "lousa", - "louvar", - "luar", - "lucidez", - "lucro", - "luneta", - "lustre", - "lutador", - "luva", - "macaco", - "macete", - "machado", - "macio", - "madeira", - "madrinha", - "magnata", - "magreza", - "maior", - "mais", - "malandro", - "malha", - "malote", - "maluco", - "mamilo", - "mamoeiro", - "mamute", - "manada", - "mancha", - "mandato", - "manequim", - "manhoso", - "manivela", - "manobrar", - "mansa", - "manter", - "manusear", - "mapeado", - "maquinar", - "marcador", - "maresia", - "marfim", - "margem", - "marinho", - "marmita", - "maroto", - "marquise", - "marreco", - "martelo", - "marujo", - "mascote", - "masmorra", - "massagem", - "mastigar", - "matagal", - "materno", - "matinal", - "matutar", - "maxilar", - "medalha", - "medida", - "medusa", - "megafone", - "meiga", - "melancia", - "melhor", - "membro", - "memorial", - "menino", - "menos", - "mensagem", - "mental", - "merecer", - "mergulho", - "mesada", - "mesclar", - "mesmo", - "mesquita", - "mestre", - "metade", - "meteoro", - "metragem", - "mexer", - "mexicano", - "micro", - "migalha", - "migrar", - "milagre", - "milenar", - "milhar", - "mimado", - "minerar", - "minhoca", - "ministro", - "minoria", - "miolo", - "mirante", - "mirtilo", - "misturar", - "mocidade", - "moderno", - "modular", - "moeda", - "moer", - "moinho", - "moita", - "moldura", - "moleza", - "molho", - "molinete", - "molusco", - "montanha", - "moqueca", - "morango", - "morcego", - "mordomo", - "morena", - "mosaico", - "mosquete", - "mostarda", - "motel", - "motim", - "moto", - "motriz", - "muda", - "muito", - "mulata", - "mulher", - "multar", - "mundial", - "munido", - "muralha", - "murcho", - "muscular", - "museu", - "musical", - "nacional", - "nadador", - "naja", - "namoro", - "narina", - "narrado", - "nascer", - "nativa", - "natureza", - "navalha", - "navegar", - "navio", - "neblina", - "nebuloso", - "negativa", - "negociar", - "negrito", - "nervoso", - "neta", - "neural", - "nevasca", - "nevoeiro", - "ninar", - "ninho", - "nitidez", - "nivelar", - "nobreza", - "noite", - "noiva", - "nomear", - "nominal", - "nordeste", - "nortear", - "notar", - "noticiar", - "noturno", - "novelo", - "novilho", - "novo", - "nublado", - "nudez", - "numeral", - "nupcial", - "nutrir", - "nuvem", - "obcecado", - "obedecer", - "objetivo", - "obrigado", - "obscuro", - "obstetra", - "obter", - "obturar", - "ocidente", - "ocioso", - "ocorrer", - "oculista", - "ocupado", - "ofegante", - "ofensiva", - "oferenda", - "oficina", - "ofuscado", - "ogiva", - "olaria", - "oleoso", - "olhar", - "oliveira", - "ombro", - "omelete", - "omisso", - "omitir", - "ondulado", - "oneroso", - "ontem", - "opcional", - "operador", - "oponente", - "oportuno", - "oposto", - "orar", - "orbitar", - "ordem", - "ordinal", - "orfanato", - "orgasmo", - "orgulho", - "oriental", - "origem", - "oriundo", - "orla", - "ortodoxo", - "orvalho", - "oscilar", - "ossada", - "osso", - "ostentar", - "otimismo", - "ousadia", - "outono", - "outubro", - "ouvido", - "ovelha", - "ovular", - "oxidar", - "oxigenar", - "pacato", - "paciente", - "pacote", - "pactuar", - "padaria", - "padrinho", - "pagar", - "pagode", - "painel", - "pairar", - "paisagem", - "palavra", - "palestra", - "palheta", - "palito", - "palmada", - "palpitar", - "pancada", - "panela", - "panfleto", - "panqueca", - "pantanal", - "papagaio", - "papelada", - "papiro", - "parafina", - "parcial", - "pardal", - "parede", - "partida", - "pasmo", - "passado", - "pastel", - "patamar", - "patente", - "patinar", - "patrono", - "paulada", - "pausar", - "peculiar", - "pedalar", - "pedestre", - "pediatra", - "pedra", - "pegada", - "peitoral", - "peixe", - "pele", - "pelicano", - "penca", - "pendurar", - "peneira", - "penhasco", - "pensador", - "pente", - "perceber", - "perfeito", - "pergunta", - "perito", - "permitir", - "perna", - "perplexo", - "persiana", - "pertence", - "peruca", - "pescado", - "pesquisa", - "pessoa", - "petiscar", - "piada", - "picado", - "piedade", - "pigmento", - "pilastra", - "pilhado", - "pilotar", - "pimenta", - "pincel", - "pinguim", - "pinha", - "pinote", - "pintar", - "pioneiro", - "pipoca", - "piquete", - "piranha", - "pires", - "pirueta", - "piscar", - "pistola", - "pitanga", - "pivete", - "planta", - "plaqueta", - "platina", - "plebeu", - "plumagem", - "pluvial", - "pneu", - "poda", - "poeira", - "poetisa", - "polegada", - "policiar", - "poluente", - "polvilho", - "pomar", - "pomba", - "ponderar", - "pontaria", - "populoso", - "porta", - "possuir", - "postal", - "pote", - "poupar", - "pouso", - "povoar", - "praia", - "prancha", - "prato", - "praxe", - "prece", - "predador", - "prefeito", - "premiar", - "prensar", - "preparar", - "presilha", - "pretexto", - "prevenir", - "prezar", - "primata", - "princesa", - "prisma", - "privado", - "processo", - "produto", - "profeta", - "proibido", - "projeto", - "prometer", - "propagar", - "prosa", - "protetor", - "provador", - "publicar", - "pudim", - "pular", - "pulmonar", - "pulseira", - "punhal", - "punir", - "pupilo", - "pureza", - "puxador", - "quadra", - "quantia", - "quarto", - "quase", - "quebrar", - "queda", - "queijo", - "quente", - "querido", - "quimono", - "quina", - "quiosque", - "rabanada", - "rabisco", - "rachar", - "racionar", - "radial", - "raiar", - "rainha", - "raio", - "raiva", - "rajada", - "ralado", - "ramal", - "ranger", - "ranhura", - "rapadura", - "rapel", - "rapidez", - "raposa", - "raquete", - "raridade", - "rasante", - "rascunho", - "rasgar", - "raspador", - "rasteira", - "rasurar", - "ratazana", - "ratoeira", - "realeza", - "reanimar", - "reaver", - "rebaixar", - "rebelde", - "rebolar", - "recado", - "recente", - "recheio", - "recibo", - "recordar", - "recrutar", - "recuar", - "rede", - "redimir", - "redonda", - "reduzida", - "reenvio", - "refinar", - "refletir", - "refogar", - "refresco", - "refugiar", - "regalia", - "regime", - "regra", - "reinado", - "reitor", - "rejeitar", - "relativo", - "remador", - "remendo", - "remorso", - "renovado", - "reparo", - "repelir", - "repleto", - "repolho", - "represa", - "repudiar", - "requerer", - "resenha", - "resfriar", - "resgatar", - "residir", - "resolver", - "respeito", - "ressaca", - "restante", - "resumir", - "retalho", - "reter", - "retirar", - "retomada", - "retratar", - "revelar", - "revisor", - "revolta", - "riacho", - "rica", - "rigidez", - "rigoroso", - "rimar", - "ringue", - "risada", - "risco", - "risonho", - "robalo", - "rochedo", - "rodada", - "rodeio", - "rodovia", - "roedor", - "roleta", - "romano", - "roncar", - "rosado", - "roseira", - "rosto", - "rota", - "roteiro", - "rotina", - "rotular", - "rouco", - "roupa", - "roxo", - "rubro", - "rugido", - "rugoso", - "ruivo", - "rumo", - "rupestre", - "russo", - "sabor", - "saciar", - "sacola", - "sacudir", - "sadio", - "safira", - "saga", - "sagrada", - "saibro", - "salada", - "saleiro", - "salgado", - "saliva", - "salpicar", - "salsicha", - "saltar", - "salvador", - "sambar", - "samurai", - "sanar", - "sanfona", - "sangue", - "sanidade", - "sapato", - "sarda", - "sargento", - "sarjeta", - "saturar", - "saudade", - "saxofone", - "sazonal", - "secar", - "secular", - "seda", - "sedento", - "sediado", - "sedoso", - "sedutor", - "segmento", - "segredo", - "segundo", - "seiva", - "seleto", - "selvagem", - "semanal", - "semente", - "senador", - "senhor", - "sensual", - "sentado", - "separado", - "sereia", - "seringa", - "serra", - "servo", - "setembro", - "setor", - "sigilo", - "silhueta", - "silicone", - "simetria", - "simpatia", - "simular", - "sinal", - "sincero", - "singular", - "sinopse", - "sintonia", - "sirene", - "siri", - "situado", - "soberano", - "sobra", - "socorro", - "sogro", - "soja", - "solda", - "soletrar", - "solteiro", - "sombrio", - "sonata", - "sondar", - "sonegar", - "sonhador", - "sono", - "soprano", - "soquete", - "sorrir", - "sorteio", - "sossego", - "sotaque", - "soterrar", - "sovado", - "sozinho", - "suavizar", - "subida", - "submerso", - "subsolo", - "subtrair", - "sucata", - "sucesso", - "suco", - "sudeste", - "sufixo", - "sugador", - "sugerir", - "sujeito", - "sulfato", - "sumir", - "suor", - "superior", - "suplicar", - "suposto", - "suprimir", - "surdina", - "surfista", - "surpresa", - "surreal", - "surtir", - "suspiro", - "sustento", - "tabela", - "tablete", - "tabuada", - "tacho", - "tagarela", - "talher", - "talo", - "talvez", - "tamanho", - "tamborim", - "tampa", - "tangente", - "tanto", - "tapar", - "tapioca", - "tardio", - "tarefa", - "tarja", - "tarraxa", - "tatuagem", - "taurino", - "taxativo", - "taxista", - "teatral", - "tecer", - "tecido", - "teclado", - "tedioso", - "teia", - "teimar", - "telefone", - "telhado", - "tempero", - "tenente", - "tensor", - "tentar", - "termal", - "terno", - "terreno", - "tese", - "tesoura", - "testado", - "teto", - "textura", - "texugo", - "tiara", - "tigela", - "tijolo", - "timbrar", - "timidez", - "tingido", - "tinteiro", - "tiragem", - "titular", - "toalha", - "tocha", - "tolerar", - "tolice", - "tomada", - "tomilho", - "tonel", - "tontura", - "topete", - "tora", - "torcido", - "torneio", - "torque", - "torrada", - "torto", - "tostar", - "touca", - "toupeira", - "toxina", - "trabalho", - "tracejar", - "tradutor", - "trafegar", - "trajeto", - "trama", - "trancar", - "trapo", - "traseiro", - "tratador", - "travar", - "treino", - "tremer", - "trepidar", - "trevo", - "triagem", - "tribo", - "triciclo", - "tridente", - "trilogia", - "trindade", - "triplo", - "triturar", - "triunfal", - "trocar", - "trombeta", - "trova", - "trunfo", - "truque", - "tubular", - "tucano", - "tudo", - "tulipa", - "tupi", - "turbo", - "turma", - "turquesa", - "tutelar", - "tutorial", - "uivar", - "umbigo", - "unha", - "unidade", - "uniforme", - "urologia", - "urso", - "urtiga", - "urubu", - "usado", - "usina", - "usufruir", - "vacina", - "vadiar", - "vagaroso", - "vaidoso", - "vala", - "valente", - "validade", - "valores", - "vantagem", - "vaqueiro", - "varanda", - "vareta", - "varrer", - "vascular", - "vasilha", - "vassoura", - "vazar", - "vazio", - "veado", - "vedar", - "vegetar", - "veicular", - "veleiro", - "velhice", - "veludo", - "vencedor", - "vendaval", - "venerar", - "ventre", - "verbal", - "verdade", - "vereador", - "vergonha", - "vermelho", - "verniz", - "versar", - "vertente", - "vespa", - "vestido", - "vetorial", - "viaduto", - "viagem", - "viajar", - "viatura", - "vibrador", - "videira", - "vidraria", - "viela", - "viga", - "vigente", - "vigiar", - "vigorar", - "vilarejo", - "vinco", - "vinheta", - "vinil", - "violeta", - "virada", - "virtude", - "visitar", - "visto", - "vitral", - "viveiro", - "vizinho", - "voador", - "voar", - "vogal", - "volante", - "voleibol", - "voltagem", - "volumoso", - "vontade", - "vulto", - "vuvuzela", - "xadrez", - "xarope", - "xeque", - "xeretar", - "xerife", - "xingar", - "zangado", - "zarpar", - "zebu", - "zelador", - "zombar", - "zoologia", - "zumbido" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/english.json -var require_english = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/wordlists/english.json"(exports2, module2) { - module2.exports = [ - "abandon", - "ability", - "able", - "about", - "above", - "absent", - "absorb", - "abstract", - "absurd", - "abuse", - "access", - "accident", - "account", - "accuse", - "achieve", - "acid", - "acoustic", - "acquire", - "across", - "act", - "action", - "actor", - "actress", - "actual", - "adapt", - "add", - "addict", - "address", - "adjust", - "admit", - "adult", - "advance", - "advice", - "aerobic", - "affair", - "afford", - "afraid", - "again", - "age", - "agent", - "agree", - "ahead", - "aim", - "air", - "airport", - "aisle", - "alarm", - "album", - "alcohol", - "alert", - "alien", - "all", - "alley", - "allow", - "almost", - "alone", - "alpha", - "already", - "also", - "alter", - "always", - "amateur", - "amazing", - "among", - "amount", - "amused", - "analyst", - "anchor", - "ancient", - "anger", - "angle", - "angry", - "animal", - "ankle", - "announce", - "annual", - "another", - "answer", - "antenna", - "antique", - "anxiety", - "any", - "apart", - "apology", - "appear", - "apple", - "approve", - "april", - "arch", - "arctic", - "area", - "arena", - "argue", - "arm", - "armed", - "armor", - "army", - "around", - "arrange", - "arrest", - "arrive", - "arrow", - "art", - "artefact", - "artist", - "artwork", - "ask", - "aspect", - "assault", - "asset", - "assist", - "assume", - "asthma", - "athlete", - "atom", - "attack", - "attend", - "attitude", - "attract", - "auction", - "audit", - "august", - "aunt", - "author", - "auto", - "autumn", - "average", - "avocado", - "avoid", - "awake", - "aware", - "away", - "awesome", - "awful", - "awkward", - "axis", - "baby", - "bachelor", - "bacon", - "badge", - "bag", - "balance", - "balcony", - "ball", - "bamboo", - "banana", - "banner", - "bar", - "barely", - "bargain", - "barrel", - "base", - "basic", - "basket", - "battle", - "beach", - "bean", - "beauty", - "because", - "become", - "beef", - "before", - "begin", - "behave", - "behind", - "believe", - "below", - "belt", - "bench", - "benefit", - "best", - "betray", - "better", - "between", - "beyond", - "bicycle", - "bid", - "bike", - "bind", - "biology", - "bird", - "birth", - "bitter", - "black", - "blade", - "blame", - "blanket", - "blast", - "bleak", - "bless", - "blind", - "blood", - "blossom", - "blouse", - "blue", - "blur", - "blush", - "board", - "boat", - "body", - "boil", - "bomb", - "bone", - "bonus", - "book", - "boost", - "border", - "boring", - "borrow", - "boss", - "bottom", - "bounce", - "box", - "boy", - "bracket", - "brain", - "brand", - "brass", - "brave", - "bread", - "breeze", - "brick", - "bridge", - "brief", - "bright", - "bring", - "brisk", - "broccoli", - "broken", - "bronze", - "broom", - "brother", - "brown", - "brush", - "bubble", - "buddy", - "budget", - "buffalo", - "build", - "bulb", - "bulk", - "bullet", - "bundle", - "bunker", - "burden", - "burger", - "burst", - "bus", - "business", - "busy", - "butter", - "buyer", - "buzz", - "cabbage", - "cabin", - "cable", - "cactus", - "cage", - "cake", - "call", - "calm", - "camera", - "camp", - "can", - "canal", - "cancel", - "candy", - "cannon", - "canoe", - "canvas", - "canyon", - "capable", - "capital", - "captain", - "car", - "carbon", - "card", - "cargo", - "carpet", - "carry", - "cart", - "case", - "cash", - "casino", - "castle", - "casual", - "cat", - "catalog", - "catch", - "category", - "cattle", - "caught", - "cause", - "caution", - "cave", - "ceiling", - "celery", - "cement", - "census", - "century", - "cereal", - "certain", - "chair", - "chalk", - "champion", - "change", - "chaos", - "chapter", - "charge", - "chase", - "chat", - "cheap", - "check", - "cheese", - "chef", - "cherry", - "chest", - "chicken", - "chief", - "child", - "chimney", - "choice", - "choose", - "chronic", - "chuckle", - "chunk", - "churn", - "cigar", - "cinnamon", - "circle", - "citizen", - "city", - "civil", - "claim", - "clap", - "clarify", - "claw", - "clay", - "clean", - "clerk", - "clever", - "click", - "client", - "cliff", - "climb", - "clinic", - "clip", - "clock", - "clog", - "close", - "cloth", - "cloud", - "clown", - "club", - "clump", - "cluster", - "clutch", - "coach", - "coast", - "coconut", - "code", - "coffee", - "coil", - "coin", - "collect", - "color", - "column", - "combine", - "come", - "comfort", - "comic", - "common", - "company", - "concert", - "conduct", - "confirm", - "congress", - "connect", - "consider", - "control", - "convince", - "cook", - "cool", - "copper", - "copy", - "coral", - "core", - "corn", - "correct", - "cost", - "cotton", - "couch", - "country", - "couple", - "course", - "cousin", - "cover", - "coyote", - "crack", - "cradle", - "craft", - "cram", - "crane", - "crash", - "crater", - "crawl", - "crazy", - "cream", - "credit", - "creek", - "crew", - "cricket", - "crime", - "crisp", - "critic", - "crop", - "cross", - "crouch", - "crowd", - "crucial", - "cruel", - "cruise", - "crumble", - "crunch", - "crush", - "cry", - "crystal", - "cube", - "culture", - "cup", - "cupboard", - "curious", - "current", - "curtain", - "curve", - "cushion", - "custom", - "cute", - "cycle", - "dad", - "damage", - "damp", - "dance", - "danger", - "daring", - "dash", - "daughter", - "dawn", - "day", - "deal", - "debate", - "debris", - "decade", - "december", - "decide", - "decline", - "decorate", - "decrease", - "deer", - "defense", - "define", - "defy", - "degree", - "delay", - "deliver", - "demand", - "demise", - "denial", - "dentist", - "deny", - "depart", - "depend", - "deposit", - "depth", - "deputy", - "derive", - "describe", - "desert", - "design", - "desk", - "despair", - "destroy", - "detail", - "detect", - "develop", - "device", - "devote", - "diagram", - "dial", - "diamond", - "diary", - "dice", - "diesel", - "diet", - "differ", - "digital", - "dignity", - "dilemma", - "dinner", - "dinosaur", - "direct", - "dirt", - "disagree", - "discover", - "disease", - "dish", - "dismiss", - "disorder", - "display", - "distance", - "divert", - "divide", - "divorce", - "dizzy", - "doctor", - "document", - "dog", - "doll", - "dolphin", - "domain", - "donate", - "donkey", - "donor", - "door", - "dose", - "double", - "dove", - "draft", - "dragon", - "drama", - "drastic", - "draw", - "dream", - "dress", - "drift", - "drill", - "drink", - "drip", - "drive", - "drop", - "drum", - "dry", - "duck", - "dumb", - "dune", - "during", - "dust", - "dutch", - "duty", - "dwarf", - "dynamic", - "eager", - "eagle", - "early", - "earn", - "earth", - "easily", - "east", - "easy", - "echo", - "ecology", - "economy", - "edge", - "edit", - "educate", - "effort", - "egg", - "eight", - "either", - "elbow", - "elder", - "electric", - "elegant", - "element", - "elephant", - "elevator", - "elite", - "else", - "embark", - "embody", - "embrace", - "emerge", - "emotion", - "employ", - "empower", - "empty", - "enable", - "enact", - "end", - "endless", - "endorse", - "enemy", - "energy", - "enforce", - "engage", - "engine", - "enhance", - "enjoy", - "enlist", - "enough", - "enrich", - "enroll", - "ensure", - "enter", - "entire", - "entry", - "envelope", - "episode", - "equal", - "equip", - "era", - "erase", - "erode", - "erosion", - "error", - "erupt", - "escape", - "essay", - "essence", - "estate", - "eternal", - "ethics", - "evidence", - "evil", - "evoke", - "evolve", - "exact", - "example", - "excess", - "exchange", - "excite", - "exclude", - "excuse", - "execute", - "exercise", - "exhaust", - "exhibit", - "exile", - "exist", - "exit", - "exotic", - "expand", - "expect", - "expire", - "explain", - "expose", - "express", - "extend", - "extra", - "eye", - "eyebrow", - "fabric", - "face", - "faculty", - "fade", - "faint", - "faith", - "fall", - "false", - "fame", - "family", - "famous", - "fan", - "fancy", - "fantasy", - "farm", - "fashion", - "fat", - "fatal", - "father", - "fatigue", - "fault", - "favorite", - "feature", - "february", - "federal", - "fee", - "feed", - "feel", - "female", - "fence", - "festival", - "fetch", - "fever", - "few", - "fiber", - "fiction", - "field", - "figure", - "file", - "film", - "filter", - "final", - "find", - "fine", - "finger", - "finish", - "fire", - "firm", - "first", - "fiscal", - "fish", - "fit", - "fitness", - "fix", - "flag", - "flame", - "flash", - "flat", - "flavor", - "flee", - "flight", - "flip", - "float", - "flock", - "floor", - "flower", - "fluid", - "flush", - "fly", - "foam", - "focus", - "fog", - "foil", - "fold", - "follow", - "food", - "foot", - "force", - "forest", - "forget", - "fork", - "fortune", - "forum", - "forward", - "fossil", - "foster", - "found", - "fox", - "fragile", - "frame", - "frequent", - "fresh", - "friend", - "fringe", - "frog", - "front", - "frost", - "frown", - "frozen", - "fruit", - "fuel", - "fun", - "funny", - "furnace", - "fury", - "future", - "gadget", - "gain", - "galaxy", - "gallery", - "game", - "gap", - "garage", - "garbage", - "garden", - "garlic", - "garment", - "gas", - "gasp", - "gate", - "gather", - "gauge", - "gaze", - "general", - "genius", - "genre", - "gentle", - "genuine", - "gesture", - "ghost", - "giant", - "gift", - "giggle", - "ginger", - "giraffe", - "girl", - "give", - "glad", - "glance", - "glare", - "glass", - "glide", - "glimpse", - "globe", - "gloom", - "glory", - "glove", - "glow", - "glue", - "goat", - "goddess", - "gold", - "good", - "goose", - "gorilla", - "gospel", - "gossip", - "govern", - "gown", - "grab", - "grace", - "grain", - "grant", - "grape", - "grass", - "gravity", - "great", - "green", - "grid", - "grief", - "grit", - "grocery", - "group", - "grow", - "grunt", - "guard", - "guess", - "guide", - "guilt", - "guitar", - "gun", - "gym", - "habit", - "hair", - "half", - "hammer", - "hamster", - "hand", - "happy", - "harbor", - "hard", - "harsh", - "harvest", - "hat", - "have", - "hawk", - "hazard", - "head", - "health", - "heart", - "heavy", - "hedgehog", - "height", - "hello", - "helmet", - "help", - "hen", - "hero", - "hidden", - "high", - "hill", - "hint", - "hip", - "hire", - "history", - "hobby", - "hockey", - "hold", - "hole", - "holiday", - "hollow", - "home", - "honey", - "hood", - "hope", - "horn", - "horror", - "horse", - "hospital", - "host", - "hotel", - "hour", - "hover", - "hub", - "huge", - "human", - "humble", - "humor", - "hundred", - "hungry", - "hunt", - "hurdle", - "hurry", - "hurt", - "husband", - "hybrid", - "ice", - "icon", - "idea", - "identify", - "idle", - "ignore", - "ill", - "illegal", - "illness", - "image", - "imitate", - "immense", - "immune", - "impact", - "impose", - "improve", - "impulse", - "inch", - "include", - "income", - "increase", - "index", - "indicate", - "indoor", - "industry", - "infant", - "inflict", - "inform", - "inhale", - "inherit", - "initial", - "inject", - "injury", - "inmate", - "inner", - "innocent", - "input", - "inquiry", - "insane", - "insect", - "inside", - "inspire", - "install", - "intact", - "interest", - "into", - "invest", - "invite", - "involve", - "iron", - "island", - "isolate", - "issue", - "item", - "ivory", - "jacket", - "jaguar", - "jar", - "jazz", - "jealous", - "jeans", - "jelly", - "jewel", - "job", - "join", - "joke", - "journey", - "joy", - "judge", - "juice", - "jump", - "jungle", - "junior", - "junk", - "just", - "kangaroo", - "keen", - "keep", - "ketchup", - "key", - "kick", - "kid", - "kidney", - "kind", - "kingdom", - "kiss", - "kit", - "kitchen", - "kite", - "kitten", - "kiwi", - "knee", - "knife", - "knock", - "know", - "lab", - "label", - "labor", - "ladder", - "lady", - "lake", - "lamp", - "language", - "laptop", - "large", - "later", - "latin", - "laugh", - "laundry", - "lava", - "law", - "lawn", - "lawsuit", - "layer", - "lazy", - "leader", - "leaf", - "learn", - "leave", - "lecture", - "left", - "leg", - "legal", - "legend", - "leisure", - "lemon", - "lend", - "length", - "lens", - "leopard", - "lesson", - "letter", - "level", - "liar", - "liberty", - "library", - "license", - "life", - "lift", - "light", - "like", - "limb", - "limit", - "link", - "lion", - "liquid", - "list", - "little", - "live", - "lizard", - "load", - "loan", - "lobster", - "local", - "lock", - "logic", - "lonely", - "long", - "loop", - "lottery", - "loud", - "lounge", - "love", - "loyal", - "lucky", - "luggage", - "lumber", - "lunar", - "lunch", - "luxury", - "lyrics", - "machine", - "mad", - "magic", - "magnet", - "maid", - "mail", - "main", - "major", - "make", - "mammal", - "man", - "manage", - "mandate", - "mango", - "mansion", - "manual", - "maple", - "marble", - "march", - "margin", - "marine", - "market", - "marriage", - "mask", - "mass", - "master", - "match", - "material", - "math", - "matrix", - "matter", - "maximum", - "maze", - "meadow", - "mean", - "measure", - "meat", - "mechanic", - "medal", - "media", - "melody", - "melt", - "member", - "memory", - "mention", - "menu", - "mercy", - "merge", - "merit", - "merry", - "mesh", - "message", - "metal", - "method", - "middle", - "midnight", - "milk", - "million", - "mimic", - "mind", - "minimum", - "minor", - "minute", - "miracle", - "mirror", - "misery", - "miss", - "mistake", - "mix", - "mixed", - "mixture", - "mobile", - "model", - "modify", - "mom", - "moment", - "monitor", - "monkey", - "monster", - "month", - "moon", - "moral", - "more", - "morning", - "mosquito", - "mother", - "motion", - "motor", - "mountain", - "mouse", - "move", - "movie", - "much", - "muffin", - "mule", - "multiply", - "muscle", - "museum", - "mushroom", - "music", - "must", - "mutual", - "myself", - "mystery", - "myth", - "naive", - "name", - "napkin", - "narrow", - "nasty", - "nation", - "nature", - "near", - "neck", - "need", - "negative", - "neglect", - "neither", - "nephew", - "nerve", - "nest", - "net", - "network", - "neutral", - "never", - "news", - "next", - "nice", - "night", - "noble", - "noise", - "nominee", - "noodle", - "normal", - "north", - "nose", - "notable", - "note", - "nothing", - "notice", - "novel", - "now", - "nuclear", - "number", - "nurse", - "nut", - "oak", - "obey", - "object", - "oblige", - "obscure", - "observe", - "obtain", - "obvious", - "occur", - "ocean", - "october", - "odor", - "off", - "offer", - "office", - "often", - "oil", - "okay", - "old", - "olive", - "olympic", - "omit", - "once", - "one", - "onion", - "online", - "only", - "open", - "opera", - "opinion", - "oppose", - "option", - "orange", - "orbit", - "orchard", - "order", - "ordinary", - "organ", - "orient", - "original", - "orphan", - "ostrich", - "other", - "outdoor", - "outer", - "output", - "outside", - "oval", - "oven", - "over", - "own", - "owner", - "oxygen", - "oyster", - "ozone", - "pact", - "paddle", - "page", - "pair", - "palace", - "palm", - "panda", - "panel", - "panic", - "panther", - "paper", - "parade", - "parent", - "park", - "parrot", - "party", - "pass", - "patch", - "path", - "patient", - "patrol", - "pattern", - "pause", - "pave", - "payment", - "peace", - "peanut", - "pear", - "peasant", - "pelican", - "pen", - "penalty", - "pencil", - "people", - "pepper", - "perfect", - "permit", - "person", - "pet", - "phone", - "photo", - "phrase", - "physical", - "piano", - "picnic", - "picture", - "piece", - "pig", - "pigeon", - "pill", - "pilot", - "pink", - "pioneer", - "pipe", - "pistol", - "pitch", - "pizza", - "place", - "planet", - "plastic", - "plate", - "play", - "please", - "pledge", - "pluck", - "plug", - "plunge", - "poem", - "poet", - "point", - "polar", - "pole", - "police", - "pond", - "pony", - "pool", - "popular", - "portion", - "position", - "possible", - "post", - "potato", - "pottery", - "poverty", - "powder", - "power", - "practice", - "praise", - "predict", - "prefer", - "prepare", - "present", - "pretty", - "prevent", - "price", - "pride", - "primary", - "print", - "priority", - "prison", - "private", - "prize", - "problem", - "process", - "produce", - "profit", - "program", - "project", - "promote", - "proof", - "property", - "prosper", - "protect", - "proud", - "provide", - "public", - "pudding", - "pull", - "pulp", - "pulse", - "pumpkin", - "punch", - "pupil", - "puppy", - "purchase", - "purity", - "purpose", - "purse", - "push", - "put", - "puzzle", - "pyramid", - "quality", - "quantum", - "quarter", - "question", - "quick", - "quit", - "quiz", - "quote", - "rabbit", - "raccoon", - "race", - "rack", - "radar", - "radio", - "rail", - "rain", - "raise", - "rally", - "ramp", - "ranch", - "random", - "range", - "rapid", - "rare", - "rate", - "rather", - "raven", - "raw", - "razor", - "ready", - "real", - "reason", - "rebel", - "rebuild", - "recall", - "receive", - "recipe", - "record", - "recycle", - "reduce", - "reflect", - "reform", - "refuse", - "region", - "regret", - "regular", - "reject", - "relax", - "release", - "relief", - "rely", - "remain", - "remember", - "remind", - "remove", - "render", - "renew", - "rent", - "reopen", - "repair", - "repeat", - "replace", - "report", - "require", - "rescue", - "resemble", - "resist", - "resource", - "response", - "result", - "retire", - "retreat", - "return", - "reunion", - "reveal", - "review", - "reward", - "rhythm", - "rib", - "ribbon", - "rice", - "rich", - "ride", - "ridge", - "rifle", - "right", - "rigid", - "ring", - "riot", - "ripple", - "risk", - "ritual", - "rival", - "river", - "road", - "roast", - "robot", - "robust", - "rocket", - "romance", - "roof", - "rookie", - "room", - "rose", - "rotate", - "rough", - "round", - "route", - "royal", - "rubber", - "rude", - "rug", - "rule", - "run", - "runway", - "rural", - "sad", - "saddle", - "sadness", - "safe", - "sail", - "salad", - "salmon", - "salon", - "salt", - "salute", - "same", - "sample", - "sand", - "satisfy", - "satoshi", - "sauce", - "sausage", - "save", - "say", - "scale", - "scan", - "scare", - "scatter", - "scene", - "scheme", - "school", - "science", - "scissors", - "scorpion", - "scout", - "scrap", - "screen", - "script", - "scrub", - "sea", - "search", - "season", - "seat", - "second", - "secret", - "section", - "security", - "seed", - "seek", - "segment", - "select", - "sell", - "seminar", - "senior", - "sense", - "sentence", - "series", - "service", - "session", - "settle", - "setup", - "seven", - "shadow", - "shaft", - "shallow", - "share", - "shed", - "shell", - "sheriff", - "shield", - "shift", - "shine", - "ship", - "shiver", - "shock", - "shoe", - "shoot", - "shop", - "short", - "shoulder", - "shove", - "shrimp", - "shrug", - "shuffle", - "shy", - "sibling", - "sick", - "side", - "siege", - "sight", - "sign", - "silent", - "silk", - "silly", - "silver", - "similar", - "simple", - "since", - "sing", - "siren", - "sister", - "situate", - "six", - "size", - "skate", - "sketch", - "ski", - "skill", - "skin", - "skirt", - "skull", - "slab", - "slam", - "sleep", - "slender", - "slice", - "slide", - "slight", - "slim", - "slogan", - "slot", - "slow", - "slush", - "small", - "smart", - "smile", - "smoke", - "smooth", - "snack", - "snake", - "snap", - "sniff", - "snow", - "soap", - "soccer", - "social", - "sock", - "soda", - "soft", - "solar", - "soldier", - "solid", - "solution", - "solve", - "someone", - "song", - "soon", - "sorry", - "sort", - "soul", - "sound", - "soup", - "source", - "south", - "space", - "spare", - "spatial", - "spawn", - "speak", - "special", - "speed", - "spell", - "spend", - "sphere", - "spice", - "spider", - "spike", - "spin", - "spirit", - "split", - "spoil", - "sponsor", - "spoon", - "sport", - "spot", - "spray", - "spread", - "spring", - "spy", - "square", - "squeeze", - "squirrel", - "stable", - "stadium", - "staff", - "stage", - "stairs", - "stamp", - "stand", - "start", - "state", - "stay", - "steak", - "steel", - "stem", - "step", - "stereo", - "stick", - "still", - "sting", - "stock", - "stomach", - "stone", - "stool", - "story", - "stove", - "strategy", - "street", - "strike", - "strong", - "struggle", - "student", - "stuff", - "stumble", - "style", - "subject", - "submit", - "subway", - "success", - "such", - "sudden", - "suffer", - "sugar", - "suggest", - "suit", - "summer", - "sun", - "sunny", - "sunset", - "super", - "supply", - "supreme", - "sure", - "surface", - "surge", - "surprise", - "surround", - "survey", - "suspect", - "sustain", - "swallow", - "swamp", - "swap", - "swarm", - "swear", - "sweet", - "swift", - "swim", - "swing", - "switch", - "sword", - "symbol", - "symptom", - "syrup", - "system", - "table", - "tackle", - "tag", - "tail", - "talent", - "talk", - "tank", - "tape", - "target", - "task", - "taste", - "tattoo", - "taxi", - "teach", - "team", - "tell", - "ten", - "tenant", - "tennis", - "tent", - "term", - "test", - "text", - "thank", - "that", - "theme", - "then", - "theory", - "there", - "they", - "thing", - "this", - "thought", - "three", - "thrive", - "throw", - "thumb", - "thunder", - "ticket", - "tide", - "tiger", - "tilt", - "timber", - "time", - "tiny", - "tip", - "tired", - "tissue", - "title", - "toast", - "tobacco", - "today", - "toddler", - "toe", - "together", - "toilet", - "token", - "tomato", - "tomorrow", - "tone", - "tongue", - "tonight", - "tool", - "tooth", - "top", - "topic", - "topple", - "torch", - "tornado", - "tortoise", - "toss", - "total", - "tourist", - "toward", - "tower", - "town", - "toy", - "track", - "trade", - "traffic", - "tragic", - "train", - "transfer", - "trap", - "trash", - "travel", - "tray", - "treat", - "tree", - "trend", - "trial", - "tribe", - "trick", - "trigger", - "trim", - "trip", - "trophy", - "trouble", - "truck", - "true", - "truly", - "trumpet", - "trust", - "truth", - "try", - "tube", - "tuition", - "tumble", - "tuna", - "tunnel", - "turkey", - "turn", - "turtle", - "twelve", - "twenty", - "twice", - "twin", - "twist", - "two", - "type", - "typical", - "ugly", - "umbrella", - "unable", - "unaware", - "uncle", - "uncover", - "under", - "undo", - "unfair", - "unfold", - "unhappy", - "uniform", - "unique", - "unit", - "universe", - "unknown", - "unlock", - "until", - "unusual", - "unveil", - "update", - "upgrade", - "uphold", - "upon", - "upper", - "upset", - "urban", - "urge", - "usage", - "use", - "used", - "useful", - "useless", - "usual", - "utility", - "vacant", - "vacuum", - "vague", - "valid", - "valley", - "valve", - "van", - "vanish", - "vapor", - "various", - "vast", - "vault", - "vehicle", - "velvet", - "vendor", - "venture", - "venue", - "verb", - "verify", - "version", - "very", - "vessel", - "veteran", - "viable", - "vibrant", - "vicious", - "victory", - "video", - "view", - "village", - "vintage", - "violin", - "virtual", - "virus", - "visa", - "visit", - "visual", - "vital", - "vivid", - "vocal", - "voice", - "void", - "volcano", - "volume", - "vote", - "voyage", - "wage", - "wagon", - "wait", - "walk", - "wall", - "walnut", - "want", - "warfare", - "warm", - "warrior", - "wash", - "wasp", - "waste", - "water", - "wave", - "way", - "wealth", - "weapon", - "wear", - "weasel", - "weather", - "web", - "wedding", - "weekend", - "weird", - "welcome", - "west", - "wet", - "whale", - "what", - "wheat", - "wheel", - "when", - "where", - "whip", - "whisper", - "wide", - "width", - "wife", - "wild", - "will", - "win", - "window", - "wine", - "wing", - "wink", - "winner", - "winter", - "wire", - "wisdom", - "wise", - "wish", - "witness", - "wolf", - "woman", - "wonder", - "wood", - "wool", - "word", - "work", - "world", - "worry", - "worth", - "wrap", - "wreck", - "wrestle", - "wrist", - "write", - "wrong", - "yard", - "year", - "yellow", - "you", - "young", - "youth", - "zebra", - "zero", - "zone", - "zoo" - ]; - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/_wordlists.js -var require_wordlists = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/_wordlists.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var wordlists = {}; - exports2.wordlists = wordlists; - var _default; - exports2._default = _default; - try { - exports2._default = _default = require_czech(); - wordlists.czech = _default; - } catch (err) { - } - try { - exports2._default = _default = require_chinese_simplified(); - wordlists.chinese_simplified = _default; - } catch (err) { - } - try { - exports2._default = _default = require_chinese_traditional(); - wordlists.chinese_traditional = _default; - } catch (err) { - } - try { - exports2._default = _default = require_korean(); - wordlists.korean = _default; - } catch (err) { - } - try { - exports2._default = _default = require_french(); - wordlists.french = _default; - } catch (err) { - } - try { - exports2._default = _default = require_italian(); - wordlists.italian = _default; - } catch (err) { - } - try { - exports2._default = _default = require_spanish(); - wordlists.spanish = _default; - } catch (err) { - } - try { - exports2._default = _default = require_japanese(); - wordlists.japanese = _default; - wordlists.JA = _default; - } catch (err) { - } - try { - exports2._default = _default = require_portuguese(); - wordlists.portuguese = _default; - } catch (err) { - } - try { - exports2._default = _default = require_english(); - wordlists.english = _default; - wordlists.EN = _default; - } catch (err) { - } - } -}); - -// ../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/index.js -var require_src = __commonJS({ - "../../node_modules/.pnpm/bip39@3.1.0/node_modules/bip39/src/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var sha256_1 = require_sha256(); - var sha512_1 = require_sha512(); - var pbkdf2_1 = require_pbkdf2(); - var utils_1 = require_utils2(); - var _wordlists_1 = require_wordlists(); - var DEFAULT_WORDLIST = _wordlists_1._default; - var INVALID_MNEMONIC = "Invalid mnemonic"; - var INVALID_ENTROPY = "Invalid entropy"; - var INVALID_CHECKSUM = "Invalid mnemonic checksum"; - var WORDLIST_REQUIRED = "A wordlist is required but a default could not be found.\nPlease pass a 2048 word array explicitly."; - function normalize(str) { - return (str || "").normalize("NFKD"); - } - function lpad(str, padString, length) { - while (str.length < length) { - str = padString + str; - } - return str; - } - function binaryToByte(bin) { - return parseInt(bin, 2); - } - function bytesToBinary(bytes) { - return bytes.map((x) => lpad(x.toString(2), "0", 8)).join(""); - } - function deriveChecksumBits(entropyBuffer) { - const ENT = entropyBuffer.length * 8; - const CS = ENT / 32; - const hash = sha256_1.sha256(Uint8Array.from(entropyBuffer)); - return bytesToBinary(Array.from(hash)).slice(0, CS); - } - function salt(password) { - return "mnemonic" + (password || ""); - } - function mnemonicToSeedSync(mnemonic, password) { - const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), "utf8")); - const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), "utf8")); - const res = pbkdf2_1.pbkdf2(sha512_1.sha512, mnemonicBuffer, saltBuffer, { - c: 2048, - dkLen: 64 - }); - return Buffer.from(res); - } - exports2.mnemonicToSeedSync = mnemonicToSeedSync; - function mnemonicToSeed(mnemonic, password) { - const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), "utf8")); - const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), "utf8")); - return pbkdf2_1.pbkdf2Async(sha512_1.sha512, mnemonicBuffer, saltBuffer, { - c: 2048, - dkLen: 64 - }).then((res) => Buffer.from(res)); - } - exports2.mnemonicToSeed = mnemonicToSeed; - function mnemonicToEntropy(mnemonic, wordlist) { - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - const words = normalize(mnemonic).split(" "); - if (words.length % 3 !== 0) { - throw new Error(INVALID_MNEMONIC); - } - const bits = words.map((word) => { - const index = wordlist.indexOf(word); - if (index === -1) { - throw new Error(INVALID_MNEMONIC); - } - return lpad(index.toString(2), "0", 11); - }).join(""); - const dividerIndex = Math.floor(bits.length / 33) * 32; - const entropyBits = bits.slice(0, dividerIndex); - const checksumBits = bits.slice(dividerIndex); - const entropyBytes = entropyBits.match(/(.{1,8})/g).map(binaryToByte); - if (entropyBytes.length < 16) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length > 32) { - throw new Error(INVALID_ENTROPY); - } - if (entropyBytes.length % 4 !== 0) { - throw new Error(INVALID_ENTROPY); - } - const entropy = Buffer.from(entropyBytes); - const newChecksum = deriveChecksumBits(entropy); - if (newChecksum !== checksumBits) { - throw new Error(INVALID_CHECKSUM); - } - return entropy.toString("hex"); - } - exports2.mnemonicToEntropy = mnemonicToEntropy; - function entropyToMnemonic(entropy, wordlist) { - if (!Buffer.isBuffer(entropy)) { - entropy = Buffer.from(entropy, "hex"); - } - wordlist = wordlist || DEFAULT_WORDLIST; - if (!wordlist) { - throw new Error(WORDLIST_REQUIRED); - } - if (entropy.length < 16) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length > 32) { - throw new TypeError(INVALID_ENTROPY); - } - if (entropy.length % 4 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - const entropyBits = bytesToBinary(Array.from(entropy)); - const checksumBits = deriveChecksumBits(entropy); - const bits = entropyBits + checksumBits; - const chunks = bits.match(/(.{1,11})/g); - const words = chunks.map((binary) => { - const index = binaryToByte(binary); - return wordlist[index]; - }); - return wordlist[0] === "\u3042\u3044\u3053\u304F\u3057\u3093" ? words.join("\u3000") : words.join(" "); - } - exports2.entropyToMnemonic = entropyToMnemonic; - function generateMnemonic(strength, rng2, wordlist) { - strength = strength || 128; - if (strength % 32 !== 0) { - throw new TypeError(INVALID_ENTROPY); - } - rng2 = rng2 || ((size) => Buffer.from(utils_1.randomBytes(size))); - return entropyToMnemonic(rng2(strength / 8), wordlist); - } - exports2.generateMnemonic = generateMnemonic; - function validateMnemonic2(mnemonic, wordlist) { - try { - mnemonicToEntropy(mnemonic, wordlist); - } catch (e) { - return false; - } - return true; - } - exports2.validateMnemonic = validateMnemonic2; - function setDefaultWordlist(language) { - const result = _wordlists_1.wordlists[language]; - if (result) { - DEFAULT_WORDLIST = result; - } else { - throw new Error('Could not find wordlist for language "' + language + '"'); - } - } - exports2.setDefaultWordlist = setDefaultWordlist; - function getDefaultWordlist() { - if (!DEFAULT_WORDLIST) { - throw new Error("No Default Wordlist set"); - } - return Object.keys(_wordlists_1.wordlists).filter((lang) => { - if (lang === "JA" || lang === "EN") { - return false; - } - return _wordlists_1.wordlists[lang].every((word, index) => word === DEFAULT_WORDLIST[index]); - })[0]; - } - exports2.getDefaultWordlist = getDefaultWordlist; - var _wordlists_2 = require_wordlists(); - exports2.wordlists = _wordlists_2.wordlists; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/cryptoNode.js -var nc, crypto; -var init_cryptoNode = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/cryptoNode.js"() { - nc = __toESM(require("node:crypto"), 1); - crypto = nc && typeof nc === "object" && "webcrypto" in nc ? nc.webcrypto : nc && typeof nc === "object" && "randomBytes" in nc ? nc : void 0; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js -function isBytes(a) { - return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array"; -} -function anumber(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error("positive integer expected, got " + n); -} -function abytes(b, ...lengths) { - if (!isBytes(b)) - throw new Error("Uint8Array expected"); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error("Uint8Array expected of length " + lengths + ", got length=" + b.length); -} -function ahash(h) { - if (typeof h !== "function" || typeof h.create !== "function") - throw new Error("Hash should be wrapped by utils.createHasher"); - anumber(h.outputLen); - anumber(h.blockLen); -} -function aexists(instance2, checkFinished = true) { - if (instance2.destroyed) - throw new Error("Hash instance has been destroyed"); - if (checkFinished && instance2.finished) - throw new Error("Hash#digest() has already been called"); -} -function aoutput(out, instance2) { - abytes(out); - const min = instance2.outputLen; - if (out.length < min) { - throw new Error("digestInto() expects output buffer of length at least " + min); - } -} -function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -function rotr(word, shift) { - return word << 32 - shift | word >>> shift; -} -function byteSwap(word) { - return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255; -} -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} -function bytesToHex(bytes) { - abytes(bytes); - if (hasHexBuiltin) - return bytes.toHex(); - let hex = ""; - for (let i = 0; i < bytes.length; i++) { - hex += hexes[bytes[i]]; - } - return hex; -} -function asciiToBase16(ch) { - if (ch >= asciis._0 && ch <= asciis._9) - return ch - asciis._0; - if (ch >= asciis.A && ch <= asciis.F) - return ch - (asciis.A - 10); - if (ch >= asciis.a && ch <= asciis.f) - return ch - (asciis.a - 10); - return; -} -function hexToBytes(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - if (hasHexBuiltin) - return Uint8Array.fromHex(hex); - const hl = hex.length; - const al = hl / 2; - if (hl % 2) - throw new Error("hex string expected, got unpadded hex of length " + hl); - const array2 = new Uint8Array(al); - for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) { - const n1 = asciiToBase16(hex.charCodeAt(hi)); - const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); - if (n1 === void 0 || n2 === void 0) { - const char = hex[hi] + hex[hi + 1]; - throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi); - } - array2[ai] = n1 * 16 + n2; - } - return array2; -} -function utf8ToBytes(str) { - if (typeof str !== "string") - throw new Error("string expected"); - return new Uint8Array(new TextEncoder().encode(str)); -} -function toBytes(data) { - if (typeof data === "string") - data = utf8ToBytes(data); - abytes(data); - return data; -} -function concatBytes(...arrays) { - let sum = 0; - for (let i = 0; i < arrays.length; i++) { - const a = arrays[i]; - abytes(a); - sum += a.length; - } - const res = new Uint8Array(sum); - for (let i = 0, pad = 0; i < arrays.length; i++) { - const a = arrays[i]; - res.set(a, pad); - pad += a.length; - } - return res; -} -function createHasher(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} -function randomBytes(bytesLength = 32) { - if (crypto && typeof crypto.getRandomValues === "function") { - return crypto.getRandomValues(new Uint8Array(bytesLength)); - } - if (crypto && typeof crypto.randomBytes === "function") { - return Uint8Array.from(crypto.randomBytes(bytesLength)); - } - throw new Error("crypto.getRandomValues must be defined"); -} -var isLE, swap32IfBE, hasHexBuiltin, hexes, asciis, Hash; -var init_utils = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/utils.js"() { - init_cryptoNode(); - isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68)(); - swap32IfBE = isLE ? (u) => u : byteSwap32; - hasHexBuiltin = /* @__PURE__ */ (() => ( - // @ts-ignore - typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function" - ))(); - hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0")); - asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 }; - Hash = class { - }; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js -function setBigUint64(view, byteOffset, value, isLE2) { - if (typeof view.setBigUint64 === "function") - return view.setBigUint64(byteOffset, value, isLE2); - const _32n2 = BigInt(32); - const _u32_max = BigInt(4294967295); - const wh = Number(value >> _32n2 & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE2 ? 4 : 0; - const l = isLE2 ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE2); - view.setUint32(byteOffset + l, wl, isLE2); -} -function Chi(a, b, c) { - return a & b ^ ~a & c; -} -function Maj(a, b, c) { - return a & b ^ a & c ^ b & c; -} -var HashMD, SHA256_IV, SHA512_IV; -var init_md = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js"() { - init_utils(); - HashMD = class extends Hash { - constructor(blockLen, outputLen, padOffset, isLE2) { - super(); - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE2; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - const { buffer, view, blockLen, isLE: isLE2 } = this; - let { pos } = this; - buffer[pos++] = 128; - clean(this.buffer.subarray(pos)); - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - if (len % 4) - throw new Error("_sha2: outputLen should be aligned to 32bit"); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error("_sha2: outputLen bigger than state"); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE2); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - clone() { - return this._cloneInto(); - } - }; - SHA256_IV = /* @__PURE__ */ Uint32Array.from([ - 1779033703, - 3144134277, - 1013904242, - 2773480762, - 1359893119, - 2600822924, - 528734635, - 1541459225 - ]); - SHA512_IV = /* @__PURE__ */ Uint32Array.from([ - 1779033703, - 4089235720, - 3144134277, - 2227873595, - 1013904242, - 4271175723, - 2773480762, - 1595750129, - 1359893119, - 2917565137, - 2600822924, - 725511199, - 528734635, - 4215389547, - 1541459225, - 327033209 - ]); - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number(n >> _32n & U32_MASK64) }; - return { h: Number(n >> _32n & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: Ah + Bh + (l / 2 ** 32 | 0) | 0, l: l | 0 }; -} -var U32_MASK64, _32n, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotlSH, rotlSL, rotlBH, rotlBL, add3L, add3H, add4L, add4H, add5L, add5H; -var init_u64 = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_u64.js"() { - U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); - _32n = /* @__PURE__ */ BigInt(32); - shrSH = (h, _l, s) => h >>> s; - shrSL = (h, l, s) => h << 32 - s | l >>> s; - rotrSH = (h, l, s) => h >>> s | l << 32 - s; - rotrSL = (h, l, s) => h << 32 - s | l >>> s; - rotrBH = (h, l, s) => h << 64 - s | l >>> s - 32; - rotrBL = (h, l, s) => h >>> s - 32 | l << 64 - s; - rotlSH = (h, l, s) => h << s | l >>> 32 - s; - rotlSL = (h, l, s) => l << s | h >>> 32 - s; - rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s; - rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s; - add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); - add3H = (low, Ah, Bh, Ch) => Ah + Bh + Ch + (low / 2 ** 32 | 0) | 0; - add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); - add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0; - add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); - add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js -var SHA256_K, SHA256_W, SHA256, K512, SHA512_Kh, SHA512_Kl, SHA512_W_H, SHA512_W_L, SHA512, sha256, sha512; -var init_sha2 = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha2.js"() { - init_md(); - init_u64(); - init_utils(); - SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 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 - ]); - SHA256_W = /* @__PURE__ */ new Uint32Array(64); - SHA256 = class extends HashMD { - constructor(outputLen = 32) { - super(64, outputLen, 8, false); - this.A = SHA256_IV[0] | 0; - this.B = SHA256_IV[1] | 0; - this.C = SHA256_IV[2] | 0; - this.D = SHA256_IV[3] | 0; - this.E = SHA256_IV[4] | 0; - this.F = SHA256_IV[5] | 0; - this.G = SHA256_IV[6] | 0; - this.H = SHA256_IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset2) { - for (let i = 0; i < 16; i++, offset2 += 4) - SHA256_W[i] = view.getUint32(offset2, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3; - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10; - SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0; - } - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = sigma0 + Maj(A, B, C) | 0; - H = G; - G = F; - F = E; - E = D + T1 | 0; - D = C; - C = B; - B = A; - A = T1 + T2 | 0; - } - A = A + this.A | 0; - B = B + this.B | 0; - C = C + this.C | 0; - D = D + this.D | 0; - E = E + this.E | 0; - F = F + this.F | 0; - G = G + this.G | 0; - H = H + this.H | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - clean(SHA256_W); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } - }; - K512 = /* @__PURE__ */ (() => 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((n) => BigInt(n))))(); - SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); - SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); - SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); - SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); - SHA512 = class extends HashMD { - constructor(outputLen = 64) { - super(128, outputLen, 16, false); - this.Ah = SHA512_IV[0] | 0; - this.Al = SHA512_IV[1] | 0; - this.Bh = SHA512_IV[2] | 0; - this.Bl = SHA512_IV[3] | 0; - this.Ch = SHA512_IV[4] | 0; - this.Cl = SHA512_IV[5] | 0; - this.Dh = SHA512_IV[6] | 0; - this.Dl = SHA512_IV[7] | 0; - this.Eh = SHA512_IV[8] | 0; - this.El = SHA512_IV[9] | 0; - this.Fh = SHA512_IV[10] | 0; - this.Fl = SHA512_IV[11] | 0; - this.Gh = SHA512_IV[12] | 0; - this.Gl = SHA512_IV[13] | 0; - this.Hh = SHA512_IV[14] | 0; - this.Hl = SHA512_IV[15] | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset2) { - for (let i = 0; i < 16; i++, offset2 += 4) { - SHA512_W_H[i] = view.getUint32(offset2); - SHA512_W_L[i] = view.getUint32(offset2 += 4); - } - for (let i = 16; i < 80; i++) { - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7); - const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7); - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6); - const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6); - const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - for (let i = 0; i < 80; i++) { - const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41); - const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41); - const CHIh = Eh & Fh ^ ~Eh & Gh; - const CHIl = El & Fl ^ ~El & Gl; - const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39); - const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39); - const MAJh = Ah & Bh ^ Ah & Ch ^ Bh & Ch; - const MAJl = Al & Bl ^ Al & Cl ^ Bl & Cl; - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = add3L(T1l, sigma0l, MAJl); - Ah = add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - clean(SHA512_W_H, SHA512_W_L); - } - destroy() { - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - }; - sha256 = /* @__PURE__ */ createHasher(() => new SHA256()); - sha512 = /* @__PURE__ */ createHasher(() => new SHA512()); - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/utils.js -function _abool2(value, title = "") { - if (typeof value !== "boolean") { - const prefix = title && `"${title}"`; - throw new Error(prefix + "expected boolean, got type=" + typeof value); - } - return value; -} -function _abytes2(value, length, title = "") { - const bytes = isBytes(value); - const len = value?.length; - const needsLen = length !== void 0; - if (!bytes || needsLen && len !== length) { - const prefix = title && `"${title}" `; - const ofLen = needsLen ? ` of length ${length}` : ""; - const got = bytes ? `length=${len}` : `type=${typeof value}`; - throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got); - } - return value; -} -function numberToHexUnpadded(num) { - const hex = num.toString(16); - return hex.length & 1 ? "0" + hex : hex; -} -function hexToNumber(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - return hex === "" ? _0n : BigInt("0x" + hex); -} -function bytesToNumberBE(bytes) { - return hexToNumber(bytesToHex(bytes)); -} -function bytesToNumberLE(bytes) { - abytes(bytes); - return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse())); -} -function numberToBytesBE(n, len) { - return hexToBytes(n.toString(16).padStart(len * 2, "0")); -} -function numberToBytesLE(n, len) { - return numberToBytesBE(n, len).reverse(); -} -function ensureBytes(title, hex, expectedLength) { - let res; - if (typeof hex === "string") { - try { - res = hexToBytes(hex); - } catch (e) { - throw new Error(title + " must be hex string or Uint8Array, cause: " + e); - } - } else if (isBytes(hex)) { - res = Uint8Array.from(hex); - } else { - throw new Error(title + " must be hex string or Uint8Array"); - } - const len = res.length; - if (typeof expectedLength === "number" && len !== expectedLength) - throw new Error(title + " of length " + expectedLength + " expected, got " + len); - return res; -} -function equalBytes(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; -} -function copyBytes(bytes) { - return Uint8Array.from(bytes); -} -function inRange(n, min, max) { - return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max; -} -function aInRange(title, n, min, max) { - if (!inRange(n, min, max)) - throw new Error("expected valid " + title + ": " + min + " <= n < " + max + ", got " + n); -} -function bitLen(n) { - let len; - for (len = 0; n > _0n; n >>= _1n, len += 1) - ; - return len; -} -function createHmacDrbg(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== "number" || hashLen < 2) - throw new Error("hashLen must be a number"); - if (typeof qByteLen !== "number" || qByteLen < 2) - throw new Error("qByteLen must be a number"); - if (typeof hmacFn !== "function") - throw new Error("hmacFn must be a function"); - const u8n = (len) => new Uint8Array(len); - const u8of = (byte) => Uint8Array.of(byte); - let v = u8n(hashLen); - let k = u8n(hashLen); - let i = 0; - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); - const reseed = (seed = u8n(0)) => { - k = h(u8of(0), seed); - v = h(); - if (seed.length === 0) - return; - k = h(u8of(1), seed); - v = h(); - }; - const gen2 = () => { - if (i++ >= 1e3) - throw new Error("drbg: tried 1000 values"); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return concatBytes(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); - let res = void 0; - while (!(res = pred(gen2()))) - reseed(); - reset(); - return res; - }; - return genUntil; -} -function _validateObject(object, fields, optFields = {}) { - if (!object || typeof object !== "object") - throw new Error("expected valid options object"); - function checkField(fieldName, expectedType, isOpt) { - const val = object[fieldName]; - if (isOpt && val === void 0) - return; - const current = typeof val; - if (current !== expectedType || val === null) - throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`); - } - Object.entries(fields).forEach(([k, v]) => checkField(k, v, false)); - Object.entries(optFields).forEach(([k, v]) => checkField(k, v, true)); -} -function memoized(fn) { - const map = /* @__PURE__ */ new WeakMap(); - return (arg, ...args) => { - const val = map.get(arg); - if (val !== void 0) - return val; - const computed = fn(arg, ...args); - map.set(arg, computed); - return computed; - }; -} -var _0n, _1n, isPosBig, bitMask, notImplemented; -var init_utils2 = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/utils.js"() { - init_utils(); - init_utils(); - _0n = /* @__PURE__ */ BigInt(0); - _1n = /* @__PURE__ */ BigInt(1); - isPosBig = (n) => typeof n === "bigint" && _0n <= n; - bitMask = (n) => (_1n << BigInt(n)) - _1n; - notImplemented = () => { - throw new Error("not implemented"); - }; - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/modular.js -function mod(a, b) { - const result = a % b; - return result >= _0n2 ? result : b + result; -} -function pow2(x, power, modulo) { - let res = x; - while (power-- > _0n2) { - res *= res; - res %= modulo; - } - return res; -} -function invert(number2, modulo) { - if (number2 === _0n2) - throw new Error("invert: expected non-zero number"); - if (modulo <= _0n2) - throw new Error("invert: expected positive modulus, got " + modulo); - let a = mod(number2, modulo); - let b = modulo; - let x = _0n2, y = _1n2, u = _1n2, v = _0n2; - while (a !== _0n2) { - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n2) - throw new Error("invert: does not exist"); - return mod(x, modulo); -} -function assertIsSquare(Fp2, root, n) { - if (!Fp2.eql(Fp2.sqr(root), n)) - throw new Error("Cannot find square root"); -} -function sqrt3mod4(Fp2, n) { - const p1div4 = (Fp2.ORDER + _1n2) / _4n; - const root = Fp2.pow(n, p1div4); - assertIsSquare(Fp2, root, n); - return root; -} -function sqrt5mod8(Fp2, n) { - const p5div8 = (Fp2.ORDER - _5n) / _8n; - const n2 = Fp2.mul(n, _2n); - const v = Fp2.pow(n2, p5div8); - const nv = Fp2.mul(n, v); - const i = Fp2.mul(Fp2.mul(nv, _2n), v); - const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE)); - assertIsSquare(Fp2, root, n); - return root; -} -function sqrt9mod16(P) { - const Fp_ = Field(P); - const tn = tonelliShanks(P); - const c1 = tn(Fp_, Fp_.neg(Fp_.ONE)); - const c2 = tn(Fp_, c1); - const c3 = tn(Fp_, Fp_.neg(c1)); - const c4 = (P + _7n) / _16n; - return (Fp2, n) => { - let tv1 = Fp2.pow(n, c4); - let tv2 = Fp2.mul(tv1, c1); - const tv3 = Fp2.mul(tv1, c2); - const tv4 = Fp2.mul(tv1, c3); - const e1 = Fp2.eql(Fp2.sqr(tv2), n); - const e2 = Fp2.eql(Fp2.sqr(tv3), n); - tv1 = Fp2.cmov(tv1, tv2, e1); - tv2 = Fp2.cmov(tv4, tv3, e2); - const e3 = Fp2.eql(Fp2.sqr(tv2), n); - const root = Fp2.cmov(tv1, tv2, e3); - assertIsSquare(Fp2, root, n); - return root; - }; -} -function tonelliShanks(P) { - if (P < _3n) - throw new Error("sqrt is not defined for small field"); - let Q = P - _1n2; - let S = 0; - while (Q % _2n === _0n2) { - Q /= _2n; - S++; - } - let Z = _2n; - const _Fp = Field(P); - while (FpLegendre(_Fp, Z) === 1) { - if (Z++ > 1e3) - throw new Error("Cannot find square root: probably non-prime P"); - } - if (S === 1) - return sqrt3mod4; - let cc = _Fp.pow(Z, Q); - const Q1div2 = (Q + _1n2) / _2n; - return function tonelliSlow(Fp2, n) { - if (Fp2.is0(n)) - return n; - if (FpLegendre(Fp2, n) !== 1) - throw new Error("Cannot find square root"); - let M = S; - let c = Fp2.mul(Fp2.ONE, cc); - let t = Fp2.pow(n, Q); - let R = Fp2.pow(n, Q1div2); - while (!Fp2.eql(t, Fp2.ONE)) { - if (Fp2.is0(t)) - return Fp2.ZERO; - let i = 1; - let t_tmp = Fp2.sqr(t); - while (!Fp2.eql(t_tmp, Fp2.ONE)) { - i++; - t_tmp = Fp2.sqr(t_tmp); - if (i === M) - throw new Error("Cannot find square root"); - } - const exponent = _1n2 << BigInt(M - i - 1); - const b = Fp2.pow(c, exponent); - M = i; - c = Fp2.sqr(b); - t = Fp2.mul(t, c); - R = Fp2.mul(R, b); - } - return R; - }; -} -function FpSqrt(P) { - if (P % _4n === _3n) - return sqrt3mod4; - if (P % _8n === _5n) - return sqrt5mod8; - if (P % _16n === _9n) - return sqrt9mod16(P); - return tonelliShanks(P); -} -function validateField(field) { - const initial = { - ORDER: "bigint", - MASK: "bigint", - BYTES: "number", - BITS: "number" - }; - const opts = FIELD_FIELDS.reduce((map, val) => { - map[val] = "function"; - return map; - }, initial); - _validateObject(field, opts); - return field; -} -function FpPow(Fp2, num, power) { - if (power < _0n2) - throw new Error("invalid exponent, negatives unsupported"); - if (power === _0n2) - return Fp2.ONE; - if (power === _1n2) - return num; - let p = Fp2.ONE; - let d = num; - while (power > _0n2) { - if (power & _1n2) - p = Fp2.mul(p, d); - d = Fp2.sqr(d); - power >>= _1n2; - } - return p; -} -function FpInvertBatch(Fp2, nums, passZero = false) { - const inverted = new Array(nums.length).fill(passZero ? Fp2.ZERO : void 0); - const multipliedAcc = nums.reduce((acc, num, i) => { - if (Fp2.is0(num)) - return acc; - inverted[i] = acc; - return Fp2.mul(acc, num); - }, Fp2.ONE); - const invertedAcc = Fp2.inv(multipliedAcc); - nums.reduceRight((acc, num, i) => { - if (Fp2.is0(num)) - return acc; - inverted[i] = Fp2.mul(acc, inverted[i]); - return Fp2.mul(acc, num); - }, invertedAcc); - return inverted; -} -function FpLegendre(Fp2, n) { - const p1mod2 = (Fp2.ORDER - _1n2) / _2n; - const powered = Fp2.pow(n, p1mod2); - const yes = Fp2.eql(powered, Fp2.ONE); - const zero = Fp2.eql(powered, Fp2.ZERO); - const no = Fp2.eql(powered, Fp2.neg(Fp2.ONE)); - if (!yes && !zero && !no) - throw new Error("invalid Legendre symbol result"); - return yes ? 1 : zero ? 0 : -1; -} -function nLength(n, nBitLength) { - if (nBitLength !== void 0) - anumber(nBitLength); - const _nBitLength = nBitLength !== void 0 ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; -} -function Field(ORDER, bitLenOrOpts, isLE2 = false, opts = {}) { - if (ORDER <= _0n2) - throw new Error("invalid field: expected ORDER > 0, got " + ORDER); - let _nbitLength = void 0; - let _sqrt = void 0; - let modFromBytes = false; - let allowedLengths = void 0; - if (typeof bitLenOrOpts === "object" && bitLenOrOpts != null) { - if (opts.sqrt || isLE2) - throw new Error("cannot specify opts in two arguments"); - const _opts = bitLenOrOpts; - if (_opts.BITS) - _nbitLength = _opts.BITS; - if (_opts.sqrt) - _sqrt = _opts.sqrt; - if (typeof _opts.isLE === "boolean") - isLE2 = _opts.isLE; - if (typeof _opts.modFromBytes === "boolean") - modFromBytes = _opts.modFromBytes; - allowedLengths = _opts.allowedLengths; - } else { - if (typeof bitLenOrOpts === "number") - _nbitLength = bitLenOrOpts; - if (opts.sqrt) - _sqrt = opts.sqrt; - } - const { nBitLength: BITS, nByteLength: BYTES } = nLength(ORDER, _nbitLength); - if (BYTES > 2048) - throw new Error("invalid field: expected ORDER of <= 2048 bytes"); - let sqrtP; - const f = Object.freeze({ - ORDER, - isLE: isLE2, - BITS, - BYTES, - MASK: bitMask(BITS), - ZERO: _0n2, - ONE: _1n2, - allowedLengths, - create: (num) => mod(num, ORDER), - isValid: (num) => { - if (typeof num !== "bigint") - throw new Error("invalid field element: expected bigint, got " + typeof num); - return _0n2 <= num && num < ORDER; - }, - is0: (num) => num === _0n2, - // is valid and invertible - isValidNot0: (num) => !f.is0(num) && f.isValid(num), - isOdd: (num) => (num & _1n2) === _1n2, - neg: (num) => mod(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod(num * num, ORDER), - add: (lhs, rhs) => mod(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod(lhs * rhs, ORDER), - pow: (num, power) => FpPow(f, num, power), - div: (lhs, rhs) => mod(lhs * invert(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert(num, ORDER), - sqrt: _sqrt || ((n) => { - if (!sqrtP) - sqrtP = FpSqrt(ORDER); - return sqrtP(f, n); - }), - toBytes: (num) => isLE2 ? numberToBytesLE(num, BYTES) : numberToBytesBE(num, BYTES), - fromBytes: (bytes, skipValidation = true) => { - if (allowedLengths) { - if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) { - throw new Error("Field.fromBytes: expected " + allowedLengths + " bytes, got " + bytes.length); - } - const padded = new Uint8Array(BYTES); - padded.set(bytes, isLE2 ? 0 : padded.length - bytes.length); - bytes = padded; - } - if (bytes.length !== BYTES) - throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length); - let scalar = isLE2 ? bytesToNumberLE(bytes) : bytesToNumberBE(bytes); - if (modFromBytes) - scalar = mod(scalar, ORDER); - if (!skipValidation) { - if (!f.isValid(scalar)) - throw new Error("invalid field element: outside of range 0..ORDER"); - } - return scalar; - }, - // TODO: we don't need it here, move out to separate fn - invertBatch: (lst) => FpInvertBatch(f, lst), - // We can't move this out because Fp6, Fp12 implement it - // and it's unclear what to return in there. - cmov: (a, b, c) => c ? b : a - }); - return Object.freeze(f); -} -function getFieldBytesLength(fieldOrder) { - if (typeof fieldOrder !== "bigint") - throw new Error("field order must be bigint"); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); -} -function getMinHashLength(fieldOrder) { - const length = getFieldBytesLength(fieldOrder); - return length + Math.ceil(length / 2); -} -function mapHashToField(key, fieldOrder, isLE2 = false) { - const len = key.length; - const fieldLen = getFieldBytesLength(fieldOrder); - const minLen = getMinHashLength(fieldOrder); - if (len < 16 || len < minLen || len > 1024) - throw new Error("expected " + minLen + "-1024 bytes of input, got " + len); - const num = isLE2 ? bytesToNumberLE(key) : bytesToNumberBE(key); - const reduced = mod(num, fieldOrder - _1n2) + _1n2; - return isLE2 ? numberToBytesLE(reduced, fieldLen) : numberToBytesBE(reduced, fieldLen); -} -var _0n2, _1n2, _2n, _3n, _4n, _5n, _7n, _8n, _9n, _16n, isNegativeLE, FIELD_FIELDS; -var init_modular = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/modular.js"() { - init_utils2(); - _0n2 = BigInt(0); - _1n2 = BigInt(1); - _2n = /* @__PURE__ */ BigInt(2); - _3n = /* @__PURE__ */ BigInt(3); - _4n = /* @__PURE__ */ BigInt(4); - _5n = /* @__PURE__ */ BigInt(5); - _7n = /* @__PURE__ */ BigInt(7); - _8n = /* @__PURE__ */ BigInt(8); - _9n = /* @__PURE__ */ BigInt(9); - _16n = /* @__PURE__ */ BigInt(16); - isNegativeLE = (num, modulo) => (mod(num, modulo) & _1n2) === _1n2; - FIELD_FIELDS = [ - "create", - "isValid", - "is0", - "neg", - "inv", - "sqrt", - "sqr", - "eql", - "add", - "sub", - "mul", - "pow", - "div", - "addN", - "subN", - "mulN", - "sqrN" - ]; - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/curve.js -function negateCt(condition, item) { - const neg = item.negate(); - return condition ? neg : item; -} -function normalizeZ(c, points) { - const invertedZs = FpInvertBatch(c.Fp, points.map((p) => p.Z)); - return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i]))); -} -function validateW(W, bits) { - if (!Number.isSafeInteger(W) || W <= 0 || W > bits) - throw new Error("invalid window size, expected [1.." + bits + "], got W=" + W); -} -function calcWOpts(W, scalarBits) { - validateW(W, scalarBits); - const windows = Math.ceil(scalarBits / W) + 1; - const windowSize = 2 ** (W - 1); - const maxNumber = 2 ** W; - const mask2 = bitMask(W); - const shiftBy = BigInt(W); - return { windows, windowSize, mask: mask2, maxNumber, shiftBy }; -} -function calcOffsets(n, window2, wOpts) { - const { windowSize, mask: mask2, maxNumber, shiftBy } = wOpts; - let wbits = Number(n & mask2); - let nextN = n >> shiftBy; - if (wbits > windowSize) { - wbits -= maxNumber; - nextN += _1n3; - } - const offsetStart = window2 * windowSize; - const offset2 = offsetStart + Math.abs(wbits) - 1; - const isZero = wbits === 0; - const isNeg = wbits < 0; - const isNegF = window2 % 2 !== 0; - const offsetF = offsetStart; - return { nextN, offset: offset2, isZero, isNeg, isNegF, offsetF }; -} -function validateMSMPoints(points, c) { - if (!Array.isArray(points)) - throw new Error("array expected"); - points.forEach((p, i) => { - if (!(p instanceof c)) - throw new Error("invalid point at index " + i); - }); -} -function validateMSMScalars(scalars, field) { - if (!Array.isArray(scalars)) - throw new Error("array of scalars expected"); - scalars.forEach((s, i) => { - if (!field.isValid(s)) - throw new Error("invalid scalar at index " + i); - }); -} -function getW(P) { - return pointWindowSizes.get(P) || 1; -} -function assert0(n) { - if (n !== _0n3) - throw new Error("invalid wNAF"); -} -function mulEndoUnsafe(Point, point, k1, k2) { - let acc = point; - let p1 = Point.ZERO; - let p2 = Point.ZERO; - while (k1 > _0n3 || k2 > _0n3) { - if (k1 & _1n3) - p1 = p1.add(acc); - if (k2 & _1n3) - p2 = p2.add(acc); - acc = acc.double(); - k1 >>= _1n3; - k2 >>= _1n3; - } - return { p1, p2 }; -} -function pippenger(c, fieldN, points, scalars) { - validateMSMPoints(points, c); - validateMSMScalars(scalars, fieldN); - const plength = points.length; - const slength = scalars.length; - if (plength !== slength) - throw new Error("arrays of points and scalars must have equal length"); - const zero = c.ZERO; - const wbits = bitLen(BigInt(plength)); - let windowSize = 1; - if (wbits > 12) - windowSize = wbits - 3; - else if (wbits > 4) - windowSize = wbits - 2; - else if (wbits > 0) - windowSize = 2; - const MASK = bitMask(windowSize); - const buckets = new Array(Number(MASK) + 1).fill(zero); - const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize; - let sum = zero; - for (let i = lastBits; i >= 0; i -= windowSize) { - buckets.fill(zero); - for (let j = 0; j < slength; j++) { - const scalar = scalars[j]; - const wbits2 = Number(scalar >> BigInt(i) & MASK); - buckets[wbits2] = buckets[wbits2].add(points[j]); - } - let resI = zero; - for (let j = buckets.length - 1, sumI = zero; j > 0; j--) { - sumI = sumI.add(buckets[j]); - resI = resI.add(sumI); - } - sum = sum.add(resI); - if (i !== 0) - for (let j = 0; j < windowSize; j++) - sum = sum.double(); - } - return sum; -} -function createField(order, field, isLE2) { - if (field) { - if (field.ORDER !== order) - throw new Error("Field.ORDER must match order: Fp == p, Fn == n"); - validateField(field); - return field; - } else { - return Field(order, { isLE: isLE2 }); - } -} -function _createCurveFields(type2, CURVE, curveOpts = {}, FpFnLE) { - if (FpFnLE === void 0) - FpFnLE = type2 === "edwards"; - if (!CURVE || typeof CURVE !== "object") - throw new Error(`expected valid ${type2} CURVE object`); - for (const p of ["p", "n", "h"]) { - const val = CURVE[p]; - if (!(typeof val === "bigint" && val > _0n3)) - throw new Error(`CURVE.${p} must be positive bigint`); - } - const Fp2 = createField(CURVE.p, curveOpts.Fp, FpFnLE); - const Fn2 = createField(CURVE.n, curveOpts.Fn, FpFnLE); - const _b = type2 === "weierstrass" ? "b" : "d"; - const params = ["Gx", "Gy", "a", _b]; - for (const p of params) { - if (!Fp2.isValid(CURVE[p])) - throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`); - } - CURVE = Object.freeze(Object.assign({}, CURVE)); - return { CURVE, Fp: Fp2, Fn: Fn2 }; -} -var _0n3, _1n3, pointPrecomputes, pointWindowSizes, wNAF; -var init_curve = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/curve.js"() { - init_utils2(); - init_modular(); - _0n3 = BigInt(0); - _1n3 = BigInt(1); - pointPrecomputes = /* @__PURE__ */ new WeakMap(); - pointWindowSizes = /* @__PURE__ */ new WeakMap(); - wNAF = class { - // Parametrized with a given Point class (not individual point) - constructor(Point, bits) { - this.BASE = Point.BASE; - this.ZERO = Point.ZERO; - this.Fn = Point.Fn; - this.bits = bits; - } - // non-const time multiplication ladder - _unsafeLadder(elm, n, p = this.ZERO) { - let d = elm; - while (n > _0n3) { - if (n & _1n3) - p = p.add(d); - d = d.double(); - n >>= _1n3; - } - return p; - } - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(point, W) { - const { windows, windowSize } = calcWOpts(W, this.bits); - const points = []; - let p = point; - let base = p; - for (let window2 = 0; window2 < windows; window2++) { - base = p; - points.push(base); - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - if (!this.Fn.isValid(n)) - throw new Error("invalid scalar"); - let p = this.ZERO; - let f = this.BASE; - const wo = calcWOpts(W, this.bits); - for (let window2 = 0; window2 < wo.windows; window2++) { - const { nextN, offset: offset2, isZero, isNeg, isNegF, offsetF } = calcOffsets(n, window2, wo); - n = nextN; - if (isZero) { - f = f.add(negateCt(isNegF, precomputes[offsetF])); - } else { - p = p.add(negateCt(isNeg, precomputes[offset2])); - } - } - assert0(n); - return { p, f }; - } - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - wNAFUnsafe(W, precomputes, n, acc = this.ZERO) { - const wo = calcWOpts(W, this.bits); - for (let window2 = 0; window2 < wo.windows; window2++) { - if (n === _0n3) - break; - const { nextN, offset: offset2, isZero, isNeg } = calcOffsets(n, window2, wo); - n = nextN; - if (isZero) { - continue; - } else { - const item = precomputes[offset2]; - acc = acc.add(isNeg ? item.negate() : item); - } - } - assert0(n); - return acc; - } - getPrecomputes(W, point, transform) { - let comp = pointPrecomputes.get(point); - if (!comp) { - comp = this.precomputeWindow(point, W); - if (W !== 1) { - if (typeof transform === "function") - comp = transform(comp); - pointPrecomputes.set(point, comp); - } - } - return comp; - } - cached(point, scalar, transform) { - const W = getW(point); - return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar); - } - unsafe(point, scalar, transform, prev) { - const W = getW(point); - if (W === 1) - return this._unsafeLadder(point, scalar, prev); - return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev); - } - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - createCache(P, W) { - validateW(W, this.bits); - pointWindowSizes.set(P, W); - pointPrecomputes.delete(P); - } - hasCache(elm) { - return getW(elm) !== 1; - } - }; - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/edwards.js -function isEdValidXY(Fp2, CURVE, x, y) { - const x2 = Fp2.sqr(x); - const y2 = Fp2.sqr(y); - const left = Fp2.add(Fp2.mul(CURVE.a, x2), y2); - const right = Fp2.add(Fp2.ONE, Fp2.mul(CURVE.d, Fp2.mul(x2, y2))); - return Fp2.eql(left, right); -} -function edwards(params, extraOpts = {}) { - const validated = _createCurveFields("edwards", params, extraOpts, extraOpts.FpFnLE); - const { Fp: Fp2, Fn: Fn2 } = validated; - let CURVE = validated.CURVE; - const { h: cofactor } = CURVE; - _validateObject(extraOpts, {}, { uvRatio: "function" }); - const MASK = _2n2 << BigInt(Fn2.BYTES * 8) - _1n4; - const modP = (n) => Fp2.create(n); - const uvRatio2 = extraOpts.uvRatio || ((u, v) => { - try { - return { isValid: true, value: Fp2.sqrt(Fp2.div(u, v)) }; - } catch (e) { - return { isValid: false, value: _0n4 }; - } - }); - if (!isEdValidXY(Fp2, CURVE, CURVE.Gx, CURVE.Gy)) - throw new Error("bad curve params: generator point"); - function acoord(title, n, banZero = false) { - const min = banZero ? _1n4 : _0n4; - aInRange("coordinate " + title, n, min, MASK); - return n; - } - function aextpoint(other) { - if (!(other instanceof Point)) - throw new Error("ExtendedPoint expected"); - } - const toAffineMemo = memoized((p, iz) => { - const { X, Y, Z } = p; - const is0 = p.is0(); - if (iz == null) - iz = is0 ? _8n2 : Fp2.inv(Z); - const x = modP(X * iz); - const y = modP(Y * iz); - const zz = Fp2.mul(Z, iz); - if (is0) - return { x: _0n4, y: _1n4 }; - if (zz !== _1n4) - throw new Error("invZ was invalid"); - return { x, y }; - }); - const assertValidMemo = memoized((p) => { - const { a, d } = CURVE; - if (p.is0()) - throw new Error("bad point: ZERO"); - const { X, Y, Z, T } = p; - const X2 = modP(X * X); - const Y2 = modP(Y * Y); - const Z2 = modP(Z * Z); - const Z4 = modP(Z2 * Z2); - const aX2 = modP(X2 * a); - const left = modP(Z2 * modP(aX2 + Y2)); - const right = modP(Z4 + modP(d * modP(X2 * Y2))); - if (left !== right) - throw new Error("bad point: equation left != right (1)"); - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) - throw new Error("bad point: equation left != right (2)"); - return true; - }); - class Point { - constructor(X, Y, Z, T) { - this.X = acoord("x", X); - this.Y = acoord("y", Y); - this.Z = acoord("z", Z, true); - this.T = acoord("t", T); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - static fromAffine(p) { - if (p instanceof Point) - throw new Error("extended point not allowed"); - const { x, y } = p || {}; - acoord("x", x); - acoord("y", y); - return new Point(x, y, _1n4, modP(x * y)); - } - // Uses algo from RFC8032 5.1.3. - static fromBytes(bytes, zip215 = false) { - const len = Fp2.BYTES; - const { a, d } = CURVE; - bytes = copyBytes(_abytes2(bytes, len, "point")); - _abool2(zip215, "zip215"); - const normed = copyBytes(bytes); - const lastByte = bytes[len - 1]; - normed[len - 1] = lastByte & ~128; - const y = bytesToNumberLE(normed); - const max = zip215 ? MASK : Fp2.ORDER; - aInRange("point.y", y, _0n4, max); - const y2 = modP(y * y); - const u = modP(y2 - _1n4); - const v = modP(d * y2 - a); - let { isValid, value: x } = uvRatio2(u, v); - if (!isValid) - throw new Error("bad point: invalid y coordinate"); - const isXOdd = (x & _1n4) === _1n4; - const isLastByteOdd = (lastByte & 128) !== 0; - if (!zip215 && x === _0n4 && isLastByteOdd) - throw new Error("bad point: x=0 and x_0=1"); - if (isLastByteOdd !== isXOdd) - x = modP(-x); - return Point.fromAffine({ x, y }); - } - static fromHex(bytes, zip215 = false) { - return Point.fromBytes(ensureBytes("point", bytes), zip215); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_2n2); - return this; - } - // Useful in fromAffine() - not for fromBytes(), which always created valid points. - assertValidity() { - assertValidMemo(this); - } - // Compare one point to another. - equals(other) { - aextpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - is0() { - return this.equals(Point.ZERO); - } - negate() { - return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T)); - } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a } = CURVE; - const { X: X1, Y: Y1, Z: Z1 } = this; - const A = modP(X1 * X1); - const B = modP(Y1 * Y1); - const C = modP(_2n2 * modP(Z1 * Z1)); - const D = modP(a * A); - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); - const G = D + B; - const F = G - C; - const H = D - B; - const X3 = modP(E * F); - const Y3 = modP(G * H); - const T3 = modP(E * H); - const Z3 = modP(F * G); - return new Point(X3, Y3, Z3, T3); - } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - aextpoint(other); - const { a, d } = CURVE; - const { X: X1, Y: Y1, Z: Z1, T: T1 } = this; - const { X: X2, Y: Y2, Z: Z2, T: T2 } = other; - const A = modP(X1 * X2); - const B = modP(Y1 * Y2); - const C = modP(T1 * d * T2); - const D = modP(Z1 * Z2); - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); - const F = D - C; - const G = D + C; - const H = modP(B - a * A); - const X3 = modP(E * F); - const Y3 = modP(G * H); - const T3 = modP(E * H); - const Z3 = modP(F * G); - return new Point(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - // Constant-time multiplication. - multiply(scalar) { - if (!Fn2.isValidNot0(scalar)) - throw new Error("invalid scalar: expected 1 <= sc < curve.n"); - const { p, f } = wnaf.cached(this, scalar, (p2) => normalizeZ(Point, p2)); - return normalizeZ(Point, [p, f])[0]; - } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - // Accepts optional accumulator to merge with multiply (important for sparse scalars) - multiplyUnsafe(scalar, acc = Point.ZERO) { - if (!Fn2.isValid(scalar)) - throw new Error("invalid scalar: expected 0 <= sc < curve.n"); - if (scalar === _0n4) - return Point.ZERO; - if (this.is0() || scalar === _1n4) - return this; - return wnaf.unsafe(this, scalar, (p) => normalizeZ(Point, p), acc); - } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafe(this, CURVE.n).is0(); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - clearCofactor() { - if (cofactor === _1n4) - return this; - return this.multiplyUnsafe(cofactor); - } - toBytes() { - const { x, y } = this.toAffine(); - const bytes = Fp2.toBytes(y); - bytes[bytes.length - 1] |= x & _1n4 ? 128 : 0; - return bytes; - } - toHex() { - return bytesToHex(this.toBytes()); - } - toString() { - return ``; - } - // TODO: remove - get ex() { - return this.X; - } - get ey() { - return this.Y; - } - get ez() { - return this.Z; - } - get et() { - return this.T; - } - static normalizeZ(points) { - return normalizeZ(Point, points); - } - static msm(points, scalars) { - return pippenger(Point, Fn2, points, scalars); - } - _setWindowSize(windowSize) { - this.precompute(windowSize); - } - toRawBytes() { - return this.toBytes(); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n4, modP(CURVE.Gx * CURVE.Gy)); - Point.ZERO = new Point(_0n4, _1n4, _1n4, _0n4); - Point.Fp = Fp2; - Point.Fn = Fn2; - const wnaf = new wNAF(Point, Fn2.BITS); - Point.BASE.precompute(8); - return Point; -} -function eddsa(Point, cHash, eddsaOpts = {}) { - if (typeof cHash !== "function") - throw new Error('"hash" function param is required'); - _validateObject(eddsaOpts, {}, { - adjustScalarBytes: "function", - randomBytes: "function", - domain: "function", - prehash: "function", - mapToCurve: "function" - }); - const { prehash } = eddsaOpts; - const { BASE, Fp: Fp2, Fn: Fn2 } = Point; - const randomBytes3 = eddsaOpts.randomBytes || randomBytes; - const adjustScalarBytes2 = eddsaOpts.adjustScalarBytes || ((bytes) => bytes); - const domain = eddsaOpts.domain || ((data, ctx, phflag) => { - _abool2(phflag, "phflag"); - if (ctx.length || phflag) - throw new Error("Contexts/pre-hash are not supported"); - return data; - }); - function modN_LE(hash) { - return Fn2.create(bytesToNumberLE(hash)); - } - function getPrivateScalar(key) { - const len = lengths.secretKey; - key = ensureBytes("private key", key, len); - const hashed = ensureBytes("hashed private key", cHash(key), 2 * len); - const head = adjustScalarBytes2(hashed.slice(0, len)); - const prefix = hashed.slice(len, 2 * len); - const scalar = modN_LE(head); - return { head, prefix, scalar }; - } - function getExtendedPublicKey(secretKey) { - const { head, prefix, scalar } = getPrivateScalar(secretKey); - const point = BASE.multiply(scalar); - const pointBytes = point.toBytes(); - return { head, prefix, scalar, point, pointBytes }; - } - function getPublicKey2(secretKey) { - return getExtendedPublicKey(secretKey).pointBytes; - } - function hashDomainToScalar(context = Uint8Array.of(), ...msgs) { - const msg = concatBytes(...msgs); - return modN_LE(cHash(domain(msg, ensureBytes("context", context), !!prehash))); - } - function sign2(msg, secretKey, options = {}) { - msg = ensureBytes("message", msg); - if (prehash) - msg = prehash(msg); - const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey); - const r = hashDomainToScalar(options.context, prefix, msg); - const R = BASE.multiply(r).toBytes(); - const k = hashDomainToScalar(options.context, R, pointBytes, msg); - const s = Fn2.create(r + k * scalar); - if (!Fn2.isValid(s)) - throw new Error("sign failed: invalid s"); - const rs = concatBytes(R, Fn2.toBytes(s)); - return _abytes2(rs, lengths.signature, "result"); - } - const verifyOpts = { zip215: true }; - function verify2(sig, msg, publicKey2, options = verifyOpts) { - const { context, zip215 } = options; - const len = lengths.signature; - sig = ensureBytes("signature", sig, len); - msg = ensureBytes("message", msg); - publicKey2 = ensureBytes("publicKey", publicKey2, lengths.publicKey); - if (zip215 !== void 0) - _abool2(zip215, "zip215"); - if (prehash) - msg = prehash(msg); - const mid = len / 2; - const r = sig.subarray(0, mid); - const s = bytesToNumberLE(sig.subarray(mid, len)); - let A, R, SB; - try { - A = Point.fromBytes(publicKey2, zip215); - R = Point.fromBytes(r, zip215); - SB = BASE.multiplyUnsafe(s); - } catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) - return false; - const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - return RkA.subtract(SB).clearCofactor().is0(); - } - const _size = Fp2.BYTES; - const lengths = { - secretKey: _size, - publicKey: _size, - signature: 2 * _size, - seed: _size - }; - function randomSecretKey(seed = randomBytes3(lengths.seed)) { - return _abytes2(seed, lengths.seed, "seed"); - } - function keygen(seed) { - const secretKey = utils.randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey2(secretKey) }; - } - function isValidSecretKey(key) { - return isBytes(key) && key.length === Fn2.BYTES; - } - function isValidPublicKey2(key, zip215) { - try { - return !!Point.fromBytes(key, zip215); - } catch (error) { - return false; - } - } - const utils = { - getExtendedPublicKey, - randomSecretKey, - isValidSecretKey, - isValidPublicKey: isValidPublicKey2, - /** - * Converts ed public key to x public key. Uses formula: - * - ed25519: - * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * - ed448: - * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - */ - toMontgomery(publicKey2) { - const { y } = Point.fromBytes(publicKey2); - const size = lengths.publicKey; - const is25519 = size === 32; - if (!is25519 && size !== 57) - throw new Error("only defined for 25519 and 448"); - const u = is25519 ? Fp2.div(_1n4 + y, _1n4 - y) : Fp2.div(y - _1n4, y + _1n4); - return Fp2.toBytes(u); - }, - toMontgomerySecret(secretKey) { - const size = lengths.secretKey; - _abytes2(secretKey, size); - const hashed = cHash(secretKey.subarray(0, size)); - return adjustScalarBytes2(hashed).subarray(0, size); - }, - /** @deprecated */ - randomPrivateKey: randomSecretKey, - /** @deprecated */ - precompute(windowSize = 8, point = Point.BASE) { - return point.precompute(windowSize, false); - } - }; - return Object.freeze({ - keygen, - getPublicKey: getPublicKey2, - sign: sign2, - verify: verify2, - utils, - Point, - lengths - }); -} -function _eddsa_legacy_opts_to_new(c) { - const CURVE = { - a: c.a, - d: c.d, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy - }; - const Fp2 = c.Fp; - const Fn2 = Field(CURVE.n, c.nBitLength, true); - const curveOpts = { Fp: Fp2, Fn: Fn2, uvRatio: c.uvRatio }; - const eddsaOpts = { - randomBytes: c.randomBytes, - adjustScalarBytes: c.adjustScalarBytes, - domain: c.domain, - prehash: c.prehash, - mapToCurve: c.mapToCurve - }; - return { CURVE, curveOpts, hash: c.hash, eddsaOpts }; -} -function _eddsa_new_output_to_legacy(c, eddsa2) { - const Point = eddsa2.Point; - const legacy = Object.assign({}, eddsa2, { - ExtendedPoint: Point, - CURVE: c, - nBitLength: Point.Fn.BITS, - nByteLength: Point.Fn.BYTES - }); - return legacy; -} -function twistedEdwards(c) { - const { CURVE, curveOpts, hash, eddsaOpts } = _eddsa_legacy_opts_to_new(c); - const Point = edwards(CURVE, curveOpts); - const EDDSA = eddsa(Point, hash, eddsaOpts); - return _eddsa_new_output_to_legacy(c, EDDSA); -} -var _0n4, _1n4, _2n2, _8n2, PrimeEdwardsPoint; -var init_edwards = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/edwards.js"() { - init_utils2(); - init_curve(); - init_modular(); - _0n4 = BigInt(0); - _1n4 = BigInt(1); - _2n2 = BigInt(2); - _8n2 = BigInt(8); - PrimeEdwardsPoint = class { - constructor(ep) { - this.ep = ep; - } - // Static methods that must be implemented by subclasses - static fromBytes(_bytes) { - notImplemented(); - } - static fromHex(_hex) { - notImplemented(); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - // Common implementations - clearCofactor() { - return this; - } - assertValidity() { - this.ep.assertValidity(); - } - toAffine(invertedZ) { - return this.ep.toAffine(invertedZ); - } - toHex() { - return bytesToHex(this.toBytes()); - } - toString() { - return this.toHex(); - } - isTorsionFree() { - return true; - } - isSmallOrder() { - return false; - } - add(other) { - this.assertSame(other); - return this.init(this.ep.add(other.ep)); - } - subtract(other) { - this.assertSame(other); - return this.init(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return this.init(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return this.init(this.ep.multiplyUnsafe(scalar)); - } - double() { - return this.init(this.ep.double()); - } - negate() { - return this.init(this.ep.negate()); - } - precompute(windowSize, isLazy) { - return this.init(this.ep.precompute(windowSize, isLazy)); - } - /** @deprecated use `toBytes` */ - toRawBytes() { - return this.toBytes(); - } - }; - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/ed25519.js -function ed25519_pow_2_252_3(x) { - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P = ed25519_CURVE_p; - const x2 = x * x % P; - const b2 = x2 * x % P; - const b4 = pow2(b2, _2n3, P) * b2 % P; - const b5 = pow2(b4, _1n5, P) * x % P; - const b10 = pow2(b5, _5n2, P) * b5 % P; - const b20 = pow2(b10, _10n, P) * b10 % P; - const b40 = pow2(b20, _20n, P) * b20 % P; - const b80 = pow2(b40, _40n, P) * b40 % P; - const b160 = pow2(b80, _80n, P) * b80 % P; - const b240 = pow2(b160, _80n, P) * b80 % P; - const b250 = pow2(b240, _10n, P) * b10 % P; - const pow_p_5_8 = pow2(b250, _2n3, P) * x % P; - return { pow_p_5_8, b2 }; -} -function adjustScalarBytes(bytes) { - bytes[0] &= 248; - bytes[31] &= 127; - bytes[31] |= 64; - return bytes; -} -function uvRatio(u, v) { - const P = ed25519_CURVE_p; - const v32 = mod(v * v * v, P); - const v7 = mod(v32 * v32 * v, P); - const pow = ed25519_pow_2_252_3(u * v7).pow_p_5_8; - let x = mod(u * v32 * pow, P); - const vx2 = mod(v * x * x, P); - const root1 = x; - const root2 = mod(x * ED25519_SQRT_M1, P); - const useRoot1 = vx2 === u; - const useRoot2 = vx2 === mod(-u, P); - const noRoot = vx2 === mod(-u * ED25519_SQRT_M1, P); - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; - if (isNegativeLE(x, P)) - x = mod(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; -} -function calcElligatorRistrettoMap(r0) { - const { d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod2 = (n) => Fp.create(n); - const r = mod2(SQRT_M1 * r0 * r0); - const Ns = mod2((r + _1n5) * ONE_MINUS_D_SQ); - let c = BigInt(-1); - const D = mod2((c - d * r) * mod2(r + d)); - let { isValid: Ns_D_is_sq, value: s } = uvRatio(Ns, D); - let s_ = mod2(s * r0); - if (!isNegativeLE(s_, P)) - s_ = mod2(-s_); - if (!Ns_D_is_sq) - s = s_; - if (!Ns_D_is_sq) - c = r; - const Nt = mod2(c * (r - _1n5) * D_MINUS_ONE_SQ - D); - const s2 = s * s; - const W0 = mod2((s + s) * D); - const W1 = mod2(Nt * SQRT_AD_MINUS_ONE); - const W2 = mod2(_1n5 - s2); - const W3 = mod2(_1n5 + s2); - return new ed25519.Point(mod2(W0 * W3), mod2(W2 * W1), mod2(W1 * W3), mod2(W0 * W2)); -} -function ristretto255_map(bytes) { - abytes(bytes, 64); - const r1 = bytes255ToNumberLE(bytes.subarray(0, 32)); - const R1 = calcElligatorRistrettoMap(r1); - const r2 = bytes255ToNumberLE(bytes.subarray(32, 64)); - const R2 = calcElligatorRistrettoMap(r2); - return new _RistrettoPoint(R1.add(R2)); -} -var _0n5, _1n5, _2n3, _3n2, _5n2, _8n3, ed25519_CURVE_p, ed25519_CURVE, ED25519_SQRT_M1, Fp, Fn, ed25519Defaults, ed25519, SQRT_M1, SQRT_AD_MINUS_ONE, INVSQRT_A_MINUS_D, ONE_MINUS_D_SQ, D_MINUS_ONE_SQ, invertSqrt, MAX_255B, bytes255ToNumberLE, _RistrettoPoint; -var init_ed25519 = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/ed25519.js"() { - init_sha2(); - init_utils(); - init_curve(); - init_edwards(); - init_modular(); - init_utils2(); - _0n5 = /* @__PURE__ */ BigInt(0); - _1n5 = BigInt(1); - _2n3 = BigInt(2); - _3n2 = BigInt(3); - _5n2 = BigInt(5); - _8n3 = BigInt(8); - ed25519_CURVE_p = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"); - ed25519_CURVE = /* @__PURE__ */ (() => ({ - p: ed25519_CURVE_p, - n: BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"), - h: _8n3, - a: BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"), - d: BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"), - Gx: BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"), - Gy: BigInt("0x6666666666666666666666666666666666666666666666666666666666666658") - }))(); - ED25519_SQRT_M1 = /* @__PURE__ */ BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"); - Fp = /* @__PURE__ */ (() => Field(ed25519_CURVE.p, { isLE: true }))(); - Fn = /* @__PURE__ */ (() => Field(ed25519_CURVE.n, { isLE: true }))(); - ed25519Defaults = /* @__PURE__ */ (() => ({ - ...ed25519_CURVE, - Fp, - hash: sha512, - adjustScalarBytes, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio - }))(); - ed25519 = /* @__PURE__ */ (() => twistedEdwards(ed25519Defaults))(); - SQRT_M1 = ED25519_SQRT_M1; - SQRT_AD_MINUS_ONE = /* @__PURE__ */ BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"); - INVSQRT_A_MINUS_D = /* @__PURE__ */ BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"); - ONE_MINUS_D_SQ = /* @__PURE__ */ BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"); - D_MINUS_ONE_SQ = /* @__PURE__ */ BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"); - invertSqrt = (number2) => uvRatio(_1n5, number2); - MAX_255B = /* @__PURE__ */ BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - bytes255ToNumberLE = (bytes) => ed25519.Point.Fp.create(bytesToNumberLE(bytes) & MAX_255B); - _RistrettoPoint = class __RistrettoPoint extends PrimeEdwardsPoint { - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new __RistrettoPoint(ed25519.Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof __RistrettoPoint)) - throw new Error("RistrettoPoint expected"); - } - init(ep) { - return new __RistrettoPoint(ep); - } - /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ - static hashToCurve(hex) { - return ristretto255_map(ensureBytes("ristrettoHash", hex, 64)); - } - static fromBytes(bytes) { - abytes(bytes, 32); - const { a, d } = ed25519_CURVE; - const P = ed25519_CURVE_p; - const mod2 = (n) => Fp.create(n); - const s = bytes255ToNumberLE(bytes); - if (!equalBytes(Fp.toBytes(s), bytes) || isNegativeLE(s, P)) - throw new Error("invalid ristretto255 encoding 1"); - const s2 = mod2(s * s); - const u1 = mod2(_1n5 + a * s2); - const u2 = mod2(_1n5 - a * s2); - const u1_2 = mod2(u1 * u1); - const u2_2 = mod2(u2 * u2); - const v = mod2(a * d * u1_2 - u2_2); - const { isValid, value: I } = invertSqrt(mod2(v * u2_2)); - const Dx = mod2(I * u2); - const Dy = mod2(I * Dx * v); - let x = mod2((s + s) * Dx); - if (isNegativeLE(x, P)) - x = mod2(-x); - const y = mod2(u1 * Dy); - const t = mod2(x * y); - if (!isValid || isNegativeLE(t, P) || y === _0n5) - throw new Error("invalid ristretto255 encoding 2"); - return new __RistrettoPoint(new ed25519.Point(x, y, _1n5, t)); - } - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex) { - return __RistrettoPoint.fromBytes(ensureBytes("ristrettoHex", hex, 32)); - } - static msm(points, scalars) { - return pippenger(__RistrettoPoint, ed25519.Point.Fn, points, scalars); - } - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes() { - let { X, Y, Z, T } = this.ep; - const P = ed25519_CURVE_p; - const mod2 = (n) => Fp.create(n); - const u1 = mod2(mod2(Z + Y) * mod2(Z - Y)); - const u2 = mod2(X * Y); - const u2sq = mod2(u2 * u2); - const { value: invsqrt } = invertSqrt(mod2(u1 * u2sq)); - const D1 = mod2(invsqrt * u1); - const D2 = mod2(invsqrt * u2); - const zInv = mod2(D1 * D2 * T); - let D; - if (isNegativeLE(T * zInv, P)) { - let _x = mod2(Y * SQRT_M1); - let _y = mod2(X * SQRT_M1); - X = _x; - Y = _y; - D = mod2(D1 * INVSQRT_A_MINUS_D); - } else { - D = D2; - } - if (isNegativeLE(X * zInv, P)) - Y = mod2(-Y); - let s = mod2((Z - Y) * D); - if (isNegativeLE(s, P)) - s = mod2(-s); - return Fp.toBytes(s); - } - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - const mod2 = (n) => Fp.create(n); - const one = mod2(X1 * Y2) === mod2(Y1 * X2); - const two = mod2(Y1 * Y2) === mod2(X1 * X2); - return one || two; - } - is0() { - return this.equals(__RistrettoPoint.ZERO); - } - }; - _RistrettoPoint.BASE = /* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.BASE))(); - _RistrettoPoint.ZERO = /* @__PURE__ */ (() => new _RistrettoPoint(ed25519.Point.ZERO))(); - _RistrettoPoint.Fp = /* @__PURE__ */ (() => Fp)(); - _RistrettoPoint.Fn = /* @__PURE__ */ (() => Fn)(); - } -}); - -// ../../node_modules/.pnpm/bn.js@5.2.3/node_modules/bn.js/lib/bn.js -var require_bn = __commonJS({ - "../../node_modules/.pnpm/bn.js@5.2.3/node_modules/bn.js/lib/bn.js"(exports2, module2) { - (function(module3, exports3) { - "use strict"; - function assert3(val, msg) { - if (!val) - throw new Error(msg || "Assertion failed"); - } - function inherits(ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - function BN2(number2, base, endian) { - if (BN2.isBN(number2)) { - return number2; - } - this.negative = 0; - this.words = null; - this.length = 0; - this.red = null; - if (number2 !== null) { - if (base === "le" || base === "be") { - endian = base; - base = 10; - } - this._init(number2 || 0, base || 10, endian || "be"); - } - } - if (typeof module3 === "object") { - module3.exports = BN2; - } else { - exports3.BN = BN2; - } - BN2.BN = BN2; - BN2.wordSize = 26; - var Buffer3; - try { - if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") { - Buffer3 = window.Buffer; - } else { - Buffer3 = require("buffer").Buffer; - } - } catch (e) { - } - BN2.isBN = function isBN(num) { - if (num instanceof BN2) { - return true; - } - return num !== null && typeof num === "object" && num.constructor.wordSize === BN2.wordSize && Array.isArray(num.words); - }; - BN2.max = function max(left, right) { - if (left.cmp(right) > 0) - return left; - return right; - }; - BN2.min = function min(left, right) { - if (left.cmp(right) < 0) - return left; - return right; - }; - BN2.prototype._init = function init(number2, base, endian) { - if (typeof number2 === "number") { - return this._initNumber(number2, base, endian); - } - if (typeof number2 === "object") { - return this._initArray(number2, base, endian); - } - if (base === "hex") { - base = 16; - } - assert3(base === (base | 0) && base >= 2 && base <= 36); - number2 = number2.toString().replace(/\s+/g, ""); - var start = 0; - if (number2[0] === "-") { - start++; - this.negative = 1; - } - if (start < number2.length) { - if (base === 16) { - this._parseHex(number2, start, endian); - } else { - this._parseBase(number2, base, start); - if (endian === "le") { - this._initArray(this.toArray(), base, endian); - } - } - } - }; - BN2.prototype._initNumber = function _initNumber(number2, base, endian) { - if (number2 < 0) { - this.negative = 1; - number2 = -number2; - } - if (number2 < 67108864) { - this.words = [number2 & 67108863]; - this.length = 1; - } else if (number2 < 4503599627370496) { - this.words = [ - number2 & 67108863, - number2 / 67108864 & 67108863 - ]; - this.length = 2; - } else { - assert3(number2 < 9007199254740992); - this.words = [ - number2 & 67108863, - number2 / 67108864 & 67108863, - 1 - ]; - this.length = 3; - } - if (endian !== "le") - return; - this._initArray(this.toArray(), base, endian); - }; - BN2.prototype._initArray = function _initArray(number2, base, endian) { - assert3(typeof number2.length === "number"); - if (number2.length <= 0) { - this.words = [0]; - this.length = 1; - return this; - } - this.length = Math.ceil(number2.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - var j, w; - var off = 0; - if (endian === "be") { - for (i = number2.length - 1, j = 0; i >= 0; i -= 3) { - w = number2[i] | number2[i - 1] << 8 | number2[i - 2] << 16; - this.words[j] |= w << off & 67108863; - this.words[j + 1] = w >>> 26 - off & 67108863; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === "le") { - for (i = 0, j = 0; i < number2.length; i += 3) { - w = number2[i] | number2[i + 1] << 8 | number2[i + 2] << 16; - this.words[j] |= w << off & 67108863; - this.words[j + 1] = w >>> 26 - off & 67108863; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this._strip(); - }; - function parseHex4Bits(string2, index) { - var c = string2.charCodeAt(index); - if (c >= 48 && c <= 57) { - return c - 48; - } else if (c >= 65 && c <= 70) { - return c - 55; - } else if (c >= 97 && c <= 102) { - return c - 87; - } else { - assert3(false, "Invalid character in " + string2); - } - } - function parseHexByte(string2, lowerBound, index) { - var r = parseHex4Bits(string2, index); - if (index - 1 >= lowerBound) { - r |= parseHex4Bits(string2, index - 1) << 4; - } - return r; - } - BN2.prototype._parseHex = function _parseHex(number2, start, endian) { - this.length = Math.ceil((number2.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - var off = 0; - var j = 0; - var w; - if (endian === "be") { - for (i = number2.length - 1; i >= start; i -= 2) { - w = parseHexByte(number2, start, i) << off; - this.words[j] |= w & 67108863; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } else { - var parseLength = number2.length - start; - for (i = parseLength % 2 === 0 ? start + 1 : start; i < number2.length; i += 2) { - w = parseHexByte(number2, start, i) << off; - this.words[j] |= w & 67108863; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } - this._strip(); - }; - function parseBase(str, start, end, mul) { - var r = 0; - var b = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - r *= mul; - if (c >= 49) { - b = c - 49 + 10; - } else if (c >= 17) { - b = c - 17 + 10; - } else { - b = c; - } - assert3(c >= 0 && b < mul, "Invalid character"); - r += b; - } - return r; - } - BN2.prototype._parseBase = function _parseBase(number2, base, start) { - this.words = [0]; - this.length = 1; - for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = limbPow / base | 0; - var total = number2.length - start; - var mod2 = total % limbLen; - var end = Math.min(total, total - mod2) + start; - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number2, i, i + limbLen, base); - this.imuln(limbPow); - if (this.words[0] + word < 67108864) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - if (mod2 !== 0) { - var pow = 1; - word = parseBase(number2, i, number2.length, base); - for (i = 0; i < mod2; i++) { - pow *= base; - } - this.imuln(pow); - if (this.words[0] + word < 67108864) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - this._strip(); - }; - BN2.prototype.copy = function copy(dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - function move(dest, src) { - dest.words = src.words; - dest.length = src.length; - dest.negative = src.negative; - dest.red = src.red; - } - BN2.prototype._move = function _move(dest) { - move(dest, this); - }; - BN2.prototype.clone = function clone2() { - var r = new BN2(null); - this.copy(r); - return r; - }; - BN2.prototype._expand = function _expand(size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - BN2.prototype._strip = function strip() { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - BN2.prototype._normSign = function _normSign() { - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") { - try { - BN2.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect; - } catch (e) { - BN2.prototype.inspect = inspect; - } - } else { - BN2.prototype.inspect = inspect; - } - function inspect() { - return (this.red ? ""; - } - var zeros = [ - "", - "0", - "00", - "000", - "0000", - "00000", - "000000", - "0000000", - "00000000", - "000000000", - "0000000000", - "00000000000", - "000000000000", - "0000000000000", - "00000000000000", - "000000000000000", - "0000000000000000", - "00000000000000000", - "000000000000000000", - "0000000000000000000", - "00000000000000000000", - "000000000000000000000", - "0000000000000000000000", - "00000000000000000000000", - "000000000000000000000000", - "0000000000000000000000000" - ]; - var groupSizes = [ - 0, - 0, - 25, - 16, - 12, - 11, - 10, - 9, - 8, - 8, - 7, - 7, - 7, - 7, - 6, - 6, - 6, - 6, - 6, - 6, - 6, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5 - ]; - var groupBases = [ - 0, - 0, - 33554432, - 43046721, - 16777216, - 48828125, - 60466176, - 40353607, - 16777216, - 43046721, - 1e7, - 19487171, - 35831808, - 62748517, - 7529536, - 11390625, - 16777216, - 24137569, - 34012224, - 47045881, - 64e6, - 4084101, - 5153632, - 6436343, - 7962624, - 9765625, - 11881376, - 14348907, - 17210368, - 20511149, - 243e5, - 28629151, - 33554432, - 39135393, - 45435424, - 52521875, - 60466176 - ]; - BN2.prototype.toString = function toString(base, padding) { - base = base || 10; - padding = padding | 0 || 1; - var out; - if (base === 16 || base === "hex") { - out = ""; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = ((w << off | carry) & 16777215).toString(16); - carry = w >>> 24 - off & 16777215; - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = "0" + out; - } - if (this.negative !== 0) { - out = "-" + out; - } - return out; - } - if (base === (base | 0) && base >= 2 && base <= 36) { - var groupSize = groupSizes[base]; - var groupBase = groupBases[base]; - out = ""; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modrn(groupBase).toString(base); - c = c.idivn(groupBase); - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = "0" + out; - } - while (out.length % padding !== 0) { - out = "0" + out; - } - if (this.negative !== 0) { - out = "-" + out; - } - return out; - } - assert3(false, "Base should be between 2 and 36"); - }; - BN2.prototype.toNumber = function toNumber() { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 67108864; - } else if (this.length === 3 && this.words[2] === 1) { - ret += 4503599627370496 + this.words[1] * 67108864; - } else if (this.length > 2) { - assert3(false, "Number can only safely store up to 53 bits"); - } - return this.negative !== 0 ? -ret : ret; - }; - BN2.prototype.toJSON = function toJSON() { - return this.toString(16, 2); - }; - if (Buffer3) { - BN2.prototype.toBuffer = function toBuffer2(endian, length) { - return this.toArrayLike(Buffer3, endian, length); - }; - } - BN2.prototype.toArray = function toArray(endian, length) { - return this.toArrayLike(Array, endian, length); - }; - var allocate = function allocate2(ArrayType, size) { - if (ArrayType.allocUnsafe) { - return ArrayType.allocUnsafe(size); - } - return new ArrayType(size); - }; - BN2.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) { - this._strip(); - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert3(byteLength <= reqLength, "byte array longer than desired length"); - assert3(reqLength > 0, "Requested array length <= 0"); - var res = allocate(ArrayType, reqLength); - var postfix = endian === "le" ? "LE" : "BE"; - this["_toArrayLike" + postfix](res, byteLength); - return res; - }; - BN2.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) { - var position = 0; - var carry = 0; - for (var i = 0, shift = 0; i < this.length; i++) { - var word = this.words[i] << shift | carry; - res[position++] = word & 255; - if (position < res.length) { - res[position++] = word >> 8 & 255; - } - if (position < res.length) { - res[position++] = word >> 16 & 255; - } - if (shift === 6) { - if (position < res.length) { - res[position++] = word >> 24 & 255; - } - carry = 0; - shift = 0; - } else { - carry = word >>> 24; - shift += 2; - } - } - if (position < res.length) { - res[position++] = carry; - while (position < res.length) { - res[position++] = 0; - } - } - }; - BN2.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) { - var position = res.length - 1; - var carry = 0; - for (var i = 0, shift = 0; i < this.length; i++) { - var word = this.words[i] << shift | carry; - res[position--] = word & 255; - if (position >= 0) { - res[position--] = word >> 8 & 255; - } - if (position >= 0) { - res[position--] = word >> 16 & 255; - } - if (shift === 6) { - if (position >= 0) { - res[position--] = word >> 24 & 255; - } - carry = 0; - shift = 0; - } else { - carry = word >>> 24; - shift += 2; - } - } - if (position >= 0) { - res[position--] = carry; - while (position >= 0) { - res[position--] = 0; - } - } - }; - if (Math.clz32) { - BN2.prototype._countBits = function _countBits(w) { - return 32 - Math.clz32(w); - }; - } else { - BN2.prototype._countBits = function _countBits(w) { - var t = w; - var r = 0; - if (t >= 4096) { - r += 13; - t >>>= 13; - } - if (t >= 64) { - r += 7; - t >>>= 7; - } - if (t >= 8) { - r += 4; - t >>>= 4; - } - if (t >= 2) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - BN2.prototype._zeroBits = function _zeroBits(w) { - if (w === 0) - return 26; - var t = w; - var r = 0; - if ((t & 8191) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 127) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 15) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 1) === 0) { - r++; - } - return r; - }; - BN2.prototype.bitLength = function bitLength() { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - function toBitArray(num) { - var w = new Array(num.bitLength()); - for (var bit = 0; bit < w.length; bit++) { - var off = bit / 26 | 0; - var wbit = bit % 26; - w[bit] = num.words[off] >>> wbit & 1; - } - return w; - } - BN2.prototype.zeroBits = function zeroBits() { - if (this.isZero()) - return 0; - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) - break; - } - return r; - }; - BN2.prototype.byteLength = function byteLength() { - return Math.ceil(this.bitLength() / 8); - }; - BN2.prototype.toTwos = function toTwos(width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - BN2.prototype.fromTwos = function fromTwos(width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - BN2.prototype.isNeg = function isNeg() { - return this.negative !== 0; - }; - BN2.prototype.neg = function neg() { - return this.clone().ineg(); - }; - BN2.prototype.ineg = function ineg() { - if (!this.isZero()) { - this.negative ^= 1; - } - return this; - }; - BN2.prototype.iuor = function iuor(num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - return this._strip(); - }; - BN2.prototype.ior = function ior(num) { - assert3((this.negative | num.negative) === 0); - return this.iuor(num); - }; - BN2.prototype.or = function or(num) { - if (this.length > num.length) - return this.clone().ior(num); - return num.clone().ior(this); - }; - BN2.prototype.uor = function uor(num) { - if (this.length > num.length) - return this.clone().iuor(num); - return num.clone().iuor(this); - }; - BN2.prototype.iuand = function iuand(num) { - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - this.length = b.length; - return this._strip(); - }; - BN2.prototype.iand = function iand(num) { - assert3((this.negative | num.negative) === 0); - return this.iuand(num); - }; - BN2.prototype.and = function and(num) { - if (this.length > num.length) - return this.clone().iand(num); - return num.clone().iand(this); - }; - BN2.prototype.uand = function uand(num) { - if (this.length > num.length) - return this.clone().iuand(num); - return num.clone().iuand(this); - }; - BN2.prototype.iuxor = function iuxor(num) { - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - this.length = a.length; - return this._strip(); - }; - BN2.prototype.ixor = function ixor(num) { - assert3((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - BN2.prototype.xor = function xor(num) { - if (this.length > num.length) - return this.clone().ixor(num); - return num.clone().ixor(this); - }; - BN2.prototype.uxor = function uxor(num) { - if (this.length > num.length) - return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - BN2.prototype.inotn = function inotn(width) { - assert3(typeof width === "number" && width >= 0); - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - this._expand(bytesNeeded); - if (bitsLeft > 0) { - bytesNeeded--; - } - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 67108863; - } - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft; - } - return this._strip(); - }; - BN2.prototype.notn = function notn(width) { - return this.clone().inotn(width); - }; - BN2.prototype.setn = function setn(bit, val) { - assert3(typeof bit === "number" && bit >= 0); - var off = bit / 26 | 0; - var wbit = bit % 26; - this._expand(off + 1); - if (val) { - this.words[off] = this.words[off] | 1 << wbit; - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - return this._strip(); - }; - BN2.prototype.iadd = function iadd(num) { - var r; - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 67108863; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 67108863; - carry = r >>> 26; - } - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - return this; - }; - BN2.prototype.add = function add2(num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - if (this.length > num.length) - return this.clone().iadd(num); - return num.clone().iadd(this); - }; - BN2.prototype.isub = function isub(num) { - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - var cmp = this.cmp(num); - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 67108863; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 67108863; - } - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - this.length = Math.max(this.length, i); - if (a !== this) { - this.negative = 1; - } - return this._strip(); - }; - BN2.prototype.sub = function sub(num) { - return this.clone().isub(num); - }; - function smallMulTo(self2, num, out) { - out.negative = num.negative ^ self2.negative; - var len = self2.length + num.length | 0; - out.length = len; - len = len - 1 | 0; - var a = self2.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - var lo = r & 67108863; - var carry = r / 67108864 | 0; - out.words[0] = lo; - for (var k = 1; k < len; k++) { - var ncarry = carry >>> 26; - var rword = carry & 67108863; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) { - var i = k - j | 0; - a = self2.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += r / 67108864 | 0; - rword = r & 67108863; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - return out._strip(); - } - var comb10MulTo = function comb10MulTo2(self2, num, out) { - var a = self2.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 8191; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 8191; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 8191; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 8191; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 8191; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 8191; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 8191; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 8191; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 8191; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 8191; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 8191; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 8191; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 8191; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 8191; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 8191; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 8191; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 8191; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 8191; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 8191; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 8191; - var bh9 = b9 >>> 13; - out.negative = self2.negative ^ num.negative; - out.length = 19; - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = mid + Math.imul(ah0, bl0) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0; - w0 &= 67108863; - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = mid + Math.imul(ah1, bl0) | 0; - hi = Math.imul(ah1, bh0); - lo = lo + Math.imul(al0, bl1) | 0; - mid = mid + Math.imul(al0, bh1) | 0; - mid = mid + Math.imul(ah0, bl1) | 0; - hi = hi + Math.imul(ah0, bh1) | 0; - var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0; - w1 &= 67108863; - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = mid + Math.imul(ah2, bl0) | 0; - hi = Math.imul(ah2, bh0); - lo = lo + Math.imul(al1, bl1) | 0; - mid = mid + Math.imul(al1, bh1) | 0; - mid = mid + Math.imul(ah1, bl1) | 0; - hi = hi + Math.imul(ah1, bh1) | 0; - lo = lo + Math.imul(al0, bl2) | 0; - mid = mid + Math.imul(al0, bh2) | 0; - mid = mid + Math.imul(ah0, bl2) | 0; - hi = hi + Math.imul(ah0, bh2) | 0; - var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0; - w2 &= 67108863; - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = mid + Math.imul(ah3, bl0) | 0; - hi = Math.imul(ah3, bh0); - lo = lo + Math.imul(al2, bl1) | 0; - mid = mid + Math.imul(al2, bh1) | 0; - mid = mid + Math.imul(ah2, bl1) | 0; - hi = hi + Math.imul(ah2, bh1) | 0; - lo = lo + Math.imul(al1, bl2) | 0; - mid = mid + Math.imul(al1, bh2) | 0; - mid = mid + Math.imul(ah1, bl2) | 0; - hi = hi + Math.imul(ah1, bh2) | 0; - lo = lo + Math.imul(al0, bl3) | 0; - mid = mid + Math.imul(al0, bh3) | 0; - mid = mid + Math.imul(ah0, bl3) | 0; - hi = hi + Math.imul(ah0, bh3) | 0; - var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0; - w3 &= 67108863; - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = mid + Math.imul(ah4, bl0) | 0; - hi = Math.imul(ah4, bh0); - lo = lo + Math.imul(al3, bl1) | 0; - mid = mid + Math.imul(al3, bh1) | 0; - mid = mid + Math.imul(ah3, bl1) | 0; - hi = hi + Math.imul(ah3, bh1) | 0; - lo = lo + Math.imul(al2, bl2) | 0; - mid = mid + Math.imul(al2, bh2) | 0; - mid = mid + Math.imul(ah2, bl2) | 0; - hi = hi + Math.imul(ah2, bh2) | 0; - lo = lo + Math.imul(al1, bl3) | 0; - mid = mid + Math.imul(al1, bh3) | 0; - mid = mid + Math.imul(ah1, bl3) | 0; - hi = hi + Math.imul(ah1, bh3) | 0; - lo = lo + Math.imul(al0, bl4) | 0; - mid = mid + Math.imul(al0, bh4) | 0; - mid = mid + Math.imul(ah0, bl4) | 0; - hi = hi + Math.imul(ah0, bh4) | 0; - var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0; - w4 &= 67108863; - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = mid + Math.imul(ah5, bl0) | 0; - hi = Math.imul(ah5, bh0); - lo = lo + Math.imul(al4, bl1) | 0; - mid = mid + Math.imul(al4, bh1) | 0; - mid = mid + Math.imul(ah4, bl1) | 0; - hi = hi + Math.imul(ah4, bh1) | 0; - lo = lo + Math.imul(al3, bl2) | 0; - mid = mid + Math.imul(al3, bh2) | 0; - mid = mid + Math.imul(ah3, bl2) | 0; - hi = hi + Math.imul(ah3, bh2) | 0; - lo = lo + Math.imul(al2, bl3) | 0; - mid = mid + Math.imul(al2, bh3) | 0; - mid = mid + Math.imul(ah2, bl3) | 0; - hi = hi + Math.imul(ah2, bh3) | 0; - lo = lo + Math.imul(al1, bl4) | 0; - mid = mid + Math.imul(al1, bh4) | 0; - mid = mid + Math.imul(ah1, bl4) | 0; - hi = hi + Math.imul(ah1, bh4) | 0; - lo = lo + Math.imul(al0, bl5) | 0; - mid = mid + Math.imul(al0, bh5) | 0; - mid = mid + Math.imul(ah0, bl5) | 0; - hi = hi + Math.imul(ah0, bh5) | 0; - var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0; - w5 &= 67108863; - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = mid + Math.imul(ah6, bl0) | 0; - hi = Math.imul(ah6, bh0); - lo = lo + Math.imul(al5, bl1) | 0; - mid = mid + Math.imul(al5, bh1) | 0; - mid = mid + Math.imul(ah5, bl1) | 0; - hi = hi + Math.imul(ah5, bh1) | 0; - lo = lo + Math.imul(al4, bl2) | 0; - mid = mid + Math.imul(al4, bh2) | 0; - mid = mid + Math.imul(ah4, bl2) | 0; - hi = hi + Math.imul(ah4, bh2) | 0; - lo = lo + Math.imul(al3, bl3) | 0; - mid = mid + Math.imul(al3, bh3) | 0; - mid = mid + Math.imul(ah3, bl3) | 0; - hi = hi + Math.imul(ah3, bh3) | 0; - lo = lo + Math.imul(al2, bl4) | 0; - mid = mid + Math.imul(al2, bh4) | 0; - mid = mid + Math.imul(ah2, bl4) | 0; - hi = hi + Math.imul(ah2, bh4) | 0; - lo = lo + Math.imul(al1, bl5) | 0; - mid = mid + Math.imul(al1, bh5) | 0; - mid = mid + Math.imul(ah1, bl5) | 0; - hi = hi + Math.imul(ah1, bh5) | 0; - lo = lo + Math.imul(al0, bl6) | 0; - mid = mid + Math.imul(al0, bh6) | 0; - mid = mid + Math.imul(ah0, bl6) | 0; - hi = hi + Math.imul(ah0, bh6) | 0; - var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0; - w6 &= 67108863; - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = mid + Math.imul(ah7, bl0) | 0; - hi = Math.imul(ah7, bh0); - lo = lo + Math.imul(al6, bl1) | 0; - mid = mid + Math.imul(al6, bh1) | 0; - mid = mid + Math.imul(ah6, bl1) | 0; - hi = hi + Math.imul(ah6, bh1) | 0; - lo = lo + Math.imul(al5, bl2) | 0; - mid = mid + Math.imul(al5, bh2) | 0; - mid = mid + Math.imul(ah5, bl2) | 0; - hi = hi + Math.imul(ah5, bh2) | 0; - lo = lo + Math.imul(al4, bl3) | 0; - mid = mid + Math.imul(al4, bh3) | 0; - mid = mid + Math.imul(ah4, bl3) | 0; - hi = hi + Math.imul(ah4, bh3) | 0; - lo = lo + Math.imul(al3, bl4) | 0; - mid = mid + Math.imul(al3, bh4) | 0; - mid = mid + Math.imul(ah3, bl4) | 0; - hi = hi + Math.imul(ah3, bh4) | 0; - lo = lo + Math.imul(al2, bl5) | 0; - mid = mid + Math.imul(al2, bh5) | 0; - mid = mid + Math.imul(ah2, bl5) | 0; - hi = hi + Math.imul(ah2, bh5) | 0; - lo = lo + Math.imul(al1, bl6) | 0; - mid = mid + Math.imul(al1, bh6) | 0; - mid = mid + Math.imul(ah1, bl6) | 0; - hi = hi + Math.imul(ah1, bh6) | 0; - lo = lo + Math.imul(al0, bl7) | 0; - mid = mid + Math.imul(al0, bh7) | 0; - mid = mid + Math.imul(ah0, bl7) | 0; - hi = hi + Math.imul(ah0, bh7) | 0; - var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0; - w7 &= 67108863; - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = mid + Math.imul(ah8, bl0) | 0; - hi = Math.imul(ah8, bh0); - lo = lo + Math.imul(al7, bl1) | 0; - mid = mid + Math.imul(al7, bh1) | 0; - mid = mid + Math.imul(ah7, bl1) | 0; - hi = hi + Math.imul(ah7, bh1) | 0; - lo = lo + Math.imul(al6, bl2) | 0; - mid = mid + Math.imul(al6, bh2) | 0; - mid = mid + Math.imul(ah6, bl2) | 0; - hi = hi + Math.imul(ah6, bh2) | 0; - lo = lo + Math.imul(al5, bl3) | 0; - mid = mid + Math.imul(al5, bh3) | 0; - mid = mid + Math.imul(ah5, bl3) | 0; - hi = hi + Math.imul(ah5, bh3) | 0; - lo = lo + Math.imul(al4, bl4) | 0; - mid = mid + Math.imul(al4, bh4) | 0; - mid = mid + Math.imul(ah4, bl4) | 0; - hi = hi + Math.imul(ah4, bh4) | 0; - lo = lo + Math.imul(al3, bl5) | 0; - mid = mid + Math.imul(al3, bh5) | 0; - mid = mid + Math.imul(ah3, bl5) | 0; - hi = hi + Math.imul(ah3, bh5) | 0; - lo = lo + Math.imul(al2, bl6) | 0; - mid = mid + Math.imul(al2, bh6) | 0; - mid = mid + Math.imul(ah2, bl6) | 0; - hi = hi + Math.imul(ah2, bh6) | 0; - lo = lo + Math.imul(al1, bl7) | 0; - mid = mid + Math.imul(al1, bh7) | 0; - mid = mid + Math.imul(ah1, bl7) | 0; - hi = hi + Math.imul(ah1, bh7) | 0; - lo = lo + Math.imul(al0, bl8) | 0; - mid = mid + Math.imul(al0, bh8) | 0; - mid = mid + Math.imul(ah0, bl8) | 0; - hi = hi + Math.imul(ah0, bh8) | 0; - var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0; - w8 &= 67108863; - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = mid + Math.imul(ah9, bl0) | 0; - hi = Math.imul(ah9, bh0); - lo = lo + Math.imul(al8, bl1) | 0; - mid = mid + Math.imul(al8, bh1) | 0; - mid = mid + Math.imul(ah8, bl1) | 0; - hi = hi + Math.imul(ah8, bh1) | 0; - lo = lo + Math.imul(al7, bl2) | 0; - mid = mid + Math.imul(al7, bh2) | 0; - mid = mid + Math.imul(ah7, bl2) | 0; - hi = hi + Math.imul(ah7, bh2) | 0; - lo = lo + Math.imul(al6, bl3) | 0; - mid = mid + Math.imul(al6, bh3) | 0; - mid = mid + Math.imul(ah6, bl3) | 0; - hi = hi + Math.imul(ah6, bh3) | 0; - lo = lo + Math.imul(al5, bl4) | 0; - mid = mid + Math.imul(al5, bh4) | 0; - mid = mid + Math.imul(ah5, bl4) | 0; - hi = hi + Math.imul(ah5, bh4) | 0; - lo = lo + Math.imul(al4, bl5) | 0; - mid = mid + Math.imul(al4, bh5) | 0; - mid = mid + Math.imul(ah4, bl5) | 0; - hi = hi + Math.imul(ah4, bh5) | 0; - lo = lo + Math.imul(al3, bl6) | 0; - mid = mid + Math.imul(al3, bh6) | 0; - mid = mid + Math.imul(ah3, bl6) | 0; - hi = hi + Math.imul(ah3, bh6) | 0; - lo = lo + Math.imul(al2, bl7) | 0; - mid = mid + Math.imul(al2, bh7) | 0; - mid = mid + Math.imul(ah2, bl7) | 0; - hi = hi + Math.imul(ah2, bh7) | 0; - lo = lo + Math.imul(al1, bl8) | 0; - mid = mid + Math.imul(al1, bh8) | 0; - mid = mid + Math.imul(ah1, bl8) | 0; - hi = hi + Math.imul(ah1, bh8) | 0; - lo = lo + Math.imul(al0, bl9) | 0; - mid = mid + Math.imul(al0, bh9) | 0; - mid = mid + Math.imul(ah0, bl9) | 0; - hi = hi + Math.imul(ah0, bh9) | 0; - var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0; - w9 &= 67108863; - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = mid + Math.imul(ah9, bl1) | 0; - hi = Math.imul(ah9, bh1); - lo = lo + Math.imul(al8, bl2) | 0; - mid = mid + Math.imul(al8, bh2) | 0; - mid = mid + Math.imul(ah8, bl2) | 0; - hi = hi + Math.imul(ah8, bh2) | 0; - lo = lo + Math.imul(al7, bl3) | 0; - mid = mid + Math.imul(al7, bh3) | 0; - mid = mid + Math.imul(ah7, bl3) | 0; - hi = hi + Math.imul(ah7, bh3) | 0; - lo = lo + Math.imul(al6, bl4) | 0; - mid = mid + Math.imul(al6, bh4) | 0; - mid = mid + Math.imul(ah6, bl4) | 0; - hi = hi + Math.imul(ah6, bh4) | 0; - lo = lo + Math.imul(al5, bl5) | 0; - mid = mid + Math.imul(al5, bh5) | 0; - mid = mid + Math.imul(ah5, bl5) | 0; - hi = hi + Math.imul(ah5, bh5) | 0; - lo = lo + Math.imul(al4, bl6) | 0; - mid = mid + Math.imul(al4, bh6) | 0; - mid = mid + Math.imul(ah4, bl6) | 0; - hi = hi + Math.imul(ah4, bh6) | 0; - lo = lo + Math.imul(al3, bl7) | 0; - mid = mid + Math.imul(al3, bh7) | 0; - mid = mid + Math.imul(ah3, bl7) | 0; - hi = hi + Math.imul(ah3, bh7) | 0; - lo = lo + Math.imul(al2, bl8) | 0; - mid = mid + Math.imul(al2, bh8) | 0; - mid = mid + Math.imul(ah2, bl8) | 0; - hi = hi + Math.imul(ah2, bh8) | 0; - lo = lo + Math.imul(al1, bl9) | 0; - mid = mid + Math.imul(al1, bh9) | 0; - mid = mid + Math.imul(ah1, bl9) | 0; - hi = hi + Math.imul(ah1, bh9) | 0; - var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0; - w10 &= 67108863; - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = mid + Math.imul(ah9, bl2) | 0; - hi = Math.imul(ah9, bh2); - lo = lo + Math.imul(al8, bl3) | 0; - mid = mid + Math.imul(al8, bh3) | 0; - mid = mid + Math.imul(ah8, bl3) | 0; - hi = hi + Math.imul(ah8, bh3) | 0; - lo = lo + Math.imul(al7, bl4) | 0; - mid = mid + Math.imul(al7, bh4) | 0; - mid = mid + Math.imul(ah7, bl4) | 0; - hi = hi + Math.imul(ah7, bh4) | 0; - lo = lo + Math.imul(al6, bl5) | 0; - mid = mid + Math.imul(al6, bh5) | 0; - mid = mid + Math.imul(ah6, bl5) | 0; - hi = hi + Math.imul(ah6, bh5) | 0; - lo = lo + Math.imul(al5, bl6) | 0; - mid = mid + Math.imul(al5, bh6) | 0; - mid = mid + Math.imul(ah5, bl6) | 0; - hi = hi + Math.imul(ah5, bh6) | 0; - lo = lo + Math.imul(al4, bl7) | 0; - mid = mid + Math.imul(al4, bh7) | 0; - mid = mid + Math.imul(ah4, bl7) | 0; - hi = hi + Math.imul(ah4, bh7) | 0; - lo = lo + Math.imul(al3, bl8) | 0; - mid = mid + Math.imul(al3, bh8) | 0; - mid = mid + Math.imul(ah3, bl8) | 0; - hi = hi + Math.imul(ah3, bh8) | 0; - lo = lo + Math.imul(al2, bl9) | 0; - mid = mid + Math.imul(al2, bh9) | 0; - mid = mid + Math.imul(ah2, bl9) | 0; - hi = hi + Math.imul(ah2, bh9) | 0; - var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0; - w11 &= 67108863; - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = mid + Math.imul(ah9, bl3) | 0; - hi = Math.imul(ah9, bh3); - lo = lo + Math.imul(al8, bl4) | 0; - mid = mid + Math.imul(al8, bh4) | 0; - mid = mid + Math.imul(ah8, bl4) | 0; - hi = hi + Math.imul(ah8, bh4) | 0; - lo = lo + Math.imul(al7, bl5) | 0; - mid = mid + Math.imul(al7, bh5) | 0; - mid = mid + Math.imul(ah7, bl5) | 0; - hi = hi + Math.imul(ah7, bh5) | 0; - lo = lo + Math.imul(al6, bl6) | 0; - mid = mid + Math.imul(al6, bh6) | 0; - mid = mid + Math.imul(ah6, bl6) | 0; - hi = hi + Math.imul(ah6, bh6) | 0; - lo = lo + Math.imul(al5, bl7) | 0; - mid = mid + Math.imul(al5, bh7) | 0; - mid = mid + Math.imul(ah5, bl7) | 0; - hi = hi + Math.imul(ah5, bh7) | 0; - lo = lo + Math.imul(al4, bl8) | 0; - mid = mid + Math.imul(al4, bh8) | 0; - mid = mid + Math.imul(ah4, bl8) | 0; - hi = hi + Math.imul(ah4, bh8) | 0; - lo = lo + Math.imul(al3, bl9) | 0; - mid = mid + Math.imul(al3, bh9) | 0; - mid = mid + Math.imul(ah3, bl9) | 0; - hi = hi + Math.imul(ah3, bh9) | 0; - var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0; - w12 &= 67108863; - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = mid + Math.imul(ah9, bl4) | 0; - hi = Math.imul(ah9, bh4); - lo = lo + Math.imul(al8, bl5) | 0; - mid = mid + Math.imul(al8, bh5) | 0; - mid = mid + Math.imul(ah8, bl5) | 0; - hi = hi + Math.imul(ah8, bh5) | 0; - lo = lo + Math.imul(al7, bl6) | 0; - mid = mid + Math.imul(al7, bh6) | 0; - mid = mid + Math.imul(ah7, bl6) | 0; - hi = hi + Math.imul(ah7, bh6) | 0; - lo = lo + Math.imul(al6, bl7) | 0; - mid = mid + Math.imul(al6, bh7) | 0; - mid = mid + Math.imul(ah6, bl7) | 0; - hi = hi + Math.imul(ah6, bh7) | 0; - lo = lo + Math.imul(al5, bl8) | 0; - mid = mid + Math.imul(al5, bh8) | 0; - mid = mid + Math.imul(ah5, bl8) | 0; - hi = hi + Math.imul(ah5, bh8) | 0; - lo = lo + Math.imul(al4, bl9) | 0; - mid = mid + Math.imul(al4, bh9) | 0; - mid = mid + Math.imul(ah4, bl9) | 0; - hi = hi + Math.imul(ah4, bh9) | 0; - var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0; - w13 &= 67108863; - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = mid + Math.imul(ah9, bl5) | 0; - hi = Math.imul(ah9, bh5); - lo = lo + Math.imul(al8, bl6) | 0; - mid = mid + Math.imul(al8, bh6) | 0; - mid = mid + Math.imul(ah8, bl6) | 0; - hi = hi + Math.imul(ah8, bh6) | 0; - lo = lo + Math.imul(al7, bl7) | 0; - mid = mid + Math.imul(al7, bh7) | 0; - mid = mid + Math.imul(ah7, bl7) | 0; - hi = hi + Math.imul(ah7, bh7) | 0; - lo = lo + Math.imul(al6, bl8) | 0; - mid = mid + Math.imul(al6, bh8) | 0; - mid = mid + Math.imul(ah6, bl8) | 0; - hi = hi + Math.imul(ah6, bh8) | 0; - lo = lo + Math.imul(al5, bl9) | 0; - mid = mid + Math.imul(al5, bh9) | 0; - mid = mid + Math.imul(ah5, bl9) | 0; - hi = hi + Math.imul(ah5, bh9) | 0; - var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0; - w14 &= 67108863; - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = mid + Math.imul(ah9, bl6) | 0; - hi = Math.imul(ah9, bh6); - lo = lo + Math.imul(al8, bl7) | 0; - mid = mid + Math.imul(al8, bh7) | 0; - mid = mid + Math.imul(ah8, bl7) | 0; - hi = hi + Math.imul(ah8, bh7) | 0; - lo = lo + Math.imul(al7, bl8) | 0; - mid = mid + Math.imul(al7, bh8) | 0; - mid = mid + Math.imul(ah7, bl8) | 0; - hi = hi + Math.imul(ah7, bh8) | 0; - lo = lo + Math.imul(al6, bl9) | 0; - mid = mid + Math.imul(al6, bh9) | 0; - mid = mid + Math.imul(ah6, bl9) | 0; - hi = hi + Math.imul(ah6, bh9) | 0; - var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0; - w15 &= 67108863; - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = mid + Math.imul(ah9, bl7) | 0; - hi = Math.imul(ah9, bh7); - lo = lo + Math.imul(al8, bl8) | 0; - mid = mid + Math.imul(al8, bh8) | 0; - mid = mid + Math.imul(ah8, bl8) | 0; - hi = hi + Math.imul(ah8, bh8) | 0; - lo = lo + Math.imul(al7, bl9) | 0; - mid = mid + Math.imul(al7, bh9) | 0; - mid = mid + Math.imul(ah7, bl9) | 0; - hi = hi + Math.imul(ah7, bh9) | 0; - var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0; - w16 &= 67108863; - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = mid + Math.imul(ah9, bl8) | 0; - hi = Math.imul(ah9, bh8); - lo = lo + Math.imul(al8, bl9) | 0; - mid = mid + Math.imul(al8, bh9) | 0; - mid = mid + Math.imul(ah8, bl9) | 0; - hi = hi + Math.imul(ah8, bh9) | 0; - var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0; - w17 &= 67108863; - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = mid + Math.imul(ah9, bl9) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0; - c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0; - w18 &= 67108863; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - function bigMulTo(self2, num, out) { - out.negative = num.negative ^ self2.negative; - out.length = self2.length + num.length; - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 67108863; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self2.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self2.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - var lo = r & 67108863; - ncarry = ncarry + (r / 67108864 | 0) | 0; - lo = lo + rword | 0; - rword = lo & 67108863; - ncarry = ncarry + (lo >>> 26) | 0; - hncarry += ncarry >>> 26; - ncarry &= 67108863; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - return out._strip(); - } - function jumboMulTo(self2, num, out) { - return bigMulTo(self2, num, out); - } - BN2.prototype.mulTo = function mulTo(num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - return res; - }; - function FFTM(x, y) { - this.x = x; - this.y = y; - } - FFTM.prototype.makeRBT = function makeRBT(N) { - var t = new Array(N); - var l = BN2.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - return t; - }; - FFTM.prototype.revBin = function revBin(x, l, N) { - if (x === 0 || x === N - 1) - return x; - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << l - i - 1; - x >>= 1; - } - return rb; - }; - FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - var rx = rtwdf_ * ro - itwdf_ * io; - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - FFTM.prototype.guessLen13b = function guessLen13b(n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - return 1 << i + 1 + odd; - }; - FFTM.prototype.conjugate = function conjugate(rws, iws, N) { - if (N <= 1) - return; - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - t = iws[i]; - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - FFTM.prototype.normalize13b = function normalize13b(ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry; - ws[i] = w & 67108863; - if (w < 67108864) { - carry = 0; - } else { - carry = w / 67108864 | 0; - } - } - return ws; - }; - FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - rws[2 * i] = carry & 8191; - carry = carry >>> 13; - rws[2 * i + 1] = carry & 8191; - carry = carry >>> 13; - } - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - assert3(carry === 0); - assert3((carry & ~8191) === 0); - }; - FFTM.prototype.stub = function stub(N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - return ph; - }; - FFTM.prototype.mulp = function mulp(x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - var rbt = this.makeRBT(N); - var _ = this.stub(N); - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - var rmws = out.words; - rmws.length = N; - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out._strip(); - }; - BN2.prototype.mul = function mul(num) { - var out = new BN2(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - BN2.prototype.mulf = function mulf(num) { - var out = new BN2(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - BN2.prototype.imul = function imul(num) { - return this.clone().mulTo(num, this); - }; - BN2.prototype.imuln = function imuln(num) { - var isNegNum = num < 0; - if (isNegNum) - num = -num; - assert3(typeof num === "number"); - assert3(num < 67108864); - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 67108863) + (carry & 67108863); - carry >>= 26; - carry += w / 67108864 | 0; - carry += lo >>> 26; - this.words[i] = lo & 67108863; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - this.length = num === 0 ? 1 : this.length; - return isNegNum ? this.ineg() : this; - }; - BN2.prototype.muln = function muln(num) { - return this.clone().imuln(num); - }; - BN2.prototype.sqr = function sqr() { - return this.mul(this); - }; - BN2.prototype.isqr = function isqr() { - return this.imul(this.clone()); - }; - BN2.prototype.pow = function pow(num) { - var w = toBitArray(num); - if (w.length === 0) - return new BN2(1); - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) - break; - } - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) - continue; - res = res.mul(q); - } - } - return res; - }; - BN2.prototype.iushln = function iushln(bits) { - assert3(typeof bits === "number" && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = 67108863 >>> 26 - r << 26 - r; - var i; - if (r !== 0) { - var carry = 0; - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = (this.words[i] | 0) - newCarry << r; - this.words[i] = c | carry; - carry = newCarry >>> 26 - r; - } - if (carry) { - this.words[i] = carry; - this.length++; - } - } - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - this.length += s; - } - return this._strip(); - }; - BN2.prototype.ishln = function ishln(bits) { - assert3(this.negative === 0); - return this.iushln(bits); - }; - BN2.prototype.iushrn = function iushrn(bits, hint, extended) { - assert3(typeof bits === "number" && bits >= 0); - var h; - if (hint) { - h = (hint - hint % 26) / 26; - } else { - h = 0; - } - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask2 = 67108863 ^ 67108863 >>> r << r; - var maskedWords = extended; - h -= s; - h = Math.max(0, h); - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - if (s === 0) { - } else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = carry << 26 - r | word >>> r; - carry = word & mask2; - } - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - return this._strip(); - }; - BN2.prototype.ishrn = function ishrn(bits, hint, extended) { - assert3(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - BN2.prototype.shln = function shln(bits) { - return this.clone().ishln(bits); - }; - BN2.prototype.ushln = function ushln(bits) { - return this.clone().iushln(bits); - }; - BN2.prototype.shrn = function shrn(bits) { - return this.clone().ishrn(bits); - }; - BN2.prototype.ushrn = function ushrn(bits) { - return this.clone().iushrn(bits); - }; - BN2.prototype.testn = function testn(bit) { - assert3(typeof bit === "number" && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - if (this.length <= s) - return false; - var w = this.words[s]; - return !!(w & q); - }; - BN2.prototype.imaskn = function imaskn(bits) { - assert3(typeof bits === "number" && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - assert3(this.negative === 0, "imaskn works only with positive numbers"); - if (this.length <= s) { - return this; - } - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - if (r !== 0) { - var mask2 = 67108863 ^ 67108863 >>> r << r; - this.words[this.length - 1] &= mask2; - } - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - return this._strip(); - }; - BN2.prototype.maskn = function maskn(bits) { - return this.clone().imaskn(bits); - }; - BN2.prototype.iaddn = function iaddn(num) { - assert3(typeof num === "number"); - assert3(num < 67108864); - if (num < 0) - return this.isubn(-num); - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) <= num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - return this._iaddn(num); - }; - BN2.prototype._iaddn = function _iaddn(num) { - this.words[0] += num; - for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) { - this.words[i] -= 67108864; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - return this; - }; - BN2.prototype.isubn = function isubn(num) { - assert3(typeof num === "number"); - assert3(num < 67108864); - if (num < 0) - return this.iaddn(-num); - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - this.words[0] -= num; - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 67108864; - this.words[i + 1] -= 1; - } - } - return this._strip(); - }; - BN2.prototype.addn = function addn(num) { - return this.clone().iaddn(num); - }; - BN2.prototype.subn = function subn(num) { - return this.clone().isubn(num); - }; - BN2.prototype.iabs = function iabs() { - this.negative = 0; - return this; - }; - BN2.prototype.abs = function abs() { - return this.clone().iabs(); - }; - BN2.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) { - var len = num.length + shift; - var i; - this._expand(len); - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 67108863; - carry = (w >> 26) - (right / 67108864 | 0); - this.words[i + shift] = w & 67108863; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 67108863; - } - if (carry === 0) - return this._strip(); - assert3(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 67108863; - } - this.negative = 1; - return this._strip(); - }; - BN2.prototype._wordDiv = function _wordDiv(num, mode) { - var shift = this.length - num.length; - var a = this.clone(); - var b = num; - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - var m = a.length - b.length; - var q; - if (mode !== "mod") { - q = new BN2(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0); - qj = Math.min(qj / bhi | 0, 67108863); - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q._strip(); - } - a._strip(); - if (mode !== "div" && shift !== 0) { - a.iushrn(shift); - } - return { - div: q || null, - mod: a - }; - }; - BN2.prototype.divmod = function divmod(num, mode, positive) { - assert3(!num.isZero()); - if (this.isZero()) { - return { - div: new BN2(0), - mod: new BN2(0) - }; - } - var div, mod2, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - if (mode !== "mod") { - div = res.div.neg(); - } - if (mode !== "div") { - mod2 = res.mod.neg(); - if (positive && mod2.negative !== 0) { - mod2.iadd(num); - } - } - return { - div, - mod: mod2 - }; - } - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - if (mode !== "mod") { - div = res.div.neg(); - } - return { - div, - mod: res.mod - }; - } - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - if (mode !== "div") { - mod2 = res.mod.neg(); - if (positive && mod2.negative !== 0) { - mod2.isub(num); - } - } - return { - div: res.div, - mod: mod2 - }; - } - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN2(0), - mod: this - }; - } - if (num.length === 1) { - if (mode === "div") { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - if (mode === "mod") { - return { - div: null, - mod: new BN2(this.modrn(num.words[0])) - }; - } - return { - div: this.divn(num.words[0]), - mod: new BN2(this.modrn(num.words[0])) - }; - } - return this._wordDiv(num, mode); - }; - BN2.prototype.div = function div(num) { - return this.divmod(num, "div", false).div; - }; - BN2.prototype.mod = function mod2(num) { - return this.divmod(num, "mod", false).mod; - }; - BN2.prototype.umod = function umod(num) { - return this.divmod(num, "mod", true).mod; - }; - BN2.prototype.divRound = function divRound(num) { - var dm = this.divmod(num); - if (dm.mod.isZero()) - return dm.div; - var mod2 = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod2.cmp(half); - if (cmp < 0 || r2 === 1 && cmp === 0) - return dm.div; - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - BN2.prototype.modrn = function modrn(num) { - var isNegNum = num < 0; - if (isNegNum) - num = -num; - assert3(num <= 67108863); - var p = (1 << 26) % num; - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - return isNegNum ? -acc : acc; - }; - BN2.prototype.modn = function modn(num) { - return this.modrn(num); - }; - BN2.prototype.idivn = function idivn(num) { - var isNegNum = num < 0; - if (isNegNum) - num = -num; - assert3(num <= 67108863); - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 67108864; - this.words[i] = w / num | 0; - carry = w % num; - } - this._strip(); - return isNegNum ? this.ineg() : this; - }; - BN2.prototype.divn = function divn(num) { - return this.clone().idivn(num); - }; - BN2.prototype.egcd = function egcd(p) { - assert3(p.negative === 0); - assert3(!p.isZero()); - var x = this; - var y = p.clone(); - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - var A = new BN2(1); - var B = new BN2(0); - var C = new BN2(0); - var D = new BN2(1); - var g = 0; - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - var yp = y.clone(); - var xp = x.clone(); - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) - ; - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - A.iushrn(1); - B.iushrn(1); - } - } - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) - ; - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - C.iushrn(1); - D.iushrn(1); - } - } - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - BN2.prototype._invmp = function _invmp(p) { - assert3(p.negative === 0); - assert3(!p.isZero()); - var a = this; - var b = p.clone(); - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - var x1 = new BN2(1); - var x2 = new BN2(0); - var delta = b.clone(); - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) - ; - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - x1.iushrn(1); - } - } - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) - ; - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - x2.iushrn(1); - } - } - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - if (res.cmpn(0) < 0) { - res.iadd(p); - } - return res; - }; - BN2.prototype.gcd = function gcd(num) { - if (this.isZero()) - return num.abs(); - if (num.isZero()) - return this.abs(); - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - var r = a.cmp(b); - if (r < 0) { - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - a.isub(b); - } while (true); - return b.iushln(shift); - }; - BN2.prototype.invm = function invm(num) { - return this.egcd(num).a.umod(num); - }; - BN2.prototype.isEven = function isEven() { - return (this.words[0] & 1) === 0; - }; - BN2.prototype.isOdd = function isOdd() { - return (this.words[0] & 1) === 1; - }; - BN2.prototype.andln = function andln(num) { - return this.words[0] & num; - }; - BN2.prototype.bincn = function bincn(bit) { - assert3(typeof bit === "number"); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 67108863; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - BN2.prototype.isZero = function isZero() { - return this.length === 1 && this.words[0] === 0; - }; - BN2.prototype.cmpn = function cmpn(num) { - var negative = num < 0; - if (this.negative !== 0 && !negative) - return -1; - if (this.negative === 0 && negative) - return 1; - this._strip(); - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - assert3(num <= 67108863, "Number is too big"); - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) - return -res | 0; - return res; - }; - BN2.prototype.cmp = function cmp(num) { - if (this.negative !== 0 && num.negative === 0) - return -1; - if (this.negative === 0 && num.negative !== 0) - return 1; - var res = this.ucmp(num); - if (this.negative !== 0) - return -res | 0; - return res; - }; - BN2.prototype.ucmp = function ucmp(num) { - if (this.length > num.length) - return 1; - if (this.length < num.length) - return -1; - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - if (a === b) - continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - BN2.prototype.gtn = function gtn(num) { - return this.cmpn(num) === 1; - }; - BN2.prototype.gt = function gt(num) { - return this.cmp(num) === 1; - }; - BN2.prototype.gten = function gten(num) { - return this.cmpn(num) >= 0; - }; - BN2.prototype.gte = function gte(num) { - return this.cmp(num) >= 0; - }; - BN2.prototype.ltn = function ltn(num) { - return this.cmpn(num) === -1; - }; - BN2.prototype.lt = function lt(num) { - return this.cmp(num) === -1; - }; - BN2.prototype.lten = function lten(num) { - return this.cmpn(num) <= 0; - }; - BN2.prototype.lte = function lte(num) { - return this.cmp(num) <= 0; - }; - BN2.prototype.eqn = function eqn(num) { - return this.cmpn(num) === 0; - }; - BN2.prototype.eq = function eq(num) { - return this.cmp(num) === 0; - }; - BN2.red = function red(num) { - return new Red(num); - }; - BN2.prototype.toRed = function toRed(ctx) { - assert3(!this.red, "Already a number in reduction context"); - assert3(this.negative === 0, "red works only with positives"); - return ctx.convertTo(this)._forceRed(ctx); - }; - BN2.prototype.fromRed = function fromRed() { - assert3(this.red, "fromRed works only with numbers in reduction context"); - return this.red.convertFrom(this); - }; - BN2.prototype._forceRed = function _forceRed(ctx) { - this.red = ctx; - return this; - }; - BN2.prototype.forceRed = function forceRed(ctx) { - assert3(!this.red, "Already a number in reduction context"); - return this._forceRed(ctx); - }; - BN2.prototype.redAdd = function redAdd(num) { - assert3(this.red, "redAdd works only with red numbers"); - return this.red.add(this, num); - }; - BN2.prototype.redIAdd = function redIAdd(num) { - assert3(this.red, "redIAdd works only with red numbers"); - return this.red.iadd(this, num); - }; - BN2.prototype.redSub = function redSub(num) { - assert3(this.red, "redSub works only with red numbers"); - return this.red.sub(this, num); - }; - BN2.prototype.redISub = function redISub(num) { - assert3(this.red, "redISub works only with red numbers"); - return this.red.isub(this, num); - }; - BN2.prototype.redShl = function redShl(num) { - assert3(this.red, "redShl works only with red numbers"); - return this.red.shl(this, num); - }; - BN2.prototype.redMul = function redMul(num) { - assert3(this.red, "redMul works only with red numbers"); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - BN2.prototype.redIMul = function redIMul(num) { - assert3(this.red, "redMul works only with red numbers"); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - BN2.prototype.redSqr = function redSqr() { - assert3(this.red, "redSqr works only with red numbers"); - this.red._verify1(this); - return this.red.sqr(this); - }; - BN2.prototype.redISqr = function redISqr() { - assert3(this.red, "redISqr works only with red numbers"); - this.red._verify1(this); - return this.red.isqr(this); - }; - BN2.prototype.redSqrt = function redSqrt() { - assert3(this.red, "redSqrt works only with red numbers"); - this.red._verify1(this); - return this.red.sqrt(this); - }; - BN2.prototype.redInvm = function redInvm() { - assert3(this.red, "redInvm works only with red numbers"); - this.red._verify1(this); - return this.red.invm(this); - }; - BN2.prototype.redNeg = function redNeg() { - assert3(this.red, "redNeg works only with red numbers"); - this.red._verify1(this); - return this.red.neg(this); - }; - BN2.prototype.redPow = function redPow(num) { - assert3(this.red && !num.red, "redPow(normalNum)"); - this.red._verify1(this); - return this.red.pow(this, num); - }; - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - function MPrime(name, p) { - this.name = name; - this.p = new BN2(p, 16); - this.n = this.p.bitLength(); - this.k = new BN2(1).iushln(this.n).isub(this.p); - this.tmp = this._tmp(); - } - MPrime.prototype._tmp = function _tmp() { - var tmp = new BN2(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - MPrime.prototype.ireduce = function ireduce(num) { - var r = num; - var rlen; - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - if (r.strip !== void 0) { - r.strip(); - } else { - r._strip(); - } - } - return r; - }; - MPrime.prototype.split = function split2(input, out) { - input.iushrn(this.n, 0, out); - }; - MPrime.prototype.imulK = function imulK(num) { - return num.imul(this.k); - }; - function K256() { - MPrime.call( - this, - "k256", - "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f" - ); - } - inherits(K256, MPrime); - K256.prototype.split = function split2(input, output) { - var mask2 = 4194303; - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - var prev = input.words[9]; - output.words[output.length++] = prev & mask2; - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = (next & mask2) << 4 | prev >>> 22; - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - K256.prototype.imulK = function imulK(num) { - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 977; - num.words[i] = lo & 67108863; - lo = w * 64 + (lo / 67108864 | 0); - } - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - function P224() { - MPrime.call( - this, - "p224", - "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001" - ); - } - inherits(P224, MPrime); - function P192() { - MPrime.call( - this, - "p192", - "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff" - ); - } - inherits(P192, MPrime); - function P25519() { - MPrime.call( - this, - "25519", - "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed" - ); - } - inherits(P25519, MPrime); - P25519.prototype.imulK = function imulK(num) { - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 19 + carry; - var lo = hi & 67108863; - hi >>>= 26; - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - BN2._prime = function prime(name) { - if (primes[name]) - return primes[name]; - var prime2; - if (name === "k256") { - prime2 = new K256(); - } else if (name === "p224") { - prime2 = new P224(); - } else if (name === "p192") { - prime2 = new P192(); - } else if (name === "p25519") { - prime2 = new P25519(); - } else { - throw new Error("Unknown prime " + name); - } - primes[name] = prime2; - return prime2; - }; - function Red(m) { - if (typeof m === "string") { - var prime = BN2._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert3(m.gtn(1), "modulus must be greater than 1"); - this.m = m; - this.prime = null; - } - } - Red.prototype._verify1 = function _verify1(a) { - assert3(a.negative === 0, "red works only with positives"); - assert3(a.red, "red works only with red numbers"); - }; - Red.prototype._verify2 = function _verify2(a, b) { - assert3((a.negative | b.negative) === 0, "red works only with positives"); - assert3( - a.red && a.red === b.red, - "red works only with red numbers" - ); - }; - Red.prototype.imod = function imod(a) { - if (this.prime) - return this.prime.ireduce(a)._forceRed(this); - move(a, a.umod(this.m)._forceRed(this)); - return a; - }; - Red.prototype.neg = function neg(a) { - if (a.isZero()) { - return a.clone(); - } - return this.m.sub(a)._forceRed(this); - }; - Red.prototype.add = function add2(a, b) { - this._verify2(a, b); - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - Red.prototype.iadd = function iadd(a, b) { - this._verify2(a, b); - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - Red.prototype.sub = function sub(a, b) { - this._verify2(a, b); - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - Red.prototype.isub = function isub(a, b) { - this._verify2(a, b); - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - Red.prototype.shl = function shl(a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - Red.prototype.imul = function imul(a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - Red.prototype.mul = function mul(a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - Red.prototype.isqr = function isqr(a) { - return this.imul(a, a.clone()); - }; - Red.prototype.sqr = function sqr(a) { - return this.mul(a, a); - }; - Red.prototype.sqrt = function sqrt(a) { - if (a.isZero()) - return a.clone(); - var mod3 = this.m.andln(3); - assert3(mod3 % 2 === 1); - if (mod3 === 3) { - var pow = this.m.add(new BN2(1)).iushrn(2); - return this.pow(a, pow); - } - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert3(!q.isZero()); - var one = new BN2(1).toRed(this); - var nOne = one.redNeg(); - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN2(2 * z * z).toRed(this); - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert3(i < m); - var b = this.pow(c, new BN2(1).iushln(m - i - 1)); - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - return r; - }; - Red.prototype.invm = function invm(a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - Red.prototype.pow = function pow(a, num) { - if (num.isZero()) - return new BN2(1).toRed(this); - if (num.cmpn(1) === 0) - return a.clone(); - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN2(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = word >> j & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) - continue; - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - return res; - }; - Red.prototype.convertTo = function convertTo(num) { - var r = num.umod(this.m); - return r === num ? r.clone() : r; - }; - Red.prototype.convertFrom = function convertFrom(num) { - var res = num.clone(); - res.red = null; - return res; - }; - BN2.mont = function mont(num) { - return new Mont(num); - }; - function Mont(m) { - Red.call(this, m); - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - this.shift % 26; - } - this.r = new BN2(1).iushln(this.shift); - this.r2 = this.imod(this.r.sqr()); - this.rinv = this.r._invmp(this.m); - this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); - this.minv = this.minv.umod(this.r); - this.minv = this.r.sub(this.minv); - } - inherits(Mont, Red); - Mont.prototype.convertTo = function convertTo(num) { - return this.imod(num.ushln(this.shift)); - }; - Mont.prototype.convertFrom = function convertFrom(num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - Mont.prototype.imul = function imul(a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - return res._forceRed(this); - }; - Mont.prototype.mul = function mul(a, b) { - if (a.isZero() || b.isZero()) - return new BN2(0)._forceRed(this); - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - return res._forceRed(this); - }; - Mont.prototype.invm = function invm(a) { - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; - })(typeof module2 === "undefined" || module2, exports2); - } -}); - -// ../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js -var require_safe_buffer = __commonJS({ - "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports2, module2) { - var buffer = require("buffer"); - var Buffer3 = buffer.Buffer; - function copyProps(src, dst) { - for (var key in src) { - dst[key] = src[key]; - } - } - if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) { - module2.exports = buffer; - } else { - copyProps(buffer, exports2); - exports2.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer3(arg, encodingOrOffset, length); - } - SafeBuffer.prototype = Object.create(Buffer3.prototype); - copyProps(Buffer3, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); - } - return Buffer3(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size, fill, encoding) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - var buf = Buffer3(size); - if (fill !== void 0) { - if (typeof encoding === "string") { - buf.fill(fill, encoding); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf; - }; - SafeBuffer.allocUnsafe = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return Buffer3(size); - }; - SafeBuffer.allocUnsafeSlow = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer.SlowBuffer(size); - }; - } -}); - -// ../../node_modules/.pnpm/base-x@3.0.11/node_modules/base-x/src/index.js -var require_src2 = __commonJS({ - "../../node_modules/.pnpm/base-x@3.0.11/node_modules/base-x/src/index.js"(exports2, module2) { - "use strict"; - var _Buffer = require_safe_buffer().Buffer; - function base(ALPHABET) { - if (ALPHABET.length >= 255) { - throw new TypeError("Alphabet too long"); - } - var BASE_MAP = new Uint8Array(256); - for (var j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (var i = 0; i < ALPHABET.length; i++) { - var x = ALPHABET.charAt(i); - var xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + " is ambiguous"); - } - BASE_MAP[xc] = i; - } - var BASE = ALPHABET.length; - var LEADER = ALPHABET.charAt(0); - var FACTOR = Math.log(BASE) / Math.log(256); - var iFACTOR = Math.log(256) / Math.log(BASE); - function encode(source) { - if (Array.isArray(source) || source instanceof Uint8Array) { - source = _Buffer.from(source); - } - if (!_Buffer.isBuffer(source)) { - throw new TypeError("Expected Buffer"); - } - if (source.length === 0) { - return ""; - } - var zeroes = 0; - var length = 0; - var pbegin = 0; - var pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - var size = (pend - pbegin) * iFACTOR + 1 >>> 0; - var b58 = new Uint8Array(size); - while (pbegin !== pend) { - var carry = source[pbegin]; - var i2 = 0; - for (var it1 = size - 1; (carry !== 0 || i2 < length) && it1 !== -1; it1--, i2++) { - carry += 256 * b58[it1] >>> 0; - b58[it1] = carry % BASE >>> 0; - carry = carry / BASE >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i2; - pbegin++; - } - var it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - var str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; - } - function decodeUnsafe(source) { - if (typeof source !== "string") { - throw new TypeError("Expected String"); - } - if (source.length === 0) { - return _Buffer.alloc(0); - } - var psz = 0; - var zeroes = 0; - var length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - var size = (source.length - psz) * FACTOR + 1 >>> 0; - var b256 = new Uint8Array(size); - while (psz < source.length) { - var charCode = source.charCodeAt(psz); - if (charCode > 255) { - return; - } - var carry = BASE_MAP[charCode]; - if (carry === 255) { - return; - } - var i2 = 0; - for (var it3 = size - 1; (carry !== 0 || i2 < length) && it3 !== -1; it3--, i2++) { - carry += BASE * b256[it3] >>> 0; - b256[it3] = carry % 256 >>> 0; - carry = carry / 256 >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i2; - psz++; - } - var it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - var vch = _Buffer.allocUnsafe(zeroes + (size - it4)); - vch.fill(0, 0, zeroes); - var j2 = zeroes; - while (it4 !== size) { - vch[j2++] = b256[it4++]; - } - return vch; - } - function decode(string2) { - var buffer = decodeUnsafe(string2); - if (buffer) { - return buffer; - } - throw new Error("Non-base" + BASE + " character"); - } - return { - encode, - decodeUnsafe, - decode - }; - } - module2.exports = base; - } -}); - -// ../../node_modules/.pnpm/bs58@4.0.1/node_modules/bs58/index.js -var require_bs58 = __commonJS({ - "../../node_modules/.pnpm/bs58@4.0.1/node_modules/bs58/index.js"(exports2, module2) { - var basex = require_src2(); - var ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - module2.exports = basex(ALPHABET); - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js -var sha2562; -var init_sha256 = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha256.js"() { - init_sha2(); - sha2562 = sha256; - } -}); - -// ../../node_modules/.pnpm/text-encoding-utf-8@1.0.2/node_modules/text-encoding-utf-8/lib/encoding.lib.js -var require_encoding_lib = __commonJS({ - "../../node_modules/.pnpm/text-encoding-utf-8@1.0.2/node_modules/text-encoding-utf-8/lib/encoding.lib.js"(exports2) { - "use strict"; - function inRange2(a, min, max) { - return min <= a && a <= max; - } - function ToDictionary(o) { - if (o === void 0) - return {}; - if (o === Object(o)) - return o; - throw TypeError("Could not convert argument to dictionary"); - } - function stringToCodePoints(string2) { - var s = String(string2); - var n = s.length; - var i = 0; - var u = []; - while (i < n) { - var c = s.charCodeAt(i); - if (c < 55296 || c > 57343) { - u.push(c); - } else if (56320 <= c && c <= 57343) { - u.push(65533); - } else if (55296 <= c && c <= 56319) { - if (i === n - 1) { - u.push(65533); - } else { - var d = string2.charCodeAt(i + 1); - if (56320 <= d && d <= 57343) { - var a = c & 1023; - var b = d & 1023; - u.push(65536 + (a << 10) + b); - i += 1; - } else { - u.push(65533); - } - } - } - i += 1; - } - return u; - } - function codePointsToString(code_points) { - var s = ""; - for (var i = 0; i < code_points.length; ++i) { - var cp = code_points[i]; - if (cp <= 65535) { - s += String.fromCharCode(cp); - } else { - cp -= 65536; - s += String.fromCharCode( - (cp >> 10) + 55296, - (cp & 1023) + 56320 - ); - } - } - return s; - } - var end_of_stream = -1; - function Stream2(tokens) { - this.tokens = [].slice.call(tokens); - } - Stream2.prototype = { - /** - * @return {boolean} True if end-of-stream has been hit. - */ - endOfStream: function() { - return !this.tokens.length; - }, - /** - * When a token is read from a stream, the first token in the - * stream must be returned and subsequently removed, and - * end-of-stream must be returned otherwise. - * - * @return {number} Get the next token from the stream, or - * end_of_stream. - */ - read: function() { - if (!this.tokens.length) - return end_of_stream; - return this.tokens.shift(); - }, - /** - * When one or more tokens are prepended to a stream, those tokens - * must be inserted, in given order, before the first token in the - * stream. - * - * @param {(number|!Array.)} token The token(s) to prepend to the stream. - */ - prepend: function(token) { - if (Array.isArray(token)) { - var tokens = ( - /**@type {!Array.}*/ - token - ); - while (tokens.length) - this.tokens.unshift(tokens.pop()); - } else { - this.tokens.unshift(token); - } - }, - /** - * When one or more tokens are pushed to a stream, those tokens - * must be inserted, in given order, after the last token in the - * stream. - * - * @param {(number|!Array.)} token The tokens(s) to prepend to the stream. - */ - push: function(token) { - if (Array.isArray(token)) { - var tokens = ( - /**@type {!Array.}*/ - token - ); - while (tokens.length) - this.tokens.push(tokens.shift()); - } else { - this.tokens.push(token); - } - } - }; - var finished = -1; - function decoderError(fatal, opt_code_point) { - if (fatal) - throw TypeError("Decoder error"); - return opt_code_point || 65533; - } - var DEFAULT_ENCODING = "utf-8"; - function TextDecoder2(encoding, options) { - if (!(this instanceof TextDecoder2)) { - return new TextDecoder2(encoding, options); - } - encoding = encoding !== void 0 ? String(encoding).toLowerCase() : DEFAULT_ENCODING; - if (encoding !== DEFAULT_ENCODING) { - throw new Error("Encoding not supported. Only utf-8 is supported"); - } - options = ToDictionary(options); - this._streaming = false; - this._BOMseen = false; - this._decoder = null; - this._fatal = Boolean(options["fatal"]); - this._ignoreBOM = Boolean(options["ignoreBOM"]); - Object.defineProperty(this, "encoding", { value: "utf-8" }); - Object.defineProperty(this, "fatal", { value: this._fatal }); - Object.defineProperty(this, "ignoreBOM", { value: this._ignoreBOM }); - } - TextDecoder2.prototype = { - /** - * @param {ArrayBufferView=} input The buffer of bytes to decode. - * @param {Object=} options - * @return {string} The decoded string. - */ - decode: function decode(input, options) { - var bytes; - if (typeof input === "object" && input instanceof ArrayBuffer) { - bytes = new Uint8Array(input); - } else if (typeof input === "object" && "buffer" in input && input.buffer instanceof ArrayBuffer) { - bytes = new Uint8Array( - input.buffer, - input.byteOffset, - input.byteLength - ); - } else { - bytes = new Uint8Array(0); - } - options = ToDictionary(options); - if (!this._streaming) { - this._decoder = new UTF8Decoder({ fatal: this._fatal }); - this._BOMseen = false; - } - this._streaming = Boolean(options["stream"]); - var input_stream = new Stream2(bytes); - var code_points = []; - var result; - while (!input_stream.endOfStream()) { - result = this._decoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (result === null) - continue; - if (Array.isArray(result)) - code_points.push.apply( - code_points, - /**@type {!Array.}*/ - result - ); - else - code_points.push(result); - } - if (!this._streaming) { - do { - result = this._decoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (result === null) - continue; - if (Array.isArray(result)) - code_points.push.apply( - code_points, - /**@type {!Array.}*/ - result - ); - else - code_points.push(result); - } while (!input_stream.endOfStream()); - this._decoder = null; - } - if (code_points.length) { - if (["utf-8"].indexOf(this.encoding) !== -1 && !this._ignoreBOM && !this._BOMseen) { - if (code_points[0] === 65279) { - this._BOMseen = true; - code_points.shift(); - } else { - this._BOMseen = true; - } - } - } - return codePointsToString(code_points); - } - }; - function TextEncoder2(encoding, options) { - if (!(this instanceof TextEncoder2)) - return new TextEncoder2(encoding, options); - encoding = encoding !== void 0 ? String(encoding).toLowerCase() : DEFAULT_ENCODING; - if (encoding !== DEFAULT_ENCODING) { - throw new Error("Encoding not supported. Only utf-8 is supported"); - } - options = ToDictionary(options); - this._streaming = false; - this._encoder = null; - this._options = { fatal: Boolean(options["fatal"]) }; - Object.defineProperty(this, "encoding", { value: "utf-8" }); - } - TextEncoder2.prototype = { - /** - * @param {string=} opt_string The string to encode. - * @param {Object=} options - * @return {Uint8Array} Encoded bytes, as a Uint8Array. - */ - encode: function encode(opt_string, options) { - opt_string = opt_string ? String(opt_string) : ""; - options = ToDictionary(options); - if (!this._streaming) - this._encoder = new UTF8Encoder(this._options); - this._streaming = Boolean(options["stream"]); - var bytes = []; - var input_stream = new Stream2(stringToCodePoints(opt_string)); - var result; - while (!input_stream.endOfStream()) { - result = this._encoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (Array.isArray(result)) - bytes.push.apply( - bytes, - /**@type {!Array.}*/ - result - ); - else - bytes.push(result); - } - if (!this._streaming) { - while (true) { - result = this._encoder.handler(input_stream, input_stream.read()); - if (result === finished) - break; - if (Array.isArray(result)) - bytes.push.apply( - bytes, - /**@type {!Array.}*/ - result - ); - else - bytes.push(result); - } - this._encoder = null; - } - return new Uint8Array(bytes); - } - }; - function UTF8Decoder(options) { - var fatal = options.fatal; - var utf8_code_point = 0, utf8_bytes_seen = 0, utf8_bytes_needed = 0, utf8_lower_boundary = 128, utf8_upper_boundary = 191; - this.handler = function(stream, bite) { - if (bite === end_of_stream && utf8_bytes_needed !== 0) { - utf8_bytes_needed = 0; - return decoderError(fatal); - } - if (bite === end_of_stream) - return finished; - if (utf8_bytes_needed === 0) { - if (inRange2(bite, 0, 127)) { - return bite; - } - if (inRange2(bite, 194, 223)) { - utf8_bytes_needed = 1; - utf8_code_point = bite - 192; - } else if (inRange2(bite, 224, 239)) { - if (bite === 224) - utf8_lower_boundary = 160; - if (bite === 237) - utf8_upper_boundary = 159; - utf8_bytes_needed = 2; - utf8_code_point = bite - 224; - } else if (inRange2(bite, 240, 244)) { - if (bite === 240) - utf8_lower_boundary = 144; - if (bite === 244) - utf8_upper_boundary = 143; - utf8_bytes_needed = 3; - utf8_code_point = bite - 240; - } else { - return decoderError(fatal); - } - utf8_code_point = utf8_code_point << 6 * utf8_bytes_needed; - return null; - } - if (!inRange2(bite, utf8_lower_boundary, utf8_upper_boundary)) { - utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; - utf8_lower_boundary = 128; - utf8_upper_boundary = 191; - stream.prepend(bite); - return decoderError(fatal); - } - utf8_lower_boundary = 128; - utf8_upper_boundary = 191; - utf8_bytes_seen += 1; - utf8_code_point += bite - 128 << 6 * (utf8_bytes_needed - utf8_bytes_seen); - if (utf8_bytes_seen !== utf8_bytes_needed) - return null; - var code_point = utf8_code_point; - utf8_code_point = utf8_bytes_needed = utf8_bytes_seen = 0; - return code_point; - }; - } - function UTF8Encoder(options) { - var fatal = options.fatal; - this.handler = function(stream, code_point) { - if (code_point === end_of_stream) - return finished; - if (inRange2(code_point, 0, 127)) - return code_point; - var count, offset2; - if (inRange2(code_point, 128, 2047)) { - count = 1; - offset2 = 192; - } else if (inRange2(code_point, 2048, 65535)) { - count = 2; - offset2 = 224; - } else if (inRange2(code_point, 65536, 1114111)) { - count = 3; - offset2 = 240; - } - var bytes = [(code_point >> 6 * count) + offset2]; - while (count > 0) { - var temp = code_point >> 6 * (count - 1); - bytes.push(128 | temp & 63); - count -= 1; - } - return bytes; - }; - } - exports2.TextEncoder = TextEncoder2; - exports2.TextDecoder = TextDecoder2; - } -}); - -// ../../node_modules/.pnpm/borsh@0.7.0/node_modules/borsh/lib/index.js -var require_lib2 = __commonJS({ - "../../node_modules/.pnpm/borsh@0.7.0/node_modules/borsh/lib/index.js"(exports2) { - "use strict"; - var __createBinding = exports2 && exports2.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { - return m[k]; - } }); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __decorate = exports2 && exports2.__decorate || function(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __importStar = exports2 && exports2.__importStar || function(mod2) { - if (mod2 && mod2.__esModule) - return mod2; - var result = {}; - if (mod2 != null) { - for (var k in mod2) - if (k !== "default" && Object.hasOwnProperty.call(mod2, k)) - __createBinding(result, mod2, k); - } - __setModuleDefault(result, mod2); - return result; - }; - var __importDefault = exports2 && exports2.__importDefault || function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deserializeUnchecked = exports2.deserialize = exports2.serialize = exports2.BinaryReader = exports2.BinaryWriter = exports2.BorshError = exports2.baseDecode = exports2.baseEncode = void 0; - var bn_js_1 = __importDefault(require_bn()); - var bs58_1 = __importDefault(require_bs58()); - var encoding = __importStar(require_encoding_lib()); - var ResolvedTextDecoder = typeof TextDecoder !== "function" ? encoding.TextDecoder : TextDecoder; - var textDecoder = new ResolvedTextDecoder("utf-8", { fatal: true }); - function baseEncode(value) { - if (typeof value === "string") { - value = Buffer.from(value, "utf8"); - } - return bs58_1.default.encode(Buffer.from(value)); - } - exports2.baseEncode = baseEncode; - function baseDecode(value) { - return Buffer.from(bs58_1.default.decode(value)); - } - exports2.baseDecode = baseDecode; - var INITIAL_LENGTH = 1024; - var BorshError = class extends Error { - constructor(message) { - super(message); - this.fieldPath = []; - this.originalMessage = message; - } - addToFieldPath(fieldName) { - this.fieldPath.splice(0, 0, fieldName); - this.message = this.originalMessage + ": " + this.fieldPath.join("."); - } - }; - exports2.BorshError = BorshError; - var BinaryWriter = class { - constructor() { - this.buf = Buffer.alloc(INITIAL_LENGTH); - this.length = 0; - } - maybeResize() { - if (this.buf.length < 16 + this.length) { - this.buf = Buffer.concat([this.buf, Buffer.alloc(INITIAL_LENGTH)]); - } - } - writeU8(value) { - this.maybeResize(); - this.buf.writeUInt8(value, this.length); - this.length += 1; - } - writeU16(value) { - this.maybeResize(); - this.buf.writeUInt16LE(value, this.length); - this.length += 2; - } - writeU32(value) { - this.maybeResize(); - this.buf.writeUInt32LE(value, this.length); - this.length += 4; - } - writeU64(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 8))); - } - writeU128(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 16))); - } - writeU256(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 32))); - } - writeU512(value) { - this.maybeResize(); - this.writeBuffer(Buffer.from(new bn_js_1.default(value).toArray("le", 64))); - } - writeBuffer(buffer) { - this.buf = Buffer.concat([ - Buffer.from(this.buf.subarray(0, this.length)), - buffer, - Buffer.alloc(INITIAL_LENGTH) - ]); - this.length += buffer.length; - } - writeString(str) { - this.maybeResize(); - const b = Buffer.from(str, "utf8"); - this.writeU32(b.length); - this.writeBuffer(b); - } - writeFixedArray(array2) { - this.writeBuffer(Buffer.from(array2)); - } - writeArray(array2, fn) { - this.maybeResize(); - this.writeU32(array2.length); - for (const elem of array2) { - this.maybeResize(); - fn(elem); - } - } - toArray() { - return this.buf.subarray(0, this.length); - } - }; - exports2.BinaryWriter = BinaryWriter; - function handlingRangeError(target, propertyKey, propertyDescriptor) { - const originalMethod = propertyDescriptor.value; - propertyDescriptor.value = function(...args) { - try { - return originalMethod.apply(this, args); - } catch (e) { - if (e instanceof RangeError) { - const code = e.code; - if (["ERR_BUFFER_OUT_OF_BOUNDS", "ERR_OUT_OF_RANGE"].indexOf(code) >= 0) { - throw new BorshError("Reached the end of buffer when deserializing"); - } - } - throw e; - } - }; - } - var BinaryReader = class { - constructor(buf) { - this.buf = buf; - this.offset = 0; - } - readU8() { - const value = this.buf.readUInt8(this.offset); - this.offset += 1; - return value; - } - readU16() { - const value = this.buf.readUInt16LE(this.offset); - this.offset += 2; - return value; - } - readU32() { - const value = this.buf.readUInt32LE(this.offset); - this.offset += 4; - return value; - } - readU64() { - const buf = this.readBuffer(8); - return new bn_js_1.default(buf, "le"); - } - readU128() { - const buf = this.readBuffer(16); - return new bn_js_1.default(buf, "le"); - } - readU256() { - const buf = this.readBuffer(32); - return new bn_js_1.default(buf, "le"); - } - readU512() { - const buf = this.readBuffer(64); - return new bn_js_1.default(buf, "le"); - } - readBuffer(len) { - if (this.offset + len > this.buf.length) { - throw new BorshError(`Expected buffer length ${len} isn't within bounds`); - } - const result = this.buf.slice(this.offset, this.offset + len); - this.offset += len; - return result; - } - readString() { - const len = this.readU32(); - const buf = this.readBuffer(len); - try { - return textDecoder.decode(buf); - } catch (e) { - throw new BorshError(`Error decoding UTF-8 string: ${e}`); - } - } - readFixedArray(len) { - return new Uint8Array(this.readBuffer(len)); - } - readArray(fn) { - const len = this.readU32(); - const result = Array(); - for (let i = 0; i < len; ++i) { - result.push(fn()); - } - return result; - } - }; - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readU8", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readU16", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readU32", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readU64", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readU128", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readU256", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readU512", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readString", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readFixedArray", null); - __decorate([ - handlingRangeError - ], BinaryReader.prototype, "readArray", null); - exports2.BinaryReader = BinaryReader; - function capitalizeFirstLetter(string2) { - return string2.charAt(0).toUpperCase() + string2.slice(1); - } - function serializeField(schema, fieldName, value, fieldType, writer) { - try { - if (typeof fieldType === "string") { - writer[`write${capitalizeFirstLetter(fieldType)}`](value); - } else if (fieldType instanceof Array) { - if (typeof fieldType[0] === "number") { - if (value.length !== fieldType[0]) { - throw new BorshError(`Expecting byte array of length ${fieldType[0]}, but got ${value.length} bytes`); - } - writer.writeFixedArray(value); - } else if (fieldType.length === 2 && typeof fieldType[1] === "number") { - if (value.length !== fieldType[1]) { - throw new BorshError(`Expecting byte array of length ${fieldType[1]}, but got ${value.length} bytes`); - } - for (let i = 0; i < fieldType[1]; i++) { - serializeField(schema, null, value[i], fieldType[0], writer); - } - } else { - writer.writeArray(value, (item) => { - serializeField(schema, fieldName, item, fieldType[0], writer); - }); - } - } else if (fieldType.kind !== void 0) { - switch (fieldType.kind) { - case "option": { - if (value === null || value === void 0) { - writer.writeU8(0); - } else { - writer.writeU8(1); - serializeField(schema, fieldName, value, fieldType.type, writer); - } - break; - } - case "map": { - writer.writeU32(value.size); - value.forEach((val, key) => { - serializeField(schema, fieldName, key, fieldType.key, writer); - serializeField(schema, fieldName, val, fieldType.value, writer); - }); - break; - } - default: - throw new BorshError(`FieldType ${fieldType} unrecognized`); - } - } else { - serializeStruct(schema, value, writer); - } - } catch (error) { - if (error instanceof BorshError) { - error.addToFieldPath(fieldName); - } - throw error; - } - } - function serializeStruct(schema, obj, writer) { - if (typeof obj.borshSerialize === "function") { - obj.borshSerialize(writer); - return; - } - const structSchema = schema.get(obj.constructor); - if (!structSchema) { - throw new BorshError(`Class ${obj.constructor.name} is missing in schema`); - } - if (structSchema.kind === "struct") { - structSchema.fields.map(([fieldName, fieldType]) => { - serializeField(schema, fieldName, obj[fieldName], fieldType, writer); - }); - } else if (structSchema.kind === "enum") { - const name = obj[structSchema.field]; - for (let idx = 0; idx < structSchema.values.length; ++idx) { - const [fieldName, fieldType] = structSchema.values[idx]; - if (fieldName === name) { - writer.writeU8(idx); - serializeField(schema, fieldName, obj[fieldName], fieldType, writer); - break; - } - } - } else { - throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${obj.constructor.name}`); - } - } - function serialize2(schema, obj, Writer = BinaryWriter) { - const writer = new Writer(); - serializeStruct(schema, obj, writer); - return writer.toArray(); - } - exports2.serialize = serialize2; - function deserializeField(schema, fieldName, fieldType, reader) { - try { - if (typeof fieldType === "string") { - return reader[`read${capitalizeFirstLetter(fieldType)}`](); - } - if (fieldType instanceof Array) { - if (typeof fieldType[0] === "number") { - return reader.readFixedArray(fieldType[0]); - } else if (typeof fieldType[1] === "number") { - const arr = []; - for (let i = 0; i < fieldType[1]; i++) { - arr.push(deserializeField(schema, null, fieldType[0], reader)); - } - return arr; - } else { - return reader.readArray(() => deserializeField(schema, fieldName, fieldType[0], reader)); - } - } - if (fieldType.kind === "option") { - const option = reader.readU8(); - if (option) { - return deserializeField(schema, fieldName, fieldType.type, reader); - } - return void 0; - } - if (fieldType.kind === "map") { - let map = /* @__PURE__ */ new Map(); - const length = reader.readU32(); - for (let i = 0; i < length; i++) { - const key = deserializeField(schema, fieldName, fieldType.key, reader); - const val = deserializeField(schema, fieldName, fieldType.value, reader); - map.set(key, val); - } - return map; - } - return deserializeStruct(schema, fieldType, reader); - } catch (error) { - if (error instanceof BorshError) { - error.addToFieldPath(fieldName); - } - throw error; - } - } - function deserializeStruct(schema, classType, reader) { - if (typeof classType.borshDeserialize === "function") { - return classType.borshDeserialize(reader); - } - const structSchema = schema.get(classType); - if (!structSchema) { - throw new BorshError(`Class ${classType.name} is missing in schema`); - } - if (structSchema.kind === "struct") { - const result = {}; - for (const [fieldName, fieldType] of schema.get(classType).fields) { - result[fieldName] = deserializeField(schema, fieldName, fieldType, reader); - } - return new classType(result); - } - if (structSchema.kind === "enum") { - const idx = reader.readU8(); - if (idx >= structSchema.values.length) { - throw new BorshError(`Enum index: ${idx} is out of range`); - } - const [fieldName, fieldType] = structSchema.values[idx]; - const fieldValue = deserializeField(schema, fieldName, fieldType, reader); - return new classType({ [fieldName]: fieldValue }); - } - throw new BorshError(`Unexpected schema kind: ${structSchema.kind} for ${classType.constructor.name}`); - } - function deserialize2(schema, classType, buffer, Reader = BinaryReader) { - const reader = new Reader(buffer); - const result = deserializeStruct(schema, classType, reader); - if (reader.offset < buffer.length) { - throw new BorshError(`Unexpected ${buffer.length - reader.offset} bytes after deserialized data`); - } - return result; - } - exports2.deserialize = deserialize2; - function deserializeUnchecked2(schema, classType, buffer, Reader = BinaryReader) { - const reader = new Reader(buffer); - return deserializeStruct(schema, classType, reader); - } - exports2.deserializeUnchecked = deserializeUnchecked2; - } -}); - -// ../../node_modules/.pnpm/@solana+buffer-layout@4.0.1/node_modules/@solana/buffer-layout/lib/Layout.js -var require_Layout = __commonJS({ - "../../node_modules/.pnpm/@solana+buffer-layout@4.0.1/node_modules/@solana/buffer-layout/lib/Layout.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.s16 = exports2.s8 = exports2.nu64be = exports2.u48be = exports2.u40be = exports2.u32be = exports2.u24be = exports2.u16be = exports2.nu64 = exports2.u48 = exports2.u40 = exports2.u32 = exports2.u24 = exports2.u16 = exports2.u8 = exports2.offset = exports2.greedy = exports2.Constant = exports2.UTF8 = exports2.CString = exports2.Blob = exports2.Boolean = exports2.BitField = exports2.BitStructure = exports2.VariantLayout = exports2.Union = exports2.UnionLayoutDiscriminator = exports2.UnionDiscriminator = exports2.Structure = exports2.Sequence = exports2.DoubleBE = exports2.Double = exports2.FloatBE = exports2.Float = exports2.NearInt64BE = exports2.NearInt64 = exports2.NearUInt64BE = exports2.NearUInt64 = exports2.IntBE = exports2.Int = exports2.UIntBE = exports2.UInt = exports2.OffsetLayout = exports2.GreedyCount = exports2.ExternalLayout = exports2.bindConstructorLayout = exports2.nameWithProperty = exports2.Layout = exports2.uint8ArrayToBuffer = exports2.checkUint8Array = void 0; - exports2.constant = exports2.utf8 = exports2.cstr = exports2.blob = exports2.unionLayoutDiscriminator = exports2.union = exports2.seq = exports2.bits = exports2.struct = exports2.f64be = exports2.f64 = exports2.f32be = exports2.f32 = exports2.ns64be = exports2.s48be = exports2.s40be = exports2.s32be = exports2.s24be = exports2.s16be = exports2.ns64 = exports2.s48 = exports2.s40 = exports2.s32 = exports2.s24 = void 0; - var buffer_1 = require("buffer"); - function checkUint8Array(b) { - if (!(b instanceof Uint8Array)) { - throw new TypeError("b must be a Uint8Array"); - } - } - exports2.checkUint8Array = checkUint8Array; - function uint8ArrayToBuffer(b) { - checkUint8Array(b); - return buffer_1.Buffer.from(b.buffer, b.byteOffset, b.length); - } - exports2.uint8ArrayToBuffer = uint8ArrayToBuffer; - var Layout = class { - constructor(span, property) { - if (!Number.isInteger(span)) { - throw new TypeError("span must be an integer"); - } - this.span = span; - this.property = property; - } - /** Function to create an Object into which decoded properties will - * be written. - * - * Used only for layouts that {@link Layout#decode|decode} to Object - * instances, which means: - * * {@link Structure} - * * {@link Union} - * * {@link VariantLayout} - * * {@link BitStructure} - * - * If left undefined the JavaScript representation of these layouts - * will be Object instances. - * - * See {@link bindConstructorLayout}. - */ - makeDestinationObject() { - return {}; - } - /** - * Calculate the span of a specific instance of a layout. - * - * @param {Uint8Array} b - the buffer that contains an encoded instance. - * - * @param {Number} [offset] - the offset at which the encoded instance - * starts. If absent a zero offset is inferred. - * - * @return {Number} - the number of bytes covered by the layout - * instance. If this method is not overridden in a subclass the - * definition-time constant {@link Layout#span|span} will be - * returned. - * - * @throws {RangeError} - if the length of the value cannot be - * determined. - */ - getSpan(b, offset2) { - if (0 > this.span) { - throw new RangeError("indeterminate span"); - } - return this.span; - } - /** - * Replicate the layout using a new property. - * - * This function must be used to get a structurally-equivalent layout - * with a different name since all {@link Layout} instances are - * immutable. - * - * **NOTE** This is a shallow copy. All fields except {@link - * Layout#property|property} are strictly equal to the origin layout. - * - * @param {String} property - the value for {@link - * Layout#property|property} in the replica. - * - * @returns {Layout} - the copy with {@link Layout#property|property} - * set to `property`. - */ - replicate(property) { - const rv = Object.create(this.constructor.prototype); - Object.assign(rv, this); - rv.property = property; - return rv; - } - /** - * Create an object from layout properties and an array of values. - * - * **NOTE** This function returns `undefined` if invoked on a layout - * that does not return its value as an Object. Objects are - * returned for things that are a {@link Structure}, which includes - * {@link VariantLayout|variant layouts} if they are structures, and - * excludes {@link Union}s. If you want this feature for a union - * you must use {@link Union.getVariant|getVariant} to select the - * desired layout. - * - * @param {Array} values - an array of values that correspond to the - * default order for properties. As with {@link Layout#decode|decode} - * layout elements that have no property name are skipped when - * iterating over the array values. Only the top-level properties are - * assigned; arguments are not assigned to properties of contained - * layouts. Any unused values are ignored. - * - * @return {(Object|undefined)} - */ - fromArray(values) { - return void 0; - } - }; - exports2.Layout = Layout; - function nameWithProperty(name, lo) { - if (lo.property) { - return name + "[" + lo.property + "]"; - } - return name; - } - exports2.nameWithProperty = nameWithProperty; - function bindConstructorLayout(Class, layout) { - if ("function" !== typeof Class) { - throw new TypeError("Class must be constructor"); - } - if (Object.prototype.hasOwnProperty.call(Class, "layout_")) { - throw new Error("Class is already bound to a layout"); - } - if (!(layout && layout instanceof Layout)) { - throw new TypeError("layout must be a Layout"); - } - if (Object.prototype.hasOwnProperty.call(layout, "boundConstructor_")) { - throw new Error("layout is already bound to a constructor"); - } - Class.layout_ = layout; - layout.boundConstructor_ = Class; - layout.makeDestinationObject = () => new Class(); - Object.defineProperty(Class.prototype, "encode", { - value(b, offset2) { - return layout.encode(this, b, offset2); - }, - writable: true - }); - Object.defineProperty(Class, "decode", { - value(b, offset2) { - return layout.decode(b, offset2); - }, - writable: true - }); - } - exports2.bindConstructorLayout = bindConstructorLayout; - var ExternalLayout = class extends Layout { - /** - * Return `true` iff the external layout decodes to an unsigned - * integer layout. - * - * In that case it can be used as the source of {@link - * Sequence#count|Sequence counts}, {@link Blob#length|Blob lengths}, - * or as {@link UnionLayoutDiscriminator#layout|external union - * discriminators}. - * - * @abstract - */ - isCount() { - throw new Error("ExternalLayout is abstract"); - } - }; - exports2.ExternalLayout = ExternalLayout; - var GreedyCount = class extends ExternalLayout { - constructor(elementSpan = 1, property) { - if (!Number.isInteger(elementSpan) || 0 >= elementSpan) { - throw new TypeError("elementSpan must be a (positive) integer"); - } - super(-1, property); - this.elementSpan = elementSpan; - } - /** @override */ - isCount() { - return true; - } - /** @override */ - decode(b, offset2 = 0) { - checkUint8Array(b); - const rem = b.length - offset2; - return Math.floor(rem / this.elementSpan); - } - /** @override */ - encode(src, b, offset2) { - return 0; - } - }; - exports2.GreedyCount = GreedyCount; - var OffsetLayout = class extends ExternalLayout { - constructor(layout, offset2 = 0, property) { - if (!(layout instanceof Layout)) { - throw new TypeError("layout must be a Layout"); - } - if (!Number.isInteger(offset2)) { - throw new TypeError("offset must be integer or undefined"); - } - super(layout.span, property || layout.property); - this.layout = layout; - this.offset = offset2; - } - /** @override */ - isCount() { - return this.layout instanceof UInt || this.layout instanceof UIntBE; - } - /** @override */ - decode(b, offset2 = 0) { - return this.layout.decode(b, offset2 + this.offset); - } - /** @override */ - encode(src, b, offset2 = 0) { - return this.layout.encode(src, b, offset2 + this.offset); - } - }; - exports2.OffsetLayout = OffsetLayout; - var UInt = class extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readUIntLE(offset2, this.span); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeUIntLE(src, offset2, this.span); - return this.span; - } - }; - exports2.UInt = UInt; - var UIntBE = class extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readUIntBE(offset2, this.span); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeUIntBE(src, offset2, this.span); - return this.span; - } - }; - exports2.UIntBE = UIntBE; - var Int = class extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readIntLE(offset2, this.span); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeIntLE(src, offset2, this.span); - return this.span; - } - }; - exports2.Int = Int; - var IntBE = class extends Layout { - constructor(span, property) { - super(span, property); - if (6 < this.span) { - throw new RangeError("span must not exceed 6 bytes"); - } - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readIntBE(offset2, this.span); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeIntBE(src, offset2, this.span); - return this.span; - } - }; - exports2.IntBE = IntBE; - var V2E32 = Math.pow(2, 32); - function divmodInt64(src) { - const hi32 = Math.floor(src / V2E32); - const lo32 = src - hi32 * V2E32; - return { hi32, lo32 }; - } - function roundedInt64(hi32, lo32) { - return hi32 * V2E32 + lo32; - } - var NearUInt64 = class extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b, offset2 = 0) { - const buffer = uint8ArrayToBuffer(b); - const lo32 = buffer.readUInt32LE(offset2); - const hi32 = buffer.readUInt32LE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src, b, offset2 = 0) { - const split2 = divmodInt64(src); - const buffer = uint8ArrayToBuffer(b); - buffer.writeUInt32LE(split2.lo32, offset2); - buffer.writeUInt32LE(split2.hi32, offset2 + 4); - return 8; - } - }; - exports2.NearUInt64 = NearUInt64; - var NearUInt64BE = class extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b, offset2 = 0) { - const buffer = uint8ArrayToBuffer(b); - const hi32 = buffer.readUInt32BE(offset2); - const lo32 = buffer.readUInt32BE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src, b, offset2 = 0) { - const split2 = divmodInt64(src); - const buffer = uint8ArrayToBuffer(b); - buffer.writeUInt32BE(split2.hi32, offset2); - buffer.writeUInt32BE(split2.lo32, offset2 + 4); - return 8; - } - }; - exports2.NearUInt64BE = NearUInt64BE; - var NearInt64 = class extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b, offset2 = 0) { - const buffer = uint8ArrayToBuffer(b); - const lo32 = buffer.readUInt32LE(offset2); - const hi32 = buffer.readInt32LE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src, b, offset2 = 0) { - const split2 = divmodInt64(src); - const buffer = uint8ArrayToBuffer(b); - buffer.writeUInt32LE(split2.lo32, offset2); - buffer.writeInt32LE(split2.hi32, offset2 + 4); - return 8; - } - }; - exports2.NearInt64 = NearInt64; - var NearInt64BE = class extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b, offset2 = 0) { - const buffer = uint8ArrayToBuffer(b); - const hi32 = buffer.readInt32BE(offset2); - const lo32 = buffer.readUInt32BE(offset2 + 4); - return roundedInt64(hi32, lo32); - } - /** @override */ - encode(src, b, offset2 = 0) { - const split2 = divmodInt64(src); - const buffer = uint8ArrayToBuffer(b); - buffer.writeInt32BE(split2.hi32, offset2); - buffer.writeUInt32BE(split2.lo32, offset2 + 4); - return 8; - } - }; - exports2.NearInt64BE = NearInt64BE; - var Float = class extends Layout { - constructor(property) { - super(4, property); - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readFloatLE(offset2); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeFloatLE(src, offset2); - return 4; - } - }; - exports2.Float = Float; - var FloatBE = class extends Layout { - constructor(property) { - super(4, property); - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readFloatBE(offset2); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeFloatBE(src, offset2); - return 4; - } - }; - exports2.FloatBE = FloatBE; - var Double = class extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readDoubleLE(offset2); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeDoubleLE(src, offset2); - return 8; - } - }; - exports2.Double = Double; - var DoubleBE = class extends Layout { - constructor(property) { - super(8, property); - } - /** @override */ - decode(b, offset2 = 0) { - return uint8ArrayToBuffer(b).readDoubleBE(offset2); - } - /** @override */ - encode(src, b, offset2 = 0) { - uint8ArrayToBuffer(b).writeDoubleBE(src, offset2); - return 8; - } - }; - exports2.DoubleBE = DoubleBE; - var Sequence = class extends Layout { - constructor(elementLayout, count, property) { - if (!(elementLayout instanceof Layout)) { - throw new TypeError("elementLayout must be a Layout"); - } - if (!(count instanceof ExternalLayout && count.isCount() || Number.isInteger(count) && 0 <= count)) { - throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout"); - } - let span = -1; - if (!(count instanceof ExternalLayout) && 0 < elementLayout.span) { - span = count * elementLayout.span; - } - super(span, property); - this.elementLayout = elementLayout; - this.count = count; - } - /** @override */ - getSpan(b, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - let span = 0; - let count = this.count; - if (count instanceof ExternalLayout) { - count = count.decode(b, offset2); - } - if (0 < this.elementLayout.span) { - span = count * this.elementLayout.span; - } else { - let idx = 0; - while (idx < count) { - span += this.elementLayout.getSpan(b, offset2 + span); - ++idx; - } - } - return span; - } - /** @override */ - decode(b, offset2 = 0) { - const rv = []; - let i = 0; - let count = this.count; - if (count instanceof ExternalLayout) { - count = count.decode(b, offset2); - } - while (i < count) { - rv.push(this.elementLayout.decode(b, offset2)); - offset2 += this.elementLayout.getSpan(b, offset2); - i += 1; - } - return rv; - } - /** Implement {@link Layout#encode|encode} for {@link Sequence}. - * - * **NOTE** If `src` is shorter than {@link Sequence#count|count} then - * the unused space in the buffer is left unchanged. If `src` is - * longer than {@link Sequence#count|count} the unneeded elements are - * ignored. - * - * **NOTE** If {@link Layout#count|count} is an instance of {@link - * ExternalLayout} then the length of `src` will be encoded as the - * count after `src` is encoded. */ - encode(src, b, offset2 = 0) { - const elo = this.elementLayout; - const span = src.reduce((span2, v) => { - return span2 + elo.encode(v, b, offset2 + span2); - }, 0); - if (this.count instanceof ExternalLayout) { - this.count.encode(src.length, b, offset2); - } - return span; - } - }; - exports2.Sequence = Sequence; - var Structure = class extends Layout { - constructor(fields, property, decodePrefixes) { - if (!(Array.isArray(fields) && fields.reduce((acc, v) => acc && v instanceof Layout, true))) { - throw new TypeError("fields must be array of Layout instances"); - } - if ("boolean" === typeof property && void 0 === decodePrefixes) { - decodePrefixes = property; - property = void 0; - } - for (const fd of fields) { - if (0 > fd.span && void 0 === fd.property) { - throw new Error("fields cannot contain unnamed variable-length layout"); - } - } - let span = -1; - try { - span = fields.reduce((span2, fd) => span2 + fd.getSpan(), 0); - } catch (e) { - } - super(span, property); - this.fields = fields; - this.decodePrefixes = !!decodePrefixes; - } - /** @override */ - getSpan(b, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - let span = 0; - try { - span = this.fields.reduce((span2, fd) => { - const fsp = fd.getSpan(b, offset2); - offset2 += fsp; - return span2 + fsp; - }, 0); - } catch (e) { - throw new RangeError("indeterminate span"); - } - return span; - } - /** @override */ - decode(b, offset2 = 0) { - checkUint8Array(b); - const dest = this.makeDestinationObject(); - for (const fd of this.fields) { - if (void 0 !== fd.property) { - dest[fd.property] = fd.decode(b, offset2); - } - offset2 += fd.getSpan(b, offset2); - if (this.decodePrefixes && b.length === offset2) { - break; - } - } - return dest; - } - /** Implement {@link Layout#encode|encode} for {@link Structure}. - * - * If `src` is missing a property for a member with a defined {@link - * Layout#property|property} the corresponding region of the buffer is - * left unmodified. */ - encode(src, b, offset2 = 0) { - const firstOffset = offset2; - let lastOffset = 0; - let lastWrote = 0; - for (const fd of this.fields) { - let span = fd.span; - lastWrote = 0 < span ? span : 0; - if (void 0 !== fd.property) { - const fv = src[fd.property]; - if (void 0 !== fv) { - lastWrote = fd.encode(fv, b, offset2); - if (0 > span) { - span = fd.getSpan(b, offset2); - } - } - } - lastOffset = offset2; - offset2 += span; - } - return lastOffset + lastWrote - firstOffset; - } - /** @override */ - fromArray(values) { - const dest = this.makeDestinationObject(); - for (const fd of this.fields) { - if (void 0 !== fd.property && 0 < values.length) { - dest[fd.property] = values.shift(); - } - } - return dest; - } - /** - * Get access to the layout of a given property. - * - * @param {String} property - the structure member of interest. - * - * @return {Layout} - the layout associated with `property`, or - * undefined if there is no such property. - */ - layoutFor(property) { - if ("string" !== typeof property) { - throw new TypeError("property must be string"); - } - for (const fd of this.fields) { - if (fd.property === property) { - return fd; - } - } - return void 0; - } - /** - * Get the offset of a structure member. - * - * @param {String} property - the structure member of interest. - * - * @return {Number} - the offset in bytes to the start of `property` - * within the structure, or undefined if `property` is not a field - * within the structure. If the property is a member but follows a - * variable-length structure member a negative number will be - * returned. - */ - offsetOf(property) { - if ("string" !== typeof property) { - throw new TypeError("property must be string"); - } - let offset2 = 0; - for (const fd of this.fields) { - if (fd.property === property) { - return offset2; - } - if (0 > fd.span) { - offset2 = -1; - } else if (0 <= offset2) { - offset2 += fd.span; - } - } - return void 0; - } - }; - exports2.Structure = Structure; - var UnionDiscriminator = class { - constructor(property) { - this.property = property; - } - /** Analog to {@link Layout#decode|Layout decode} for union discriminators. - * - * The implementation of this method need not reference the buffer if - * variant information is available through other means. */ - decode(b, offset2) { - throw new Error("UnionDiscriminator is abstract"); - } - /** Analog to {@link Layout#decode|Layout encode} for union discriminators. - * - * The implementation of this method need not store the value if - * variant information is maintained through other means. */ - encode(src, b, offset2) { - throw new Error("UnionDiscriminator is abstract"); - } - }; - exports2.UnionDiscriminator = UnionDiscriminator; - var UnionLayoutDiscriminator = class extends UnionDiscriminator { - constructor(layout, property) { - if (!(layout instanceof ExternalLayout && layout.isCount())) { - throw new TypeError("layout must be an unsigned integer ExternalLayout"); - } - super(property || layout.property || "variant"); - this.layout = layout; - } - /** Delegate decoding to {@link UnionLayoutDiscriminator#layout|layout}. */ - decode(b, offset2) { - return this.layout.decode(b, offset2); - } - /** Delegate encoding to {@link UnionLayoutDiscriminator#layout|layout}. */ - encode(src, b, offset2) { - return this.layout.encode(src, b, offset2); - } - }; - exports2.UnionLayoutDiscriminator = UnionLayoutDiscriminator; - var Union = class extends Layout { - constructor(discr, defaultLayout, property) { - let discriminator; - if (discr instanceof UInt || discr instanceof UIntBE) { - discriminator = new UnionLayoutDiscriminator(new OffsetLayout(discr)); - } else if (discr instanceof ExternalLayout && discr.isCount()) { - discriminator = new UnionLayoutDiscriminator(discr); - } else if (!(discr instanceof UnionDiscriminator)) { - throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout"); - } else { - discriminator = discr; - } - if (void 0 === defaultLayout) { - defaultLayout = null; - } - if (!(null === defaultLayout || defaultLayout instanceof Layout)) { - throw new TypeError("defaultLayout must be null or a Layout"); - } - if (null !== defaultLayout) { - if (0 > defaultLayout.span) { - throw new Error("defaultLayout must have constant span"); - } - if (void 0 === defaultLayout.property) { - defaultLayout = defaultLayout.replicate("content"); - } - } - let span = -1; - if (defaultLayout) { - span = defaultLayout.span; - if (0 <= span && (discr instanceof UInt || discr instanceof UIntBE)) { - span += discriminator.layout.span; - } - } - super(span, property); - this.discriminator = discriminator; - this.usesPrefixDiscriminator = discr instanceof UInt || discr instanceof UIntBE; - this.defaultLayout = defaultLayout; - this.registry = {}; - let boundGetSourceVariant = this.defaultGetSourceVariant.bind(this); - this.getSourceVariant = function(src) { - return boundGetSourceVariant(src); - }; - this.configGetSourceVariant = function(gsv) { - boundGetSourceVariant = gsv.bind(this); - }; - } - /** @override */ - getSpan(b, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - const vlo = this.getVariant(b, offset2); - if (!vlo) { - throw new Error("unable to determine span for unrecognized variant"); - } - return vlo.getSpan(b, offset2); - } - /** - * Method to infer a registered Union variant compatible with `src`. - * - * The first satisfied rule in the following sequence defines the - * return value: - * * If `src` has properties matching the Union discriminator and - * the default layout, `undefined` is returned regardless of the - * value of the discriminator property (this ensures the default - * layout will be used); - * * If `src` has a property matching the Union discriminator, the - * value of the discriminator identifies a registered variant, and - * either (a) the variant has no layout, or (b) `src` has the - * variant's property, then the variant is returned (because the - * source satisfies the constraints of the variant it identifies); - * * If `src` does not have a property matching the Union - * discriminator, but does have a property matching a registered - * variant, then the variant is returned (because the source - * matches a variant without an explicit conflict); - * * An error is thrown (because we either can't identify a variant, - * or we were explicitly told the variant but can't satisfy it). - * - * @param {Object} src - an object presumed to be compatible with - * the content of the Union. - * - * @return {(undefined|VariantLayout)} - as described above. - * - * @throws {Error} - if `src` cannot be associated with a default or - * registered variant. - */ - defaultGetSourceVariant(src) { - if (Object.prototype.hasOwnProperty.call(src, this.discriminator.property)) { - if (this.defaultLayout && this.defaultLayout.property && Object.prototype.hasOwnProperty.call(src, this.defaultLayout.property)) { - return void 0; - } - const vlo = this.registry[src[this.discriminator.property]]; - if (vlo && (!vlo.layout || vlo.property && Object.prototype.hasOwnProperty.call(src, vlo.property))) { - return vlo; - } - } else { - for (const tag in this.registry) { - const vlo = this.registry[tag]; - if (vlo.property && Object.prototype.hasOwnProperty.call(src, vlo.property)) { - return vlo; - } - } - } - throw new Error("unable to infer src variant"); - } - /** Implement {@link Layout#decode|decode} for {@link Union}. - * - * If the variant is {@link Union#addVariant|registered} the return - * value is an instance of that variant, with no explicit - * discriminator. Otherwise the {@link Union#defaultLayout|default - * layout} is used to decode the content. */ - decode(b, offset2 = 0) { - let dest; - const dlo = this.discriminator; - const discr = dlo.decode(b, offset2); - const clo = this.registry[discr]; - if (void 0 === clo) { - const defaultLayout = this.defaultLayout; - let contentOffset = 0; - if (this.usesPrefixDiscriminator) { - contentOffset = dlo.layout.span; - } - dest = this.makeDestinationObject(); - dest[dlo.property] = discr; - dest[defaultLayout.property] = defaultLayout.decode(b, offset2 + contentOffset); - } else { - dest = clo.decode(b, offset2); - } - return dest; - } - /** Implement {@link Layout#encode|encode} for {@link Union}. - * - * This API assumes the `src` object is consistent with the union's - * {@link Union#defaultLayout|default layout}. To encode variants - * use the appropriate variant-specific {@link VariantLayout#encode} - * method. */ - encode(src, b, offset2 = 0) { - const vlo = this.getSourceVariant(src); - if (void 0 === vlo) { - const dlo = this.discriminator; - const clo = this.defaultLayout; - let contentOffset = 0; - if (this.usesPrefixDiscriminator) { - contentOffset = dlo.layout.span; - } - dlo.encode(src[dlo.property], b, offset2); - return contentOffset + clo.encode(src[clo.property], b, offset2 + contentOffset); - } - return vlo.encode(src, b, offset2); - } - /** Register a new variant structure within a union. The newly - * created variant is returned. - * - * @param {Number} variant - initializer for {@link - * VariantLayout#variant|variant}. - * - * @param {Layout} layout - initializer for {@link - * VariantLayout#layout|layout}. - * - * @param {String} property - initializer for {@link - * Layout#property|property}. - * - * @return {VariantLayout} */ - addVariant(variant, layout, property) { - const rv = new VariantLayout(this, variant, layout, property); - this.registry[variant] = rv; - return rv; - } - /** - * Get the layout associated with a registered variant. - * - * If `vb` does not produce a registered variant the function returns - * `undefined`. - * - * @param {(Number|Uint8Array)} vb - either the variant number, or a - * buffer from which the discriminator is to be read. - * - * @param {Number} offset - offset into `vb` for the start of the - * union. Used only when `vb` is an instance of {Uint8Array}. - * - * @return {({VariantLayout}|undefined)} - */ - getVariant(vb, offset2 = 0) { - let variant; - if (vb instanceof Uint8Array) { - variant = this.discriminator.decode(vb, offset2); - } else { - variant = vb; - } - return this.registry[variant]; - } - }; - exports2.Union = Union; - var VariantLayout = class extends Layout { - constructor(union2, variant, layout, property) { - if (!(union2 instanceof Union)) { - throw new TypeError("union must be a Union"); - } - if (!Number.isInteger(variant) || 0 > variant) { - throw new TypeError("variant must be a (non-negative) integer"); - } - if ("string" === typeof layout && void 0 === property) { - property = layout; - layout = null; - } - if (layout) { - if (!(layout instanceof Layout)) { - throw new TypeError("layout must be a Layout"); - } - if (null !== union2.defaultLayout && 0 <= layout.span && layout.span > union2.defaultLayout.span) { - throw new Error("variant span exceeds span of containing union"); - } - if ("string" !== typeof property) { - throw new TypeError("variant must have a String property"); - } - } - let span = union2.span; - if (0 > union2.span) { - span = layout ? layout.span : 0; - if (0 <= span && union2.usesPrefixDiscriminator) { - span += union2.discriminator.layout.span; - } - } - super(span, property); - this.union = union2; - this.variant = variant; - this.layout = layout || null; - } - /** @override */ - getSpan(b, offset2 = 0) { - if (0 <= this.span) { - return this.span; - } - let contentOffset = 0; - if (this.union.usesPrefixDiscriminator) { - contentOffset = this.union.discriminator.layout.span; - } - let span = 0; - if (this.layout) { - span = this.layout.getSpan(b, offset2 + contentOffset); - } - return contentOffset + span; - } - /** @override */ - decode(b, offset2 = 0) { - const dest = this.makeDestinationObject(); - if (this !== this.union.getVariant(b, offset2)) { - throw new Error("variant mismatch"); - } - let contentOffset = 0; - if (this.union.usesPrefixDiscriminator) { - contentOffset = this.union.discriminator.layout.span; - } - if (this.layout) { - dest[this.property] = this.layout.decode(b, offset2 + contentOffset); - } else if (this.property) { - dest[this.property] = true; - } else if (this.union.usesPrefixDiscriminator) { - dest[this.union.discriminator.property] = this.variant; - } - return dest; - } - /** @override */ - encode(src, b, offset2 = 0) { - let contentOffset = 0; - if (this.union.usesPrefixDiscriminator) { - contentOffset = this.union.discriminator.layout.span; - } - if (this.layout && !Object.prototype.hasOwnProperty.call(src, this.property)) { - throw new TypeError("variant lacks property " + this.property); - } - this.union.discriminator.encode(this.variant, b, offset2); - let span = contentOffset; - if (this.layout) { - this.layout.encode(src[this.property], b, offset2 + contentOffset); - span += this.layout.getSpan(b, offset2 + contentOffset); - if (0 <= this.union.span && span > this.union.span) { - throw new Error("encoded variant overruns containing union"); - } - } - return span; - } - /** Delegate {@link Layout#fromArray|fromArray} to {@link - * VariantLayout#layout|layout}. */ - fromArray(values) { - if (this.layout) { - return this.layout.fromArray(values); - } - return void 0; - } - }; - exports2.VariantLayout = VariantLayout; - function fixBitwiseResult(v) { - if (0 > v) { - v += 4294967296; - } - return v; - } - var BitStructure = class extends Layout { - constructor(word, msb, property) { - if (!(word instanceof UInt || word instanceof UIntBE)) { - throw new TypeError("word must be a UInt or UIntBE layout"); - } - if ("string" === typeof msb && void 0 === property) { - property = msb; - msb = false; - } - if (4 < word.span) { - throw new RangeError("word cannot exceed 32 bits"); - } - super(word.span, property); - this.word = word; - this.msb = !!msb; - this.fields = []; - let value = 0; - this._packedSetValue = function(v) { - value = fixBitwiseResult(v); - return this; - }; - this._packedGetValue = function() { - return value; - }; - } - /** @override */ - decode(b, offset2 = 0) { - const dest = this.makeDestinationObject(); - const value = this.word.decode(b, offset2); - this._packedSetValue(value); - for (const fd of this.fields) { - if (void 0 !== fd.property) { - dest[fd.property] = fd.decode(b); - } - } - return dest; - } - /** Implement {@link Layout#encode|encode} for {@link BitStructure}. - * - * If `src` is missing a property for a member with a defined {@link - * Layout#property|property} the corresponding region of the packed - * value is left unmodified. Unused bits are also left unmodified. */ - encode(src, b, offset2 = 0) { - const value = this.word.decode(b, offset2); - this._packedSetValue(value); - for (const fd of this.fields) { - if (void 0 !== fd.property) { - const fv = src[fd.property]; - if (void 0 !== fv) { - fd.encode(fv); - } - } - } - return this.word.encode(this._packedGetValue(), b, offset2); - } - /** Register a new bitfield with a containing bit structure. The - * resulting bitfield is returned. - * - * @param {Number} bits - initializer for {@link BitField#bits|bits}. - * - * @param {string} property - initializer for {@link - * Layout#property|property}. - * - * @return {BitField} */ - addField(bits, property) { - const bf = new BitField(this, bits, property); - this.fields.push(bf); - return bf; - } - /** As with {@link BitStructure#addField|addField} for single-bit - * fields with `boolean` value representation. - * - * @param {string} property - initializer for {@link - * Layout#property|property}. - * - * @return {Boolean} */ - // `Boolean` conflicts with the native primitive type - // eslint-disable-next-line @typescript-eslint/ban-types - addBoolean(property) { - const bf = new Boolean2(this, property); - this.fields.push(bf); - return bf; - } - /** - * Get access to the bit field for a given property. - * - * @param {String} property - the bit field of interest. - * - * @return {BitField} - the field associated with `property`, or - * undefined if there is no such property. - */ - fieldFor(property) { - if ("string" !== typeof property) { - throw new TypeError("property must be string"); - } - for (const fd of this.fields) { - if (fd.property === property) { - return fd; - } - } - return void 0; - } - }; - exports2.BitStructure = BitStructure; - var BitField = class { - constructor(container, bits, property) { - if (!(container instanceof BitStructure)) { - throw new TypeError("container must be a BitStructure"); - } - if (!Number.isInteger(bits) || 0 >= bits) { - throw new TypeError("bits must be positive integer"); - } - const totalBits = 8 * container.span; - const usedBits = container.fields.reduce((sum, fd) => sum + fd.bits, 0); - if (bits + usedBits > totalBits) { - throw new Error("bits too long for span remainder (" + (totalBits - usedBits) + " of " + totalBits + " remain)"); - } - this.container = container; - this.bits = bits; - this.valueMask = (1 << bits) - 1; - if (32 === bits) { - this.valueMask = 4294967295; - } - this.start = usedBits; - if (this.container.msb) { - this.start = totalBits - usedBits - bits; - } - this.wordMask = fixBitwiseResult(this.valueMask << this.start); - this.property = property; - } - /** Store a value into the corresponding subsequence of the containing - * bit field. */ - decode(b, offset2) { - const word = this.container._packedGetValue(); - const wordValue = fixBitwiseResult(word & this.wordMask); - const value = wordValue >>> this.start; - return value; - } - /** Store a value into the corresponding subsequence of the containing - * bit field. - * - * **NOTE** This is not a specialization of {@link - * Layout#encode|Layout.encode} and there is no return value. */ - encode(value) { - if ("number" !== typeof value || !Number.isInteger(value) || value !== fixBitwiseResult(value & this.valueMask)) { - throw new TypeError(nameWithProperty("BitField.encode", this) + " value must be integer not exceeding " + this.valueMask); - } - const word = this.container._packedGetValue(); - const wordValue = fixBitwiseResult(value << this.start); - this.container._packedSetValue(fixBitwiseResult(word & ~this.wordMask) | wordValue); - } - }; - exports2.BitField = BitField; - var Boolean2 = class extends BitField { - constructor(container, property) { - super(container, 1, property); - } - /** Override {@link BitField#decode|decode} for {@link Boolean|Boolean}. - * - * @returns {boolean} */ - decode(b, offset2) { - return !!super.decode(b, offset2); - } - /** @override */ - encode(value) { - if ("boolean" === typeof value) { - value = +value; - } - super.encode(value); - } - }; - exports2.Boolean = Boolean2; - var Blob3 = class extends Layout { - constructor(length, property) { - if (!(length instanceof ExternalLayout && length.isCount() || Number.isInteger(length) && 0 <= length)) { - throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout"); - } - let span = -1; - if (!(length instanceof ExternalLayout)) { - span = length; - } - super(span, property); - this.length = length; - } - /** @override */ - getSpan(b, offset2) { - let span = this.span; - if (0 > span) { - span = this.length.decode(b, offset2); - } - return span; - } - /** @override */ - decode(b, offset2 = 0) { - let span = this.span; - if (0 > span) { - span = this.length.decode(b, offset2); - } - return uint8ArrayToBuffer(b).slice(offset2, offset2 + span); - } - /** Implement {@link Layout#encode|encode} for {@link Blob}. - * - * **NOTE** If {@link Layout#count|count} is an instance of {@link - * ExternalLayout} then the length of `src` will be encoded as the - * count after `src` is encoded. */ - encode(src, b, offset2) { - let span = this.length; - if (this.length instanceof ExternalLayout) { - span = src.length; - } - if (!(src instanceof Uint8Array && span === src.length)) { - throw new TypeError(nameWithProperty("Blob.encode", this) + " requires (length " + span + ") Uint8Array as src"); - } - if (offset2 + span > b.length) { - throw new RangeError("encoding overruns Uint8Array"); - } - const srcBuffer = uint8ArrayToBuffer(src); - uint8ArrayToBuffer(b).write(srcBuffer.toString("hex"), offset2, span, "hex"); - if (this.length instanceof ExternalLayout) { - this.length.encode(span, b, offset2); - } - return span; - } - }; - exports2.Blob = Blob3; - var CString = class extends Layout { - constructor(property) { - super(-1, property); - } - /** @override */ - getSpan(b, offset2 = 0) { - checkUint8Array(b); - let idx = offset2; - while (idx < b.length && 0 !== b[idx]) { - idx += 1; - } - return 1 + idx - offset2; - } - /** @override */ - decode(b, offset2 = 0) { - const span = this.getSpan(b, offset2); - return uint8ArrayToBuffer(b).slice(offset2, offset2 + span - 1).toString("utf-8"); - } - /** @override */ - encode(src, b, offset2 = 0) { - if ("string" !== typeof src) { - src = String(src); - } - const srcb = buffer_1.Buffer.from(src, "utf8"); - const span = srcb.length; - if (offset2 + span > b.length) { - throw new RangeError("encoding overruns Buffer"); - } - const buffer = uint8ArrayToBuffer(b); - srcb.copy(buffer, offset2); - buffer[offset2 + span] = 0; - return span + 1; - } - }; - exports2.CString = CString; - var UTF8 = class extends Layout { - constructor(maxSpan, property) { - if ("string" === typeof maxSpan && void 0 === property) { - property = maxSpan; - maxSpan = void 0; - } - if (void 0 === maxSpan) { - maxSpan = -1; - } else if (!Number.isInteger(maxSpan)) { - throw new TypeError("maxSpan must be an integer"); - } - super(-1, property); - this.maxSpan = maxSpan; - } - /** @override */ - getSpan(b, offset2 = 0) { - checkUint8Array(b); - return b.length - offset2; - } - /** @override */ - decode(b, offset2 = 0) { - const span = this.getSpan(b, offset2); - if (0 <= this.maxSpan && this.maxSpan < span) { - throw new RangeError("text length exceeds maxSpan"); - } - return uint8ArrayToBuffer(b).slice(offset2, offset2 + span).toString("utf-8"); - } - /** @override */ - encode(src, b, offset2 = 0) { - if ("string" !== typeof src) { - src = String(src); - } - const srcb = buffer_1.Buffer.from(src, "utf8"); - const span = srcb.length; - if (0 <= this.maxSpan && this.maxSpan < span) { - throw new RangeError("text length exceeds maxSpan"); - } - if (offset2 + span > b.length) { - throw new RangeError("encoding overruns Buffer"); - } - srcb.copy(uint8ArrayToBuffer(b), offset2); - return span; - } - }; - exports2.UTF8 = UTF8; - var Constant = class extends Layout { - constructor(value, property) { - super(0, property); - this.value = value; - } - /** @override */ - decode(b, offset2) { - return this.value; - } - /** @override */ - encode(src, b, offset2) { - return 0; - } - }; - exports2.Constant = Constant; - exports2.greedy = (elementSpan, property) => new GreedyCount(elementSpan, property); - exports2.offset = (layout, offset2, property) => new OffsetLayout(layout, offset2, property); - exports2.u8 = (property) => new UInt(1, property); - exports2.u16 = (property) => new UInt(2, property); - exports2.u24 = (property) => new UInt(3, property); - exports2.u32 = (property) => new UInt(4, property); - exports2.u40 = (property) => new UInt(5, property); - exports2.u48 = (property) => new UInt(6, property); - exports2.nu64 = (property) => new NearUInt64(property); - exports2.u16be = (property) => new UIntBE(2, property); - exports2.u24be = (property) => new UIntBE(3, property); - exports2.u32be = (property) => new UIntBE(4, property); - exports2.u40be = (property) => new UIntBE(5, property); - exports2.u48be = (property) => new UIntBE(6, property); - exports2.nu64be = (property) => new NearUInt64BE(property); - exports2.s8 = (property) => new Int(1, property); - exports2.s16 = (property) => new Int(2, property); - exports2.s24 = (property) => new Int(3, property); - exports2.s32 = (property) => new Int(4, property); - exports2.s40 = (property) => new Int(5, property); - exports2.s48 = (property) => new Int(6, property); - exports2.ns64 = (property) => new NearInt64(property); - exports2.s16be = (property) => new IntBE(2, property); - exports2.s24be = (property) => new IntBE(3, property); - exports2.s32be = (property) => new IntBE(4, property); - exports2.s40be = (property) => new IntBE(5, property); - exports2.s48be = (property) => new IntBE(6, property); - exports2.ns64be = (property) => new NearInt64BE(property); - exports2.f32 = (property) => new Float(property); - exports2.f32be = (property) => new FloatBE(property); - exports2.f64 = (property) => new Double(property); - exports2.f64be = (property) => new DoubleBE(property); - exports2.struct = (fields, property, decodePrefixes) => new Structure(fields, property, decodePrefixes); - exports2.bits = (word, msb, property) => new BitStructure(word, msb, property); - exports2.seq = (elementLayout, count, property) => new Sequence(elementLayout, count, property); - exports2.union = (discr, defaultLayout, property) => new Union(discr, defaultLayout, property); - exports2.unionLayoutDiscriminator = (layout, property) => new UnionLayoutDiscriminator(layout, property); - exports2.blob = (length, property) => new Blob3(length, property); - exports2.cstr = (property) => new CString(property); - exports2.utf8 = (maxSpan, property) => new UTF8(maxSpan, property); - exports2.constant = (value, property) => new Constant(value, property); - } -}); - -// ../../node_modules/.pnpm/@solana+errors@2.3.0_typescript@5.9.3/node_modules/@solana/errors/dist/index.node.mjs -function encodeValue(value) { - if (Array.isArray(value)) { - const commaSeparatedValues = value.map(encodeValue).join( - "%2C%20" - /* ", " */ - ); - return "%5B" + commaSeparatedValues + /* "]" */ - "%5D"; - } else if (typeof value === "bigint") { - return `${value}n`; - } else { - return encodeURIComponent( - String( - value != null && Object.getPrototypeOf(value) === null ? ( - // Plain objects with no prototype don't have a `toString` method. - // Convert them before stringifying them. - { ...value } - ) : value - ) - ); - } -} -function encodeObjectContextEntry([key, value]) { - return `${key}=${encodeValue(value)}`; -} -function encodeContextObject(context) { - const searchParamsString = Object.entries(context).map(encodeObjectContextEntry).join("&"); - return Buffer.from(searchParamsString, "utf8").toString("base64"); -} -function getHumanReadableErrorMessage(code, context = {}) { - const messageFormatString = SolanaErrorMessages[code]; - if (messageFormatString.length === 0) { - return ""; - } - let state; - function commitStateUpTo(endIndex) { - if (state[TYPE] === 2) { - const variableName = messageFormatString.slice(state[START_INDEX] + 1, endIndex); - fragments.push( - variableName in context ? ( - // eslint-disable-next-line @typescript-eslint/restrict-template-expressions - `${context[variableName]}` - ) : `$${variableName}` - ); - } else if (state[TYPE] === 1) { - fragments.push(messageFormatString.slice(state[START_INDEX], endIndex)); - } - } - const fragments = []; - messageFormatString.split("").forEach((char, ii) => { - if (ii === 0) { - state = { - [START_INDEX]: 0, - [TYPE]: messageFormatString[0] === "\\" ? 0 : messageFormatString[0] === "$" ? 2 : 1 - /* Text */ - }; - return; - } - let nextState; - switch (state[TYPE]) { - case 0: - nextState = { - [START_INDEX]: ii, - [TYPE]: 1 - /* Text */ - }; - break; - case 1: - if (char === "\\") { - nextState = { - [START_INDEX]: ii, - [TYPE]: 0 - /* EscapeSequence */ - }; - } else if (char === "$") { - nextState = { - [START_INDEX]: ii, - [TYPE]: 2 - /* Variable */ - }; - } - break; - case 2: - if (char === "\\") { - nextState = { - [START_INDEX]: ii, - [TYPE]: 0 - /* EscapeSequence */ - }; - } else if (char === "$") { - nextState = { - [START_INDEX]: ii, - [TYPE]: 2 - /* Variable */ - }; - } else if (!char.match(/\w/)) { - nextState = { - [START_INDEX]: ii, - [TYPE]: 1 - /* Text */ - }; - } - break; - } - if (nextState) { - if (state !== nextState) { - commitStateUpTo(ii); - } - state = nextState; - } - }); - commitStateUpTo(); - return fragments.join(""); -} -function getErrorMessage(code, context = {}) { - if (process.env.NODE_ENV !== "production") { - return getHumanReadableErrorMessage(code, context); - } else { - let decodingAdviceMessage = `Solana error #${code}; Decode this error by running \`npx @solana/errors decode -- ${code}`; - if (Object.keys(context).length) { - decodingAdviceMessage += ` '${encodeContextObject(context)}'`; - } - return `${decodingAdviceMessage}\``; - } -} -var SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED, SOLANA_ERROR__INVALID_NONCE, SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND, SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE, SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH, SOLANA_ERROR__LAMPORTS_OUT_OF_RANGE, SOLANA_ERROR__MALFORMED_BIGINT_STRING, SOLANA_ERROR__MALFORMED_NUMBER_STRING, SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE, SOLANA_ERROR__MALFORMED_JSON_RPC_ERROR, SOLANA_ERROR__JSON_RPC__PARSE_ERROR, SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR, SOLANA_ERROR__JSON_RPC__INVALID_PARAMS, SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND, SOLANA_ERROR__JSON_RPC__INVALID_REQUEST, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH, SOLANA_ERROR__JSON_RPC__SCAN_ERROR, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE, SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP, SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH, SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE, SOLANA_ERROR__ADDRESSES__INVALID_BASE58_ENCODED_ADDRESS, SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY, SOLANA_ERROR__ADDRESSES__MALFORMED_PDA, SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE, SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED, SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED, SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE, SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED, SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER, SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS, SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND, SOLANA_ERROR__ACCOUNTS__ONE_OR_MORE_ACCOUNTS_NOT_FOUND, SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT, SOLANA_ERROR__ACCOUNTS__EXPECTED_DECODED_ACCOUNT, SOLANA_ERROR__ACCOUNTS__EXPECTED_ALL_ACCOUNTS_TO_BE_DECODED, SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT, SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED, SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED, SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED, SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED, SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED, SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED, SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY, SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED, SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH, SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH, SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH, SOLANA_ERROR__KEYS__SIGNATURE_STRING_LENGTH_OUT_OF_RANGE, SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY, SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS, SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA, SOLANA_ERROR__INSTRUCTION__PROGRAM_ID_MISMATCH, SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN, SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR, SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ARGUMENT, SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_INSTRUCTION_DATA, SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_DATA, SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_TOO_SMALL, SOLANA_ERROR__INSTRUCTION_ERROR__INSUFFICIENT_FUNDS, SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_PROGRAM_ID, SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_REQUIRED_SIGNATURE, SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED, SOLANA_ERROR__INSTRUCTION_ERROR__UNINITIALIZED_ACCOUNT, SOLANA_ERROR__INSTRUCTION_ERROR__UNBALANCED_INSTRUCTION, SOLANA_ERROR__INSTRUCTION_ERROR__MODIFIED_PROGRAM_ID, SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_LAMPORT_SPEND, SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_DATA_MODIFIED, SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_LAMPORT_CHANGE, SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED, SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_INDEX, SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_MODIFIED, SOLANA_ERROR__INSTRUCTION_ERROR__RENT_EPOCH_MODIFIED, SOLANA_ERROR__INSTRUCTION_ERROR__NOT_ENOUGH_ACCOUNT_KEYS, SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_SIZE_CHANGED, SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_EXECUTABLE, SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED, SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_OUTSTANDING, SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_OUT_OF_SYNC, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ERROR, SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_DATA_MODIFIED, SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_LAMPORT_CHANGE, SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_ACCOUNT_NOT_RENT_EXEMPT, SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_PROGRAM_ID, SOLANA_ERROR__INSTRUCTION_ERROR__CALL_DEPTH, SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_ACCOUNT, SOLANA_ERROR__INSTRUCTION_ERROR__REENTRANCY_NOT_ALLOWED, SOLANA_ERROR__INSTRUCTION_ERROR__MAX_SEED_LENGTH_EXCEEDED, SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_SEEDS, SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_REALLOC, SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED, SOLANA_ERROR__INSTRUCTION_ERROR__PRIVILEGE_ESCALATION, SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_ENVIRONMENT_SETUP_FAILURE, SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPLETE, SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPILE, SOLANA_ERROR__INSTRUCTION_ERROR__IMMUTABLE, SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_AUTHORITY, SOLANA_ERROR__INSTRUCTION_ERROR__BORSH_IO_ERROR, SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_RENT_EXEMPT, SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_OWNER, SOLANA_ERROR__INSTRUCTION_ERROR__ARITHMETIC_OVERFLOW, SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_SYSVAR, SOLANA_ERROR__INSTRUCTION_ERROR__ILLEGAL_OWNER, SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED, SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_EXCEEDED, SOLANA_ERROR__INSTRUCTION_ERROR__MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED, SOLANA_ERROR__INSTRUCTION_ERROR__BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS, SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS, SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER, SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER, SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER, SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER, SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER, SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER, SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER, SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER, SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS, SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING, SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES, SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE, SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME, SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME, SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE, SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING, SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE, SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND, SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING, SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING, SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING, SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING, SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING, SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING, SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE, SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION, SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES, SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH, SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT, SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT, SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT, SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN, SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE, SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE, SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_NOT_FOUND, SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_ACCOUNT_NOT_FOUND, SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_FEE, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_FOR_FEE, SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED, SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND, SOLANA_ERROR__TRANSACTION_ERROR__CALL_CHAIN_TOO_DEEP, SOLANA_ERROR__TRANSACTION_ERROR__MISSING_SIGNATURE_FOR_FEE, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_INDEX, SOLANA_ERROR__TRANSACTION_ERROR__SIGNATURE_FAILURE, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_PROGRAM_FOR_EXECUTION, SOLANA_ERROR__TRANSACTION_ERROR__SANITIZE_FAILURE, SOLANA_ERROR__TRANSACTION_ERROR__CLUSTER_MAINTENANCE, SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_BORROW_OUTSTANDING, SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_BLOCK_COST_LIMIT, SOLANA_ERROR__TRANSACTION_ERROR__UNSUPPORTED_VERSION, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_WRITABLE_ACCOUNT, SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT, SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_BLOCK_LIMIT, SOLANA_ERROR__TRANSACTION_ERROR__TOO_MANY_ACCOUNT_LOCKS, SOLANA_ERROR__TRANSACTION_ERROR__ADDRESS_LOOKUP_TABLE_NOT_FOUND, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_OWNER, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_DATA, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_INDEX, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_RENT_PAYING_ACCOUNT, SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_VOTE_COST_LIMIT, SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT, SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION, SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_RENT, SOLANA_ERROR__TRANSACTION_ERROR__MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED, SOLANA_ERROR__TRANSACTION_ERROR__INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT, SOLANA_ERROR__TRANSACTION_ERROR__RESANITIZATION_NEEDED, SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED, SOLANA_ERROR__TRANSACTION_ERROR__UNBALANCED_TRANSACTION, SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY, SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH, SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH, SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH, SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH, SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH, SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH, SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS, SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE, SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT, SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT, SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE, SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE, SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH, SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE, SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT, SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE, SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE, SOLANA_ERROR__CODECS__INVALID_CONSTANT, SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_SIZE, SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL, SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES, SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS, SOLANA_ERROR__RPC__INTEGER_OVERFLOW, SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD, SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN, SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID, SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED, SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED, SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT, SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING, SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE, SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING, SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE, SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENTED, SolanaErrorMessages, START_INDEX, TYPE, SolanaError; -var init_index_node = __esm({ - "../../node_modules/.pnpm/@solana+errors@2.3.0_typescript@5.9.3/node_modules/@solana/errors/dist/index.node.mjs"() { - SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED = 1; - SOLANA_ERROR__INVALID_NONCE = 2; - SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND = 3; - SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE = 4; - SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH = 5; - SOLANA_ERROR__LAMPORTS_OUT_OF_RANGE = 6; - SOLANA_ERROR__MALFORMED_BIGINT_STRING = 7; - SOLANA_ERROR__MALFORMED_NUMBER_STRING = 8; - SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE = 9; - SOLANA_ERROR__MALFORMED_JSON_RPC_ERROR = 10; - SOLANA_ERROR__JSON_RPC__PARSE_ERROR = -32700; - SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR = -32603; - SOLANA_ERROR__JSON_RPC__INVALID_PARAMS = -32602; - SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND = -32601; - SOLANA_ERROR__JSON_RPC__INVALID_REQUEST = -32600; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED = -32016; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION = -32015; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET = -32014; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH = -32013; - SOLANA_ERROR__JSON_RPC__SCAN_ERROR = -32012; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE = -32011; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX = -32010; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED = -32009; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT = -32008; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED = -32007; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE = -32006; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY = -32005; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE = -32004; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE = -32003; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE = -32002; - SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP = -32001; - SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH = 28e5; - SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE = 2800001; - SOLANA_ERROR__ADDRESSES__INVALID_BASE58_ENCODED_ADDRESS = 2800002; - SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY = 2800003; - SOLANA_ERROR__ADDRESSES__MALFORMED_PDA = 2800004; - SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE = 2800005; - SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED = 2800006; - SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED = 2800007; - SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE = 2800008; - SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED = 2800009; - SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER = 2800010; - SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS = 2800011; - SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND = 323e4; - SOLANA_ERROR__ACCOUNTS__ONE_OR_MORE_ACCOUNTS_NOT_FOUND = 32300001; - SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT = 3230002; - SOLANA_ERROR__ACCOUNTS__EXPECTED_DECODED_ACCOUNT = 3230003; - SOLANA_ERROR__ACCOUNTS__EXPECTED_ALL_ACCOUNTS_TO_BE_DECODED = 3230004; - SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT = 361e4; - SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED = 3610001; - SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED = 3610002; - SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED = 3610003; - SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED = 3610004; - SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED = 3610005; - SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED = 3610006; - SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY = 3610007; - SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED = 3611e3; - SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH = 3704e3; - SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH = 3704001; - SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH = 3704002; - SOLANA_ERROR__KEYS__SIGNATURE_STRING_LENGTH_OUT_OF_RANGE = 3704003; - SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY = 3704004; - SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS = 4128e3; - SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA = 4128001; - SOLANA_ERROR__INSTRUCTION__PROGRAM_ID_MISMATCH = 4128002; - SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN = 4615e3; - SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR = 4615001; - SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ARGUMENT = 4615002; - SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_INSTRUCTION_DATA = 4615003; - SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_DATA = 4615004; - SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_TOO_SMALL = 4615005; - SOLANA_ERROR__INSTRUCTION_ERROR__INSUFFICIENT_FUNDS = 4615006; - SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_PROGRAM_ID = 4615007; - SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_REQUIRED_SIGNATURE = 4615008; - SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED = 4615009; - SOLANA_ERROR__INSTRUCTION_ERROR__UNINITIALIZED_ACCOUNT = 4615010; - SOLANA_ERROR__INSTRUCTION_ERROR__UNBALANCED_INSTRUCTION = 4615011; - SOLANA_ERROR__INSTRUCTION_ERROR__MODIFIED_PROGRAM_ID = 4615012; - SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_LAMPORT_SPEND = 4615013; - SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_DATA_MODIFIED = 4615014; - SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_LAMPORT_CHANGE = 4615015; - SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED = 4615016; - SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_INDEX = 4615017; - SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_MODIFIED = 4615018; - SOLANA_ERROR__INSTRUCTION_ERROR__RENT_EPOCH_MODIFIED = 4615019; - SOLANA_ERROR__INSTRUCTION_ERROR__NOT_ENOUGH_ACCOUNT_KEYS = 4615020; - SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_SIZE_CHANGED = 4615021; - SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_EXECUTABLE = 4615022; - SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED = 4615023; - SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_OUTSTANDING = 4615024; - SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_OUT_OF_SYNC = 4615025; - SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM = 4615026; - SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ERROR = 4615027; - SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_DATA_MODIFIED = 4615028; - SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_LAMPORT_CHANGE = 4615029; - SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_ACCOUNT_NOT_RENT_EXEMPT = 4615030; - SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_PROGRAM_ID = 4615031; - SOLANA_ERROR__INSTRUCTION_ERROR__CALL_DEPTH = 4615032; - SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_ACCOUNT = 4615033; - SOLANA_ERROR__INSTRUCTION_ERROR__REENTRANCY_NOT_ALLOWED = 4615034; - SOLANA_ERROR__INSTRUCTION_ERROR__MAX_SEED_LENGTH_EXCEEDED = 4615035; - SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_SEEDS = 4615036; - SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_REALLOC = 4615037; - SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED = 4615038; - SOLANA_ERROR__INSTRUCTION_ERROR__PRIVILEGE_ESCALATION = 4615039; - SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_ENVIRONMENT_SETUP_FAILURE = 4615040; - SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPLETE = 4615041; - SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPILE = 4615042; - SOLANA_ERROR__INSTRUCTION_ERROR__IMMUTABLE = 4615043; - SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_AUTHORITY = 4615044; - SOLANA_ERROR__INSTRUCTION_ERROR__BORSH_IO_ERROR = 4615045; - SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_RENT_EXEMPT = 4615046; - SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_OWNER = 4615047; - SOLANA_ERROR__INSTRUCTION_ERROR__ARITHMETIC_OVERFLOW = 4615048; - SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_SYSVAR = 4615049; - SOLANA_ERROR__INSTRUCTION_ERROR__ILLEGAL_OWNER = 4615050; - SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED = 4615051; - SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_EXCEEDED = 4615052; - SOLANA_ERROR__INSTRUCTION_ERROR__MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED = 4615053; - SOLANA_ERROR__INSTRUCTION_ERROR__BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS = 4615054; - SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS = 5508e3; - SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER = 5508001; - SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER = 5508002; - SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER = 5508003; - SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER = 5508004; - SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER = 5508005; - SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER = 5508006; - SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER = 5508007; - SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER = 5508008; - SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS = 5508009; - SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING = 5508010; - SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED = 5508011; - SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES = 5663e3; - SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE = 5663001; - SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME = 5663002; - SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME = 5663003; - SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE = 5663004; - SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING = 5663005; - SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE = 5663006; - SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND = 5663007; - SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING = 5663008; - SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING = 5663009; - SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING = 5663010; - SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING = 5663011; - SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING = 5663012; - SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING = 5663013; - SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE = 5663014; - SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION = 5663015; - SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES = 5663016; - SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH = 5663017; - SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT = 5663018; - SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT = 5663019; - SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT = 5663020; - SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN = 705e4; - SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE = 7050001; - SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE = 7050002; - SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_NOT_FOUND = 7050003; - SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_ACCOUNT_NOT_FOUND = 7050004; - SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_FEE = 7050005; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_FOR_FEE = 7050006; - SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED = 7050007; - SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND = 7050008; - SOLANA_ERROR__TRANSACTION_ERROR__CALL_CHAIN_TOO_DEEP = 7050009; - SOLANA_ERROR__TRANSACTION_ERROR__MISSING_SIGNATURE_FOR_FEE = 7050010; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_INDEX = 7050011; - SOLANA_ERROR__TRANSACTION_ERROR__SIGNATURE_FAILURE = 7050012; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_PROGRAM_FOR_EXECUTION = 7050013; - SOLANA_ERROR__TRANSACTION_ERROR__SANITIZE_FAILURE = 7050014; - SOLANA_ERROR__TRANSACTION_ERROR__CLUSTER_MAINTENANCE = 7050015; - SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_BORROW_OUTSTANDING = 7050016; - SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_BLOCK_COST_LIMIT = 7050017; - SOLANA_ERROR__TRANSACTION_ERROR__UNSUPPORTED_VERSION = 7050018; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_WRITABLE_ACCOUNT = 7050019; - SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT = 7050020; - SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_BLOCK_LIMIT = 7050021; - SOLANA_ERROR__TRANSACTION_ERROR__TOO_MANY_ACCOUNT_LOCKS = 7050022; - SOLANA_ERROR__TRANSACTION_ERROR__ADDRESS_LOOKUP_TABLE_NOT_FOUND = 7050023; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_OWNER = 7050024; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_DATA = 7050025; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_INDEX = 7050026; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_RENT_PAYING_ACCOUNT = 7050027; - SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_VOTE_COST_LIMIT = 7050028; - SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT = 7050029; - SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION = 7050030; - SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_RENT = 7050031; - SOLANA_ERROR__TRANSACTION_ERROR__MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED = 7050032; - SOLANA_ERROR__TRANSACTION_ERROR__INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT = 7050033; - SOLANA_ERROR__TRANSACTION_ERROR__RESANITIZATION_NEEDED = 7050034; - SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED = 7050035; - SOLANA_ERROR__TRANSACTION_ERROR__UNBALANCED_TRANSACTION = 7050036; - SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY = 8078e3; - SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH = 8078001; - SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH = 8078002; - SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH = 8078003; - SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH = 8078004; - SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH = 8078005; - SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH = 8078006; - SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS = 8078007; - SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE = 8078008; - SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT = 8078009; - SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT = 8078010; - SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE = 8078011; - SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE = 8078012; - SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH = 8078013; - SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE = 8078014; - SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT = 8078015; - SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE = 8078016; - SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE = 8078017; - SOLANA_ERROR__CODECS__INVALID_CONSTANT = 8078018; - SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_SIZE = 8078019; - SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL = 8078020; - SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES = 8078021; - SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS = 8078022; - SOLANA_ERROR__RPC__INTEGER_OVERFLOW = 81e5; - SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN = 8100001; - SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR = 8100002; - SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD = 8100003; - SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN = 819e4; - SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID = 8190001; - SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED = 8190002; - SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED = 8190003; - SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT = 8190004; - SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING = 99e5; - SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE = 9900001; - SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING = 9900002; - SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE = 9900003; - SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENTED = 9900004; - SolanaErrorMessages = { - [SOLANA_ERROR__ACCOUNTS__ACCOUNT_NOT_FOUND]: "Account not found at address: $address", - [SOLANA_ERROR__ACCOUNTS__EXPECTED_ALL_ACCOUNTS_TO_BE_DECODED]: "Not all accounts were decoded. Encoded accounts found at addresses: $addresses.", - [SOLANA_ERROR__ACCOUNTS__EXPECTED_DECODED_ACCOUNT]: "Expected decoded account at address: $address", - [SOLANA_ERROR__ACCOUNTS__FAILED_TO_DECODE_ACCOUNT]: "Failed to decode account data at address: $address", - [SOLANA_ERROR__ACCOUNTS__ONE_OR_MORE_ACCOUNTS_NOT_FOUND]: "Accounts not found at addresses: $addresses", - [SOLANA_ERROR__ADDRESSES__FAILED_TO_FIND_VIABLE_PDA_BUMP_SEED]: "Unable to find a viable program address bump seed.", - [SOLANA_ERROR__ADDRESSES__INVALID_BASE58_ENCODED_ADDRESS]: "$putativeAddress is not a base58-encoded address.", - [SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH]: "Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.", - [SOLANA_ERROR__ADDRESSES__INVALID_ED25519_PUBLIC_KEY]: "The `CryptoKey` must be an `Ed25519` public key.", - [SOLANA_ERROR__ADDRESSES__INVALID_OFF_CURVE_ADDRESS]: "$putativeOffCurveAddress is not a base58-encoded off-curve address.", - [SOLANA_ERROR__ADDRESSES__INVALID_SEEDS_POINT_ON_CURVE]: "Invalid seeds; point must fall off the Ed25519 curve.", - [SOLANA_ERROR__ADDRESSES__MALFORMED_PDA]: "Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].", - [SOLANA_ERROR__ADDRESSES__MAX_NUMBER_OF_PDA_SEEDS_EXCEEDED]: "A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.", - [SOLANA_ERROR__ADDRESSES__MAX_PDA_SEED_LENGTH_EXCEEDED]: "The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.", - [SOLANA_ERROR__ADDRESSES__PDA_BUMP_SEED_OUT_OF_RANGE]: "Expected program derived address bump to be in the range [0, 255], got: $bump.", - [SOLANA_ERROR__ADDRESSES__PDA_ENDS_WITH_PDA_MARKER]: "Program address cannot end with PDA marker.", - [SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE]: "Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.", - [SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE]: "Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.", - [SOLANA_ERROR__BLOCK_HEIGHT_EXCEEDED]: "The network has progressed past the last block for which this transaction could have been committed.", - [SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY]: "Codec [$codecDescription] cannot decode empty byte arrays.", - [SOLANA_ERROR__CODECS__CANNOT_USE_LEXICAL_VALUES_AS_ENUM_DISCRIMINATORS]: "Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.", - [SOLANA_ERROR__CODECS__ENCODED_BYTES_MUST_NOT_INCLUDE_SENTINEL]: "Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].", - [SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH]: "Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].", - [SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH]: "Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].", - [SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH]: "Encoder and decoder must either both be fixed-size or variable-size.", - [SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE]: "Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.", - [SOLANA_ERROR__CODECS__EXPECTED_FIXED_LENGTH]: "Expected a fixed-size codec, got a variable-size one.", - [SOLANA_ERROR__CODECS__EXPECTED_POSITIVE_BYTE_LENGTH]: "Codec [$codecDescription] expected a positive byte length, got $bytesLength.", - [SOLANA_ERROR__CODECS__EXPECTED_VARIABLE_LENGTH]: "Expected a variable-size codec, got a fixed-size one.", - [SOLANA_ERROR__CODECS__EXPECTED_ZERO_VALUE_TO_MATCH_ITEM_FIXED_SIZE]: "Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].", - [SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH]: "Codec [$codecDescription] expected $expected bytes, got $bytesLength.", - [SOLANA_ERROR__CODECS__INVALID_CONSTANT]: "Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].", - [SOLANA_ERROR__CODECS__INVALID_DISCRIMINATED_UNION_VARIANT]: "Invalid discriminated union variant. Expected one of [$variants], got $value.", - [SOLANA_ERROR__CODECS__INVALID_ENUM_VARIANT]: "Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.", - [SOLANA_ERROR__CODECS__INVALID_LITERAL_UNION_VARIANT]: "Invalid literal union variant. Expected one of [$variants], got $value.", - [SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS]: "Expected [$codecDescription] to have $expected items, got $actual.", - [SOLANA_ERROR__CODECS__INVALID_STRING_FOR_BASE]: "Invalid value $value for base $base with alphabet $alphabet.", - [SOLANA_ERROR__CODECS__LITERAL_UNION_DISCRIMINATOR_OUT_OF_RANGE]: "Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.", - [SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE]: "Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.", - [SOLANA_ERROR__CODECS__OFFSET_OUT_OF_RANGE]: "Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.", - [SOLANA_ERROR__CODECS__SENTINEL_MISSING_IN_DECODED_BYTES]: "Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].", - [SOLANA_ERROR__CODECS__UNION_VARIANT_OUT_OF_RANGE]: "Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.", - [SOLANA_ERROR__CRYPTO__RANDOM_VALUES_FUNCTION_UNIMPLEMENTED]: "No random values implementation could be found.", - [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_ALREADY_INITIALIZED]: "instruction requires an uninitialized account", - [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_FAILED]: "instruction tries to borrow reference for an account which is already borrowed", - [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_BORROW_OUTSTANDING]: "instruction left account with an outstanding borrowed reference", - [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_SIZE_CHANGED]: "program other than the account's owner changed the size of the account data", - [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_DATA_TOO_SMALL]: "account data too small for instruction", - [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_EXECUTABLE]: "instruction expected an executable account", - [SOLANA_ERROR__INSTRUCTION_ERROR__ACCOUNT_NOT_RENT_EXEMPT]: "An account does not have enough lamports to be rent-exempt", - [SOLANA_ERROR__INSTRUCTION_ERROR__ARITHMETIC_OVERFLOW]: "Program arithmetic overflowed", - [SOLANA_ERROR__INSTRUCTION_ERROR__BORSH_IO_ERROR]: "Failed to serialize or deserialize account data: $encodedData", - [SOLANA_ERROR__INSTRUCTION_ERROR__BUILTIN_PROGRAMS_MUST_CONSUME_COMPUTE_UNITS]: "Builtin programs must consume compute units", - [SOLANA_ERROR__INSTRUCTION_ERROR__CALL_DEPTH]: "Cross-program invocation call depth too deep", - [SOLANA_ERROR__INSTRUCTION_ERROR__COMPUTATIONAL_BUDGET_EXCEEDED]: "Computational budget exceeded", - [SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM]: "custom program error: #$code", - [SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_INDEX]: "instruction contains duplicate accounts", - [SOLANA_ERROR__INSTRUCTION_ERROR__DUPLICATE_ACCOUNT_OUT_OF_SYNC]: "instruction modifications of multiply-passed account differ", - [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_ACCOUNT_NOT_RENT_EXEMPT]: "executable accounts must be rent exempt", - [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_DATA_MODIFIED]: "instruction changed executable accounts data", - [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_LAMPORT_CHANGE]: "instruction changed the balance of an executable account", - [SOLANA_ERROR__INSTRUCTION_ERROR__EXECUTABLE_MODIFIED]: "instruction changed executable bit of an account", - [SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_DATA_MODIFIED]: "instruction modified data of an account it does not own", - [SOLANA_ERROR__INSTRUCTION_ERROR__EXTERNAL_ACCOUNT_LAMPORT_SPEND]: "instruction spent from the balance of an account it does not own", - [SOLANA_ERROR__INSTRUCTION_ERROR__GENERIC_ERROR]: "generic instruction error", - [SOLANA_ERROR__INSTRUCTION_ERROR__ILLEGAL_OWNER]: "Provided owner is not allowed", - [SOLANA_ERROR__INSTRUCTION_ERROR__IMMUTABLE]: "Account is immutable", - [SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_AUTHORITY]: "Incorrect authority provided", - [SOLANA_ERROR__INSTRUCTION_ERROR__INCORRECT_PROGRAM_ID]: "incorrect program id for instruction", - [SOLANA_ERROR__INSTRUCTION_ERROR__INSUFFICIENT_FUNDS]: "insufficient funds for instruction", - [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_DATA]: "invalid account data for instruction", - [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ACCOUNT_OWNER]: "Invalid account owner", - [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ARGUMENT]: "invalid program argument", - [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_ERROR]: "program returned invalid error code", - [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_INSTRUCTION_DATA]: "invalid instruction data", - [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_REALLOC]: "Failed to reallocate account data", - [SOLANA_ERROR__INSTRUCTION_ERROR__INVALID_SEEDS]: "Provided seeds do not result in a valid address", - [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_DATA_ALLOCATIONS_EXCEEDED]: "Accounts data allocations exceeded the maximum allowed per transaction", - [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_ACCOUNTS_EXCEEDED]: "Max accounts exceeded", - [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_INSTRUCTION_TRACE_LENGTH_EXCEEDED]: "Max instruction trace length exceeded", - [SOLANA_ERROR__INSTRUCTION_ERROR__MAX_SEED_LENGTH_EXCEEDED]: "Length of the seed is too long for address generation", - [SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_ACCOUNT]: "An account required by the instruction is missing", - [SOLANA_ERROR__INSTRUCTION_ERROR__MISSING_REQUIRED_SIGNATURE]: "missing required signature for instruction", - [SOLANA_ERROR__INSTRUCTION_ERROR__MODIFIED_PROGRAM_ID]: "instruction illegally modified the program id of an account", - [SOLANA_ERROR__INSTRUCTION_ERROR__NOT_ENOUGH_ACCOUNT_KEYS]: "insufficient account keys for instruction", - [SOLANA_ERROR__INSTRUCTION_ERROR__PRIVILEGE_ESCALATION]: "Cross-program invocation with unauthorized signer or writable account", - [SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_ENVIRONMENT_SETUP_FAILURE]: "Failed to create program execution environment", - [SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPILE]: "Program failed to compile", - [SOLANA_ERROR__INSTRUCTION_ERROR__PROGRAM_FAILED_TO_COMPLETE]: "Program failed to complete", - [SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_DATA_MODIFIED]: "instruction modified data of a read-only account", - [SOLANA_ERROR__INSTRUCTION_ERROR__READONLY_LAMPORT_CHANGE]: "instruction changed the balance of a read-only account", - [SOLANA_ERROR__INSTRUCTION_ERROR__REENTRANCY_NOT_ALLOWED]: "Cross-program invocation reentrancy not allowed for this instruction", - [SOLANA_ERROR__INSTRUCTION_ERROR__RENT_EPOCH_MODIFIED]: "instruction modified rent epoch of an account", - [SOLANA_ERROR__INSTRUCTION_ERROR__UNBALANCED_INSTRUCTION]: "sum of account balances before and after instruction do not match", - [SOLANA_ERROR__INSTRUCTION_ERROR__UNINITIALIZED_ACCOUNT]: "instruction requires an initialized account", - [SOLANA_ERROR__INSTRUCTION_ERROR__UNKNOWN]: "", - [SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_PROGRAM_ID]: "Unsupported program id", - [SOLANA_ERROR__INSTRUCTION_ERROR__UNSUPPORTED_SYSVAR]: "Unsupported sysvar", - [SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_ACCOUNTS]: "The instruction does not have any accounts.", - [SOLANA_ERROR__INSTRUCTION__EXPECTED_TO_HAVE_DATA]: "The instruction does not have any data.", - [SOLANA_ERROR__INSTRUCTION__PROGRAM_ID_MISMATCH]: "Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.", - [SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH]: "Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.", - [SOLANA_ERROR__INVALID_NONCE]: "The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`", - [SOLANA_ERROR__INVARIANT_VIOLATION__CACHED_ABORTABLE_ITERABLE_CACHE_ENTRY_MISSING]: "Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", - [SOLANA_ERROR__INVARIANT_VIOLATION__DATA_PUBLISHER_CHANNEL_UNIMPLEMENTED]: "Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.", - [SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_MUST_NOT_POLL_BEFORE_RESOLVING_EXISTING_MESSAGE_PROMISE]: "Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", - [SOLANA_ERROR__INVARIANT_VIOLATION__SUBSCRIPTION_ITERATOR_STATE_MISSING]: "Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", - [SOLANA_ERROR__INVARIANT_VIOLATION__SWITCH_MUST_BE_EXHAUSTIVE]: "Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", - [SOLANA_ERROR__JSON_RPC__INTERNAL_ERROR]: "JSON-RPC error: Internal JSON-RPC error ($__serverMessage)", - [SOLANA_ERROR__JSON_RPC__INVALID_PARAMS]: "JSON-RPC error: Invalid method parameter(s) ($__serverMessage)", - [SOLANA_ERROR__JSON_RPC__INVALID_REQUEST]: "JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)", - [SOLANA_ERROR__JSON_RPC__METHOD_NOT_FOUND]: "JSON-RPC error: The method does not exist / is not available ($__serverMessage)", - [SOLANA_ERROR__JSON_RPC__PARSE_ERROR]: "JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)", - [SOLANA_ERROR__JSON_RPC__SCAN_ERROR]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_CLEANED_UP]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_NOT_AVAILABLE]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED]: "Minimum context slot has not been reached", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NODE_UNHEALTHY]: "Node is unhealthy; behind by $numSlotsBehind slots", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_NO_SNAPSHOT]: "No snapshot", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE]: "Transaction simulation failed", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SLOT_SKIPPED]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE]: "Transaction history is not available from this node", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE]: "$__serverMessage", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH]: "Transaction signature length mismatch", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE]: "Transaction signature verification failure", - [SOLANA_ERROR__JSON_RPC__SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION]: "$__serverMessage", - [SOLANA_ERROR__KEYS__INVALID_KEY_PAIR_BYTE_LENGTH]: "Key pair bytes must be of length 64, got $byteLength.", - [SOLANA_ERROR__KEYS__INVALID_PRIVATE_KEY_BYTE_LENGTH]: "Expected private key bytes with length 32. Actual length: $actualLength.", - [SOLANA_ERROR__KEYS__INVALID_SIGNATURE_BYTE_LENGTH]: "Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.", - [SOLANA_ERROR__KEYS__PUBLIC_KEY_MUST_MATCH_PRIVATE_KEY]: "The provided private key does not match the provided public key.", - [SOLANA_ERROR__KEYS__SIGNATURE_STRING_LENGTH_OUT_OF_RANGE]: "Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.", - [SOLANA_ERROR__LAMPORTS_OUT_OF_RANGE]: "Lamports value must be in the range [0, 2e64-1]", - [SOLANA_ERROR__MALFORMED_BIGINT_STRING]: "`$value` cannot be parsed as a `BigInt`", - [SOLANA_ERROR__MALFORMED_JSON_RPC_ERROR]: "$message", - [SOLANA_ERROR__MALFORMED_NUMBER_STRING]: "`$value` cannot be parsed as a `Number`", - [SOLANA_ERROR__NONCE_ACCOUNT_NOT_FOUND]: "No nonce account could be found at address `$nonceAccountAddress`", - [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CANNOT_CREATE_SUBSCRIPTION_PLAN]: "The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.", - [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CLOSED_BEFORE_MESSAGE_BUFFERED]: "WebSocket was closed before payload could be added to the send buffer", - [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_CONNECTION_CLOSED]: "WebSocket connection closed", - [SOLANA_ERROR__RPC_SUBSCRIPTIONS__CHANNEL_FAILED_TO_CONNECT]: "WebSocket failed to connect", - [SOLANA_ERROR__RPC_SUBSCRIPTIONS__EXPECTED_SERVER_SUBSCRIPTION_ID]: "Failed to obtain a subscription id from the server", - [SOLANA_ERROR__RPC__API_PLAN_MISSING_FOR_RPC_METHOD]: "Could not find an API plan for RPC method: `$method`", - [SOLANA_ERROR__RPC__INTEGER_OVERFLOW]: "The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.", - [SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR]: "HTTP error ($statusCode): $message", - [SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN]: "HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.", - [SOLANA_ERROR__SIGNER__ADDRESS_CANNOT_HAVE_MULTIPLE_SIGNERS]: "Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.", - [SOLANA_ERROR__SIGNER__EXPECTED_KEY_PAIR_SIGNER]: "The provided value does not implement the `KeyPairSigner` interface", - [SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_MODIFYING_SIGNER]: "The provided value does not implement the `MessageModifyingSigner` interface", - [SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_PARTIAL_SIGNER]: "The provided value does not implement the `MessagePartialSigner` interface", - [SOLANA_ERROR__SIGNER__EXPECTED_MESSAGE_SIGNER]: "The provided value does not implement any of the `MessageSigner` interfaces", - [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_MODIFYING_SIGNER]: "The provided value does not implement the `TransactionModifyingSigner` interface", - [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_PARTIAL_SIGNER]: "The provided value does not implement the `TransactionPartialSigner` interface", - [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER]: "The provided value does not implement the `TransactionSendingSigner` interface", - [SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER]: "The provided value does not implement any of the `TransactionSigner` interfaces", - [SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS]: "More than one `TransactionSendingSigner` was identified.", - [SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING]: "No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.", - [SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED]: "Wallet account signers do not support signing multiple messages/transactions in a single operation", - [SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY]: "Cannot export a non-extractable key.", - [SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED]: "No digest implementation could be found.", - [SOLANA_ERROR__SUBTLE_CRYPTO__DISALLOWED_IN_INSECURE_CONTEXT]: "Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.", - [SOLANA_ERROR__SUBTLE_CRYPTO__ED25519_ALGORITHM_UNIMPLEMENTED]: "This runtime does not support the generation of Ed25519 key pairs.\n\nInstall @solana/webcrypto-ed25519-polyfill and call its `install` function before generating keys in environments that do not support Ed25519.\n\nFor a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.", - [SOLANA_ERROR__SUBTLE_CRYPTO__EXPORT_FUNCTION_UNIMPLEMENTED]: "No signature verification implementation could be found.", - [SOLANA_ERROR__SUBTLE_CRYPTO__GENERATE_FUNCTION_UNIMPLEMENTED]: "No key generation implementation could be found.", - [SOLANA_ERROR__SUBTLE_CRYPTO__SIGN_FUNCTION_UNIMPLEMENTED]: "No signing implementation could be found.", - [SOLANA_ERROR__SUBTLE_CRYPTO__VERIFY_FUNCTION_UNIMPLEMENTED]: "No key export implementation could be found.", - [SOLANA_ERROR__TIMESTAMP_OUT_OF_RANGE]: "Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given", - [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_BORROW_OUTSTANDING]: "Transaction processing left an account with an outstanding borrowed reference", - [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE]: "Account in use", - [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE]: "Account loaded twice", - [SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_NOT_FOUND]: "Attempt to debit an account but found no record of a prior credit.", - [SOLANA_ERROR__TRANSACTION_ERROR__ADDRESS_LOOKUP_TABLE_NOT_FOUND]: "Transaction loads an address table account that doesn't exist", - [SOLANA_ERROR__TRANSACTION_ERROR__ALREADY_PROCESSED]: "This transaction has already been processed", - [SOLANA_ERROR__TRANSACTION_ERROR__BLOCKHASH_NOT_FOUND]: "Blockhash not found", - [SOLANA_ERROR__TRANSACTION_ERROR__CALL_CHAIN_TOO_DEEP]: "Loader call chain is too deep", - [SOLANA_ERROR__TRANSACTION_ERROR__CLUSTER_MAINTENANCE]: "Transactions are currently disabled due to cluster maintenance", - [SOLANA_ERROR__TRANSACTION_ERROR__DUPLICATE_INSTRUCTION]: "Transaction contains a duplicate instruction ($index) that is not allowed", - [SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_FEE]: "Insufficient funds for fee", - [SOLANA_ERROR__TRANSACTION_ERROR__INSUFFICIENT_FUNDS_FOR_RENT]: "Transaction results in an account ($accountIndex) with insufficient funds for rent", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_FOR_FEE]: "This account may not be used to pay transaction fees", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ACCOUNT_INDEX]: "Transaction contains an invalid account reference", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_DATA]: "Transaction loads an address table account with invalid data", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_INDEX]: "Transaction address table lookup uses an invalid index", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_ADDRESS_LOOKUP_TABLE_OWNER]: "Transaction loads an address table account with an invalid owner", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_LOADED_ACCOUNTS_DATA_SIZE_LIMIT]: "LoadedAccountsDataSizeLimit set for transaction must be greater than 0.", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_PROGRAM_FOR_EXECUTION]: "This program may not be used for executing instructions", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_RENT_PAYING_ACCOUNT]: "Transaction leaves an account with a lower balance than rent-exempt minimum", - [SOLANA_ERROR__TRANSACTION_ERROR__INVALID_WRITABLE_ACCOUNT]: "Transaction loads a writable account that cannot be written", - [SOLANA_ERROR__TRANSACTION_ERROR__MAX_LOADED_ACCOUNTS_DATA_SIZE_EXCEEDED]: "Transaction exceeded max loaded accounts data size cap", - [SOLANA_ERROR__TRANSACTION_ERROR__MISSING_SIGNATURE_FOR_FEE]: "Transaction requires a fee but has no signature present", - [SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_ACCOUNT_NOT_FOUND]: "Attempt to load a program that does not exist", - [SOLANA_ERROR__TRANSACTION_ERROR__PROGRAM_EXECUTION_TEMPORARILY_RESTRICTED]: "Execution of the program referenced by account at index $accountIndex is temporarily restricted.", - [SOLANA_ERROR__TRANSACTION_ERROR__RESANITIZATION_NEEDED]: "ResanitizationNeeded", - [SOLANA_ERROR__TRANSACTION_ERROR__SANITIZE_FAILURE]: "Transaction failed to sanitize accounts offsets correctly", - [SOLANA_ERROR__TRANSACTION_ERROR__SIGNATURE_FAILURE]: "Transaction did not pass signature verification", - [SOLANA_ERROR__TRANSACTION_ERROR__TOO_MANY_ACCOUNT_LOCKS]: "Transaction locked too many accounts", - [SOLANA_ERROR__TRANSACTION_ERROR__UNBALANCED_TRANSACTION]: "Sum of account balances before and after transaction do not match", - [SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN]: "The transaction failed with the error `$errorName`", - [SOLANA_ERROR__TRANSACTION_ERROR__UNSUPPORTED_VERSION]: "Transaction version is unsupported", - [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_BLOCK_LIMIT]: "Transaction would exceed account data limit within the block", - [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_ACCOUNT_DATA_TOTAL_LIMIT]: "Transaction would exceed total account data limit", - [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_ACCOUNT_COST_LIMIT]: "Transaction would exceed max account limit within the block", - [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_BLOCK_COST_LIMIT]: "Transaction would exceed max Block Cost Limit", - [SOLANA_ERROR__TRANSACTION_ERROR__WOULD_EXCEED_MAX_VOTE_COST_LIMIT]: "Transaction would exceed max Vote Cost Limit", - [SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION]: "Attempted to sign a transaction with an address that is not a signer for it", - [SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING]: "Transaction is missing an address at index: $index.", - [SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES]: "Transaction has no expected signers therefore it cannot be encoded", - [SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT]: "Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes", - [SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME]: "Transaction does not have a blockhash lifetime", - [SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME]: "Transaction is not a durable nonce transaction", - [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING]: "Contents of these address lookup tables unknown: $lookupTableAddresses", - [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_INDEX_OUT_OF_RANGE]: "Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved", - [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_FEE_PAYER_MISSING]: "No fee payer set in CompiledTransaction", - [SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_INSTRUCTION_PROGRAM_ADDRESS_NOT_FOUND]: "Could not find program address at index $index", - [SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT]: "Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more", - [SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT]: "Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more", - [SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING]: "Transaction is missing a fee payer.", - [SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING]: "Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.", - [SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE]: "Transaction first instruction is not advance nonce account instruction.", - [SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING]: "Transaction with no instructions cannot be durable nonce transaction.", - [SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES]: "This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees", - [SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_MUST_NOT_BE_WRITABLE]: "This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable", - [SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH]: "The transaction message expected the transaction to have $signerAddressesLength signatures, got $signaturesLength.", - [SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING]: "Transaction is missing signatures for addresses: $addresses.", - [SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE]: "Transaction version must be in the range [0, 127]. `$actualVersion` given" - }; - START_INDEX = "i"; - TYPE = "t"; - SolanaError = class extends Error { - /** - * Indicates the root cause of this {@link SolanaError}, if any. - * - * For example, a transaction error might have an instruction error as its root cause. In this - * case, you will be able to access the instruction error on the transaction error as `cause`. - */ - cause = this.cause; - /** - * Contains context that can assist in understanding or recovering from a {@link SolanaError}. - */ - context; - constructor(...[code, contextAndErrorOptions]) { - let context; - let errorOptions; - if (contextAndErrorOptions) { - const { cause, ...contextRest } = contextAndErrorOptions; - if (cause) { - errorOptions = { cause }; - } - if (Object.keys(contextRest).length > 0) { - context = contextRest; - } - } - const message = getErrorMessage(code, context); - super(message, errorOptions); - this.context = { - __code: code, - ...context - }; - this.name = "SolanaError"; - } - }; - } -}); - -// ../../node_modules/.pnpm/@solana+codecs-core@2.3.0_typescript@5.9.3/node_modules/@solana/codecs-core/dist/index.node.mjs -function getEncodedSize(value, encoder) { - return "fixedSize" in encoder ? encoder.fixedSize : encoder.getSizeFromValue(value); -} -function createEncoder(encoder) { - return Object.freeze({ - ...encoder, - encode: (value) => { - const bytes = new Uint8Array(getEncodedSize(value, encoder)); - encoder.write(value, bytes, 0); - return bytes; - } - }); -} -function createDecoder(decoder) { - return Object.freeze({ - ...decoder, - decode: (bytes, offset2 = 0) => decoder.read(bytes, offset2)[0] - }); -} -function isFixedSize(codec) { - return "fixedSize" in codec && typeof codec.fixedSize === "number"; -} -function combineCodec(encoder, decoder) { - if (isFixedSize(encoder) !== isFixedSize(decoder)) { - throw new SolanaError(SOLANA_ERROR__CODECS__ENCODER_DECODER_SIZE_COMPATIBILITY_MISMATCH); - } - if (isFixedSize(encoder) && isFixedSize(decoder) && encoder.fixedSize !== decoder.fixedSize) { - throw new SolanaError(SOLANA_ERROR__CODECS__ENCODER_DECODER_FIXED_SIZE_MISMATCH, { - decoderFixedSize: decoder.fixedSize, - encoderFixedSize: encoder.fixedSize - }); - } - if (!isFixedSize(encoder) && !isFixedSize(decoder) && encoder.maxSize !== decoder.maxSize) { - throw new SolanaError(SOLANA_ERROR__CODECS__ENCODER_DECODER_MAX_SIZE_MISMATCH, { - decoderMaxSize: decoder.maxSize, - encoderMaxSize: encoder.maxSize - }); - } - return { - ...decoder, - ...encoder, - decode: decoder.decode, - encode: encoder.encode, - read: decoder.read, - write: encoder.write - }; -} -function assertByteArrayIsNotEmptyForCodec(codecDescription, bytes, offset2 = 0) { - if (bytes.length - offset2 <= 0) { - throw new SolanaError(SOLANA_ERROR__CODECS__CANNOT_DECODE_EMPTY_BYTE_ARRAY, { - codecDescription - }); - } -} -function assertByteArrayHasEnoughBytesForCodec(codecDescription, expected, bytes, offset2 = 0) { - const bytesLength = bytes.length - offset2; - if (bytesLength < expected) { - throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH, { - bytesLength, - codecDescription, - expected - }); - } -} -var init_index_node2 = __esm({ - "../../node_modules/.pnpm/@solana+codecs-core@2.3.0_typescript@5.9.3/node_modules/@solana/codecs-core/dist/index.node.mjs"() { - init_index_node(); - } -}); - -// ../../node_modules/.pnpm/@solana+codecs-numbers@2.3.0_typescript@5.9.3/node_modules/@solana/codecs-numbers/dist/index.node.mjs -function assertNumberIsBetweenForCodec(codecDescription, min, max, value) { - if (value < min || value > max) { - throw new SolanaError(SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE, { - codecDescription, - max, - min, - value - }); - } -} -function isLittleEndian(config) { - return config?.endian === 1 ? false : true; -} -function numberEncoderFactory(input) { - return createEncoder({ - fixedSize: input.size, - write(value, bytes, offset2) { - if (input.range) { - assertNumberIsBetweenForCodec(input.name, input.range[0], input.range[1], value); - } - const arrayBuffer = new ArrayBuffer(input.size); - input.set(new DataView(arrayBuffer), value, isLittleEndian(input.config)); - bytes.set(new Uint8Array(arrayBuffer), offset2); - return offset2 + input.size; - } - }); -} -function numberDecoderFactory(input) { - return createDecoder({ - fixedSize: input.size, - read(bytes, offset2 = 0) { - assertByteArrayIsNotEmptyForCodec(input.name, bytes, offset2); - assertByteArrayHasEnoughBytesForCodec(input.name, input.size, bytes, offset2); - const view = new DataView(toArrayBuffer(bytes, offset2, input.size)); - return [input.get(view, isLittleEndian(input.config)), offset2 + input.size]; - } - }); -} -function toArrayBuffer(bytes, offset2, length) { - const bytesOffset = bytes.byteOffset + (offset2 ?? 0); - const bytesLength = length ?? bytes.byteLength; - return bytes.buffer.slice(bytesOffset, bytesOffset + bytesLength); -} -var getU64Encoder, getU64Decoder, getU64Codec; -var init_index_node3 = __esm({ - "../../node_modules/.pnpm/@solana+codecs-numbers@2.3.0_typescript@5.9.3/node_modules/@solana/codecs-numbers/dist/index.node.mjs"() { - init_index_node(); - init_index_node2(); - getU64Encoder = (config = {}) => numberEncoderFactory({ - config, - name: "u64", - range: [0n, BigInt("0xffffffffffffffff")], - set: (view, value, le) => view.setBigUint64(0, BigInt(value), le), - size: 8 - }); - getU64Decoder = (config = {}) => numberDecoderFactory({ - config, - get: (view, le) => view.getBigUint64(0, le), - name: "u64", - size: 8 - }); - getU64Codec = (config = {}) => combineCodec(getU64Encoder(config), getU64Decoder(config)); - } -}); - -// ../../node_modules/.pnpm/superstruct@2.0.2/node_modules/superstruct/dist/index.mjs -function isIterable(x) { - return isObject(x) && typeof x[Symbol.iterator] === "function"; -} -function isObject(x) { - return typeof x === "object" && x != null; -} -function isNonArrayObject(x) { - return isObject(x) && !Array.isArray(x); -} -function print(value) { - if (typeof value === "symbol") { - return value.toString(); - } - return typeof value === "string" ? JSON.stringify(value) : `${value}`; -} -function shiftIterator(input) { - const { done, value } = input.next(); - return done ? void 0 : value; -} -function toFailure(result, context, struct2, value) { - if (result === true) { - return; - } else if (result === false) { - result = {}; - } else if (typeof result === "string") { - result = { message: result }; - } - const { path: path2, branch } = context; - const { type: type2 } = struct2; - const { refinement, message = `Expected a value of type \`${type2}\`${refinement ? ` with refinement \`${refinement}\`` : ""}, but received: \`${print(value)}\`` } = result; - return { - value, - type: type2, - refinement, - key: path2[path2.length - 1], - path: path2, - branch, - ...result, - message - }; -} -function* toFailures(result, context, struct2, value) { - if (!isIterable(result)) { - result = [result]; - } - for (const r of result) { - const failure = toFailure(r, context, struct2, value); - if (failure) { - yield failure; - } - } -} -function* run(value, struct2, options = {}) { - const { path: path2 = [], branch = [value], coerce: coerce2 = false, mask: mask2 = false } = options; - const ctx = { path: path2, branch, mask: mask2 }; - if (coerce2) { - value = struct2.coercer(value, ctx); - } - let status = "valid"; - for (const failure of struct2.validator(value, ctx)) { - failure.explanation = options.message; - status = "not_valid"; - yield [failure, void 0]; - } - for (let [k, v, s] of struct2.entries(value, ctx)) { - const ts = run(v, s, { - path: k === void 0 ? path2 : [...path2, k], - branch: k === void 0 ? branch : [...branch, v], - coerce: coerce2, - mask: mask2, - message: options.message - }); - for (const t of ts) { - if (t[0]) { - status = t[0].refinement != null ? "not_refined" : "not_valid"; - yield [t[0], void 0]; - } else if (coerce2) { - v = t[1]; - if (k === void 0) { - value = v; - } else if (value instanceof Map) { - value.set(k, v); - } else if (value instanceof Set) { - value.add(v); - } else if (isObject(value)) { - if (v !== void 0 || k in value) - value[k] = v; - } - } - } - } - if (status !== "not_valid") { - for (const failure of struct2.refiner(value, ctx)) { - failure.explanation = options.message; - status = "not_refined"; - yield [failure, void 0]; - } - } - if (status === "valid") { - yield [void 0, value]; - } -} -function assert(value, struct2, message) { - const result = validate(value, struct2, { message }); - if (result[0]) { - throw result[0]; - } -} -function create(value, struct2, message) { - const result = validate(value, struct2, { coerce: true, message }); - if (result[0]) { - throw result[0]; - } else { - return result[1]; - } -} -function mask(value, struct2, message) { - const result = validate(value, struct2, { coerce: true, mask: true, message }); - if (result[0]) { - throw result[0]; - } else { - return result[1]; - } -} -function is(value, struct2) { - const result = validate(value, struct2); - return !result[0]; -} -function validate(value, struct2, options = {}) { - const tuples = run(value, struct2, options); - const tuple2 = shiftIterator(tuples); - if (tuple2[0]) { - const error = new StructError(tuple2[0], function* () { - for (const t of tuples) { - if (t[0]) { - yield t[0]; - } - } - }); - return [error, void 0]; - } else { - const v = tuple2[1]; - return [void 0, v]; - } -} -function define(name, validator) { - return new Struct({ type: name, schema: null, validator }); -} -function any() { - return define("any", () => true); -} -function array(Element) { - return new Struct({ - type: "array", - schema: Element, - *entries(value) { - if (Element && Array.isArray(value)) { - for (const [i, v] of value.entries()) { - yield [i, v, Element]; - } - } - }, - coercer(value) { - return Array.isArray(value) ? value.slice() : value; - }, - validator(value) { - return Array.isArray(value) || `Expected an array value, but received: ${print(value)}`; - } - }); -} -function boolean() { - return define("boolean", (value) => { - return typeof value === "boolean"; - }); -} -function instance(Class) { - return define("instance", (value) => { - return value instanceof Class || `Expected a \`${Class.name}\` instance, but received: ${print(value)}`; - }); -} -function literal(constant) { - const description = print(constant); - const t = typeof constant; - return new Struct({ - type: "literal", - schema: t === "string" || t === "number" || t === "boolean" ? constant : null, - validator(value) { - return value === constant || `Expected the literal \`${description}\`, but received: ${print(value)}`; - } - }); -} -function never() { - return define("never", () => false); -} -function nullable(struct2) { - return new Struct({ - ...struct2, - validator: (value, ctx) => value === null || struct2.validator(value, ctx), - refiner: (value, ctx) => value === null || struct2.refiner(value, ctx) - }); -} -function number() { - return define("number", (value) => { - return typeof value === "number" && !isNaN(value) || `Expected a number, but received: ${print(value)}`; - }); -} -function optional(struct2) { - return new Struct({ - ...struct2, - validator: (value, ctx) => value === void 0 || struct2.validator(value, ctx), - refiner: (value, ctx) => value === void 0 || struct2.refiner(value, ctx) - }); -} -function record(Key, Value) { - return new Struct({ - type: "record", - schema: null, - *entries(value) { - if (isObject(value)) { - for (const k in value) { - const v = value[k]; - yield [k, k, Key]; - yield [k, v, Value]; - } - } - }, - validator(value) { - return isNonArrayObject(value) || `Expected an object, but received: ${print(value)}`; - }, - coercer(value) { - return isNonArrayObject(value) ? { ...value } : value; - } - }); -} -function string() { - return define("string", (value) => { - return typeof value === "string" || `Expected a string, but received: ${print(value)}`; - }); -} -function tuple(Structs) { - const Never = never(); - return new Struct({ - type: "tuple", - schema: null, - *entries(value) { - if (Array.isArray(value)) { - const length = Math.max(Structs.length, value.length); - for (let i = 0; i < length; i++) { - yield [i, value[i], Structs[i] || Never]; - } - } - }, - validator(value) { - return Array.isArray(value) || `Expected an array, but received: ${print(value)}`; - }, - coercer(value) { - return Array.isArray(value) ? value.slice() : value; - } - }); -} -function type(schema) { - const keys = Object.keys(schema); - return new Struct({ - type: "type", - schema, - *entries(value) { - if (isObject(value)) { - for (const k of keys) { - yield [k, value[k], schema[k]]; - } - } - }, - validator(value) { - return isNonArrayObject(value) || `Expected an object, but received: ${print(value)}`; - }, - coercer(value) { - return isNonArrayObject(value) ? { ...value } : value; - } - }); -} -function union(Structs) { - const description = Structs.map((s) => s.type).join(" | "); - return new Struct({ - type: "union", - schema: null, - coercer(value, ctx) { - for (const S of Structs) { - const [error, coerced] = S.validate(value, { - coerce: true, - mask: ctx.mask - }); - if (!error) { - return coerced; - } - } - return value; - }, - validator(value, ctx) { - const failures = []; - for (const S of Structs) { - const [...tuples] = run(value, S, ctx); - const [first] = tuples; - if (!first[0]) { - return []; - } else { - for (const [failure] of tuples) { - if (failure) { - failures.push(failure); - } - } - } - } - return [ - `Expected the value to satisfy a union of \`${description}\`, but received: ${print(value)}`, - ...failures - ]; - } - }); -} -function unknown() { - return define("unknown", () => true); -} -function coerce(struct2, condition, coercer) { - return new Struct({ - ...struct2, - coercer: (value, ctx) => { - return is(value, condition) ? struct2.coercer(coercer(value, ctx), ctx) : struct2.coercer(value, ctx); - } - }); -} -var StructError, Struct; -var init_dist = __esm({ - "../../node_modules/.pnpm/superstruct@2.0.2/node_modules/superstruct/dist/index.mjs"() { - StructError = class extends TypeError { - constructor(failure, failures) { - let cached; - const { message, explanation, ...rest } = failure; - const { path: path2 } = failure; - const msg = path2.length === 0 ? message : `At path: ${path2.join(".")} -- ${message}`; - super(explanation ?? msg); - if (explanation != null) - this.cause = msg; - Object.assign(this, rest); - this.name = this.constructor.name; - this.failures = () => { - return cached ?? (cached = [failure, ...failures()]); - }; - } - }; - Struct = class { - constructor(props) { - const { type: type2, schema, validator, refiner, coercer = (value) => value, entries = function* () { - } } = props; - this.type = type2; - this.schema = schema; - this.entries = entries; - this.coercer = coercer; - if (validator) { - this.validator = (value, context) => { - const result = validator(value, context); - return toFailures(result, context, this, value); - }; - } else { - this.validator = () => []; - } - if (refiner) { - this.refiner = (value, context) => { - const result = refiner(value, context); - return toFailures(result, context, this, value); - }; - } else { - this.refiner = () => []; - } - } - /** - * Assert that a value passes the struct's validation, throwing if it doesn't. - */ - assert(value, message) { - return assert(value, this, message); - } - /** - * Create a value with the struct's coercion logic, then validate it. - */ - create(value, message) { - return create(value, this, message); - } - /** - * Check if a value passes the struct's validation. - */ - is(value) { - return is(value, this); - } - /** - * Mask a value, coercing and validating it, but returning only the subset of - * properties defined by the struct's schema. Masking applies recursively to - * props of `object` structs only. - */ - mask(value, message) { - return mask(value, this, message); - } - /** - * Validate a value with the struct's validation logic, returning a tuple - * representing the result. - * - * You may optionally pass `true` for the `coerce` argument to coerce - * the value before attempting to validate it. If you do, the result will - * contain the coerced result when successful. Also, `mask` will turn on - * masking of the unknown `object` props recursively if passed. - */ - validate(value, options = {}) { - return validate(value, this, options); - } - }; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/rng.js -function rng() { - if (poolPtr > rnds8Pool.length - 16) { - import_crypto2.default.randomFillSync(rnds8Pool); - poolPtr = 0; - } - return rnds8Pool.slice(poolPtr, poolPtr += 16); -} -var import_crypto2, rnds8Pool, poolPtr; -var init_rng = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/rng.js"() { - import_crypto2 = __toESM(require("crypto")); - rnds8Pool = new Uint8Array(256); - poolPtr = rnds8Pool.length; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/regex.js -var regex_default; -var init_regex = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/regex.js"() { - regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/validate.js -function validate2(uuid) { - return typeof uuid === "string" && regex_default.test(uuid); -} -var validate_default; -var init_validate = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/validate.js"() { - init_regex(); - validate_default = validate2; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/stringify.js -function stringify(arr, offset2 = 0) { - const uuid = (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase(); - if (!validate_default(uuid)) { - throw TypeError("Stringified UUID is invalid"); - } - return uuid; -} -var byteToHex, stringify_default; -var init_stringify = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/stringify.js"() { - init_validate(); - byteToHex = []; - for (let i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).substr(1)); - } - stringify_default = stringify; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v1.js -function v1(options, buf, offset2) { - let i = buf && offset2 || 0; - const b = buf || new Array(16); - options = options || {}; - let node = options.node || _nodeId; - let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq; - if (node == null || clockseq == null) { - const seedBytes = options.random || (options.rng || rng)(); - if (node == null) { - node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]]; - } - if (clockseq == null) { - clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383; - } - } - let msecs = options.msecs !== void 0 ? options.msecs : Date.now(); - let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1; - const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4; - if (dt < 0 && options.clockseq === void 0) { - clockseq = clockseq + 1 & 16383; - } - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) { - nsecs = 0; - } - if (nsecs >= 1e4) { - throw new Error("uuid.v1(): Can't create more than 10M uuids/sec"); - } - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - msecs += 122192928e5; - const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296; - b[i++] = tl >>> 24 & 255; - b[i++] = tl >>> 16 & 255; - b[i++] = tl >>> 8 & 255; - b[i++] = tl & 255; - const tmh = msecs / 4294967296 * 1e4 & 268435455; - b[i++] = tmh >>> 8 & 255; - b[i++] = tmh & 255; - b[i++] = tmh >>> 24 & 15 | 16; - b[i++] = tmh >>> 16 & 255; - b[i++] = clockseq >>> 8 | 128; - b[i++] = clockseq & 255; - for (let n = 0; n < 6; ++n) { - b[i + n] = node[n]; - } - return buf || stringify_default(b); -} -var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default; -var init_v1 = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v1.js"() { - init_rng(); - init_stringify(); - _lastMSecs = 0; - _lastNSecs = 0; - v1_default = v1; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/parse.js -function parse(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - let v; - const arr = new Uint8Array(16); - arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24; - arr[1] = v >>> 16 & 255; - arr[2] = v >>> 8 & 255; - arr[3] = v & 255; - arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8; - arr[5] = v & 255; - arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8; - arr[7] = v & 255; - arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8; - arr[9] = v & 255; - arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255; - arr[11] = v / 4294967296 & 255; - arr[12] = v >>> 24 & 255; - arr[13] = v >>> 16 & 255; - arr[14] = v >>> 8 & 255; - arr[15] = v & 255; - return arr; -} -var parse_default; -var init_parse = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/parse.js"() { - init_validate(); - parse_default = parse; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v35.js -function stringToBytes(str) { - str = unescape(encodeURIComponent(str)); - const bytes = []; - for (let i = 0; i < str.length; ++i) { - bytes.push(str.charCodeAt(i)); - } - return bytes; -} -function v35_default(name, version2, hashfunc) { - function generateUUID(value, namespace, buf, offset2) { - if (typeof value === "string") { - value = stringToBytes(value); - } - if (typeof namespace === "string") { - namespace = parse_default(namespace); - } - if (namespace.length !== 16) { - throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)"); - } - let bytes = new Uint8Array(16 + value.length); - bytes.set(namespace); - bytes.set(value, namespace.length); - bytes = hashfunc(bytes); - bytes[6] = bytes[6] & 15 | version2; - bytes[8] = bytes[8] & 63 | 128; - if (buf) { - offset2 = offset2 || 0; - for (let i = 0; i < 16; ++i) { - buf[offset2 + i] = bytes[i]; - } - return buf; - } - return stringify_default(bytes); - } - try { - generateUUID.name = name; - } catch (err) { - } - generateUUID.DNS = DNS; - generateUUID.URL = URL2; - return generateUUID; -} -var DNS, URL2; -var init_v35 = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v35.js"() { - init_stringify(); - init_parse(); - DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; - URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/md5.js -function md5(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return import_crypto3.default.createHash("md5").update(bytes).digest(); -} -var import_crypto3, md5_default; -var init_md5 = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/md5.js"() { - import_crypto3 = __toESM(require("crypto")); - md5_default = md5; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v3.js -var v3, v3_default; -var init_v3 = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v3.js"() { - init_v35(); - init_md5(); - v3 = v35_default("v3", 48, md5_default); - v3_default = v3; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v4.js -function v4(options, buf, offset2) { - options = options || {}; - const rnds = options.random || (options.rng || rng)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset2 = offset2 || 0; - for (let i = 0; i < 16; ++i) { - buf[offset2 + i] = rnds[i]; - } - return buf; - } - return stringify_default(rnds); -} -var v4_default; -var init_v4 = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v4.js"() { - init_rng(); - init_stringify(); - v4_default = v4; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/sha1.js -function sha1(bytes) { - if (Array.isArray(bytes)) { - bytes = Buffer.from(bytes); - } else if (typeof bytes === "string") { - bytes = Buffer.from(bytes, "utf8"); - } - return import_crypto4.default.createHash("sha1").update(bytes).digest(); -} -var import_crypto4, sha1_default; -var init_sha1 = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/sha1.js"() { - import_crypto4 = __toESM(require("crypto")); - sha1_default = sha1; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v5.js -var v5, v5_default; -var init_v5 = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/v5.js"() { - init_v35(); - init_sha1(); - v5 = v35_default("v5", 80, sha1_default); - v5_default = v5; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/nil.js -var nil_default; -var init_nil = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/nil.js"() { - nil_default = "00000000-0000-0000-0000-000000000000"; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/version.js -function version(uuid) { - if (!validate_default(uuid)) { - throw TypeError("Invalid UUID"); - } - return parseInt(uuid.substr(14, 1), 16); -} -var version_default; -var init_version = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/version.js"() { - init_validate(); - version_default = version; - } -}); - -// ../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/index.js -var esm_node_exports = {}; -__export(esm_node_exports, { - NIL: () => nil_default, - parse: () => parse_default, - stringify: () => stringify_default, - v1: () => v1_default, - v3: () => v3_default, - v4: () => v4_default, - v5: () => v5_default, - validate: () => validate_default, - version: () => version_default -}); -var init_esm_node = __esm({ - "../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-node/index.js"() { - init_v1(); - init_v3(); - init_v4(); - init_v5(); - init_nil(); - init_version(); - init_validate(); - init_stringify(); - init_parse(); - } -}); - -// ../../node_modules/.pnpm/jayson@4.3.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/jayson/lib/generateRequest.js -var require_generateRequest = __commonJS({ - "../../node_modules/.pnpm/jayson@4.3.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/jayson/lib/generateRequest.js"(exports2, module2) { - "use strict"; - var uuid = (init_esm_node(), __toCommonJS(esm_node_exports)).v4; - var generateRequest = function(method, params, id, options) { - if (typeof method !== "string") { - throw new TypeError(method + " must be a string"); - } - options = options || {}; - const version2 = typeof options.version === "number" ? options.version : 2; - if (version2 !== 1 && version2 !== 2) { - throw new TypeError(version2 + " must be 1 or 2"); - } - const request = { - method - }; - if (version2 === 2) { - request.jsonrpc = "2.0"; - } - if (params) { - if (typeof params !== "object" && !Array.isArray(params)) { - throw new TypeError(params + " must be an object, array or omitted"); - } - request.params = params; - } - if (typeof id === "undefined") { - const generator = typeof options.generator === "function" ? options.generator : function() { - return uuid(); - }; - request.id = generator(request, options); - } else if (version2 === 2 && id === null) { - if (options.notificationIdNull) { - request.id = null; - } - } else { - request.id = id; - } - return request; - }; - module2.exports = generateRequest; - } -}); - -// ../../node_modules/.pnpm/jayson@4.3.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/jayson/lib/client/browser/index.js -var require_browser = __commonJS({ - "../../node_modules/.pnpm/jayson@4.3.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/jayson/lib/client/browser/index.js"(exports2, module2) { - "use strict"; - var uuid = (init_esm_node(), __toCommonJS(esm_node_exports)).v4; - var generateRequest = require_generateRequest(); - var ClientBrowser = function(callServer, options) { - if (!(this instanceof ClientBrowser)) { - return new ClientBrowser(callServer, options); - } - if (!options) { - options = {}; - } - this.options = { - reviver: typeof options.reviver !== "undefined" ? options.reviver : null, - replacer: typeof options.replacer !== "undefined" ? options.replacer : null, - generator: typeof options.generator !== "undefined" ? options.generator : function() { - return uuid(); - }, - version: typeof options.version !== "undefined" ? options.version : 2, - notificationIdNull: typeof options.notificationIdNull === "boolean" ? options.notificationIdNull : false - }; - this.callServer = callServer; - }; - module2.exports = ClientBrowser; - ClientBrowser.prototype.request = function(method, params, id, callback) { - const self2 = this; - let request = null; - const isBatch = Array.isArray(method) && typeof params === "function"; - if (this.options.version === 1 && isBatch) { - throw new TypeError("JSON-RPC 1.0 does not support batching"); - } - const isRaw = !isBatch && method && typeof method === "object" && typeof params === "function"; - if (isBatch || isRaw) { - callback = params; - request = method; - } else { - if (typeof id === "function") { - callback = id; - id = void 0; - } - const hasCallback = typeof callback === "function"; - try { - request = generateRequest(method, params, id, { - generator: this.options.generator, - version: this.options.version, - notificationIdNull: this.options.notificationIdNull - }); - } catch (err) { - if (hasCallback) { - callback(err); - return; - } - throw err; - } - if (!hasCallback) { - return request; - } - } - let message; - try { - message = JSON.stringify(request, this.options.replacer); - } catch (err) { - callback(err); - return; - } - this.callServer(message, function(err, response) { - self2._parseResponse(err, response, callback); - }); - return request; - }; - ClientBrowser.prototype._parseResponse = function(err, responseText, callback) { - if (err) { - callback(err); - return; - } - if (!responseText) { - callback(); - return; - } - let response; - try { - response = JSON.parse(responseText, this.options.reviver); - } catch (err2) { - callback(err2); - return; - } - if (callback.length === 3) { - if (Array.isArray(response)) { - const isError = function(res) { - return typeof res.error !== "undefined"; - }; - const isNotError = function(res) { - return !isError(res); - }; - callback(null, response.filter(isError), response.filter(isNotError)); - return; - } else { - callback(null, response.error, response.result); - return; - } - } - callback(null, response); - }; - } -}); - -// ../../node_modules/.pnpm/webidl-conversions@3.0.1/node_modules/webidl-conversions/lib/index.js -var require_lib3 = __commonJS({ - "../../node_modules/.pnpm/webidl-conversions@3.0.1/node_modules/webidl-conversions/lib/index.js"(exports2, module2) { - "use strict"; - var conversions = {}; - module2.exports = conversions; - function sign2(x) { - return x < 0 ? -1 : 1; - } - function evenRound(x) { - if (x % 1 === 0.5 && (x & 1) === 0) { - return Math.floor(x); - } else { - return Math.round(x); - } - } - function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; - } - const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); - const upperBound = Math.pow(2, bitLength) - 1; - const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); - const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); - return function(V, opts) { - if (!opts) - opts = {}; - let x = +V; - if (opts.enforceRange) { - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite number"); - } - x = sign2(x) * Math.floor(Math.abs(x)); - if (x < lowerBound || x > upperBound) { - throw new TypeError("Argument is not in byte range"); - } - return x; - } - if (!isNaN(x) && opts.clamp) { - x = evenRound(x); - if (x < lowerBound) - x = lowerBound; - if (x > upperBound) - x = upperBound; - return x; - } - if (!Number.isFinite(x) || x === 0) { - return 0; - } - x = sign2(x) * Math.floor(Math.abs(x)); - x = x % moduloVal; - if (!typeOpts.unsigned && x >= moduloBound) { - return x - moduloVal; - } else if (typeOpts.unsigned) { - if (x < 0) { - x += moduloVal; - } else if (x === -0) { - return 0; - } - } - return x; - }; - } - conversions["void"] = function() { - return void 0; - }; - conversions["boolean"] = function(val) { - return !!val; - }; - conversions["byte"] = createNumberConversion(8, { unsigned: false }); - conversions["octet"] = createNumberConversion(8, { unsigned: true }); - conversions["short"] = createNumberConversion(16, { unsigned: false }); - conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); - conversions["long"] = createNumberConversion(32, { unsigned: false }); - conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); - conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); - conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); - conversions["double"] = function(V) { - const x = +V; - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite floating-point value"); - } - return x; - }; - conversions["unrestricted double"] = function(V) { - const x = +V; - if (isNaN(x)) { - throw new TypeError("Argument is NaN"); - } - return x; - }; - conversions["float"] = conversions["double"]; - conversions["unrestricted float"] = conversions["unrestricted double"]; - conversions["DOMString"] = function(V, opts) { - if (!opts) - opts = {}; - if (opts.treatNullAsEmptyString && V === null) { - return ""; - } - return String(V); - }; - conversions["ByteString"] = function(V, opts) { - const x = String(V); - let c = void 0; - for (let i = 0; (c = x.codePointAt(i)) !== void 0; ++i) { - if (c > 255) { - throw new TypeError("Argument is not a valid bytestring"); - } - } - return x; - }; - conversions["USVString"] = function(V) { - const S = String(V); - const n = S.length; - const U = []; - for (let i = 0; i < n; ++i) { - const c = S.charCodeAt(i); - if (c < 55296 || c > 57343) { - U.push(String.fromCodePoint(c)); - } else if (56320 <= c && c <= 57343) { - U.push(String.fromCodePoint(65533)); - } else { - if (i === n - 1) { - U.push(String.fromCodePoint(65533)); - } else { - const d = S.charCodeAt(i + 1); - if (56320 <= d && d <= 57343) { - const a = c & 1023; - const b = d & 1023; - U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); - ++i; - } else { - U.push(String.fromCodePoint(65533)); - } - } - } - } - return U.join(""); - }; - conversions["Date"] = function(V, opts) { - if (!(V instanceof Date)) { - throw new TypeError("Argument is not a Date object"); - } - if (isNaN(V)) { - return void 0; - } - return V; - }; - conversions["RegExp"] = function(V, opts) { - if (!(V instanceof RegExp)) { - V = new RegExp(V); - } - return V; - }; - } -}); - -// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/utils.js -var require_utils3 = __commonJS({ - "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/utils.js"(exports2, module2) { - "use strict"; - module2.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); - } - }; - module2.exports.wrapperSymbol = Symbol("wrapper"); - module2.exports.implSymbol = Symbol("impl"); - module2.exports.wrapperForImpl = function(impl) { - return impl[module2.exports.wrapperSymbol]; - }; - module2.exports.implForWrapper = function(wrapper) { - return wrapper[module2.exports.implSymbol]; - }; - } -}); - -// ../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/lib/mappingTable.json -var require_mappingTable = __commonJS({ - "../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/lib/mappingTable.json"(exports2, module2) { - module2.exports = [[[0, 44], "disallowed_STD3_valid"], [[45, 46], "valid"], [[47, 47], "disallowed_STD3_valid"], [[48, 57], "valid"], [[58, 64], "disallowed_STD3_valid"], [[65, 65], "mapped", [97]], [[66, 66], "mapped", [98]], [[67, 67], "mapped", [99]], [[68, 68], "mapped", [100]], [[69, 69], "mapped", [101]], [[70, 70], "mapped", [102]], [[71, 71], "mapped", [103]], [[72, 72], "mapped", [104]], [[73, 73], "mapped", [105]], [[74, 74], "mapped", [106]], [[75, 75], "mapped", [107]], [[76, 76], "mapped", [108]], [[77, 77], "mapped", [109]], [[78, 78], "mapped", [110]], [[79, 79], "mapped", [111]], [[80, 80], "mapped", [112]], [[81, 81], "mapped", [113]], [[82, 82], "mapped", [114]], [[83, 83], "mapped", [115]], [[84, 84], "mapped", [116]], [[85, 85], "mapped", [117]], [[86, 86], "mapped", [118]], [[87, 87], "mapped", [119]], [[88, 88], "mapped", [120]], [[89, 89], "mapped", [121]], [[90, 90], "mapped", [122]], [[91, 96], "disallowed_STD3_valid"], [[97, 122], "valid"], [[123, 127], "disallowed_STD3_valid"], [[128, 159], "disallowed"], [[160, 160], "disallowed_STD3_mapped", [32]], [[161, 167], "valid", [], "NV8"], [[168, 168], "disallowed_STD3_mapped", [32, 776]], [[169, 169], "valid", [], "NV8"], [[170, 170], "mapped", [97]], [[171, 172], "valid", [], "NV8"], [[173, 173], "ignored"], [[174, 174], "valid", [], "NV8"], [[175, 175], "disallowed_STD3_mapped", [32, 772]], [[176, 177], "valid", [], "NV8"], [[178, 178], "mapped", [50]], [[179, 179], "mapped", [51]], [[180, 180], "disallowed_STD3_mapped", [32, 769]], [[181, 181], "mapped", [956]], [[182, 182], "valid", [], "NV8"], [[183, 183], "valid"], [[184, 184], "disallowed_STD3_mapped", [32, 807]], [[185, 185], "mapped", [49]], [[186, 186], "mapped", [111]], [[187, 187], "valid", [], "NV8"], [[188, 188], "mapped", [49, 8260, 52]], [[189, 189], "mapped", [49, 8260, 50]], [[190, 190], "mapped", [51, 8260, 52]], [[191, 191], "valid", [], "NV8"], [[192, 192], "mapped", [224]], [[193, 193], "mapped", [225]], [[194, 194], "mapped", [226]], [[195, 195], "mapped", [227]], [[196, 196], "mapped", [228]], [[197, 197], "mapped", [229]], [[198, 198], "mapped", [230]], [[199, 199], "mapped", [231]], [[200, 200], "mapped", [232]], [[201, 201], "mapped", [233]], [[202, 202], "mapped", [234]], [[203, 203], "mapped", [235]], [[204, 204], "mapped", [236]], [[205, 205], "mapped", [237]], [[206, 206], "mapped", [238]], [[207, 207], "mapped", [239]], [[208, 208], "mapped", [240]], [[209, 209], "mapped", [241]], [[210, 210], "mapped", [242]], [[211, 211], "mapped", [243]], [[212, 212], "mapped", [244]], [[213, 213], "mapped", [245]], [[214, 214], "mapped", [246]], [[215, 215], "valid", [], "NV8"], [[216, 216], "mapped", [248]], [[217, 217], "mapped", [249]], [[218, 218], "mapped", [250]], [[219, 219], "mapped", [251]], [[220, 220], "mapped", [252]], [[221, 221], "mapped", [253]], [[222, 222], "mapped", [254]], [[223, 223], "deviation", [115, 115]], [[224, 246], "valid"], [[247, 247], "valid", [], "NV8"], [[248, 255], "valid"], [[256, 256], "mapped", [257]], [[257, 257], "valid"], [[258, 258], "mapped", [259]], [[259, 259], "valid"], [[260, 260], "mapped", [261]], [[261, 261], "valid"], [[262, 262], "mapped", [263]], [[263, 263], "valid"], [[264, 264], "mapped", [265]], [[265, 265], "valid"], [[266, 266], "mapped", [267]], [[267, 267], "valid"], [[268, 268], "mapped", [269]], [[269, 269], "valid"], [[270, 270], "mapped", [271]], [[271, 271], "valid"], [[272, 272], "mapped", [273]], [[273, 273], "valid"], [[274, 274], "mapped", [275]], [[275, 275], "valid"], [[276, 276], "mapped", [277]], [[277, 277], "valid"], [[278, 278], "mapped", [279]], [[279, 279], "valid"], [[280, 280], "mapped", [281]], [[281, 281], "valid"], [[282, 282], "mapped", [283]], [[283, 283], "valid"], [[284, 284], "mapped", [285]], [[285, 285], "valid"], [[286, 286], "mapped", [287]], [[287, 287], "valid"], [[288, 288], "mapped", [289]], [[289, 289], "valid"], [[290, 290], "mapped", [291]], [[291, 291], "valid"], [[292, 292], "mapped", [293]], [[293, 293], "valid"], [[294, 294], "mapped", [295]], [[295, 295], "valid"], [[296, 296], "mapped", [297]], [[297, 297], "valid"], [[298, 298], "mapped", [299]], [[299, 299], "valid"], [[300, 300], "mapped", [301]], [[301, 301], "valid"], [[302, 302], "mapped", [303]], [[303, 303], "valid"], [[304, 304], "mapped", [105, 775]], [[305, 305], "valid"], [[306, 307], "mapped", [105, 106]], [[308, 308], "mapped", [309]], [[309, 309], "valid"], [[310, 310], "mapped", [311]], [[311, 312], "valid"], [[313, 313], "mapped", [314]], [[314, 314], "valid"], [[315, 315], "mapped", [316]], [[316, 316], "valid"], [[317, 317], "mapped", [318]], [[318, 318], "valid"], [[319, 320], "mapped", [108, 183]], [[321, 321], "mapped", [322]], [[322, 322], "valid"], [[323, 323], "mapped", [324]], [[324, 324], "valid"], [[325, 325], "mapped", [326]], [[326, 326], "valid"], [[327, 327], "mapped", [328]], [[328, 328], "valid"], [[329, 329], "mapped", [700, 110]], [[330, 330], "mapped", [331]], [[331, 331], "valid"], [[332, 332], "mapped", [333]], [[333, 333], "valid"], [[334, 334], "mapped", [335]], [[335, 335], "valid"], [[336, 336], "mapped", [337]], [[337, 337], "valid"], [[338, 338], "mapped", [339]], [[339, 339], "valid"], [[340, 340], "mapped", [341]], [[341, 341], "valid"], [[342, 342], "mapped", [343]], [[343, 343], "valid"], [[344, 344], "mapped", [345]], [[345, 345], "valid"], [[346, 346], "mapped", [347]], [[347, 347], "valid"], [[348, 348], "mapped", [349]], [[349, 349], "valid"], [[350, 350], "mapped", [351]], [[351, 351], "valid"], [[352, 352], "mapped", [353]], [[353, 353], "valid"], [[354, 354], "mapped", [355]], [[355, 355], "valid"], [[356, 356], "mapped", [357]], [[357, 357], "valid"], [[358, 358], "mapped", [359]], [[359, 359], "valid"], [[360, 360], "mapped", [361]], [[361, 361], "valid"], [[362, 362], "mapped", [363]], [[363, 363], "valid"], [[364, 364], "mapped", [365]], [[365, 365], "valid"], [[366, 366], "mapped", [367]], [[367, 367], "valid"], [[368, 368], "mapped", [369]], [[369, 369], "valid"], [[370, 370], "mapped", [371]], [[371, 371], "valid"], [[372, 372], "mapped", [373]], [[373, 373], "valid"], [[374, 374], "mapped", [375]], [[375, 375], "valid"], [[376, 376], "mapped", [255]], [[377, 377], "mapped", [378]], [[378, 378], "valid"], [[379, 379], "mapped", [380]], [[380, 380], "valid"], [[381, 381], "mapped", [382]], [[382, 382], "valid"], [[383, 383], "mapped", [115]], [[384, 384], "valid"], [[385, 385], "mapped", [595]], [[386, 386], "mapped", [387]], [[387, 387], "valid"], [[388, 388], "mapped", [389]], [[389, 389], "valid"], [[390, 390], "mapped", [596]], [[391, 391], "mapped", [392]], [[392, 392], "valid"], [[393, 393], "mapped", [598]], [[394, 394], "mapped", [599]], [[395, 395], "mapped", [396]], [[396, 397], "valid"], [[398, 398], "mapped", [477]], [[399, 399], "mapped", [601]], [[400, 400], "mapped", [603]], [[401, 401], "mapped", [402]], [[402, 402], "valid"], [[403, 403], "mapped", [608]], [[404, 404], "mapped", [611]], [[405, 405], "valid"], [[406, 406], "mapped", [617]], [[407, 407], "mapped", [616]], [[408, 408], "mapped", [409]], [[409, 411], "valid"], [[412, 412], "mapped", [623]], [[413, 413], "mapped", [626]], [[414, 414], "valid"], [[415, 415], "mapped", [629]], [[416, 416], "mapped", [417]], [[417, 417], "valid"], [[418, 418], "mapped", [419]], [[419, 419], "valid"], [[420, 420], "mapped", [421]], [[421, 421], "valid"], [[422, 422], "mapped", [640]], [[423, 423], "mapped", [424]], [[424, 424], "valid"], [[425, 425], "mapped", [643]], [[426, 427], "valid"], [[428, 428], "mapped", [429]], [[429, 429], "valid"], [[430, 430], "mapped", [648]], [[431, 431], "mapped", [432]], [[432, 432], "valid"], [[433, 433], "mapped", [650]], [[434, 434], "mapped", [651]], [[435, 435], "mapped", [436]], [[436, 436], "valid"], [[437, 437], "mapped", [438]], [[438, 438], "valid"], [[439, 439], "mapped", [658]], [[440, 440], "mapped", [441]], [[441, 443], "valid"], [[444, 444], "mapped", [445]], [[445, 451], "valid"], [[452, 454], "mapped", [100, 382]], [[455, 457], "mapped", [108, 106]], [[458, 460], "mapped", [110, 106]], [[461, 461], "mapped", [462]], [[462, 462], "valid"], [[463, 463], "mapped", [464]], [[464, 464], "valid"], [[465, 465], "mapped", [466]], [[466, 466], "valid"], [[467, 467], "mapped", [468]], [[468, 468], "valid"], [[469, 469], "mapped", [470]], [[470, 470], "valid"], [[471, 471], "mapped", [472]], [[472, 472], "valid"], [[473, 473], "mapped", [474]], [[474, 474], "valid"], [[475, 475], "mapped", [476]], [[476, 477], "valid"], [[478, 478], "mapped", [479]], [[479, 479], "valid"], [[480, 480], "mapped", [481]], [[481, 481], "valid"], [[482, 482], "mapped", [483]], [[483, 483], "valid"], [[484, 484], "mapped", [485]], [[485, 485], "valid"], [[486, 486], "mapped", [487]], [[487, 487], "valid"], [[488, 488], "mapped", [489]], [[489, 489], "valid"], [[490, 490], "mapped", [491]], [[491, 491], "valid"], [[492, 492], "mapped", [493]], [[493, 493], "valid"], [[494, 494], "mapped", [495]], [[495, 496], "valid"], [[497, 499], "mapped", [100, 122]], [[500, 500], "mapped", [501]], [[501, 501], "valid"], [[502, 502], "mapped", [405]], [[503, 503], "mapped", [447]], [[504, 504], "mapped", [505]], [[505, 505], "valid"], [[506, 506], "mapped", [507]], [[507, 507], "valid"], [[508, 508], "mapped", [509]], [[509, 509], "valid"], [[510, 510], "mapped", [511]], [[511, 511], "valid"], [[512, 512], "mapped", [513]], [[513, 513], "valid"], [[514, 514], "mapped", [515]], [[515, 515], "valid"], [[516, 516], "mapped", [517]], [[517, 517], "valid"], [[518, 518], "mapped", [519]], [[519, 519], "valid"], [[520, 520], "mapped", [521]], [[521, 521], "valid"], [[522, 522], "mapped", [523]], [[523, 523], "valid"], [[524, 524], "mapped", [525]], [[525, 525], "valid"], [[526, 526], "mapped", [527]], [[527, 527], "valid"], [[528, 528], "mapped", [529]], [[529, 529], "valid"], [[530, 530], "mapped", [531]], [[531, 531], "valid"], [[532, 532], "mapped", [533]], [[533, 533], "valid"], [[534, 534], "mapped", [535]], [[535, 535], "valid"], [[536, 536], "mapped", [537]], [[537, 537], "valid"], [[538, 538], "mapped", [539]], [[539, 539], "valid"], [[540, 540], "mapped", [541]], [[541, 541], "valid"], [[542, 542], "mapped", [543]], [[543, 543], "valid"], [[544, 544], "mapped", [414]], [[545, 545], "valid"], [[546, 546], "mapped", [547]], [[547, 547], "valid"], [[548, 548], "mapped", [549]], [[549, 549], "valid"], [[550, 550], "mapped", [551]], [[551, 551], "valid"], [[552, 552], "mapped", [553]], [[553, 553], "valid"], [[554, 554], "mapped", [555]], [[555, 555], "valid"], [[556, 556], "mapped", [557]], [[557, 557], "valid"], [[558, 558], "mapped", [559]], [[559, 559], "valid"], [[560, 560], "mapped", [561]], [[561, 561], "valid"], [[562, 562], "mapped", [563]], [[563, 563], "valid"], [[564, 566], "valid"], [[567, 569], "valid"], [[570, 570], "mapped", [11365]], [[571, 571], "mapped", [572]], [[572, 572], "valid"], [[573, 573], "mapped", [410]], [[574, 574], "mapped", [11366]], [[575, 576], "valid"], [[577, 577], "mapped", [578]], [[578, 578], "valid"], [[579, 579], "mapped", [384]], [[580, 580], "mapped", [649]], [[581, 581], "mapped", [652]], [[582, 582], "mapped", [583]], [[583, 583], "valid"], [[584, 584], "mapped", [585]], [[585, 585], "valid"], [[586, 586], "mapped", [587]], [[587, 587], "valid"], [[588, 588], "mapped", [589]], [[589, 589], "valid"], [[590, 590], "mapped", [591]], [[591, 591], "valid"], [[592, 680], "valid"], [[681, 685], "valid"], [[686, 687], "valid"], [[688, 688], "mapped", [104]], [[689, 689], "mapped", [614]], [[690, 690], "mapped", [106]], [[691, 691], "mapped", [114]], [[692, 692], "mapped", [633]], [[693, 693], "mapped", [635]], [[694, 694], "mapped", [641]], [[695, 695], "mapped", [119]], [[696, 696], "mapped", [121]], [[697, 705], "valid"], [[706, 709], "valid", [], "NV8"], [[710, 721], "valid"], [[722, 727], "valid", [], "NV8"], [[728, 728], "disallowed_STD3_mapped", [32, 774]], [[729, 729], "disallowed_STD3_mapped", [32, 775]], [[730, 730], "disallowed_STD3_mapped", [32, 778]], [[731, 731], "disallowed_STD3_mapped", [32, 808]], [[732, 732], "disallowed_STD3_mapped", [32, 771]], [[733, 733], "disallowed_STD3_mapped", [32, 779]], [[734, 734], "valid", [], "NV8"], [[735, 735], "valid", [], "NV8"], [[736, 736], "mapped", [611]], [[737, 737], "mapped", [108]], [[738, 738], "mapped", [115]], [[739, 739], "mapped", [120]], [[740, 740], "mapped", [661]], [[741, 745], "valid", [], "NV8"], [[746, 747], "valid", [], "NV8"], [[748, 748], "valid"], [[749, 749], "valid", [], "NV8"], [[750, 750], "valid"], [[751, 767], "valid", [], "NV8"], [[768, 831], "valid"], [[832, 832], "mapped", [768]], [[833, 833], "mapped", [769]], [[834, 834], "valid"], [[835, 835], "mapped", [787]], [[836, 836], "mapped", [776, 769]], [[837, 837], "mapped", [953]], [[838, 846], "valid"], [[847, 847], "ignored"], [[848, 855], "valid"], [[856, 860], "valid"], [[861, 863], "valid"], [[864, 865], "valid"], [[866, 866], "valid"], [[867, 879], "valid"], [[880, 880], "mapped", [881]], [[881, 881], "valid"], [[882, 882], "mapped", [883]], [[883, 883], "valid"], [[884, 884], "mapped", [697]], [[885, 885], "valid"], [[886, 886], "mapped", [887]], [[887, 887], "valid"], [[888, 889], "disallowed"], [[890, 890], "disallowed_STD3_mapped", [32, 953]], [[891, 893], "valid"], [[894, 894], "disallowed_STD3_mapped", [59]], [[895, 895], "mapped", [1011]], [[896, 899], "disallowed"], [[900, 900], "disallowed_STD3_mapped", [32, 769]], [[901, 901], "disallowed_STD3_mapped", [32, 776, 769]], [[902, 902], "mapped", [940]], [[903, 903], "mapped", [183]], [[904, 904], "mapped", [941]], [[905, 905], "mapped", [942]], [[906, 906], "mapped", [943]], [[907, 907], "disallowed"], [[908, 908], "mapped", [972]], [[909, 909], "disallowed"], [[910, 910], "mapped", [973]], [[911, 911], "mapped", [974]], [[912, 912], "valid"], [[913, 913], "mapped", [945]], [[914, 914], "mapped", [946]], [[915, 915], "mapped", [947]], [[916, 916], "mapped", [948]], [[917, 917], "mapped", [949]], [[918, 918], "mapped", [950]], [[919, 919], "mapped", [951]], [[920, 920], "mapped", [952]], [[921, 921], "mapped", [953]], [[922, 922], "mapped", [954]], [[923, 923], "mapped", [955]], [[924, 924], "mapped", [956]], [[925, 925], "mapped", [957]], [[926, 926], "mapped", [958]], [[927, 927], "mapped", [959]], [[928, 928], "mapped", [960]], [[929, 929], "mapped", [961]], [[930, 930], "disallowed"], [[931, 931], "mapped", [963]], [[932, 932], "mapped", [964]], [[933, 933], "mapped", [965]], [[934, 934], "mapped", [966]], [[935, 935], "mapped", [967]], [[936, 936], "mapped", [968]], [[937, 937], "mapped", [969]], [[938, 938], "mapped", [970]], [[939, 939], "mapped", [971]], [[940, 961], "valid"], [[962, 962], "deviation", [963]], [[963, 974], "valid"], [[975, 975], "mapped", [983]], [[976, 976], "mapped", [946]], [[977, 977], "mapped", [952]], [[978, 978], "mapped", [965]], [[979, 979], "mapped", [973]], [[980, 980], "mapped", [971]], [[981, 981], "mapped", [966]], [[982, 982], "mapped", [960]], [[983, 983], "valid"], [[984, 984], "mapped", [985]], [[985, 985], "valid"], [[986, 986], "mapped", [987]], [[987, 987], "valid"], [[988, 988], "mapped", [989]], [[989, 989], "valid"], [[990, 990], "mapped", [991]], [[991, 991], "valid"], [[992, 992], "mapped", [993]], [[993, 993], "valid"], [[994, 994], "mapped", [995]], [[995, 995], "valid"], [[996, 996], "mapped", [997]], [[997, 997], "valid"], [[998, 998], "mapped", [999]], [[999, 999], "valid"], [[1e3, 1e3], "mapped", [1001]], [[1001, 1001], "valid"], [[1002, 1002], "mapped", [1003]], [[1003, 1003], "valid"], [[1004, 1004], "mapped", [1005]], [[1005, 1005], "valid"], [[1006, 1006], "mapped", [1007]], [[1007, 1007], "valid"], [[1008, 1008], "mapped", [954]], [[1009, 1009], "mapped", [961]], [[1010, 1010], "mapped", [963]], [[1011, 1011], "valid"], [[1012, 1012], "mapped", [952]], [[1013, 1013], "mapped", [949]], [[1014, 1014], "valid", [], "NV8"], [[1015, 1015], "mapped", [1016]], [[1016, 1016], "valid"], [[1017, 1017], "mapped", [963]], [[1018, 1018], "mapped", [1019]], [[1019, 1019], "valid"], [[1020, 1020], "valid"], [[1021, 1021], "mapped", [891]], [[1022, 1022], "mapped", [892]], [[1023, 1023], "mapped", [893]], [[1024, 1024], "mapped", [1104]], [[1025, 1025], "mapped", [1105]], [[1026, 1026], "mapped", [1106]], [[1027, 1027], "mapped", [1107]], [[1028, 1028], "mapped", [1108]], [[1029, 1029], "mapped", [1109]], [[1030, 1030], "mapped", [1110]], [[1031, 1031], "mapped", [1111]], [[1032, 1032], "mapped", [1112]], [[1033, 1033], "mapped", [1113]], [[1034, 1034], "mapped", [1114]], [[1035, 1035], "mapped", [1115]], [[1036, 1036], "mapped", [1116]], [[1037, 1037], "mapped", [1117]], [[1038, 1038], "mapped", [1118]], [[1039, 1039], "mapped", [1119]], [[1040, 1040], "mapped", [1072]], [[1041, 1041], "mapped", [1073]], [[1042, 1042], "mapped", [1074]], [[1043, 1043], "mapped", [1075]], [[1044, 1044], "mapped", [1076]], [[1045, 1045], "mapped", [1077]], [[1046, 1046], "mapped", [1078]], [[1047, 1047], "mapped", [1079]], [[1048, 1048], "mapped", [1080]], [[1049, 1049], "mapped", [1081]], [[1050, 1050], "mapped", [1082]], [[1051, 1051], "mapped", [1083]], [[1052, 1052], "mapped", [1084]], [[1053, 1053], "mapped", [1085]], [[1054, 1054], "mapped", [1086]], [[1055, 1055], "mapped", [1087]], [[1056, 1056], "mapped", [1088]], [[1057, 1057], "mapped", [1089]], [[1058, 1058], "mapped", [1090]], [[1059, 1059], "mapped", [1091]], [[1060, 1060], "mapped", [1092]], [[1061, 1061], "mapped", [1093]], [[1062, 1062], "mapped", [1094]], [[1063, 1063], "mapped", [1095]], [[1064, 1064], "mapped", [1096]], [[1065, 1065], "mapped", [1097]], [[1066, 1066], "mapped", [1098]], [[1067, 1067], "mapped", [1099]], [[1068, 1068], "mapped", [1100]], [[1069, 1069], "mapped", [1101]], [[1070, 1070], "mapped", [1102]], [[1071, 1071], "mapped", [1103]], [[1072, 1103], "valid"], [[1104, 1104], "valid"], [[1105, 1116], "valid"], [[1117, 1117], "valid"], [[1118, 1119], "valid"], [[1120, 1120], "mapped", [1121]], [[1121, 1121], "valid"], [[1122, 1122], "mapped", [1123]], [[1123, 1123], "valid"], [[1124, 1124], "mapped", [1125]], [[1125, 1125], "valid"], [[1126, 1126], "mapped", [1127]], [[1127, 1127], "valid"], [[1128, 1128], "mapped", [1129]], [[1129, 1129], "valid"], [[1130, 1130], "mapped", [1131]], [[1131, 1131], "valid"], [[1132, 1132], "mapped", [1133]], [[1133, 1133], "valid"], [[1134, 1134], "mapped", [1135]], [[1135, 1135], "valid"], [[1136, 1136], "mapped", [1137]], [[1137, 1137], "valid"], [[1138, 1138], "mapped", [1139]], [[1139, 1139], "valid"], [[1140, 1140], "mapped", [1141]], [[1141, 1141], "valid"], [[1142, 1142], "mapped", [1143]], [[1143, 1143], "valid"], [[1144, 1144], "mapped", [1145]], [[1145, 1145], "valid"], [[1146, 1146], "mapped", [1147]], [[1147, 1147], "valid"], [[1148, 1148], "mapped", [1149]], [[1149, 1149], "valid"], [[1150, 1150], "mapped", [1151]], [[1151, 1151], "valid"], [[1152, 1152], "mapped", [1153]], [[1153, 1153], "valid"], [[1154, 1154], "valid", [], "NV8"], [[1155, 1158], "valid"], [[1159, 1159], "valid"], [[1160, 1161], "valid", [], "NV8"], [[1162, 1162], "mapped", [1163]], [[1163, 1163], "valid"], [[1164, 1164], "mapped", [1165]], [[1165, 1165], "valid"], [[1166, 1166], "mapped", [1167]], [[1167, 1167], "valid"], [[1168, 1168], "mapped", [1169]], [[1169, 1169], "valid"], [[1170, 1170], "mapped", [1171]], [[1171, 1171], "valid"], [[1172, 1172], "mapped", [1173]], [[1173, 1173], "valid"], [[1174, 1174], "mapped", [1175]], [[1175, 1175], "valid"], [[1176, 1176], "mapped", [1177]], [[1177, 1177], "valid"], [[1178, 1178], "mapped", [1179]], [[1179, 1179], "valid"], [[1180, 1180], "mapped", [1181]], [[1181, 1181], "valid"], [[1182, 1182], "mapped", [1183]], [[1183, 1183], "valid"], [[1184, 1184], "mapped", [1185]], [[1185, 1185], "valid"], [[1186, 1186], "mapped", [1187]], [[1187, 1187], "valid"], [[1188, 1188], "mapped", [1189]], [[1189, 1189], "valid"], [[1190, 1190], "mapped", [1191]], [[1191, 1191], "valid"], [[1192, 1192], "mapped", [1193]], [[1193, 1193], "valid"], [[1194, 1194], "mapped", [1195]], [[1195, 1195], "valid"], [[1196, 1196], "mapped", [1197]], [[1197, 1197], "valid"], [[1198, 1198], "mapped", [1199]], [[1199, 1199], "valid"], [[1200, 1200], "mapped", [1201]], [[1201, 1201], "valid"], [[1202, 1202], "mapped", [1203]], [[1203, 1203], "valid"], [[1204, 1204], "mapped", [1205]], [[1205, 1205], "valid"], [[1206, 1206], "mapped", [1207]], [[1207, 1207], "valid"], [[1208, 1208], "mapped", [1209]], [[1209, 1209], "valid"], [[1210, 1210], "mapped", [1211]], [[1211, 1211], "valid"], [[1212, 1212], "mapped", [1213]], [[1213, 1213], "valid"], [[1214, 1214], "mapped", [1215]], [[1215, 1215], "valid"], [[1216, 1216], "disallowed"], [[1217, 1217], "mapped", [1218]], [[1218, 1218], "valid"], [[1219, 1219], "mapped", [1220]], [[1220, 1220], "valid"], [[1221, 1221], "mapped", [1222]], [[1222, 1222], "valid"], [[1223, 1223], "mapped", [1224]], [[1224, 1224], "valid"], [[1225, 1225], "mapped", [1226]], [[1226, 1226], "valid"], [[1227, 1227], "mapped", [1228]], [[1228, 1228], "valid"], [[1229, 1229], "mapped", [1230]], [[1230, 1230], "valid"], [[1231, 1231], "valid"], [[1232, 1232], "mapped", [1233]], [[1233, 1233], "valid"], [[1234, 1234], "mapped", [1235]], [[1235, 1235], "valid"], [[1236, 1236], "mapped", [1237]], [[1237, 1237], "valid"], [[1238, 1238], "mapped", [1239]], [[1239, 1239], "valid"], [[1240, 1240], "mapped", [1241]], [[1241, 1241], "valid"], [[1242, 1242], "mapped", [1243]], [[1243, 1243], "valid"], [[1244, 1244], "mapped", [1245]], [[1245, 1245], "valid"], [[1246, 1246], "mapped", [1247]], [[1247, 1247], "valid"], [[1248, 1248], "mapped", [1249]], [[1249, 1249], "valid"], [[1250, 1250], "mapped", [1251]], [[1251, 1251], "valid"], [[1252, 1252], "mapped", [1253]], [[1253, 1253], "valid"], [[1254, 1254], "mapped", [1255]], [[1255, 1255], "valid"], [[1256, 1256], "mapped", [1257]], [[1257, 1257], "valid"], [[1258, 1258], "mapped", [1259]], [[1259, 1259], "valid"], [[1260, 1260], "mapped", [1261]], [[1261, 1261], "valid"], [[1262, 1262], "mapped", [1263]], [[1263, 1263], "valid"], [[1264, 1264], "mapped", [1265]], [[1265, 1265], "valid"], [[1266, 1266], "mapped", [1267]], [[1267, 1267], "valid"], [[1268, 1268], "mapped", [1269]], [[1269, 1269], "valid"], [[1270, 1270], "mapped", [1271]], [[1271, 1271], "valid"], [[1272, 1272], "mapped", [1273]], [[1273, 1273], "valid"], [[1274, 1274], "mapped", [1275]], [[1275, 1275], "valid"], [[1276, 1276], "mapped", [1277]], [[1277, 1277], "valid"], [[1278, 1278], "mapped", [1279]], [[1279, 1279], "valid"], [[1280, 1280], "mapped", [1281]], [[1281, 1281], "valid"], [[1282, 1282], "mapped", [1283]], [[1283, 1283], "valid"], [[1284, 1284], "mapped", [1285]], [[1285, 1285], "valid"], [[1286, 1286], "mapped", [1287]], [[1287, 1287], "valid"], [[1288, 1288], "mapped", [1289]], [[1289, 1289], "valid"], [[1290, 1290], "mapped", [1291]], [[1291, 1291], "valid"], [[1292, 1292], "mapped", [1293]], [[1293, 1293], "valid"], [[1294, 1294], "mapped", [1295]], [[1295, 1295], "valid"], [[1296, 1296], "mapped", [1297]], [[1297, 1297], "valid"], [[1298, 1298], "mapped", [1299]], [[1299, 1299], "valid"], [[1300, 1300], "mapped", [1301]], [[1301, 1301], "valid"], [[1302, 1302], "mapped", [1303]], [[1303, 1303], "valid"], [[1304, 1304], "mapped", [1305]], [[1305, 1305], "valid"], [[1306, 1306], "mapped", [1307]], [[1307, 1307], "valid"], [[1308, 1308], "mapped", [1309]], [[1309, 1309], "valid"], [[1310, 1310], "mapped", [1311]], [[1311, 1311], "valid"], [[1312, 1312], "mapped", [1313]], [[1313, 1313], "valid"], [[1314, 1314], "mapped", [1315]], [[1315, 1315], "valid"], [[1316, 1316], "mapped", [1317]], [[1317, 1317], "valid"], [[1318, 1318], "mapped", [1319]], [[1319, 1319], "valid"], [[1320, 1320], "mapped", [1321]], [[1321, 1321], "valid"], [[1322, 1322], "mapped", [1323]], [[1323, 1323], "valid"], [[1324, 1324], "mapped", [1325]], [[1325, 1325], "valid"], [[1326, 1326], "mapped", [1327]], [[1327, 1327], "valid"], [[1328, 1328], "disallowed"], [[1329, 1329], "mapped", [1377]], [[1330, 1330], "mapped", [1378]], [[1331, 1331], "mapped", [1379]], [[1332, 1332], "mapped", [1380]], [[1333, 1333], "mapped", [1381]], [[1334, 1334], "mapped", [1382]], [[1335, 1335], "mapped", [1383]], [[1336, 1336], "mapped", [1384]], [[1337, 1337], "mapped", [1385]], [[1338, 1338], "mapped", [1386]], [[1339, 1339], "mapped", [1387]], [[1340, 1340], "mapped", [1388]], [[1341, 1341], "mapped", [1389]], [[1342, 1342], "mapped", [1390]], [[1343, 1343], "mapped", [1391]], [[1344, 1344], "mapped", [1392]], [[1345, 1345], "mapped", [1393]], [[1346, 1346], "mapped", [1394]], [[1347, 1347], "mapped", [1395]], [[1348, 1348], "mapped", [1396]], [[1349, 1349], "mapped", [1397]], [[1350, 1350], "mapped", [1398]], [[1351, 1351], "mapped", [1399]], [[1352, 1352], "mapped", [1400]], [[1353, 1353], "mapped", [1401]], [[1354, 1354], "mapped", [1402]], [[1355, 1355], "mapped", [1403]], [[1356, 1356], "mapped", [1404]], [[1357, 1357], "mapped", [1405]], [[1358, 1358], "mapped", [1406]], [[1359, 1359], "mapped", [1407]], [[1360, 1360], "mapped", [1408]], [[1361, 1361], "mapped", [1409]], [[1362, 1362], "mapped", [1410]], [[1363, 1363], "mapped", [1411]], [[1364, 1364], "mapped", [1412]], [[1365, 1365], "mapped", [1413]], [[1366, 1366], "mapped", [1414]], [[1367, 1368], "disallowed"], [[1369, 1369], "valid"], [[1370, 1375], "valid", [], "NV8"], [[1376, 1376], "disallowed"], [[1377, 1414], "valid"], [[1415, 1415], "mapped", [1381, 1410]], [[1416, 1416], "disallowed"], [[1417, 1417], "valid", [], "NV8"], [[1418, 1418], "valid", [], "NV8"], [[1419, 1420], "disallowed"], [[1421, 1422], "valid", [], "NV8"], [[1423, 1423], "valid", [], "NV8"], [[1424, 1424], "disallowed"], [[1425, 1441], "valid"], [[1442, 1442], "valid"], [[1443, 1455], "valid"], [[1456, 1465], "valid"], [[1466, 1466], "valid"], [[1467, 1469], "valid"], [[1470, 1470], "valid", [], "NV8"], [[1471, 1471], "valid"], [[1472, 1472], "valid", [], "NV8"], [[1473, 1474], "valid"], [[1475, 1475], "valid", [], "NV8"], [[1476, 1476], "valid"], [[1477, 1477], "valid"], [[1478, 1478], "valid", [], "NV8"], [[1479, 1479], "valid"], [[1480, 1487], "disallowed"], [[1488, 1514], "valid"], [[1515, 1519], "disallowed"], [[1520, 1524], "valid"], [[1525, 1535], "disallowed"], [[1536, 1539], "disallowed"], [[1540, 1540], "disallowed"], [[1541, 1541], "disallowed"], [[1542, 1546], "valid", [], "NV8"], [[1547, 1547], "valid", [], "NV8"], [[1548, 1548], "valid", [], "NV8"], [[1549, 1551], "valid", [], "NV8"], [[1552, 1557], "valid"], [[1558, 1562], "valid"], [[1563, 1563], "valid", [], "NV8"], [[1564, 1564], "disallowed"], [[1565, 1565], "disallowed"], [[1566, 1566], "valid", [], "NV8"], [[1567, 1567], "valid", [], "NV8"], [[1568, 1568], "valid"], [[1569, 1594], "valid"], [[1595, 1599], "valid"], [[1600, 1600], "valid", [], "NV8"], [[1601, 1618], "valid"], [[1619, 1621], "valid"], [[1622, 1624], "valid"], [[1625, 1630], "valid"], [[1631, 1631], "valid"], [[1632, 1641], "valid"], [[1642, 1645], "valid", [], "NV8"], [[1646, 1647], "valid"], [[1648, 1652], "valid"], [[1653, 1653], "mapped", [1575, 1652]], [[1654, 1654], "mapped", [1608, 1652]], [[1655, 1655], "mapped", [1735, 1652]], [[1656, 1656], "mapped", [1610, 1652]], [[1657, 1719], "valid"], [[1720, 1721], "valid"], [[1722, 1726], "valid"], [[1727, 1727], "valid"], [[1728, 1742], "valid"], [[1743, 1743], "valid"], [[1744, 1747], "valid"], [[1748, 1748], "valid", [], "NV8"], [[1749, 1756], "valid"], [[1757, 1757], "disallowed"], [[1758, 1758], "valid", [], "NV8"], [[1759, 1768], "valid"], [[1769, 1769], "valid", [], "NV8"], [[1770, 1773], "valid"], [[1774, 1775], "valid"], [[1776, 1785], "valid"], [[1786, 1790], "valid"], [[1791, 1791], "valid"], [[1792, 1805], "valid", [], "NV8"], [[1806, 1806], "disallowed"], [[1807, 1807], "disallowed"], [[1808, 1836], "valid"], [[1837, 1839], "valid"], [[1840, 1866], "valid"], [[1867, 1868], "disallowed"], [[1869, 1871], "valid"], [[1872, 1901], "valid"], [[1902, 1919], "valid"], [[1920, 1968], "valid"], [[1969, 1969], "valid"], [[1970, 1983], "disallowed"], [[1984, 2037], "valid"], [[2038, 2042], "valid", [], "NV8"], [[2043, 2047], "disallowed"], [[2048, 2093], "valid"], [[2094, 2095], "disallowed"], [[2096, 2110], "valid", [], "NV8"], [[2111, 2111], "disallowed"], [[2112, 2139], "valid"], [[2140, 2141], "disallowed"], [[2142, 2142], "valid", [], "NV8"], [[2143, 2207], "disallowed"], [[2208, 2208], "valid"], [[2209, 2209], "valid"], [[2210, 2220], "valid"], [[2221, 2226], "valid"], [[2227, 2228], "valid"], [[2229, 2274], "disallowed"], [[2275, 2275], "valid"], [[2276, 2302], "valid"], [[2303, 2303], "valid"], [[2304, 2304], "valid"], [[2305, 2307], "valid"], [[2308, 2308], "valid"], [[2309, 2361], "valid"], [[2362, 2363], "valid"], [[2364, 2381], "valid"], [[2382, 2382], "valid"], [[2383, 2383], "valid"], [[2384, 2388], "valid"], [[2389, 2389], "valid"], [[2390, 2391], "valid"], [[2392, 2392], "mapped", [2325, 2364]], [[2393, 2393], "mapped", [2326, 2364]], [[2394, 2394], "mapped", [2327, 2364]], [[2395, 2395], "mapped", [2332, 2364]], [[2396, 2396], "mapped", [2337, 2364]], [[2397, 2397], "mapped", [2338, 2364]], [[2398, 2398], "mapped", [2347, 2364]], [[2399, 2399], "mapped", [2351, 2364]], [[2400, 2403], "valid"], [[2404, 2405], "valid", [], "NV8"], [[2406, 2415], "valid"], [[2416, 2416], "valid", [], "NV8"], [[2417, 2418], "valid"], [[2419, 2423], "valid"], [[2424, 2424], "valid"], [[2425, 2426], "valid"], [[2427, 2428], "valid"], [[2429, 2429], "valid"], [[2430, 2431], "valid"], [[2432, 2432], "valid"], [[2433, 2435], "valid"], [[2436, 2436], "disallowed"], [[2437, 2444], "valid"], [[2445, 2446], "disallowed"], [[2447, 2448], "valid"], [[2449, 2450], "disallowed"], [[2451, 2472], "valid"], [[2473, 2473], "disallowed"], [[2474, 2480], "valid"], [[2481, 2481], "disallowed"], [[2482, 2482], "valid"], [[2483, 2485], "disallowed"], [[2486, 2489], "valid"], [[2490, 2491], "disallowed"], [[2492, 2492], "valid"], [[2493, 2493], "valid"], [[2494, 2500], "valid"], [[2501, 2502], "disallowed"], [[2503, 2504], "valid"], [[2505, 2506], "disallowed"], [[2507, 2509], "valid"], [[2510, 2510], "valid"], [[2511, 2518], "disallowed"], [[2519, 2519], "valid"], [[2520, 2523], "disallowed"], [[2524, 2524], "mapped", [2465, 2492]], [[2525, 2525], "mapped", [2466, 2492]], [[2526, 2526], "disallowed"], [[2527, 2527], "mapped", [2479, 2492]], [[2528, 2531], "valid"], [[2532, 2533], "disallowed"], [[2534, 2545], "valid"], [[2546, 2554], "valid", [], "NV8"], [[2555, 2555], "valid", [], "NV8"], [[2556, 2560], "disallowed"], [[2561, 2561], "valid"], [[2562, 2562], "valid"], [[2563, 2563], "valid"], [[2564, 2564], "disallowed"], [[2565, 2570], "valid"], [[2571, 2574], "disallowed"], [[2575, 2576], "valid"], [[2577, 2578], "disallowed"], [[2579, 2600], "valid"], [[2601, 2601], "disallowed"], [[2602, 2608], "valid"], [[2609, 2609], "disallowed"], [[2610, 2610], "valid"], [[2611, 2611], "mapped", [2610, 2620]], [[2612, 2612], "disallowed"], [[2613, 2613], "valid"], [[2614, 2614], "mapped", [2616, 2620]], [[2615, 2615], "disallowed"], [[2616, 2617], "valid"], [[2618, 2619], "disallowed"], [[2620, 2620], "valid"], [[2621, 2621], "disallowed"], [[2622, 2626], "valid"], [[2627, 2630], "disallowed"], [[2631, 2632], "valid"], [[2633, 2634], "disallowed"], [[2635, 2637], "valid"], [[2638, 2640], "disallowed"], [[2641, 2641], "valid"], [[2642, 2648], "disallowed"], [[2649, 2649], "mapped", [2582, 2620]], [[2650, 2650], "mapped", [2583, 2620]], [[2651, 2651], "mapped", [2588, 2620]], [[2652, 2652], "valid"], [[2653, 2653], "disallowed"], [[2654, 2654], "mapped", [2603, 2620]], [[2655, 2661], "disallowed"], [[2662, 2676], "valid"], [[2677, 2677], "valid"], [[2678, 2688], "disallowed"], [[2689, 2691], "valid"], [[2692, 2692], "disallowed"], [[2693, 2699], "valid"], [[2700, 2700], "valid"], [[2701, 2701], "valid"], [[2702, 2702], "disallowed"], [[2703, 2705], "valid"], [[2706, 2706], "disallowed"], [[2707, 2728], "valid"], [[2729, 2729], "disallowed"], [[2730, 2736], "valid"], [[2737, 2737], "disallowed"], [[2738, 2739], "valid"], [[2740, 2740], "disallowed"], [[2741, 2745], "valid"], [[2746, 2747], "disallowed"], [[2748, 2757], "valid"], [[2758, 2758], "disallowed"], [[2759, 2761], "valid"], [[2762, 2762], "disallowed"], [[2763, 2765], "valid"], [[2766, 2767], "disallowed"], [[2768, 2768], "valid"], [[2769, 2783], "disallowed"], [[2784, 2784], "valid"], [[2785, 2787], "valid"], [[2788, 2789], "disallowed"], [[2790, 2799], "valid"], [[2800, 2800], "valid", [], "NV8"], [[2801, 2801], "valid", [], "NV8"], [[2802, 2808], "disallowed"], [[2809, 2809], "valid"], [[2810, 2816], "disallowed"], [[2817, 2819], "valid"], [[2820, 2820], "disallowed"], [[2821, 2828], "valid"], [[2829, 2830], "disallowed"], [[2831, 2832], "valid"], [[2833, 2834], "disallowed"], [[2835, 2856], "valid"], [[2857, 2857], "disallowed"], [[2858, 2864], "valid"], [[2865, 2865], "disallowed"], [[2866, 2867], "valid"], [[2868, 2868], "disallowed"], [[2869, 2869], "valid"], [[2870, 2873], "valid"], [[2874, 2875], "disallowed"], [[2876, 2883], "valid"], [[2884, 2884], "valid"], [[2885, 2886], "disallowed"], [[2887, 2888], "valid"], [[2889, 2890], "disallowed"], [[2891, 2893], "valid"], [[2894, 2901], "disallowed"], [[2902, 2903], "valid"], [[2904, 2907], "disallowed"], [[2908, 2908], "mapped", [2849, 2876]], [[2909, 2909], "mapped", [2850, 2876]], [[2910, 2910], "disallowed"], [[2911, 2913], "valid"], [[2914, 2915], "valid"], [[2916, 2917], "disallowed"], [[2918, 2927], "valid"], [[2928, 2928], "valid", [], "NV8"], [[2929, 2929], "valid"], [[2930, 2935], "valid", [], "NV8"], [[2936, 2945], "disallowed"], [[2946, 2947], "valid"], [[2948, 2948], "disallowed"], [[2949, 2954], "valid"], [[2955, 2957], "disallowed"], [[2958, 2960], "valid"], [[2961, 2961], "disallowed"], [[2962, 2965], "valid"], [[2966, 2968], "disallowed"], [[2969, 2970], "valid"], [[2971, 2971], "disallowed"], [[2972, 2972], "valid"], [[2973, 2973], "disallowed"], [[2974, 2975], "valid"], [[2976, 2978], "disallowed"], [[2979, 2980], "valid"], [[2981, 2983], "disallowed"], [[2984, 2986], "valid"], [[2987, 2989], "disallowed"], [[2990, 2997], "valid"], [[2998, 2998], "valid"], [[2999, 3001], "valid"], [[3002, 3005], "disallowed"], [[3006, 3010], "valid"], [[3011, 3013], "disallowed"], [[3014, 3016], "valid"], [[3017, 3017], "disallowed"], [[3018, 3021], "valid"], [[3022, 3023], "disallowed"], [[3024, 3024], "valid"], [[3025, 3030], "disallowed"], [[3031, 3031], "valid"], [[3032, 3045], "disallowed"], [[3046, 3046], "valid"], [[3047, 3055], "valid"], [[3056, 3058], "valid", [], "NV8"], [[3059, 3066], "valid", [], "NV8"], [[3067, 3071], "disallowed"], [[3072, 3072], "valid"], [[3073, 3075], "valid"], [[3076, 3076], "disallowed"], [[3077, 3084], "valid"], [[3085, 3085], "disallowed"], [[3086, 3088], "valid"], [[3089, 3089], "disallowed"], [[3090, 3112], "valid"], [[3113, 3113], "disallowed"], [[3114, 3123], "valid"], [[3124, 3124], "valid"], [[3125, 3129], "valid"], [[3130, 3132], "disallowed"], [[3133, 3133], "valid"], [[3134, 3140], "valid"], [[3141, 3141], "disallowed"], [[3142, 3144], "valid"], [[3145, 3145], "disallowed"], [[3146, 3149], "valid"], [[3150, 3156], "disallowed"], [[3157, 3158], "valid"], [[3159, 3159], "disallowed"], [[3160, 3161], "valid"], [[3162, 3162], "valid"], [[3163, 3167], "disallowed"], [[3168, 3169], "valid"], [[3170, 3171], "valid"], [[3172, 3173], "disallowed"], [[3174, 3183], "valid"], [[3184, 3191], "disallowed"], [[3192, 3199], "valid", [], "NV8"], [[3200, 3200], "disallowed"], [[3201, 3201], "valid"], [[3202, 3203], "valid"], [[3204, 3204], "disallowed"], [[3205, 3212], "valid"], [[3213, 3213], "disallowed"], [[3214, 3216], "valid"], [[3217, 3217], "disallowed"], [[3218, 3240], "valid"], [[3241, 3241], "disallowed"], [[3242, 3251], "valid"], [[3252, 3252], "disallowed"], [[3253, 3257], "valid"], [[3258, 3259], "disallowed"], [[3260, 3261], "valid"], [[3262, 3268], "valid"], [[3269, 3269], "disallowed"], [[3270, 3272], "valid"], [[3273, 3273], "disallowed"], [[3274, 3277], "valid"], [[3278, 3284], "disallowed"], [[3285, 3286], "valid"], [[3287, 3293], "disallowed"], [[3294, 3294], "valid"], [[3295, 3295], "disallowed"], [[3296, 3297], "valid"], [[3298, 3299], "valid"], [[3300, 3301], "disallowed"], [[3302, 3311], "valid"], [[3312, 3312], "disallowed"], [[3313, 3314], "valid"], [[3315, 3328], "disallowed"], [[3329, 3329], "valid"], [[3330, 3331], "valid"], [[3332, 3332], "disallowed"], [[3333, 3340], "valid"], [[3341, 3341], "disallowed"], [[3342, 3344], "valid"], [[3345, 3345], "disallowed"], [[3346, 3368], "valid"], [[3369, 3369], "valid"], [[3370, 3385], "valid"], [[3386, 3386], "valid"], [[3387, 3388], "disallowed"], [[3389, 3389], "valid"], [[3390, 3395], "valid"], [[3396, 3396], "valid"], [[3397, 3397], "disallowed"], [[3398, 3400], "valid"], [[3401, 3401], "disallowed"], [[3402, 3405], "valid"], [[3406, 3406], "valid"], [[3407, 3414], "disallowed"], [[3415, 3415], "valid"], [[3416, 3422], "disallowed"], [[3423, 3423], "valid"], [[3424, 3425], "valid"], [[3426, 3427], "valid"], [[3428, 3429], "disallowed"], [[3430, 3439], "valid"], [[3440, 3445], "valid", [], "NV8"], [[3446, 3448], "disallowed"], [[3449, 3449], "valid", [], "NV8"], [[3450, 3455], "valid"], [[3456, 3457], "disallowed"], [[3458, 3459], "valid"], [[3460, 3460], "disallowed"], [[3461, 3478], "valid"], [[3479, 3481], "disallowed"], [[3482, 3505], "valid"], [[3506, 3506], "disallowed"], [[3507, 3515], "valid"], [[3516, 3516], "disallowed"], [[3517, 3517], "valid"], [[3518, 3519], "disallowed"], [[3520, 3526], "valid"], [[3527, 3529], "disallowed"], [[3530, 3530], "valid"], [[3531, 3534], "disallowed"], [[3535, 3540], "valid"], [[3541, 3541], "disallowed"], [[3542, 3542], "valid"], [[3543, 3543], "disallowed"], [[3544, 3551], "valid"], [[3552, 3557], "disallowed"], [[3558, 3567], "valid"], [[3568, 3569], "disallowed"], [[3570, 3571], "valid"], [[3572, 3572], "valid", [], "NV8"], [[3573, 3584], "disallowed"], [[3585, 3634], "valid"], [[3635, 3635], "mapped", [3661, 3634]], [[3636, 3642], "valid"], [[3643, 3646], "disallowed"], [[3647, 3647], "valid", [], "NV8"], [[3648, 3662], "valid"], [[3663, 3663], "valid", [], "NV8"], [[3664, 3673], "valid"], [[3674, 3675], "valid", [], "NV8"], [[3676, 3712], "disallowed"], [[3713, 3714], "valid"], [[3715, 3715], "disallowed"], [[3716, 3716], "valid"], [[3717, 3718], "disallowed"], [[3719, 3720], "valid"], [[3721, 3721], "disallowed"], [[3722, 3722], "valid"], [[3723, 3724], "disallowed"], [[3725, 3725], "valid"], [[3726, 3731], "disallowed"], [[3732, 3735], "valid"], [[3736, 3736], "disallowed"], [[3737, 3743], "valid"], [[3744, 3744], "disallowed"], [[3745, 3747], "valid"], [[3748, 3748], "disallowed"], [[3749, 3749], "valid"], [[3750, 3750], "disallowed"], [[3751, 3751], "valid"], [[3752, 3753], "disallowed"], [[3754, 3755], "valid"], [[3756, 3756], "disallowed"], [[3757, 3762], "valid"], [[3763, 3763], "mapped", [3789, 3762]], [[3764, 3769], "valid"], [[3770, 3770], "disallowed"], [[3771, 3773], "valid"], [[3774, 3775], "disallowed"], [[3776, 3780], "valid"], [[3781, 3781], "disallowed"], [[3782, 3782], "valid"], [[3783, 3783], "disallowed"], [[3784, 3789], "valid"], [[3790, 3791], "disallowed"], [[3792, 3801], "valid"], [[3802, 3803], "disallowed"], [[3804, 3804], "mapped", [3755, 3737]], [[3805, 3805], "mapped", [3755, 3745]], [[3806, 3807], "valid"], [[3808, 3839], "disallowed"], [[3840, 3840], "valid"], [[3841, 3850], "valid", [], "NV8"], [[3851, 3851], "valid"], [[3852, 3852], "mapped", [3851]], [[3853, 3863], "valid", [], "NV8"], [[3864, 3865], "valid"], [[3866, 3871], "valid", [], "NV8"], [[3872, 3881], "valid"], [[3882, 3892], "valid", [], "NV8"], [[3893, 3893], "valid"], [[3894, 3894], "valid", [], "NV8"], [[3895, 3895], "valid"], [[3896, 3896], "valid", [], "NV8"], [[3897, 3897], "valid"], [[3898, 3901], "valid", [], "NV8"], [[3902, 3906], "valid"], [[3907, 3907], "mapped", [3906, 4023]], [[3908, 3911], "valid"], [[3912, 3912], "disallowed"], [[3913, 3916], "valid"], [[3917, 3917], "mapped", [3916, 4023]], [[3918, 3921], "valid"], [[3922, 3922], "mapped", [3921, 4023]], [[3923, 3926], "valid"], [[3927, 3927], "mapped", [3926, 4023]], [[3928, 3931], "valid"], [[3932, 3932], "mapped", [3931, 4023]], [[3933, 3944], "valid"], [[3945, 3945], "mapped", [3904, 4021]], [[3946, 3946], "valid"], [[3947, 3948], "valid"], [[3949, 3952], "disallowed"], [[3953, 3954], "valid"], [[3955, 3955], "mapped", [3953, 3954]], [[3956, 3956], "valid"], [[3957, 3957], "mapped", [3953, 3956]], [[3958, 3958], "mapped", [4018, 3968]], [[3959, 3959], "mapped", [4018, 3953, 3968]], [[3960, 3960], "mapped", [4019, 3968]], [[3961, 3961], "mapped", [4019, 3953, 3968]], [[3962, 3968], "valid"], [[3969, 3969], "mapped", [3953, 3968]], [[3970, 3972], "valid"], [[3973, 3973], "valid", [], "NV8"], [[3974, 3979], "valid"], [[3980, 3983], "valid"], [[3984, 3986], "valid"], [[3987, 3987], "mapped", [3986, 4023]], [[3988, 3989], "valid"], [[3990, 3990], "valid"], [[3991, 3991], "valid"], [[3992, 3992], "disallowed"], [[3993, 3996], "valid"], [[3997, 3997], "mapped", [3996, 4023]], [[3998, 4001], "valid"], [[4002, 4002], "mapped", [4001, 4023]], [[4003, 4006], "valid"], [[4007, 4007], "mapped", [4006, 4023]], [[4008, 4011], "valid"], [[4012, 4012], "mapped", [4011, 4023]], [[4013, 4013], "valid"], [[4014, 4016], "valid"], [[4017, 4023], "valid"], [[4024, 4024], "valid"], [[4025, 4025], "mapped", [3984, 4021]], [[4026, 4028], "valid"], [[4029, 4029], "disallowed"], [[4030, 4037], "valid", [], "NV8"], [[4038, 4038], "valid"], [[4039, 4044], "valid", [], "NV8"], [[4045, 4045], "disallowed"], [[4046, 4046], "valid", [], "NV8"], [[4047, 4047], "valid", [], "NV8"], [[4048, 4049], "valid", [], "NV8"], [[4050, 4052], "valid", [], "NV8"], [[4053, 4056], "valid", [], "NV8"], [[4057, 4058], "valid", [], "NV8"], [[4059, 4095], "disallowed"], [[4096, 4129], "valid"], [[4130, 4130], "valid"], [[4131, 4135], "valid"], [[4136, 4136], "valid"], [[4137, 4138], "valid"], [[4139, 4139], "valid"], [[4140, 4146], "valid"], [[4147, 4149], "valid"], [[4150, 4153], "valid"], [[4154, 4159], "valid"], [[4160, 4169], "valid"], [[4170, 4175], "valid", [], "NV8"], [[4176, 4185], "valid"], [[4186, 4249], "valid"], [[4250, 4253], "valid"], [[4254, 4255], "valid", [], "NV8"], [[4256, 4293], "disallowed"], [[4294, 4294], "disallowed"], [[4295, 4295], "mapped", [11559]], [[4296, 4300], "disallowed"], [[4301, 4301], "mapped", [11565]], [[4302, 4303], "disallowed"], [[4304, 4342], "valid"], [[4343, 4344], "valid"], [[4345, 4346], "valid"], [[4347, 4347], "valid", [], "NV8"], [[4348, 4348], "mapped", [4316]], [[4349, 4351], "valid"], [[4352, 4441], "valid", [], "NV8"], [[4442, 4446], "valid", [], "NV8"], [[4447, 4448], "disallowed"], [[4449, 4514], "valid", [], "NV8"], [[4515, 4519], "valid", [], "NV8"], [[4520, 4601], "valid", [], "NV8"], [[4602, 4607], "valid", [], "NV8"], [[4608, 4614], "valid"], [[4615, 4615], "valid"], [[4616, 4678], "valid"], [[4679, 4679], "valid"], [[4680, 4680], "valid"], [[4681, 4681], "disallowed"], [[4682, 4685], "valid"], [[4686, 4687], "disallowed"], [[4688, 4694], "valid"], [[4695, 4695], "disallowed"], [[4696, 4696], "valid"], [[4697, 4697], "disallowed"], [[4698, 4701], "valid"], [[4702, 4703], "disallowed"], [[4704, 4742], "valid"], [[4743, 4743], "valid"], [[4744, 4744], "valid"], [[4745, 4745], "disallowed"], [[4746, 4749], "valid"], [[4750, 4751], "disallowed"], [[4752, 4782], "valid"], [[4783, 4783], "valid"], [[4784, 4784], "valid"], [[4785, 4785], "disallowed"], [[4786, 4789], "valid"], [[4790, 4791], "disallowed"], [[4792, 4798], "valid"], [[4799, 4799], "disallowed"], [[4800, 4800], "valid"], [[4801, 4801], "disallowed"], [[4802, 4805], "valid"], [[4806, 4807], "disallowed"], [[4808, 4814], "valid"], [[4815, 4815], "valid"], [[4816, 4822], "valid"], [[4823, 4823], "disallowed"], [[4824, 4846], "valid"], [[4847, 4847], "valid"], [[4848, 4878], "valid"], [[4879, 4879], "valid"], [[4880, 4880], "valid"], [[4881, 4881], "disallowed"], [[4882, 4885], "valid"], [[4886, 4887], "disallowed"], [[4888, 4894], "valid"], [[4895, 4895], "valid"], [[4896, 4934], "valid"], [[4935, 4935], "valid"], [[4936, 4954], "valid"], [[4955, 4956], "disallowed"], [[4957, 4958], "valid"], [[4959, 4959], "valid"], [[4960, 4960], "valid", [], "NV8"], [[4961, 4988], "valid", [], "NV8"], [[4989, 4991], "disallowed"], [[4992, 5007], "valid"], [[5008, 5017], "valid", [], "NV8"], [[5018, 5023], "disallowed"], [[5024, 5108], "valid"], [[5109, 5109], "valid"], [[5110, 5111], "disallowed"], [[5112, 5112], "mapped", [5104]], [[5113, 5113], "mapped", [5105]], [[5114, 5114], "mapped", [5106]], [[5115, 5115], "mapped", [5107]], [[5116, 5116], "mapped", [5108]], [[5117, 5117], "mapped", [5109]], [[5118, 5119], "disallowed"], [[5120, 5120], "valid", [], "NV8"], [[5121, 5740], "valid"], [[5741, 5742], "valid", [], "NV8"], [[5743, 5750], "valid"], [[5751, 5759], "valid"], [[5760, 5760], "disallowed"], [[5761, 5786], "valid"], [[5787, 5788], "valid", [], "NV8"], [[5789, 5791], "disallowed"], [[5792, 5866], "valid"], [[5867, 5872], "valid", [], "NV8"], [[5873, 5880], "valid"], [[5881, 5887], "disallowed"], [[5888, 5900], "valid"], [[5901, 5901], "disallowed"], [[5902, 5908], "valid"], [[5909, 5919], "disallowed"], [[5920, 5940], "valid"], [[5941, 5942], "valid", [], "NV8"], [[5943, 5951], "disallowed"], [[5952, 5971], "valid"], [[5972, 5983], "disallowed"], [[5984, 5996], "valid"], [[5997, 5997], "disallowed"], [[5998, 6e3], "valid"], [[6001, 6001], "disallowed"], [[6002, 6003], "valid"], [[6004, 6015], "disallowed"], [[6016, 6067], "valid"], [[6068, 6069], "disallowed"], [[6070, 6099], "valid"], [[6100, 6102], "valid", [], "NV8"], [[6103, 6103], "valid"], [[6104, 6107], "valid", [], "NV8"], [[6108, 6108], "valid"], [[6109, 6109], "valid"], [[6110, 6111], "disallowed"], [[6112, 6121], "valid"], [[6122, 6127], "disallowed"], [[6128, 6137], "valid", [], "NV8"], [[6138, 6143], "disallowed"], [[6144, 6149], "valid", [], "NV8"], [[6150, 6150], "disallowed"], [[6151, 6154], "valid", [], "NV8"], [[6155, 6157], "ignored"], [[6158, 6158], "disallowed"], [[6159, 6159], "disallowed"], [[6160, 6169], "valid"], [[6170, 6175], "disallowed"], [[6176, 6263], "valid"], [[6264, 6271], "disallowed"], [[6272, 6313], "valid"], [[6314, 6314], "valid"], [[6315, 6319], "disallowed"], [[6320, 6389], "valid"], [[6390, 6399], "disallowed"], [[6400, 6428], "valid"], [[6429, 6430], "valid"], [[6431, 6431], "disallowed"], [[6432, 6443], "valid"], [[6444, 6447], "disallowed"], [[6448, 6459], "valid"], [[6460, 6463], "disallowed"], [[6464, 6464], "valid", [], "NV8"], [[6465, 6467], "disallowed"], [[6468, 6469], "valid", [], "NV8"], [[6470, 6509], "valid"], [[6510, 6511], "disallowed"], [[6512, 6516], "valid"], [[6517, 6527], "disallowed"], [[6528, 6569], "valid"], [[6570, 6571], "valid"], [[6572, 6575], "disallowed"], [[6576, 6601], "valid"], [[6602, 6607], "disallowed"], [[6608, 6617], "valid"], [[6618, 6618], "valid", [], "XV8"], [[6619, 6621], "disallowed"], [[6622, 6623], "valid", [], "NV8"], [[6624, 6655], "valid", [], "NV8"], [[6656, 6683], "valid"], [[6684, 6685], "disallowed"], [[6686, 6687], "valid", [], "NV8"], [[6688, 6750], "valid"], [[6751, 6751], "disallowed"], [[6752, 6780], "valid"], [[6781, 6782], "disallowed"], [[6783, 6793], "valid"], [[6794, 6799], "disallowed"], [[6800, 6809], "valid"], [[6810, 6815], "disallowed"], [[6816, 6822], "valid", [], "NV8"], [[6823, 6823], "valid"], [[6824, 6829], "valid", [], "NV8"], [[6830, 6831], "disallowed"], [[6832, 6845], "valid"], [[6846, 6846], "valid", [], "NV8"], [[6847, 6911], "disallowed"], [[6912, 6987], "valid"], [[6988, 6991], "disallowed"], [[6992, 7001], "valid"], [[7002, 7018], "valid", [], "NV8"], [[7019, 7027], "valid"], [[7028, 7036], "valid", [], "NV8"], [[7037, 7039], "disallowed"], [[7040, 7082], "valid"], [[7083, 7085], "valid"], [[7086, 7097], "valid"], [[7098, 7103], "valid"], [[7104, 7155], "valid"], [[7156, 7163], "disallowed"], [[7164, 7167], "valid", [], "NV8"], [[7168, 7223], "valid"], [[7224, 7226], "disallowed"], [[7227, 7231], "valid", [], "NV8"], [[7232, 7241], "valid"], [[7242, 7244], "disallowed"], [[7245, 7293], "valid"], [[7294, 7295], "valid", [], "NV8"], [[7296, 7359], "disallowed"], [[7360, 7367], "valid", [], "NV8"], [[7368, 7375], "disallowed"], [[7376, 7378], "valid"], [[7379, 7379], "valid", [], "NV8"], [[7380, 7410], "valid"], [[7411, 7414], "valid"], [[7415, 7415], "disallowed"], [[7416, 7417], "valid"], [[7418, 7423], "disallowed"], [[7424, 7467], "valid"], [[7468, 7468], "mapped", [97]], [[7469, 7469], "mapped", [230]], [[7470, 7470], "mapped", [98]], [[7471, 7471], "valid"], [[7472, 7472], "mapped", [100]], [[7473, 7473], "mapped", [101]], [[7474, 7474], "mapped", [477]], [[7475, 7475], "mapped", [103]], [[7476, 7476], "mapped", [104]], [[7477, 7477], "mapped", [105]], [[7478, 7478], "mapped", [106]], [[7479, 7479], "mapped", [107]], [[7480, 7480], "mapped", [108]], [[7481, 7481], "mapped", [109]], [[7482, 7482], "mapped", [110]], [[7483, 7483], "valid"], [[7484, 7484], "mapped", [111]], [[7485, 7485], "mapped", [547]], [[7486, 7486], "mapped", [112]], [[7487, 7487], "mapped", [114]], [[7488, 7488], "mapped", [116]], [[7489, 7489], "mapped", [117]], [[7490, 7490], "mapped", [119]], [[7491, 7491], "mapped", [97]], [[7492, 7492], "mapped", [592]], [[7493, 7493], "mapped", [593]], [[7494, 7494], "mapped", [7426]], [[7495, 7495], "mapped", [98]], [[7496, 7496], "mapped", [100]], [[7497, 7497], "mapped", [101]], [[7498, 7498], "mapped", [601]], [[7499, 7499], "mapped", [603]], [[7500, 7500], "mapped", [604]], [[7501, 7501], "mapped", [103]], [[7502, 7502], "valid"], [[7503, 7503], "mapped", [107]], [[7504, 7504], "mapped", [109]], [[7505, 7505], "mapped", [331]], [[7506, 7506], "mapped", [111]], [[7507, 7507], "mapped", [596]], [[7508, 7508], "mapped", [7446]], [[7509, 7509], "mapped", [7447]], [[7510, 7510], "mapped", [112]], [[7511, 7511], "mapped", [116]], [[7512, 7512], "mapped", [117]], [[7513, 7513], "mapped", [7453]], [[7514, 7514], "mapped", [623]], [[7515, 7515], "mapped", [118]], [[7516, 7516], "mapped", [7461]], [[7517, 7517], "mapped", [946]], [[7518, 7518], "mapped", [947]], [[7519, 7519], "mapped", [948]], [[7520, 7520], "mapped", [966]], [[7521, 7521], "mapped", [967]], [[7522, 7522], "mapped", [105]], [[7523, 7523], "mapped", [114]], [[7524, 7524], "mapped", [117]], [[7525, 7525], "mapped", [118]], [[7526, 7526], "mapped", [946]], [[7527, 7527], "mapped", [947]], [[7528, 7528], "mapped", [961]], [[7529, 7529], "mapped", [966]], [[7530, 7530], "mapped", [967]], [[7531, 7531], "valid"], [[7532, 7543], "valid"], [[7544, 7544], "mapped", [1085]], [[7545, 7578], "valid"], [[7579, 7579], "mapped", [594]], [[7580, 7580], "mapped", [99]], [[7581, 7581], "mapped", [597]], [[7582, 7582], "mapped", [240]], [[7583, 7583], "mapped", [604]], [[7584, 7584], "mapped", [102]], [[7585, 7585], "mapped", [607]], [[7586, 7586], "mapped", [609]], [[7587, 7587], "mapped", [613]], [[7588, 7588], "mapped", [616]], [[7589, 7589], "mapped", [617]], [[7590, 7590], "mapped", [618]], [[7591, 7591], "mapped", [7547]], [[7592, 7592], "mapped", [669]], [[7593, 7593], "mapped", [621]], [[7594, 7594], "mapped", [7557]], [[7595, 7595], "mapped", [671]], [[7596, 7596], "mapped", [625]], [[7597, 7597], "mapped", [624]], [[7598, 7598], "mapped", [626]], [[7599, 7599], "mapped", [627]], [[7600, 7600], "mapped", [628]], [[7601, 7601], "mapped", [629]], [[7602, 7602], "mapped", [632]], [[7603, 7603], "mapped", [642]], [[7604, 7604], "mapped", [643]], [[7605, 7605], "mapped", [427]], [[7606, 7606], "mapped", [649]], [[7607, 7607], "mapped", [650]], [[7608, 7608], "mapped", [7452]], [[7609, 7609], "mapped", [651]], [[7610, 7610], "mapped", [652]], [[7611, 7611], "mapped", [122]], [[7612, 7612], "mapped", [656]], [[7613, 7613], "mapped", [657]], [[7614, 7614], "mapped", [658]], [[7615, 7615], "mapped", [952]], [[7616, 7619], "valid"], [[7620, 7626], "valid"], [[7627, 7654], "valid"], [[7655, 7669], "valid"], [[7670, 7675], "disallowed"], [[7676, 7676], "valid"], [[7677, 7677], "valid"], [[7678, 7679], "valid"], [[7680, 7680], "mapped", [7681]], [[7681, 7681], "valid"], [[7682, 7682], "mapped", [7683]], [[7683, 7683], "valid"], [[7684, 7684], "mapped", [7685]], [[7685, 7685], "valid"], [[7686, 7686], "mapped", [7687]], [[7687, 7687], "valid"], [[7688, 7688], "mapped", [7689]], [[7689, 7689], "valid"], [[7690, 7690], "mapped", [7691]], [[7691, 7691], "valid"], [[7692, 7692], "mapped", [7693]], [[7693, 7693], "valid"], [[7694, 7694], "mapped", [7695]], [[7695, 7695], "valid"], [[7696, 7696], "mapped", [7697]], [[7697, 7697], "valid"], [[7698, 7698], "mapped", [7699]], [[7699, 7699], "valid"], [[7700, 7700], "mapped", [7701]], [[7701, 7701], "valid"], [[7702, 7702], "mapped", [7703]], [[7703, 7703], "valid"], [[7704, 7704], "mapped", [7705]], [[7705, 7705], "valid"], [[7706, 7706], "mapped", [7707]], [[7707, 7707], "valid"], [[7708, 7708], "mapped", [7709]], [[7709, 7709], "valid"], [[7710, 7710], "mapped", [7711]], [[7711, 7711], "valid"], [[7712, 7712], "mapped", [7713]], [[7713, 7713], "valid"], [[7714, 7714], "mapped", [7715]], [[7715, 7715], "valid"], [[7716, 7716], "mapped", [7717]], [[7717, 7717], "valid"], [[7718, 7718], "mapped", [7719]], [[7719, 7719], "valid"], [[7720, 7720], "mapped", [7721]], [[7721, 7721], "valid"], [[7722, 7722], "mapped", [7723]], [[7723, 7723], "valid"], [[7724, 7724], "mapped", [7725]], [[7725, 7725], "valid"], [[7726, 7726], "mapped", [7727]], [[7727, 7727], "valid"], [[7728, 7728], "mapped", [7729]], [[7729, 7729], "valid"], [[7730, 7730], "mapped", [7731]], [[7731, 7731], "valid"], [[7732, 7732], "mapped", [7733]], [[7733, 7733], "valid"], [[7734, 7734], "mapped", [7735]], [[7735, 7735], "valid"], [[7736, 7736], "mapped", [7737]], [[7737, 7737], "valid"], [[7738, 7738], "mapped", [7739]], [[7739, 7739], "valid"], [[7740, 7740], "mapped", [7741]], [[7741, 7741], "valid"], [[7742, 7742], "mapped", [7743]], [[7743, 7743], "valid"], [[7744, 7744], "mapped", [7745]], [[7745, 7745], "valid"], [[7746, 7746], "mapped", [7747]], [[7747, 7747], "valid"], [[7748, 7748], "mapped", [7749]], [[7749, 7749], "valid"], [[7750, 7750], "mapped", [7751]], [[7751, 7751], "valid"], [[7752, 7752], "mapped", [7753]], [[7753, 7753], "valid"], [[7754, 7754], "mapped", [7755]], [[7755, 7755], "valid"], [[7756, 7756], "mapped", [7757]], [[7757, 7757], "valid"], [[7758, 7758], "mapped", [7759]], [[7759, 7759], "valid"], [[7760, 7760], "mapped", [7761]], [[7761, 7761], "valid"], [[7762, 7762], "mapped", [7763]], [[7763, 7763], "valid"], [[7764, 7764], "mapped", [7765]], [[7765, 7765], "valid"], [[7766, 7766], "mapped", [7767]], [[7767, 7767], "valid"], [[7768, 7768], "mapped", [7769]], [[7769, 7769], "valid"], [[7770, 7770], "mapped", [7771]], [[7771, 7771], "valid"], [[7772, 7772], "mapped", [7773]], [[7773, 7773], "valid"], [[7774, 7774], "mapped", [7775]], [[7775, 7775], "valid"], [[7776, 7776], "mapped", [7777]], [[7777, 7777], "valid"], [[7778, 7778], "mapped", [7779]], [[7779, 7779], "valid"], [[7780, 7780], "mapped", [7781]], [[7781, 7781], "valid"], [[7782, 7782], "mapped", [7783]], [[7783, 7783], "valid"], [[7784, 7784], "mapped", [7785]], [[7785, 7785], "valid"], [[7786, 7786], "mapped", [7787]], [[7787, 7787], "valid"], [[7788, 7788], "mapped", [7789]], [[7789, 7789], "valid"], [[7790, 7790], "mapped", [7791]], [[7791, 7791], "valid"], [[7792, 7792], "mapped", [7793]], [[7793, 7793], "valid"], [[7794, 7794], "mapped", [7795]], [[7795, 7795], "valid"], [[7796, 7796], "mapped", [7797]], [[7797, 7797], "valid"], [[7798, 7798], "mapped", [7799]], [[7799, 7799], "valid"], [[7800, 7800], "mapped", [7801]], [[7801, 7801], "valid"], [[7802, 7802], "mapped", [7803]], [[7803, 7803], "valid"], [[7804, 7804], "mapped", [7805]], [[7805, 7805], "valid"], [[7806, 7806], "mapped", [7807]], [[7807, 7807], "valid"], [[7808, 7808], "mapped", [7809]], [[7809, 7809], "valid"], [[7810, 7810], "mapped", [7811]], [[7811, 7811], "valid"], [[7812, 7812], "mapped", [7813]], [[7813, 7813], "valid"], [[7814, 7814], "mapped", [7815]], [[7815, 7815], "valid"], [[7816, 7816], "mapped", [7817]], [[7817, 7817], "valid"], [[7818, 7818], "mapped", [7819]], [[7819, 7819], "valid"], [[7820, 7820], "mapped", [7821]], [[7821, 7821], "valid"], [[7822, 7822], "mapped", [7823]], [[7823, 7823], "valid"], [[7824, 7824], "mapped", [7825]], [[7825, 7825], "valid"], [[7826, 7826], "mapped", [7827]], [[7827, 7827], "valid"], [[7828, 7828], "mapped", [7829]], [[7829, 7833], "valid"], [[7834, 7834], "mapped", [97, 702]], [[7835, 7835], "mapped", [7777]], [[7836, 7837], "valid"], [[7838, 7838], "mapped", [115, 115]], [[7839, 7839], "valid"], [[7840, 7840], "mapped", [7841]], [[7841, 7841], "valid"], [[7842, 7842], "mapped", [7843]], [[7843, 7843], "valid"], [[7844, 7844], "mapped", [7845]], [[7845, 7845], "valid"], [[7846, 7846], "mapped", [7847]], [[7847, 7847], "valid"], [[7848, 7848], "mapped", [7849]], [[7849, 7849], "valid"], [[7850, 7850], "mapped", [7851]], [[7851, 7851], "valid"], [[7852, 7852], "mapped", [7853]], [[7853, 7853], "valid"], [[7854, 7854], "mapped", [7855]], [[7855, 7855], "valid"], [[7856, 7856], "mapped", [7857]], [[7857, 7857], "valid"], [[7858, 7858], "mapped", [7859]], [[7859, 7859], "valid"], [[7860, 7860], "mapped", [7861]], [[7861, 7861], "valid"], [[7862, 7862], "mapped", [7863]], [[7863, 7863], "valid"], [[7864, 7864], "mapped", [7865]], [[7865, 7865], "valid"], [[7866, 7866], "mapped", [7867]], [[7867, 7867], "valid"], [[7868, 7868], "mapped", [7869]], [[7869, 7869], "valid"], [[7870, 7870], "mapped", [7871]], [[7871, 7871], "valid"], [[7872, 7872], "mapped", [7873]], [[7873, 7873], "valid"], [[7874, 7874], "mapped", [7875]], [[7875, 7875], "valid"], [[7876, 7876], "mapped", [7877]], [[7877, 7877], "valid"], [[7878, 7878], "mapped", [7879]], [[7879, 7879], "valid"], [[7880, 7880], "mapped", [7881]], [[7881, 7881], "valid"], [[7882, 7882], "mapped", [7883]], [[7883, 7883], "valid"], [[7884, 7884], "mapped", [7885]], [[7885, 7885], "valid"], [[7886, 7886], "mapped", [7887]], [[7887, 7887], "valid"], [[7888, 7888], "mapped", [7889]], [[7889, 7889], "valid"], [[7890, 7890], "mapped", [7891]], [[7891, 7891], "valid"], [[7892, 7892], "mapped", [7893]], [[7893, 7893], "valid"], [[7894, 7894], "mapped", [7895]], [[7895, 7895], "valid"], [[7896, 7896], "mapped", [7897]], [[7897, 7897], "valid"], [[7898, 7898], "mapped", [7899]], [[7899, 7899], "valid"], [[7900, 7900], "mapped", [7901]], [[7901, 7901], "valid"], [[7902, 7902], "mapped", [7903]], [[7903, 7903], "valid"], [[7904, 7904], "mapped", [7905]], [[7905, 7905], "valid"], [[7906, 7906], "mapped", [7907]], [[7907, 7907], "valid"], [[7908, 7908], "mapped", [7909]], [[7909, 7909], "valid"], [[7910, 7910], "mapped", [7911]], [[7911, 7911], "valid"], [[7912, 7912], "mapped", [7913]], [[7913, 7913], "valid"], [[7914, 7914], "mapped", [7915]], [[7915, 7915], "valid"], [[7916, 7916], "mapped", [7917]], [[7917, 7917], "valid"], [[7918, 7918], "mapped", [7919]], [[7919, 7919], "valid"], [[7920, 7920], "mapped", [7921]], [[7921, 7921], "valid"], [[7922, 7922], "mapped", [7923]], [[7923, 7923], "valid"], [[7924, 7924], "mapped", [7925]], [[7925, 7925], "valid"], [[7926, 7926], "mapped", [7927]], [[7927, 7927], "valid"], [[7928, 7928], "mapped", [7929]], [[7929, 7929], "valid"], [[7930, 7930], "mapped", [7931]], [[7931, 7931], "valid"], [[7932, 7932], "mapped", [7933]], [[7933, 7933], "valid"], [[7934, 7934], "mapped", [7935]], [[7935, 7935], "valid"], [[7936, 7943], "valid"], [[7944, 7944], "mapped", [7936]], [[7945, 7945], "mapped", [7937]], [[7946, 7946], "mapped", [7938]], [[7947, 7947], "mapped", [7939]], [[7948, 7948], "mapped", [7940]], [[7949, 7949], "mapped", [7941]], [[7950, 7950], "mapped", [7942]], [[7951, 7951], "mapped", [7943]], [[7952, 7957], "valid"], [[7958, 7959], "disallowed"], [[7960, 7960], "mapped", [7952]], [[7961, 7961], "mapped", [7953]], [[7962, 7962], "mapped", [7954]], [[7963, 7963], "mapped", [7955]], [[7964, 7964], "mapped", [7956]], [[7965, 7965], "mapped", [7957]], [[7966, 7967], "disallowed"], [[7968, 7975], "valid"], [[7976, 7976], "mapped", [7968]], [[7977, 7977], "mapped", [7969]], [[7978, 7978], "mapped", [7970]], [[7979, 7979], "mapped", [7971]], [[7980, 7980], "mapped", [7972]], [[7981, 7981], "mapped", [7973]], [[7982, 7982], "mapped", [7974]], [[7983, 7983], "mapped", [7975]], [[7984, 7991], "valid"], [[7992, 7992], "mapped", [7984]], [[7993, 7993], "mapped", [7985]], [[7994, 7994], "mapped", [7986]], [[7995, 7995], "mapped", [7987]], [[7996, 7996], "mapped", [7988]], [[7997, 7997], "mapped", [7989]], [[7998, 7998], "mapped", [7990]], [[7999, 7999], "mapped", [7991]], [[8e3, 8005], "valid"], [[8006, 8007], "disallowed"], [[8008, 8008], "mapped", [8e3]], [[8009, 8009], "mapped", [8001]], [[8010, 8010], "mapped", [8002]], [[8011, 8011], "mapped", [8003]], [[8012, 8012], "mapped", [8004]], [[8013, 8013], "mapped", [8005]], [[8014, 8015], "disallowed"], [[8016, 8023], "valid"], [[8024, 8024], "disallowed"], [[8025, 8025], "mapped", [8017]], [[8026, 8026], "disallowed"], [[8027, 8027], "mapped", [8019]], [[8028, 8028], "disallowed"], [[8029, 8029], "mapped", [8021]], [[8030, 8030], "disallowed"], [[8031, 8031], "mapped", [8023]], [[8032, 8039], "valid"], [[8040, 8040], "mapped", [8032]], [[8041, 8041], "mapped", [8033]], [[8042, 8042], "mapped", [8034]], [[8043, 8043], "mapped", [8035]], [[8044, 8044], "mapped", [8036]], [[8045, 8045], "mapped", [8037]], [[8046, 8046], "mapped", [8038]], [[8047, 8047], "mapped", [8039]], [[8048, 8048], "valid"], [[8049, 8049], "mapped", [940]], [[8050, 8050], "valid"], [[8051, 8051], "mapped", [941]], [[8052, 8052], "valid"], [[8053, 8053], "mapped", [942]], [[8054, 8054], "valid"], [[8055, 8055], "mapped", [943]], [[8056, 8056], "valid"], [[8057, 8057], "mapped", [972]], [[8058, 8058], "valid"], [[8059, 8059], "mapped", [973]], [[8060, 8060], "valid"], [[8061, 8061], "mapped", [974]], [[8062, 8063], "disallowed"], [[8064, 8064], "mapped", [7936, 953]], [[8065, 8065], "mapped", [7937, 953]], [[8066, 8066], "mapped", [7938, 953]], [[8067, 8067], "mapped", [7939, 953]], [[8068, 8068], "mapped", [7940, 953]], [[8069, 8069], "mapped", [7941, 953]], [[8070, 8070], "mapped", [7942, 953]], [[8071, 8071], "mapped", [7943, 953]], [[8072, 8072], "mapped", [7936, 953]], [[8073, 8073], "mapped", [7937, 953]], [[8074, 8074], "mapped", [7938, 953]], [[8075, 8075], "mapped", [7939, 953]], [[8076, 8076], "mapped", [7940, 953]], [[8077, 8077], "mapped", [7941, 953]], [[8078, 8078], "mapped", [7942, 953]], [[8079, 8079], "mapped", [7943, 953]], [[8080, 8080], "mapped", [7968, 953]], [[8081, 8081], "mapped", [7969, 953]], [[8082, 8082], "mapped", [7970, 953]], [[8083, 8083], "mapped", [7971, 953]], [[8084, 8084], "mapped", [7972, 953]], [[8085, 8085], "mapped", [7973, 953]], [[8086, 8086], "mapped", [7974, 953]], [[8087, 8087], "mapped", [7975, 953]], [[8088, 8088], "mapped", [7968, 953]], [[8089, 8089], "mapped", [7969, 953]], [[8090, 8090], "mapped", [7970, 953]], [[8091, 8091], "mapped", [7971, 953]], [[8092, 8092], "mapped", [7972, 953]], [[8093, 8093], "mapped", [7973, 953]], [[8094, 8094], "mapped", [7974, 953]], [[8095, 8095], "mapped", [7975, 953]], [[8096, 8096], "mapped", [8032, 953]], [[8097, 8097], "mapped", [8033, 953]], [[8098, 8098], "mapped", [8034, 953]], [[8099, 8099], "mapped", [8035, 953]], [[8100, 8100], "mapped", [8036, 953]], [[8101, 8101], "mapped", [8037, 953]], [[8102, 8102], "mapped", [8038, 953]], [[8103, 8103], "mapped", [8039, 953]], [[8104, 8104], "mapped", [8032, 953]], [[8105, 8105], "mapped", [8033, 953]], [[8106, 8106], "mapped", [8034, 953]], [[8107, 8107], "mapped", [8035, 953]], [[8108, 8108], "mapped", [8036, 953]], [[8109, 8109], "mapped", [8037, 953]], [[8110, 8110], "mapped", [8038, 953]], [[8111, 8111], "mapped", [8039, 953]], [[8112, 8113], "valid"], [[8114, 8114], "mapped", [8048, 953]], [[8115, 8115], "mapped", [945, 953]], [[8116, 8116], "mapped", [940, 953]], [[8117, 8117], "disallowed"], [[8118, 8118], "valid"], [[8119, 8119], "mapped", [8118, 953]], [[8120, 8120], "mapped", [8112]], [[8121, 8121], "mapped", [8113]], [[8122, 8122], "mapped", [8048]], [[8123, 8123], "mapped", [940]], [[8124, 8124], "mapped", [945, 953]], [[8125, 8125], "disallowed_STD3_mapped", [32, 787]], [[8126, 8126], "mapped", [953]], [[8127, 8127], "disallowed_STD3_mapped", [32, 787]], [[8128, 8128], "disallowed_STD3_mapped", [32, 834]], [[8129, 8129], "disallowed_STD3_mapped", [32, 776, 834]], [[8130, 8130], "mapped", [8052, 953]], [[8131, 8131], "mapped", [951, 953]], [[8132, 8132], "mapped", [942, 953]], [[8133, 8133], "disallowed"], [[8134, 8134], "valid"], [[8135, 8135], "mapped", [8134, 953]], [[8136, 8136], "mapped", [8050]], [[8137, 8137], "mapped", [941]], [[8138, 8138], "mapped", [8052]], [[8139, 8139], "mapped", [942]], [[8140, 8140], "mapped", [951, 953]], [[8141, 8141], "disallowed_STD3_mapped", [32, 787, 768]], [[8142, 8142], "disallowed_STD3_mapped", [32, 787, 769]], [[8143, 8143], "disallowed_STD3_mapped", [32, 787, 834]], [[8144, 8146], "valid"], [[8147, 8147], "mapped", [912]], [[8148, 8149], "disallowed"], [[8150, 8151], "valid"], [[8152, 8152], "mapped", [8144]], [[8153, 8153], "mapped", [8145]], [[8154, 8154], "mapped", [8054]], [[8155, 8155], "mapped", [943]], [[8156, 8156], "disallowed"], [[8157, 8157], "disallowed_STD3_mapped", [32, 788, 768]], [[8158, 8158], "disallowed_STD3_mapped", [32, 788, 769]], [[8159, 8159], "disallowed_STD3_mapped", [32, 788, 834]], [[8160, 8162], "valid"], [[8163, 8163], "mapped", [944]], [[8164, 8167], "valid"], [[8168, 8168], "mapped", [8160]], [[8169, 8169], "mapped", [8161]], [[8170, 8170], "mapped", [8058]], [[8171, 8171], "mapped", [973]], [[8172, 8172], "mapped", [8165]], [[8173, 8173], "disallowed_STD3_mapped", [32, 776, 768]], [[8174, 8174], "disallowed_STD3_mapped", [32, 776, 769]], [[8175, 8175], "disallowed_STD3_mapped", [96]], [[8176, 8177], "disallowed"], [[8178, 8178], "mapped", [8060, 953]], [[8179, 8179], "mapped", [969, 953]], [[8180, 8180], "mapped", [974, 953]], [[8181, 8181], "disallowed"], [[8182, 8182], "valid"], [[8183, 8183], "mapped", [8182, 953]], [[8184, 8184], "mapped", [8056]], [[8185, 8185], "mapped", [972]], [[8186, 8186], "mapped", [8060]], [[8187, 8187], "mapped", [974]], [[8188, 8188], "mapped", [969, 953]], [[8189, 8189], "disallowed_STD3_mapped", [32, 769]], [[8190, 8190], "disallowed_STD3_mapped", [32, 788]], [[8191, 8191], "disallowed"], [[8192, 8202], "disallowed_STD3_mapped", [32]], [[8203, 8203], "ignored"], [[8204, 8205], "deviation", []], [[8206, 8207], "disallowed"], [[8208, 8208], "valid", [], "NV8"], [[8209, 8209], "mapped", [8208]], [[8210, 8214], "valid", [], "NV8"], [[8215, 8215], "disallowed_STD3_mapped", [32, 819]], [[8216, 8227], "valid", [], "NV8"], [[8228, 8230], "disallowed"], [[8231, 8231], "valid", [], "NV8"], [[8232, 8238], "disallowed"], [[8239, 8239], "disallowed_STD3_mapped", [32]], [[8240, 8242], "valid", [], "NV8"], [[8243, 8243], "mapped", [8242, 8242]], [[8244, 8244], "mapped", [8242, 8242, 8242]], [[8245, 8245], "valid", [], "NV8"], [[8246, 8246], "mapped", [8245, 8245]], [[8247, 8247], "mapped", [8245, 8245, 8245]], [[8248, 8251], "valid", [], "NV8"], [[8252, 8252], "disallowed_STD3_mapped", [33, 33]], [[8253, 8253], "valid", [], "NV8"], [[8254, 8254], "disallowed_STD3_mapped", [32, 773]], [[8255, 8262], "valid", [], "NV8"], [[8263, 8263], "disallowed_STD3_mapped", [63, 63]], [[8264, 8264], "disallowed_STD3_mapped", [63, 33]], [[8265, 8265], "disallowed_STD3_mapped", [33, 63]], [[8266, 8269], "valid", [], "NV8"], [[8270, 8274], "valid", [], "NV8"], [[8275, 8276], "valid", [], "NV8"], [[8277, 8278], "valid", [], "NV8"], [[8279, 8279], "mapped", [8242, 8242, 8242, 8242]], [[8280, 8286], "valid", [], "NV8"], [[8287, 8287], "disallowed_STD3_mapped", [32]], [[8288, 8288], "ignored"], [[8289, 8291], "disallowed"], [[8292, 8292], "ignored"], [[8293, 8293], "disallowed"], [[8294, 8297], "disallowed"], [[8298, 8303], "disallowed"], [[8304, 8304], "mapped", [48]], [[8305, 8305], "mapped", [105]], [[8306, 8307], "disallowed"], [[8308, 8308], "mapped", [52]], [[8309, 8309], "mapped", [53]], [[8310, 8310], "mapped", [54]], [[8311, 8311], "mapped", [55]], [[8312, 8312], "mapped", [56]], [[8313, 8313], "mapped", [57]], [[8314, 8314], "disallowed_STD3_mapped", [43]], [[8315, 8315], "mapped", [8722]], [[8316, 8316], "disallowed_STD3_mapped", [61]], [[8317, 8317], "disallowed_STD3_mapped", [40]], [[8318, 8318], "disallowed_STD3_mapped", [41]], [[8319, 8319], "mapped", [110]], [[8320, 8320], "mapped", [48]], [[8321, 8321], "mapped", [49]], [[8322, 8322], "mapped", [50]], [[8323, 8323], "mapped", [51]], [[8324, 8324], "mapped", [52]], [[8325, 8325], "mapped", [53]], [[8326, 8326], "mapped", [54]], [[8327, 8327], "mapped", [55]], [[8328, 8328], "mapped", [56]], [[8329, 8329], "mapped", [57]], [[8330, 8330], "disallowed_STD3_mapped", [43]], [[8331, 8331], "mapped", [8722]], [[8332, 8332], "disallowed_STD3_mapped", [61]], [[8333, 8333], "disallowed_STD3_mapped", [40]], [[8334, 8334], "disallowed_STD3_mapped", [41]], [[8335, 8335], "disallowed"], [[8336, 8336], "mapped", [97]], [[8337, 8337], "mapped", [101]], [[8338, 8338], "mapped", [111]], [[8339, 8339], "mapped", [120]], [[8340, 8340], "mapped", [601]], [[8341, 8341], "mapped", [104]], [[8342, 8342], "mapped", [107]], [[8343, 8343], "mapped", [108]], [[8344, 8344], "mapped", [109]], [[8345, 8345], "mapped", [110]], [[8346, 8346], "mapped", [112]], [[8347, 8347], "mapped", [115]], [[8348, 8348], "mapped", [116]], [[8349, 8351], "disallowed"], [[8352, 8359], "valid", [], "NV8"], [[8360, 8360], "mapped", [114, 115]], [[8361, 8362], "valid", [], "NV8"], [[8363, 8363], "valid", [], "NV8"], [[8364, 8364], "valid", [], "NV8"], [[8365, 8367], "valid", [], "NV8"], [[8368, 8369], "valid", [], "NV8"], [[8370, 8373], "valid", [], "NV8"], [[8374, 8376], "valid", [], "NV8"], [[8377, 8377], "valid", [], "NV8"], [[8378, 8378], "valid", [], "NV8"], [[8379, 8381], "valid", [], "NV8"], [[8382, 8382], "valid", [], "NV8"], [[8383, 8399], "disallowed"], [[8400, 8417], "valid", [], "NV8"], [[8418, 8419], "valid", [], "NV8"], [[8420, 8426], "valid", [], "NV8"], [[8427, 8427], "valid", [], "NV8"], [[8428, 8431], "valid", [], "NV8"], [[8432, 8432], "valid", [], "NV8"], [[8433, 8447], "disallowed"], [[8448, 8448], "disallowed_STD3_mapped", [97, 47, 99]], [[8449, 8449], "disallowed_STD3_mapped", [97, 47, 115]], [[8450, 8450], "mapped", [99]], [[8451, 8451], "mapped", [176, 99]], [[8452, 8452], "valid", [], "NV8"], [[8453, 8453], "disallowed_STD3_mapped", [99, 47, 111]], [[8454, 8454], "disallowed_STD3_mapped", [99, 47, 117]], [[8455, 8455], "mapped", [603]], [[8456, 8456], "valid", [], "NV8"], [[8457, 8457], "mapped", [176, 102]], [[8458, 8458], "mapped", [103]], [[8459, 8462], "mapped", [104]], [[8463, 8463], "mapped", [295]], [[8464, 8465], "mapped", [105]], [[8466, 8467], "mapped", [108]], [[8468, 8468], "valid", [], "NV8"], [[8469, 8469], "mapped", [110]], [[8470, 8470], "mapped", [110, 111]], [[8471, 8472], "valid", [], "NV8"], [[8473, 8473], "mapped", [112]], [[8474, 8474], "mapped", [113]], [[8475, 8477], "mapped", [114]], [[8478, 8479], "valid", [], "NV8"], [[8480, 8480], "mapped", [115, 109]], [[8481, 8481], "mapped", [116, 101, 108]], [[8482, 8482], "mapped", [116, 109]], [[8483, 8483], "valid", [], "NV8"], [[8484, 8484], "mapped", [122]], [[8485, 8485], "valid", [], "NV8"], [[8486, 8486], "mapped", [969]], [[8487, 8487], "valid", [], "NV8"], [[8488, 8488], "mapped", [122]], [[8489, 8489], "valid", [], "NV8"], [[8490, 8490], "mapped", [107]], [[8491, 8491], "mapped", [229]], [[8492, 8492], "mapped", [98]], [[8493, 8493], "mapped", [99]], [[8494, 8494], "valid", [], "NV8"], [[8495, 8496], "mapped", [101]], [[8497, 8497], "mapped", [102]], [[8498, 8498], "disallowed"], [[8499, 8499], "mapped", [109]], [[8500, 8500], "mapped", [111]], [[8501, 8501], "mapped", [1488]], [[8502, 8502], "mapped", [1489]], [[8503, 8503], "mapped", [1490]], [[8504, 8504], "mapped", [1491]], [[8505, 8505], "mapped", [105]], [[8506, 8506], "valid", [], "NV8"], [[8507, 8507], "mapped", [102, 97, 120]], [[8508, 8508], "mapped", [960]], [[8509, 8510], "mapped", [947]], [[8511, 8511], "mapped", [960]], [[8512, 8512], "mapped", [8721]], [[8513, 8516], "valid", [], "NV8"], [[8517, 8518], "mapped", [100]], [[8519, 8519], "mapped", [101]], [[8520, 8520], "mapped", [105]], [[8521, 8521], "mapped", [106]], [[8522, 8523], "valid", [], "NV8"], [[8524, 8524], "valid", [], "NV8"], [[8525, 8525], "valid", [], "NV8"], [[8526, 8526], "valid"], [[8527, 8527], "valid", [], "NV8"], [[8528, 8528], "mapped", [49, 8260, 55]], [[8529, 8529], "mapped", [49, 8260, 57]], [[8530, 8530], "mapped", [49, 8260, 49, 48]], [[8531, 8531], "mapped", [49, 8260, 51]], [[8532, 8532], "mapped", [50, 8260, 51]], [[8533, 8533], "mapped", [49, 8260, 53]], [[8534, 8534], "mapped", [50, 8260, 53]], [[8535, 8535], "mapped", [51, 8260, 53]], [[8536, 8536], "mapped", [52, 8260, 53]], [[8537, 8537], "mapped", [49, 8260, 54]], [[8538, 8538], "mapped", [53, 8260, 54]], [[8539, 8539], "mapped", [49, 8260, 56]], [[8540, 8540], "mapped", [51, 8260, 56]], [[8541, 8541], "mapped", [53, 8260, 56]], [[8542, 8542], "mapped", [55, 8260, 56]], [[8543, 8543], "mapped", [49, 8260]], [[8544, 8544], "mapped", [105]], [[8545, 8545], "mapped", [105, 105]], [[8546, 8546], "mapped", [105, 105, 105]], [[8547, 8547], "mapped", [105, 118]], [[8548, 8548], "mapped", [118]], [[8549, 8549], "mapped", [118, 105]], [[8550, 8550], "mapped", [118, 105, 105]], [[8551, 8551], "mapped", [118, 105, 105, 105]], [[8552, 8552], "mapped", [105, 120]], [[8553, 8553], "mapped", [120]], [[8554, 8554], "mapped", [120, 105]], [[8555, 8555], "mapped", [120, 105, 105]], [[8556, 8556], "mapped", [108]], [[8557, 8557], "mapped", [99]], [[8558, 8558], "mapped", [100]], [[8559, 8559], "mapped", [109]], [[8560, 8560], "mapped", [105]], [[8561, 8561], "mapped", [105, 105]], [[8562, 8562], "mapped", [105, 105, 105]], [[8563, 8563], "mapped", [105, 118]], [[8564, 8564], "mapped", [118]], [[8565, 8565], "mapped", [118, 105]], [[8566, 8566], "mapped", [118, 105, 105]], [[8567, 8567], "mapped", [118, 105, 105, 105]], [[8568, 8568], "mapped", [105, 120]], [[8569, 8569], "mapped", [120]], [[8570, 8570], "mapped", [120, 105]], [[8571, 8571], "mapped", [120, 105, 105]], [[8572, 8572], "mapped", [108]], [[8573, 8573], "mapped", [99]], [[8574, 8574], "mapped", [100]], [[8575, 8575], "mapped", [109]], [[8576, 8578], "valid", [], "NV8"], [[8579, 8579], "disallowed"], [[8580, 8580], "valid"], [[8581, 8584], "valid", [], "NV8"], [[8585, 8585], "mapped", [48, 8260, 51]], [[8586, 8587], "valid", [], "NV8"], [[8588, 8591], "disallowed"], [[8592, 8682], "valid", [], "NV8"], [[8683, 8691], "valid", [], "NV8"], [[8692, 8703], "valid", [], "NV8"], [[8704, 8747], "valid", [], "NV8"], [[8748, 8748], "mapped", [8747, 8747]], [[8749, 8749], "mapped", [8747, 8747, 8747]], [[8750, 8750], "valid", [], "NV8"], [[8751, 8751], "mapped", [8750, 8750]], [[8752, 8752], "mapped", [8750, 8750, 8750]], [[8753, 8799], "valid", [], "NV8"], [[8800, 8800], "disallowed_STD3_valid"], [[8801, 8813], "valid", [], "NV8"], [[8814, 8815], "disallowed_STD3_valid"], [[8816, 8945], "valid", [], "NV8"], [[8946, 8959], "valid", [], "NV8"], [[8960, 8960], "valid", [], "NV8"], [[8961, 8961], "valid", [], "NV8"], [[8962, 9e3], "valid", [], "NV8"], [[9001, 9001], "mapped", [12296]], [[9002, 9002], "mapped", [12297]], [[9003, 9082], "valid", [], "NV8"], [[9083, 9083], "valid", [], "NV8"], [[9084, 9084], "valid", [], "NV8"], [[9085, 9114], "valid", [], "NV8"], [[9115, 9166], "valid", [], "NV8"], [[9167, 9168], "valid", [], "NV8"], [[9169, 9179], "valid", [], "NV8"], [[9180, 9191], "valid", [], "NV8"], [[9192, 9192], "valid", [], "NV8"], [[9193, 9203], "valid", [], "NV8"], [[9204, 9210], "valid", [], "NV8"], [[9211, 9215], "disallowed"], [[9216, 9252], "valid", [], "NV8"], [[9253, 9254], "valid", [], "NV8"], [[9255, 9279], "disallowed"], [[9280, 9290], "valid", [], "NV8"], [[9291, 9311], "disallowed"], [[9312, 9312], "mapped", [49]], [[9313, 9313], "mapped", [50]], [[9314, 9314], "mapped", [51]], [[9315, 9315], "mapped", [52]], [[9316, 9316], "mapped", [53]], [[9317, 9317], "mapped", [54]], [[9318, 9318], "mapped", [55]], [[9319, 9319], "mapped", [56]], [[9320, 9320], "mapped", [57]], [[9321, 9321], "mapped", [49, 48]], [[9322, 9322], "mapped", [49, 49]], [[9323, 9323], "mapped", [49, 50]], [[9324, 9324], "mapped", [49, 51]], [[9325, 9325], "mapped", [49, 52]], [[9326, 9326], "mapped", [49, 53]], [[9327, 9327], "mapped", [49, 54]], [[9328, 9328], "mapped", [49, 55]], [[9329, 9329], "mapped", [49, 56]], [[9330, 9330], "mapped", [49, 57]], [[9331, 9331], "mapped", [50, 48]], [[9332, 9332], "disallowed_STD3_mapped", [40, 49, 41]], [[9333, 9333], "disallowed_STD3_mapped", [40, 50, 41]], [[9334, 9334], "disallowed_STD3_mapped", [40, 51, 41]], [[9335, 9335], "disallowed_STD3_mapped", [40, 52, 41]], [[9336, 9336], "disallowed_STD3_mapped", [40, 53, 41]], [[9337, 9337], "disallowed_STD3_mapped", [40, 54, 41]], [[9338, 9338], "disallowed_STD3_mapped", [40, 55, 41]], [[9339, 9339], "disallowed_STD3_mapped", [40, 56, 41]], [[9340, 9340], "disallowed_STD3_mapped", [40, 57, 41]], [[9341, 9341], "disallowed_STD3_mapped", [40, 49, 48, 41]], [[9342, 9342], "disallowed_STD3_mapped", [40, 49, 49, 41]], [[9343, 9343], "disallowed_STD3_mapped", [40, 49, 50, 41]], [[9344, 9344], "disallowed_STD3_mapped", [40, 49, 51, 41]], [[9345, 9345], "disallowed_STD3_mapped", [40, 49, 52, 41]], [[9346, 9346], "disallowed_STD3_mapped", [40, 49, 53, 41]], [[9347, 9347], "disallowed_STD3_mapped", [40, 49, 54, 41]], [[9348, 9348], "disallowed_STD3_mapped", [40, 49, 55, 41]], [[9349, 9349], "disallowed_STD3_mapped", [40, 49, 56, 41]], [[9350, 9350], "disallowed_STD3_mapped", [40, 49, 57, 41]], [[9351, 9351], "disallowed_STD3_mapped", [40, 50, 48, 41]], [[9352, 9371], "disallowed"], [[9372, 9372], "disallowed_STD3_mapped", [40, 97, 41]], [[9373, 9373], "disallowed_STD3_mapped", [40, 98, 41]], [[9374, 9374], "disallowed_STD3_mapped", [40, 99, 41]], [[9375, 9375], "disallowed_STD3_mapped", [40, 100, 41]], [[9376, 9376], "disallowed_STD3_mapped", [40, 101, 41]], [[9377, 9377], "disallowed_STD3_mapped", [40, 102, 41]], [[9378, 9378], "disallowed_STD3_mapped", [40, 103, 41]], [[9379, 9379], "disallowed_STD3_mapped", [40, 104, 41]], [[9380, 9380], "disallowed_STD3_mapped", [40, 105, 41]], [[9381, 9381], "disallowed_STD3_mapped", [40, 106, 41]], [[9382, 9382], "disallowed_STD3_mapped", [40, 107, 41]], [[9383, 9383], "disallowed_STD3_mapped", [40, 108, 41]], [[9384, 9384], "disallowed_STD3_mapped", [40, 109, 41]], [[9385, 9385], "disallowed_STD3_mapped", [40, 110, 41]], [[9386, 9386], "disallowed_STD3_mapped", [40, 111, 41]], [[9387, 9387], "disallowed_STD3_mapped", [40, 112, 41]], [[9388, 9388], "disallowed_STD3_mapped", [40, 113, 41]], [[9389, 9389], "disallowed_STD3_mapped", [40, 114, 41]], [[9390, 9390], "disallowed_STD3_mapped", [40, 115, 41]], [[9391, 9391], "disallowed_STD3_mapped", [40, 116, 41]], [[9392, 9392], "disallowed_STD3_mapped", [40, 117, 41]], [[9393, 9393], "disallowed_STD3_mapped", [40, 118, 41]], [[9394, 9394], "disallowed_STD3_mapped", [40, 119, 41]], [[9395, 9395], "disallowed_STD3_mapped", [40, 120, 41]], [[9396, 9396], "disallowed_STD3_mapped", [40, 121, 41]], [[9397, 9397], "disallowed_STD3_mapped", [40, 122, 41]], [[9398, 9398], "mapped", [97]], [[9399, 9399], "mapped", [98]], [[9400, 9400], "mapped", [99]], [[9401, 9401], "mapped", [100]], [[9402, 9402], "mapped", [101]], [[9403, 9403], "mapped", [102]], [[9404, 9404], "mapped", [103]], [[9405, 9405], "mapped", [104]], [[9406, 9406], "mapped", [105]], [[9407, 9407], "mapped", [106]], [[9408, 9408], "mapped", [107]], [[9409, 9409], "mapped", [108]], [[9410, 9410], "mapped", [109]], [[9411, 9411], "mapped", [110]], [[9412, 9412], "mapped", [111]], [[9413, 9413], "mapped", [112]], [[9414, 9414], "mapped", [113]], [[9415, 9415], "mapped", [114]], [[9416, 9416], "mapped", [115]], [[9417, 9417], "mapped", [116]], [[9418, 9418], "mapped", [117]], [[9419, 9419], "mapped", [118]], [[9420, 9420], "mapped", [119]], [[9421, 9421], "mapped", [120]], [[9422, 9422], "mapped", [121]], [[9423, 9423], "mapped", [122]], [[9424, 9424], "mapped", [97]], [[9425, 9425], "mapped", [98]], [[9426, 9426], "mapped", [99]], [[9427, 9427], "mapped", [100]], [[9428, 9428], "mapped", [101]], [[9429, 9429], "mapped", [102]], [[9430, 9430], "mapped", [103]], [[9431, 9431], "mapped", [104]], [[9432, 9432], "mapped", [105]], [[9433, 9433], "mapped", [106]], [[9434, 9434], "mapped", [107]], [[9435, 9435], "mapped", [108]], [[9436, 9436], "mapped", [109]], [[9437, 9437], "mapped", [110]], [[9438, 9438], "mapped", [111]], [[9439, 9439], "mapped", [112]], [[9440, 9440], "mapped", [113]], [[9441, 9441], "mapped", [114]], [[9442, 9442], "mapped", [115]], [[9443, 9443], "mapped", [116]], [[9444, 9444], "mapped", [117]], [[9445, 9445], "mapped", [118]], [[9446, 9446], "mapped", [119]], [[9447, 9447], "mapped", [120]], [[9448, 9448], "mapped", [121]], [[9449, 9449], "mapped", [122]], [[9450, 9450], "mapped", [48]], [[9451, 9470], "valid", [], "NV8"], [[9471, 9471], "valid", [], "NV8"], [[9472, 9621], "valid", [], "NV8"], [[9622, 9631], "valid", [], "NV8"], [[9632, 9711], "valid", [], "NV8"], [[9712, 9719], "valid", [], "NV8"], [[9720, 9727], "valid", [], "NV8"], [[9728, 9747], "valid", [], "NV8"], [[9748, 9749], "valid", [], "NV8"], [[9750, 9751], "valid", [], "NV8"], [[9752, 9752], "valid", [], "NV8"], [[9753, 9753], "valid", [], "NV8"], [[9754, 9839], "valid", [], "NV8"], [[9840, 9841], "valid", [], "NV8"], [[9842, 9853], "valid", [], "NV8"], [[9854, 9855], "valid", [], "NV8"], [[9856, 9865], "valid", [], "NV8"], [[9866, 9873], "valid", [], "NV8"], [[9874, 9884], "valid", [], "NV8"], [[9885, 9885], "valid", [], "NV8"], [[9886, 9887], "valid", [], "NV8"], [[9888, 9889], "valid", [], "NV8"], [[9890, 9905], "valid", [], "NV8"], [[9906, 9906], "valid", [], "NV8"], [[9907, 9916], "valid", [], "NV8"], [[9917, 9919], "valid", [], "NV8"], [[9920, 9923], "valid", [], "NV8"], [[9924, 9933], "valid", [], "NV8"], [[9934, 9934], "valid", [], "NV8"], [[9935, 9953], "valid", [], "NV8"], [[9954, 9954], "valid", [], "NV8"], [[9955, 9955], "valid", [], "NV8"], [[9956, 9959], "valid", [], "NV8"], [[9960, 9983], "valid", [], "NV8"], [[9984, 9984], "valid", [], "NV8"], [[9985, 9988], "valid", [], "NV8"], [[9989, 9989], "valid", [], "NV8"], [[9990, 9993], "valid", [], "NV8"], [[9994, 9995], "valid", [], "NV8"], [[9996, 10023], "valid", [], "NV8"], [[10024, 10024], "valid", [], "NV8"], [[10025, 10059], "valid", [], "NV8"], [[10060, 10060], "valid", [], "NV8"], [[10061, 10061], "valid", [], "NV8"], [[10062, 10062], "valid", [], "NV8"], [[10063, 10066], "valid", [], "NV8"], [[10067, 10069], "valid", [], "NV8"], [[10070, 10070], "valid", [], "NV8"], [[10071, 10071], "valid", [], "NV8"], [[10072, 10078], "valid", [], "NV8"], [[10079, 10080], "valid", [], "NV8"], [[10081, 10087], "valid", [], "NV8"], [[10088, 10101], "valid", [], "NV8"], [[10102, 10132], "valid", [], "NV8"], [[10133, 10135], "valid", [], "NV8"], [[10136, 10159], "valid", [], "NV8"], [[10160, 10160], "valid", [], "NV8"], [[10161, 10174], "valid", [], "NV8"], [[10175, 10175], "valid", [], "NV8"], [[10176, 10182], "valid", [], "NV8"], [[10183, 10186], "valid", [], "NV8"], [[10187, 10187], "valid", [], "NV8"], [[10188, 10188], "valid", [], "NV8"], [[10189, 10189], "valid", [], "NV8"], [[10190, 10191], "valid", [], "NV8"], [[10192, 10219], "valid", [], "NV8"], [[10220, 10223], "valid", [], "NV8"], [[10224, 10239], "valid", [], "NV8"], [[10240, 10495], "valid", [], "NV8"], [[10496, 10763], "valid", [], "NV8"], [[10764, 10764], "mapped", [8747, 8747, 8747, 8747]], [[10765, 10867], "valid", [], "NV8"], [[10868, 10868], "disallowed_STD3_mapped", [58, 58, 61]], [[10869, 10869], "disallowed_STD3_mapped", [61, 61]], [[10870, 10870], "disallowed_STD3_mapped", [61, 61, 61]], [[10871, 10971], "valid", [], "NV8"], [[10972, 10972], "mapped", [10973, 824]], [[10973, 11007], "valid", [], "NV8"], [[11008, 11021], "valid", [], "NV8"], [[11022, 11027], "valid", [], "NV8"], [[11028, 11034], "valid", [], "NV8"], [[11035, 11039], "valid", [], "NV8"], [[11040, 11043], "valid", [], "NV8"], [[11044, 11084], "valid", [], "NV8"], [[11085, 11087], "valid", [], "NV8"], [[11088, 11092], "valid", [], "NV8"], [[11093, 11097], "valid", [], "NV8"], [[11098, 11123], "valid", [], "NV8"], [[11124, 11125], "disallowed"], [[11126, 11157], "valid", [], "NV8"], [[11158, 11159], "disallowed"], [[11160, 11193], "valid", [], "NV8"], [[11194, 11196], "disallowed"], [[11197, 11208], "valid", [], "NV8"], [[11209, 11209], "disallowed"], [[11210, 11217], "valid", [], "NV8"], [[11218, 11243], "disallowed"], [[11244, 11247], "valid", [], "NV8"], [[11248, 11263], "disallowed"], [[11264, 11264], "mapped", [11312]], [[11265, 11265], "mapped", [11313]], [[11266, 11266], "mapped", [11314]], [[11267, 11267], "mapped", [11315]], [[11268, 11268], "mapped", [11316]], [[11269, 11269], "mapped", [11317]], [[11270, 11270], "mapped", [11318]], [[11271, 11271], "mapped", [11319]], [[11272, 11272], "mapped", [11320]], [[11273, 11273], "mapped", [11321]], [[11274, 11274], "mapped", [11322]], [[11275, 11275], "mapped", [11323]], [[11276, 11276], "mapped", [11324]], [[11277, 11277], "mapped", [11325]], [[11278, 11278], "mapped", [11326]], [[11279, 11279], "mapped", [11327]], [[11280, 11280], "mapped", [11328]], [[11281, 11281], "mapped", [11329]], [[11282, 11282], "mapped", [11330]], [[11283, 11283], "mapped", [11331]], [[11284, 11284], "mapped", [11332]], [[11285, 11285], "mapped", [11333]], [[11286, 11286], "mapped", [11334]], [[11287, 11287], "mapped", [11335]], [[11288, 11288], "mapped", [11336]], [[11289, 11289], "mapped", [11337]], [[11290, 11290], "mapped", [11338]], [[11291, 11291], "mapped", [11339]], [[11292, 11292], "mapped", [11340]], [[11293, 11293], "mapped", [11341]], [[11294, 11294], "mapped", [11342]], [[11295, 11295], "mapped", [11343]], [[11296, 11296], "mapped", [11344]], [[11297, 11297], "mapped", [11345]], [[11298, 11298], "mapped", [11346]], [[11299, 11299], "mapped", [11347]], [[11300, 11300], "mapped", [11348]], [[11301, 11301], "mapped", [11349]], [[11302, 11302], "mapped", [11350]], [[11303, 11303], "mapped", [11351]], [[11304, 11304], "mapped", [11352]], [[11305, 11305], "mapped", [11353]], [[11306, 11306], "mapped", [11354]], [[11307, 11307], "mapped", [11355]], [[11308, 11308], "mapped", [11356]], [[11309, 11309], "mapped", [11357]], [[11310, 11310], "mapped", [11358]], [[11311, 11311], "disallowed"], [[11312, 11358], "valid"], [[11359, 11359], "disallowed"], [[11360, 11360], "mapped", [11361]], [[11361, 11361], "valid"], [[11362, 11362], "mapped", [619]], [[11363, 11363], "mapped", [7549]], [[11364, 11364], "mapped", [637]], [[11365, 11366], "valid"], [[11367, 11367], "mapped", [11368]], [[11368, 11368], "valid"], [[11369, 11369], "mapped", [11370]], [[11370, 11370], "valid"], [[11371, 11371], "mapped", [11372]], [[11372, 11372], "valid"], [[11373, 11373], "mapped", [593]], [[11374, 11374], "mapped", [625]], [[11375, 11375], "mapped", [592]], [[11376, 11376], "mapped", [594]], [[11377, 11377], "valid"], [[11378, 11378], "mapped", [11379]], [[11379, 11379], "valid"], [[11380, 11380], "valid"], [[11381, 11381], "mapped", [11382]], [[11382, 11383], "valid"], [[11384, 11387], "valid"], [[11388, 11388], "mapped", [106]], [[11389, 11389], "mapped", [118]], [[11390, 11390], "mapped", [575]], [[11391, 11391], "mapped", [576]], [[11392, 11392], "mapped", [11393]], [[11393, 11393], "valid"], [[11394, 11394], "mapped", [11395]], [[11395, 11395], "valid"], [[11396, 11396], "mapped", [11397]], [[11397, 11397], "valid"], [[11398, 11398], "mapped", [11399]], [[11399, 11399], "valid"], [[11400, 11400], "mapped", [11401]], [[11401, 11401], "valid"], [[11402, 11402], "mapped", [11403]], [[11403, 11403], "valid"], [[11404, 11404], "mapped", [11405]], [[11405, 11405], "valid"], [[11406, 11406], "mapped", [11407]], [[11407, 11407], "valid"], [[11408, 11408], "mapped", [11409]], [[11409, 11409], "valid"], [[11410, 11410], "mapped", [11411]], [[11411, 11411], "valid"], [[11412, 11412], "mapped", [11413]], [[11413, 11413], "valid"], [[11414, 11414], "mapped", [11415]], [[11415, 11415], "valid"], [[11416, 11416], "mapped", [11417]], [[11417, 11417], "valid"], [[11418, 11418], "mapped", [11419]], [[11419, 11419], "valid"], [[11420, 11420], "mapped", [11421]], [[11421, 11421], "valid"], [[11422, 11422], "mapped", [11423]], [[11423, 11423], "valid"], [[11424, 11424], "mapped", [11425]], [[11425, 11425], "valid"], [[11426, 11426], "mapped", [11427]], [[11427, 11427], "valid"], [[11428, 11428], "mapped", [11429]], [[11429, 11429], "valid"], [[11430, 11430], "mapped", [11431]], [[11431, 11431], "valid"], [[11432, 11432], "mapped", [11433]], [[11433, 11433], "valid"], [[11434, 11434], "mapped", [11435]], [[11435, 11435], "valid"], [[11436, 11436], "mapped", [11437]], [[11437, 11437], "valid"], [[11438, 11438], "mapped", [11439]], [[11439, 11439], "valid"], [[11440, 11440], "mapped", [11441]], [[11441, 11441], "valid"], [[11442, 11442], "mapped", [11443]], [[11443, 11443], "valid"], [[11444, 11444], "mapped", [11445]], [[11445, 11445], "valid"], [[11446, 11446], "mapped", [11447]], [[11447, 11447], "valid"], [[11448, 11448], "mapped", [11449]], [[11449, 11449], "valid"], [[11450, 11450], "mapped", [11451]], [[11451, 11451], "valid"], [[11452, 11452], "mapped", [11453]], [[11453, 11453], "valid"], [[11454, 11454], "mapped", [11455]], [[11455, 11455], "valid"], [[11456, 11456], "mapped", [11457]], [[11457, 11457], "valid"], [[11458, 11458], "mapped", [11459]], [[11459, 11459], "valid"], [[11460, 11460], "mapped", [11461]], [[11461, 11461], "valid"], [[11462, 11462], "mapped", [11463]], [[11463, 11463], "valid"], [[11464, 11464], "mapped", [11465]], [[11465, 11465], "valid"], [[11466, 11466], "mapped", [11467]], [[11467, 11467], "valid"], [[11468, 11468], "mapped", [11469]], [[11469, 11469], "valid"], [[11470, 11470], "mapped", [11471]], [[11471, 11471], "valid"], [[11472, 11472], "mapped", [11473]], [[11473, 11473], "valid"], [[11474, 11474], "mapped", [11475]], [[11475, 11475], "valid"], [[11476, 11476], "mapped", [11477]], [[11477, 11477], "valid"], [[11478, 11478], "mapped", [11479]], [[11479, 11479], "valid"], [[11480, 11480], "mapped", [11481]], [[11481, 11481], "valid"], [[11482, 11482], "mapped", [11483]], [[11483, 11483], "valid"], [[11484, 11484], "mapped", [11485]], [[11485, 11485], "valid"], [[11486, 11486], "mapped", [11487]], [[11487, 11487], "valid"], [[11488, 11488], "mapped", [11489]], [[11489, 11489], "valid"], [[11490, 11490], "mapped", [11491]], [[11491, 11492], "valid"], [[11493, 11498], "valid", [], "NV8"], [[11499, 11499], "mapped", [11500]], [[11500, 11500], "valid"], [[11501, 11501], "mapped", [11502]], [[11502, 11505], "valid"], [[11506, 11506], "mapped", [11507]], [[11507, 11507], "valid"], [[11508, 11512], "disallowed"], [[11513, 11519], "valid", [], "NV8"], [[11520, 11557], "valid"], [[11558, 11558], "disallowed"], [[11559, 11559], "valid"], [[11560, 11564], "disallowed"], [[11565, 11565], "valid"], [[11566, 11567], "disallowed"], [[11568, 11621], "valid"], [[11622, 11623], "valid"], [[11624, 11630], "disallowed"], [[11631, 11631], "mapped", [11617]], [[11632, 11632], "valid", [], "NV8"], [[11633, 11646], "disallowed"], [[11647, 11647], "valid"], [[11648, 11670], "valid"], [[11671, 11679], "disallowed"], [[11680, 11686], "valid"], [[11687, 11687], "disallowed"], [[11688, 11694], "valid"], [[11695, 11695], "disallowed"], [[11696, 11702], "valid"], [[11703, 11703], "disallowed"], [[11704, 11710], "valid"], [[11711, 11711], "disallowed"], [[11712, 11718], "valid"], [[11719, 11719], "disallowed"], [[11720, 11726], "valid"], [[11727, 11727], "disallowed"], [[11728, 11734], "valid"], [[11735, 11735], "disallowed"], [[11736, 11742], "valid"], [[11743, 11743], "disallowed"], [[11744, 11775], "valid"], [[11776, 11799], "valid", [], "NV8"], [[11800, 11803], "valid", [], "NV8"], [[11804, 11805], "valid", [], "NV8"], [[11806, 11822], "valid", [], "NV8"], [[11823, 11823], "valid"], [[11824, 11824], "valid", [], "NV8"], [[11825, 11825], "valid", [], "NV8"], [[11826, 11835], "valid", [], "NV8"], [[11836, 11842], "valid", [], "NV8"], [[11843, 11903], "disallowed"], [[11904, 11929], "valid", [], "NV8"], [[11930, 11930], "disallowed"], [[11931, 11934], "valid", [], "NV8"], [[11935, 11935], "mapped", [27597]], [[11936, 12018], "valid", [], "NV8"], [[12019, 12019], "mapped", [40863]], [[12020, 12031], "disallowed"], [[12032, 12032], "mapped", [19968]], [[12033, 12033], "mapped", [20008]], [[12034, 12034], "mapped", [20022]], [[12035, 12035], "mapped", [20031]], [[12036, 12036], "mapped", [20057]], [[12037, 12037], "mapped", [20101]], [[12038, 12038], "mapped", [20108]], [[12039, 12039], "mapped", [20128]], [[12040, 12040], "mapped", [20154]], [[12041, 12041], "mapped", [20799]], [[12042, 12042], "mapped", [20837]], [[12043, 12043], "mapped", [20843]], [[12044, 12044], "mapped", [20866]], [[12045, 12045], "mapped", [20886]], [[12046, 12046], "mapped", [20907]], [[12047, 12047], "mapped", [20960]], [[12048, 12048], "mapped", [20981]], [[12049, 12049], "mapped", [20992]], [[12050, 12050], "mapped", [21147]], [[12051, 12051], "mapped", [21241]], [[12052, 12052], "mapped", [21269]], [[12053, 12053], "mapped", [21274]], [[12054, 12054], "mapped", [21304]], [[12055, 12055], "mapped", [21313]], [[12056, 12056], "mapped", [21340]], [[12057, 12057], "mapped", [21353]], [[12058, 12058], "mapped", [21378]], [[12059, 12059], "mapped", [21430]], [[12060, 12060], "mapped", [21448]], [[12061, 12061], "mapped", [21475]], [[12062, 12062], "mapped", [22231]], [[12063, 12063], "mapped", [22303]], [[12064, 12064], "mapped", [22763]], [[12065, 12065], "mapped", [22786]], [[12066, 12066], "mapped", [22794]], [[12067, 12067], "mapped", [22805]], [[12068, 12068], "mapped", [22823]], [[12069, 12069], "mapped", [22899]], [[12070, 12070], "mapped", [23376]], [[12071, 12071], "mapped", [23424]], [[12072, 12072], "mapped", [23544]], [[12073, 12073], "mapped", [23567]], [[12074, 12074], "mapped", [23586]], [[12075, 12075], "mapped", [23608]], [[12076, 12076], "mapped", [23662]], [[12077, 12077], "mapped", [23665]], [[12078, 12078], "mapped", [24027]], [[12079, 12079], "mapped", [24037]], [[12080, 12080], "mapped", [24049]], [[12081, 12081], "mapped", [24062]], [[12082, 12082], "mapped", [24178]], [[12083, 12083], "mapped", [24186]], [[12084, 12084], "mapped", [24191]], [[12085, 12085], "mapped", [24308]], [[12086, 12086], "mapped", [24318]], [[12087, 12087], "mapped", [24331]], [[12088, 12088], "mapped", [24339]], [[12089, 12089], "mapped", [24400]], [[12090, 12090], "mapped", [24417]], [[12091, 12091], "mapped", [24435]], [[12092, 12092], "mapped", [24515]], [[12093, 12093], "mapped", [25096]], [[12094, 12094], "mapped", [25142]], [[12095, 12095], "mapped", [25163]], [[12096, 12096], "mapped", [25903]], [[12097, 12097], "mapped", [25908]], [[12098, 12098], "mapped", [25991]], [[12099, 12099], "mapped", [26007]], [[12100, 12100], "mapped", [26020]], [[12101, 12101], "mapped", [26041]], [[12102, 12102], "mapped", [26080]], [[12103, 12103], "mapped", [26085]], [[12104, 12104], "mapped", [26352]], [[12105, 12105], "mapped", [26376]], [[12106, 12106], "mapped", [26408]], [[12107, 12107], "mapped", [27424]], [[12108, 12108], "mapped", [27490]], [[12109, 12109], "mapped", [27513]], [[12110, 12110], "mapped", [27571]], [[12111, 12111], "mapped", [27595]], [[12112, 12112], "mapped", [27604]], [[12113, 12113], "mapped", [27611]], [[12114, 12114], "mapped", [27663]], [[12115, 12115], "mapped", [27668]], [[12116, 12116], "mapped", [27700]], [[12117, 12117], "mapped", [28779]], [[12118, 12118], "mapped", [29226]], [[12119, 12119], "mapped", [29238]], [[12120, 12120], "mapped", [29243]], [[12121, 12121], "mapped", [29247]], [[12122, 12122], "mapped", [29255]], [[12123, 12123], "mapped", [29273]], [[12124, 12124], "mapped", [29275]], [[12125, 12125], "mapped", [29356]], [[12126, 12126], "mapped", [29572]], [[12127, 12127], "mapped", [29577]], [[12128, 12128], "mapped", [29916]], [[12129, 12129], "mapped", [29926]], [[12130, 12130], "mapped", [29976]], [[12131, 12131], "mapped", [29983]], [[12132, 12132], "mapped", [29992]], [[12133, 12133], "mapped", [3e4]], [[12134, 12134], "mapped", [30091]], [[12135, 12135], "mapped", [30098]], [[12136, 12136], "mapped", [30326]], [[12137, 12137], "mapped", [30333]], [[12138, 12138], "mapped", [30382]], [[12139, 12139], "mapped", [30399]], [[12140, 12140], "mapped", [30446]], [[12141, 12141], "mapped", [30683]], [[12142, 12142], "mapped", [30690]], [[12143, 12143], "mapped", [30707]], [[12144, 12144], "mapped", [31034]], [[12145, 12145], "mapped", [31160]], [[12146, 12146], "mapped", [31166]], [[12147, 12147], "mapped", [31348]], [[12148, 12148], "mapped", [31435]], [[12149, 12149], "mapped", [31481]], [[12150, 12150], "mapped", [31859]], [[12151, 12151], "mapped", [31992]], [[12152, 12152], "mapped", [32566]], [[12153, 12153], "mapped", [32593]], [[12154, 12154], "mapped", [32650]], [[12155, 12155], "mapped", [32701]], [[12156, 12156], "mapped", [32769]], [[12157, 12157], "mapped", [32780]], [[12158, 12158], "mapped", [32786]], [[12159, 12159], "mapped", [32819]], [[12160, 12160], "mapped", [32895]], [[12161, 12161], "mapped", [32905]], [[12162, 12162], "mapped", [33251]], [[12163, 12163], "mapped", [33258]], [[12164, 12164], "mapped", [33267]], [[12165, 12165], "mapped", [33276]], [[12166, 12166], "mapped", [33292]], [[12167, 12167], "mapped", [33307]], [[12168, 12168], "mapped", [33311]], [[12169, 12169], "mapped", [33390]], [[12170, 12170], "mapped", [33394]], [[12171, 12171], "mapped", [33400]], [[12172, 12172], "mapped", [34381]], [[12173, 12173], "mapped", [34411]], [[12174, 12174], "mapped", [34880]], [[12175, 12175], "mapped", [34892]], [[12176, 12176], "mapped", [34915]], [[12177, 12177], "mapped", [35198]], [[12178, 12178], "mapped", [35211]], [[12179, 12179], "mapped", [35282]], [[12180, 12180], "mapped", [35328]], [[12181, 12181], "mapped", [35895]], [[12182, 12182], "mapped", [35910]], [[12183, 12183], "mapped", [35925]], [[12184, 12184], "mapped", [35960]], [[12185, 12185], "mapped", [35997]], [[12186, 12186], "mapped", [36196]], [[12187, 12187], "mapped", [36208]], [[12188, 12188], "mapped", [36275]], [[12189, 12189], "mapped", [36523]], [[12190, 12190], "mapped", [36554]], [[12191, 12191], "mapped", [36763]], [[12192, 12192], "mapped", [36784]], [[12193, 12193], "mapped", [36789]], [[12194, 12194], "mapped", [37009]], [[12195, 12195], "mapped", [37193]], [[12196, 12196], "mapped", [37318]], [[12197, 12197], "mapped", [37324]], [[12198, 12198], "mapped", [37329]], [[12199, 12199], "mapped", [38263]], [[12200, 12200], "mapped", [38272]], [[12201, 12201], "mapped", [38428]], [[12202, 12202], "mapped", [38582]], [[12203, 12203], "mapped", [38585]], [[12204, 12204], "mapped", [38632]], [[12205, 12205], "mapped", [38737]], [[12206, 12206], "mapped", [38750]], [[12207, 12207], "mapped", [38754]], [[12208, 12208], "mapped", [38761]], [[12209, 12209], "mapped", [38859]], [[12210, 12210], "mapped", [38893]], [[12211, 12211], "mapped", [38899]], [[12212, 12212], "mapped", [38913]], [[12213, 12213], "mapped", [39080]], [[12214, 12214], "mapped", [39131]], [[12215, 12215], "mapped", [39135]], [[12216, 12216], "mapped", [39318]], [[12217, 12217], "mapped", [39321]], [[12218, 12218], "mapped", [39340]], [[12219, 12219], "mapped", [39592]], [[12220, 12220], "mapped", [39640]], [[12221, 12221], "mapped", [39647]], [[12222, 12222], "mapped", [39717]], [[12223, 12223], "mapped", [39727]], [[12224, 12224], "mapped", [39730]], [[12225, 12225], "mapped", [39740]], [[12226, 12226], "mapped", [39770]], [[12227, 12227], "mapped", [40165]], [[12228, 12228], "mapped", [40565]], [[12229, 12229], "mapped", [40575]], [[12230, 12230], "mapped", [40613]], [[12231, 12231], "mapped", [40635]], [[12232, 12232], "mapped", [40643]], [[12233, 12233], "mapped", [40653]], [[12234, 12234], "mapped", [40657]], [[12235, 12235], "mapped", [40697]], [[12236, 12236], "mapped", [40701]], [[12237, 12237], "mapped", [40718]], [[12238, 12238], "mapped", [40723]], [[12239, 12239], "mapped", [40736]], [[12240, 12240], "mapped", [40763]], [[12241, 12241], "mapped", [40778]], [[12242, 12242], "mapped", [40786]], [[12243, 12243], "mapped", [40845]], [[12244, 12244], "mapped", [40860]], [[12245, 12245], "mapped", [40864]], [[12246, 12271], "disallowed"], [[12272, 12283], "disallowed"], [[12284, 12287], "disallowed"], [[12288, 12288], "disallowed_STD3_mapped", [32]], [[12289, 12289], "valid", [], "NV8"], [[12290, 12290], "mapped", [46]], [[12291, 12292], "valid", [], "NV8"], [[12293, 12295], "valid"], [[12296, 12329], "valid", [], "NV8"], [[12330, 12333], "valid"], [[12334, 12341], "valid", [], "NV8"], [[12342, 12342], "mapped", [12306]], [[12343, 12343], "valid", [], "NV8"], [[12344, 12344], "mapped", [21313]], [[12345, 12345], "mapped", [21316]], [[12346, 12346], "mapped", [21317]], [[12347, 12347], "valid", [], "NV8"], [[12348, 12348], "valid"], [[12349, 12349], "valid", [], "NV8"], [[12350, 12350], "valid", [], "NV8"], [[12351, 12351], "valid", [], "NV8"], [[12352, 12352], "disallowed"], [[12353, 12436], "valid"], [[12437, 12438], "valid"], [[12439, 12440], "disallowed"], [[12441, 12442], "valid"], [[12443, 12443], "disallowed_STD3_mapped", [32, 12441]], [[12444, 12444], "disallowed_STD3_mapped", [32, 12442]], [[12445, 12446], "valid"], [[12447, 12447], "mapped", [12424, 12426]], [[12448, 12448], "valid", [], "NV8"], [[12449, 12542], "valid"], [[12543, 12543], "mapped", [12467, 12488]], [[12544, 12548], "disallowed"], [[12549, 12588], "valid"], [[12589, 12589], "valid"], [[12590, 12592], "disallowed"], [[12593, 12593], "mapped", [4352]], [[12594, 12594], "mapped", [4353]], [[12595, 12595], "mapped", [4522]], [[12596, 12596], "mapped", [4354]], [[12597, 12597], "mapped", [4524]], [[12598, 12598], "mapped", [4525]], [[12599, 12599], "mapped", [4355]], [[12600, 12600], "mapped", [4356]], [[12601, 12601], "mapped", [4357]], [[12602, 12602], "mapped", [4528]], [[12603, 12603], "mapped", [4529]], [[12604, 12604], "mapped", [4530]], [[12605, 12605], "mapped", [4531]], [[12606, 12606], "mapped", [4532]], [[12607, 12607], "mapped", [4533]], [[12608, 12608], "mapped", [4378]], [[12609, 12609], "mapped", [4358]], [[12610, 12610], "mapped", [4359]], [[12611, 12611], "mapped", [4360]], [[12612, 12612], "mapped", [4385]], [[12613, 12613], "mapped", [4361]], [[12614, 12614], "mapped", [4362]], [[12615, 12615], "mapped", [4363]], [[12616, 12616], "mapped", [4364]], [[12617, 12617], "mapped", [4365]], [[12618, 12618], "mapped", [4366]], [[12619, 12619], "mapped", [4367]], [[12620, 12620], "mapped", [4368]], [[12621, 12621], "mapped", [4369]], [[12622, 12622], "mapped", [4370]], [[12623, 12623], "mapped", [4449]], [[12624, 12624], "mapped", [4450]], [[12625, 12625], "mapped", [4451]], [[12626, 12626], "mapped", [4452]], [[12627, 12627], "mapped", [4453]], [[12628, 12628], "mapped", [4454]], [[12629, 12629], "mapped", [4455]], [[12630, 12630], "mapped", [4456]], [[12631, 12631], "mapped", [4457]], [[12632, 12632], "mapped", [4458]], [[12633, 12633], "mapped", [4459]], [[12634, 12634], "mapped", [4460]], [[12635, 12635], "mapped", [4461]], [[12636, 12636], "mapped", [4462]], [[12637, 12637], "mapped", [4463]], [[12638, 12638], "mapped", [4464]], [[12639, 12639], "mapped", [4465]], [[12640, 12640], "mapped", [4466]], [[12641, 12641], "mapped", [4467]], [[12642, 12642], "mapped", [4468]], [[12643, 12643], "mapped", [4469]], [[12644, 12644], "disallowed"], [[12645, 12645], "mapped", [4372]], [[12646, 12646], "mapped", [4373]], [[12647, 12647], "mapped", [4551]], [[12648, 12648], "mapped", [4552]], [[12649, 12649], "mapped", [4556]], [[12650, 12650], "mapped", [4558]], [[12651, 12651], "mapped", [4563]], [[12652, 12652], "mapped", [4567]], [[12653, 12653], "mapped", [4569]], [[12654, 12654], "mapped", [4380]], [[12655, 12655], "mapped", [4573]], [[12656, 12656], "mapped", [4575]], [[12657, 12657], "mapped", [4381]], [[12658, 12658], "mapped", [4382]], [[12659, 12659], "mapped", [4384]], [[12660, 12660], "mapped", [4386]], [[12661, 12661], "mapped", [4387]], [[12662, 12662], "mapped", [4391]], [[12663, 12663], "mapped", [4393]], [[12664, 12664], "mapped", [4395]], [[12665, 12665], "mapped", [4396]], [[12666, 12666], "mapped", [4397]], [[12667, 12667], "mapped", [4398]], [[12668, 12668], "mapped", [4399]], [[12669, 12669], "mapped", [4402]], [[12670, 12670], "mapped", [4406]], [[12671, 12671], "mapped", [4416]], [[12672, 12672], "mapped", [4423]], [[12673, 12673], "mapped", [4428]], [[12674, 12674], "mapped", [4593]], [[12675, 12675], "mapped", [4594]], [[12676, 12676], "mapped", [4439]], [[12677, 12677], "mapped", [4440]], [[12678, 12678], "mapped", [4441]], [[12679, 12679], "mapped", [4484]], [[12680, 12680], "mapped", [4485]], [[12681, 12681], "mapped", [4488]], [[12682, 12682], "mapped", [4497]], [[12683, 12683], "mapped", [4498]], [[12684, 12684], "mapped", [4500]], [[12685, 12685], "mapped", [4510]], [[12686, 12686], "mapped", [4513]], [[12687, 12687], "disallowed"], [[12688, 12689], "valid", [], "NV8"], [[12690, 12690], "mapped", [19968]], [[12691, 12691], "mapped", [20108]], [[12692, 12692], "mapped", [19977]], [[12693, 12693], "mapped", [22235]], [[12694, 12694], "mapped", [19978]], [[12695, 12695], "mapped", [20013]], [[12696, 12696], "mapped", [19979]], [[12697, 12697], "mapped", [30002]], [[12698, 12698], "mapped", [20057]], [[12699, 12699], "mapped", [19993]], [[12700, 12700], "mapped", [19969]], [[12701, 12701], "mapped", [22825]], [[12702, 12702], "mapped", [22320]], [[12703, 12703], "mapped", [20154]], [[12704, 12727], "valid"], [[12728, 12730], "valid"], [[12731, 12735], "disallowed"], [[12736, 12751], "valid", [], "NV8"], [[12752, 12771], "valid", [], "NV8"], [[12772, 12783], "disallowed"], [[12784, 12799], "valid"], [[12800, 12800], "disallowed_STD3_mapped", [40, 4352, 41]], [[12801, 12801], "disallowed_STD3_mapped", [40, 4354, 41]], [[12802, 12802], "disallowed_STD3_mapped", [40, 4355, 41]], [[12803, 12803], "disallowed_STD3_mapped", [40, 4357, 41]], [[12804, 12804], "disallowed_STD3_mapped", [40, 4358, 41]], [[12805, 12805], "disallowed_STD3_mapped", [40, 4359, 41]], [[12806, 12806], "disallowed_STD3_mapped", [40, 4361, 41]], [[12807, 12807], "disallowed_STD3_mapped", [40, 4363, 41]], [[12808, 12808], "disallowed_STD3_mapped", [40, 4364, 41]], [[12809, 12809], "disallowed_STD3_mapped", [40, 4366, 41]], [[12810, 12810], "disallowed_STD3_mapped", [40, 4367, 41]], [[12811, 12811], "disallowed_STD3_mapped", [40, 4368, 41]], [[12812, 12812], "disallowed_STD3_mapped", [40, 4369, 41]], [[12813, 12813], "disallowed_STD3_mapped", [40, 4370, 41]], [[12814, 12814], "disallowed_STD3_mapped", [40, 44032, 41]], [[12815, 12815], "disallowed_STD3_mapped", [40, 45208, 41]], [[12816, 12816], "disallowed_STD3_mapped", [40, 45796, 41]], [[12817, 12817], "disallowed_STD3_mapped", [40, 46972, 41]], [[12818, 12818], "disallowed_STD3_mapped", [40, 47560, 41]], [[12819, 12819], "disallowed_STD3_mapped", [40, 48148, 41]], [[12820, 12820], "disallowed_STD3_mapped", [40, 49324, 41]], [[12821, 12821], "disallowed_STD3_mapped", [40, 50500, 41]], [[12822, 12822], "disallowed_STD3_mapped", [40, 51088, 41]], [[12823, 12823], "disallowed_STD3_mapped", [40, 52264, 41]], [[12824, 12824], "disallowed_STD3_mapped", [40, 52852, 41]], [[12825, 12825], "disallowed_STD3_mapped", [40, 53440, 41]], [[12826, 12826], "disallowed_STD3_mapped", [40, 54028, 41]], [[12827, 12827], "disallowed_STD3_mapped", [40, 54616, 41]], [[12828, 12828], "disallowed_STD3_mapped", [40, 51452, 41]], [[12829, 12829], "disallowed_STD3_mapped", [40, 50724, 51204, 41]], [[12830, 12830], "disallowed_STD3_mapped", [40, 50724, 54980, 41]], [[12831, 12831], "disallowed"], [[12832, 12832], "disallowed_STD3_mapped", [40, 19968, 41]], [[12833, 12833], "disallowed_STD3_mapped", [40, 20108, 41]], [[12834, 12834], "disallowed_STD3_mapped", [40, 19977, 41]], [[12835, 12835], "disallowed_STD3_mapped", [40, 22235, 41]], [[12836, 12836], "disallowed_STD3_mapped", [40, 20116, 41]], [[12837, 12837], "disallowed_STD3_mapped", [40, 20845, 41]], [[12838, 12838], "disallowed_STD3_mapped", [40, 19971, 41]], [[12839, 12839], "disallowed_STD3_mapped", [40, 20843, 41]], [[12840, 12840], "disallowed_STD3_mapped", [40, 20061, 41]], [[12841, 12841], "disallowed_STD3_mapped", [40, 21313, 41]], [[12842, 12842], "disallowed_STD3_mapped", [40, 26376, 41]], [[12843, 12843], "disallowed_STD3_mapped", [40, 28779, 41]], [[12844, 12844], "disallowed_STD3_mapped", [40, 27700, 41]], [[12845, 12845], "disallowed_STD3_mapped", [40, 26408, 41]], [[12846, 12846], "disallowed_STD3_mapped", [40, 37329, 41]], [[12847, 12847], "disallowed_STD3_mapped", [40, 22303, 41]], [[12848, 12848], "disallowed_STD3_mapped", [40, 26085, 41]], [[12849, 12849], "disallowed_STD3_mapped", [40, 26666, 41]], [[12850, 12850], "disallowed_STD3_mapped", [40, 26377, 41]], [[12851, 12851], "disallowed_STD3_mapped", [40, 31038, 41]], [[12852, 12852], "disallowed_STD3_mapped", [40, 21517, 41]], [[12853, 12853], "disallowed_STD3_mapped", [40, 29305, 41]], [[12854, 12854], "disallowed_STD3_mapped", [40, 36001, 41]], [[12855, 12855], "disallowed_STD3_mapped", [40, 31069, 41]], [[12856, 12856], "disallowed_STD3_mapped", [40, 21172, 41]], [[12857, 12857], "disallowed_STD3_mapped", [40, 20195, 41]], [[12858, 12858], "disallowed_STD3_mapped", [40, 21628, 41]], [[12859, 12859], "disallowed_STD3_mapped", [40, 23398, 41]], [[12860, 12860], "disallowed_STD3_mapped", [40, 30435, 41]], [[12861, 12861], "disallowed_STD3_mapped", [40, 20225, 41]], [[12862, 12862], "disallowed_STD3_mapped", [40, 36039, 41]], [[12863, 12863], "disallowed_STD3_mapped", [40, 21332, 41]], [[12864, 12864], "disallowed_STD3_mapped", [40, 31085, 41]], [[12865, 12865], "disallowed_STD3_mapped", [40, 20241, 41]], [[12866, 12866], "disallowed_STD3_mapped", [40, 33258, 41]], [[12867, 12867], "disallowed_STD3_mapped", [40, 33267, 41]], [[12868, 12868], "mapped", [21839]], [[12869, 12869], "mapped", [24188]], [[12870, 12870], "mapped", [25991]], [[12871, 12871], "mapped", [31631]], [[12872, 12879], "valid", [], "NV8"], [[12880, 12880], "mapped", [112, 116, 101]], [[12881, 12881], "mapped", [50, 49]], [[12882, 12882], "mapped", [50, 50]], [[12883, 12883], "mapped", [50, 51]], [[12884, 12884], "mapped", [50, 52]], [[12885, 12885], "mapped", [50, 53]], [[12886, 12886], "mapped", [50, 54]], [[12887, 12887], "mapped", [50, 55]], [[12888, 12888], "mapped", [50, 56]], [[12889, 12889], "mapped", [50, 57]], [[12890, 12890], "mapped", [51, 48]], [[12891, 12891], "mapped", [51, 49]], [[12892, 12892], "mapped", [51, 50]], [[12893, 12893], "mapped", [51, 51]], [[12894, 12894], "mapped", [51, 52]], [[12895, 12895], "mapped", [51, 53]], [[12896, 12896], "mapped", [4352]], [[12897, 12897], "mapped", [4354]], [[12898, 12898], "mapped", [4355]], [[12899, 12899], "mapped", [4357]], [[12900, 12900], "mapped", [4358]], [[12901, 12901], "mapped", [4359]], [[12902, 12902], "mapped", [4361]], [[12903, 12903], "mapped", [4363]], [[12904, 12904], "mapped", [4364]], [[12905, 12905], "mapped", [4366]], [[12906, 12906], "mapped", [4367]], [[12907, 12907], "mapped", [4368]], [[12908, 12908], "mapped", [4369]], [[12909, 12909], "mapped", [4370]], [[12910, 12910], "mapped", [44032]], [[12911, 12911], "mapped", [45208]], [[12912, 12912], "mapped", [45796]], [[12913, 12913], "mapped", [46972]], [[12914, 12914], "mapped", [47560]], [[12915, 12915], "mapped", [48148]], [[12916, 12916], "mapped", [49324]], [[12917, 12917], "mapped", [50500]], [[12918, 12918], "mapped", [51088]], [[12919, 12919], "mapped", [52264]], [[12920, 12920], "mapped", [52852]], [[12921, 12921], "mapped", [53440]], [[12922, 12922], "mapped", [54028]], [[12923, 12923], "mapped", [54616]], [[12924, 12924], "mapped", [52280, 44256]], [[12925, 12925], "mapped", [51452, 51032]], [[12926, 12926], "mapped", [50864]], [[12927, 12927], "valid", [], "NV8"], [[12928, 12928], "mapped", [19968]], [[12929, 12929], "mapped", [20108]], [[12930, 12930], "mapped", [19977]], [[12931, 12931], "mapped", [22235]], [[12932, 12932], "mapped", [20116]], [[12933, 12933], "mapped", [20845]], [[12934, 12934], "mapped", [19971]], [[12935, 12935], "mapped", [20843]], [[12936, 12936], "mapped", [20061]], [[12937, 12937], "mapped", [21313]], [[12938, 12938], "mapped", [26376]], [[12939, 12939], "mapped", [28779]], [[12940, 12940], "mapped", [27700]], [[12941, 12941], "mapped", [26408]], [[12942, 12942], "mapped", [37329]], [[12943, 12943], "mapped", [22303]], [[12944, 12944], "mapped", [26085]], [[12945, 12945], "mapped", [26666]], [[12946, 12946], "mapped", [26377]], [[12947, 12947], "mapped", [31038]], [[12948, 12948], "mapped", [21517]], [[12949, 12949], "mapped", [29305]], [[12950, 12950], "mapped", [36001]], [[12951, 12951], "mapped", [31069]], [[12952, 12952], "mapped", [21172]], [[12953, 12953], "mapped", [31192]], [[12954, 12954], "mapped", [30007]], [[12955, 12955], "mapped", [22899]], [[12956, 12956], "mapped", [36969]], [[12957, 12957], "mapped", [20778]], [[12958, 12958], "mapped", [21360]], [[12959, 12959], "mapped", [27880]], [[12960, 12960], "mapped", [38917]], [[12961, 12961], "mapped", [20241]], [[12962, 12962], "mapped", [20889]], [[12963, 12963], "mapped", [27491]], [[12964, 12964], "mapped", [19978]], [[12965, 12965], "mapped", [20013]], [[12966, 12966], "mapped", [19979]], [[12967, 12967], "mapped", [24038]], [[12968, 12968], "mapped", [21491]], [[12969, 12969], "mapped", [21307]], [[12970, 12970], "mapped", [23447]], [[12971, 12971], "mapped", [23398]], [[12972, 12972], "mapped", [30435]], [[12973, 12973], "mapped", [20225]], [[12974, 12974], "mapped", [36039]], [[12975, 12975], "mapped", [21332]], [[12976, 12976], "mapped", [22812]], [[12977, 12977], "mapped", [51, 54]], [[12978, 12978], "mapped", [51, 55]], [[12979, 12979], "mapped", [51, 56]], [[12980, 12980], "mapped", [51, 57]], [[12981, 12981], "mapped", [52, 48]], [[12982, 12982], "mapped", [52, 49]], [[12983, 12983], "mapped", [52, 50]], [[12984, 12984], "mapped", [52, 51]], [[12985, 12985], "mapped", [52, 52]], [[12986, 12986], "mapped", [52, 53]], [[12987, 12987], "mapped", [52, 54]], [[12988, 12988], "mapped", [52, 55]], [[12989, 12989], "mapped", [52, 56]], [[12990, 12990], "mapped", [52, 57]], [[12991, 12991], "mapped", [53, 48]], [[12992, 12992], "mapped", [49, 26376]], [[12993, 12993], "mapped", [50, 26376]], [[12994, 12994], "mapped", [51, 26376]], [[12995, 12995], "mapped", [52, 26376]], [[12996, 12996], "mapped", [53, 26376]], [[12997, 12997], "mapped", [54, 26376]], [[12998, 12998], "mapped", [55, 26376]], [[12999, 12999], "mapped", [56, 26376]], [[13e3, 13e3], "mapped", [57, 26376]], [[13001, 13001], "mapped", [49, 48, 26376]], [[13002, 13002], "mapped", [49, 49, 26376]], [[13003, 13003], "mapped", [49, 50, 26376]], [[13004, 13004], "mapped", [104, 103]], [[13005, 13005], "mapped", [101, 114, 103]], [[13006, 13006], "mapped", [101, 118]], [[13007, 13007], "mapped", [108, 116, 100]], [[13008, 13008], "mapped", [12450]], [[13009, 13009], "mapped", [12452]], [[13010, 13010], "mapped", [12454]], [[13011, 13011], "mapped", [12456]], [[13012, 13012], "mapped", [12458]], [[13013, 13013], "mapped", [12459]], [[13014, 13014], "mapped", [12461]], [[13015, 13015], "mapped", [12463]], [[13016, 13016], "mapped", [12465]], [[13017, 13017], "mapped", [12467]], [[13018, 13018], "mapped", [12469]], [[13019, 13019], "mapped", [12471]], [[13020, 13020], "mapped", [12473]], [[13021, 13021], "mapped", [12475]], [[13022, 13022], "mapped", [12477]], [[13023, 13023], "mapped", [12479]], [[13024, 13024], "mapped", [12481]], [[13025, 13025], "mapped", [12484]], [[13026, 13026], "mapped", [12486]], [[13027, 13027], "mapped", [12488]], [[13028, 13028], "mapped", [12490]], [[13029, 13029], "mapped", [12491]], [[13030, 13030], "mapped", [12492]], [[13031, 13031], "mapped", [12493]], [[13032, 13032], "mapped", [12494]], [[13033, 13033], "mapped", [12495]], [[13034, 13034], "mapped", [12498]], [[13035, 13035], "mapped", [12501]], [[13036, 13036], "mapped", [12504]], [[13037, 13037], "mapped", [12507]], [[13038, 13038], "mapped", [12510]], [[13039, 13039], "mapped", [12511]], [[13040, 13040], "mapped", [12512]], [[13041, 13041], "mapped", [12513]], [[13042, 13042], "mapped", [12514]], [[13043, 13043], "mapped", [12516]], [[13044, 13044], "mapped", [12518]], [[13045, 13045], "mapped", [12520]], [[13046, 13046], "mapped", [12521]], [[13047, 13047], "mapped", [12522]], [[13048, 13048], "mapped", [12523]], [[13049, 13049], "mapped", [12524]], [[13050, 13050], "mapped", [12525]], [[13051, 13051], "mapped", [12527]], [[13052, 13052], "mapped", [12528]], [[13053, 13053], "mapped", [12529]], [[13054, 13054], "mapped", [12530]], [[13055, 13055], "disallowed"], [[13056, 13056], "mapped", [12450, 12497, 12540, 12488]], [[13057, 13057], "mapped", [12450, 12523, 12501, 12449]], [[13058, 13058], "mapped", [12450, 12531, 12506, 12450]], [[13059, 13059], "mapped", [12450, 12540, 12523]], [[13060, 13060], "mapped", [12452, 12491, 12531, 12464]], [[13061, 13061], "mapped", [12452, 12531, 12481]], [[13062, 13062], "mapped", [12454, 12457, 12531]], [[13063, 13063], "mapped", [12456, 12473, 12463, 12540, 12489]], [[13064, 13064], "mapped", [12456, 12540, 12459, 12540]], [[13065, 13065], "mapped", [12458, 12531, 12473]], [[13066, 13066], "mapped", [12458, 12540, 12512]], [[13067, 13067], "mapped", [12459, 12452, 12522]], [[13068, 13068], "mapped", [12459, 12521, 12483, 12488]], [[13069, 13069], "mapped", [12459, 12525, 12522, 12540]], [[13070, 13070], "mapped", [12460, 12525, 12531]], [[13071, 13071], "mapped", [12460, 12531, 12510]], [[13072, 13072], "mapped", [12462, 12460]], [[13073, 13073], "mapped", [12462, 12491, 12540]], [[13074, 13074], "mapped", [12461, 12517, 12522, 12540]], [[13075, 13075], "mapped", [12462, 12523, 12480, 12540]], [[13076, 13076], "mapped", [12461, 12525]], [[13077, 13077], "mapped", [12461, 12525, 12464, 12521, 12512]], [[13078, 13078], "mapped", [12461, 12525, 12513, 12540, 12488, 12523]], [[13079, 13079], "mapped", [12461, 12525, 12527, 12483, 12488]], [[13080, 13080], "mapped", [12464, 12521, 12512]], [[13081, 13081], "mapped", [12464, 12521, 12512, 12488, 12531]], [[13082, 13082], "mapped", [12463, 12523, 12476, 12452, 12525]], [[13083, 13083], "mapped", [12463, 12525, 12540, 12493]], [[13084, 13084], "mapped", [12465, 12540, 12473]], [[13085, 13085], "mapped", [12467, 12523, 12490]], [[13086, 13086], "mapped", [12467, 12540, 12509]], [[13087, 13087], "mapped", [12469, 12452, 12463, 12523]], [[13088, 13088], "mapped", [12469, 12531, 12481, 12540, 12512]], [[13089, 13089], "mapped", [12471, 12522, 12531, 12464]], [[13090, 13090], "mapped", [12475, 12531, 12481]], [[13091, 13091], "mapped", [12475, 12531, 12488]], [[13092, 13092], "mapped", [12480, 12540, 12473]], [[13093, 13093], "mapped", [12487, 12471]], [[13094, 13094], "mapped", [12489, 12523]], [[13095, 13095], "mapped", [12488, 12531]], [[13096, 13096], "mapped", [12490, 12494]], [[13097, 13097], "mapped", [12494, 12483, 12488]], [[13098, 13098], "mapped", [12495, 12452, 12484]], [[13099, 13099], "mapped", [12497, 12540, 12475, 12531, 12488]], [[13100, 13100], "mapped", [12497, 12540, 12484]], [[13101, 13101], "mapped", [12496, 12540, 12524, 12523]], [[13102, 13102], "mapped", [12500, 12450, 12473, 12488, 12523]], [[13103, 13103], "mapped", [12500, 12463, 12523]], [[13104, 13104], "mapped", [12500, 12467]], [[13105, 13105], "mapped", [12499, 12523]], [[13106, 13106], "mapped", [12501, 12449, 12521, 12483, 12489]], [[13107, 13107], "mapped", [12501, 12451, 12540, 12488]], [[13108, 13108], "mapped", [12502, 12483, 12471, 12455, 12523]], [[13109, 13109], "mapped", [12501, 12521, 12531]], [[13110, 13110], "mapped", [12504, 12463, 12479, 12540, 12523]], [[13111, 13111], "mapped", [12506, 12477]], [[13112, 13112], "mapped", [12506, 12491, 12498]], [[13113, 13113], "mapped", [12504, 12523, 12484]], [[13114, 13114], "mapped", [12506, 12531, 12473]], [[13115, 13115], "mapped", [12506, 12540, 12472]], [[13116, 13116], "mapped", [12505, 12540, 12479]], [[13117, 13117], "mapped", [12509, 12452, 12531, 12488]], [[13118, 13118], "mapped", [12508, 12523, 12488]], [[13119, 13119], "mapped", [12507, 12531]], [[13120, 13120], "mapped", [12509, 12531, 12489]], [[13121, 13121], "mapped", [12507, 12540, 12523]], [[13122, 13122], "mapped", [12507, 12540, 12531]], [[13123, 13123], "mapped", [12510, 12452, 12463, 12525]], [[13124, 13124], "mapped", [12510, 12452, 12523]], [[13125, 13125], "mapped", [12510, 12483, 12495]], [[13126, 13126], "mapped", [12510, 12523, 12463]], [[13127, 13127], "mapped", [12510, 12531, 12471, 12519, 12531]], [[13128, 13128], "mapped", [12511, 12463, 12525, 12531]], [[13129, 13129], "mapped", [12511, 12522]], [[13130, 13130], "mapped", [12511, 12522, 12496, 12540, 12523]], [[13131, 13131], "mapped", [12513, 12460]], [[13132, 13132], "mapped", [12513, 12460, 12488, 12531]], [[13133, 13133], "mapped", [12513, 12540, 12488, 12523]], [[13134, 13134], "mapped", [12516, 12540, 12489]], [[13135, 13135], "mapped", [12516, 12540, 12523]], [[13136, 13136], "mapped", [12518, 12450, 12531]], [[13137, 13137], "mapped", [12522, 12483, 12488, 12523]], [[13138, 13138], "mapped", [12522, 12521]], [[13139, 13139], "mapped", [12523, 12500, 12540]], [[13140, 13140], "mapped", [12523, 12540, 12502, 12523]], [[13141, 13141], "mapped", [12524, 12512]], [[13142, 13142], "mapped", [12524, 12531, 12488, 12466, 12531]], [[13143, 13143], "mapped", [12527, 12483, 12488]], [[13144, 13144], "mapped", [48, 28857]], [[13145, 13145], "mapped", [49, 28857]], [[13146, 13146], "mapped", [50, 28857]], [[13147, 13147], "mapped", [51, 28857]], [[13148, 13148], "mapped", [52, 28857]], [[13149, 13149], "mapped", [53, 28857]], [[13150, 13150], "mapped", [54, 28857]], [[13151, 13151], "mapped", [55, 28857]], [[13152, 13152], "mapped", [56, 28857]], [[13153, 13153], "mapped", [57, 28857]], [[13154, 13154], "mapped", [49, 48, 28857]], [[13155, 13155], "mapped", [49, 49, 28857]], [[13156, 13156], "mapped", [49, 50, 28857]], [[13157, 13157], "mapped", [49, 51, 28857]], [[13158, 13158], "mapped", [49, 52, 28857]], [[13159, 13159], "mapped", [49, 53, 28857]], [[13160, 13160], "mapped", [49, 54, 28857]], [[13161, 13161], "mapped", [49, 55, 28857]], [[13162, 13162], "mapped", [49, 56, 28857]], [[13163, 13163], "mapped", [49, 57, 28857]], [[13164, 13164], "mapped", [50, 48, 28857]], [[13165, 13165], "mapped", [50, 49, 28857]], [[13166, 13166], "mapped", [50, 50, 28857]], [[13167, 13167], "mapped", [50, 51, 28857]], [[13168, 13168], "mapped", [50, 52, 28857]], [[13169, 13169], "mapped", [104, 112, 97]], [[13170, 13170], "mapped", [100, 97]], [[13171, 13171], "mapped", [97, 117]], [[13172, 13172], "mapped", [98, 97, 114]], [[13173, 13173], "mapped", [111, 118]], [[13174, 13174], "mapped", [112, 99]], [[13175, 13175], "mapped", [100, 109]], [[13176, 13176], "mapped", [100, 109, 50]], [[13177, 13177], "mapped", [100, 109, 51]], [[13178, 13178], "mapped", [105, 117]], [[13179, 13179], "mapped", [24179, 25104]], [[13180, 13180], "mapped", [26157, 21644]], [[13181, 13181], "mapped", [22823, 27491]], [[13182, 13182], "mapped", [26126, 27835]], [[13183, 13183], "mapped", [26666, 24335, 20250, 31038]], [[13184, 13184], "mapped", [112, 97]], [[13185, 13185], "mapped", [110, 97]], [[13186, 13186], "mapped", [956, 97]], [[13187, 13187], "mapped", [109, 97]], [[13188, 13188], "mapped", [107, 97]], [[13189, 13189], "mapped", [107, 98]], [[13190, 13190], "mapped", [109, 98]], [[13191, 13191], "mapped", [103, 98]], [[13192, 13192], "mapped", [99, 97, 108]], [[13193, 13193], "mapped", [107, 99, 97, 108]], [[13194, 13194], "mapped", [112, 102]], [[13195, 13195], "mapped", [110, 102]], [[13196, 13196], "mapped", [956, 102]], [[13197, 13197], "mapped", [956, 103]], [[13198, 13198], "mapped", [109, 103]], [[13199, 13199], "mapped", [107, 103]], [[13200, 13200], "mapped", [104, 122]], [[13201, 13201], "mapped", [107, 104, 122]], [[13202, 13202], "mapped", [109, 104, 122]], [[13203, 13203], "mapped", [103, 104, 122]], [[13204, 13204], "mapped", [116, 104, 122]], [[13205, 13205], "mapped", [956, 108]], [[13206, 13206], "mapped", [109, 108]], [[13207, 13207], "mapped", [100, 108]], [[13208, 13208], "mapped", [107, 108]], [[13209, 13209], "mapped", [102, 109]], [[13210, 13210], "mapped", [110, 109]], [[13211, 13211], "mapped", [956, 109]], [[13212, 13212], "mapped", [109, 109]], [[13213, 13213], "mapped", [99, 109]], [[13214, 13214], "mapped", [107, 109]], [[13215, 13215], "mapped", [109, 109, 50]], [[13216, 13216], "mapped", [99, 109, 50]], [[13217, 13217], "mapped", [109, 50]], [[13218, 13218], "mapped", [107, 109, 50]], [[13219, 13219], "mapped", [109, 109, 51]], [[13220, 13220], "mapped", [99, 109, 51]], [[13221, 13221], "mapped", [109, 51]], [[13222, 13222], "mapped", [107, 109, 51]], [[13223, 13223], "mapped", [109, 8725, 115]], [[13224, 13224], "mapped", [109, 8725, 115, 50]], [[13225, 13225], "mapped", [112, 97]], [[13226, 13226], "mapped", [107, 112, 97]], [[13227, 13227], "mapped", [109, 112, 97]], [[13228, 13228], "mapped", [103, 112, 97]], [[13229, 13229], "mapped", [114, 97, 100]], [[13230, 13230], "mapped", [114, 97, 100, 8725, 115]], [[13231, 13231], "mapped", [114, 97, 100, 8725, 115, 50]], [[13232, 13232], "mapped", [112, 115]], [[13233, 13233], "mapped", [110, 115]], [[13234, 13234], "mapped", [956, 115]], [[13235, 13235], "mapped", [109, 115]], [[13236, 13236], "mapped", [112, 118]], [[13237, 13237], "mapped", [110, 118]], [[13238, 13238], "mapped", [956, 118]], [[13239, 13239], "mapped", [109, 118]], [[13240, 13240], "mapped", [107, 118]], [[13241, 13241], "mapped", [109, 118]], [[13242, 13242], "mapped", [112, 119]], [[13243, 13243], "mapped", [110, 119]], [[13244, 13244], "mapped", [956, 119]], [[13245, 13245], "mapped", [109, 119]], [[13246, 13246], "mapped", [107, 119]], [[13247, 13247], "mapped", [109, 119]], [[13248, 13248], "mapped", [107, 969]], [[13249, 13249], "mapped", [109, 969]], [[13250, 13250], "disallowed"], [[13251, 13251], "mapped", [98, 113]], [[13252, 13252], "mapped", [99, 99]], [[13253, 13253], "mapped", [99, 100]], [[13254, 13254], "mapped", [99, 8725, 107, 103]], [[13255, 13255], "disallowed"], [[13256, 13256], "mapped", [100, 98]], [[13257, 13257], "mapped", [103, 121]], [[13258, 13258], "mapped", [104, 97]], [[13259, 13259], "mapped", [104, 112]], [[13260, 13260], "mapped", [105, 110]], [[13261, 13261], "mapped", [107, 107]], [[13262, 13262], "mapped", [107, 109]], [[13263, 13263], "mapped", [107, 116]], [[13264, 13264], "mapped", [108, 109]], [[13265, 13265], "mapped", [108, 110]], [[13266, 13266], "mapped", [108, 111, 103]], [[13267, 13267], "mapped", [108, 120]], [[13268, 13268], "mapped", [109, 98]], [[13269, 13269], "mapped", [109, 105, 108]], [[13270, 13270], "mapped", [109, 111, 108]], [[13271, 13271], "mapped", [112, 104]], [[13272, 13272], "disallowed"], [[13273, 13273], "mapped", [112, 112, 109]], [[13274, 13274], "mapped", [112, 114]], [[13275, 13275], "mapped", [115, 114]], [[13276, 13276], "mapped", [115, 118]], [[13277, 13277], "mapped", [119, 98]], [[13278, 13278], "mapped", [118, 8725, 109]], [[13279, 13279], "mapped", [97, 8725, 109]], [[13280, 13280], "mapped", [49, 26085]], [[13281, 13281], "mapped", [50, 26085]], [[13282, 13282], "mapped", [51, 26085]], [[13283, 13283], "mapped", [52, 26085]], [[13284, 13284], "mapped", [53, 26085]], [[13285, 13285], "mapped", [54, 26085]], [[13286, 13286], "mapped", [55, 26085]], [[13287, 13287], "mapped", [56, 26085]], [[13288, 13288], "mapped", [57, 26085]], [[13289, 13289], "mapped", [49, 48, 26085]], [[13290, 13290], "mapped", [49, 49, 26085]], [[13291, 13291], "mapped", [49, 50, 26085]], [[13292, 13292], "mapped", [49, 51, 26085]], [[13293, 13293], "mapped", [49, 52, 26085]], [[13294, 13294], "mapped", [49, 53, 26085]], [[13295, 13295], "mapped", [49, 54, 26085]], [[13296, 13296], "mapped", [49, 55, 26085]], [[13297, 13297], "mapped", [49, 56, 26085]], [[13298, 13298], "mapped", [49, 57, 26085]], [[13299, 13299], "mapped", [50, 48, 26085]], [[13300, 13300], "mapped", [50, 49, 26085]], [[13301, 13301], "mapped", [50, 50, 26085]], [[13302, 13302], "mapped", [50, 51, 26085]], [[13303, 13303], "mapped", [50, 52, 26085]], [[13304, 13304], "mapped", [50, 53, 26085]], [[13305, 13305], "mapped", [50, 54, 26085]], [[13306, 13306], "mapped", [50, 55, 26085]], [[13307, 13307], "mapped", [50, 56, 26085]], [[13308, 13308], "mapped", [50, 57, 26085]], [[13309, 13309], "mapped", [51, 48, 26085]], [[13310, 13310], "mapped", [51, 49, 26085]], [[13311, 13311], "mapped", [103, 97, 108]], [[13312, 19893], "valid"], [[19894, 19903], "disallowed"], [[19904, 19967], "valid", [], "NV8"], [[19968, 40869], "valid"], [[40870, 40891], "valid"], [[40892, 40899], "valid"], [[40900, 40907], "valid"], [[40908, 40908], "valid"], [[40909, 40917], "valid"], [[40918, 40959], "disallowed"], [[40960, 42124], "valid"], [[42125, 42127], "disallowed"], [[42128, 42145], "valid", [], "NV8"], [[42146, 42147], "valid", [], "NV8"], [[42148, 42163], "valid", [], "NV8"], [[42164, 42164], "valid", [], "NV8"], [[42165, 42176], "valid", [], "NV8"], [[42177, 42177], "valid", [], "NV8"], [[42178, 42180], "valid", [], "NV8"], [[42181, 42181], "valid", [], "NV8"], [[42182, 42182], "valid", [], "NV8"], [[42183, 42191], "disallowed"], [[42192, 42237], "valid"], [[42238, 42239], "valid", [], "NV8"], [[42240, 42508], "valid"], [[42509, 42511], "valid", [], "NV8"], [[42512, 42539], "valid"], [[42540, 42559], "disallowed"], [[42560, 42560], "mapped", [42561]], [[42561, 42561], "valid"], [[42562, 42562], "mapped", [42563]], [[42563, 42563], "valid"], [[42564, 42564], "mapped", [42565]], [[42565, 42565], "valid"], [[42566, 42566], "mapped", [42567]], [[42567, 42567], "valid"], [[42568, 42568], "mapped", [42569]], [[42569, 42569], "valid"], [[42570, 42570], "mapped", [42571]], [[42571, 42571], "valid"], [[42572, 42572], "mapped", [42573]], [[42573, 42573], "valid"], [[42574, 42574], "mapped", [42575]], [[42575, 42575], "valid"], [[42576, 42576], "mapped", [42577]], [[42577, 42577], "valid"], [[42578, 42578], "mapped", [42579]], [[42579, 42579], "valid"], [[42580, 42580], "mapped", [42581]], [[42581, 42581], "valid"], [[42582, 42582], "mapped", [42583]], [[42583, 42583], "valid"], [[42584, 42584], "mapped", [42585]], [[42585, 42585], "valid"], [[42586, 42586], "mapped", [42587]], [[42587, 42587], "valid"], [[42588, 42588], "mapped", [42589]], [[42589, 42589], "valid"], [[42590, 42590], "mapped", [42591]], [[42591, 42591], "valid"], [[42592, 42592], "mapped", [42593]], [[42593, 42593], "valid"], [[42594, 42594], "mapped", [42595]], [[42595, 42595], "valid"], [[42596, 42596], "mapped", [42597]], [[42597, 42597], "valid"], [[42598, 42598], "mapped", [42599]], [[42599, 42599], "valid"], [[42600, 42600], "mapped", [42601]], [[42601, 42601], "valid"], [[42602, 42602], "mapped", [42603]], [[42603, 42603], "valid"], [[42604, 42604], "mapped", [42605]], [[42605, 42607], "valid"], [[42608, 42611], "valid", [], "NV8"], [[42612, 42619], "valid"], [[42620, 42621], "valid"], [[42622, 42622], "valid", [], "NV8"], [[42623, 42623], "valid"], [[42624, 42624], "mapped", [42625]], [[42625, 42625], "valid"], [[42626, 42626], "mapped", [42627]], [[42627, 42627], "valid"], [[42628, 42628], "mapped", [42629]], [[42629, 42629], "valid"], [[42630, 42630], "mapped", [42631]], [[42631, 42631], "valid"], [[42632, 42632], "mapped", [42633]], [[42633, 42633], "valid"], [[42634, 42634], "mapped", [42635]], [[42635, 42635], "valid"], [[42636, 42636], "mapped", [42637]], [[42637, 42637], "valid"], [[42638, 42638], "mapped", [42639]], [[42639, 42639], "valid"], [[42640, 42640], "mapped", [42641]], [[42641, 42641], "valid"], [[42642, 42642], "mapped", [42643]], [[42643, 42643], "valid"], [[42644, 42644], "mapped", [42645]], [[42645, 42645], "valid"], [[42646, 42646], "mapped", [42647]], [[42647, 42647], "valid"], [[42648, 42648], "mapped", [42649]], [[42649, 42649], "valid"], [[42650, 42650], "mapped", [42651]], [[42651, 42651], "valid"], [[42652, 42652], "mapped", [1098]], [[42653, 42653], "mapped", [1100]], [[42654, 42654], "valid"], [[42655, 42655], "valid"], [[42656, 42725], "valid"], [[42726, 42735], "valid", [], "NV8"], [[42736, 42737], "valid"], [[42738, 42743], "valid", [], "NV8"], [[42744, 42751], "disallowed"], [[42752, 42774], "valid", [], "NV8"], [[42775, 42778], "valid"], [[42779, 42783], "valid"], [[42784, 42785], "valid", [], "NV8"], [[42786, 42786], "mapped", [42787]], [[42787, 42787], "valid"], [[42788, 42788], "mapped", [42789]], [[42789, 42789], "valid"], [[42790, 42790], "mapped", [42791]], [[42791, 42791], "valid"], [[42792, 42792], "mapped", [42793]], [[42793, 42793], "valid"], [[42794, 42794], "mapped", [42795]], [[42795, 42795], "valid"], [[42796, 42796], "mapped", [42797]], [[42797, 42797], "valid"], [[42798, 42798], "mapped", [42799]], [[42799, 42801], "valid"], [[42802, 42802], "mapped", [42803]], [[42803, 42803], "valid"], [[42804, 42804], "mapped", [42805]], [[42805, 42805], "valid"], [[42806, 42806], "mapped", [42807]], [[42807, 42807], "valid"], [[42808, 42808], "mapped", [42809]], [[42809, 42809], "valid"], [[42810, 42810], "mapped", [42811]], [[42811, 42811], "valid"], [[42812, 42812], "mapped", [42813]], [[42813, 42813], "valid"], [[42814, 42814], "mapped", [42815]], [[42815, 42815], "valid"], [[42816, 42816], "mapped", [42817]], [[42817, 42817], "valid"], [[42818, 42818], "mapped", [42819]], [[42819, 42819], "valid"], [[42820, 42820], "mapped", [42821]], [[42821, 42821], "valid"], [[42822, 42822], "mapped", [42823]], [[42823, 42823], "valid"], [[42824, 42824], "mapped", [42825]], [[42825, 42825], "valid"], [[42826, 42826], "mapped", [42827]], [[42827, 42827], "valid"], [[42828, 42828], "mapped", [42829]], [[42829, 42829], "valid"], [[42830, 42830], "mapped", [42831]], [[42831, 42831], "valid"], [[42832, 42832], "mapped", [42833]], [[42833, 42833], "valid"], [[42834, 42834], "mapped", [42835]], [[42835, 42835], "valid"], [[42836, 42836], "mapped", [42837]], [[42837, 42837], "valid"], [[42838, 42838], "mapped", [42839]], [[42839, 42839], "valid"], [[42840, 42840], "mapped", [42841]], [[42841, 42841], "valid"], [[42842, 42842], "mapped", [42843]], [[42843, 42843], "valid"], [[42844, 42844], "mapped", [42845]], [[42845, 42845], "valid"], [[42846, 42846], "mapped", [42847]], [[42847, 42847], "valid"], [[42848, 42848], "mapped", [42849]], [[42849, 42849], "valid"], [[42850, 42850], "mapped", [42851]], [[42851, 42851], "valid"], [[42852, 42852], "mapped", [42853]], [[42853, 42853], "valid"], [[42854, 42854], "mapped", [42855]], [[42855, 42855], "valid"], [[42856, 42856], "mapped", [42857]], [[42857, 42857], "valid"], [[42858, 42858], "mapped", [42859]], [[42859, 42859], "valid"], [[42860, 42860], "mapped", [42861]], [[42861, 42861], "valid"], [[42862, 42862], "mapped", [42863]], [[42863, 42863], "valid"], [[42864, 42864], "mapped", [42863]], [[42865, 42872], "valid"], [[42873, 42873], "mapped", [42874]], [[42874, 42874], "valid"], [[42875, 42875], "mapped", [42876]], [[42876, 42876], "valid"], [[42877, 42877], "mapped", [7545]], [[42878, 42878], "mapped", [42879]], [[42879, 42879], "valid"], [[42880, 42880], "mapped", [42881]], [[42881, 42881], "valid"], [[42882, 42882], "mapped", [42883]], [[42883, 42883], "valid"], [[42884, 42884], "mapped", [42885]], [[42885, 42885], "valid"], [[42886, 42886], "mapped", [42887]], [[42887, 42888], "valid"], [[42889, 42890], "valid", [], "NV8"], [[42891, 42891], "mapped", [42892]], [[42892, 42892], "valid"], [[42893, 42893], "mapped", [613]], [[42894, 42894], "valid"], [[42895, 42895], "valid"], [[42896, 42896], "mapped", [42897]], [[42897, 42897], "valid"], [[42898, 42898], "mapped", [42899]], [[42899, 42899], "valid"], [[42900, 42901], "valid"], [[42902, 42902], "mapped", [42903]], [[42903, 42903], "valid"], [[42904, 42904], "mapped", [42905]], [[42905, 42905], "valid"], [[42906, 42906], "mapped", [42907]], [[42907, 42907], "valid"], [[42908, 42908], "mapped", [42909]], [[42909, 42909], "valid"], [[42910, 42910], "mapped", [42911]], [[42911, 42911], "valid"], [[42912, 42912], "mapped", [42913]], [[42913, 42913], "valid"], [[42914, 42914], "mapped", [42915]], [[42915, 42915], "valid"], [[42916, 42916], "mapped", [42917]], [[42917, 42917], "valid"], [[42918, 42918], "mapped", [42919]], [[42919, 42919], "valid"], [[42920, 42920], "mapped", [42921]], [[42921, 42921], "valid"], [[42922, 42922], "mapped", [614]], [[42923, 42923], "mapped", [604]], [[42924, 42924], "mapped", [609]], [[42925, 42925], "mapped", [620]], [[42926, 42927], "disallowed"], [[42928, 42928], "mapped", [670]], [[42929, 42929], "mapped", [647]], [[42930, 42930], "mapped", [669]], [[42931, 42931], "mapped", [43859]], [[42932, 42932], "mapped", [42933]], [[42933, 42933], "valid"], [[42934, 42934], "mapped", [42935]], [[42935, 42935], "valid"], [[42936, 42998], "disallowed"], [[42999, 42999], "valid"], [[43e3, 43e3], "mapped", [295]], [[43001, 43001], "mapped", [339]], [[43002, 43002], "valid"], [[43003, 43007], "valid"], [[43008, 43047], "valid"], [[43048, 43051], "valid", [], "NV8"], [[43052, 43055], "disallowed"], [[43056, 43065], "valid", [], "NV8"], [[43066, 43071], "disallowed"], [[43072, 43123], "valid"], [[43124, 43127], "valid", [], "NV8"], [[43128, 43135], "disallowed"], [[43136, 43204], "valid"], [[43205, 43213], "disallowed"], [[43214, 43215], "valid", [], "NV8"], [[43216, 43225], "valid"], [[43226, 43231], "disallowed"], [[43232, 43255], "valid"], [[43256, 43258], "valid", [], "NV8"], [[43259, 43259], "valid"], [[43260, 43260], "valid", [], "NV8"], [[43261, 43261], "valid"], [[43262, 43263], "disallowed"], [[43264, 43309], "valid"], [[43310, 43311], "valid", [], "NV8"], [[43312, 43347], "valid"], [[43348, 43358], "disallowed"], [[43359, 43359], "valid", [], "NV8"], [[43360, 43388], "valid", [], "NV8"], [[43389, 43391], "disallowed"], [[43392, 43456], "valid"], [[43457, 43469], "valid", [], "NV8"], [[43470, 43470], "disallowed"], [[43471, 43481], "valid"], [[43482, 43485], "disallowed"], [[43486, 43487], "valid", [], "NV8"], [[43488, 43518], "valid"], [[43519, 43519], "disallowed"], [[43520, 43574], "valid"], [[43575, 43583], "disallowed"], [[43584, 43597], "valid"], [[43598, 43599], "disallowed"], [[43600, 43609], "valid"], [[43610, 43611], "disallowed"], [[43612, 43615], "valid", [], "NV8"], [[43616, 43638], "valid"], [[43639, 43641], "valid", [], "NV8"], [[43642, 43643], "valid"], [[43644, 43647], "valid"], [[43648, 43714], "valid"], [[43715, 43738], "disallowed"], [[43739, 43741], "valid"], [[43742, 43743], "valid", [], "NV8"], [[43744, 43759], "valid"], [[43760, 43761], "valid", [], "NV8"], [[43762, 43766], "valid"], [[43767, 43776], "disallowed"], [[43777, 43782], "valid"], [[43783, 43784], "disallowed"], [[43785, 43790], "valid"], [[43791, 43792], "disallowed"], [[43793, 43798], "valid"], [[43799, 43807], "disallowed"], [[43808, 43814], "valid"], [[43815, 43815], "disallowed"], [[43816, 43822], "valid"], [[43823, 43823], "disallowed"], [[43824, 43866], "valid"], [[43867, 43867], "valid", [], "NV8"], [[43868, 43868], "mapped", [42791]], [[43869, 43869], "mapped", [43831]], [[43870, 43870], "mapped", [619]], [[43871, 43871], "mapped", [43858]], [[43872, 43875], "valid"], [[43876, 43877], "valid"], [[43878, 43887], "disallowed"], [[43888, 43888], "mapped", [5024]], [[43889, 43889], "mapped", [5025]], [[43890, 43890], "mapped", [5026]], [[43891, 43891], "mapped", [5027]], [[43892, 43892], "mapped", [5028]], [[43893, 43893], "mapped", [5029]], [[43894, 43894], "mapped", [5030]], [[43895, 43895], "mapped", [5031]], [[43896, 43896], "mapped", [5032]], [[43897, 43897], "mapped", [5033]], [[43898, 43898], "mapped", [5034]], [[43899, 43899], "mapped", [5035]], [[43900, 43900], "mapped", [5036]], [[43901, 43901], "mapped", [5037]], [[43902, 43902], "mapped", [5038]], [[43903, 43903], "mapped", [5039]], [[43904, 43904], "mapped", [5040]], [[43905, 43905], "mapped", [5041]], [[43906, 43906], "mapped", [5042]], [[43907, 43907], "mapped", [5043]], [[43908, 43908], "mapped", [5044]], [[43909, 43909], "mapped", [5045]], [[43910, 43910], "mapped", [5046]], [[43911, 43911], "mapped", [5047]], [[43912, 43912], "mapped", [5048]], [[43913, 43913], "mapped", [5049]], [[43914, 43914], "mapped", [5050]], [[43915, 43915], "mapped", [5051]], [[43916, 43916], "mapped", [5052]], [[43917, 43917], "mapped", [5053]], [[43918, 43918], "mapped", [5054]], [[43919, 43919], "mapped", [5055]], [[43920, 43920], "mapped", [5056]], [[43921, 43921], "mapped", [5057]], [[43922, 43922], "mapped", [5058]], [[43923, 43923], "mapped", [5059]], [[43924, 43924], "mapped", [5060]], [[43925, 43925], "mapped", [5061]], [[43926, 43926], "mapped", [5062]], [[43927, 43927], "mapped", [5063]], [[43928, 43928], "mapped", [5064]], [[43929, 43929], "mapped", [5065]], [[43930, 43930], "mapped", [5066]], [[43931, 43931], "mapped", [5067]], [[43932, 43932], "mapped", [5068]], [[43933, 43933], "mapped", [5069]], [[43934, 43934], "mapped", [5070]], [[43935, 43935], "mapped", [5071]], [[43936, 43936], "mapped", [5072]], [[43937, 43937], "mapped", [5073]], [[43938, 43938], "mapped", [5074]], [[43939, 43939], "mapped", [5075]], [[43940, 43940], "mapped", [5076]], [[43941, 43941], "mapped", [5077]], [[43942, 43942], "mapped", [5078]], [[43943, 43943], "mapped", [5079]], [[43944, 43944], "mapped", [5080]], [[43945, 43945], "mapped", [5081]], [[43946, 43946], "mapped", [5082]], [[43947, 43947], "mapped", [5083]], [[43948, 43948], "mapped", [5084]], [[43949, 43949], "mapped", [5085]], [[43950, 43950], "mapped", [5086]], [[43951, 43951], "mapped", [5087]], [[43952, 43952], "mapped", [5088]], [[43953, 43953], "mapped", [5089]], [[43954, 43954], "mapped", [5090]], [[43955, 43955], "mapped", [5091]], [[43956, 43956], "mapped", [5092]], [[43957, 43957], "mapped", [5093]], [[43958, 43958], "mapped", [5094]], [[43959, 43959], "mapped", [5095]], [[43960, 43960], "mapped", [5096]], [[43961, 43961], "mapped", [5097]], [[43962, 43962], "mapped", [5098]], [[43963, 43963], "mapped", [5099]], [[43964, 43964], "mapped", [5100]], [[43965, 43965], "mapped", [5101]], [[43966, 43966], "mapped", [5102]], [[43967, 43967], "mapped", [5103]], [[43968, 44010], "valid"], [[44011, 44011], "valid", [], "NV8"], [[44012, 44013], "valid"], [[44014, 44015], "disallowed"], [[44016, 44025], "valid"], [[44026, 44031], "disallowed"], [[44032, 55203], "valid"], [[55204, 55215], "disallowed"], [[55216, 55238], "valid", [], "NV8"], [[55239, 55242], "disallowed"], [[55243, 55291], "valid", [], "NV8"], [[55292, 55295], "disallowed"], [[55296, 57343], "disallowed"], [[57344, 63743], "disallowed"], [[63744, 63744], "mapped", [35912]], [[63745, 63745], "mapped", [26356]], [[63746, 63746], "mapped", [36554]], [[63747, 63747], "mapped", [36040]], [[63748, 63748], "mapped", [28369]], [[63749, 63749], "mapped", [20018]], [[63750, 63750], "mapped", [21477]], [[63751, 63752], "mapped", [40860]], [[63753, 63753], "mapped", [22865]], [[63754, 63754], "mapped", [37329]], [[63755, 63755], "mapped", [21895]], [[63756, 63756], "mapped", [22856]], [[63757, 63757], "mapped", [25078]], [[63758, 63758], "mapped", [30313]], [[63759, 63759], "mapped", [32645]], [[63760, 63760], "mapped", [34367]], [[63761, 63761], "mapped", [34746]], [[63762, 63762], "mapped", [35064]], [[63763, 63763], "mapped", [37007]], [[63764, 63764], "mapped", [27138]], [[63765, 63765], "mapped", [27931]], [[63766, 63766], "mapped", [28889]], [[63767, 63767], "mapped", [29662]], [[63768, 63768], "mapped", [33853]], [[63769, 63769], "mapped", [37226]], [[63770, 63770], "mapped", [39409]], [[63771, 63771], "mapped", [20098]], [[63772, 63772], "mapped", [21365]], [[63773, 63773], "mapped", [27396]], [[63774, 63774], "mapped", [29211]], [[63775, 63775], "mapped", [34349]], [[63776, 63776], "mapped", [40478]], [[63777, 63777], "mapped", [23888]], [[63778, 63778], "mapped", [28651]], [[63779, 63779], "mapped", [34253]], [[63780, 63780], "mapped", [35172]], [[63781, 63781], "mapped", [25289]], [[63782, 63782], "mapped", [33240]], [[63783, 63783], "mapped", [34847]], [[63784, 63784], "mapped", [24266]], [[63785, 63785], "mapped", [26391]], [[63786, 63786], "mapped", [28010]], [[63787, 63787], "mapped", [29436]], [[63788, 63788], "mapped", [37070]], [[63789, 63789], "mapped", [20358]], [[63790, 63790], "mapped", [20919]], [[63791, 63791], "mapped", [21214]], [[63792, 63792], "mapped", [25796]], [[63793, 63793], "mapped", [27347]], [[63794, 63794], "mapped", [29200]], [[63795, 63795], "mapped", [30439]], [[63796, 63796], "mapped", [32769]], [[63797, 63797], "mapped", [34310]], [[63798, 63798], "mapped", [34396]], [[63799, 63799], "mapped", [36335]], [[63800, 63800], "mapped", [38706]], [[63801, 63801], "mapped", [39791]], [[63802, 63802], "mapped", [40442]], [[63803, 63803], "mapped", [30860]], [[63804, 63804], "mapped", [31103]], [[63805, 63805], "mapped", [32160]], [[63806, 63806], "mapped", [33737]], [[63807, 63807], "mapped", [37636]], [[63808, 63808], "mapped", [40575]], [[63809, 63809], "mapped", [35542]], [[63810, 63810], "mapped", [22751]], [[63811, 63811], "mapped", [24324]], [[63812, 63812], "mapped", [31840]], [[63813, 63813], "mapped", [32894]], [[63814, 63814], "mapped", [29282]], [[63815, 63815], "mapped", [30922]], [[63816, 63816], "mapped", [36034]], [[63817, 63817], "mapped", [38647]], [[63818, 63818], "mapped", [22744]], [[63819, 63819], "mapped", [23650]], [[63820, 63820], "mapped", [27155]], [[63821, 63821], "mapped", [28122]], [[63822, 63822], "mapped", [28431]], [[63823, 63823], "mapped", [32047]], [[63824, 63824], "mapped", [32311]], [[63825, 63825], "mapped", [38475]], [[63826, 63826], "mapped", [21202]], [[63827, 63827], "mapped", [32907]], [[63828, 63828], "mapped", [20956]], [[63829, 63829], "mapped", [20940]], [[63830, 63830], "mapped", [31260]], [[63831, 63831], "mapped", [32190]], [[63832, 63832], "mapped", [33777]], [[63833, 63833], "mapped", [38517]], [[63834, 63834], "mapped", [35712]], [[63835, 63835], "mapped", [25295]], [[63836, 63836], "mapped", [27138]], [[63837, 63837], "mapped", [35582]], [[63838, 63838], "mapped", [20025]], [[63839, 63839], "mapped", [23527]], [[63840, 63840], "mapped", [24594]], [[63841, 63841], "mapped", [29575]], [[63842, 63842], "mapped", [30064]], [[63843, 63843], "mapped", [21271]], [[63844, 63844], "mapped", [30971]], [[63845, 63845], "mapped", [20415]], [[63846, 63846], "mapped", [24489]], [[63847, 63847], "mapped", [19981]], [[63848, 63848], "mapped", [27852]], [[63849, 63849], "mapped", [25976]], [[63850, 63850], "mapped", [32034]], [[63851, 63851], "mapped", [21443]], [[63852, 63852], "mapped", [22622]], [[63853, 63853], "mapped", [30465]], [[63854, 63854], "mapped", [33865]], [[63855, 63855], "mapped", [35498]], [[63856, 63856], "mapped", [27578]], [[63857, 63857], "mapped", [36784]], [[63858, 63858], "mapped", [27784]], [[63859, 63859], "mapped", [25342]], [[63860, 63860], "mapped", [33509]], [[63861, 63861], "mapped", [25504]], [[63862, 63862], "mapped", [30053]], [[63863, 63863], "mapped", [20142]], [[63864, 63864], "mapped", [20841]], [[63865, 63865], "mapped", [20937]], [[63866, 63866], "mapped", [26753]], [[63867, 63867], "mapped", [31975]], [[63868, 63868], "mapped", [33391]], [[63869, 63869], "mapped", [35538]], [[63870, 63870], "mapped", [37327]], [[63871, 63871], "mapped", [21237]], [[63872, 63872], "mapped", [21570]], [[63873, 63873], "mapped", [22899]], [[63874, 63874], "mapped", [24300]], [[63875, 63875], "mapped", [26053]], [[63876, 63876], "mapped", [28670]], [[63877, 63877], "mapped", [31018]], [[63878, 63878], "mapped", [38317]], [[63879, 63879], "mapped", [39530]], [[63880, 63880], "mapped", [40599]], [[63881, 63881], "mapped", [40654]], [[63882, 63882], "mapped", [21147]], [[63883, 63883], "mapped", [26310]], [[63884, 63884], "mapped", [27511]], [[63885, 63885], "mapped", [36706]], [[63886, 63886], "mapped", [24180]], [[63887, 63887], "mapped", [24976]], [[63888, 63888], "mapped", [25088]], [[63889, 63889], "mapped", [25754]], [[63890, 63890], "mapped", [28451]], [[63891, 63891], "mapped", [29001]], [[63892, 63892], "mapped", [29833]], [[63893, 63893], "mapped", [31178]], [[63894, 63894], "mapped", [32244]], [[63895, 63895], "mapped", [32879]], [[63896, 63896], "mapped", [36646]], [[63897, 63897], "mapped", [34030]], [[63898, 63898], "mapped", [36899]], [[63899, 63899], "mapped", [37706]], [[63900, 63900], "mapped", [21015]], [[63901, 63901], "mapped", [21155]], [[63902, 63902], "mapped", [21693]], [[63903, 63903], "mapped", [28872]], [[63904, 63904], "mapped", [35010]], [[63905, 63905], "mapped", [35498]], [[63906, 63906], "mapped", [24265]], [[63907, 63907], "mapped", [24565]], [[63908, 63908], "mapped", [25467]], [[63909, 63909], "mapped", [27566]], [[63910, 63910], "mapped", [31806]], [[63911, 63911], "mapped", [29557]], [[63912, 63912], "mapped", [20196]], [[63913, 63913], "mapped", [22265]], [[63914, 63914], "mapped", [23527]], [[63915, 63915], "mapped", [23994]], [[63916, 63916], "mapped", [24604]], [[63917, 63917], "mapped", [29618]], [[63918, 63918], "mapped", [29801]], [[63919, 63919], "mapped", [32666]], [[63920, 63920], "mapped", [32838]], [[63921, 63921], "mapped", [37428]], [[63922, 63922], "mapped", [38646]], [[63923, 63923], "mapped", [38728]], [[63924, 63924], "mapped", [38936]], [[63925, 63925], "mapped", [20363]], [[63926, 63926], "mapped", [31150]], [[63927, 63927], "mapped", [37300]], [[63928, 63928], "mapped", [38584]], [[63929, 63929], "mapped", [24801]], [[63930, 63930], "mapped", [20102]], [[63931, 63931], "mapped", [20698]], [[63932, 63932], "mapped", [23534]], [[63933, 63933], "mapped", [23615]], [[63934, 63934], "mapped", [26009]], [[63935, 63935], "mapped", [27138]], [[63936, 63936], "mapped", [29134]], [[63937, 63937], "mapped", [30274]], [[63938, 63938], "mapped", [34044]], [[63939, 63939], "mapped", [36988]], [[63940, 63940], "mapped", [40845]], [[63941, 63941], "mapped", [26248]], [[63942, 63942], "mapped", [38446]], [[63943, 63943], "mapped", [21129]], [[63944, 63944], "mapped", [26491]], [[63945, 63945], "mapped", [26611]], [[63946, 63946], "mapped", [27969]], [[63947, 63947], "mapped", [28316]], [[63948, 63948], "mapped", [29705]], [[63949, 63949], "mapped", [30041]], [[63950, 63950], "mapped", [30827]], [[63951, 63951], "mapped", [32016]], [[63952, 63952], "mapped", [39006]], [[63953, 63953], "mapped", [20845]], [[63954, 63954], "mapped", [25134]], [[63955, 63955], "mapped", [38520]], [[63956, 63956], "mapped", [20523]], [[63957, 63957], "mapped", [23833]], [[63958, 63958], "mapped", [28138]], [[63959, 63959], "mapped", [36650]], [[63960, 63960], "mapped", [24459]], [[63961, 63961], "mapped", [24900]], [[63962, 63962], "mapped", [26647]], [[63963, 63963], "mapped", [29575]], [[63964, 63964], "mapped", [38534]], [[63965, 63965], "mapped", [21033]], [[63966, 63966], "mapped", [21519]], [[63967, 63967], "mapped", [23653]], [[63968, 63968], "mapped", [26131]], [[63969, 63969], "mapped", [26446]], [[63970, 63970], "mapped", [26792]], [[63971, 63971], "mapped", [27877]], [[63972, 63972], "mapped", [29702]], [[63973, 63973], "mapped", [30178]], [[63974, 63974], "mapped", [32633]], [[63975, 63975], "mapped", [35023]], [[63976, 63976], "mapped", [35041]], [[63977, 63977], "mapped", [37324]], [[63978, 63978], "mapped", [38626]], [[63979, 63979], "mapped", [21311]], [[63980, 63980], "mapped", [28346]], [[63981, 63981], "mapped", [21533]], [[63982, 63982], "mapped", [29136]], [[63983, 63983], "mapped", [29848]], [[63984, 63984], "mapped", [34298]], [[63985, 63985], "mapped", [38563]], [[63986, 63986], "mapped", [40023]], [[63987, 63987], "mapped", [40607]], [[63988, 63988], "mapped", [26519]], [[63989, 63989], "mapped", [28107]], [[63990, 63990], "mapped", [33256]], [[63991, 63991], "mapped", [31435]], [[63992, 63992], "mapped", [31520]], [[63993, 63993], "mapped", [31890]], [[63994, 63994], "mapped", [29376]], [[63995, 63995], "mapped", [28825]], [[63996, 63996], "mapped", [35672]], [[63997, 63997], "mapped", [20160]], [[63998, 63998], "mapped", [33590]], [[63999, 63999], "mapped", [21050]], [[64e3, 64e3], "mapped", [20999]], [[64001, 64001], "mapped", [24230]], [[64002, 64002], "mapped", [25299]], [[64003, 64003], "mapped", [31958]], [[64004, 64004], "mapped", [23429]], [[64005, 64005], "mapped", [27934]], [[64006, 64006], "mapped", [26292]], [[64007, 64007], "mapped", [36667]], [[64008, 64008], "mapped", [34892]], [[64009, 64009], "mapped", [38477]], [[64010, 64010], "mapped", [35211]], [[64011, 64011], "mapped", [24275]], [[64012, 64012], "mapped", [20800]], [[64013, 64013], "mapped", [21952]], [[64014, 64015], "valid"], [[64016, 64016], "mapped", [22618]], [[64017, 64017], "valid"], [[64018, 64018], "mapped", [26228]], [[64019, 64020], "valid"], [[64021, 64021], "mapped", [20958]], [[64022, 64022], "mapped", [29482]], [[64023, 64023], "mapped", [30410]], [[64024, 64024], "mapped", [31036]], [[64025, 64025], "mapped", [31070]], [[64026, 64026], "mapped", [31077]], [[64027, 64027], "mapped", [31119]], [[64028, 64028], "mapped", [38742]], [[64029, 64029], "mapped", [31934]], [[64030, 64030], "mapped", [32701]], [[64031, 64031], "valid"], [[64032, 64032], "mapped", [34322]], [[64033, 64033], "valid"], [[64034, 64034], "mapped", [35576]], [[64035, 64036], "valid"], [[64037, 64037], "mapped", [36920]], [[64038, 64038], "mapped", [37117]], [[64039, 64041], "valid"], [[64042, 64042], "mapped", [39151]], [[64043, 64043], "mapped", [39164]], [[64044, 64044], "mapped", [39208]], [[64045, 64045], "mapped", [40372]], [[64046, 64046], "mapped", [37086]], [[64047, 64047], "mapped", [38583]], [[64048, 64048], "mapped", [20398]], [[64049, 64049], "mapped", [20711]], [[64050, 64050], "mapped", [20813]], [[64051, 64051], "mapped", [21193]], [[64052, 64052], "mapped", [21220]], [[64053, 64053], "mapped", [21329]], [[64054, 64054], "mapped", [21917]], [[64055, 64055], "mapped", [22022]], [[64056, 64056], "mapped", [22120]], [[64057, 64057], "mapped", [22592]], [[64058, 64058], "mapped", [22696]], [[64059, 64059], "mapped", [23652]], [[64060, 64060], "mapped", [23662]], [[64061, 64061], "mapped", [24724]], [[64062, 64062], "mapped", [24936]], [[64063, 64063], "mapped", [24974]], [[64064, 64064], "mapped", [25074]], [[64065, 64065], "mapped", [25935]], [[64066, 64066], "mapped", [26082]], [[64067, 64067], "mapped", [26257]], [[64068, 64068], "mapped", [26757]], [[64069, 64069], "mapped", [28023]], [[64070, 64070], "mapped", [28186]], [[64071, 64071], "mapped", [28450]], [[64072, 64072], "mapped", [29038]], [[64073, 64073], "mapped", [29227]], [[64074, 64074], "mapped", [29730]], [[64075, 64075], "mapped", [30865]], [[64076, 64076], "mapped", [31038]], [[64077, 64077], "mapped", [31049]], [[64078, 64078], "mapped", [31048]], [[64079, 64079], "mapped", [31056]], [[64080, 64080], "mapped", [31062]], [[64081, 64081], "mapped", [31069]], [[64082, 64082], "mapped", [31117]], [[64083, 64083], "mapped", [31118]], [[64084, 64084], "mapped", [31296]], [[64085, 64085], "mapped", [31361]], [[64086, 64086], "mapped", [31680]], [[64087, 64087], "mapped", [32244]], [[64088, 64088], "mapped", [32265]], [[64089, 64089], "mapped", [32321]], [[64090, 64090], "mapped", [32626]], [[64091, 64091], "mapped", [32773]], [[64092, 64092], "mapped", [33261]], [[64093, 64094], "mapped", [33401]], [[64095, 64095], "mapped", [33879]], [[64096, 64096], "mapped", [35088]], [[64097, 64097], "mapped", [35222]], [[64098, 64098], "mapped", [35585]], [[64099, 64099], "mapped", [35641]], [[64100, 64100], "mapped", [36051]], [[64101, 64101], "mapped", [36104]], [[64102, 64102], "mapped", [36790]], [[64103, 64103], "mapped", [36920]], [[64104, 64104], "mapped", [38627]], [[64105, 64105], "mapped", [38911]], [[64106, 64106], "mapped", [38971]], [[64107, 64107], "mapped", [24693]], [[64108, 64108], "mapped", [148206]], [[64109, 64109], "mapped", [33304]], [[64110, 64111], "disallowed"], [[64112, 64112], "mapped", [20006]], [[64113, 64113], "mapped", [20917]], [[64114, 64114], "mapped", [20840]], [[64115, 64115], "mapped", [20352]], [[64116, 64116], "mapped", [20805]], [[64117, 64117], "mapped", [20864]], [[64118, 64118], "mapped", [21191]], [[64119, 64119], "mapped", [21242]], [[64120, 64120], "mapped", [21917]], [[64121, 64121], "mapped", [21845]], [[64122, 64122], "mapped", [21913]], [[64123, 64123], "mapped", [21986]], [[64124, 64124], "mapped", [22618]], [[64125, 64125], "mapped", [22707]], [[64126, 64126], "mapped", [22852]], [[64127, 64127], "mapped", [22868]], [[64128, 64128], "mapped", [23138]], [[64129, 64129], "mapped", [23336]], [[64130, 64130], "mapped", [24274]], [[64131, 64131], "mapped", [24281]], [[64132, 64132], "mapped", [24425]], [[64133, 64133], "mapped", [24493]], [[64134, 64134], "mapped", [24792]], [[64135, 64135], "mapped", [24910]], [[64136, 64136], "mapped", [24840]], [[64137, 64137], "mapped", [24974]], [[64138, 64138], "mapped", [24928]], [[64139, 64139], "mapped", [25074]], [[64140, 64140], "mapped", [25140]], [[64141, 64141], "mapped", [25540]], [[64142, 64142], "mapped", [25628]], [[64143, 64143], "mapped", [25682]], [[64144, 64144], "mapped", [25942]], [[64145, 64145], "mapped", [26228]], [[64146, 64146], "mapped", [26391]], [[64147, 64147], "mapped", [26395]], [[64148, 64148], "mapped", [26454]], [[64149, 64149], "mapped", [27513]], [[64150, 64150], "mapped", [27578]], [[64151, 64151], "mapped", [27969]], [[64152, 64152], "mapped", [28379]], [[64153, 64153], "mapped", [28363]], [[64154, 64154], "mapped", [28450]], [[64155, 64155], "mapped", [28702]], [[64156, 64156], "mapped", [29038]], [[64157, 64157], "mapped", [30631]], [[64158, 64158], "mapped", [29237]], [[64159, 64159], "mapped", [29359]], [[64160, 64160], "mapped", [29482]], [[64161, 64161], "mapped", [29809]], [[64162, 64162], "mapped", [29958]], [[64163, 64163], "mapped", [30011]], [[64164, 64164], "mapped", [30237]], [[64165, 64165], "mapped", [30239]], [[64166, 64166], "mapped", [30410]], [[64167, 64167], "mapped", [30427]], [[64168, 64168], "mapped", [30452]], [[64169, 64169], "mapped", [30538]], [[64170, 64170], "mapped", [30528]], [[64171, 64171], "mapped", [30924]], [[64172, 64172], "mapped", [31409]], [[64173, 64173], "mapped", [31680]], [[64174, 64174], "mapped", [31867]], [[64175, 64175], "mapped", [32091]], [[64176, 64176], "mapped", [32244]], [[64177, 64177], "mapped", [32574]], [[64178, 64178], "mapped", [32773]], [[64179, 64179], "mapped", [33618]], [[64180, 64180], "mapped", [33775]], [[64181, 64181], "mapped", [34681]], [[64182, 64182], "mapped", [35137]], [[64183, 64183], "mapped", [35206]], [[64184, 64184], "mapped", [35222]], [[64185, 64185], "mapped", [35519]], [[64186, 64186], "mapped", [35576]], [[64187, 64187], "mapped", [35531]], [[64188, 64188], "mapped", [35585]], [[64189, 64189], "mapped", [35582]], [[64190, 64190], "mapped", [35565]], [[64191, 64191], "mapped", [35641]], [[64192, 64192], "mapped", [35722]], [[64193, 64193], "mapped", [36104]], [[64194, 64194], "mapped", [36664]], [[64195, 64195], "mapped", [36978]], [[64196, 64196], "mapped", [37273]], [[64197, 64197], "mapped", [37494]], [[64198, 64198], "mapped", [38524]], [[64199, 64199], "mapped", [38627]], [[64200, 64200], "mapped", [38742]], [[64201, 64201], "mapped", [38875]], [[64202, 64202], "mapped", [38911]], [[64203, 64203], "mapped", [38923]], [[64204, 64204], "mapped", [38971]], [[64205, 64205], "mapped", [39698]], [[64206, 64206], "mapped", [40860]], [[64207, 64207], "mapped", [141386]], [[64208, 64208], "mapped", [141380]], [[64209, 64209], "mapped", [144341]], [[64210, 64210], "mapped", [15261]], [[64211, 64211], "mapped", [16408]], [[64212, 64212], "mapped", [16441]], [[64213, 64213], "mapped", [152137]], [[64214, 64214], "mapped", [154832]], [[64215, 64215], "mapped", [163539]], [[64216, 64216], "mapped", [40771]], [[64217, 64217], "mapped", [40846]], [[64218, 64255], "disallowed"], [[64256, 64256], "mapped", [102, 102]], [[64257, 64257], "mapped", [102, 105]], [[64258, 64258], "mapped", [102, 108]], [[64259, 64259], "mapped", [102, 102, 105]], [[64260, 64260], "mapped", [102, 102, 108]], [[64261, 64262], "mapped", [115, 116]], [[64263, 64274], "disallowed"], [[64275, 64275], "mapped", [1396, 1398]], [[64276, 64276], "mapped", [1396, 1381]], [[64277, 64277], "mapped", [1396, 1387]], [[64278, 64278], "mapped", [1406, 1398]], [[64279, 64279], "mapped", [1396, 1389]], [[64280, 64284], "disallowed"], [[64285, 64285], "mapped", [1497, 1460]], [[64286, 64286], "valid"], [[64287, 64287], "mapped", [1522, 1463]], [[64288, 64288], "mapped", [1506]], [[64289, 64289], "mapped", [1488]], [[64290, 64290], "mapped", [1491]], [[64291, 64291], "mapped", [1492]], [[64292, 64292], "mapped", [1499]], [[64293, 64293], "mapped", [1500]], [[64294, 64294], "mapped", [1501]], [[64295, 64295], "mapped", [1512]], [[64296, 64296], "mapped", [1514]], [[64297, 64297], "disallowed_STD3_mapped", [43]], [[64298, 64298], "mapped", [1513, 1473]], [[64299, 64299], "mapped", [1513, 1474]], [[64300, 64300], "mapped", [1513, 1468, 1473]], [[64301, 64301], "mapped", [1513, 1468, 1474]], [[64302, 64302], "mapped", [1488, 1463]], [[64303, 64303], "mapped", [1488, 1464]], [[64304, 64304], "mapped", [1488, 1468]], [[64305, 64305], "mapped", [1489, 1468]], [[64306, 64306], "mapped", [1490, 1468]], [[64307, 64307], "mapped", [1491, 1468]], [[64308, 64308], "mapped", [1492, 1468]], [[64309, 64309], "mapped", [1493, 1468]], [[64310, 64310], "mapped", [1494, 1468]], [[64311, 64311], "disallowed"], [[64312, 64312], "mapped", [1496, 1468]], [[64313, 64313], "mapped", [1497, 1468]], [[64314, 64314], "mapped", [1498, 1468]], [[64315, 64315], "mapped", [1499, 1468]], [[64316, 64316], "mapped", [1500, 1468]], [[64317, 64317], "disallowed"], [[64318, 64318], "mapped", [1502, 1468]], [[64319, 64319], "disallowed"], [[64320, 64320], "mapped", [1504, 1468]], [[64321, 64321], "mapped", [1505, 1468]], [[64322, 64322], "disallowed"], [[64323, 64323], "mapped", [1507, 1468]], [[64324, 64324], "mapped", [1508, 1468]], [[64325, 64325], "disallowed"], [[64326, 64326], "mapped", [1510, 1468]], [[64327, 64327], "mapped", [1511, 1468]], [[64328, 64328], "mapped", [1512, 1468]], [[64329, 64329], "mapped", [1513, 1468]], [[64330, 64330], "mapped", [1514, 1468]], [[64331, 64331], "mapped", [1493, 1465]], [[64332, 64332], "mapped", [1489, 1471]], [[64333, 64333], "mapped", [1499, 1471]], [[64334, 64334], "mapped", [1508, 1471]], [[64335, 64335], "mapped", [1488, 1500]], [[64336, 64337], "mapped", [1649]], [[64338, 64341], "mapped", [1659]], [[64342, 64345], "mapped", [1662]], [[64346, 64349], "mapped", [1664]], [[64350, 64353], "mapped", [1658]], [[64354, 64357], "mapped", [1663]], [[64358, 64361], "mapped", [1657]], [[64362, 64365], "mapped", [1700]], [[64366, 64369], "mapped", [1702]], [[64370, 64373], "mapped", [1668]], [[64374, 64377], "mapped", [1667]], [[64378, 64381], "mapped", [1670]], [[64382, 64385], "mapped", [1671]], [[64386, 64387], "mapped", [1677]], [[64388, 64389], "mapped", [1676]], [[64390, 64391], "mapped", [1678]], [[64392, 64393], "mapped", [1672]], [[64394, 64395], "mapped", [1688]], [[64396, 64397], "mapped", [1681]], [[64398, 64401], "mapped", [1705]], [[64402, 64405], "mapped", [1711]], [[64406, 64409], "mapped", [1715]], [[64410, 64413], "mapped", [1713]], [[64414, 64415], "mapped", [1722]], [[64416, 64419], "mapped", [1723]], [[64420, 64421], "mapped", [1728]], [[64422, 64425], "mapped", [1729]], [[64426, 64429], "mapped", [1726]], [[64430, 64431], "mapped", [1746]], [[64432, 64433], "mapped", [1747]], [[64434, 64449], "valid", [], "NV8"], [[64450, 64466], "disallowed"], [[64467, 64470], "mapped", [1709]], [[64471, 64472], "mapped", [1735]], [[64473, 64474], "mapped", [1734]], [[64475, 64476], "mapped", [1736]], [[64477, 64477], "mapped", [1735, 1652]], [[64478, 64479], "mapped", [1739]], [[64480, 64481], "mapped", [1733]], [[64482, 64483], "mapped", [1737]], [[64484, 64487], "mapped", [1744]], [[64488, 64489], "mapped", [1609]], [[64490, 64491], "mapped", [1574, 1575]], [[64492, 64493], "mapped", [1574, 1749]], [[64494, 64495], "mapped", [1574, 1608]], [[64496, 64497], "mapped", [1574, 1735]], [[64498, 64499], "mapped", [1574, 1734]], [[64500, 64501], "mapped", [1574, 1736]], [[64502, 64504], "mapped", [1574, 1744]], [[64505, 64507], "mapped", [1574, 1609]], [[64508, 64511], "mapped", [1740]], [[64512, 64512], "mapped", [1574, 1580]], [[64513, 64513], "mapped", [1574, 1581]], [[64514, 64514], "mapped", [1574, 1605]], [[64515, 64515], "mapped", [1574, 1609]], [[64516, 64516], "mapped", [1574, 1610]], [[64517, 64517], "mapped", [1576, 1580]], [[64518, 64518], "mapped", [1576, 1581]], [[64519, 64519], "mapped", [1576, 1582]], [[64520, 64520], "mapped", [1576, 1605]], [[64521, 64521], "mapped", [1576, 1609]], [[64522, 64522], "mapped", [1576, 1610]], [[64523, 64523], "mapped", [1578, 1580]], [[64524, 64524], "mapped", [1578, 1581]], [[64525, 64525], "mapped", [1578, 1582]], [[64526, 64526], "mapped", [1578, 1605]], [[64527, 64527], "mapped", [1578, 1609]], [[64528, 64528], "mapped", [1578, 1610]], [[64529, 64529], "mapped", [1579, 1580]], [[64530, 64530], "mapped", [1579, 1605]], [[64531, 64531], "mapped", [1579, 1609]], [[64532, 64532], "mapped", [1579, 1610]], [[64533, 64533], "mapped", [1580, 1581]], [[64534, 64534], "mapped", [1580, 1605]], [[64535, 64535], "mapped", [1581, 1580]], [[64536, 64536], "mapped", [1581, 1605]], [[64537, 64537], "mapped", [1582, 1580]], [[64538, 64538], "mapped", [1582, 1581]], [[64539, 64539], "mapped", [1582, 1605]], [[64540, 64540], "mapped", [1587, 1580]], [[64541, 64541], "mapped", [1587, 1581]], [[64542, 64542], "mapped", [1587, 1582]], [[64543, 64543], "mapped", [1587, 1605]], [[64544, 64544], "mapped", [1589, 1581]], [[64545, 64545], "mapped", [1589, 1605]], [[64546, 64546], "mapped", [1590, 1580]], [[64547, 64547], "mapped", [1590, 1581]], [[64548, 64548], "mapped", [1590, 1582]], [[64549, 64549], "mapped", [1590, 1605]], [[64550, 64550], "mapped", [1591, 1581]], [[64551, 64551], "mapped", [1591, 1605]], [[64552, 64552], "mapped", [1592, 1605]], [[64553, 64553], "mapped", [1593, 1580]], [[64554, 64554], "mapped", [1593, 1605]], [[64555, 64555], "mapped", [1594, 1580]], [[64556, 64556], "mapped", [1594, 1605]], [[64557, 64557], "mapped", [1601, 1580]], [[64558, 64558], "mapped", [1601, 1581]], [[64559, 64559], "mapped", [1601, 1582]], [[64560, 64560], "mapped", [1601, 1605]], [[64561, 64561], "mapped", [1601, 1609]], [[64562, 64562], "mapped", [1601, 1610]], [[64563, 64563], "mapped", [1602, 1581]], [[64564, 64564], "mapped", [1602, 1605]], [[64565, 64565], "mapped", [1602, 1609]], [[64566, 64566], "mapped", [1602, 1610]], [[64567, 64567], "mapped", [1603, 1575]], [[64568, 64568], "mapped", [1603, 1580]], [[64569, 64569], "mapped", [1603, 1581]], [[64570, 64570], "mapped", [1603, 1582]], [[64571, 64571], "mapped", [1603, 1604]], [[64572, 64572], "mapped", [1603, 1605]], [[64573, 64573], "mapped", [1603, 1609]], [[64574, 64574], "mapped", [1603, 1610]], [[64575, 64575], "mapped", [1604, 1580]], [[64576, 64576], "mapped", [1604, 1581]], [[64577, 64577], "mapped", [1604, 1582]], [[64578, 64578], "mapped", [1604, 1605]], [[64579, 64579], "mapped", [1604, 1609]], [[64580, 64580], "mapped", [1604, 1610]], [[64581, 64581], "mapped", [1605, 1580]], [[64582, 64582], "mapped", [1605, 1581]], [[64583, 64583], "mapped", [1605, 1582]], [[64584, 64584], "mapped", [1605, 1605]], [[64585, 64585], "mapped", [1605, 1609]], [[64586, 64586], "mapped", [1605, 1610]], [[64587, 64587], "mapped", [1606, 1580]], [[64588, 64588], "mapped", [1606, 1581]], [[64589, 64589], "mapped", [1606, 1582]], [[64590, 64590], "mapped", [1606, 1605]], [[64591, 64591], "mapped", [1606, 1609]], [[64592, 64592], "mapped", [1606, 1610]], [[64593, 64593], "mapped", [1607, 1580]], [[64594, 64594], "mapped", [1607, 1605]], [[64595, 64595], "mapped", [1607, 1609]], [[64596, 64596], "mapped", [1607, 1610]], [[64597, 64597], "mapped", [1610, 1580]], [[64598, 64598], "mapped", [1610, 1581]], [[64599, 64599], "mapped", [1610, 1582]], [[64600, 64600], "mapped", [1610, 1605]], [[64601, 64601], "mapped", [1610, 1609]], [[64602, 64602], "mapped", [1610, 1610]], [[64603, 64603], "mapped", [1584, 1648]], [[64604, 64604], "mapped", [1585, 1648]], [[64605, 64605], "mapped", [1609, 1648]], [[64606, 64606], "disallowed_STD3_mapped", [32, 1612, 1617]], [[64607, 64607], "disallowed_STD3_mapped", [32, 1613, 1617]], [[64608, 64608], "disallowed_STD3_mapped", [32, 1614, 1617]], [[64609, 64609], "disallowed_STD3_mapped", [32, 1615, 1617]], [[64610, 64610], "disallowed_STD3_mapped", [32, 1616, 1617]], [[64611, 64611], "disallowed_STD3_mapped", [32, 1617, 1648]], [[64612, 64612], "mapped", [1574, 1585]], [[64613, 64613], "mapped", [1574, 1586]], [[64614, 64614], "mapped", [1574, 1605]], [[64615, 64615], "mapped", [1574, 1606]], [[64616, 64616], "mapped", [1574, 1609]], [[64617, 64617], "mapped", [1574, 1610]], [[64618, 64618], "mapped", [1576, 1585]], [[64619, 64619], "mapped", [1576, 1586]], [[64620, 64620], "mapped", [1576, 1605]], [[64621, 64621], "mapped", [1576, 1606]], [[64622, 64622], "mapped", [1576, 1609]], [[64623, 64623], "mapped", [1576, 1610]], [[64624, 64624], "mapped", [1578, 1585]], [[64625, 64625], "mapped", [1578, 1586]], [[64626, 64626], "mapped", [1578, 1605]], [[64627, 64627], "mapped", [1578, 1606]], [[64628, 64628], "mapped", [1578, 1609]], [[64629, 64629], "mapped", [1578, 1610]], [[64630, 64630], "mapped", [1579, 1585]], [[64631, 64631], "mapped", [1579, 1586]], [[64632, 64632], "mapped", [1579, 1605]], [[64633, 64633], "mapped", [1579, 1606]], [[64634, 64634], "mapped", [1579, 1609]], [[64635, 64635], "mapped", [1579, 1610]], [[64636, 64636], "mapped", [1601, 1609]], [[64637, 64637], "mapped", [1601, 1610]], [[64638, 64638], "mapped", [1602, 1609]], [[64639, 64639], "mapped", [1602, 1610]], [[64640, 64640], "mapped", [1603, 1575]], [[64641, 64641], "mapped", [1603, 1604]], [[64642, 64642], "mapped", [1603, 1605]], [[64643, 64643], "mapped", [1603, 1609]], [[64644, 64644], "mapped", [1603, 1610]], [[64645, 64645], "mapped", [1604, 1605]], [[64646, 64646], "mapped", [1604, 1609]], [[64647, 64647], "mapped", [1604, 1610]], [[64648, 64648], "mapped", [1605, 1575]], [[64649, 64649], "mapped", [1605, 1605]], [[64650, 64650], "mapped", [1606, 1585]], [[64651, 64651], "mapped", [1606, 1586]], [[64652, 64652], "mapped", [1606, 1605]], [[64653, 64653], "mapped", [1606, 1606]], [[64654, 64654], "mapped", [1606, 1609]], [[64655, 64655], "mapped", [1606, 1610]], [[64656, 64656], "mapped", [1609, 1648]], [[64657, 64657], "mapped", [1610, 1585]], [[64658, 64658], "mapped", [1610, 1586]], [[64659, 64659], "mapped", [1610, 1605]], [[64660, 64660], "mapped", [1610, 1606]], [[64661, 64661], "mapped", [1610, 1609]], [[64662, 64662], "mapped", [1610, 1610]], [[64663, 64663], "mapped", [1574, 1580]], [[64664, 64664], "mapped", [1574, 1581]], [[64665, 64665], "mapped", [1574, 1582]], [[64666, 64666], "mapped", [1574, 1605]], [[64667, 64667], "mapped", [1574, 1607]], [[64668, 64668], "mapped", [1576, 1580]], [[64669, 64669], "mapped", [1576, 1581]], [[64670, 64670], "mapped", [1576, 1582]], [[64671, 64671], "mapped", [1576, 1605]], [[64672, 64672], "mapped", [1576, 1607]], [[64673, 64673], "mapped", [1578, 1580]], [[64674, 64674], "mapped", [1578, 1581]], [[64675, 64675], "mapped", [1578, 1582]], [[64676, 64676], "mapped", [1578, 1605]], [[64677, 64677], "mapped", [1578, 1607]], [[64678, 64678], "mapped", [1579, 1605]], [[64679, 64679], "mapped", [1580, 1581]], [[64680, 64680], "mapped", [1580, 1605]], [[64681, 64681], "mapped", [1581, 1580]], [[64682, 64682], "mapped", [1581, 1605]], [[64683, 64683], "mapped", [1582, 1580]], [[64684, 64684], "mapped", [1582, 1605]], [[64685, 64685], "mapped", [1587, 1580]], [[64686, 64686], "mapped", [1587, 1581]], [[64687, 64687], "mapped", [1587, 1582]], [[64688, 64688], "mapped", [1587, 1605]], [[64689, 64689], "mapped", [1589, 1581]], [[64690, 64690], "mapped", [1589, 1582]], [[64691, 64691], "mapped", [1589, 1605]], [[64692, 64692], "mapped", [1590, 1580]], [[64693, 64693], "mapped", [1590, 1581]], [[64694, 64694], "mapped", [1590, 1582]], [[64695, 64695], "mapped", [1590, 1605]], [[64696, 64696], "mapped", [1591, 1581]], [[64697, 64697], "mapped", [1592, 1605]], [[64698, 64698], "mapped", [1593, 1580]], [[64699, 64699], "mapped", [1593, 1605]], [[64700, 64700], "mapped", [1594, 1580]], [[64701, 64701], "mapped", [1594, 1605]], [[64702, 64702], "mapped", [1601, 1580]], [[64703, 64703], "mapped", [1601, 1581]], [[64704, 64704], "mapped", [1601, 1582]], [[64705, 64705], "mapped", [1601, 1605]], [[64706, 64706], "mapped", [1602, 1581]], [[64707, 64707], "mapped", [1602, 1605]], [[64708, 64708], "mapped", [1603, 1580]], [[64709, 64709], "mapped", [1603, 1581]], [[64710, 64710], "mapped", [1603, 1582]], [[64711, 64711], "mapped", [1603, 1604]], [[64712, 64712], "mapped", [1603, 1605]], [[64713, 64713], "mapped", [1604, 1580]], [[64714, 64714], "mapped", [1604, 1581]], [[64715, 64715], "mapped", [1604, 1582]], [[64716, 64716], "mapped", [1604, 1605]], [[64717, 64717], "mapped", [1604, 1607]], [[64718, 64718], "mapped", [1605, 1580]], [[64719, 64719], "mapped", [1605, 1581]], [[64720, 64720], "mapped", [1605, 1582]], [[64721, 64721], "mapped", [1605, 1605]], [[64722, 64722], "mapped", [1606, 1580]], [[64723, 64723], "mapped", [1606, 1581]], [[64724, 64724], "mapped", [1606, 1582]], [[64725, 64725], "mapped", [1606, 1605]], [[64726, 64726], "mapped", [1606, 1607]], [[64727, 64727], "mapped", [1607, 1580]], [[64728, 64728], "mapped", [1607, 1605]], [[64729, 64729], "mapped", [1607, 1648]], [[64730, 64730], "mapped", [1610, 1580]], [[64731, 64731], "mapped", [1610, 1581]], [[64732, 64732], "mapped", [1610, 1582]], [[64733, 64733], "mapped", [1610, 1605]], [[64734, 64734], "mapped", [1610, 1607]], [[64735, 64735], "mapped", [1574, 1605]], [[64736, 64736], "mapped", [1574, 1607]], [[64737, 64737], "mapped", [1576, 1605]], [[64738, 64738], "mapped", [1576, 1607]], [[64739, 64739], "mapped", [1578, 1605]], [[64740, 64740], "mapped", [1578, 1607]], [[64741, 64741], "mapped", [1579, 1605]], [[64742, 64742], "mapped", [1579, 1607]], [[64743, 64743], "mapped", [1587, 1605]], [[64744, 64744], "mapped", [1587, 1607]], [[64745, 64745], "mapped", [1588, 1605]], [[64746, 64746], "mapped", [1588, 1607]], [[64747, 64747], "mapped", [1603, 1604]], [[64748, 64748], "mapped", [1603, 1605]], [[64749, 64749], "mapped", [1604, 1605]], [[64750, 64750], "mapped", [1606, 1605]], [[64751, 64751], "mapped", [1606, 1607]], [[64752, 64752], "mapped", [1610, 1605]], [[64753, 64753], "mapped", [1610, 1607]], [[64754, 64754], "mapped", [1600, 1614, 1617]], [[64755, 64755], "mapped", [1600, 1615, 1617]], [[64756, 64756], "mapped", [1600, 1616, 1617]], [[64757, 64757], "mapped", [1591, 1609]], [[64758, 64758], "mapped", [1591, 1610]], [[64759, 64759], "mapped", [1593, 1609]], [[64760, 64760], "mapped", [1593, 1610]], [[64761, 64761], "mapped", [1594, 1609]], [[64762, 64762], "mapped", [1594, 1610]], [[64763, 64763], "mapped", [1587, 1609]], [[64764, 64764], "mapped", [1587, 1610]], [[64765, 64765], "mapped", [1588, 1609]], [[64766, 64766], "mapped", [1588, 1610]], [[64767, 64767], "mapped", [1581, 1609]], [[64768, 64768], "mapped", [1581, 1610]], [[64769, 64769], "mapped", [1580, 1609]], [[64770, 64770], "mapped", [1580, 1610]], [[64771, 64771], "mapped", [1582, 1609]], [[64772, 64772], "mapped", [1582, 1610]], [[64773, 64773], "mapped", [1589, 1609]], [[64774, 64774], "mapped", [1589, 1610]], [[64775, 64775], "mapped", [1590, 1609]], [[64776, 64776], "mapped", [1590, 1610]], [[64777, 64777], "mapped", [1588, 1580]], [[64778, 64778], "mapped", [1588, 1581]], [[64779, 64779], "mapped", [1588, 1582]], [[64780, 64780], "mapped", [1588, 1605]], [[64781, 64781], "mapped", [1588, 1585]], [[64782, 64782], "mapped", [1587, 1585]], [[64783, 64783], "mapped", [1589, 1585]], [[64784, 64784], "mapped", [1590, 1585]], [[64785, 64785], "mapped", [1591, 1609]], [[64786, 64786], "mapped", [1591, 1610]], [[64787, 64787], "mapped", [1593, 1609]], [[64788, 64788], "mapped", [1593, 1610]], [[64789, 64789], "mapped", [1594, 1609]], [[64790, 64790], "mapped", [1594, 1610]], [[64791, 64791], "mapped", [1587, 1609]], [[64792, 64792], "mapped", [1587, 1610]], [[64793, 64793], "mapped", [1588, 1609]], [[64794, 64794], "mapped", [1588, 1610]], [[64795, 64795], "mapped", [1581, 1609]], [[64796, 64796], "mapped", [1581, 1610]], [[64797, 64797], "mapped", [1580, 1609]], [[64798, 64798], "mapped", [1580, 1610]], [[64799, 64799], "mapped", [1582, 1609]], [[64800, 64800], "mapped", [1582, 1610]], [[64801, 64801], "mapped", [1589, 1609]], [[64802, 64802], "mapped", [1589, 1610]], [[64803, 64803], "mapped", [1590, 1609]], [[64804, 64804], "mapped", [1590, 1610]], [[64805, 64805], "mapped", [1588, 1580]], [[64806, 64806], "mapped", [1588, 1581]], [[64807, 64807], "mapped", [1588, 1582]], [[64808, 64808], "mapped", [1588, 1605]], [[64809, 64809], "mapped", [1588, 1585]], [[64810, 64810], "mapped", [1587, 1585]], [[64811, 64811], "mapped", [1589, 1585]], [[64812, 64812], "mapped", [1590, 1585]], [[64813, 64813], "mapped", [1588, 1580]], [[64814, 64814], "mapped", [1588, 1581]], [[64815, 64815], "mapped", [1588, 1582]], [[64816, 64816], "mapped", [1588, 1605]], [[64817, 64817], "mapped", [1587, 1607]], [[64818, 64818], "mapped", [1588, 1607]], [[64819, 64819], "mapped", [1591, 1605]], [[64820, 64820], "mapped", [1587, 1580]], [[64821, 64821], "mapped", [1587, 1581]], [[64822, 64822], "mapped", [1587, 1582]], [[64823, 64823], "mapped", [1588, 1580]], [[64824, 64824], "mapped", [1588, 1581]], [[64825, 64825], "mapped", [1588, 1582]], [[64826, 64826], "mapped", [1591, 1605]], [[64827, 64827], "mapped", [1592, 1605]], [[64828, 64829], "mapped", [1575, 1611]], [[64830, 64831], "valid", [], "NV8"], [[64832, 64847], "disallowed"], [[64848, 64848], "mapped", [1578, 1580, 1605]], [[64849, 64850], "mapped", [1578, 1581, 1580]], [[64851, 64851], "mapped", [1578, 1581, 1605]], [[64852, 64852], "mapped", [1578, 1582, 1605]], [[64853, 64853], "mapped", [1578, 1605, 1580]], [[64854, 64854], "mapped", [1578, 1605, 1581]], [[64855, 64855], "mapped", [1578, 1605, 1582]], [[64856, 64857], "mapped", [1580, 1605, 1581]], [[64858, 64858], "mapped", [1581, 1605, 1610]], [[64859, 64859], "mapped", [1581, 1605, 1609]], [[64860, 64860], "mapped", [1587, 1581, 1580]], [[64861, 64861], "mapped", [1587, 1580, 1581]], [[64862, 64862], "mapped", [1587, 1580, 1609]], [[64863, 64864], "mapped", [1587, 1605, 1581]], [[64865, 64865], "mapped", [1587, 1605, 1580]], [[64866, 64867], "mapped", [1587, 1605, 1605]], [[64868, 64869], "mapped", [1589, 1581, 1581]], [[64870, 64870], "mapped", [1589, 1605, 1605]], [[64871, 64872], "mapped", [1588, 1581, 1605]], [[64873, 64873], "mapped", [1588, 1580, 1610]], [[64874, 64875], "mapped", [1588, 1605, 1582]], [[64876, 64877], "mapped", [1588, 1605, 1605]], [[64878, 64878], "mapped", [1590, 1581, 1609]], [[64879, 64880], "mapped", [1590, 1582, 1605]], [[64881, 64882], "mapped", [1591, 1605, 1581]], [[64883, 64883], "mapped", [1591, 1605, 1605]], [[64884, 64884], "mapped", [1591, 1605, 1610]], [[64885, 64885], "mapped", [1593, 1580, 1605]], [[64886, 64887], "mapped", [1593, 1605, 1605]], [[64888, 64888], "mapped", [1593, 1605, 1609]], [[64889, 64889], "mapped", [1594, 1605, 1605]], [[64890, 64890], "mapped", [1594, 1605, 1610]], [[64891, 64891], "mapped", [1594, 1605, 1609]], [[64892, 64893], "mapped", [1601, 1582, 1605]], [[64894, 64894], "mapped", [1602, 1605, 1581]], [[64895, 64895], "mapped", [1602, 1605, 1605]], [[64896, 64896], "mapped", [1604, 1581, 1605]], [[64897, 64897], "mapped", [1604, 1581, 1610]], [[64898, 64898], "mapped", [1604, 1581, 1609]], [[64899, 64900], "mapped", [1604, 1580, 1580]], [[64901, 64902], "mapped", [1604, 1582, 1605]], [[64903, 64904], "mapped", [1604, 1605, 1581]], [[64905, 64905], "mapped", [1605, 1581, 1580]], [[64906, 64906], "mapped", [1605, 1581, 1605]], [[64907, 64907], "mapped", [1605, 1581, 1610]], [[64908, 64908], "mapped", [1605, 1580, 1581]], [[64909, 64909], "mapped", [1605, 1580, 1605]], [[64910, 64910], "mapped", [1605, 1582, 1580]], [[64911, 64911], "mapped", [1605, 1582, 1605]], [[64912, 64913], "disallowed"], [[64914, 64914], "mapped", [1605, 1580, 1582]], [[64915, 64915], "mapped", [1607, 1605, 1580]], [[64916, 64916], "mapped", [1607, 1605, 1605]], [[64917, 64917], "mapped", [1606, 1581, 1605]], [[64918, 64918], "mapped", [1606, 1581, 1609]], [[64919, 64920], "mapped", [1606, 1580, 1605]], [[64921, 64921], "mapped", [1606, 1580, 1609]], [[64922, 64922], "mapped", [1606, 1605, 1610]], [[64923, 64923], "mapped", [1606, 1605, 1609]], [[64924, 64925], "mapped", [1610, 1605, 1605]], [[64926, 64926], "mapped", [1576, 1582, 1610]], [[64927, 64927], "mapped", [1578, 1580, 1610]], [[64928, 64928], "mapped", [1578, 1580, 1609]], [[64929, 64929], "mapped", [1578, 1582, 1610]], [[64930, 64930], "mapped", [1578, 1582, 1609]], [[64931, 64931], "mapped", [1578, 1605, 1610]], [[64932, 64932], "mapped", [1578, 1605, 1609]], [[64933, 64933], "mapped", [1580, 1605, 1610]], [[64934, 64934], "mapped", [1580, 1581, 1609]], [[64935, 64935], "mapped", [1580, 1605, 1609]], [[64936, 64936], "mapped", [1587, 1582, 1609]], [[64937, 64937], "mapped", [1589, 1581, 1610]], [[64938, 64938], "mapped", [1588, 1581, 1610]], [[64939, 64939], "mapped", [1590, 1581, 1610]], [[64940, 64940], "mapped", [1604, 1580, 1610]], [[64941, 64941], "mapped", [1604, 1605, 1610]], [[64942, 64942], "mapped", [1610, 1581, 1610]], [[64943, 64943], "mapped", [1610, 1580, 1610]], [[64944, 64944], "mapped", [1610, 1605, 1610]], [[64945, 64945], "mapped", [1605, 1605, 1610]], [[64946, 64946], "mapped", [1602, 1605, 1610]], [[64947, 64947], "mapped", [1606, 1581, 1610]], [[64948, 64948], "mapped", [1602, 1605, 1581]], [[64949, 64949], "mapped", [1604, 1581, 1605]], [[64950, 64950], "mapped", [1593, 1605, 1610]], [[64951, 64951], "mapped", [1603, 1605, 1610]], [[64952, 64952], "mapped", [1606, 1580, 1581]], [[64953, 64953], "mapped", [1605, 1582, 1610]], [[64954, 64954], "mapped", [1604, 1580, 1605]], [[64955, 64955], "mapped", [1603, 1605, 1605]], [[64956, 64956], "mapped", [1604, 1580, 1605]], [[64957, 64957], "mapped", [1606, 1580, 1581]], [[64958, 64958], "mapped", [1580, 1581, 1610]], [[64959, 64959], "mapped", [1581, 1580, 1610]], [[64960, 64960], "mapped", [1605, 1580, 1610]], [[64961, 64961], "mapped", [1601, 1605, 1610]], [[64962, 64962], "mapped", [1576, 1581, 1610]], [[64963, 64963], "mapped", [1603, 1605, 1605]], [[64964, 64964], "mapped", [1593, 1580, 1605]], [[64965, 64965], "mapped", [1589, 1605, 1605]], [[64966, 64966], "mapped", [1587, 1582, 1610]], [[64967, 64967], "mapped", [1606, 1580, 1610]], [[64968, 64975], "disallowed"], [[64976, 65007], "disallowed"], [[65008, 65008], "mapped", [1589, 1604, 1746]], [[65009, 65009], "mapped", [1602, 1604, 1746]], [[65010, 65010], "mapped", [1575, 1604, 1604, 1607]], [[65011, 65011], "mapped", [1575, 1603, 1576, 1585]], [[65012, 65012], "mapped", [1605, 1581, 1605, 1583]], [[65013, 65013], "mapped", [1589, 1604, 1593, 1605]], [[65014, 65014], "mapped", [1585, 1587, 1608, 1604]], [[65015, 65015], "mapped", [1593, 1604, 1610, 1607]], [[65016, 65016], "mapped", [1608, 1587, 1604, 1605]], [[65017, 65017], "mapped", [1589, 1604, 1609]], [[65018, 65018], "disallowed_STD3_mapped", [1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593, 1604, 1610, 1607, 32, 1608, 1587, 1604, 1605]], [[65019, 65019], "disallowed_STD3_mapped", [1580, 1604, 32, 1580, 1604, 1575, 1604, 1607]], [[65020, 65020], "mapped", [1585, 1740, 1575, 1604]], [[65021, 65021], "valid", [], "NV8"], [[65022, 65023], "disallowed"], [[65024, 65039], "ignored"], [[65040, 65040], "disallowed_STD3_mapped", [44]], [[65041, 65041], "mapped", [12289]], [[65042, 65042], "disallowed"], [[65043, 65043], "disallowed_STD3_mapped", [58]], [[65044, 65044], "disallowed_STD3_mapped", [59]], [[65045, 65045], "disallowed_STD3_mapped", [33]], [[65046, 65046], "disallowed_STD3_mapped", [63]], [[65047, 65047], "mapped", [12310]], [[65048, 65048], "mapped", [12311]], [[65049, 65049], "disallowed"], [[65050, 65055], "disallowed"], [[65056, 65059], "valid"], [[65060, 65062], "valid"], [[65063, 65069], "valid"], [[65070, 65071], "valid"], [[65072, 65072], "disallowed"], [[65073, 65073], "mapped", [8212]], [[65074, 65074], "mapped", [8211]], [[65075, 65076], "disallowed_STD3_mapped", [95]], [[65077, 65077], "disallowed_STD3_mapped", [40]], [[65078, 65078], "disallowed_STD3_mapped", [41]], [[65079, 65079], "disallowed_STD3_mapped", [123]], [[65080, 65080], "disallowed_STD3_mapped", [125]], [[65081, 65081], "mapped", [12308]], [[65082, 65082], "mapped", [12309]], [[65083, 65083], "mapped", [12304]], [[65084, 65084], "mapped", [12305]], [[65085, 65085], "mapped", [12298]], [[65086, 65086], "mapped", [12299]], [[65087, 65087], "mapped", [12296]], [[65088, 65088], "mapped", [12297]], [[65089, 65089], "mapped", [12300]], [[65090, 65090], "mapped", [12301]], [[65091, 65091], "mapped", [12302]], [[65092, 65092], "mapped", [12303]], [[65093, 65094], "valid", [], "NV8"], [[65095, 65095], "disallowed_STD3_mapped", [91]], [[65096, 65096], "disallowed_STD3_mapped", [93]], [[65097, 65100], "disallowed_STD3_mapped", [32, 773]], [[65101, 65103], "disallowed_STD3_mapped", [95]], [[65104, 65104], "disallowed_STD3_mapped", [44]], [[65105, 65105], "mapped", [12289]], [[65106, 65106], "disallowed"], [[65107, 65107], "disallowed"], [[65108, 65108], "disallowed_STD3_mapped", [59]], [[65109, 65109], "disallowed_STD3_mapped", [58]], [[65110, 65110], "disallowed_STD3_mapped", [63]], [[65111, 65111], "disallowed_STD3_mapped", [33]], [[65112, 65112], "mapped", [8212]], [[65113, 65113], "disallowed_STD3_mapped", [40]], [[65114, 65114], "disallowed_STD3_mapped", [41]], [[65115, 65115], "disallowed_STD3_mapped", [123]], [[65116, 65116], "disallowed_STD3_mapped", [125]], [[65117, 65117], "mapped", [12308]], [[65118, 65118], "mapped", [12309]], [[65119, 65119], "disallowed_STD3_mapped", [35]], [[65120, 65120], "disallowed_STD3_mapped", [38]], [[65121, 65121], "disallowed_STD3_mapped", [42]], [[65122, 65122], "disallowed_STD3_mapped", [43]], [[65123, 65123], "mapped", [45]], [[65124, 65124], "disallowed_STD3_mapped", [60]], [[65125, 65125], "disallowed_STD3_mapped", [62]], [[65126, 65126], "disallowed_STD3_mapped", [61]], [[65127, 65127], "disallowed"], [[65128, 65128], "disallowed_STD3_mapped", [92]], [[65129, 65129], "disallowed_STD3_mapped", [36]], [[65130, 65130], "disallowed_STD3_mapped", [37]], [[65131, 65131], "disallowed_STD3_mapped", [64]], [[65132, 65135], "disallowed"], [[65136, 65136], "disallowed_STD3_mapped", [32, 1611]], [[65137, 65137], "mapped", [1600, 1611]], [[65138, 65138], "disallowed_STD3_mapped", [32, 1612]], [[65139, 65139], "valid"], [[65140, 65140], "disallowed_STD3_mapped", [32, 1613]], [[65141, 65141], "disallowed"], [[65142, 65142], "disallowed_STD3_mapped", [32, 1614]], [[65143, 65143], "mapped", [1600, 1614]], [[65144, 65144], "disallowed_STD3_mapped", [32, 1615]], [[65145, 65145], "mapped", [1600, 1615]], [[65146, 65146], "disallowed_STD3_mapped", [32, 1616]], [[65147, 65147], "mapped", [1600, 1616]], [[65148, 65148], "disallowed_STD3_mapped", [32, 1617]], [[65149, 65149], "mapped", [1600, 1617]], [[65150, 65150], "disallowed_STD3_mapped", [32, 1618]], [[65151, 65151], "mapped", [1600, 1618]], [[65152, 65152], "mapped", [1569]], [[65153, 65154], "mapped", [1570]], [[65155, 65156], "mapped", [1571]], [[65157, 65158], "mapped", [1572]], [[65159, 65160], "mapped", [1573]], [[65161, 65164], "mapped", [1574]], [[65165, 65166], "mapped", [1575]], [[65167, 65170], "mapped", [1576]], [[65171, 65172], "mapped", [1577]], [[65173, 65176], "mapped", [1578]], [[65177, 65180], "mapped", [1579]], [[65181, 65184], "mapped", [1580]], [[65185, 65188], "mapped", [1581]], [[65189, 65192], "mapped", [1582]], [[65193, 65194], "mapped", [1583]], [[65195, 65196], "mapped", [1584]], [[65197, 65198], "mapped", [1585]], [[65199, 65200], "mapped", [1586]], [[65201, 65204], "mapped", [1587]], [[65205, 65208], "mapped", [1588]], [[65209, 65212], "mapped", [1589]], [[65213, 65216], "mapped", [1590]], [[65217, 65220], "mapped", [1591]], [[65221, 65224], "mapped", [1592]], [[65225, 65228], "mapped", [1593]], [[65229, 65232], "mapped", [1594]], [[65233, 65236], "mapped", [1601]], [[65237, 65240], "mapped", [1602]], [[65241, 65244], "mapped", [1603]], [[65245, 65248], "mapped", [1604]], [[65249, 65252], "mapped", [1605]], [[65253, 65256], "mapped", [1606]], [[65257, 65260], "mapped", [1607]], [[65261, 65262], "mapped", [1608]], [[65263, 65264], "mapped", [1609]], [[65265, 65268], "mapped", [1610]], [[65269, 65270], "mapped", [1604, 1570]], [[65271, 65272], "mapped", [1604, 1571]], [[65273, 65274], "mapped", [1604, 1573]], [[65275, 65276], "mapped", [1604, 1575]], [[65277, 65278], "disallowed"], [[65279, 65279], "ignored"], [[65280, 65280], "disallowed"], [[65281, 65281], "disallowed_STD3_mapped", [33]], [[65282, 65282], "disallowed_STD3_mapped", [34]], [[65283, 65283], "disallowed_STD3_mapped", [35]], [[65284, 65284], "disallowed_STD3_mapped", [36]], [[65285, 65285], "disallowed_STD3_mapped", [37]], [[65286, 65286], "disallowed_STD3_mapped", [38]], [[65287, 65287], "disallowed_STD3_mapped", [39]], [[65288, 65288], "disallowed_STD3_mapped", [40]], [[65289, 65289], "disallowed_STD3_mapped", [41]], [[65290, 65290], "disallowed_STD3_mapped", [42]], [[65291, 65291], "disallowed_STD3_mapped", [43]], [[65292, 65292], "disallowed_STD3_mapped", [44]], [[65293, 65293], "mapped", [45]], [[65294, 65294], "mapped", [46]], [[65295, 65295], "disallowed_STD3_mapped", [47]], [[65296, 65296], "mapped", [48]], [[65297, 65297], "mapped", [49]], [[65298, 65298], "mapped", [50]], [[65299, 65299], "mapped", [51]], [[65300, 65300], "mapped", [52]], [[65301, 65301], "mapped", [53]], [[65302, 65302], "mapped", [54]], [[65303, 65303], "mapped", [55]], [[65304, 65304], "mapped", [56]], [[65305, 65305], "mapped", [57]], [[65306, 65306], "disallowed_STD3_mapped", [58]], [[65307, 65307], "disallowed_STD3_mapped", [59]], [[65308, 65308], "disallowed_STD3_mapped", [60]], [[65309, 65309], "disallowed_STD3_mapped", [61]], [[65310, 65310], "disallowed_STD3_mapped", [62]], [[65311, 65311], "disallowed_STD3_mapped", [63]], [[65312, 65312], "disallowed_STD3_mapped", [64]], [[65313, 65313], "mapped", [97]], [[65314, 65314], "mapped", [98]], [[65315, 65315], "mapped", [99]], [[65316, 65316], "mapped", [100]], [[65317, 65317], "mapped", [101]], [[65318, 65318], "mapped", [102]], [[65319, 65319], "mapped", [103]], [[65320, 65320], "mapped", [104]], [[65321, 65321], "mapped", [105]], [[65322, 65322], "mapped", [106]], [[65323, 65323], "mapped", [107]], [[65324, 65324], "mapped", [108]], [[65325, 65325], "mapped", [109]], [[65326, 65326], "mapped", [110]], [[65327, 65327], "mapped", [111]], [[65328, 65328], "mapped", [112]], [[65329, 65329], "mapped", [113]], [[65330, 65330], "mapped", [114]], [[65331, 65331], "mapped", [115]], [[65332, 65332], "mapped", [116]], [[65333, 65333], "mapped", [117]], [[65334, 65334], "mapped", [118]], [[65335, 65335], "mapped", [119]], [[65336, 65336], "mapped", [120]], [[65337, 65337], "mapped", [121]], [[65338, 65338], "mapped", [122]], [[65339, 65339], "disallowed_STD3_mapped", [91]], [[65340, 65340], "disallowed_STD3_mapped", [92]], [[65341, 65341], "disallowed_STD3_mapped", [93]], [[65342, 65342], "disallowed_STD3_mapped", [94]], [[65343, 65343], "disallowed_STD3_mapped", [95]], [[65344, 65344], "disallowed_STD3_mapped", [96]], [[65345, 65345], "mapped", [97]], [[65346, 65346], "mapped", [98]], [[65347, 65347], "mapped", [99]], [[65348, 65348], "mapped", [100]], [[65349, 65349], "mapped", [101]], [[65350, 65350], "mapped", [102]], [[65351, 65351], "mapped", [103]], [[65352, 65352], "mapped", [104]], [[65353, 65353], "mapped", [105]], [[65354, 65354], "mapped", [106]], [[65355, 65355], "mapped", [107]], [[65356, 65356], "mapped", [108]], [[65357, 65357], "mapped", [109]], [[65358, 65358], "mapped", [110]], [[65359, 65359], "mapped", [111]], [[65360, 65360], "mapped", [112]], [[65361, 65361], "mapped", [113]], [[65362, 65362], "mapped", [114]], [[65363, 65363], "mapped", [115]], [[65364, 65364], "mapped", [116]], [[65365, 65365], "mapped", [117]], [[65366, 65366], "mapped", [118]], [[65367, 65367], "mapped", [119]], [[65368, 65368], "mapped", [120]], [[65369, 65369], "mapped", [121]], [[65370, 65370], "mapped", [122]], [[65371, 65371], "disallowed_STD3_mapped", [123]], [[65372, 65372], "disallowed_STD3_mapped", [124]], [[65373, 65373], "disallowed_STD3_mapped", [125]], [[65374, 65374], "disallowed_STD3_mapped", [126]], [[65375, 65375], "mapped", [10629]], [[65376, 65376], "mapped", [10630]], [[65377, 65377], "mapped", [46]], [[65378, 65378], "mapped", [12300]], [[65379, 65379], "mapped", [12301]], [[65380, 65380], "mapped", [12289]], [[65381, 65381], "mapped", [12539]], [[65382, 65382], "mapped", [12530]], [[65383, 65383], "mapped", [12449]], [[65384, 65384], "mapped", [12451]], [[65385, 65385], "mapped", [12453]], [[65386, 65386], "mapped", [12455]], [[65387, 65387], "mapped", [12457]], [[65388, 65388], "mapped", [12515]], [[65389, 65389], "mapped", [12517]], [[65390, 65390], "mapped", [12519]], [[65391, 65391], "mapped", [12483]], [[65392, 65392], "mapped", [12540]], [[65393, 65393], "mapped", [12450]], [[65394, 65394], "mapped", [12452]], [[65395, 65395], "mapped", [12454]], [[65396, 65396], "mapped", [12456]], [[65397, 65397], "mapped", [12458]], [[65398, 65398], "mapped", [12459]], [[65399, 65399], "mapped", [12461]], [[65400, 65400], "mapped", [12463]], [[65401, 65401], "mapped", [12465]], [[65402, 65402], "mapped", [12467]], [[65403, 65403], "mapped", [12469]], [[65404, 65404], "mapped", [12471]], [[65405, 65405], "mapped", [12473]], [[65406, 65406], "mapped", [12475]], [[65407, 65407], "mapped", [12477]], [[65408, 65408], "mapped", [12479]], [[65409, 65409], "mapped", [12481]], [[65410, 65410], "mapped", [12484]], [[65411, 65411], "mapped", [12486]], [[65412, 65412], "mapped", [12488]], [[65413, 65413], "mapped", [12490]], [[65414, 65414], "mapped", [12491]], [[65415, 65415], "mapped", [12492]], [[65416, 65416], "mapped", [12493]], [[65417, 65417], "mapped", [12494]], [[65418, 65418], "mapped", [12495]], [[65419, 65419], "mapped", [12498]], [[65420, 65420], "mapped", [12501]], [[65421, 65421], "mapped", [12504]], [[65422, 65422], "mapped", [12507]], [[65423, 65423], "mapped", [12510]], [[65424, 65424], "mapped", [12511]], [[65425, 65425], "mapped", [12512]], [[65426, 65426], "mapped", [12513]], [[65427, 65427], "mapped", [12514]], [[65428, 65428], "mapped", [12516]], [[65429, 65429], "mapped", [12518]], [[65430, 65430], "mapped", [12520]], [[65431, 65431], "mapped", [12521]], [[65432, 65432], "mapped", [12522]], [[65433, 65433], "mapped", [12523]], [[65434, 65434], "mapped", [12524]], [[65435, 65435], "mapped", [12525]], [[65436, 65436], "mapped", [12527]], [[65437, 65437], "mapped", [12531]], [[65438, 65438], "mapped", [12441]], [[65439, 65439], "mapped", [12442]], [[65440, 65440], "disallowed"], [[65441, 65441], "mapped", [4352]], [[65442, 65442], "mapped", [4353]], [[65443, 65443], "mapped", [4522]], [[65444, 65444], "mapped", [4354]], [[65445, 65445], "mapped", [4524]], [[65446, 65446], "mapped", [4525]], [[65447, 65447], "mapped", [4355]], [[65448, 65448], "mapped", [4356]], [[65449, 65449], "mapped", [4357]], [[65450, 65450], "mapped", [4528]], [[65451, 65451], "mapped", [4529]], [[65452, 65452], "mapped", [4530]], [[65453, 65453], "mapped", [4531]], [[65454, 65454], "mapped", [4532]], [[65455, 65455], "mapped", [4533]], [[65456, 65456], "mapped", [4378]], [[65457, 65457], "mapped", [4358]], [[65458, 65458], "mapped", [4359]], [[65459, 65459], "mapped", [4360]], [[65460, 65460], "mapped", [4385]], [[65461, 65461], "mapped", [4361]], [[65462, 65462], "mapped", [4362]], [[65463, 65463], "mapped", [4363]], [[65464, 65464], "mapped", [4364]], [[65465, 65465], "mapped", [4365]], [[65466, 65466], "mapped", [4366]], [[65467, 65467], "mapped", [4367]], [[65468, 65468], "mapped", [4368]], [[65469, 65469], "mapped", [4369]], [[65470, 65470], "mapped", [4370]], [[65471, 65473], "disallowed"], [[65474, 65474], "mapped", [4449]], [[65475, 65475], "mapped", [4450]], [[65476, 65476], "mapped", [4451]], [[65477, 65477], "mapped", [4452]], [[65478, 65478], "mapped", [4453]], [[65479, 65479], "mapped", [4454]], [[65480, 65481], "disallowed"], [[65482, 65482], "mapped", [4455]], [[65483, 65483], "mapped", [4456]], [[65484, 65484], "mapped", [4457]], [[65485, 65485], "mapped", [4458]], [[65486, 65486], "mapped", [4459]], [[65487, 65487], "mapped", [4460]], [[65488, 65489], "disallowed"], [[65490, 65490], "mapped", [4461]], [[65491, 65491], "mapped", [4462]], [[65492, 65492], "mapped", [4463]], [[65493, 65493], "mapped", [4464]], [[65494, 65494], "mapped", [4465]], [[65495, 65495], "mapped", [4466]], [[65496, 65497], "disallowed"], [[65498, 65498], "mapped", [4467]], [[65499, 65499], "mapped", [4468]], [[65500, 65500], "mapped", [4469]], [[65501, 65503], "disallowed"], [[65504, 65504], "mapped", [162]], [[65505, 65505], "mapped", [163]], [[65506, 65506], "mapped", [172]], [[65507, 65507], "disallowed_STD3_mapped", [32, 772]], [[65508, 65508], "mapped", [166]], [[65509, 65509], "mapped", [165]], [[65510, 65510], "mapped", [8361]], [[65511, 65511], "disallowed"], [[65512, 65512], "mapped", [9474]], [[65513, 65513], "mapped", [8592]], [[65514, 65514], "mapped", [8593]], [[65515, 65515], "mapped", [8594]], [[65516, 65516], "mapped", [8595]], [[65517, 65517], "mapped", [9632]], [[65518, 65518], "mapped", [9675]], [[65519, 65528], "disallowed"], [[65529, 65531], "disallowed"], [[65532, 65532], "disallowed"], [[65533, 65533], "disallowed"], [[65534, 65535], "disallowed"], [[65536, 65547], "valid"], [[65548, 65548], "disallowed"], [[65549, 65574], "valid"], [[65575, 65575], "disallowed"], [[65576, 65594], "valid"], [[65595, 65595], "disallowed"], [[65596, 65597], "valid"], [[65598, 65598], "disallowed"], [[65599, 65613], "valid"], [[65614, 65615], "disallowed"], [[65616, 65629], "valid"], [[65630, 65663], "disallowed"], [[65664, 65786], "valid"], [[65787, 65791], "disallowed"], [[65792, 65794], "valid", [], "NV8"], [[65795, 65798], "disallowed"], [[65799, 65843], "valid", [], "NV8"], [[65844, 65846], "disallowed"], [[65847, 65855], "valid", [], "NV8"], [[65856, 65930], "valid", [], "NV8"], [[65931, 65932], "valid", [], "NV8"], [[65933, 65935], "disallowed"], [[65936, 65947], "valid", [], "NV8"], [[65948, 65951], "disallowed"], [[65952, 65952], "valid", [], "NV8"], [[65953, 65999], "disallowed"], [[66e3, 66044], "valid", [], "NV8"], [[66045, 66045], "valid"], [[66046, 66175], "disallowed"], [[66176, 66204], "valid"], [[66205, 66207], "disallowed"], [[66208, 66256], "valid"], [[66257, 66271], "disallowed"], [[66272, 66272], "valid"], [[66273, 66299], "valid", [], "NV8"], [[66300, 66303], "disallowed"], [[66304, 66334], "valid"], [[66335, 66335], "valid"], [[66336, 66339], "valid", [], "NV8"], [[66340, 66351], "disallowed"], [[66352, 66368], "valid"], [[66369, 66369], "valid", [], "NV8"], [[66370, 66377], "valid"], [[66378, 66378], "valid", [], "NV8"], [[66379, 66383], "disallowed"], [[66384, 66426], "valid"], [[66427, 66431], "disallowed"], [[66432, 66461], "valid"], [[66462, 66462], "disallowed"], [[66463, 66463], "valid", [], "NV8"], [[66464, 66499], "valid"], [[66500, 66503], "disallowed"], [[66504, 66511], "valid"], [[66512, 66517], "valid", [], "NV8"], [[66518, 66559], "disallowed"], [[66560, 66560], "mapped", [66600]], [[66561, 66561], "mapped", [66601]], [[66562, 66562], "mapped", [66602]], [[66563, 66563], "mapped", [66603]], [[66564, 66564], "mapped", [66604]], [[66565, 66565], "mapped", [66605]], [[66566, 66566], "mapped", [66606]], [[66567, 66567], "mapped", [66607]], [[66568, 66568], "mapped", [66608]], [[66569, 66569], "mapped", [66609]], [[66570, 66570], "mapped", [66610]], [[66571, 66571], "mapped", [66611]], [[66572, 66572], "mapped", [66612]], [[66573, 66573], "mapped", [66613]], [[66574, 66574], "mapped", [66614]], [[66575, 66575], "mapped", [66615]], [[66576, 66576], "mapped", [66616]], [[66577, 66577], "mapped", [66617]], [[66578, 66578], "mapped", [66618]], [[66579, 66579], "mapped", [66619]], [[66580, 66580], "mapped", [66620]], [[66581, 66581], "mapped", [66621]], [[66582, 66582], "mapped", [66622]], [[66583, 66583], "mapped", [66623]], [[66584, 66584], "mapped", [66624]], [[66585, 66585], "mapped", [66625]], [[66586, 66586], "mapped", [66626]], [[66587, 66587], "mapped", [66627]], [[66588, 66588], "mapped", [66628]], [[66589, 66589], "mapped", [66629]], [[66590, 66590], "mapped", [66630]], [[66591, 66591], "mapped", [66631]], [[66592, 66592], "mapped", [66632]], [[66593, 66593], "mapped", [66633]], [[66594, 66594], "mapped", [66634]], [[66595, 66595], "mapped", [66635]], [[66596, 66596], "mapped", [66636]], [[66597, 66597], "mapped", [66637]], [[66598, 66598], "mapped", [66638]], [[66599, 66599], "mapped", [66639]], [[66600, 66637], "valid"], [[66638, 66717], "valid"], [[66718, 66719], "disallowed"], [[66720, 66729], "valid"], [[66730, 66815], "disallowed"], [[66816, 66855], "valid"], [[66856, 66863], "disallowed"], [[66864, 66915], "valid"], [[66916, 66926], "disallowed"], [[66927, 66927], "valid", [], "NV8"], [[66928, 67071], "disallowed"], [[67072, 67382], "valid"], [[67383, 67391], "disallowed"], [[67392, 67413], "valid"], [[67414, 67423], "disallowed"], [[67424, 67431], "valid"], [[67432, 67583], "disallowed"], [[67584, 67589], "valid"], [[67590, 67591], "disallowed"], [[67592, 67592], "valid"], [[67593, 67593], "disallowed"], [[67594, 67637], "valid"], [[67638, 67638], "disallowed"], [[67639, 67640], "valid"], [[67641, 67643], "disallowed"], [[67644, 67644], "valid"], [[67645, 67646], "disallowed"], [[67647, 67647], "valid"], [[67648, 67669], "valid"], [[67670, 67670], "disallowed"], [[67671, 67679], "valid", [], "NV8"], [[67680, 67702], "valid"], [[67703, 67711], "valid", [], "NV8"], [[67712, 67742], "valid"], [[67743, 67750], "disallowed"], [[67751, 67759], "valid", [], "NV8"], [[67760, 67807], "disallowed"], [[67808, 67826], "valid"], [[67827, 67827], "disallowed"], [[67828, 67829], "valid"], [[67830, 67834], "disallowed"], [[67835, 67839], "valid", [], "NV8"], [[67840, 67861], "valid"], [[67862, 67865], "valid", [], "NV8"], [[67866, 67867], "valid", [], "NV8"], [[67868, 67870], "disallowed"], [[67871, 67871], "valid", [], "NV8"], [[67872, 67897], "valid"], [[67898, 67902], "disallowed"], [[67903, 67903], "valid", [], "NV8"], [[67904, 67967], "disallowed"], [[67968, 68023], "valid"], [[68024, 68027], "disallowed"], [[68028, 68029], "valid", [], "NV8"], [[68030, 68031], "valid"], [[68032, 68047], "valid", [], "NV8"], [[68048, 68049], "disallowed"], [[68050, 68095], "valid", [], "NV8"], [[68096, 68099], "valid"], [[68100, 68100], "disallowed"], [[68101, 68102], "valid"], [[68103, 68107], "disallowed"], [[68108, 68115], "valid"], [[68116, 68116], "disallowed"], [[68117, 68119], "valid"], [[68120, 68120], "disallowed"], [[68121, 68147], "valid"], [[68148, 68151], "disallowed"], [[68152, 68154], "valid"], [[68155, 68158], "disallowed"], [[68159, 68159], "valid"], [[68160, 68167], "valid", [], "NV8"], [[68168, 68175], "disallowed"], [[68176, 68184], "valid", [], "NV8"], [[68185, 68191], "disallowed"], [[68192, 68220], "valid"], [[68221, 68223], "valid", [], "NV8"], [[68224, 68252], "valid"], [[68253, 68255], "valid", [], "NV8"], [[68256, 68287], "disallowed"], [[68288, 68295], "valid"], [[68296, 68296], "valid", [], "NV8"], [[68297, 68326], "valid"], [[68327, 68330], "disallowed"], [[68331, 68342], "valid", [], "NV8"], [[68343, 68351], "disallowed"], [[68352, 68405], "valid"], [[68406, 68408], "disallowed"], [[68409, 68415], "valid", [], "NV8"], [[68416, 68437], "valid"], [[68438, 68439], "disallowed"], [[68440, 68447], "valid", [], "NV8"], [[68448, 68466], "valid"], [[68467, 68471], "disallowed"], [[68472, 68479], "valid", [], "NV8"], [[68480, 68497], "valid"], [[68498, 68504], "disallowed"], [[68505, 68508], "valid", [], "NV8"], [[68509, 68520], "disallowed"], [[68521, 68527], "valid", [], "NV8"], [[68528, 68607], "disallowed"], [[68608, 68680], "valid"], [[68681, 68735], "disallowed"], [[68736, 68736], "mapped", [68800]], [[68737, 68737], "mapped", [68801]], [[68738, 68738], "mapped", [68802]], [[68739, 68739], "mapped", [68803]], [[68740, 68740], "mapped", [68804]], [[68741, 68741], "mapped", [68805]], [[68742, 68742], "mapped", [68806]], [[68743, 68743], "mapped", [68807]], [[68744, 68744], "mapped", [68808]], [[68745, 68745], "mapped", [68809]], [[68746, 68746], "mapped", [68810]], [[68747, 68747], "mapped", [68811]], [[68748, 68748], "mapped", [68812]], [[68749, 68749], "mapped", [68813]], [[68750, 68750], "mapped", [68814]], [[68751, 68751], "mapped", [68815]], [[68752, 68752], "mapped", [68816]], [[68753, 68753], "mapped", [68817]], [[68754, 68754], "mapped", [68818]], [[68755, 68755], "mapped", [68819]], [[68756, 68756], "mapped", [68820]], [[68757, 68757], "mapped", [68821]], [[68758, 68758], "mapped", [68822]], [[68759, 68759], "mapped", [68823]], [[68760, 68760], "mapped", [68824]], [[68761, 68761], "mapped", [68825]], [[68762, 68762], "mapped", [68826]], [[68763, 68763], "mapped", [68827]], [[68764, 68764], "mapped", [68828]], [[68765, 68765], "mapped", [68829]], [[68766, 68766], "mapped", [68830]], [[68767, 68767], "mapped", [68831]], [[68768, 68768], "mapped", [68832]], [[68769, 68769], "mapped", [68833]], [[68770, 68770], "mapped", [68834]], [[68771, 68771], "mapped", [68835]], [[68772, 68772], "mapped", [68836]], [[68773, 68773], "mapped", [68837]], [[68774, 68774], "mapped", [68838]], [[68775, 68775], "mapped", [68839]], [[68776, 68776], "mapped", [68840]], [[68777, 68777], "mapped", [68841]], [[68778, 68778], "mapped", [68842]], [[68779, 68779], "mapped", [68843]], [[68780, 68780], "mapped", [68844]], [[68781, 68781], "mapped", [68845]], [[68782, 68782], "mapped", [68846]], [[68783, 68783], "mapped", [68847]], [[68784, 68784], "mapped", [68848]], [[68785, 68785], "mapped", [68849]], [[68786, 68786], "mapped", [68850]], [[68787, 68799], "disallowed"], [[68800, 68850], "valid"], [[68851, 68857], "disallowed"], [[68858, 68863], "valid", [], "NV8"], [[68864, 69215], "disallowed"], [[69216, 69246], "valid", [], "NV8"], [[69247, 69631], "disallowed"], [[69632, 69702], "valid"], [[69703, 69709], "valid", [], "NV8"], [[69710, 69713], "disallowed"], [[69714, 69733], "valid", [], "NV8"], [[69734, 69743], "valid"], [[69744, 69758], "disallowed"], [[69759, 69759], "valid"], [[69760, 69818], "valid"], [[69819, 69820], "valid", [], "NV8"], [[69821, 69821], "disallowed"], [[69822, 69825], "valid", [], "NV8"], [[69826, 69839], "disallowed"], [[69840, 69864], "valid"], [[69865, 69871], "disallowed"], [[69872, 69881], "valid"], [[69882, 69887], "disallowed"], [[69888, 69940], "valid"], [[69941, 69941], "disallowed"], [[69942, 69951], "valid"], [[69952, 69955], "valid", [], "NV8"], [[69956, 69967], "disallowed"], [[69968, 70003], "valid"], [[70004, 70005], "valid", [], "NV8"], [[70006, 70006], "valid"], [[70007, 70015], "disallowed"], [[70016, 70084], "valid"], [[70085, 70088], "valid", [], "NV8"], [[70089, 70089], "valid", [], "NV8"], [[70090, 70092], "valid"], [[70093, 70093], "valid", [], "NV8"], [[70094, 70095], "disallowed"], [[70096, 70105], "valid"], [[70106, 70106], "valid"], [[70107, 70107], "valid", [], "NV8"], [[70108, 70108], "valid"], [[70109, 70111], "valid", [], "NV8"], [[70112, 70112], "disallowed"], [[70113, 70132], "valid", [], "NV8"], [[70133, 70143], "disallowed"], [[70144, 70161], "valid"], [[70162, 70162], "disallowed"], [[70163, 70199], "valid"], [[70200, 70205], "valid", [], "NV8"], [[70206, 70271], "disallowed"], [[70272, 70278], "valid"], [[70279, 70279], "disallowed"], [[70280, 70280], "valid"], [[70281, 70281], "disallowed"], [[70282, 70285], "valid"], [[70286, 70286], "disallowed"], [[70287, 70301], "valid"], [[70302, 70302], "disallowed"], [[70303, 70312], "valid"], [[70313, 70313], "valid", [], "NV8"], [[70314, 70319], "disallowed"], [[70320, 70378], "valid"], [[70379, 70383], "disallowed"], [[70384, 70393], "valid"], [[70394, 70399], "disallowed"], [[70400, 70400], "valid"], [[70401, 70403], "valid"], [[70404, 70404], "disallowed"], [[70405, 70412], "valid"], [[70413, 70414], "disallowed"], [[70415, 70416], "valid"], [[70417, 70418], "disallowed"], [[70419, 70440], "valid"], [[70441, 70441], "disallowed"], [[70442, 70448], "valid"], [[70449, 70449], "disallowed"], [[70450, 70451], "valid"], [[70452, 70452], "disallowed"], [[70453, 70457], "valid"], [[70458, 70459], "disallowed"], [[70460, 70468], "valid"], [[70469, 70470], "disallowed"], [[70471, 70472], "valid"], [[70473, 70474], "disallowed"], [[70475, 70477], "valid"], [[70478, 70479], "disallowed"], [[70480, 70480], "valid"], [[70481, 70486], "disallowed"], [[70487, 70487], "valid"], [[70488, 70492], "disallowed"], [[70493, 70499], "valid"], [[70500, 70501], "disallowed"], [[70502, 70508], "valid"], [[70509, 70511], "disallowed"], [[70512, 70516], "valid"], [[70517, 70783], "disallowed"], [[70784, 70853], "valid"], [[70854, 70854], "valid", [], "NV8"], [[70855, 70855], "valid"], [[70856, 70863], "disallowed"], [[70864, 70873], "valid"], [[70874, 71039], "disallowed"], [[71040, 71093], "valid"], [[71094, 71095], "disallowed"], [[71096, 71104], "valid"], [[71105, 71113], "valid", [], "NV8"], [[71114, 71127], "valid", [], "NV8"], [[71128, 71133], "valid"], [[71134, 71167], "disallowed"], [[71168, 71232], "valid"], [[71233, 71235], "valid", [], "NV8"], [[71236, 71236], "valid"], [[71237, 71247], "disallowed"], [[71248, 71257], "valid"], [[71258, 71295], "disallowed"], [[71296, 71351], "valid"], [[71352, 71359], "disallowed"], [[71360, 71369], "valid"], [[71370, 71423], "disallowed"], [[71424, 71449], "valid"], [[71450, 71452], "disallowed"], [[71453, 71467], "valid"], [[71468, 71471], "disallowed"], [[71472, 71481], "valid"], [[71482, 71487], "valid", [], "NV8"], [[71488, 71839], "disallowed"], [[71840, 71840], "mapped", [71872]], [[71841, 71841], "mapped", [71873]], [[71842, 71842], "mapped", [71874]], [[71843, 71843], "mapped", [71875]], [[71844, 71844], "mapped", [71876]], [[71845, 71845], "mapped", [71877]], [[71846, 71846], "mapped", [71878]], [[71847, 71847], "mapped", [71879]], [[71848, 71848], "mapped", [71880]], [[71849, 71849], "mapped", [71881]], [[71850, 71850], "mapped", [71882]], [[71851, 71851], "mapped", [71883]], [[71852, 71852], "mapped", [71884]], [[71853, 71853], "mapped", [71885]], [[71854, 71854], "mapped", [71886]], [[71855, 71855], "mapped", [71887]], [[71856, 71856], "mapped", [71888]], [[71857, 71857], "mapped", [71889]], [[71858, 71858], "mapped", [71890]], [[71859, 71859], "mapped", [71891]], [[71860, 71860], "mapped", [71892]], [[71861, 71861], "mapped", [71893]], [[71862, 71862], "mapped", [71894]], [[71863, 71863], "mapped", [71895]], [[71864, 71864], "mapped", [71896]], [[71865, 71865], "mapped", [71897]], [[71866, 71866], "mapped", [71898]], [[71867, 71867], "mapped", [71899]], [[71868, 71868], "mapped", [71900]], [[71869, 71869], "mapped", [71901]], [[71870, 71870], "mapped", [71902]], [[71871, 71871], "mapped", [71903]], [[71872, 71913], "valid"], [[71914, 71922], "valid", [], "NV8"], [[71923, 71934], "disallowed"], [[71935, 71935], "valid"], [[71936, 72383], "disallowed"], [[72384, 72440], "valid"], [[72441, 73727], "disallowed"], [[73728, 74606], "valid"], [[74607, 74648], "valid"], [[74649, 74649], "valid"], [[74650, 74751], "disallowed"], [[74752, 74850], "valid", [], "NV8"], [[74851, 74862], "valid", [], "NV8"], [[74863, 74863], "disallowed"], [[74864, 74867], "valid", [], "NV8"], [[74868, 74868], "valid", [], "NV8"], [[74869, 74879], "disallowed"], [[74880, 75075], "valid"], [[75076, 77823], "disallowed"], [[77824, 78894], "valid"], [[78895, 82943], "disallowed"], [[82944, 83526], "valid"], [[83527, 92159], "disallowed"], [[92160, 92728], "valid"], [[92729, 92735], "disallowed"], [[92736, 92766], "valid"], [[92767, 92767], "disallowed"], [[92768, 92777], "valid"], [[92778, 92781], "disallowed"], [[92782, 92783], "valid", [], "NV8"], [[92784, 92879], "disallowed"], [[92880, 92909], "valid"], [[92910, 92911], "disallowed"], [[92912, 92916], "valid"], [[92917, 92917], "valid", [], "NV8"], [[92918, 92927], "disallowed"], [[92928, 92982], "valid"], [[92983, 92991], "valid", [], "NV8"], [[92992, 92995], "valid"], [[92996, 92997], "valid", [], "NV8"], [[92998, 93007], "disallowed"], [[93008, 93017], "valid"], [[93018, 93018], "disallowed"], [[93019, 93025], "valid", [], "NV8"], [[93026, 93026], "disallowed"], [[93027, 93047], "valid"], [[93048, 93052], "disallowed"], [[93053, 93071], "valid"], [[93072, 93951], "disallowed"], [[93952, 94020], "valid"], [[94021, 94031], "disallowed"], [[94032, 94078], "valid"], [[94079, 94094], "disallowed"], [[94095, 94111], "valid"], [[94112, 110591], "disallowed"], [[110592, 110593], "valid"], [[110594, 113663], "disallowed"], [[113664, 113770], "valid"], [[113771, 113775], "disallowed"], [[113776, 113788], "valid"], [[113789, 113791], "disallowed"], [[113792, 113800], "valid"], [[113801, 113807], "disallowed"], [[113808, 113817], "valid"], [[113818, 113819], "disallowed"], [[113820, 113820], "valid", [], "NV8"], [[113821, 113822], "valid"], [[113823, 113823], "valid", [], "NV8"], [[113824, 113827], "ignored"], [[113828, 118783], "disallowed"], [[118784, 119029], "valid", [], "NV8"], [[119030, 119039], "disallowed"], [[119040, 119078], "valid", [], "NV8"], [[119079, 119080], "disallowed"], [[119081, 119081], "valid", [], "NV8"], [[119082, 119133], "valid", [], "NV8"], [[119134, 119134], "mapped", [119127, 119141]], [[119135, 119135], "mapped", [119128, 119141]], [[119136, 119136], "mapped", [119128, 119141, 119150]], [[119137, 119137], "mapped", [119128, 119141, 119151]], [[119138, 119138], "mapped", [119128, 119141, 119152]], [[119139, 119139], "mapped", [119128, 119141, 119153]], [[119140, 119140], "mapped", [119128, 119141, 119154]], [[119141, 119154], "valid", [], "NV8"], [[119155, 119162], "disallowed"], [[119163, 119226], "valid", [], "NV8"], [[119227, 119227], "mapped", [119225, 119141]], [[119228, 119228], "mapped", [119226, 119141]], [[119229, 119229], "mapped", [119225, 119141, 119150]], [[119230, 119230], "mapped", [119226, 119141, 119150]], [[119231, 119231], "mapped", [119225, 119141, 119151]], [[119232, 119232], "mapped", [119226, 119141, 119151]], [[119233, 119261], "valid", [], "NV8"], [[119262, 119272], "valid", [], "NV8"], [[119273, 119295], "disallowed"], [[119296, 119365], "valid", [], "NV8"], [[119366, 119551], "disallowed"], [[119552, 119638], "valid", [], "NV8"], [[119639, 119647], "disallowed"], [[119648, 119665], "valid", [], "NV8"], [[119666, 119807], "disallowed"], [[119808, 119808], "mapped", [97]], [[119809, 119809], "mapped", [98]], [[119810, 119810], "mapped", [99]], [[119811, 119811], "mapped", [100]], [[119812, 119812], "mapped", [101]], [[119813, 119813], "mapped", [102]], [[119814, 119814], "mapped", [103]], [[119815, 119815], "mapped", [104]], [[119816, 119816], "mapped", [105]], [[119817, 119817], "mapped", [106]], [[119818, 119818], "mapped", [107]], [[119819, 119819], "mapped", [108]], [[119820, 119820], "mapped", [109]], [[119821, 119821], "mapped", [110]], [[119822, 119822], "mapped", [111]], [[119823, 119823], "mapped", [112]], [[119824, 119824], "mapped", [113]], [[119825, 119825], "mapped", [114]], [[119826, 119826], "mapped", [115]], [[119827, 119827], "mapped", [116]], [[119828, 119828], "mapped", [117]], [[119829, 119829], "mapped", [118]], [[119830, 119830], "mapped", [119]], [[119831, 119831], "mapped", [120]], [[119832, 119832], "mapped", [121]], [[119833, 119833], "mapped", [122]], [[119834, 119834], "mapped", [97]], [[119835, 119835], "mapped", [98]], [[119836, 119836], "mapped", [99]], [[119837, 119837], "mapped", [100]], [[119838, 119838], "mapped", [101]], [[119839, 119839], "mapped", [102]], [[119840, 119840], "mapped", [103]], [[119841, 119841], "mapped", [104]], [[119842, 119842], "mapped", [105]], [[119843, 119843], "mapped", [106]], [[119844, 119844], "mapped", [107]], [[119845, 119845], "mapped", [108]], [[119846, 119846], "mapped", [109]], [[119847, 119847], "mapped", [110]], [[119848, 119848], "mapped", [111]], [[119849, 119849], "mapped", [112]], [[119850, 119850], "mapped", [113]], [[119851, 119851], "mapped", [114]], [[119852, 119852], "mapped", [115]], [[119853, 119853], "mapped", [116]], [[119854, 119854], "mapped", [117]], [[119855, 119855], "mapped", [118]], [[119856, 119856], "mapped", [119]], [[119857, 119857], "mapped", [120]], [[119858, 119858], "mapped", [121]], [[119859, 119859], "mapped", [122]], [[119860, 119860], "mapped", [97]], [[119861, 119861], "mapped", [98]], [[119862, 119862], "mapped", [99]], [[119863, 119863], "mapped", [100]], [[119864, 119864], "mapped", [101]], [[119865, 119865], "mapped", [102]], [[119866, 119866], "mapped", [103]], [[119867, 119867], "mapped", [104]], [[119868, 119868], "mapped", [105]], [[119869, 119869], "mapped", [106]], [[119870, 119870], "mapped", [107]], [[119871, 119871], "mapped", [108]], [[119872, 119872], "mapped", [109]], [[119873, 119873], "mapped", [110]], [[119874, 119874], "mapped", [111]], [[119875, 119875], "mapped", [112]], [[119876, 119876], "mapped", [113]], [[119877, 119877], "mapped", [114]], [[119878, 119878], "mapped", [115]], [[119879, 119879], "mapped", [116]], [[119880, 119880], "mapped", [117]], [[119881, 119881], "mapped", [118]], [[119882, 119882], "mapped", [119]], [[119883, 119883], "mapped", [120]], [[119884, 119884], "mapped", [121]], [[119885, 119885], "mapped", [122]], [[119886, 119886], "mapped", [97]], [[119887, 119887], "mapped", [98]], [[119888, 119888], "mapped", [99]], [[119889, 119889], "mapped", [100]], [[119890, 119890], "mapped", [101]], [[119891, 119891], "mapped", [102]], [[119892, 119892], "mapped", [103]], [[119893, 119893], "disallowed"], [[119894, 119894], "mapped", [105]], [[119895, 119895], "mapped", [106]], [[119896, 119896], "mapped", [107]], [[119897, 119897], "mapped", [108]], [[119898, 119898], "mapped", [109]], [[119899, 119899], "mapped", [110]], [[119900, 119900], "mapped", [111]], [[119901, 119901], "mapped", [112]], [[119902, 119902], "mapped", [113]], [[119903, 119903], "mapped", [114]], [[119904, 119904], "mapped", [115]], [[119905, 119905], "mapped", [116]], [[119906, 119906], "mapped", [117]], [[119907, 119907], "mapped", [118]], [[119908, 119908], "mapped", [119]], [[119909, 119909], "mapped", [120]], [[119910, 119910], "mapped", [121]], [[119911, 119911], "mapped", [122]], [[119912, 119912], "mapped", [97]], [[119913, 119913], "mapped", [98]], [[119914, 119914], "mapped", [99]], [[119915, 119915], "mapped", [100]], [[119916, 119916], "mapped", [101]], [[119917, 119917], "mapped", [102]], [[119918, 119918], "mapped", [103]], [[119919, 119919], "mapped", [104]], [[119920, 119920], "mapped", [105]], [[119921, 119921], "mapped", [106]], [[119922, 119922], "mapped", [107]], [[119923, 119923], "mapped", [108]], [[119924, 119924], "mapped", [109]], [[119925, 119925], "mapped", [110]], [[119926, 119926], "mapped", [111]], [[119927, 119927], "mapped", [112]], [[119928, 119928], "mapped", [113]], [[119929, 119929], "mapped", [114]], [[119930, 119930], "mapped", [115]], [[119931, 119931], "mapped", [116]], [[119932, 119932], "mapped", [117]], [[119933, 119933], "mapped", [118]], [[119934, 119934], "mapped", [119]], [[119935, 119935], "mapped", [120]], [[119936, 119936], "mapped", [121]], [[119937, 119937], "mapped", [122]], [[119938, 119938], "mapped", [97]], [[119939, 119939], "mapped", [98]], [[119940, 119940], "mapped", [99]], [[119941, 119941], "mapped", [100]], [[119942, 119942], "mapped", [101]], [[119943, 119943], "mapped", [102]], [[119944, 119944], "mapped", [103]], [[119945, 119945], "mapped", [104]], [[119946, 119946], "mapped", [105]], [[119947, 119947], "mapped", [106]], [[119948, 119948], "mapped", [107]], [[119949, 119949], "mapped", [108]], [[119950, 119950], "mapped", [109]], [[119951, 119951], "mapped", [110]], [[119952, 119952], "mapped", [111]], [[119953, 119953], "mapped", [112]], [[119954, 119954], "mapped", [113]], [[119955, 119955], "mapped", [114]], [[119956, 119956], "mapped", [115]], [[119957, 119957], "mapped", [116]], [[119958, 119958], "mapped", [117]], [[119959, 119959], "mapped", [118]], [[119960, 119960], "mapped", [119]], [[119961, 119961], "mapped", [120]], [[119962, 119962], "mapped", [121]], [[119963, 119963], "mapped", [122]], [[119964, 119964], "mapped", [97]], [[119965, 119965], "disallowed"], [[119966, 119966], "mapped", [99]], [[119967, 119967], "mapped", [100]], [[119968, 119969], "disallowed"], [[119970, 119970], "mapped", [103]], [[119971, 119972], "disallowed"], [[119973, 119973], "mapped", [106]], [[119974, 119974], "mapped", [107]], [[119975, 119976], "disallowed"], [[119977, 119977], "mapped", [110]], [[119978, 119978], "mapped", [111]], [[119979, 119979], "mapped", [112]], [[119980, 119980], "mapped", [113]], [[119981, 119981], "disallowed"], [[119982, 119982], "mapped", [115]], [[119983, 119983], "mapped", [116]], [[119984, 119984], "mapped", [117]], [[119985, 119985], "mapped", [118]], [[119986, 119986], "mapped", [119]], [[119987, 119987], "mapped", [120]], [[119988, 119988], "mapped", [121]], [[119989, 119989], "mapped", [122]], [[119990, 119990], "mapped", [97]], [[119991, 119991], "mapped", [98]], [[119992, 119992], "mapped", [99]], [[119993, 119993], "mapped", [100]], [[119994, 119994], "disallowed"], [[119995, 119995], "mapped", [102]], [[119996, 119996], "disallowed"], [[119997, 119997], "mapped", [104]], [[119998, 119998], "mapped", [105]], [[119999, 119999], "mapped", [106]], [[12e4, 12e4], "mapped", [107]], [[120001, 120001], "mapped", [108]], [[120002, 120002], "mapped", [109]], [[120003, 120003], "mapped", [110]], [[120004, 120004], "disallowed"], [[120005, 120005], "mapped", [112]], [[120006, 120006], "mapped", [113]], [[120007, 120007], "mapped", [114]], [[120008, 120008], "mapped", [115]], [[120009, 120009], "mapped", [116]], [[120010, 120010], "mapped", [117]], [[120011, 120011], "mapped", [118]], [[120012, 120012], "mapped", [119]], [[120013, 120013], "mapped", [120]], [[120014, 120014], "mapped", [121]], [[120015, 120015], "mapped", [122]], [[120016, 120016], "mapped", [97]], [[120017, 120017], "mapped", [98]], [[120018, 120018], "mapped", [99]], [[120019, 120019], "mapped", [100]], [[120020, 120020], "mapped", [101]], [[120021, 120021], "mapped", [102]], [[120022, 120022], "mapped", [103]], [[120023, 120023], "mapped", [104]], [[120024, 120024], "mapped", [105]], [[120025, 120025], "mapped", [106]], [[120026, 120026], "mapped", [107]], [[120027, 120027], "mapped", [108]], [[120028, 120028], "mapped", [109]], [[120029, 120029], "mapped", [110]], [[120030, 120030], "mapped", [111]], [[120031, 120031], "mapped", [112]], [[120032, 120032], "mapped", [113]], [[120033, 120033], "mapped", [114]], [[120034, 120034], "mapped", [115]], [[120035, 120035], "mapped", [116]], [[120036, 120036], "mapped", [117]], [[120037, 120037], "mapped", [118]], [[120038, 120038], "mapped", [119]], [[120039, 120039], "mapped", [120]], [[120040, 120040], "mapped", [121]], [[120041, 120041], "mapped", [122]], [[120042, 120042], "mapped", [97]], [[120043, 120043], "mapped", [98]], [[120044, 120044], "mapped", [99]], [[120045, 120045], "mapped", [100]], [[120046, 120046], "mapped", [101]], [[120047, 120047], "mapped", [102]], [[120048, 120048], "mapped", [103]], [[120049, 120049], "mapped", [104]], [[120050, 120050], "mapped", [105]], [[120051, 120051], "mapped", [106]], [[120052, 120052], "mapped", [107]], [[120053, 120053], "mapped", [108]], [[120054, 120054], "mapped", [109]], [[120055, 120055], "mapped", [110]], [[120056, 120056], "mapped", [111]], [[120057, 120057], "mapped", [112]], [[120058, 120058], "mapped", [113]], [[120059, 120059], "mapped", [114]], [[120060, 120060], "mapped", [115]], [[120061, 120061], "mapped", [116]], [[120062, 120062], "mapped", [117]], [[120063, 120063], "mapped", [118]], [[120064, 120064], "mapped", [119]], [[120065, 120065], "mapped", [120]], [[120066, 120066], "mapped", [121]], [[120067, 120067], "mapped", [122]], [[120068, 120068], "mapped", [97]], [[120069, 120069], "mapped", [98]], [[120070, 120070], "disallowed"], [[120071, 120071], "mapped", [100]], [[120072, 120072], "mapped", [101]], [[120073, 120073], "mapped", [102]], [[120074, 120074], "mapped", [103]], [[120075, 120076], "disallowed"], [[120077, 120077], "mapped", [106]], [[120078, 120078], "mapped", [107]], [[120079, 120079], "mapped", [108]], [[120080, 120080], "mapped", [109]], [[120081, 120081], "mapped", [110]], [[120082, 120082], "mapped", [111]], [[120083, 120083], "mapped", [112]], [[120084, 120084], "mapped", [113]], [[120085, 120085], "disallowed"], [[120086, 120086], "mapped", [115]], [[120087, 120087], "mapped", [116]], [[120088, 120088], "mapped", [117]], [[120089, 120089], "mapped", [118]], [[120090, 120090], "mapped", [119]], [[120091, 120091], "mapped", [120]], [[120092, 120092], "mapped", [121]], [[120093, 120093], "disallowed"], [[120094, 120094], "mapped", [97]], [[120095, 120095], "mapped", [98]], [[120096, 120096], "mapped", [99]], [[120097, 120097], "mapped", [100]], [[120098, 120098], "mapped", [101]], [[120099, 120099], "mapped", [102]], [[120100, 120100], "mapped", [103]], [[120101, 120101], "mapped", [104]], [[120102, 120102], "mapped", [105]], [[120103, 120103], "mapped", [106]], [[120104, 120104], "mapped", [107]], [[120105, 120105], "mapped", [108]], [[120106, 120106], "mapped", [109]], [[120107, 120107], "mapped", [110]], [[120108, 120108], "mapped", [111]], [[120109, 120109], "mapped", [112]], [[120110, 120110], "mapped", [113]], [[120111, 120111], "mapped", [114]], [[120112, 120112], "mapped", [115]], [[120113, 120113], "mapped", [116]], [[120114, 120114], "mapped", [117]], [[120115, 120115], "mapped", [118]], [[120116, 120116], "mapped", [119]], [[120117, 120117], "mapped", [120]], [[120118, 120118], "mapped", [121]], [[120119, 120119], "mapped", [122]], [[120120, 120120], "mapped", [97]], [[120121, 120121], "mapped", [98]], [[120122, 120122], "disallowed"], [[120123, 120123], "mapped", [100]], [[120124, 120124], "mapped", [101]], [[120125, 120125], "mapped", [102]], [[120126, 120126], "mapped", [103]], [[120127, 120127], "disallowed"], [[120128, 120128], "mapped", [105]], [[120129, 120129], "mapped", [106]], [[120130, 120130], "mapped", [107]], [[120131, 120131], "mapped", [108]], [[120132, 120132], "mapped", [109]], [[120133, 120133], "disallowed"], [[120134, 120134], "mapped", [111]], [[120135, 120137], "disallowed"], [[120138, 120138], "mapped", [115]], [[120139, 120139], "mapped", [116]], [[120140, 120140], "mapped", [117]], [[120141, 120141], "mapped", [118]], [[120142, 120142], "mapped", [119]], [[120143, 120143], "mapped", [120]], [[120144, 120144], "mapped", [121]], [[120145, 120145], "disallowed"], [[120146, 120146], "mapped", [97]], [[120147, 120147], "mapped", [98]], [[120148, 120148], "mapped", [99]], [[120149, 120149], "mapped", [100]], [[120150, 120150], "mapped", [101]], [[120151, 120151], "mapped", [102]], [[120152, 120152], "mapped", [103]], [[120153, 120153], "mapped", [104]], [[120154, 120154], "mapped", [105]], [[120155, 120155], "mapped", [106]], [[120156, 120156], "mapped", [107]], [[120157, 120157], "mapped", [108]], [[120158, 120158], "mapped", [109]], [[120159, 120159], "mapped", [110]], [[120160, 120160], "mapped", [111]], [[120161, 120161], "mapped", [112]], [[120162, 120162], "mapped", [113]], [[120163, 120163], "mapped", [114]], [[120164, 120164], "mapped", [115]], [[120165, 120165], "mapped", [116]], [[120166, 120166], "mapped", [117]], [[120167, 120167], "mapped", [118]], [[120168, 120168], "mapped", [119]], [[120169, 120169], "mapped", [120]], [[120170, 120170], "mapped", [121]], [[120171, 120171], "mapped", [122]], [[120172, 120172], "mapped", [97]], [[120173, 120173], "mapped", [98]], [[120174, 120174], "mapped", [99]], [[120175, 120175], "mapped", [100]], [[120176, 120176], "mapped", [101]], [[120177, 120177], "mapped", [102]], [[120178, 120178], "mapped", [103]], [[120179, 120179], "mapped", [104]], [[120180, 120180], "mapped", [105]], [[120181, 120181], "mapped", [106]], [[120182, 120182], "mapped", [107]], [[120183, 120183], "mapped", [108]], [[120184, 120184], "mapped", [109]], [[120185, 120185], "mapped", [110]], [[120186, 120186], "mapped", [111]], [[120187, 120187], "mapped", [112]], [[120188, 120188], "mapped", [113]], [[120189, 120189], "mapped", [114]], [[120190, 120190], "mapped", [115]], [[120191, 120191], "mapped", [116]], [[120192, 120192], "mapped", [117]], [[120193, 120193], "mapped", [118]], [[120194, 120194], "mapped", [119]], [[120195, 120195], "mapped", [120]], [[120196, 120196], "mapped", [121]], [[120197, 120197], "mapped", [122]], [[120198, 120198], "mapped", [97]], [[120199, 120199], "mapped", [98]], [[120200, 120200], "mapped", [99]], [[120201, 120201], "mapped", [100]], [[120202, 120202], "mapped", [101]], [[120203, 120203], "mapped", [102]], [[120204, 120204], "mapped", [103]], [[120205, 120205], "mapped", [104]], [[120206, 120206], "mapped", [105]], [[120207, 120207], "mapped", [106]], [[120208, 120208], "mapped", [107]], [[120209, 120209], "mapped", [108]], [[120210, 120210], "mapped", [109]], [[120211, 120211], "mapped", [110]], [[120212, 120212], "mapped", [111]], [[120213, 120213], "mapped", [112]], [[120214, 120214], "mapped", [113]], [[120215, 120215], "mapped", [114]], [[120216, 120216], "mapped", [115]], [[120217, 120217], "mapped", [116]], [[120218, 120218], "mapped", [117]], [[120219, 120219], "mapped", [118]], [[120220, 120220], "mapped", [119]], [[120221, 120221], "mapped", [120]], [[120222, 120222], "mapped", [121]], [[120223, 120223], "mapped", [122]], [[120224, 120224], "mapped", [97]], [[120225, 120225], "mapped", [98]], [[120226, 120226], "mapped", [99]], [[120227, 120227], "mapped", [100]], [[120228, 120228], "mapped", [101]], [[120229, 120229], "mapped", [102]], [[120230, 120230], "mapped", [103]], [[120231, 120231], "mapped", [104]], [[120232, 120232], "mapped", [105]], [[120233, 120233], "mapped", [106]], [[120234, 120234], "mapped", [107]], [[120235, 120235], "mapped", [108]], [[120236, 120236], "mapped", [109]], [[120237, 120237], "mapped", [110]], [[120238, 120238], "mapped", [111]], [[120239, 120239], "mapped", [112]], [[120240, 120240], "mapped", [113]], [[120241, 120241], "mapped", [114]], [[120242, 120242], "mapped", [115]], [[120243, 120243], "mapped", [116]], [[120244, 120244], "mapped", [117]], [[120245, 120245], "mapped", [118]], [[120246, 120246], "mapped", [119]], [[120247, 120247], "mapped", [120]], [[120248, 120248], "mapped", [121]], [[120249, 120249], "mapped", [122]], [[120250, 120250], "mapped", [97]], [[120251, 120251], "mapped", [98]], [[120252, 120252], "mapped", [99]], [[120253, 120253], "mapped", [100]], [[120254, 120254], "mapped", [101]], [[120255, 120255], "mapped", [102]], [[120256, 120256], "mapped", [103]], [[120257, 120257], "mapped", [104]], [[120258, 120258], "mapped", [105]], [[120259, 120259], "mapped", [106]], [[120260, 120260], "mapped", [107]], [[120261, 120261], "mapped", [108]], [[120262, 120262], "mapped", [109]], [[120263, 120263], "mapped", [110]], [[120264, 120264], "mapped", [111]], [[120265, 120265], "mapped", [112]], [[120266, 120266], "mapped", [113]], [[120267, 120267], "mapped", [114]], [[120268, 120268], "mapped", [115]], [[120269, 120269], "mapped", [116]], [[120270, 120270], "mapped", [117]], [[120271, 120271], "mapped", [118]], [[120272, 120272], "mapped", [119]], [[120273, 120273], "mapped", [120]], [[120274, 120274], "mapped", [121]], [[120275, 120275], "mapped", [122]], [[120276, 120276], "mapped", [97]], [[120277, 120277], "mapped", [98]], [[120278, 120278], "mapped", [99]], [[120279, 120279], "mapped", [100]], [[120280, 120280], "mapped", [101]], [[120281, 120281], "mapped", [102]], [[120282, 120282], "mapped", [103]], [[120283, 120283], "mapped", [104]], [[120284, 120284], "mapped", [105]], [[120285, 120285], "mapped", [106]], [[120286, 120286], "mapped", [107]], [[120287, 120287], "mapped", [108]], [[120288, 120288], "mapped", [109]], [[120289, 120289], "mapped", [110]], [[120290, 120290], "mapped", [111]], [[120291, 120291], "mapped", [112]], [[120292, 120292], "mapped", [113]], [[120293, 120293], "mapped", [114]], [[120294, 120294], "mapped", [115]], [[120295, 120295], "mapped", [116]], [[120296, 120296], "mapped", [117]], [[120297, 120297], "mapped", [118]], [[120298, 120298], "mapped", [119]], [[120299, 120299], "mapped", [120]], [[120300, 120300], "mapped", [121]], [[120301, 120301], "mapped", [122]], [[120302, 120302], "mapped", [97]], [[120303, 120303], "mapped", [98]], [[120304, 120304], "mapped", [99]], [[120305, 120305], "mapped", [100]], [[120306, 120306], "mapped", [101]], [[120307, 120307], "mapped", [102]], [[120308, 120308], "mapped", [103]], [[120309, 120309], "mapped", [104]], [[120310, 120310], "mapped", [105]], [[120311, 120311], "mapped", [106]], [[120312, 120312], "mapped", [107]], [[120313, 120313], "mapped", [108]], [[120314, 120314], "mapped", [109]], [[120315, 120315], "mapped", [110]], [[120316, 120316], "mapped", [111]], [[120317, 120317], "mapped", [112]], [[120318, 120318], "mapped", [113]], [[120319, 120319], "mapped", [114]], [[120320, 120320], "mapped", [115]], [[120321, 120321], "mapped", [116]], [[120322, 120322], "mapped", [117]], [[120323, 120323], "mapped", [118]], [[120324, 120324], "mapped", [119]], [[120325, 120325], "mapped", [120]], [[120326, 120326], "mapped", [121]], [[120327, 120327], "mapped", [122]], [[120328, 120328], "mapped", [97]], [[120329, 120329], "mapped", [98]], [[120330, 120330], "mapped", [99]], [[120331, 120331], "mapped", [100]], [[120332, 120332], "mapped", [101]], [[120333, 120333], "mapped", [102]], [[120334, 120334], "mapped", [103]], [[120335, 120335], "mapped", [104]], [[120336, 120336], "mapped", [105]], [[120337, 120337], "mapped", [106]], [[120338, 120338], "mapped", [107]], [[120339, 120339], "mapped", [108]], [[120340, 120340], "mapped", [109]], [[120341, 120341], "mapped", [110]], [[120342, 120342], "mapped", [111]], [[120343, 120343], "mapped", [112]], [[120344, 120344], "mapped", [113]], [[120345, 120345], "mapped", [114]], [[120346, 120346], "mapped", [115]], [[120347, 120347], "mapped", [116]], [[120348, 120348], "mapped", [117]], [[120349, 120349], "mapped", [118]], [[120350, 120350], "mapped", [119]], [[120351, 120351], "mapped", [120]], [[120352, 120352], "mapped", [121]], [[120353, 120353], "mapped", [122]], [[120354, 120354], "mapped", [97]], [[120355, 120355], "mapped", [98]], [[120356, 120356], "mapped", [99]], [[120357, 120357], "mapped", [100]], [[120358, 120358], "mapped", [101]], [[120359, 120359], "mapped", [102]], [[120360, 120360], "mapped", [103]], [[120361, 120361], "mapped", [104]], [[120362, 120362], "mapped", [105]], [[120363, 120363], "mapped", [106]], [[120364, 120364], "mapped", [107]], [[120365, 120365], "mapped", [108]], [[120366, 120366], "mapped", [109]], [[120367, 120367], "mapped", [110]], [[120368, 120368], "mapped", [111]], [[120369, 120369], "mapped", [112]], [[120370, 120370], "mapped", [113]], [[120371, 120371], "mapped", [114]], [[120372, 120372], "mapped", [115]], [[120373, 120373], "mapped", [116]], [[120374, 120374], "mapped", [117]], [[120375, 120375], "mapped", [118]], [[120376, 120376], "mapped", [119]], [[120377, 120377], "mapped", [120]], [[120378, 120378], "mapped", [121]], [[120379, 120379], "mapped", [122]], [[120380, 120380], "mapped", [97]], [[120381, 120381], "mapped", [98]], [[120382, 120382], "mapped", [99]], [[120383, 120383], "mapped", [100]], [[120384, 120384], "mapped", [101]], [[120385, 120385], "mapped", [102]], [[120386, 120386], "mapped", [103]], [[120387, 120387], "mapped", [104]], [[120388, 120388], "mapped", [105]], [[120389, 120389], "mapped", [106]], [[120390, 120390], "mapped", [107]], [[120391, 120391], "mapped", [108]], [[120392, 120392], "mapped", [109]], [[120393, 120393], "mapped", [110]], [[120394, 120394], "mapped", [111]], [[120395, 120395], "mapped", [112]], [[120396, 120396], "mapped", [113]], [[120397, 120397], "mapped", [114]], [[120398, 120398], "mapped", [115]], [[120399, 120399], "mapped", [116]], [[120400, 120400], "mapped", [117]], [[120401, 120401], "mapped", [118]], [[120402, 120402], "mapped", [119]], [[120403, 120403], "mapped", [120]], [[120404, 120404], "mapped", [121]], [[120405, 120405], "mapped", [122]], [[120406, 120406], "mapped", [97]], [[120407, 120407], "mapped", [98]], [[120408, 120408], "mapped", [99]], [[120409, 120409], "mapped", [100]], [[120410, 120410], "mapped", [101]], [[120411, 120411], "mapped", [102]], [[120412, 120412], "mapped", [103]], [[120413, 120413], "mapped", [104]], [[120414, 120414], "mapped", [105]], [[120415, 120415], "mapped", [106]], [[120416, 120416], "mapped", [107]], [[120417, 120417], "mapped", [108]], [[120418, 120418], "mapped", [109]], [[120419, 120419], "mapped", [110]], [[120420, 120420], "mapped", [111]], [[120421, 120421], "mapped", [112]], [[120422, 120422], "mapped", [113]], [[120423, 120423], "mapped", [114]], [[120424, 120424], "mapped", [115]], [[120425, 120425], "mapped", [116]], [[120426, 120426], "mapped", [117]], [[120427, 120427], "mapped", [118]], [[120428, 120428], "mapped", [119]], [[120429, 120429], "mapped", [120]], [[120430, 120430], "mapped", [121]], [[120431, 120431], "mapped", [122]], [[120432, 120432], "mapped", [97]], [[120433, 120433], "mapped", [98]], [[120434, 120434], "mapped", [99]], [[120435, 120435], "mapped", [100]], [[120436, 120436], "mapped", [101]], [[120437, 120437], "mapped", [102]], [[120438, 120438], "mapped", [103]], [[120439, 120439], "mapped", [104]], [[120440, 120440], "mapped", [105]], [[120441, 120441], "mapped", [106]], [[120442, 120442], "mapped", [107]], [[120443, 120443], "mapped", [108]], [[120444, 120444], "mapped", [109]], [[120445, 120445], "mapped", [110]], [[120446, 120446], "mapped", [111]], [[120447, 120447], "mapped", [112]], [[120448, 120448], "mapped", [113]], [[120449, 120449], "mapped", [114]], [[120450, 120450], "mapped", [115]], [[120451, 120451], "mapped", [116]], [[120452, 120452], "mapped", [117]], [[120453, 120453], "mapped", [118]], [[120454, 120454], "mapped", [119]], [[120455, 120455], "mapped", [120]], [[120456, 120456], "mapped", [121]], [[120457, 120457], "mapped", [122]], [[120458, 120458], "mapped", [97]], [[120459, 120459], "mapped", [98]], [[120460, 120460], "mapped", [99]], [[120461, 120461], "mapped", [100]], [[120462, 120462], "mapped", [101]], [[120463, 120463], "mapped", [102]], [[120464, 120464], "mapped", [103]], [[120465, 120465], "mapped", [104]], [[120466, 120466], "mapped", [105]], [[120467, 120467], "mapped", [106]], [[120468, 120468], "mapped", [107]], [[120469, 120469], "mapped", [108]], [[120470, 120470], "mapped", [109]], [[120471, 120471], "mapped", [110]], [[120472, 120472], "mapped", [111]], [[120473, 120473], "mapped", [112]], [[120474, 120474], "mapped", [113]], [[120475, 120475], "mapped", [114]], [[120476, 120476], "mapped", [115]], [[120477, 120477], "mapped", [116]], [[120478, 120478], "mapped", [117]], [[120479, 120479], "mapped", [118]], [[120480, 120480], "mapped", [119]], [[120481, 120481], "mapped", [120]], [[120482, 120482], "mapped", [121]], [[120483, 120483], "mapped", [122]], [[120484, 120484], "mapped", [305]], [[120485, 120485], "mapped", [567]], [[120486, 120487], "disallowed"], [[120488, 120488], "mapped", [945]], [[120489, 120489], "mapped", [946]], [[120490, 120490], "mapped", [947]], [[120491, 120491], "mapped", [948]], [[120492, 120492], "mapped", [949]], [[120493, 120493], "mapped", [950]], [[120494, 120494], "mapped", [951]], [[120495, 120495], "mapped", [952]], [[120496, 120496], "mapped", [953]], [[120497, 120497], "mapped", [954]], [[120498, 120498], "mapped", [955]], [[120499, 120499], "mapped", [956]], [[120500, 120500], "mapped", [957]], [[120501, 120501], "mapped", [958]], [[120502, 120502], "mapped", [959]], [[120503, 120503], "mapped", [960]], [[120504, 120504], "mapped", [961]], [[120505, 120505], "mapped", [952]], [[120506, 120506], "mapped", [963]], [[120507, 120507], "mapped", [964]], [[120508, 120508], "mapped", [965]], [[120509, 120509], "mapped", [966]], [[120510, 120510], "mapped", [967]], [[120511, 120511], "mapped", [968]], [[120512, 120512], "mapped", [969]], [[120513, 120513], "mapped", [8711]], [[120514, 120514], "mapped", [945]], [[120515, 120515], "mapped", [946]], [[120516, 120516], "mapped", [947]], [[120517, 120517], "mapped", [948]], [[120518, 120518], "mapped", [949]], [[120519, 120519], "mapped", [950]], [[120520, 120520], "mapped", [951]], [[120521, 120521], "mapped", [952]], [[120522, 120522], "mapped", [953]], [[120523, 120523], "mapped", [954]], [[120524, 120524], "mapped", [955]], [[120525, 120525], "mapped", [956]], [[120526, 120526], "mapped", [957]], [[120527, 120527], "mapped", [958]], [[120528, 120528], "mapped", [959]], [[120529, 120529], "mapped", [960]], [[120530, 120530], "mapped", [961]], [[120531, 120532], "mapped", [963]], [[120533, 120533], "mapped", [964]], [[120534, 120534], "mapped", [965]], [[120535, 120535], "mapped", [966]], [[120536, 120536], "mapped", [967]], [[120537, 120537], "mapped", [968]], [[120538, 120538], "mapped", [969]], [[120539, 120539], "mapped", [8706]], [[120540, 120540], "mapped", [949]], [[120541, 120541], "mapped", [952]], [[120542, 120542], "mapped", [954]], [[120543, 120543], "mapped", [966]], [[120544, 120544], "mapped", [961]], [[120545, 120545], "mapped", [960]], [[120546, 120546], "mapped", [945]], [[120547, 120547], "mapped", [946]], [[120548, 120548], "mapped", [947]], [[120549, 120549], "mapped", [948]], [[120550, 120550], "mapped", [949]], [[120551, 120551], "mapped", [950]], [[120552, 120552], "mapped", [951]], [[120553, 120553], "mapped", [952]], [[120554, 120554], "mapped", [953]], [[120555, 120555], "mapped", [954]], [[120556, 120556], "mapped", [955]], [[120557, 120557], "mapped", [956]], [[120558, 120558], "mapped", [957]], [[120559, 120559], "mapped", [958]], [[120560, 120560], "mapped", [959]], [[120561, 120561], "mapped", [960]], [[120562, 120562], "mapped", [961]], [[120563, 120563], "mapped", [952]], [[120564, 120564], "mapped", [963]], [[120565, 120565], "mapped", [964]], [[120566, 120566], "mapped", [965]], [[120567, 120567], "mapped", [966]], [[120568, 120568], "mapped", [967]], [[120569, 120569], "mapped", [968]], [[120570, 120570], "mapped", [969]], [[120571, 120571], "mapped", [8711]], [[120572, 120572], "mapped", [945]], [[120573, 120573], "mapped", [946]], [[120574, 120574], "mapped", [947]], [[120575, 120575], "mapped", [948]], [[120576, 120576], "mapped", [949]], [[120577, 120577], "mapped", [950]], [[120578, 120578], "mapped", [951]], [[120579, 120579], "mapped", [952]], [[120580, 120580], "mapped", [953]], [[120581, 120581], "mapped", [954]], [[120582, 120582], "mapped", [955]], [[120583, 120583], "mapped", [956]], [[120584, 120584], "mapped", [957]], [[120585, 120585], "mapped", [958]], [[120586, 120586], "mapped", [959]], [[120587, 120587], "mapped", [960]], [[120588, 120588], "mapped", [961]], [[120589, 120590], "mapped", [963]], [[120591, 120591], "mapped", [964]], [[120592, 120592], "mapped", [965]], [[120593, 120593], "mapped", [966]], [[120594, 120594], "mapped", [967]], [[120595, 120595], "mapped", [968]], [[120596, 120596], "mapped", [969]], [[120597, 120597], "mapped", [8706]], [[120598, 120598], "mapped", [949]], [[120599, 120599], "mapped", [952]], [[120600, 120600], "mapped", [954]], [[120601, 120601], "mapped", [966]], [[120602, 120602], "mapped", [961]], [[120603, 120603], "mapped", [960]], [[120604, 120604], "mapped", [945]], [[120605, 120605], "mapped", [946]], [[120606, 120606], "mapped", [947]], [[120607, 120607], "mapped", [948]], [[120608, 120608], "mapped", [949]], [[120609, 120609], "mapped", [950]], [[120610, 120610], "mapped", [951]], [[120611, 120611], "mapped", [952]], [[120612, 120612], "mapped", [953]], [[120613, 120613], "mapped", [954]], [[120614, 120614], "mapped", [955]], [[120615, 120615], "mapped", [956]], [[120616, 120616], "mapped", [957]], [[120617, 120617], "mapped", [958]], [[120618, 120618], "mapped", [959]], [[120619, 120619], "mapped", [960]], [[120620, 120620], "mapped", [961]], [[120621, 120621], "mapped", [952]], [[120622, 120622], "mapped", [963]], [[120623, 120623], "mapped", [964]], [[120624, 120624], "mapped", [965]], [[120625, 120625], "mapped", [966]], [[120626, 120626], "mapped", [967]], [[120627, 120627], "mapped", [968]], [[120628, 120628], "mapped", [969]], [[120629, 120629], "mapped", [8711]], [[120630, 120630], "mapped", [945]], [[120631, 120631], "mapped", [946]], [[120632, 120632], "mapped", [947]], [[120633, 120633], "mapped", [948]], [[120634, 120634], "mapped", [949]], [[120635, 120635], "mapped", [950]], [[120636, 120636], "mapped", [951]], [[120637, 120637], "mapped", [952]], [[120638, 120638], "mapped", [953]], [[120639, 120639], "mapped", [954]], [[120640, 120640], "mapped", [955]], [[120641, 120641], "mapped", [956]], [[120642, 120642], "mapped", [957]], [[120643, 120643], "mapped", [958]], [[120644, 120644], "mapped", [959]], [[120645, 120645], "mapped", [960]], [[120646, 120646], "mapped", [961]], [[120647, 120648], "mapped", [963]], [[120649, 120649], "mapped", [964]], [[120650, 120650], "mapped", [965]], [[120651, 120651], "mapped", [966]], [[120652, 120652], "mapped", [967]], [[120653, 120653], "mapped", [968]], [[120654, 120654], "mapped", [969]], [[120655, 120655], "mapped", [8706]], [[120656, 120656], "mapped", [949]], [[120657, 120657], "mapped", [952]], [[120658, 120658], "mapped", [954]], [[120659, 120659], "mapped", [966]], [[120660, 120660], "mapped", [961]], [[120661, 120661], "mapped", [960]], [[120662, 120662], "mapped", [945]], [[120663, 120663], "mapped", [946]], [[120664, 120664], "mapped", [947]], [[120665, 120665], "mapped", [948]], [[120666, 120666], "mapped", [949]], [[120667, 120667], "mapped", [950]], [[120668, 120668], "mapped", [951]], [[120669, 120669], "mapped", [952]], [[120670, 120670], "mapped", [953]], [[120671, 120671], "mapped", [954]], [[120672, 120672], "mapped", [955]], [[120673, 120673], "mapped", [956]], [[120674, 120674], "mapped", [957]], [[120675, 120675], "mapped", [958]], [[120676, 120676], "mapped", [959]], [[120677, 120677], "mapped", [960]], [[120678, 120678], "mapped", [961]], [[120679, 120679], "mapped", [952]], [[120680, 120680], "mapped", [963]], [[120681, 120681], "mapped", [964]], [[120682, 120682], "mapped", [965]], [[120683, 120683], "mapped", [966]], [[120684, 120684], "mapped", [967]], [[120685, 120685], "mapped", [968]], [[120686, 120686], "mapped", [969]], [[120687, 120687], "mapped", [8711]], [[120688, 120688], "mapped", [945]], [[120689, 120689], "mapped", [946]], [[120690, 120690], "mapped", [947]], [[120691, 120691], "mapped", [948]], [[120692, 120692], "mapped", [949]], [[120693, 120693], "mapped", [950]], [[120694, 120694], "mapped", [951]], [[120695, 120695], "mapped", [952]], [[120696, 120696], "mapped", [953]], [[120697, 120697], "mapped", [954]], [[120698, 120698], "mapped", [955]], [[120699, 120699], "mapped", [956]], [[120700, 120700], "mapped", [957]], [[120701, 120701], "mapped", [958]], [[120702, 120702], "mapped", [959]], [[120703, 120703], "mapped", [960]], [[120704, 120704], "mapped", [961]], [[120705, 120706], "mapped", [963]], [[120707, 120707], "mapped", [964]], [[120708, 120708], "mapped", [965]], [[120709, 120709], "mapped", [966]], [[120710, 120710], "mapped", [967]], [[120711, 120711], "mapped", [968]], [[120712, 120712], "mapped", [969]], [[120713, 120713], "mapped", [8706]], [[120714, 120714], "mapped", [949]], [[120715, 120715], "mapped", [952]], [[120716, 120716], "mapped", [954]], [[120717, 120717], "mapped", [966]], [[120718, 120718], "mapped", [961]], [[120719, 120719], "mapped", [960]], [[120720, 120720], "mapped", [945]], [[120721, 120721], "mapped", [946]], [[120722, 120722], "mapped", [947]], [[120723, 120723], "mapped", [948]], [[120724, 120724], "mapped", [949]], [[120725, 120725], "mapped", [950]], [[120726, 120726], "mapped", [951]], [[120727, 120727], "mapped", [952]], [[120728, 120728], "mapped", [953]], [[120729, 120729], "mapped", [954]], [[120730, 120730], "mapped", [955]], [[120731, 120731], "mapped", [956]], [[120732, 120732], "mapped", [957]], [[120733, 120733], "mapped", [958]], [[120734, 120734], "mapped", [959]], [[120735, 120735], "mapped", [960]], [[120736, 120736], "mapped", [961]], [[120737, 120737], "mapped", [952]], [[120738, 120738], "mapped", [963]], [[120739, 120739], "mapped", [964]], [[120740, 120740], "mapped", [965]], [[120741, 120741], "mapped", [966]], [[120742, 120742], "mapped", [967]], [[120743, 120743], "mapped", [968]], [[120744, 120744], "mapped", [969]], [[120745, 120745], "mapped", [8711]], [[120746, 120746], "mapped", [945]], [[120747, 120747], "mapped", [946]], [[120748, 120748], "mapped", [947]], [[120749, 120749], "mapped", [948]], [[120750, 120750], "mapped", [949]], [[120751, 120751], "mapped", [950]], [[120752, 120752], "mapped", [951]], [[120753, 120753], "mapped", [952]], [[120754, 120754], "mapped", [953]], [[120755, 120755], "mapped", [954]], [[120756, 120756], "mapped", [955]], [[120757, 120757], "mapped", [956]], [[120758, 120758], "mapped", [957]], [[120759, 120759], "mapped", [958]], [[120760, 120760], "mapped", [959]], [[120761, 120761], "mapped", [960]], [[120762, 120762], "mapped", [961]], [[120763, 120764], "mapped", [963]], [[120765, 120765], "mapped", [964]], [[120766, 120766], "mapped", [965]], [[120767, 120767], "mapped", [966]], [[120768, 120768], "mapped", [967]], [[120769, 120769], "mapped", [968]], [[120770, 120770], "mapped", [969]], [[120771, 120771], "mapped", [8706]], [[120772, 120772], "mapped", [949]], [[120773, 120773], "mapped", [952]], [[120774, 120774], "mapped", [954]], [[120775, 120775], "mapped", [966]], [[120776, 120776], "mapped", [961]], [[120777, 120777], "mapped", [960]], [[120778, 120779], "mapped", [989]], [[120780, 120781], "disallowed"], [[120782, 120782], "mapped", [48]], [[120783, 120783], "mapped", [49]], [[120784, 120784], "mapped", [50]], [[120785, 120785], "mapped", [51]], [[120786, 120786], "mapped", [52]], [[120787, 120787], "mapped", [53]], [[120788, 120788], "mapped", [54]], [[120789, 120789], "mapped", [55]], [[120790, 120790], "mapped", [56]], [[120791, 120791], "mapped", [57]], [[120792, 120792], "mapped", [48]], [[120793, 120793], "mapped", [49]], [[120794, 120794], "mapped", [50]], [[120795, 120795], "mapped", [51]], [[120796, 120796], "mapped", [52]], [[120797, 120797], "mapped", [53]], [[120798, 120798], "mapped", [54]], [[120799, 120799], "mapped", [55]], [[120800, 120800], "mapped", [56]], [[120801, 120801], "mapped", [57]], [[120802, 120802], "mapped", [48]], [[120803, 120803], "mapped", [49]], [[120804, 120804], "mapped", [50]], [[120805, 120805], "mapped", [51]], [[120806, 120806], "mapped", [52]], [[120807, 120807], "mapped", [53]], [[120808, 120808], "mapped", [54]], [[120809, 120809], "mapped", [55]], [[120810, 120810], "mapped", [56]], [[120811, 120811], "mapped", [57]], [[120812, 120812], "mapped", [48]], [[120813, 120813], "mapped", [49]], [[120814, 120814], "mapped", [50]], [[120815, 120815], "mapped", [51]], [[120816, 120816], "mapped", [52]], [[120817, 120817], "mapped", [53]], [[120818, 120818], "mapped", [54]], [[120819, 120819], "mapped", [55]], [[120820, 120820], "mapped", [56]], [[120821, 120821], "mapped", [57]], [[120822, 120822], "mapped", [48]], [[120823, 120823], "mapped", [49]], [[120824, 120824], "mapped", [50]], [[120825, 120825], "mapped", [51]], [[120826, 120826], "mapped", [52]], [[120827, 120827], "mapped", [53]], [[120828, 120828], "mapped", [54]], [[120829, 120829], "mapped", [55]], [[120830, 120830], "mapped", [56]], [[120831, 120831], "mapped", [57]], [[120832, 121343], "valid", [], "NV8"], [[121344, 121398], "valid"], [[121399, 121402], "valid", [], "NV8"], [[121403, 121452], "valid"], [[121453, 121460], "valid", [], "NV8"], [[121461, 121461], "valid"], [[121462, 121475], "valid", [], "NV8"], [[121476, 121476], "valid"], [[121477, 121483], "valid", [], "NV8"], [[121484, 121498], "disallowed"], [[121499, 121503], "valid"], [[121504, 121504], "disallowed"], [[121505, 121519], "valid"], [[121520, 124927], "disallowed"], [[124928, 125124], "valid"], [[125125, 125126], "disallowed"], [[125127, 125135], "valid", [], "NV8"], [[125136, 125142], "valid"], [[125143, 126463], "disallowed"], [[126464, 126464], "mapped", [1575]], [[126465, 126465], "mapped", [1576]], [[126466, 126466], "mapped", [1580]], [[126467, 126467], "mapped", [1583]], [[126468, 126468], "disallowed"], [[126469, 126469], "mapped", [1608]], [[126470, 126470], "mapped", [1586]], [[126471, 126471], "mapped", [1581]], [[126472, 126472], "mapped", [1591]], [[126473, 126473], "mapped", [1610]], [[126474, 126474], "mapped", [1603]], [[126475, 126475], "mapped", [1604]], [[126476, 126476], "mapped", [1605]], [[126477, 126477], "mapped", [1606]], [[126478, 126478], "mapped", [1587]], [[126479, 126479], "mapped", [1593]], [[126480, 126480], "mapped", [1601]], [[126481, 126481], "mapped", [1589]], [[126482, 126482], "mapped", [1602]], [[126483, 126483], "mapped", [1585]], [[126484, 126484], "mapped", [1588]], [[126485, 126485], "mapped", [1578]], [[126486, 126486], "mapped", [1579]], [[126487, 126487], "mapped", [1582]], [[126488, 126488], "mapped", [1584]], [[126489, 126489], "mapped", [1590]], [[126490, 126490], "mapped", [1592]], [[126491, 126491], "mapped", [1594]], [[126492, 126492], "mapped", [1646]], [[126493, 126493], "mapped", [1722]], [[126494, 126494], "mapped", [1697]], [[126495, 126495], "mapped", [1647]], [[126496, 126496], "disallowed"], [[126497, 126497], "mapped", [1576]], [[126498, 126498], "mapped", [1580]], [[126499, 126499], "disallowed"], [[126500, 126500], "mapped", [1607]], [[126501, 126502], "disallowed"], [[126503, 126503], "mapped", [1581]], [[126504, 126504], "disallowed"], [[126505, 126505], "mapped", [1610]], [[126506, 126506], "mapped", [1603]], [[126507, 126507], "mapped", [1604]], [[126508, 126508], "mapped", [1605]], [[126509, 126509], "mapped", [1606]], [[126510, 126510], "mapped", [1587]], [[126511, 126511], "mapped", [1593]], [[126512, 126512], "mapped", [1601]], [[126513, 126513], "mapped", [1589]], [[126514, 126514], "mapped", [1602]], [[126515, 126515], "disallowed"], [[126516, 126516], "mapped", [1588]], [[126517, 126517], "mapped", [1578]], [[126518, 126518], "mapped", [1579]], [[126519, 126519], "mapped", [1582]], [[126520, 126520], "disallowed"], [[126521, 126521], "mapped", [1590]], [[126522, 126522], "disallowed"], [[126523, 126523], "mapped", [1594]], [[126524, 126529], "disallowed"], [[126530, 126530], "mapped", [1580]], [[126531, 126534], "disallowed"], [[126535, 126535], "mapped", [1581]], [[126536, 126536], "disallowed"], [[126537, 126537], "mapped", [1610]], [[126538, 126538], "disallowed"], [[126539, 126539], "mapped", [1604]], [[126540, 126540], "disallowed"], [[126541, 126541], "mapped", [1606]], [[126542, 126542], "mapped", [1587]], [[126543, 126543], "mapped", [1593]], [[126544, 126544], "disallowed"], [[126545, 126545], "mapped", [1589]], [[126546, 126546], "mapped", [1602]], [[126547, 126547], "disallowed"], [[126548, 126548], "mapped", [1588]], [[126549, 126550], "disallowed"], [[126551, 126551], "mapped", [1582]], [[126552, 126552], "disallowed"], [[126553, 126553], "mapped", [1590]], [[126554, 126554], "disallowed"], [[126555, 126555], "mapped", [1594]], [[126556, 126556], "disallowed"], [[126557, 126557], "mapped", [1722]], [[126558, 126558], "disallowed"], [[126559, 126559], "mapped", [1647]], [[126560, 126560], "disallowed"], [[126561, 126561], "mapped", [1576]], [[126562, 126562], "mapped", [1580]], [[126563, 126563], "disallowed"], [[126564, 126564], "mapped", [1607]], [[126565, 126566], "disallowed"], [[126567, 126567], "mapped", [1581]], [[126568, 126568], "mapped", [1591]], [[126569, 126569], "mapped", [1610]], [[126570, 126570], "mapped", [1603]], [[126571, 126571], "disallowed"], [[126572, 126572], "mapped", [1605]], [[126573, 126573], "mapped", [1606]], [[126574, 126574], "mapped", [1587]], [[126575, 126575], "mapped", [1593]], [[126576, 126576], "mapped", [1601]], [[126577, 126577], "mapped", [1589]], [[126578, 126578], "mapped", [1602]], [[126579, 126579], "disallowed"], [[126580, 126580], "mapped", [1588]], [[126581, 126581], "mapped", [1578]], [[126582, 126582], "mapped", [1579]], [[126583, 126583], "mapped", [1582]], [[126584, 126584], "disallowed"], [[126585, 126585], "mapped", [1590]], [[126586, 126586], "mapped", [1592]], [[126587, 126587], "mapped", [1594]], [[126588, 126588], "mapped", [1646]], [[126589, 126589], "disallowed"], [[126590, 126590], "mapped", [1697]], [[126591, 126591], "disallowed"], [[126592, 126592], "mapped", [1575]], [[126593, 126593], "mapped", [1576]], [[126594, 126594], "mapped", [1580]], [[126595, 126595], "mapped", [1583]], [[126596, 126596], "mapped", [1607]], [[126597, 126597], "mapped", [1608]], [[126598, 126598], "mapped", [1586]], [[126599, 126599], "mapped", [1581]], [[126600, 126600], "mapped", [1591]], [[126601, 126601], "mapped", [1610]], [[126602, 126602], "disallowed"], [[126603, 126603], "mapped", [1604]], [[126604, 126604], "mapped", [1605]], [[126605, 126605], "mapped", [1606]], [[126606, 126606], "mapped", [1587]], [[126607, 126607], "mapped", [1593]], [[126608, 126608], "mapped", [1601]], [[126609, 126609], "mapped", [1589]], [[126610, 126610], "mapped", [1602]], [[126611, 126611], "mapped", [1585]], [[126612, 126612], "mapped", [1588]], [[126613, 126613], "mapped", [1578]], [[126614, 126614], "mapped", [1579]], [[126615, 126615], "mapped", [1582]], [[126616, 126616], "mapped", [1584]], [[126617, 126617], "mapped", [1590]], [[126618, 126618], "mapped", [1592]], [[126619, 126619], "mapped", [1594]], [[126620, 126624], "disallowed"], [[126625, 126625], "mapped", [1576]], [[126626, 126626], "mapped", [1580]], [[126627, 126627], "mapped", [1583]], [[126628, 126628], "disallowed"], [[126629, 126629], "mapped", [1608]], [[126630, 126630], "mapped", [1586]], [[126631, 126631], "mapped", [1581]], [[126632, 126632], "mapped", [1591]], [[126633, 126633], "mapped", [1610]], [[126634, 126634], "disallowed"], [[126635, 126635], "mapped", [1604]], [[126636, 126636], "mapped", [1605]], [[126637, 126637], "mapped", [1606]], [[126638, 126638], "mapped", [1587]], [[126639, 126639], "mapped", [1593]], [[126640, 126640], "mapped", [1601]], [[126641, 126641], "mapped", [1589]], [[126642, 126642], "mapped", [1602]], [[126643, 126643], "mapped", [1585]], [[126644, 126644], "mapped", [1588]], [[126645, 126645], "mapped", [1578]], [[126646, 126646], "mapped", [1579]], [[126647, 126647], "mapped", [1582]], [[126648, 126648], "mapped", [1584]], [[126649, 126649], "mapped", [1590]], [[126650, 126650], "mapped", [1592]], [[126651, 126651], "mapped", [1594]], [[126652, 126703], "disallowed"], [[126704, 126705], "valid", [], "NV8"], [[126706, 126975], "disallowed"], [[126976, 127019], "valid", [], "NV8"], [[127020, 127023], "disallowed"], [[127024, 127123], "valid", [], "NV8"], [[127124, 127135], "disallowed"], [[127136, 127150], "valid", [], "NV8"], [[127151, 127152], "disallowed"], [[127153, 127166], "valid", [], "NV8"], [[127167, 127167], "valid", [], "NV8"], [[127168, 127168], "disallowed"], [[127169, 127183], "valid", [], "NV8"], [[127184, 127184], "disallowed"], [[127185, 127199], "valid", [], "NV8"], [[127200, 127221], "valid", [], "NV8"], [[127222, 127231], "disallowed"], [[127232, 127232], "disallowed"], [[127233, 127233], "disallowed_STD3_mapped", [48, 44]], [[127234, 127234], "disallowed_STD3_mapped", [49, 44]], [[127235, 127235], "disallowed_STD3_mapped", [50, 44]], [[127236, 127236], "disallowed_STD3_mapped", [51, 44]], [[127237, 127237], "disallowed_STD3_mapped", [52, 44]], [[127238, 127238], "disallowed_STD3_mapped", [53, 44]], [[127239, 127239], "disallowed_STD3_mapped", [54, 44]], [[127240, 127240], "disallowed_STD3_mapped", [55, 44]], [[127241, 127241], "disallowed_STD3_mapped", [56, 44]], [[127242, 127242], "disallowed_STD3_mapped", [57, 44]], [[127243, 127244], "valid", [], "NV8"], [[127245, 127247], "disallowed"], [[127248, 127248], "disallowed_STD3_mapped", [40, 97, 41]], [[127249, 127249], "disallowed_STD3_mapped", [40, 98, 41]], [[127250, 127250], "disallowed_STD3_mapped", [40, 99, 41]], [[127251, 127251], "disallowed_STD3_mapped", [40, 100, 41]], [[127252, 127252], "disallowed_STD3_mapped", [40, 101, 41]], [[127253, 127253], "disallowed_STD3_mapped", [40, 102, 41]], [[127254, 127254], "disallowed_STD3_mapped", [40, 103, 41]], [[127255, 127255], "disallowed_STD3_mapped", [40, 104, 41]], [[127256, 127256], "disallowed_STD3_mapped", [40, 105, 41]], [[127257, 127257], "disallowed_STD3_mapped", [40, 106, 41]], [[127258, 127258], "disallowed_STD3_mapped", [40, 107, 41]], [[127259, 127259], "disallowed_STD3_mapped", [40, 108, 41]], [[127260, 127260], "disallowed_STD3_mapped", [40, 109, 41]], [[127261, 127261], "disallowed_STD3_mapped", [40, 110, 41]], [[127262, 127262], "disallowed_STD3_mapped", [40, 111, 41]], [[127263, 127263], "disallowed_STD3_mapped", [40, 112, 41]], [[127264, 127264], "disallowed_STD3_mapped", [40, 113, 41]], [[127265, 127265], "disallowed_STD3_mapped", [40, 114, 41]], [[127266, 127266], "disallowed_STD3_mapped", [40, 115, 41]], [[127267, 127267], "disallowed_STD3_mapped", [40, 116, 41]], [[127268, 127268], "disallowed_STD3_mapped", [40, 117, 41]], [[127269, 127269], "disallowed_STD3_mapped", [40, 118, 41]], [[127270, 127270], "disallowed_STD3_mapped", [40, 119, 41]], [[127271, 127271], "disallowed_STD3_mapped", [40, 120, 41]], [[127272, 127272], "disallowed_STD3_mapped", [40, 121, 41]], [[127273, 127273], "disallowed_STD3_mapped", [40, 122, 41]], [[127274, 127274], "mapped", [12308, 115, 12309]], [[127275, 127275], "mapped", [99]], [[127276, 127276], "mapped", [114]], [[127277, 127277], "mapped", [99, 100]], [[127278, 127278], "mapped", [119, 122]], [[127279, 127279], "disallowed"], [[127280, 127280], "mapped", [97]], [[127281, 127281], "mapped", [98]], [[127282, 127282], "mapped", [99]], [[127283, 127283], "mapped", [100]], [[127284, 127284], "mapped", [101]], [[127285, 127285], "mapped", [102]], [[127286, 127286], "mapped", [103]], [[127287, 127287], "mapped", [104]], [[127288, 127288], "mapped", [105]], [[127289, 127289], "mapped", [106]], [[127290, 127290], "mapped", [107]], [[127291, 127291], "mapped", [108]], [[127292, 127292], "mapped", [109]], [[127293, 127293], "mapped", [110]], [[127294, 127294], "mapped", [111]], [[127295, 127295], "mapped", [112]], [[127296, 127296], "mapped", [113]], [[127297, 127297], "mapped", [114]], [[127298, 127298], "mapped", [115]], [[127299, 127299], "mapped", [116]], [[127300, 127300], "mapped", [117]], [[127301, 127301], "mapped", [118]], [[127302, 127302], "mapped", [119]], [[127303, 127303], "mapped", [120]], [[127304, 127304], "mapped", [121]], [[127305, 127305], "mapped", [122]], [[127306, 127306], "mapped", [104, 118]], [[127307, 127307], "mapped", [109, 118]], [[127308, 127308], "mapped", [115, 100]], [[127309, 127309], "mapped", [115, 115]], [[127310, 127310], "mapped", [112, 112, 118]], [[127311, 127311], "mapped", [119, 99]], [[127312, 127318], "valid", [], "NV8"], [[127319, 127319], "valid", [], "NV8"], [[127320, 127326], "valid", [], "NV8"], [[127327, 127327], "valid", [], "NV8"], [[127328, 127337], "valid", [], "NV8"], [[127338, 127338], "mapped", [109, 99]], [[127339, 127339], "mapped", [109, 100]], [[127340, 127343], "disallowed"], [[127344, 127352], "valid", [], "NV8"], [[127353, 127353], "valid", [], "NV8"], [[127354, 127354], "valid", [], "NV8"], [[127355, 127356], "valid", [], "NV8"], [[127357, 127358], "valid", [], "NV8"], [[127359, 127359], "valid", [], "NV8"], [[127360, 127369], "valid", [], "NV8"], [[127370, 127373], "valid", [], "NV8"], [[127374, 127375], "valid", [], "NV8"], [[127376, 127376], "mapped", [100, 106]], [[127377, 127386], "valid", [], "NV8"], [[127387, 127461], "disallowed"], [[127462, 127487], "valid", [], "NV8"], [[127488, 127488], "mapped", [12411, 12363]], [[127489, 127489], "mapped", [12467, 12467]], [[127490, 127490], "mapped", [12469]], [[127491, 127503], "disallowed"], [[127504, 127504], "mapped", [25163]], [[127505, 127505], "mapped", [23383]], [[127506, 127506], "mapped", [21452]], [[127507, 127507], "mapped", [12487]], [[127508, 127508], "mapped", [20108]], [[127509, 127509], "mapped", [22810]], [[127510, 127510], "mapped", [35299]], [[127511, 127511], "mapped", [22825]], [[127512, 127512], "mapped", [20132]], [[127513, 127513], "mapped", [26144]], [[127514, 127514], "mapped", [28961]], [[127515, 127515], "mapped", [26009]], [[127516, 127516], "mapped", [21069]], [[127517, 127517], "mapped", [24460]], [[127518, 127518], "mapped", [20877]], [[127519, 127519], "mapped", [26032]], [[127520, 127520], "mapped", [21021]], [[127521, 127521], "mapped", [32066]], [[127522, 127522], "mapped", [29983]], [[127523, 127523], "mapped", [36009]], [[127524, 127524], "mapped", [22768]], [[127525, 127525], "mapped", [21561]], [[127526, 127526], "mapped", [28436]], [[127527, 127527], "mapped", [25237]], [[127528, 127528], "mapped", [25429]], [[127529, 127529], "mapped", [19968]], [[127530, 127530], "mapped", [19977]], [[127531, 127531], "mapped", [36938]], [[127532, 127532], "mapped", [24038]], [[127533, 127533], "mapped", [20013]], [[127534, 127534], "mapped", [21491]], [[127535, 127535], "mapped", [25351]], [[127536, 127536], "mapped", [36208]], [[127537, 127537], "mapped", [25171]], [[127538, 127538], "mapped", [31105]], [[127539, 127539], "mapped", [31354]], [[127540, 127540], "mapped", [21512]], [[127541, 127541], "mapped", [28288]], [[127542, 127542], "mapped", [26377]], [[127543, 127543], "mapped", [26376]], [[127544, 127544], "mapped", [30003]], [[127545, 127545], "mapped", [21106]], [[127546, 127546], "mapped", [21942]], [[127547, 127551], "disallowed"], [[127552, 127552], "mapped", [12308, 26412, 12309]], [[127553, 127553], "mapped", [12308, 19977, 12309]], [[127554, 127554], "mapped", [12308, 20108, 12309]], [[127555, 127555], "mapped", [12308, 23433, 12309]], [[127556, 127556], "mapped", [12308, 28857, 12309]], [[127557, 127557], "mapped", [12308, 25171, 12309]], [[127558, 127558], "mapped", [12308, 30423, 12309]], [[127559, 127559], "mapped", [12308, 21213, 12309]], [[127560, 127560], "mapped", [12308, 25943, 12309]], [[127561, 127567], "disallowed"], [[127568, 127568], "mapped", [24471]], [[127569, 127569], "mapped", [21487]], [[127570, 127743], "disallowed"], [[127744, 127776], "valid", [], "NV8"], [[127777, 127788], "valid", [], "NV8"], [[127789, 127791], "valid", [], "NV8"], [[127792, 127797], "valid", [], "NV8"], [[127798, 127798], "valid", [], "NV8"], [[127799, 127868], "valid", [], "NV8"], [[127869, 127869], "valid", [], "NV8"], [[127870, 127871], "valid", [], "NV8"], [[127872, 127891], "valid", [], "NV8"], [[127892, 127903], "valid", [], "NV8"], [[127904, 127940], "valid", [], "NV8"], [[127941, 127941], "valid", [], "NV8"], [[127942, 127946], "valid", [], "NV8"], [[127947, 127950], "valid", [], "NV8"], [[127951, 127955], "valid", [], "NV8"], [[127956, 127967], "valid", [], "NV8"], [[127968, 127984], "valid", [], "NV8"], [[127985, 127991], "valid", [], "NV8"], [[127992, 127999], "valid", [], "NV8"], [[128e3, 128062], "valid", [], "NV8"], [[128063, 128063], "valid", [], "NV8"], [[128064, 128064], "valid", [], "NV8"], [[128065, 128065], "valid", [], "NV8"], [[128066, 128247], "valid", [], "NV8"], [[128248, 128248], "valid", [], "NV8"], [[128249, 128252], "valid", [], "NV8"], [[128253, 128254], "valid", [], "NV8"], [[128255, 128255], "valid", [], "NV8"], [[128256, 128317], "valid", [], "NV8"], [[128318, 128319], "valid", [], "NV8"], [[128320, 128323], "valid", [], "NV8"], [[128324, 128330], "valid", [], "NV8"], [[128331, 128335], "valid", [], "NV8"], [[128336, 128359], "valid", [], "NV8"], [[128360, 128377], "valid", [], "NV8"], [[128378, 128378], "disallowed"], [[128379, 128419], "valid", [], "NV8"], [[128420, 128420], "disallowed"], [[128421, 128506], "valid", [], "NV8"], [[128507, 128511], "valid", [], "NV8"], [[128512, 128512], "valid", [], "NV8"], [[128513, 128528], "valid", [], "NV8"], [[128529, 128529], "valid", [], "NV8"], [[128530, 128532], "valid", [], "NV8"], [[128533, 128533], "valid", [], "NV8"], [[128534, 128534], "valid", [], "NV8"], [[128535, 128535], "valid", [], "NV8"], [[128536, 128536], "valid", [], "NV8"], [[128537, 128537], "valid", [], "NV8"], [[128538, 128538], "valid", [], "NV8"], [[128539, 128539], "valid", [], "NV8"], [[128540, 128542], "valid", [], "NV8"], [[128543, 128543], "valid", [], "NV8"], [[128544, 128549], "valid", [], "NV8"], [[128550, 128551], "valid", [], "NV8"], [[128552, 128555], "valid", [], "NV8"], [[128556, 128556], "valid", [], "NV8"], [[128557, 128557], "valid", [], "NV8"], [[128558, 128559], "valid", [], "NV8"], [[128560, 128563], "valid", [], "NV8"], [[128564, 128564], "valid", [], "NV8"], [[128565, 128576], "valid", [], "NV8"], [[128577, 128578], "valid", [], "NV8"], [[128579, 128580], "valid", [], "NV8"], [[128581, 128591], "valid", [], "NV8"], [[128592, 128639], "valid", [], "NV8"], [[128640, 128709], "valid", [], "NV8"], [[128710, 128719], "valid", [], "NV8"], [[128720, 128720], "valid", [], "NV8"], [[128721, 128735], "disallowed"], [[128736, 128748], "valid", [], "NV8"], [[128749, 128751], "disallowed"], [[128752, 128755], "valid", [], "NV8"], [[128756, 128767], "disallowed"], [[128768, 128883], "valid", [], "NV8"], [[128884, 128895], "disallowed"], [[128896, 128980], "valid", [], "NV8"], [[128981, 129023], "disallowed"], [[129024, 129035], "valid", [], "NV8"], [[129036, 129039], "disallowed"], [[129040, 129095], "valid", [], "NV8"], [[129096, 129103], "disallowed"], [[129104, 129113], "valid", [], "NV8"], [[129114, 129119], "disallowed"], [[129120, 129159], "valid", [], "NV8"], [[129160, 129167], "disallowed"], [[129168, 129197], "valid", [], "NV8"], [[129198, 129295], "disallowed"], [[129296, 129304], "valid", [], "NV8"], [[129305, 129407], "disallowed"], [[129408, 129412], "valid", [], "NV8"], [[129413, 129471], "disallowed"], [[129472, 129472], "valid", [], "NV8"], [[129473, 131069], "disallowed"], [[131070, 131071], "disallowed"], [[131072, 173782], "valid"], [[173783, 173823], "disallowed"], [[173824, 177972], "valid"], [[177973, 177983], "disallowed"], [[177984, 178205], "valid"], [[178206, 178207], "disallowed"], [[178208, 183969], "valid"], [[183970, 194559], "disallowed"], [[194560, 194560], "mapped", [20029]], [[194561, 194561], "mapped", [20024]], [[194562, 194562], "mapped", [20033]], [[194563, 194563], "mapped", [131362]], [[194564, 194564], "mapped", [20320]], [[194565, 194565], "mapped", [20398]], [[194566, 194566], "mapped", [20411]], [[194567, 194567], "mapped", [20482]], [[194568, 194568], "mapped", [20602]], [[194569, 194569], "mapped", [20633]], [[194570, 194570], "mapped", [20711]], [[194571, 194571], "mapped", [20687]], [[194572, 194572], "mapped", [13470]], [[194573, 194573], "mapped", [132666]], [[194574, 194574], "mapped", [20813]], [[194575, 194575], "mapped", [20820]], [[194576, 194576], "mapped", [20836]], [[194577, 194577], "mapped", [20855]], [[194578, 194578], "mapped", [132380]], [[194579, 194579], "mapped", [13497]], [[194580, 194580], "mapped", [20839]], [[194581, 194581], "mapped", [20877]], [[194582, 194582], "mapped", [132427]], [[194583, 194583], "mapped", [20887]], [[194584, 194584], "mapped", [20900]], [[194585, 194585], "mapped", [20172]], [[194586, 194586], "mapped", [20908]], [[194587, 194587], "mapped", [20917]], [[194588, 194588], "mapped", [168415]], [[194589, 194589], "mapped", [20981]], [[194590, 194590], "mapped", [20995]], [[194591, 194591], "mapped", [13535]], [[194592, 194592], "mapped", [21051]], [[194593, 194593], "mapped", [21062]], [[194594, 194594], "mapped", [21106]], [[194595, 194595], "mapped", [21111]], [[194596, 194596], "mapped", [13589]], [[194597, 194597], "mapped", [21191]], [[194598, 194598], "mapped", [21193]], [[194599, 194599], "mapped", [21220]], [[194600, 194600], "mapped", [21242]], [[194601, 194601], "mapped", [21253]], [[194602, 194602], "mapped", [21254]], [[194603, 194603], "mapped", [21271]], [[194604, 194604], "mapped", [21321]], [[194605, 194605], "mapped", [21329]], [[194606, 194606], "mapped", [21338]], [[194607, 194607], "mapped", [21363]], [[194608, 194608], "mapped", [21373]], [[194609, 194611], "mapped", [21375]], [[194612, 194612], "mapped", [133676]], [[194613, 194613], "mapped", [28784]], [[194614, 194614], "mapped", [21450]], [[194615, 194615], "mapped", [21471]], [[194616, 194616], "mapped", [133987]], [[194617, 194617], "mapped", [21483]], [[194618, 194618], "mapped", [21489]], [[194619, 194619], "mapped", [21510]], [[194620, 194620], "mapped", [21662]], [[194621, 194621], "mapped", [21560]], [[194622, 194622], "mapped", [21576]], [[194623, 194623], "mapped", [21608]], [[194624, 194624], "mapped", [21666]], [[194625, 194625], "mapped", [21750]], [[194626, 194626], "mapped", [21776]], [[194627, 194627], "mapped", [21843]], [[194628, 194628], "mapped", [21859]], [[194629, 194630], "mapped", [21892]], [[194631, 194631], "mapped", [21913]], [[194632, 194632], "mapped", [21931]], [[194633, 194633], "mapped", [21939]], [[194634, 194634], "mapped", [21954]], [[194635, 194635], "mapped", [22294]], [[194636, 194636], "mapped", [22022]], [[194637, 194637], "mapped", [22295]], [[194638, 194638], "mapped", [22097]], [[194639, 194639], "mapped", [22132]], [[194640, 194640], "mapped", [20999]], [[194641, 194641], "mapped", [22766]], [[194642, 194642], "mapped", [22478]], [[194643, 194643], "mapped", [22516]], [[194644, 194644], "mapped", [22541]], [[194645, 194645], "mapped", [22411]], [[194646, 194646], "mapped", [22578]], [[194647, 194647], "mapped", [22577]], [[194648, 194648], "mapped", [22700]], [[194649, 194649], "mapped", [136420]], [[194650, 194650], "mapped", [22770]], [[194651, 194651], "mapped", [22775]], [[194652, 194652], "mapped", [22790]], [[194653, 194653], "mapped", [22810]], [[194654, 194654], "mapped", [22818]], [[194655, 194655], "mapped", [22882]], [[194656, 194656], "mapped", [136872]], [[194657, 194657], "mapped", [136938]], [[194658, 194658], "mapped", [23020]], [[194659, 194659], "mapped", [23067]], [[194660, 194660], "mapped", [23079]], [[194661, 194661], "mapped", [23e3]], [[194662, 194662], "mapped", [23142]], [[194663, 194663], "mapped", [14062]], [[194664, 194664], "disallowed"], [[194665, 194665], "mapped", [23304]], [[194666, 194667], "mapped", [23358]], [[194668, 194668], "mapped", [137672]], [[194669, 194669], "mapped", [23491]], [[194670, 194670], "mapped", [23512]], [[194671, 194671], "mapped", [23527]], [[194672, 194672], "mapped", [23539]], [[194673, 194673], "mapped", [138008]], [[194674, 194674], "mapped", [23551]], [[194675, 194675], "mapped", [23558]], [[194676, 194676], "disallowed"], [[194677, 194677], "mapped", [23586]], [[194678, 194678], "mapped", [14209]], [[194679, 194679], "mapped", [23648]], [[194680, 194680], "mapped", [23662]], [[194681, 194681], "mapped", [23744]], [[194682, 194682], "mapped", [23693]], [[194683, 194683], "mapped", [138724]], [[194684, 194684], "mapped", [23875]], [[194685, 194685], "mapped", [138726]], [[194686, 194686], "mapped", [23918]], [[194687, 194687], "mapped", [23915]], [[194688, 194688], "mapped", [23932]], [[194689, 194689], "mapped", [24033]], [[194690, 194690], "mapped", [24034]], [[194691, 194691], "mapped", [14383]], [[194692, 194692], "mapped", [24061]], [[194693, 194693], "mapped", [24104]], [[194694, 194694], "mapped", [24125]], [[194695, 194695], "mapped", [24169]], [[194696, 194696], "mapped", [14434]], [[194697, 194697], "mapped", [139651]], [[194698, 194698], "mapped", [14460]], [[194699, 194699], "mapped", [24240]], [[194700, 194700], "mapped", [24243]], [[194701, 194701], "mapped", [24246]], [[194702, 194702], "mapped", [24266]], [[194703, 194703], "mapped", [172946]], [[194704, 194704], "mapped", [24318]], [[194705, 194706], "mapped", [140081]], [[194707, 194707], "mapped", [33281]], [[194708, 194709], "mapped", [24354]], [[194710, 194710], "mapped", [14535]], [[194711, 194711], "mapped", [144056]], [[194712, 194712], "mapped", [156122]], [[194713, 194713], "mapped", [24418]], [[194714, 194714], "mapped", [24427]], [[194715, 194715], "mapped", [14563]], [[194716, 194716], "mapped", [24474]], [[194717, 194717], "mapped", [24525]], [[194718, 194718], "mapped", [24535]], [[194719, 194719], "mapped", [24569]], [[194720, 194720], "mapped", [24705]], [[194721, 194721], "mapped", [14650]], [[194722, 194722], "mapped", [14620]], [[194723, 194723], "mapped", [24724]], [[194724, 194724], "mapped", [141012]], [[194725, 194725], "mapped", [24775]], [[194726, 194726], "mapped", [24904]], [[194727, 194727], "mapped", [24908]], [[194728, 194728], "mapped", [24910]], [[194729, 194729], "mapped", [24908]], [[194730, 194730], "mapped", [24954]], [[194731, 194731], "mapped", [24974]], [[194732, 194732], "mapped", [25010]], [[194733, 194733], "mapped", [24996]], [[194734, 194734], "mapped", [25007]], [[194735, 194735], "mapped", [25054]], [[194736, 194736], "mapped", [25074]], [[194737, 194737], "mapped", [25078]], [[194738, 194738], "mapped", [25104]], [[194739, 194739], "mapped", [25115]], [[194740, 194740], "mapped", [25181]], [[194741, 194741], "mapped", [25265]], [[194742, 194742], "mapped", [25300]], [[194743, 194743], "mapped", [25424]], [[194744, 194744], "mapped", [142092]], [[194745, 194745], "mapped", [25405]], [[194746, 194746], "mapped", [25340]], [[194747, 194747], "mapped", [25448]], [[194748, 194748], "mapped", [25475]], [[194749, 194749], "mapped", [25572]], [[194750, 194750], "mapped", [142321]], [[194751, 194751], "mapped", [25634]], [[194752, 194752], "mapped", [25541]], [[194753, 194753], "mapped", [25513]], [[194754, 194754], "mapped", [14894]], [[194755, 194755], "mapped", [25705]], [[194756, 194756], "mapped", [25726]], [[194757, 194757], "mapped", [25757]], [[194758, 194758], "mapped", [25719]], [[194759, 194759], "mapped", [14956]], [[194760, 194760], "mapped", [25935]], [[194761, 194761], "mapped", [25964]], [[194762, 194762], "mapped", [143370]], [[194763, 194763], "mapped", [26083]], [[194764, 194764], "mapped", [26360]], [[194765, 194765], "mapped", [26185]], [[194766, 194766], "mapped", [15129]], [[194767, 194767], "mapped", [26257]], [[194768, 194768], "mapped", [15112]], [[194769, 194769], "mapped", [15076]], [[194770, 194770], "mapped", [20882]], [[194771, 194771], "mapped", [20885]], [[194772, 194772], "mapped", [26368]], [[194773, 194773], "mapped", [26268]], [[194774, 194774], "mapped", [32941]], [[194775, 194775], "mapped", [17369]], [[194776, 194776], "mapped", [26391]], [[194777, 194777], "mapped", [26395]], [[194778, 194778], "mapped", [26401]], [[194779, 194779], "mapped", [26462]], [[194780, 194780], "mapped", [26451]], [[194781, 194781], "mapped", [144323]], [[194782, 194782], "mapped", [15177]], [[194783, 194783], "mapped", [26618]], [[194784, 194784], "mapped", [26501]], [[194785, 194785], "mapped", [26706]], [[194786, 194786], "mapped", [26757]], [[194787, 194787], "mapped", [144493]], [[194788, 194788], "mapped", [26766]], [[194789, 194789], "mapped", [26655]], [[194790, 194790], "mapped", [26900]], [[194791, 194791], "mapped", [15261]], [[194792, 194792], "mapped", [26946]], [[194793, 194793], "mapped", [27043]], [[194794, 194794], "mapped", [27114]], [[194795, 194795], "mapped", [27304]], [[194796, 194796], "mapped", [145059]], [[194797, 194797], "mapped", [27355]], [[194798, 194798], "mapped", [15384]], [[194799, 194799], "mapped", [27425]], [[194800, 194800], "mapped", [145575]], [[194801, 194801], "mapped", [27476]], [[194802, 194802], "mapped", [15438]], [[194803, 194803], "mapped", [27506]], [[194804, 194804], "mapped", [27551]], [[194805, 194805], "mapped", [27578]], [[194806, 194806], "mapped", [27579]], [[194807, 194807], "mapped", [146061]], [[194808, 194808], "mapped", [138507]], [[194809, 194809], "mapped", [146170]], [[194810, 194810], "mapped", [27726]], [[194811, 194811], "mapped", [146620]], [[194812, 194812], "mapped", [27839]], [[194813, 194813], "mapped", [27853]], [[194814, 194814], "mapped", [27751]], [[194815, 194815], "mapped", [27926]], [[194816, 194816], "mapped", [27966]], [[194817, 194817], "mapped", [28023]], [[194818, 194818], "mapped", [27969]], [[194819, 194819], "mapped", [28009]], [[194820, 194820], "mapped", [28024]], [[194821, 194821], "mapped", [28037]], [[194822, 194822], "mapped", [146718]], [[194823, 194823], "mapped", [27956]], [[194824, 194824], "mapped", [28207]], [[194825, 194825], "mapped", [28270]], [[194826, 194826], "mapped", [15667]], [[194827, 194827], "mapped", [28363]], [[194828, 194828], "mapped", [28359]], [[194829, 194829], "mapped", [147153]], [[194830, 194830], "mapped", [28153]], [[194831, 194831], "mapped", [28526]], [[194832, 194832], "mapped", [147294]], [[194833, 194833], "mapped", [147342]], [[194834, 194834], "mapped", [28614]], [[194835, 194835], "mapped", [28729]], [[194836, 194836], "mapped", [28702]], [[194837, 194837], "mapped", [28699]], [[194838, 194838], "mapped", [15766]], [[194839, 194839], "mapped", [28746]], [[194840, 194840], "mapped", [28797]], [[194841, 194841], "mapped", [28791]], [[194842, 194842], "mapped", [28845]], [[194843, 194843], "mapped", [132389]], [[194844, 194844], "mapped", [28997]], [[194845, 194845], "mapped", [148067]], [[194846, 194846], "mapped", [29084]], [[194847, 194847], "disallowed"], [[194848, 194848], "mapped", [29224]], [[194849, 194849], "mapped", [29237]], [[194850, 194850], "mapped", [29264]], [[194851, 194851], "mapped", [149e3]], [[194852, 194852], "mapped", [29312]], [[194853, 194853], "mapped", [29333]], [[194854, 194854], "mapped", [149301]], [[194855, 194855], "mapped", [149524]], [[194856, 194856], "mapped", [29562]], [[194857, 194857], "mapped", [29579]], [[194858, 194858], "mapped", [16044]], [[194859, 194859], "mapped", [29605]], [[194860, 194861], "mapped", [16056]], [[194862, 194862], "mapped", [29767]], [[194863, 194863], "mapped", [29788]], [[194864, 194864], "mapped", [29809]], [[194865, 194865], "mapped", [29829]], [[194866, 194866], "mapped", [29898]], [[194867, 194867], "mapped", [16155]], [[194868, 194868], "mapped", [29988]], [[194869, 194869], "mapped", [150582]], [[194870, 194870], "mapped", [30014]], [[194871, 194871], "mapped", [150674]], [[194872, 194872], "mapped", [30064]], [[194873, 194873], "mapped", [139679]], [[194874, 194874], "mapped", [30224]], [[194875, 194875], "mapped", [151457]], [[194876, 194876], "mapped", [151480]], [[194877, 194877], "mapped", [151620]], [[194878, 194878], "mapped", [16380]], [[194879, 194879], "mapped", [16392]], [[194880, 194880], "mapped", [30452]], [[194881, 194881], "mapped", [151795]], [[194882, 194882], "mapped", [151794]], [[194883, 194883], "mapped", [151833]], [[194884, 194884], "mapped", [151859]], [[194885, 194885], "mapped", [30494]], [[194886, 194887], "mapped", [30495]], [[194888, 194888], "mapped", [30538]], [[194889, 194889], "mapped", [16441]], [[194890, 194890], "mapped", [30603]], [[194891, 194891], "mapped", [16454]], [[194892, 194892], "mapped", [16534]], [[194893, 194893], "mapped", [152605]], [[194894, 194894], "mapped", [30798]], [[194895, 194895], "mapped", [30860]], [[194896, 194896], "mapped", [30924]], [[194897, 194897], "mapped", [16611]], [[194898, 194898], "mapped", [153126]], [[194899, 194899], "mapped", [31062]], [[194900, 194900], "mapped", [153242]], [[194901, 194901], "mapped", [153285]], [[194902, 194902], "mapped", [31119]], [[194903, 194903], "mapped", [31211]], [[194904, 194904], "mapped", [16687]], [[194905, 194905], "mapped", [31296]], [[194906, 194906], "mapped", [31306]], [[194907, 194907], "mapped", [31311]], [[194908, 194908], "mapped", [153980]], [[194909, 194910], "mapped", [154279]], [[194911, 194911], "disallowed"], [[194912, 194912], "mapped", [16898]], [[194913, 194913], "mapped", [154539]], [[194914, 194914], "mapped", [31686]], [[194915, 194915], "mapped", [31689]], [[194916, 194916], "mapped", [16935]], [[194917, 194917], "mapped", [154752]], [[194918, 194918], "mapped", [31954]], [[194919, 194919], "mapped", [17056]], [[194920, 194920], "mapped", [31976]], [[194921, 194921], "mapped", [31971]], [[194922, 194922], "mapped", [32e3]], [[194923, 194923], "mapped", [155526]], [[194924, 194924], "mapped", [32099]], [[194925, 194925], "mapped", [17153]], [[194926, 194926], "mapped", [32199]], [[194927, 194927], "mapped", [32258]], [[194928, 194928], "mapped", [32325]], [[194929, 194929], "mapped", [17204]], [[194930, 194930], "mapped", [156200]], [[194931, 194931], "mapped", [156231]], [[194932, 194932], "mapped", [17241]], [[194933, 194933], "mapped", [156377]], [[194934, 194934], "mapped", [32634]], [[194935, 194935], "mapped", [156478]], [[194936, 194936], "mapped", [32661]], [[194937, 194937], "mapped", [32762]], [[194938, 194938], "mapped", [32773]], [[194939, 194939], "mapped", [156890]], [[194940, 194940], "mapped", [156963]], [[194941, 194941], "mapped", [32864]], [[194942, 194942], "mapped", [157096]], [[194943, 194943], "mapped", [32880]], [[194944, 194944], "mapped", [144223]], [[194945, 194945], "mapped", [17365]], [[194946, 194946], "mapped", [32946]], [[194947, 194947], "mapped", [33027]], [[194948, 194948], "mapped", [17419]], [[194949, 194949], "mapped", [33086]], [[194950, 194950], "mapped", [23221]], [[194951, 194951], "mapped", [157607]], [[194952, 194952], "mapped", [157621]], [[194953, 194953], "mapped", [144275]], [[194954, 194954], "mapped", [144284]], [[194955, 194955], "mapped", [33281]], [[194956, 194956], "mapped", [33284]], [[194957, 194957], "mapped", [36766]], [[194958, 194958], "mapped", [17515]], [[194959, 194959], "mapped", [33425]], [[194960, 194960], "mapped", [33419]], [[194961, 194961], "mapped", [33437]], [[194962, 194962], "mapped", [21171]], [[194963, 194963], "mapped", [33457]], [[194964, 194964], "mapped", [33459]], [[194965, 194965], "mapped", [33469]], [[194966, 194966], "mapped", [33510]], [[194967, 194967], "mapped", [158524]], [[194968, 194968], "mapped", [33509]], [[194969, 194969], "mapped", [33565]], [[194970, 194970], "mapped", [33635]], [[194971, 194971], "mapped", [33709]], [[194972, 194972], "mapped", [33571]], [[194973, 194973], "mapped", [33725]], [[194974, 194974], "mapped", [33767]], [[194975, 194975], "mapped", [33879]], [[194976, 194976], "mapped", [33619]], [[194977, 194977], "mapped", [33738]], [[194978, 194978], "mapped", [33740]], [[194979, 194979], "mapped", [33756]], [[194980, 194980], "mapped", [158774]], [[194981, 194981], "mapped", [159083]], [[194982, 194982], "mapped", [158933]], [[194983, 194983], "mapped", [17707]], [[194984, 194984], "mapped", [34033]], [[194985, 194985], "mapped", [34035]], [[194986, 194986], "mapped", [34070]], [[194987, 194987], "mapped", [160714]], [[194988, 194988], "mapped", [34148]], [[194989, 194989], "mapped", [159532]], [[194990, 194990], "mapped", [17757]], [[194991, 194991], "mapped", [17761]], [[194992, 194992], "mapped", [159665]], [[194993, 194993], "mapped", [159954]], [[194994, 194994], "mapped", [17771]], [[194995, 194995], "mapped", [34384]], [[194996, 194996], "mapped", [34396]], [[194997, 194997], "mapped", [34407]], [[194998, 194998], "mapped", [34409]], [[194999, 194999], "mapped", [34473]], [[195e3, 195e3], "mapped", [34440]], [[195001, 195001], "mapped", [34574]], [[195002, 195002], "mapped", [34530]], [[195003, 195003], "mapped", [34681]], [[195004, 195004], "mapped", [34600]], [[195005, 195005], "mapped", [34667]], [[195006, 195006], "mapped", [34694]], [[195007, 195007], "disallowed"], [[195008, 195008], "mapped", [34785]], [[195009, 195009], "mapped", [34817]], [[195010, 195010], "mapped", [17913]], [[195011, 195011], "mapped", [34912]], [[195012, 195012], "mapped", [34915]], [[195013, 195013], "mapped", [161383]], [[195014, 195014], "mapped", [35031]], [[195015, 195015], "mapped", [35038]], [[195016, 195016], "mapped", [17973]], [[195017, 195017], "mapped", [35066]], [[195018, 195018], "mapped", [13499]], [[195019, 195019], "mapped", [161966]], [[195020, 195020], "mapped", [162150]], [[195021, 195021], "mapped", [18110]], [[195022, 195022], "mapped", [18119]], [[195023, 195023], "mapped", [35488]], [[195024, 195024], "mapped", [35565]], [[195025, 195025], "mapped", [35722]], [[195026, 195026], "mapped", [35925]], [[195027, 195027], "mapped", [162984]], [[195028, 195028], "mapped", [36011]], [[195029, 195029], "mapped", [36033]], [[195030, 195030], "mapped", [36123]], [[195031, 195031], "mapped", [36215]], [[195032, 195032], "mapped", [163631]], [[195033, 195033], "mapped", [133124]], [[195034, 195034], "mapped", [36299]], [[195035, 195035], "mapped", [36284]], [[195036, 195036], "mapped", [36336]], [[195037, 195037], "mapped", [133342]], [[195038, 195038], "mapped", [36564]], [[195039, 195039], "mapped", [36664]], [[195040, 195040], "mapped", [165330]], [[195041, 195041], "mapped", [165357]], [[195042, 195042], "mapped", [37012]], [[195043, 195043], "mapped", [37105]], [[195044, 195044], "mapped", [37137]], [[195045, 195045], "mapped", [165678]], [[195046, 195046], "mapped", [37147]], [[195047, 195047], "mapped", [37432]], [[195048, 195048], "mapped", [37591]], [[195049, 195049], "mapped", [37592]], [[195050, 195050], "mapped", [37500]], [[195051, 195051], "mapped", [37881]], [[195052, 195052], "mapped", [37909]], [[195053, 195053], "mapped", [166906]], [[195054, 195054], "mapped", [38283]], [[195055, 195055], "mapped", [18837]], [[195056, 195056], "mapped", [38327]], [[195057, 195057], "mapped", [167287]], [[195058, 195058], "mapped", [18918]], [[195059, 195059], "mapped", [38595]], [[195060, 195060], "mapped", [23986]], [[195061, 195061], "mapped", [38691]], [[195062, 195062], "mapped", [168261]], [[195063, 195063], "mapped", [168474]], [[195064, 195064], "mapped", [19054]], [[195065, 195065], "mapped", [19062]], [[195066, 195066], "mapped", [38880]], [[195067, 195067], "mapped", [168970]], [[195068, 195068], "mapped", [19122]], [[195069, 195069], "mapped", [169110]], [[195070, 195071], "mapped", [38923]], [[195072, 195072], "mapped", [38953]], [[195073, 195073], "mapped", [169398]], [[195074, 195074], "mapped", [39138]], [[195075, 195075], "mapped", [19251]], [[195076, 195076], "mapped", [39209]], [[195077, 195077], "mapped", [39335]], [[195078, 195078], "mapped", [39362]], [[195079, 195079], "mapped", [39422]], [[195080, 195080], "mapped", [19406]], [[195081, 195081], "mapped", [170800]], [[195082, 195082], "mapped", [39698]], [[195083, 195083], "mapped", [4e4]], [[195084, 195084], "mapped", [40189]], [[195085, 195085], "mapped", [19662]], [[195086, 195086], "mapped", [19693]], [[195087, 195087], "mapped", [40295]], [[195088, 195088], "mapped", [172238]], [[195089, 195089], "mapped", [19704]], [[195090, 195090], "mapped", [172293]], [[195091, 195091], "mapped", [172558]], [[195092, 195092], "mapped", [172689]], [[195093, 195093], "mapped", [40635]], [[195094, 195094], "mapped", [19798]], [[195095, 195095], "mapped", [40697]], [[195096, 195096], "mapped", [40702]], [[195097, 195097], "mapped", [40709]], [[195098, 195098], "mapped", [40719]], [[195099, 195099], "mapped", [40726]], [[195100, 195100], "mapped", [40763]], [[195101, 195101], "mapped", [173568]], [[195102, 196605], "disallowed"], [[196606, 196607], "disallowed"], [[196608, 262141], "disallowed"], [[262142, 262143], "disallowed"], [[262144, 327677], "disallowed"], [[327678, 327679], "disallowed"], [[327680, 393213], "disallowed"], [[393214, 393215], "disallowed"], [[393216, 458749], "disallowed"], [[458750, 458751], "disallowed"], [[458752, 524285], "disallowed"], [[524286, 524287], "disallowed"], [[524288, 589821], "disallowed"], [[589822, 589823], "disallowed"], [[589824, 655357], "disallowed"], [[655358, 655359], "disallowed"], [[655360, 720893], "disallowed"], [[720894, 720895], "disallowed"], [[720896, 786429], "disallowed"], [[786430, 786431], "disallowed"], [[786432, 851965], "disallowed"], [[851966, 851967], "disallowed"], [[851968, 917501], "disallowed"], [[917502, 917503], "disallowed"], [[917504, 917504], "disallowed"], [[917505, 917505], "disallowed"], [[917506, 917535], "disallowed"], [[917536, 917631], "disallowed"], [[917632, 917759], "disallowed"], [[917760, 917999], "ignored"], [[918e3, 983037], "disallowed"], [[983038, 983039], "disallowed"], [[983040, 1048573], "disallowed"], [[1048574, 1048575], "disallowed"], [[1048576, 1114109], "disallowed"], [[1114110, 1114111], "disallowed"]]; - } -}); - -// ../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/index.js -var require_tr46 = __commonJS({ - "../../node_modules/.pnpm/tr46@0.0.3/node_modules/tr46/index.js"(exports2, module2) { - "use strict"; - var punycode = require("punycode"); - var mappingTable = require_mappingTable(); - var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1 - }; - function normalize(str) { - return str.split("\0").map(function(s) { - return s.normalize("NFC"); - }).join("\0"); - } - function findStatus(val) { - var start = 0; - var end = mappingTable.length - 1; - while (start <= end) { - var mid = Math.floor((start + end) / 2); - var target = mappingTable[mid]; - if (target[0][0] <= val && target[0][1] >= val) { - return target; - } else if (target[0][0] > val) { - end = mid - 1; - } else { - start = mid + 1; - } - } - return null; - } - var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - function countSymbols(string2) { - return string2.replace(regexAstralSymbols, "_").length; - } - function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; - var len = countSymbols(domain_name); - for (var i = 0; i < len; ++i) { - var codePoint = domain_name.codePointAt(i); - var status = findStatus(codePoint); - switch (status[1]) { - case "disallowed": - hasError = true; - processed += String.fromCodePoint(codePoint); - break; - case "ignored": - break; - case "mapped": - processed += String.fromCodePoint.apply(String, status[2]); - break; - case "deviation": - if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { - processed += String.fromCodePoint.apply(String, status[2]); - } else { - processed += String.fromCodePoint(codePoint); - } - break; - case "valid": - processed += String.fromCodePoint(codePoint); - break; - case "disallowed_STD3_mapped": - if (useSTD3) { - hasError = true; - processed += String.fromCodePoint(codePoint); - } else { - processed += String.fromCodePoint.apply(String, status[2]); - } - break; - case "disallowed_STD3_valid": - if (useSTD3) { - hasError = true; - } - processed += String.fromCodePoint(codePoint); - break; - } - } - return { - string: processed, - error: hasError - }; - } - var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; - function validateLabel(label, processing_option) { - if (label.substr(0, 4) === "xn--") { - label = punycode.toUnicode(label); - processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; - } - var error = false; - if (normalize(label) !== label || label[3] === "-" && label[4] === "-" || label[0] === "-" || label[label.length - 1] === "-" || label.indexOf(".") !== -1 || label.search(combiningMarksRegex) === 0) { - error = true; - } - var len = countSymbols(label); - for (var i = 0; i < len; ++i) { - var status = findStatus(label.codePointAt(i)); - if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") { - error = true; - break; - } - } - return { - label, - error - }; - } - function processing(domain_name, useSTD3, processing_option) { - var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); - var labels = result.string.split("."); - for (var i = 0; i < labels.length; ++i) { - try { - var validation = validateLabel(labels[i]); - labels[i] = validation.label; - result.error = result.error || validation.error; - } catch (e) { - result.error = true; - } - } - return { - string: labels.join("."), - error: result.error - }; - } - module2.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { - var result = processing(domain_name, useSTD3, processing_option); - var labels = result.string.split("."); - labels = labels.map(function(l) { - try { - return punycode.toASCII(l); - } catch (e) { - result.error = true; - return l; - } - }); - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result.error = true; - } - for (var i = 0; i < labels.length; ++i) { - if (labels.length > 63 || labels.length === 0) { - result.error = true; - break; - } - } - } - if (result.error) - return null; - return labels.join("."); - }; - module2.exports.toUnicode = function(domain_name, useSTD3) { - var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); - return { - domain: result.string, - error: result.error - }; - }; - module2.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; - } -}); - -// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/url-state-machine.js -var require_url_state_machine = __commonJS({ - "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/url-state-machine.js"(exports2, module2) { - "use strict"; - var punycode = require("punycode"); - var tr46 = require_tr46(); - var specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 - }; - var failure = Symbol("failure"); - function countSymbols(str) { - return punycode.ucs2.decode(str).length; - } - function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? void 0 : String.fromCodePoint(c); - } - function isASCIIDigit(c) { - return c >= 48 && c <= 57; - } - function isASCIIAlpha(c) { - return c >= 65 && c <= 90 || c >= 97 && c <= 122; - } - function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); - } - function isASCIIHex(c) { - return isASCIIDigit(c) || c >= 65 && c <= 70 || c >= 97 && c <= 102; - } - function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; - } - function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; - } - function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); - } - function isWindowsDriveLetterString(string2) { - return string2.length === 2 && isASCIIAlpha(string2.codePointAt(0)) && (string2[1] === ":" || string2[1] === "|"); - } - function isNormalizedWindowsDriveLetterString(string2) { - return string2.length === 2 && isASCIIAlpha(string2.codePointAt(0)) && string2[1] === ":"; - } - function containsForbiddenHostCodePoint(string2) { - return string2.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; - } - function containsForbiddenHostCodePointExcludingPercent(string2) { - return string2.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; - } - function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== void 0; - } - function isSpecial(url) { - return isSpecialScheme(url.scheme); - } - function defaultPort(scheme) { - return specialSchemes[scheme]; - } - function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; - } - return "%" + hex; - } - function utf8PercentEncode(c) { - const buf = new Buffer(c); - let str = ""; - for (let i = 0; i < buf.length; ++i) { - str += percentEncode(buf[i]); - } - return str; - } - function utf8PercentDecode(str) { - const input = new Buffer(str); - const output = []; - for (let i = 0; i < input.length; ++i) { - if (input[i] !== 37) { - output.push(input[i]); - } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { - output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); - i += 2; - } else { - output.push(input[i]); - } - } - return new Buffer(output).toString(); - } - function isC0ControlPercentEncode(c) { - return c <= 31 || c > 126; - } - var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); - function isPathPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); - } - var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); - function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); - } - function percentEncodeChar(c, encodeSetPredicate) { - const cStr = String.fromCodePoint(c); - if (encodeSetPredicate(c)) { - return utf8PercentEncode(cStr); - } - return cStr; - } - function parseIPv4Number(input) { - let R = 10; - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; - } - if (input === "") { - return 0; - } - const regex = R === 10 ? /[^0-9]/ : R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/; - if (regex.test(input)) { - return failure; - } - return parseInt(input, R); - } - function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } - if (parts.length > 4) { - return input; - } - const numbers = []; - for (const part of parts) { - if (part === "") { - return input; - } - const n = parseIPv4Number(part); - if (n === failure) { - return input; - } - numbers.push(n); - } - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; - } - } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; - } - let ipv4 = numbers.pop(); - let counter = 0; - for (const n of numbers) { - ipv4 += n * Math.pow(256, 3 - counter); - ++counter; - } - return ipv4; - } - function serializeIPv4(address) { - let output = ""; - let n = address; - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = "." + output; - } - n = Math.floor(n / 256); - } - return output; - } - function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - input = punycode.ucs2.decode(input); - if (input[pointer] === 58) { - if (input[pointer + 1] !== 58) { - return failure; - } - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; - } - if (input[pointer] === 58) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - let value = 0; - let length = 0; - while (length < 4 && isASCIIHex(input[pointer])) { - value = value * 16 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; - } - if (input[pointer] === 46) { - if (length === 0) { - return failure; - } - pointer -= length; - if (pieceIndex > 6) { - return failure; - } - let numbersSeen = 0; - while (input[pointer] !== void 0) { - let ipv4Piece = null; - if (numbersSeen > 0) { - if (input[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - if (!isASCIIDigit(input[pointer])) { - return failure; - } - while (isASCIIDigit(input[pointer])) { - const number2 = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number2; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number2; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; - ++numbersSeen; - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - if (numbersSeen !== 4) { - return failure; - } - break; - } else if (input[pointer] === 58) { - ++pointer; - if (input[pointer] === void 0) { - return failure; - } - } else if (input[pointer] !== void 0) { - return failure; - } - address[pieceIndex] = value; - ++pieceIndex; - } - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } - return address; - } - function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress = seqResult.idx; - let ignore0 = false; - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - output += address[pieceIndex].toString(16); - if (pieceIndex !== 7) { - output += ":"; - } - } - return output; - } - function parseHost(input, isSpecialArg) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; - } - return parseIPv6(input.substring(1, input.length - 1)); - } - if (!isSpecialArg) { - return parseOpaqueHost(input); - } - const domain = utf8PercentDecode(input); - const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); - if (asciiDomain === null) { - return failure; - } - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; - } - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; - } - return asciiDomain; - } - function parseOpaqueHost(input) { - if (containsForbiddenHostCodePointExcludingPercent(input)) { - return failure; - } - let output = ""; - const decoded = punycode.ucs2.decode(input); - for (let i = 0; i < decoded.length; ++i) { - output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); - } - return output; - } - function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; - let currStart = null; - let currLen = 0; - for (let i = 0; i < arr.length; ++i) { - if (arr[i] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i; - } - ++currLen; - } - } - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - return { - idx: maxIdx, - len: maxLen - }; - } - function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; - } - return host; - } - function trimControlChars(url) { - return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); - } - function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/g, ""); - } - function shortenPath(url) { - const path2 = url.path; - if (path2.length === 0) { - return; - } - if (url.scheme === "file" && path2.length === 1 && isNormalizedWindowsDriveLetter(path2[0])) { - return; - } - path2.pop(); - } - function includesCredentials(url) { - return url.username !== "" || url.password !== ""; - } - function cannotHaveAUsernamePasswordPort(url) { - return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; - } - function isNormalizedWindowsDriveLetter(string2) { - return /^[A-Za-z]:$/.test(string2); - } - function URLStateMachine(input, base, encodingOverride, url, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null, - cannotBeABaseURL: false - }; - const res2 = trimControlChars(this.input); - if (res2 !== this.input) { - this.parseError = true; - } - this.input = res2; - } - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - this.state = stateOverride || "scheme start"; - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - this.input = punycode.ucs2.decode(this.input); - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? void 0 : String.fromCodePoint(c); - const ret = this["parse " + this.state](c, cStr); - if (!ret) { - break; - } else if (ret === failure) { - this.failure = true; - break; - } - } - } - URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { - if (isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - return true; - }; - URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c === 58) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } - if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { - return false; - } - } - this.url.scheme = this.buffer; - this.buffer = ""; - if (this.stateOverride) { - return false; - } - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === 47) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.cannotBeABaseURL = true; - this.url.path.push(""); - this.state = "cannot-be-a-base-URL path"; - } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; - } - return true; - }; - URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || this.base.cannotBeABaseURL && c !== 35) { - return failure; - } else if (this.base.cannotBeABaseURL && c === 35) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.url.cannotBeABaseURL = true; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { - if (c === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (isNaN(c)) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 47) { - this.state = "relative slash"; - } else if (c === 63) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (isSpecial(this.url) && c === 92) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(0, this.base.path.length - 1); - this.state = "path"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === 47 || c === 92)) { - if (c === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === 47) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== 47 && c !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - return true; - }; - URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { - if (c === 64) { - this.parseError = true; - if (this.atFlag) { - this.buffer = "%40" + this.buffer; - } - this.atFlag = true; - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); - if (codePoint === 58 && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || isSpecial(this.url) && c === 92) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; - } - return true; - }; - URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === 58 && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - this.url.host = host; - this.buffer = ""; - this.state = "port"; - if (this.stateOverride === "hostname") { - return false; - } - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || isSpecial(this.url) && c === 92) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === 91) { - this.arrFlag = true; - } else if (c === 93) { - this.arrFlag = false; - } - this.buffer += cStr; - } - return true; - }; - URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (isASCIIDigit(c)) { - this.buffer += cStr; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || isSpecial(this.url) && c === 92 || this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > Math.pow(2, 16) - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - return true; - }; - var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([47, 92, 63, 35]); - URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points - !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points - !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - shortenPath(this.url); - } else { - this.parseError = true; - } - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } else { - this.url.host = this.base.host; - } - } - this.state = "path"; - --this.pointer; - } - return true; - }; - URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { - if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - if (this.stateOverride) { - return false; - } - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; - } - return true; - }; - URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === 92) { - this.parseError = true; - } - this.state = "path"; - if (c !== 47 && c !== 92) { - --this.pointer; - } - } else if (!this.stateOverride && c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== void 0) { - this.state = "path"; - if (c !== 47) { - --this.pointer; - } - } - return true; - }; - URLStateMachine.prototype["parse path"] = function parsePath(c) { - if (isNaN(c) || c === 47 || isSpecial(this.url) && c === 92 || !this.stateOverride && (c === 63 || c === 35)) { - if (isSpecial(this.url) && c === 92) { - this.parseError = true; - } - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== 47 && !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c !== 47 && !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - if (this.url.host !== "" && this.url.host !== null) { - this.parseError = true; - this.url.host = ""; - } - this.buffer = this.buffer[0] + ":"; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if (this.url.scheme === "file" && (c === void 0 || c === 63 || c === 35)) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); - } - } - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - if (c === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.buffer += percentEncodeChar(c, isPathPercentEncode); - } - return true; - }; - URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (!isNaN(c) && c !== 37) { - this.parseError = true; - } - if (c === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - if (!isNaN(c)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); - } - } - return true; - }; - URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (isNaN(c) || !this.stateOverride && c === 35) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - const buffer = new Buffer(this.buffer); - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] < 33 || buffer[i] > 126 || buffer[i] === 34 || buffer[i] === 35 || buffer[i] === 60 || buffer[i] === 62) { - this.url.query += percentEncode(buffer[i]); - } else { - this.url.query += String.fromCodePoint(buffer[i]); - } - } - this.buffer = ""; - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - if (c === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.buffer += cStr; - } - return true; - }; - URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (isNaN(c)) { - } else if (c === 0) { - this.parseError = true; - } else { - if (c === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); - } - return true; - }; - function serializeURL(url, excludeFragment) { - let output = url.scheme + ":"; - if (url.host !== null) { - output += "//"; - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += ":" + url.password; - } - output += "@"; - } - output += serializeHost(url.host); - if (url.port !== null) { - output += ":" + url.port; - } - } else if (url.host === null && url.scheme === "file") { - output += "//"; - } - if (url.cannotBeABaseURL) { - output += url.path[0]; - } else { - for (const string2 of url.path) { - output += "/" + string2; - } - } - if (url.query !== null) { - output += "?" + url.query; - } - if (!excludeFragment && url.fragment !== null) { - output += "#" + url.fragment; - } - return output; - } - function serializeOrigin(tuple2) { - let result = tuple2.scheme + "://"; - result += serializeHost(tuple2.host); - if (tuple2.port !== null) { - result += ":" + tuple2.port; - } - return result; - } - module2.exports.serializeURL = serializeURL; - module2.exports.serializeURLOrigin = function(url) { - switch (url.scheme) { - case "blob": - try { - return module2.exports.serializeURLOrigin(module2.exports.parseURL(url.path[0])); - } catch (e) { - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port - }); - case "file": - return "file://"; - default: - return "null"; - } - }; - module2.exports.basicURLParse = function(input, options) { - if (options === void 0) { - options = {}; - } - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return "failure"; - } - return usm.url; - }; - module2.exports.setTheUsername = function(url, username) { - url.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i = 0; i < decoded.length; ++i) { - url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } - }; - module2.exports.setThePassword = function(url, password) { - url.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i = 0; i < decoded.length; ++i) { - url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } - }; - module2.exports.serializeHost = serializeHost; - module2.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - module2.exports.serializeInteger = function(integer) { - return String(integer); - }; - module2.exports.parseURL = function(input, options) { - if (options === void 0) { - options = {}; - } - return module2.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); - }; - } -}); - -// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL-impl.js -var require_URL_impl = __commonJS({ - "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL-impl.js"(exports2) { - "use strict"; - var usm = require_url_state_machine(); - exports2.implementation = class URLImpl { - constructor(constructorArgs) { - const url = constructorArgs[0]; - const base = constructorArgs[1]; - let parsedBase = null; - if (base !== void 0) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === "failure") { - throw new TypeError("Invalid base URL"); - } - } - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - this._url = parsedURL; - } - get href() { - return usm.serializeURL(this._url); - } - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - this._url = parsedURL; - } - get origin() { - return usm.serializeURLOrigin(this._url); - } - get protocol() { - return this._url.scheme + ":"; - } - set protocol(v) { - usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); - } - get username() { - return this._url.username; - } - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - usm.setTheUsername(this._url, v); - } - get password() { - return this._url.password; - } - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - usm.setThePassword(this._url, v); - } - get host() { - const url = this._url; - if (url.host === null) { - return ""; - } - if (url.port === null) { - return usm.serializeHost(url.host); - } - return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port); - } - set host(v) { - if (this._url.cannotBeABaseURL) { - return; - } - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } - get hostname() { - if (this._url.host === null) { - return ""; - } - return usm.serializeHost(this._url.host); - } - set hostname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } - get port() { - if (this._url.port === null) { - return ""; - } - return usm.serializeInteger(this._url.port); - } - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } - get pathname() { - if (this._url.cannotBeABaseURL) { - return this._url.path[0]; - } - if (this._url.path.length === 0) { - return ""; - } - return "/" + this._url.path.join("/"); - } - set pathname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } - return "?" + this._url.query; - } - set search(v) { - const url = this._url; - if (v === "") { - url.query = null; - return; - } - const input = v[0] === "?" ? v.substring(1) : v; - url.query = ""; - usm.basicURLParse(input, { url, stateOverride: "query" }); - } - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } - return "#" + this._url.fragment; - } - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; - } - const input = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); - } - toJSON() { - return this.href; - } - }; - } -}); - -// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL.js -var require_URL = __commonJS({ - "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL.js"(exports2, module2) { - "use strict"; - var conversions = require_lib3(); - var utils = require_utils3(); - var Impl = require_URL_impl(); - var impl = utils.implSymbol; - function URL4(url) { - if (!this || this[impl] || !(this instanceof URL4)) { - throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); - } - if (arguments.length < 1) { - throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); - } - const args = []; - for (let i = 0; i < arguments.length && i < 2; ++i) { - args[i] = arguments[i]; - } - args[0] = conversions["USVString"](args[0]); - if (args[1] !== void 0) { - args[1] = conversions["USVString"](args[1]); - } - module2.exports.setup(this, args); - } - URL4.prototype.toJSON = function toJSON() { - if (!this || !module2.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - const args = []; - for (let i = 0; i < arguments.length && i < 0; ++i) { - args[i] = arguments[i]; - } - return this[impl].toJSON.apply(this[impl], args); - }; - Object.defineProperty(URL4.prototype, "href", { - get() { - return this[impl].href; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].href = V; - }, - enumerable: true, - configurable: true - }); - URL4.prototype.toString = function() { - if (!this || !module2.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - return this.href; - }; - Object.defineProperty(URL4.prototype, "origin", { - get() { - return this[impl].origin; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "protocol", { - get() { - return this[impl].protocol; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].protocol = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "username", { - get() { - return this[impl].username; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].username = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "password", { - get() { - return this[impl].password; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].password = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "host", { - get() { - return this[impl].host; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].host = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "hostname", { - get() { - return this[impl].hostname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hostname = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "port", { - get() { - return this[impl].port; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].port = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "pathname", { - get() { - return this[impl].pathname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].pathname = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "search", { - get() { - return this[impl].search; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].search = V; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(URL4.prototype, "hash", { - get() { - return this[impl].hash; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hash = V; - }, - enumerable: true, - configurable: true - }); - module2.exports = { - is(obj) { - return !!obj && obj[impl] instanceof Impl.implementation; - }, - create(constructorArgs, privateData) { - let obj = Object.create(URL4.prototype); - this.setup(obj, constructorArgs, privateData); - return obj; - }, - setup(obj, constructorArgs, privateData) { - if (!privateData) - privateData = {}; - privateData.wrapper = obj; - obj[impl] = new Impl.implementation(constructorArgs, privateData); - obj[impl][utils.wrapperSymbol] = obj; - }, - interface: URL4, - expose: { - Window: { URL: URL4 }, - Worker: { URL: URL4 } - } - }; - } -}); - -// ../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/public-api.js -var require_public_api = __commonJS({ - "../../node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/public-api.js"(exports2) { - "use strict"; - exports2.URL = require_URL().interface; - exports2.serializeURL = require_url_state_machine().serializeURL; - exports2.serializeURLOrigin = require_url_state_machine().serializeURLOrigin; - exports2.basicURLParse = require_url_state_machine().basicURLParse; - exports2.setTheUsername = require_url_state_machine().setTheUsername; - exports2.setThePassword = require_url_state_machine().setThePassword; - exports2.serializeHost = require_url_state_machine().serializeHost; - exports2.serializeInteger = require_url_state_machine().serializeInteger; - exports2.parseURL = require_url_state_machine().parseURL; - } -}); - -// ../../node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.mjs -function FetchError(message, type2, systemError) { - Error.call(this, message); - this.message = message; - this.type = type2; - if (systemError) { - this.code = this.errno = systemError.code; - } - Error.captureStackTrace(this, this.constructor); -} -function Body(body) { - var _this = this; - var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; - let size = _ref$size === void 0 ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === void 0 ? 0 : _ref$timeout; - if (body == null) { - body = null; - } else if (isURLSearchParams(body)) { - body = Buffer.from(body.toString()); - } else if (isBlob(body)) - ; - else if (Buffer.isBuffer(body)) - ; - else if (Object.prototype.toString.call(body) === "[object ArrayBuffer]") { - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof import_stream.default) - ; - else { - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - if (body instanceof import_stream.default) { - body.on("error", function(err) { - const error = err.name === "AbortError" ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); - _this[INTERNALS].error = error; - }); - } -} -function consumeBody() { - var _this4 = this; - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - this[INTERNALS].disturbed = true; - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - let body = this.body; - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - if (isBlob(body)) { - body = body.stream(); - } - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - if (!(body instanceof import_stream.default)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - let accum = []; - let accumBytes = 0; - let abort = false; - return new Body.Promise(function(resolve, reject) { - let resTimeout; - if (_this4.timeout) { - resTimeout = setTimeout(function() { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); - }, _this4.timeout); - } - body.on("error", function(err) { - if (err.name === "AbortError") { - abort = true; - reject(err); - } else { - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); - } - }); - body.on("data", function(chunk) { - if (abort || chunk === null) { - return; - } - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); - return; - } - accumBytes += chunk.length; - accum.push(chunk); - }); - body.on("end", function() { - if (abort) { - return; - } - clearTimeout(resTimeout); - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); - } - }); - }); -} -function convertBody(buffer, headers) { - if (typeof convert !== "function") { - throw new Error("The package `encoding` must be installed to use the textConverted() function"); - } - const ct = headers.get("content-type"); - let charset = "utf-8"; - let res, str; - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - str = buffer.slice(0, 1024).toString(); - if (!res && str) { - res = / 1 && arguments[1] !== void 0 ? arguments[1] : "key+value"; - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === "key" ? function(k) { - return k.toLowerCase(); - } : kind === "value" ? function(k) { - return headers[MAP][k].join(", "); - } : function(k) { - return [k.toLowerCase(), headers[MAP][k].join(", ")]; - }); -} -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - const hostHeaderKey = find(headers[MAP], "Host"); - if (hostHeaderKey !== void 0) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - return obj; -} -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === void 0) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} -function parseURL(urlStr) { - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL3(urlStr).toString(); - } - return parse_url(urlStr); -} -function isRequest(input) { - return typeof input === "object" && typeof input[INTERNALS$2] === "object"; -} -function isAbortSignal(signal) { - const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === "AbortSignal"); -} -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - if (!headers.has("Accept")) { - headers.set("Accept", "*/*"); - } - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError("Only absolute URLs are supported"); - } - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError("Only HTTP(S) protocols are supported"); - } - if (request.signal && request.body instanceof import_stream.default.Readable && !streamDestructionSupported) { - throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); - } - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = "0"; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === "number") { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set("Content-Length", contentLengthValue); - } - if (!headers.has("User-Agent")) { - headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"); - } - if (request.compress && !headers.has("Accept-Encoding")) { - headers.set("Accept-Encoding", "gzip,deflate"); - } - let agent2 = request.agent; - if (typeof agent2 === "function") { - agent2 = agent2(parsedURL); - } - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent: agent2 - }); -} -function AbortError(message) { - Error.call(this, message); - this.type = "aborted"; - this.message = message; - Error.captureStackTrace(this, this.constructor); -} -function fetch2(url, opts) { - if (!fetch2.Promise) { - throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); - } - Body.Promise = fetch2.Promise; - return new fetch2.Promise(function(resolve, reject) { - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - const send = (options.protocol === "https:" ? import_https.default : import_http.default).request; - const signal = request.signal; - let response = null; - const abort = function abort2() { - let error = new AbortError("The user aborted a request."); - reject(error); - if (request.body && request.body instanceof import_stream.default.Readable) { - destroyStream(request.body, error); - } - if (!response || !response.body) - return; - response.body.emit("error", error); - }; - if (signal && signal.aborted) { - abort(); - return; - } - const abortAndFinalize = function abortAndFinalize2() { - abort(); - finalize(); - }; - const req = send(options); - let reqTimeout; - if (signal) { - signal.addEventListener("abort", abortAndFinalize); - } - function finalize() { - req.abort(); - if (signal) - signal.removeEventListener("abort", abortAndFinalize); - clearTimeout(reqTimeout); - } - if (request.timeout) { - req.once("socket", function(socket) { - reqTimeout = setTimeout(function() { - reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout")); - finalize(); - }, request.timeout); - }); - } - req.on("error", function(err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err)); - if (response && response.body) { - destroyStream(response.body, err); - } - finalize(); - }); - fixResponseChunkedTransferBadEnding(req, function(err) { - if (signal && signal.aborted) { - return; - } - if (response && response.body) { - destroyStream(response.body, err); - } - }); - if (parseInt(process.version.substring(1)) < 14) { - req.on("socket", function(s) { - s.addListener("close", function(hadError) { - const hasDataListener = s.listenerCount("data") > 0; - if (response && hasDataListener && !hadError && !(signal && signal.aborted)) { - const err = new Error("Premature close"); - err.code = "ERR_STREAM_PREMATURE_CLOSE"; - response.body.emit("error", err); - } - }); - }); - } - req.on("response", function(res) { - clearTimeout(reqTimeout); - const headers = createHeadersLenient(res.headers); - if (fetch2.isRedirect(res.statusCode)) { - const location = headers.get("Location"); - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - if (request.redirect !== "manual") { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, "invalid-redirect")); - finalize(); - return; - } - } - switch (request.redirect) { - case "error": - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, "no-redirect")); - finalize(); - return; - case "manual": - if (locationURL !== null) { - try { - headers.set("Location", locationURL); - } catch (err) { - reject(err); - } - } - break; - case "follow": - if (locationURL === null) { - break; - } - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")); - finalize(); - return; - } - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) { - for (const name of ["authorization", "www-authenticate", "cookie", "cookie2"]) { - requestOpts.headers.delete(name); - } - } - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")); - finalize(); - return; - } - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === "POST") { - requestOpts.method = "GET"; - requestOpts.body = void 0; - requestOpts.headers.delete("content-length"); - } - resolve(fetch2(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - res.once("end", function() { - if (signal) - signal.removeEventListener("abort", abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - const codings = headers.get("Content-Encoding"); - if (!request.compress || request.method === "HEAD" || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - const zlibOptions = { - flush: import_zlib.default.Z_SYNC_FLUSH, - finishFlush: import_zlib.default.Z_SYNC_FLUSH - }; - if (codings == "gzip" || codings == "x-gzip") { - body = body.pipe(import_zlib.default.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - if (codings == "deflate" || codings == "x-deflate") { - const raw = res.pipe(new PassThrough$1()); - raw.once("data", function(chunk) { - if ((chunk[0] & 15) === 8) { - body = body.pipe(import_zlib.default.createInflate()); - } else { - body = body.pipe(import_zlib.default.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - raw.on("end", function() { - if (!response) { - response = new Response(body, response_options); - resolve(response); - } - }); - return; - } - if (codings == "br" && typeof import_zlib.default.createBrotliDecompress === "function") { - body = body.pipe(import_zlib.default.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - response = new Response(body, response_options); - resolve(response); - }); - writeToStream(req, request); - }); -} -function fixResponseChunkedTransferBadEnding(request, errorCallback) { - let socket; - request.on("socket", function(s) { - socket = s; - }); - request.on("response", function(response) { - const headers = response.headers; - if (headers["transfer-encoding"] === "chunked" && !headers["content-length"]) { - response.once("close", function(hadError) { - const hasDataListener = socket && socket.listenerCount("data") > 0; - if (hasDataListener && !hadError) { - const err = new Error("Premature close"); - err.code = "ERR_STREAM_PREMATURE_CLOSE"; - errorCallback(err); - } - }); - } - }); -} -function destroyStream(stream, err) { - if (stream.destroy) { - stream.destroy(err); - } else { - stream.emit("error", err); - stream.end(); - } -} -var import_stream, import_http, import_url, import_whatwg_url, import_https, import_zlib, Readable, BUFFER, TYPE2, Blob2, convert, INTERNALS, PassThrough, invalidTokenRegex, invalidHeaderCharRegex, MAP, Headers, INTERNAL, HeadersIteratorPrototype, INTERNALS$1, STATUS_CODES, Response, INTERNALS$2, URL3, parse_url, format_url, streamDestructionSupported, Request, URL$1, PassThrough$1, isDomainOrSubdomain, isSameProtocol, lib_default; -var init_lib = __esm({ - "../../node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.mjs"() { - import_stream = __toESM(require("stream"), 1); - import_http = __toESM(require("http"), 1); - import_url = __toESM(require("url"), 1); - import_whatwg_url = __toESM(require_public_api(), 1); - import_https = __toESM(require("https"), 1); - import_zlib = __toESM(require("zlib"), 1); - Readable = import_stream.default.Readable; - BUFFER = Symbol("buffer"); - TYPE2 = Symbol("type"); - Blob2 = class _Blob { - constructor() { - this[TYPE2] = ""; - const blobParts = arguments[0]; - const options = arguments[1]; - const buffers = []; - let size = 0; - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof _Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === "string" ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - this[BUFFER] = Buffer.concat(buffers); - let type2 = options && options.type !== void 0 && String(options.type).toLowerCase(); - if (type2 && !/[^\u0020-\u007E]/.test(type2)) { - this[TYPE2] = type2; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE2]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function() { - }; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return "[object Blob]"; - } - slice() { - const size = this.size; - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === void 0) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === void 0) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob3 = new _Blob([], { type: arguments[2] }); - blob3[BUFFER] = slicedBuffer; - return blob3; - } - }; - Object.defineProperties(Blob2.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } - }); - Object.defineProperty(Blob2.prototype, Symbol.toStringTag, { - value: "Blob", - writable: false, - enumerable: false, - configurable: true - }); - FetchError.prototype = Object.create(Error.prototype); - FetchError.prototype.constructor = FetchError; - FetchError.prototype.name = "FetchError"; - try { - convert = require("encoding").convert; - } catch (e) { - } - INTERNALS = Symbol("Body internals"); - PassThrough = import_stream.default.PassThrough; - Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function(buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get("content-type") || ""; - return consumeBody.call(this).then(function(buf) { - return Object.assign( - // Prevent copying - new Blob2([], { - type: ct.toLowerCase() - }), - { - [BUFFER]: buf - } - ); - }); - }, - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - return consumeBody.call(this).then(function(buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); - } - }); - }, - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function(buffer) { - return buffer.toString(); - }); - }, - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - return consumeBody.call(this).then(function(buffer) { - return convertBody(buffer, _this3.headers); - }); - } - }; - Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } - }); - Body.mixIn = function(proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } - }; - Body.Promise = global.Promise; - invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/; - invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; - MAP = Symbol("map"); - Headers = class _Headers { - /** - * Headers class - * - * @param Object headers Response headers - * @return Void - */ - constructor() { - let init = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; - this[MAP] = /* @__PURE__ */ Object.create(null); - if (init instanceof _Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - return; - } - if (init == null) - ; - else if (typeof init === "object") { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== "function") { - throw new TypeError("Header pairs must be iterable"); - } - const pairs = []; - for (const pair of init) { - if (typeof pair !== "object" || typeof pair[Symbol.iterator] !== "function") { - throw new TypeError("Each header pair must be iterable"); - } - pairs.push(Array.from(pair)); - } - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError("Each header pair must be a name/value tuple"); - } - this.append(pair[0], pair[1]); - } - } else { - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError("Provided initializer must be an object"); - } - } - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === void 0) { - return null; - } - return this[MAP][key].join(", "); - } - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], value = _pairs$i[1]; - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== void 0 ? key : name] = [value]; - } - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== void 0) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== void 0; - } - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== void 0) { - delete this[MAP][key]; - } - } - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, "key"); - } - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, "value"); - } - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, "key+value"); - } - }; - Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: "Headers", - writable: false, - enumerable: false, - configurable: true - }); - Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } - }); - INTERNAL = Symbol("internal"); - HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError("Value of `this` is not a HeadersIterator"); - } - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index; - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: void 0, - done: true - }; - } - this[INTERNAL].index = index + 1; - return { - value: values[index], - done: false - }; - } - }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: "HeadersIterator", - writable: false, - enumerable: false, - configurable: true - }); - INTERNALS$1 = Symbol("Response internals"); - STATUS_CODES = import_http.default.STATUS_CODES; - Response = class _Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - Body.call(this, body, opts); - const status = opts.status || 200; - const headers = new Headers(opts.headers); - if (body != null && !headers.has("Content-Type")) { - const contentType = extractContentType(body); - if (contentType) { - headers.append("Content-Type", contentType); - } - } - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - get url() { - return this[INTERNALS$1].url || ""; - } - get status() { - return this[INTERNALS$1].status; - } - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - get redirected() { - return this[INTERNALS$1].counter > 0; - } - get statusText() { - return this[INTERNALS$1].statusText; - } - get headers() { - return this[INTERNALS$1].headers; - } - /** - * Clone this response - * - * @return Response - */ - clone() { - return new _Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } - }; - Body.mixIn(Response.prototype); - Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } - }); - Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: "Response", - writable: false, - enumerable: false, - configurable: true - }); - INTERNALS$2 = Symbol("Request internals"); - URL3 = import_url.default.URL || import_whatwg_url.default.URL; - parse_url = import_url.default.parse; - format_url = import_url.default.format; - streamDestructionSupported = "destroy" in import_stream.default.Readable.prototype; - Request = class _Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - let parsedURL; - if (!isRequest(input)) { - if (input && input.href) { - parsedURL = parseURL(input.href); - } else { - parsedURL = parseURL(`${input}`); - } - input = {}; - } else { - parsedURL = parseURL(input.url); - } - let method = init.method || input.method || "GET"; - method = method.toUpperCase(); - if ((init.body != null || isRequest(input) && input.body !== null) && (method === "GET" || method === "HEAD")) { - throw new TypeError("Request with GET/HEAD method cannot have body"); - } - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - const headers = new Headers(init.headers || input.headers || {}); - if (inputBody != null && !headers.has("Content-Type")) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append("Content-Type", contentType); - } - } - let signal = isRequest(input) ? input.signal : null; - if ("signal" in init) - signal = init.signal; - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError("Expected signal to be an instanceof AbortSignal"); - } - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || "follow", - headers, - parsedURL, - signal - }; - this.follow = init.follow !== void 0 ? init.follow : input.follow !== void 0 ? input.follow : 20; - this.compress = init.compress !== void 0 ? init.compress : input.compress !== void 0 ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - get method() { - return this[INTERNALS$2].method; - } - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - get headers() { - return this[INTERNALS$2].headers; - } - get redirect() { - return this[INTERNALS$2].redirect; - } - get signal() { - return this[INTERNALS$2].signal; - } - /** - * Clone this request - * - * @return Request - */ - clone() { - return new _Request(this); - } - }; - Body.mixIn(Request.prototype); - Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: "Request", - writable: false, - enumerable: false, - configurable: true - }); - Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } - }); - AbortError.prototype = Object.create(Error.prototype); - AbortError.prototype.constructor = AbortError; - AbortError.prototype.name = "AbortError"; - URL$1 = import_url.default.URL || import_whatwg_url.default.URL; - PassThrough$1 = import_stream.default.PassThrough; - isDomainOrSubdomain = function isDomainOrSubdomain2(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; - return orig === dest || orig[orig.length - dest.length - 1] === "." && orig.endsWith(dest); - }; - isSameProtocol = function isSameProtocol2(destination, original) { - const orig = new URL$1(original).protocol; - const dest = new URL$1(destination).protocol; - return orig === dest; - }; - fetch2.isRedirect = function(code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; - }; - fetch2.Promise = global.Promise; - lib_default = fetch2; - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/constants.js -var require_constants3 = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/constants.js"(exports2, module2) { - "use strict"; - var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"]; - var hasBlob = typeof Blob !== "undefined"; - if (hasBlob) - BINARY_TYPES.push("blob"); - module2.exports = { - BINARY_TYPES, - CLOSE_TIMEOUT: 3e4, - EMPTY_BUFFER: Buffer.alloc(0), - GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11", - hasBlob, - kForOnEventAttribute: Symbol("kIsForOnEventAttribute"), - kListener: Symbol("kListener"), - kStatusCode: Symbol("status-code"), - kWebSocket: Symbol("websocket"), - NOOP: () => { - } - }; - } -}); - -// ../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/fallback.js -var require_fallback = __commonJS({ - "../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/fallback.js"(exports2, module2) { - "use strict"; - var mask2 = (source, mask3, output, offset2, length) => { - for (var i = 0; i < length; i++) { - output[offset2 + i] = source[i] ^ mask3[i & 3]; - } - }; - var unmask = (buffer, mask3) => { - const length = buffer.length; - for (var i = 0; i < length; i++) { - buffer[i] ^= mask3[i & 3]; - } - }; - module2.exports = { mask: mask2, unmask }; - } -}); - -// ../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/index.js -var require_bufferutil = __commonJS({ - "../../node_modules/.pnpm/bufferutil@4.1.0/node_modules/bufferutil/index.js"(exports2, module2) { - "use strict"; - try { - module2.exports = require("node-gyp-build")(__dirname); - } catch (e) { - module2.exports = require_fallback(); - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/buffer-util.js -var require_buffer_util = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/buffer-util.js"(exports2, module2) { - "use strict"; - var { EMPTY_BUFFER } = require_constants3(); - var FastBuffer = Buffer[Symbol.species]; - function concat(list, totalLength) { - if (list.length === 0) - return EMPTY_BUFFER; - if (list.length === 1) - return list[0]; - const target = Buffer.allocUnsafe(totalLength); - let offset2 = 0; - for (let i = 0; i < list.length; i++) { - const buf = list[i]; - target.set(buf, offset2); - offset2 += buf.length; - } - if (offset2 < totalLength) { - return new FastBuffer(target.buffer, target.byteOffset, offset2); - } - return target; - } - function _mask(source, mask2, output, offset2, length) { - for (let i = 0; i < length; i++) { - output[offset2 + i] = source[i] ^ mask2[i & 3]; - } - } - function _unmask(buffer, mask2) { - for (let i = 0; i < buffer.length; i++) { - buffer[i] ^= mask2[i & 3]; - } - } - function toArrayBuffer2(buf) { - if (buf.length === buf.buffer.byteLength) { - return buf.buffer; - } - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.length); - } - function toBuffer2(data) { - toBuffer2.readOnly = true; - if (Buffer.isBuffer(data)) - return data; - let buf; - if (data instanceof ArrayBuffer) { - buf = new FastBuffer(data); - } else if (ArrayBuffer.isView(data)) { - buf = new FastBuffer(data.buffer, data.byteOffset, data.byteLength); - } else { - buf = Buffer.from(data); - toBuffer2.readOnly = false; - } - return buf; - } - module2.exports = { - concat, - mask: _mask, - toArrayBuffer: toArrayBuffer2, - toBuffer: toBuffer2, - unmask: _unmask - }; - if (!process.env.WS_NO_BUFFER_UTIL) { - try { - const bufferUtil = require_bufferutil(); - module2.exports.mask = function(source, mask2, output, offset2, length) { - if (length < 48) - _mask(source, mask2, output, offset2, length); - else - bufferUtil.mask(source, mask2, output, offset2, length); - }; - module2.exports.unmask = function(buffer, mask2) { - if (buffer.length < 32) - _unmask(buffer, mask2); - else - bufferUtil.unmask(buffer, mask2); - }; - } catch (e) { - } - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/limiter.js -var require_limiter = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/limiter.js"(exports2, module2) { - "use strict"; - var kDone = Symbol("kDone"); - var kRun = Symbol("kRun"); - var Limiter = class { - /** - * Creates a new `Limiter`. - * - * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed - * to run concurrently - */ - constructor(concurrency) { - this[kDone] = () => { - this.pending--; - this[kRun](); - }; - this.concurrency = concurrency || Infinity; - this.jobs = []; - this.pending = 0; - } - /** - * Adds a job to the queue. - * - * @param {Function} job The job to run - * @public - */ - add(job) { - this.jobs.push(job); - this[kRun](); - } - /** - * Removes a job from the queue and runs it if possible. - * - * @private - */ - [kRun]() { - if (this.pending === this.concurrency) - return; - if (this.jobs.length) { - const job = this.jobs.shift(); - this.pending++; - job(this[kDone]); - } - } - }; - module2.exports = Limiter; - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/permessage-deflate.js -var require_permessage_deflate = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/permessage-deflate.js"(exports2, module2) { - "use strict"; - var zlib2 = require("zlib"); - var bufferUtil = require_buffer_util(); - var Limiter = require_limiter(); - var { kStatusCode } = require_constants3(); - var FastBuffer = Buffer[Symbol.species]; - var TRAILER = Buffer.from([0, 0, 255, 255]); - var kPerMessageDeflate = Symbol("permessage-deflate"); - var kTotalLength = Symbol("total-length"); - var kCallback = Symbol("callback"); - var kBuffers = Symbol("buffers"); - var kError = Symbol("error"); - var zlibLimiter; - var PerMessageDeflate2 = class { - /** - * Creates a PerMessageDeflate instance. - * - * @param {Object} [options] Configuration options - * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support - * for, or request, a custom client window size - * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/ - * acknowledge disabling of client context takeover - * @param {Number} [options.concurrencyLimit=10] The number of concurrent - * calls to zlib - * @param {Boolean} [options.isServer=false] Create the instance in either - * server or client mode - * @param {Number} [options.maxPayload=0] The maximum allowed message length - * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the - * use of a custom server window size - * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept - * disabling of server context takeover - * @param {Number} [options.threshold=1024] Size (in bytes) below which - * messages should not be compressed if context takeover is disabled - * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on - * deflate - * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on - * inflate - */ - constructor(options) { - this._options = options || {}; - this._threshold = this._options.threshold !== void 0 ? this._options.threshold : 1024; - this._maxPayload = this._options.maxPayload | 0; - this._isServer = !!this._options.isServer; - this._deflate = null; - this._inflate = null; - this.params = null; - if (!zlibLimiter) { - const concurrency = this._options.concurrencyLimit !== void 0 ? this._options.concurrencyLimit : 10; - zlibLimiter = new Limiter(concurrency); - } - } - /** - * @type {String} - */ - static get extensionName() { - return "permessage-deflate"; - } - /** - * Create an extension negotiation offer. - * - * @return {Object} Extension parameters - * @public - */ - offer() { - const params = {}; - if (this._options.serverNoContextTakeover) { - params.server_no_context_takeover = true; - } - if (this._options.clientNoContextTakeover) { - params.client_no_context_takeover = true; - } - if (this._options.serverMaxWindowBits) { - params.server_max_window_bits = this._options.serverMaxWindowBits; - } - if (this._options.clientMaxWindowBits) { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } else if (this._options.clientMaxWindowBits == null) { - params.client_max_window_bits = true; - } - return params; - } - /** - * Accept an extension negotiation offer/response. - * - * @param {Array} configurations The extension negotiation offers/reponse - * @return {Object} Accepted configuration - * @public - */ - accept(configurations) { - configurations = this.normalizeParams(configurations); - this.params = this._isServer ? this.acceptAsServer(configurations) : this.acceptAsClient(configurations); - return this.params; - } - /** - * Releases all resources used by the extension. - * - * @public - */ - cleanup() { - if (this._inflate) { - this._inflate.close(); - this._inflate = null; - } - if (this._deflate) { - const callback = this._deflate[kCallback]; - this._deflate.close(); - this._deflate = null; - if (callback) { - callback( - new Error( - "The deflate stream was closed while data was being processed" - ) - ); - } - } - } - /** - * Accept an extension negotiation offer. - * - * @param {Array} offers The extension negotiation offers - * @return {Object} Accepted configuration - * @private - */ - acceptAsServer(offers) { - const opts = this._options; - const accepted = offers.find((params) => { - if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) { - return false; - } - return true; - }); - if (!accepted) { - throw new Error("None of the extension offers can be accepted"); - } - if (opts.serverNoContextTakeover) { - accepted.server_no_context_takeover = true; - } - if (opts.clientNoContextTakeover) { - accepted.client_no_context_takeover = true; - } - if (typeof opts.serverMaxWindowBits === "number") { - accepted.server_max_window_bits = opts.serverMaxWindowBits; - } - if (typeof opts.clientMaxWindowBits === "number") { - accepted.client_max_window_bits = opts.clientMaxWindowBits; - } else if (accepted.client_max_window_bits === true || opts.clientMaxWindowBits === false) { - delete accepted.client_max_window_bits; - } - return accepted; - } - /** - * Accept the extension negotiation response. - * - * @param {Array} response The extension negotiation response - * @return {Object} Accepted configuration - * @private - */ - acceptAsClient(response) { - const params = response[0]; - if (this._options.clientNoContextTakeover === false && params.client_no_context_takeover) { - throw new Error('Unexpected parameter "client_no_context_takeover"'); - } - if (!params.client_max_window_bits) { - if (typeof this._options.clientMaxWindowBits === "number") { - params.client_max_window_bits = this._options.clientMaxWindowBits; - } - } else if (this._options.clientMaxWindowBits === false || typeof this._options.clientMaxWindowBits === "number" && params.client_max_window_bits > this._options.clientMaxWindowBits) { - throw new Error( - 'Unexpected or invalid parameter "client_max_window_bits"' - ); - } - return params; - } - /** - * Normalize parameters. - * - * @param {Array} configurations The extension negotiation offers/reponse - * @return {Array} The offers/response with normalized parameters - * @private - */ - normalizeParams(configurations) { - configurations.forEach((params) => { - Object.keys(params).forEach((key) => { - let value = params[key]; - if (value.length > 1) { - throw new Error(`Parameter "${key}" must have only a single value`); - } - value = value[0]; - if (key === "client_max_window_bits") { - if (value !== true) { - const num = +value; - if (!Number.isInteger(num) || num < 8 || num > 15) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - value = num; - } else if (!this._isServer) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - } else if (key === "server_max_window_bits") { - const num = +value; - if (!Number.isInteger(num) || num < 8 || num > 15) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - value = num; - } else if (key === "client_no_context_takeover" || key === "server_no_context_takeover") { - if (value !== true) { - throw new TypeError( - `Invalid value for parameter "${key}": ${value}` - ); - } - } else { - throw new Error(`Unknown parameter "${key}"`); - } - params[key] = value; - }); - }); - return configurations; - } - /** - * Decompress data. Concurrency limited. - * - * @param {Buffer} data Compressed data - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @public - */ - decompress(data, fin, callback) { - zlibLimiter.add((done) => { - this._decompress(data, fin, (err, result) => { - done(); - callback(err, result); - }); - }); - } - /** - * Compress data. Concurrency limited. - * - * @param {(Buffer|String)} data Data to compress - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @public - */ - compress(data, fin, callback) { - zlibLimiter.add((done) => { - this._compress(data, fin, (err, result) => { - done(); - callback(err, result); - }); - }); - } - /** - * Decompress data. - * - * @param {Buffer} data Compressed data - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @private - */ - _decompress(data, fin, callback) { - const endpoint2 = this._isServer ? "client" : "server"; - if (!this._inflate) { - const key = `${endpoint2}_max_window_bits`; - const windowBits = typeof this.params[key] !== "number" ? zlib2.Z_DEFAULT_WINDOWBITS : this.params[key]; - this._inflate = zlib2.createInflateRaw({ - ...this._options.zlibInflateOptions, - windowBits - }); - this._inflate[kPerMessageDeflate] = this; - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - this._inflate.on("error", inflateOnError); - this._inflate.on("data", inflateOnData); - } - this._inflate[kCallback] = callback; - this._inflate.write(data); - if (fin) - this._inflate.write(TRAILER); - this._inflate.flush(() => { - const err = this._inflate[kError]; - if (err) { - this._inflate.close(); - this._inflate = null; - callback(err); - return; - } - const data2 = bufferUtil.concat( - this._inflate[kBuffers], - this._inflate[kTotalLength] - ); - if (this._inflate._readableState.endEmitted) { - this._inflate.close(); - this._inflate = null; - } else { - this._inflate[kTotalLength] = 0; - this._inflate[kBuffers] = []; - if (fin && this.params[`${endpoint2}_no_context_takeover`]) { - this._inflate.reset(); - } - } - callback(null, data2); - }); - } - /** - * Compress data. - * - * @param {(Buffer|String)} data Data to compress - * @param {Boolean} fin Specifies whether or not this is the last fragment - * @param {Function} callback Callback - * @private - */ - _compress(data, fin, callback) { - const endpoint2 = this._isServer ? "server" : "client"; - if (!this._deflate) { - const key = `${endpoint2}_max_window_bits`; - const windowBits = typeof this.params[key] !== "number" ? zlib2.Z_DEFAULT_WINDOWBITS : this.params[key]; - this._deflate = zlib2.createDeflateRaw({ - ...this._options.zlibDeflateOptions, - windowBits - }); - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - this._deflate.on("data", deflateOnData); - } - this._deflate[kCallback] = callback; - this._deflate.write(data); - this._deflate.flush(zlib2.Z_SYNC_FLUSH, () => { - if (!this._deflate) { - return; - } - let data2 = bufferUtil.concat( - this._deflate[kBuffers], - this._deflate[kTotalLength] - ); - if (fin) { - data2 = new FastBuffer(data2.buffer, data2.byteOffset, data2.length - 4); - } - this._deflate[kCallback] = null; - this._deflate[kTotalLength] = 0; - this._deflate[kBuffers] = []; - if (fin && this.params[`${endpoint2}_no_context_takeover`]) { - this._deflate.reset(); - } - callback(null, data2); - }); - } - }; - module2.exports = PerMessageDeflate2; - function deflateOnData(chunk) { - this[kBuffers].push(chunk); - this[kTotalLength] += chunk.length; - } - function inflateOnData(chunk) { - this[kTotalLength] += chunk.length; - if (this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload) { - this[kBuffers].push(chunk); - return; - } - this[kError] = new RangeError("Max payload size exceeded"); - this[kError].code = "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"; - this[kError][kStatusCode] = 1009; - this.removeListener("data", inflateOnData); - this.reset(); - } - function inflateOnError(err) { - this[kPerMessageDeflate]._inflate = null; - if (this[kError]) { - this[kCallback](this[kError]); - return; - } - err[kStatusCode] = 1007; - this[kCallback](err); - } - } -}); - -// ../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/fallback.js -var require_fallback2 = __commonJS({ - "../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/fallback.js"(exports2, module2) { - "use strict"; - function isValidUTF8(buf) { - const len = buf.length; - let i = 0; - while (i < len) { - if ((buf[i] & 128) === 0) { - i++; - } else if ((buf[i] & 224) === 192) { - if (i + 1 === len || (buf[i + 1] & 192) !== 128 || (buf[i] & 254) === 192) { - return false; - } - i += 2; - } else if ((buf[i] & 240) === 224) { - if (i + 2 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || buf[i] === 224 && (buf[i + 1] & 224) === 128 || // overlong - buf[i] === 237 && (buf[i + 1] & 224) === 160) { - return false; - } - i += 3; - } else if ((buf[i] & 248) === 240) { - if (i + 3 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || (buf[i + 3] & 192) !== 128 || buf[i] === 240 && (buf[i + 1] & 240) === 128 || // overlong - buf[i] === 244 && buf[i + 1] > 143 || buf[i] > 244) { - return false; - } - i += 4; - } else { - return false; - } - } - return true; - } - module2.exports = isValidUTF8; - } -}); - -// ../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/index.js -var require_utf_8_validate = __commonJS({ - "../../node_modules/.pnpm/utf-8-validate@6.0.6/node_modules/utf-8-validate/index.js"(exports2, module2) { - "use strict"; - try { - module2.exports = require("node-gyp-build")(__dirname); - } catch (e) { - module2.exports = require_fallback2(); - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/validation.js -var require_validation3 = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/validation.js"(exports2, module2) { - "use strict"; - var { isUtf8 } = require("buffer"); - var { hasBlob } = require_constants3(); - var tokenChars = [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - // 0 - 15 - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - // 16 - 31 - 0, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 0, - 1, - 1, - 0, - // 32 - 47 - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - // 48 - 63 - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - // 64 - 79 - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 1, - 1, - // 80 - 95 - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - // 96 - 111 - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 0, - 1, - 0 - // 112 - 127 - ]; - function isValidStatusCode(code) { - return code >= 1e3 && code <= 1014 && code !== 1004 && code !== 1005 && code !== 1006 || code >= 3e3 && code <= 4999; - } - function _isValidUTF8(buf) { - const len = buf.length; - let i = 0; - while (i < len) { - if ((buf[i] & 128) === 0) { - i++; - } else if ((buf[i] & 224) === 192) { - if (i + 1 === len || (buf[i + 1] & 192) !== 128 || (buf[i] & 254) === 192) { - return false; - } - i += 2; - } else if ((buf[i] & 240) === 224) { - if (i + 2 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || buf[i] === 224 && (buf[i + 1] & 224) === 128 || // Overlong - buf[i] === 237 && (buf[i + 1] & 224) === 160) { - return false; - } - i += 3; - } else if ((buf[i] & 248) === 240) { - if (i + 3 >= len || (buf[i + 1] & 192) !== 128 || (buf[i + 2] & 192) !== 128 || (buf[i + 3] & 192) !== 128 || buf[i] === 240 && (buf[i + 1] & 240) === 128 || // Overlong - buf[i] === 244 && buf[i + 1] > 143 || buf[i] > 244) { - return false; - } - i += 4; - } else { - return false; - } - } - return true; - } - function isBlob2(value) { - return hasBlob && typeof value === "object" && typeof value.arrayBuffer === "function" && typeof value.type === "string" && typeof value.stream === "function" && (value[Symbol.toStringTag] === "Blob" || value[Symbol.toStringTag] === "File"); - } - module2.exports = { - isBlob: isBlob2, - isValidStatusCode, - isValidUTF8: _isValidUTF8, - tokenChars - }; - if (isUtf8) { - module2.exports.isValidUTF8 = function(buf) { - return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf); - }; - } else if (!process.env.WS_NO_UTF_8_VALIDATE) { - try { - const isValidUTF8 = require_utf_8_validate(); - module2.exports.isValidUTF8 = function(buf) { - return buf.length < 32 ? _isValidUTF8(buf) : isValidUTF8(buf); - }; - } catch (e) { - } - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/receiver.js -var require_receiver = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/receiver.js"(exports2, module2) { - "use strict"; - var { Writable } = require("stream"); - var PerMessageDeflate2 = require_permessage_deflate(); - var { - BINARY_TYPES, - EMPTY_BUFFER, - kStatusCode, - kWebSocket - } = require_constants3(); - var { concat, toArrayBuffer: toArrayBuffer2, unmask } = require_buffer_util(); - var { isValidStatusCode, isValidUTF8 } = require_validation3(); - var FastBuffer = Buffer[Symbol.species]; - var GET_INFO = 0; - var GET_PAYLOAD_LENGTH_16 = 1; - var GET_PAYLOAD_LENGTH_64 = 2; - var GET_MASK = 3; - var GET_DATA = 4; - var INFLATING = 5; - var DEFER_EVENT = 6; - var Receiver2 = class extends Writable { - /** - * Creates a Receiver instance. - * - * @param {Object} [options] Options object - * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether - * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted - * multiple times in the same tick - * @param {String} [options.binaryType=nodebuffer] The type for binary data - * @param {Object} [options.extensions] An object containing the negotiated - * extensions - * @param {Boolean} [options.isServer=false] Specifies whether to operate in - * client or server mode - * @param {Number} [options.maxPayload=0] The maximum allowed message length - * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or - * not to skip UTF-8 validation for text and close messages - */ - constructor(options = {}) { - super(); - this._allowSynchronousEvents = options.allowSynchronousEvents !== void 0 ? options.allowSynchronousEvents : true; - this._binaryType = options.binaryType || BINARY_TYPES[0]; - this._extensions = options.extensions || {}; - this._isServer = !!options.isServer; - this._maxPayload = options.maxPayload | 0; - this._skipUTF8Validation = !!options.skipUTF8Validation; - this[kWebSocket] = void 0; - this._bufferedBytes = 0; - this._buffers = []; - this._compressed = false; - this._payloadLength = 0; - this._mask = void 0; - this._fragmented = 0; - this._masked = false; - this._fin = false; - this._opcode = 0; - this._totalPayloadLength = 0; - this._messageLength = 0; - this._fragments = []; - this._errored = false; - this._loop = false; - this._state = GET_INFO; - } - /** - * Implements `Writable.prototype._write()`. - * - * @param {Buffer} chunk The chunk of data to write - * @param {String} encoding The character encoding of `chunk` - * @param {Function} cb Callback - * @private - */ - _write(chunk, encoding, cb) { - if (this._opcode === 8 && this._state == GET_INFO) - return cb(); - this._bufferedBytes += chunk.length; - this._buffers.push(chunk); - this.startLoop(cb); - } - /** - * Consumes `n` bytes from the buffered data. - * - * @param {Number} n The number of bytes to consume - * @return {Buffer} The consumed bytes - * @private - */ - consume(n) { - this._bufferedBytes -= n; - if (n === this._buffers[0].length) - return this._buffers.shift(); - if (n < this._buffers[0].length) { - const buf = this._buffers[0]; - this._buffers[0] = new FastBuffer( - buf.buffer, - buf.byteOffset + n, - buf.length - n - ); - return new FastBuffer(buf.buffer, buf.byteOffset, n); - } - const dst = Buffer.allocUnsafe(n); - do { - const buf = this._buffers[0]; - const offset2 = dst.length - n; - if (n >= buf.length) { - dst.set(this._buffers.shift(), offset2); - } else { - dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset2); - this._buffers[0] = new FastBuffer( - buf.buffer, - buf.byteOffset + n, - buf.length - n - ); - } - n -= buf.length; - } while (n > 0); - return dst; - } - /** - * Starts the parsing loop. - * - * @param {Function} cb Callback - * @private - */ - startLoop(cb) { - this._loop = true; - do { - switch (this._state) { - case GET_INFO: - this.getInfo(cb); - break; - case GET_PAYLOAD_LENGTH_16: - this.getPayloadLength16(cb); - break; - case GET_PAYLOAD_LENGTH_64: - this.getPayloadLength64(cb); - break; - case GET_MASK: - this.getMask(); - break; - case GET_DATA: - this.getData(cb); - break; - case INFLATING: - case DEFER_EVENT: - this._loop = false; - return; - } - } while (this._loop); - if (!this._errored) - cb(); - } - /** - * Reads the first two bytes of a frame. - * - * @param {Function} cb Callback - * @private - */ - getInfo(cb) { - if (this._bufferedBytes < 2) { - this._loop = false; - return; - } - const buf = this.consume(2); - if ((buf[0] & 48) !== 0) { - const error = this.createError( - RangeError, - "RSV2 and RSV3 must be clear", - true, - 1002, - "WS_ERR_UNEXPECTED_RSV_2_3" - ); - cb(error); - return; - } - const compressed = (buf[0] & 64) === 64; - if (compressed && !this._extensions[PerMessageDeflate2.extensionName]) { - const error = this.createError( - RangeError, - "RSV1 must be clear", - true, - 1002, - "WS_ERR_UNEXPECTED_RSV_1" - ); - cb(error); - return; - } - this._fin = (buf[0] & 128) === 128; - this._opcode = buf[0] & 15; - this._payloadLength = buf[1] & 127; - if (this._opcode === 0) { - if (compressed) { - const error = this.createError( - RangeError, - "RSV1 must be clear", - true, - 1002, - "WS_ERR_UNEXPECTED_RSV_1" - ); - cb(error); - return; - } - if (!this._fragmented) { - const error = this.createError( - RangeError, - "invalid opcode 0", - true, - 1002, - "WS_ERR_INVALID_OPCODE" - ); - cb(error); - return; - } - this._opcode = this._fragmented; - } else if (this._opcode === 1 || this._opcode === 2) { - if (this._fragmented) { - const error = this.createError( - RangeError, - `invalid opcode ${this._opcode}`, - true, - 1002, - "WS_ERR_INVALID_OPCODE" - ); - cb(error); - return; - } - this._compressed = compressed; - } else if (this._opcode > 7 && this._opcode < 11) { - if (!this._fin) { - const error = this.createError( - RangeError, - "FIN must be set", - true, - 1002, - "WS_ERR_EXPECTED_FIN" - ); - cb(error); - return; - } - if (compressed) { - const error = this.createError( - RangeError, - "RSV1 must be clear", - true, - 1002, - "WS_ERR_UNEXPECTED_RSV_1" - ); - cb(error); - return; - } - if (this._payloadLength > 125 || this._opcode === 8 && this._payloadLength === 1) { - const error = this.createError( - RangeError, - `invalid payload length ${this._payloadLength}`, - true, - 1002, - "WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH" - ); - cb(error); - return; - } - } else { - const error = this.createError( - RangeError, - `invalid opcode ${this._opcode}`, - true, - 1002, - "WS_ERR_INVALID_OPCODE" - ); - cb(error); - return; - } - if (!this._fin && !this._fragmented) - this._fragmented = this._opcode; - this._masked = (buf[1] & 128) === 128; - if (this._isServer) { - if (!this._masked) { - const error = this.createError( - RangeError, - "MASK must be set", - true, - 1002, - "WS_ERR_EXPECTED_MASK" - ); - cb(error); - return; - } - } else if (this._masked) { - const error = this.createError( - RangeError, - "MASK must be clear", - true, - 1002, - "WS_ERR_UNEXPECTED_MASK" - ); - cb(error); - return; - } - if (this._payloadLength === 126) - this._state = GET_PAYLOAD_LENGTH_16; - else if (this._payloadLength === 127) - this._state = GET_PAYLOAD_LENGTH_64; - else - this.haveLength(cb); - } - /** - * Gets extended payload length (7+16). - * - * @param {Function} cb Callback - * @private - */ - getPayloadLength16(cb) { - if (this._bufferedBytes < 2) { - this._loop = false; - return; - } - this._payloadLength = this.consume(2).readUInt16BE(0); - this.haveLength(cb); - } - /** - * Gets extended payload length (7+64). - * - * @param {Function} cb Callback - * @private - */ - getPayloadLength64(cb) { - if (this._bufferedBytes < 8) { - this._loop = false; - return; - } - const buf = this.consume(8); - const num = buf.readUInt32BE(0); - if (num > Math.pow(2, 53 - 32) - 1) { - const error = this.createError( - RangeError, - "Unsupported WebSocket frame: payload length > 2^53 - 1", - false, - 1009, - "WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH" - ); - cb(error); - return; - } - this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4); - this.haveLength(cb); - } - /** - * Payload length has been read. - * - * @param {Function} cb Callback - * @private - */ - haveLength(cb) { - if (this._payloadLength && this._opcode < 8) { - this._totalPayloadLength += this._payloadLength; - if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) { - const error = this.createError( - RangeError, - "Max payload size exceeded", - false, - 1009, - "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH" - ); - cb(error); - return; - } - } - if (this._masked) - this._state = GET_MASK; - else - this._state = GET_DATA; - } - /** - * Reads mask bytes. - * - * @private - */ - getMask() { - if (this._bufferedBytes < 4) { - this._loop = false; - return; - } - this._mask = this.consume(4); - this._state = GET_DATA; - } - /** - * Reads data bytes. - * - * @param {Function} cb Callback - * @private - */ - getData(cb) { - let data = EMPTY_BUFFER; - if (this._payloadLength) { - if (this._bufferedBytes < this._payloadLength) { - this._loop = false; - return; - } - data = this.consume(this._payloadLength); - if (this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0) { - unmask(data, this._mask); - } - } - if (this._opcode > 7) { - this.controlMessage(data, cb); - return; - } - if (this._compressed) { - this._state = INFLATING; - this.decompress(data, cb); - return; - } - if (data.length) { - this._messageLength = this._totalPayloadLength; - this._fragments.push(data); - } - this.dataMessage(cb); - } - /** - * Decompresses data. - * - * @param {Buffer} data Compressed data - * @param {Function} cb Callback - * @private - */ - decompress(data, cb) { - const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName]; - perMessageDeflate.decompress(data, this._fin, (err, buf) => { - if (err) - return cb(err); - if (buf.length) { - this._messageLength += buf.length; - if (this._messageLength > this._maxPayload && this._maxPayload > 0) { - const error = this.createError( - RangeError, - "Max payload size exceeded", - false, - 1009, - "WS_ERR_UNSUPPORTED_MESSAGE_LENGTH" - ); - cb(error); - return; - } - this._fragments.push(buf); - } - this.dataMessage(cb); - if (this._state === GET_INFO) - this.startLoop(cb); - }); - } - /** - * Handles a data message. - * - * @param {Function} cb Callback - * @private - */ - dataMessage(cb) { - if (!this._fin) { - this._state = GET_INFO; - return; - } - const messageLength = this._messageLength; - const fragments = this._fragments; - this._totalPayloadLength = 0; - this._messageLength = 0; - this._fragmented = 0; - this._fragments = []; - if (this._opcode === 2) { - let data; - if (this._binaryType === "nodebuffer") { - data = concat(fragments, messageLength); - } else if (this._binaryType === "arraybuffer") { - data = toArrayBuffer2(concat(fragments, messageLength)); - } else if (this._binaryType === "blob") { - data = new Blob(fragments); - } else { - data = fragments; - } - if (this._allowSynchronousEvents) { - this.emit("message", data, true); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit("message", data, true); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } else { - const buf = concat(fragments, messageLength); - if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error = this.createError( - Error, - "invalid UTF-8 sequence", - true, - 1007, - "WS_ERR_INVALID_UTF8" - ); - cb(error); - return; - } - if (this._state === INFLATING || this._allowSynchronousEvents) { - this.emit("message", buf, false); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit("message", buf, false); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } - } - /** - * Handles a control message. - * - * @param {Buffer} data Data to handle - * @return {(Error|RangeError|undefined)} A possible error - * @private - */ - controlMessage(data, cb) { - if (this._opcode === 8) { - if (data.length === 0) { - this._loop = false; - this.emit("conclude", 1005, EMPTY_BUFFER); - this.end(); - } else { - const code = data.readUInt16BE(0); - if (!isValidStatusCode(code)) { - const error = this.createError( - RangeError, - `invalid status code ${code}`, - true, - 1002, - "WS_ERR_INVALID_CLOSE_CODE" - ); - cb(error); - return; - } - const buf = new FastBuffer( - data.buffer, - data.byteOffset + 2, - data.length - 2 - ); - if (!this._skipUTF8Validation && !isValidUTF8(buf)) { - const error = this.createError( - Error, - "invalid UTF-8 sequence", - true, - 1007, - "WS_ERR_INVALID_UTF8" - ); - cb(error); - return; - } - this._loop = false; - this.emit("conclude", code, buf); - this.end(); - } - this._state = GET_INFO; - return; - } - if (this._allowSynchronousEvents) { - this.emit(this._opcode === 9 ? "ping" : "pong", data); - this._state = GET_INFO; - } else { - this._state = DEFER_EVENT; - setImmediate(() => { - this.emit(this._opcode === 9 ? "ping" : "pong", data); - this._state = GET_INFO; - this.startLoop(cb); - }); - } - } - /** - * Builds an error object. - * - * @param {function(new:Error|RangeError)} ErrorCtor The error constructor - * @param {String} message The error message - * @param {Boolean} prefix Specifies whether or not to add a default prefix to - * `message` - * @param {Number} statusCode The status code - * @param {String} errorCode The exposed error code - * @return {(Error|RangeError)} The error - * @private - */ - createError(ErrorCtor, message, prefix, statusCode, errorCode) { - this._loop = false; - this._errored = true; - const err = new ErrorCtor( - prefix ? `Invalid WebSocket frame: ${message}` : message - ); - Error.captureStackTrace(err, this.createError); - err.code = errorCode; - err[kStatusCode] = statusCode; - return err; - } - }; - module2.exports = Receiver2; - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/sender.js -var require_sender = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/sender.js"(exports2, module2) { - "use strict"; - var { Duplex } = require("stream"); - var { randomFillSync } = require("crypto"); - var PerMessageDeflate2 = require_permessage_deflate(); - var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants3(); - var { isBlob: isBlob2, isValidStatusCode } = require_validation3(); - var { mask: applyMask, toBuffer: toBuffer2 } = require_buffer_util(); - var kByteLength = Symbol("kByteLength"); - var maskBuffer = Buffer.alloc(4); - var RANDOM_POOL_SIZE = 8 * 1024; - var randomPool; - var randomPoolPointer = RANDOM_POOL_SIZE; - var DEFAULT = 0; - var DEFLATING = 1; - var GET_BLOB_DATA = 2; - var Sender2 = class _Sender { - /** - * Creates a Sender instance. - * - * @param {Duplex} socket The connection socket - * @param {Object} [extensions] An object containing the negotiated extensions - * @param {Function} [generateMask] The function used to generate the masking - * key - */ - constructor(socket, extensions, generateMask) { - this._extensions = extensions || {}; - if (generateMask) { - this._generateMask = generateMask; - this._maskBuffer = Buffer.alloc(4); - } - this._socket = socket; - this._firstFragment = true; - this._compress = false; - this._bufferedBytes = 0; - this._queue = []; - this._state = DEFAULT; - this.onerror = NOOP; - this[kWebSocket] = void 0; - } - /** - * Frames a piece of data according to the HyBi WebSocket protocol. - * - * @param {(Buffer|String)} data The data to frame - * @param {Object} options Options object - * @param {Boolean} [options.fin=false] Specifies whether or not to set the - * FIN bit - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Boolean} [options.mask=false] Specifies whether or not to mask - * `data` - * @param {Buffer} [options.maskBuffer] The buffer used to store the masking - * key - * @param {Number} options.opcode The opcode - * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be - * modified - * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the - * RSV1 bit - * @return {(Buffer|String)[]} The framed data - * @public - */ - static frame(data, options) { - let mask2; - let merge = false; - let offset2 = 2; - let skipMasking = false; - if (options.mask) { - mask2 = options.maskBuffer || maskBuffer; - if (options.generateMask) { - options.generateMask(mask2); - } else { - if (randomPoolPointer === RANDOM_POOL_SIZE) { - if (randomPool === void 0) { - randomPool = Buffer.alloc(RANDOM_POOL_SIZE); - } - randomFillSync(randomPool, 0, RANDOM_POOL_SIZE); - randomPoolPointer = 0; - } - mask2[0] = randomPool[randomPoolPointer++]; - mask2[1] = randomPool[randomPoolPointer++]; - mask2[2] = randomPool[randomPoolPointer++]; - mask2[3] = randomPool[randomPoolPointer++]; - } - skipMasking = (mask2[0] | mask2[1] | mask2[2] | mask2[3]) === 0; - offset2 = 6; - } - let dataLength; - if (typeof data === "string") { - if ((!options.mask || skipMasking) && options[kByteLength] !== void 0) { - dataLength = options[kByteLength]; - } else { - data = Buffer.from(data); - dataLength = data.length; - } - } else { - dataLength = data.length; - merge = options.mask && options.readOnly && !skipMasking; - } - let payloadLength = dataLength; - if (dataLength >= 65536) { - offset2 += 8; - payloadLength = 127; - } else if (dataLength > 125) { - offset2 += 2; - payloadLength = 126; - } - const target = Buffer.allocUnsafe(merge ? dataLength + offset2 : offset2); - target[0] = options.fin ? options.opcode | 128 : options.opcode; - if (options.rsv1) - target[0] |= 64; - target[1] = payloadLength; - if (payloadLength === 126) { - target.writeUInt16BE(dataLength, 2); - } else if (payloadLength === 127) { - target[2] = target[3] = 0; - target.writeUIntBE(dataLength, 4, 6); - } - if (!options.mask) - return [target, data]; - target[1] |= 128; - target[offset2 - 4] = mask2[0]; - target[offset2 - 3] = mask2[1]; - target[offset2 - 2] = mask2[2]; - target[offset2 - 1] = mask2[3]; - if (skipMasking) - return [target, data]; - if (merge) { - applyMask(data, mask2, target, offset2, dataLength); - return [target]; - } - applyMask(data, mask2, data, 0, dataLength); - return [target, data]; - } - /** - * Sends a close message to the other peer. - * - * @param {Number} [code] The status code component of the body - * @param {(String|Buffer)} [data] The message component of the body - * @param {Boolean} [mask=false] Specifies whether or not to mask the message - * @param {Function} [cb] Callback - * @public - */ - close(code, data, mask2, cb) { - let buf; - if (code === void 0) { - buf = EMPTY_BUFFER; - } else if (typeof code !== "number" || !isValidStatusCode(code)) { - throw new TypeError("First argument must be a valid error code number"); - } else if (data === void 0 || !data.length) { - buf = Buffer.allocUnsafe(2); - buf.writeUInt16BE(code, 0); - } else { - const length = Buffer.byteLength(data); - if (length > 123) { - throw new RangeError("The message must not be greater than 123 bytes"); - } - buf = Buffer.allocUnsafe(2 + length); - buf.writeUInt16BE(code, 0); - if (typeof data === "string") { - buf.write(data, 2); - } else { - buf.set(data, 2); - } - } - const options = { - [kByteLength]: buf.length, - fin: true, - generateMask: this._generateMask, - mask: mask2, - maskBuffer: this._maskBuffer, - opcode: 8, - readOnly: false, - rsv1: false - }; - if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, buf, false, options, cb]); - } else { - this.sendFrame(_Sender.frame(buf, options), cb); - } - } - /** - * Sends a ping message to the other peer. - * - * @param {*} data The message to send - * @param {Boolean} [mask=false] Specifies whether or not to mask `data` - * @param {Function} [cb] Callback - * @public - */ - ping(data, mask2, cb) { - let byteLength; - let readOnly; - if (typeof data === "string") { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else if (isBlob2(data)) { - byteLength = data.size; - readOnly = false; - } else { - data = toBuffer2(data); - byteLength = data.length; - readOnly = toBuffer2.readOnly; - } - if (byteLength > 125) { - throw new RangeError("The data size must not be greater than 125 bytes"); - } - const options = { - [kByteLength]: byteLength, - fin: true, - generateMask: this._generateMask, - mask: mask2, - maskBuffer: this._maskBuffer, - opcode: 9, - readOnly, - rsv1: false - }; - if (isBlob2(data)) { - if (this._state !== DEFAULT) { - this.enqueue([this.getBlobData, data, false, options, cb]); - } else { - this.getBlobData(data, false, options, cb); - } - } else if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, data, false, options, cb]); - } else { - this.sendFrame(_Sender.frame(data, options), cb); - } - } - /** - * Sends a pong message to the other peer. - * - * @param {*} data The message to send - * @param {Boolean} [mask=false] Specifies whether or not to mask `data` - * @param {Function} [cb] Callback - * @public - */ - pong(data, mask2, cb) { - let byteLength; - let readOnly; - if (typeof data === "string") { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else if (isBlob2(data)) { - byteLength = data.size; - readOnly = false; - } else { - data = toBuffer2(data); - byteLength = data.length; - readOnly = toBuffer2.readOnly; - } - if (byteLength > 125) { - throw new RangeError("The data size must not be greater than 125 bytes"); - } - const options = { - [kByteLength]: byteLength, - fin: true, - generateMask: this._generateMask, - mask: mask2, - maskBuffer: this._maskBuffer, - opcode: 10, - readOnly, - rsv1: false - }; - if (isBlob2(data)) { - if (this._state !== DEFAULT) { - this.enqueue([this.getBlobData, data, false, options, cb]); - } else { - this.getBlobData(data, false, options, cb); - } - } else if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, data, false, options, cb]); - } else { - this.sendFrame(_Sender.frame(data, options), cb); - } - } - /** - * Sends a data message to the other peer. - * - * @param {*} data The message to send - * @param {Object} options Options object - * @param {Boolean} [options.binary=false] Specifies whether `data` is binary - * or text - * @param {Boolean} [options.compress=false] Specifies whether or not to - * compress `data` - * @param {Boolean} [options.fin=false] Specifies whether the fragment is the - * last one - * @param {Boolean} [options.mask=false] Specifies whether or not to mask - * `data` - * @param {Function} [cb] Callback - * @public - */ - send(data, options, cb) { - const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName]; - let opcode = options.binary ? 2 : 1; - let rsv1 = options.compress; - let byteLength; - let readOnly; - if (typeof data === "string") { - byteLength = Buffer.byteLength(data); - readOnly = false; - } else if (isBlob2(data)) { - byteLength = data.size; - readOnly = false; - } else { - data = toBuffer2(data); - byteLength = data.length; - readOnly = toBuffer2.readOnly; - } - if (this._firstFragment) { - this._firstFragment = false; - if (rsv1 && perMessageDeflate && perMessageDeflate.params[perMessageDeflate._isServer ? "server_no_context_takeover" : "client_no_context_takeover"]) { - rsv1 = byteLength >= perMessageDeflate._threshold; - } - this._compress = rsv1; - } else { - rsv1 = false; - opcode = 0; - } - if (options.fin) - this._firstFragment = true; - const opts = { - [kByteLength]: byteLength, - fin: options.fin, - generateMask: this._generateMask, - mask: options.mask, - maskBuffer: this._maskBuffer, - opcode, - readOnly, - rsv1 - }; - if (isBlob2(data)) { - if (this._state !== DEFAULT) { - this.enqueue([this.getBlobData, data, this._compress, opts, cb]); - } else { - this.getBlobData(data, this._compress, opts, cb); - } - } else if (this._state !== DEFAULT) { - this.enqueue([this.dispatch, data, this._compress, opts, cb]); - } else { - this.dispatch(data, this._compress, opts, cb); - } - } - /** - * Gets the contents of a blob as binary data. - * - * @param {Blob} blob The blob - * @param {Boolean} [compress=false] Specifies whether or not to compress - * the data - * @param {Object} options Options object - * @param {Boolean} [options.fin=false] Specifies whether or not to set the - * FIN bit - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Boolean} [options.mask=false] Specifies whether or not to mask - * `data` - * @param {Buffer} [options.maskBuffer] The buffer used to store the masking - * key - * @param {Number} options.opcode The opcode - * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be - * modified - * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the - * RSV1 bit - * @param {Function} [cb] Callback - * @private - */ - getBlobData(blob3, compress, options, cb) { - this._bufferedBytes += options[kByteLength]; - this._state = GET_BLOB_DATA; - blob3.arrayBuffer().then((arrayBuffer) => { - if (this._socket.destroyed) { - const err = new Error( - "The socket was closed while the blob was being read" - ); - process.nextTick(callCallbacks, this, err, cb); - return; - } - this._bufferedBytes -= options[kByteLength]; - const data = toBuffer2(arrayBuffer); - if (!compress) { - this._state = DEFAULT; - this.sendFrame(_Sender.frame(data, options), cb); - this.dequeue(); - } else { - this.dispatch(data, compress, options, cb); - } - }).catch((err) => { - process.nextTick(onError, this, err, cb); - }); - } - /** - * Dispatches a message. - * - * @param {(Buffer|String)} data The message to send - * @param {Boolean} [compress=false] Specifies whether or not to compress - * `data` - * @param {Object} options Options object - * @param {Boolean} [options.fin=false] Specifies whether or not to set the - * FIN bit - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Boolean} [options.mask=false] Specifies whether or not to mask - * `data` - * @param {Buffer} [options.maskBuffer] The buffer used to store the masking - * key - * @param {Number} options.opcode The opcode - * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be - * modified - * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the - * RSV1 bit - * @param {Function} [cb] Callback - * @private - */ - dispatch(data, compress, options, cb) { - if (!compress) { - this.sendFrame(_Sender.frame(data, options), cb); - return; - } - const perMessageDeflate = this._extensions[PerMessageDeflate2.extensionName]; - this._bufferedBytes += options[kByteLength]; - this._state = DEFLATING; - perMessageDeflate.compress(data, options.fin, (_, buf) => { - if (this._socket.destroyed) { - const err = new Error( - "The socket was closed while data was being compressed" - ); - callCallbacks(this, err, cb); - return; - } - this._bufferedBytes -= options[kByteLength]; - this._state = DEFAULT; - options.readOnly = false; - this.sendFrame(_Sender.frame(buf, options), cb); - this.dequeue(); - }); - } - /** - * Executes queued send operations. - * - * @private - */ - dequeue() { - while (this._state === DEFAULT && this._queue.length) { - const params = this._queue.shift(); - this._bufferedBytes -= params[3][kByteLength]; - Reflect.apply(params[0], this, params.slice(1)); - } - } - /** - * Enqueues a send operation. - * - * @param {Array} params Send operation parameters. - * @private - */ - enqueue(params) { - this._bufferedBytes += params[3][kByteLength]; - this._queue.push(params); - } - /** - * Sends a frame. - * - * @param {(Buffer | String)[]} list The frame to send - * @param {Function} [cb] Callback - * @private - */ - sendFrame(list, cb) { - if (list.length === 2) { - this._socket.cork(); - this._socket.write(list[0]); - this._socket.write(list[1], cb); - this._socket.uncork(); - } else { - this._socket.write(list[0], cb); - } - } - }; - module2.exports = Sender2; - function callCallbacks(sender, err, cb) { - if (typeof cb === "function") - cb(err); - for (let i = 0; i < sender._queue.length; i++) { - const params = sender._queue[i]; - const callback = params[params.length - 1]; - if (typeof callback === "function") - callback(err); - } - } - function onError(sender, err, cb) { - callCallbacks(sender, err, cb); - sender.onerror(err); - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/event-target.js -var require_event_target = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/event-target.js"(exports2, module2) { - "use strict"; - var { kForOnEventAttribute, kListener } = require_constants3(); - var kCode = Symbol("kCode"); - var kData = Symbol("kData"); - var kError = Symbol("kError"); - var kMessage = Symbol("kMessage"); - var kReason = Symbol("kReason"); - var kTarget = Symbol("kTarget"); - var kType = Symbol("kType"); - var kWasClean = Symbol("kWasClean"); - var Event = class { - /** - * Create a new `Event`. - * - * @param {String} type The name of the event - * @throws {TypeError} If the `type` argument is not specified - */ - constructor(type2) { - this[kTarget] = null; - this[kType] = type2; - } - /** - * @type {*} - */ - get target() { - return this[kTarget]; - } - /** - * @type {String} - */ - get type() { - return this[kType]; - } - }; - Object.defineProperty(Event.prototype, "target", { enumerable: true }); - Object.defineProperty(Event.prototype, "type", { enumerable: true }); - var CloseEvent = class extends Event { - /** - * Create a new `CloseEvent`. - * - * @param {String} type The name of the event - * @param {Object} [options] A dictionary object that allows for setting - * attributes via object members of the same name - * @param {Number} [options.code=0] The status code explaining why the - * connection was closed - * @param {String} [options.reason=''] A human-readable string explaining why - * the connection was closed - * @param {Boolean} [options.wasClean=false] Indicates whether or not the - * connection was cleanly closed - */ - constructor(type2, options = {}) { - super(type2); - this[kCode] = options.code === void 0 ? 0 : options.code; - this[kReason] = options.reason === void 0 ? "" : options.reason; - this[kWasClean] = options.wasClean === void 0 ? false : options.wasClean; - } - /** - * @type {Number} - */ - get code() { - return this[kCode]; - } - /** - * @type {String} - */ - get reason() { - return this[kReason]; - } - /** - * @type {Boolean} - */ - get wasClean() { - return this[kWasClean]; - } - }; - Object.defineProperty(CloseEvent.prototype, "code", { enumerable: true }); - Object.defineProperty(CloseEvent.prototype, "reason", { enumerable: true }); - Object.defineProperty(CloseEvent.prototype, "wasClean", { enumerable: true }); - var ErrorEvent = class extends Event { - /** - * Create a new `ErrorEvent`. - * - * @param {String} type The name of the event - * @param {Object} [options] A dictionary object that allows for setting - * attributes via object members of the same name - * @param {*} [options.error=null] The error that generated this event - * @param {String} [options.message=''] The error message - */ - constructor(type2, options = {}) { - super(type2); - this[kError] = options.error === void 0 ? null : options.error; - this[kMessage] = options.message === void 0 ? "" : options.message; - } - /** - * @type {*} - */ - get error() { - return this[kError]; - } - /** - * @type {String} - */ - get message() { - return this[kMessage]; - } - }; - Object.defineProperty(ErrorEvent.prototype, "error", { enumerable: true }); - Object.defineProperty(ErrorEvent.prototype, "message", { enumerable: true }); - var MessageEvent = class extends Event { - /** - * Create a new `MessageEvent`. - * - * @param {String} type The name of the event - * @param {Object} [options] A dictionary object that allows for setting - * attributes via object members of the same name - * @param {*} [options.data=null] The message content - */ - constructor(type2, options = {}) { - super(type2); - this[kData] = options.data === void 0 ? null : options.data; - } - /** - * @type {*} - */ - get data() { - return this[kData]; - } - }; - Object.defineProperty(MessageEvent.prototype, "data", { enumerable: true }); - var EventTarget = { - /** - * Register an event listener. - * - * @param {String} type A string representing the event type to listen for - * @param {(Function|Object)} handler The listener to add - * @param {Object} [options] An options object specifies characteristics about - * the event listener - * @param {Boolean} [options.once=false] A `Boolean` indicating that the - * listener should be invoked at most once after being added. If `true`, - * the listener would be automatically removed when invoked. - * @public - */ - addEventListener(type2, handler, options = {}) { - for (const listener of this.listeners(type2)) { - if (!options[kForOnEventAttribute] && listener[kListener] === handler && !listener[kForOnEventAttribute]) { - return; - } - } - let wrapper; - if (type2 === "message") { - wrapper = function onMessage(data, isBinary) { - const event = new MessageEvent("message", { - data: isBinary ? data : data.toString() - }); - event[kTarget] = this; - callListener(handler, this, event); - }; - } else if (type2 === "close") { - wrapper = function onClose(code, message) { - const event = new CloseEvent("close", { - code, - reason: message.toString(), - wasClean: this._closeFrameReceived && this._closeFrameSent - }); - event[kTarget] = this; - callListener(handler, this, event); - }; - } else if (type2 === "error") { - wrapper = function onError(error) { - const event = new ErrorEvent("error", { - error, - message: error.message - }); - event[kTarget] = this; - callListener(handler, this, event); - }; - } else if (type2 === "open") { - wrapper = function onOpen() { - const event = new Event("open"); - event[kTarget] = this; - callListener(handler, this, event); - }; - } else { - return; - } - wrapper[kForOnEventAttribute] = !!options[kForOnEventAttribute]; - wrapper[kListener] = handler; - if (options.once) { - this.once(type2, wrapper); - } else { - this.on(type2, wrapper); - } - }, - /** - * Remove an event listener. - * - * @param {String} type A string representing the event type to remove - * @param {(Function|Object)} handler The listener to remove - * @public - */ - removeEventListener(type2, handler) { - for (const listener of this.listeners(type2)) { - if (listener[kListener] === handler && !listener[kForOnEventAttribute]) { - this.removeListener(type2, listener); - break; - } - } - } - }; - module2.exports = { - CloseEvent, - ErrorEvent, - Event, - EventTarget, - MessageEvent - }; - function callListener(listener, thisArg, event) { - if (typeof listener === "object" && listener.handleEvent) { - listener.handleEvent.call(listener, event); - } else { - listener.call(thisArg, event); - } - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/extension.js -var require_extension = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/extension.js"(exports2, module2) { - "use strict"; - var { tokenChars } = require_validation3(); - function push(dest, name, elem) { - if (dest[name] === void 0) - dest[name] = [elem]; - else - dest[name].push(elem); - } - function parse2(header) { - const offers = /* @__PURE__ */ Object.create(null); - let params = /* @__PURE__ */ Object.create(null); - let mustUnescape = false; - let isEscaping = false; - let inQuotes = false; - let extensionName; - let paramName; - let start = -1; - let code = -1; - let end = -1; - let i = 0; - for (; i < header.length; i++) { - code = header.charCodeAt(i); - if (extensionName === void 0) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i; - } else if (i !== 0 && (code === 32 || code === 9)) { - if (end === -1 && start !== -1) - end = i; - } else if (code === 59 || code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - if (end === -1) - end = i; - const name = header.slice(start, end); - if (code === 44) { - push(offers, name, params); - params = /* @__PURE__ */ Object.create(null); - } else { - extensionName = name; - } - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } else if (paramName === void 0) { - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i; - } else if (code === 32 || code === 9) { - if (end === -1 && start !== -1) - end = i; - } else if (code === 59 || code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - if (end === -1) - end = i; - push(params, header.slice(start, end), true); - if (code === 44) { - push(offers, extensionName, params); - params = /* @__PURE__ */ Object.create(null); - extensionName = void 0; - } - start = end = -1; - } else if (code === 61 && start !== -1 && end === -1) { - paramName = header.slice(start, i); - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } else { - if (isEscaping) { - if (tokenChars[code] !== 1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - if (start === -1) - start = i; - else if (!mustUnescape) - mustUnescape = true; - isEscaping = false; - } else if (inQuotes) { - if (tokenChars[code] === 1) { - if (start === -1) - start = i; - } else if (code === 34 && start !== -1) { - inQuotes = false; - end = i; - } else if (code === 92) { - isEscaping = true; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } else if (code === 34 && header.charCodeAt(i - 1) === 61) { - inQuotes = true; - } else if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i; - } else if (start !== -1 && (code === 32 || code === 9)) { - if (end === -1) - end = i; - } else if (code === 59 || code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - if (end === -1) - end = i; - let value = header.slice(start, end); - if (mustUnescape) { - value = value.replace(/\\/g, ""); - mustUnescape = false; - } - push(params, paramName, value); - if (code === 44) { - push(offers, extensionName, params); - params = /* @__PURE__ */ Object.create(null); - extensionName = void 0; - } - paramName = void 0; - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } - } - if (start === -1 || inQuotes || code === 32 || code === 9) { - throw new SyntaxError("Unexpected end of input"); - } - if (end === -1) - end = i; - const token = header.slice(start, end); - if (extensionName === void 0) { - push(offers, token, params); - } else { - if (paramName === void 0) { - push(params, token, true); - } else if (mustUnescape) { - push(params, paramName, token.replace(/\\/g, "")); - } else { - push(params, paramName, token); - } - push(offers, extensionName, params); - } - return offers; - } - function format(extensions) { - return Object.keys(extensions).map((extension2) => { - let configurations = extensions[extension2]; - if (!Array.isArray(configurations)) - configurations = [configurations]; - return configurations.map((params) => { - return [extension2].concat( - Object.keys(params).map((k) => { - let values = params[k]; - if (!Array.isArray(values)) - values = [values]; - return values.map((v) => v === true ? k : `${k}=${v}`).join("; "); - }) - ).join("; "); - }).join(", "); - }).join(", "); - } - module2.exports = { format, parse: parse2 }; - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket.js -var require_websocket = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket.js"(exports2, module2) { - "use strict"; - var EventEmitter2 = require("events"); - var https2 = require("https"); - var http2 = require("http"); - var net = require("net"); - var tls = require("tls"); - var { randomBytes: randomBytes3, createHash: createHash2 } = require("crypto"); - var { Duplex, Readable: Readable2 } = require("stream"); - var { URL: URL4 } = require("url"); - var PerMessageDeflate2 = require_permessage_deflate(); - var Receiver2 = require_receiver(); - var Sender2 = require_sender(); - var { isBlob: isBlob2 } = require_validation3(); - var { - BINARY_TYPES, - CLOSE_TIMEOUT, - EMPTY_BUFFER, - GUID, - kForOnEventAttribute, - kListener, - kStatusCode, - kWebSocket, - NOOP - } = require_constants3(); - var { - EventTarget: { addEventListener, removeEventListener } - } = require_event_target(); - var { format, parse: parse2 } = require_extension(); - var { toBuffer: toBuffer2 } = require_buffer_util(); - var kAborted = Symbol("kAborted"); - var protocolVersions = [8, 13]; - var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"]; - var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/; - var WebSocket3 = class _WebSocket extends EventEmitter2 { - /** - * Create a new `WebSocket`. - * - * @param {(String|URL)} address The URL to which to connect - * @param {(String|String[])} [protocols] The subprotocols - * @param {Object} [options] Connection options - */ - constructor(address, protocols, options) { - super(); - this._binaryType = BINARY_TYPES[0]; - this._closeCode = 1006; - this._closeFrameReceived = false; - this._closeFrameSent = false; - this._closeMessage = EMPTY_BUFFER; - this._closeTimer = null; - this._errorEmitted = false; - this._extensions = {}; - this._paused = false; - this._protocol = ""; - this._readyState = _WebSocket.CONNECTING; - this._receiver = null; - this._sender = null; - this._socket = null; - if (address !== null) { - this._bufferedAmount = 0; - this._isServer = false; - this._redirects = 0; - if (protocols === void 0) { - protocols = []; - } else if (!Array.isArray(protocols)) { - if (typeof protocols === "object" && protocols !== null) { - options = protocols; - protocols = []; - } else { - protocols = [protocols]; - } - } - initAsClient(this, address, protocols, options); - } else { - this._autoPong = options.autoPong; - this._closeTimeout = options.closeTimeout; - this._isServer = true; - } - } - /** - * For historical reasons, the custom "nodebuffer" type is used by the default - * instead of "blob". - * - * @type {String} - */ - get binaryType() { - return this._binaryType; - } - set binaryType(type2) { - if (!BINARY_TYPES.includes(type2)) - return; - this._binaryType = type2; - if (this._receiver) - this._receiver._binaryType = type2; - } - /** - * @type {Number} - */ - get bufferedAmount() { - if (!this._socket) - return this._bufferedAmount; - return this._socket._writableState.length + this._sender._bufferedBytes; - } - /** - * @type {String} - */ - get extensions() { - return Object.keys(this._extensions).join(); - } - /** - * @type {Boolean} - */ - get isPaused() { - return this._paused; - } - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onclose() { - return null; - } - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onerror() { - return null; - } - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onopen() { - return null; - } - /** - * @type {Function} - */ - /* istanbul ignore next */ - get onmessage() { - return null; - } - /** - * @type {String} - */ - get protocol() { - return this._protocol; - } - /** - * @type {Number} - */ - get readyState() { - return this._readyState; - } - /** - * @type {String} - */ - get url() { - return this._url; - } - /** - * Set up the socket and the internal resources. - * - * @param {Duplex} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Object} options Options object - * @param {Boolean} [options.allowSynchronousEvents=false] Specifies whether - * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted - * multiple times in the same tick - * @param {Function} [options.generateMask] The function used to generate the - * masking key - * @param {Number} [options.maxPayload=0] The maximum allowed message size - * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or - * not to skip UTF-8 validation for text and close messages - * @private - */ - setSocket(socket, head, options) { - const receiver = new Receiver2({ - allowSynchronousEvents: options.allowSynchronousEvents, - binaryType: this.binaryType, - extensions: this._extensions, - isServer: this._isServer, - maxPayload: options.maxPayload, - skipUTF8Validation: options.skipUTF8Validation - }); - const sender = new Sender2(socket, this._extensions, options.generateMask); - this._receiver = receiver; - this._sender = sender; - this._socket = socket; - receiver[kWebSocket] = this; - sender[kWebSocket] = this; - socket[kWebSocket] = this; - receiver.on("conclude", receiverOnConclude); - receiver.on("drain", receiverOnDrain); - receiver.on("error", receiverOnError); - receiver.on("message", receiverOnMessage); - receiver.on("ping", receiverOnPing); - receiver.on("pong", receiverOnPong); - sender.onerror = senderOnError; - if (socket.setTimeout) - socket.setTimeout(0); - if (socket.setNoDelay) - socket.setNoDelay(); - if (head.length > 0) - socket.unshift(head); - socket.on("close", socketOnClose); - socket.on("data", socketOnData); - socket.on("end", socketOnEnd); - socket.on("error", socketOnError); - this._readyState = _WebSocket.OPEN; - this.emit("open"); - } - /** - * Emit the `'close'` event. - * - * @private - */ - emitClose() { - if (!this._socket) { - this._readyState = _WebSocket.CLOSED; - this.emit("close", this._closeCode, this._closeMessage); - return; - } - if (this._extensions[PerMessageDeflate2.extensionName]) { - this._extensions[PerMessageDeflate2.extensionName].cleanup(); - } - this._receiver.removeAllListeners(); - this._readyState = _WebSocket.CLOSED; - this.emit("close", this._closeCode, this._closeMessage); - } - /** - * Start a closing handshake. - * - * +----------+ +-----------+ +----------+ - * - - -|ws.close()|-->|close frame|-->|ws.close()|- - - - * | +----------+ +-----------+ +----------+ | - * +----------+ +-----------+ | - * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING - * +----------+ +-----------+ | - * | | | +---+ | - * +------------------------+-->|fin| - - - - - * | +---+ | +---+ - * - - - - -|fin|<---------------------+ - * +---+ - * - * @param {Number} [code] Status code explaining why the connection is closing - * @param {(String|Buffer)} [data] The reason why the connection is - * closing - * @public - */ - close(code, data) { - if (this.readyState === _WebSocket.CLOSED) - return; - if (this.readyState === _WebSocket.CONNECTING) { - const msg = "WebSocket was closed before the connection was established"; - abortHandshake(this, this._req, msg); - return; - } - if (this.readyState === _WebSocket.CLOSING) { - if (this._closeFrameSent && (this._closeFrameReceived || this._receiver._writableState.errorEmitted)) { - this._socket.end(); - } - return; - } - this._readyState = _WebSocket.CLOSING; - this._sender.close(code, data, !this._isServer, (err) => { - if (err) - return; - this._closeFrameSent = true; - if (this._closeFrameReceived || this._receiver._writableState.errorEmitted) { - this._socket.end(); - } - }); - setCloseTimer(this); - } - /** - * Pause the socket. - * - * @public - */ - pause() { - if (this.readyState === _WebSocket.CONNECTING || this.readyState === _WebSocket.CLOSED) { - return; - } - this._paused = true; - this._socket.pause(); - } - /** - * Send a ping. - * - * @param {*} [data] The data to send - * @param {Boolean} [mask] Indicates whether or not to mask `data` - * @param {Function} [cb] Callback which is executed when the ping is sent - * @public - */ - ping(data, mask2, cb) { - if (this.readyState === _WebSocket.CONNECTING) { - throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - } - if (typeof data === "function") { - cb = data; - data = mask2 = void 0; - } else if (typeof mask2 === "function") { - cb = mask2; - mask2 = void 0; - } - if (typeof data === "number") - data = data.toString(); - if (this.readyState !== _WebSocket.OPEN) { - sendAfterClose(this, data, cb); - return; - } - if (mask2 === void 0) - mask2 = !this._isServer; - this._sender.ping(data || EMPTY_BUFFER, mask2, cb); - } - /** - * Send a pong. - * - * @param {*} [data] The data to send - * @param {Boolean} [mask] Indicates whether or not to mask `data` - * @param {Function} [cb] Callback which is executed when the pong is sent - * @public - */ - pong(data, mask2, cb) { - if (this.readyState === _WebSocket.CONNECTING) { - throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - } - if (typeof data === "function") { - cb = data; - data = mask2 = void 0; - } else if (typeof mask2 === "function") { - cb = mask2; - mask2 = void 0; - } - if (typeof data === "number") - data = data.toString(); - if (this.readyState !== _WebSocket.OPEN) { - sendAfterClose(this, data, cb); - return; - } - if (mask2 === void 0) - mask2 = !this._isServer; - this._sender.pong(data || EMPTY_BUFFER, mask2, cb); - } - /** - * Resume the socket. - * - * @public - */ - resume() { - if (this.readyState === _WebSocket.CONNECTING || this.readyState === _WebSocket.CLOSED) { - return; - } - this._paused = false; - if (!this._receiver._writableState.needDrain) - this._socket.resume(); - } - /** - * Send a data message. - * - * @param {*} data The message to send - * @param {Object} [options] Options object - * @param {Boolean} [options.binary] Specifies whether `data` is binary or - * text - * @param {Boolean} [options.compress] Specifies whether or not to compress - * `data` - * @param {Boolean} [options.fin=true] Specifies whether the fragment is the - * last one - * @param {Boolean} [options.mask] Specifies whether or not to mask `data` - * @param {Function} [cb] Callback which is executed when data is written out - * @public - */ - send(data, options, cb) { - if (this.readyState === _WebSocket.CONNECTING) { - throw new Error("WebSocket is not open: readyState 0 (CONNECTING)"); - } - if (typeof options === "function") { - cb = options; - options = {}; - } - if (typeof data === "number") - data = data.toString(); - if (this.readyState !== _WebSocket.OPEN) { - sendAfterClose(this, data, cb); - return; - } - const opts = { - binary: typeof data !== "string", - mask: !this._isServer, - compress: true, - fin: true, - ...options - }; - if (!this._extensions[PerMessageDeflate2.extensionName]) { - opts.compress = false; - } - this._sender.send(data || EMPTY_BUFFER, opts, cb); - } - /** - * Forcibly close the connection. - * - * @public - */ - terminate() { - if (this.readyState === _WebSocket.CLOSED) - return; - if (this.readyState === _WebSocket.CONNECTING) { - const msg = "WebSocket was closed before the connection was established"; - abortHandshake(this, this._req, msg); - return; - } - if (this._socket) { - this._readyState = _WebSocket.CLOSING; - this._socket.destroy(); - } - } - }; - Object.defineProperty(WebSocket3, "CONNECTING", { - enumerable: true, - value: readyStates.indexOf("CONNECTING") - }); - Object.defineProperty(WebSocket3.prototype, "CONNECTING", { - enumerable: true, - value: readyStates.indexOf("CONNECTING") - }); - Object.defineProperty(WebSocket3, "OPEN", { - enumerable: true, - value: readyStates.indexOf("OPEN") - }); - Object.defineProperty(WebSocket3.prototype, "OPEN", { - enumerable: true, - value: readyStates.indexOf("OPEN") - }); - Object.defineProperty(WebSocket3, "CLOSING", { - enumerable: true, - value: readyStates.indexOf("CLOSING") - }); - Object.defineProperty(WebSocket3.prototype, "CLOSING", { - enumerable: true, - value: readyStates.indexOf("CLOSING") - }); - Object.defineProperty(WebSocket3, "CLOSED", { - enumerable: true, - value: readyStates.indexOf("CLOSED") - }); - Object.defineProperty(WebSocket3.prototype, "CLOSED", { - enumerable: true, - value: readyStates.indexOf("CLOSED") - }); - [ - "binaryType", - "bufferedAmount", - "extensions", - "isPaused", - "protocol", - "readyState", - "url" - ].forEach((property) => { - Object.defineProperty(WebSocket3.prototype, property, { enumerable: true }); - }); - ["open", "error", "close", "message"].forEach((method) => { - Object.defineProperty(WebSocket3.prototype, `on${method}`, { - enumerable: true, - get() { - for (const listener of this.listeners(method)) { - if (listener[kForOnEventAttribute]) - return listener[kListener]; - } - return null; - }, - set(handler) { - for (const listener of this.listeners(method)) { - if (listener[kForOnEventAttribute]) { - this.removeListener(method, listener); - break; - } - } - if (typeof handler !== "function") - return; - this.addEventListener(method, handler, { - [kForOnEventAttribute]: true - }); - } - }); - }); - WebSocket3.prototype.addEventListener = addEventListener; - WebSocket3.prototype.removeEventListener = removeEventListener; - module2.exports = WebSocket3; - function initAsClient(websocket, address, protocols, options) { - const opts = { - allowSynchronousEvents: true, - autoPong: true, - closeTimeout: CLOSE_TIMEOUT, - protocolVersion: protocolVersions[1], - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: false, - perMessageDeflate: true, - followRedirects: false, - maxRedirects: 10, - ...options, - socketPath: void 0, - hostname: void 0, - protocol: void 0, - timeout: void 0, - method: "GET", - host: void 0, - path: void 0, - port: void 0 - }; - websocket._autoPong = opts.autoPong; - websocket._closeTimeout = opts.closeTimeout; - if (!protocolVersions.includes(opts.protocolVersion)) { - throw new RangeError( - `Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})` - ); - } - let parsedUrl; - if (address instanceof URL4) { - parsedUrl = address; - } else { - try { - parsedUrl = new URL4(address); - } catch { - throw new SyntaxError(`Invalid URL: ${address}`); - } - } - if (parsedUrl.protocol === "http:") { - parsedUrl.protocol = "ws:"; - } else if (parsedUrl.protocol === "https:") { - parsedUrl.protocol = "wss:"; - } - websocket._url = parsedUrl.href; - const isSecure = parsedUrl.protocol === "wss:"; - const isIpcUrl = parsedUrl.protocol === "ws+unix:"; - let invalidUrlMessage; - if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) { - invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`; - } else if (isIpcUrl && !parsedUrl.pathname) { - invalidUrlMessage = "The URL's pathname is empty"; - } else if (parsedUrl.hash) { - invalidUrlMessage = "The URL contains a fragment identifier"; - } - if (invalidUrlMessage) { - const err = new SyntaxError(invalidUrlMessage); - if (websocket._redirects === 0) { - throw err; - } else { - emitErrorAndClose(websocket, err); - return; - } - } - const defaultPort = isSecure ? 443 : 80; - const key = randomBytes3(16).toString("base64"); - const request = isSecure ? https2.request : http2.request; - const protocolSet = /* @__PURE__ */ new Set(); - let perMessageDeflate; - opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect); - opts.defaultPort = opts.defaultPort || defaultPort; - opts.port = parsedUrl.port || defaultPort; - opts.host = parsedUrl.hostname.startsWith("[") ? parsedUrl.hostname.slice(1, -1) : parsedUrl.hostname; - opts.headers = { - ...opts.headers, - "Sec-WebSocket-Version": opts.protocolVersion, - "Sec-WebSocket-Key": key, - Connection: "Upgrade", - Upgrade: "websocket" - }; - opts.path = parsedUrl.pathname + parsedUrl.search; - opts.timeout = opts.handshakeTimeout; - if (opts.perMessageDeflate) { - perMessageDeflate = new PerMessageDeflate2({ - ...opts.perMessageDeflate, - isServer: false, - maxPayload: opts.maxPayload - }); - opts.headers["Sec-WebSocket-Extensions"] = format({ - [PerMessageDeflate2.extensionName]: perMessageDeflate.offer() - }); - } - if (protocols.length) { - for (const protocol of protocols) { - if (typeof protocol !== "string" || !subprotocolRegex.test(protocol) || protocolSet.has(protocol)) { - throw new SyntaxError( - "An invalid or duplicated subprotocol was specified" - ); - } - protocolSet.add(protocol); - } - opts.headers["Sec-WebSocket-Protocol"] = protocols.join(","); - } - if (opts.origin) { - if (opts.protocolVersion < 13) { - opts.headers["Sec-WebSocket-Origin"] = opts.origin; - } else { - opts.headers.Origin = opts.origin; - } - } - if (parsedUrl.username || parsedUrl.password) { - opts.auth = `${parsedUrl.username}:${parsedUrl.password}`; - } - if (isIpcUrl) { - const parts = opts.path.split(":"); - opts.socketPath = parts[0]; - opts.path = parts[1]; - } - let req; - if (opts.followRedirects) { - if (websocket._redirects === 0) { - websocket._originalIpc = isIpcUrl; - websocket._originalSecure = isSecure; - websocket._originalHostOrSocketPath = isIpcUrl ? opts.socketPath : parsedUrl.host; - const headers = options && options.headers; - options = { ...options, headers: {} }; - if (headers) { - for (const [key2, value] of Object.entries(headers)) { - options.headers[key2.toLowerCase()] = value; - } - } - } else if (websocket.listenerCount("redirect") === 0) { - const isSameHost = isIpcUrl ? websocket._originalIpc ? opts.socketPath === websocket._originalHostOrSocketPath : false : websocket._originalIpc ? false : parsedUrl.host === websocket._originalHostOrSocketPath; - if (!isSameHost || websocket._originalSecure && !isSecure) { - delete opts.headers.authorization; - delete opts.headers.cookie; - if (!isSameHost) - delete opts.headers.host; - opts.auth = void 0; - } - } - if (opts.auth && !options.headers.authorization) { - options.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64"); - } - req = websocket._req = request(opts); - if (websocket._redirects) { - websocket.emit("redirect", websocket.url, req); - } - } else { - req = websocket._req = request(opts); - } - if (opts.timeout) { - req.on("timeout", () => { - abortHandshake(websocket, req, "Opening handshake has timed out"); - }); - } - req.on("error", (err) => { - if (req === null || req[kAborted]) - return; - req = websocket._req = null; - emitErrorAndClose(websocket, err); - }); - req.on("response", (res) => { - const location = res.headers.location; - const statusCode = res.statusCode; - if (location && opts.followRedirects && statusCode >= 300 && statusCode < 400) { - if (++websocket._redirects > opts.maxRedirects) { - abortHandshake(websocket, req, "Maximum redirects exceeded"); - return; - } - req.abort(); - let addr; - try { - addr = new URL4(location, address); - } catch (e) { - const err = new SyntaxError(`Invalid URL: ${location}`); - emitErrorAndClose(websocket, err); - return; - } - initAsClient(websocket, addr, protocols, options); - } else if (!websocket.emit("unexpected-response", req, res)) { - abortHandshake( - websocket, - req, - `Unexpected server response: ${res.statusCode}` - ); - } - }); - req.on("upgrade", (res, socket, head) => { - websocket.emit("upgrade", res); - if (websocket.readyState !== WebSocket3.CONNECTING) - return; - req = websocket._req = null; - const upgrade = res.headers.upgrade; - if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") { - abortHandshake(websocket, socket, "Invalid Upgrade header"); - return; - } - const digest = createHash2("sha1").update(key + GUID).digest("base64"); - if (res.headers["sec-websocket-accept"] !== digest) { - abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header"); - return; - } - const serverProt = res.headers["sec-websocket-protocol"]; - let protError; - if (serverProt !== void 0) { - if (!protocolSet.size) { - protError = "Server sent a subprotocol but none was requested"; - } else if (!protocolSet.has(serverProt)) { - protError = "Server sent an invalid subprotocol"; - } - } else if (protocolSet.size) { - protError = "Server sent no subprotocol"; - } - if (protError) { - abortHandshake(websocket, socket, protError); - return; - } - if (serverProt) - websocket._protocol = serverProt; - const secWebSocketExtensions = res.headers["sec-websocket-extensions"]; - if (secWebSocketExtensions !== void 0) { - if (!perMessageDeflate) { - const message = "Server sent a Sec-WebSocket-Extensions header but no extension was requested"; - abortHandshake(websocket, socket, message); - return; - } - let extensions; - try { - extensions = parse2(secWebSocketExtensions); - } catch (err) { - const message = "Invalid Sec-WebSocket-Extensions header"; - abortHandshake(websocket, socket, message); - return; - } - const extensionNames = Object.keys(extensions); - if (extensionNames.length !== 1 || extensionNames[0] !== PerMessageDeflate2.extensionName) { - const message = "Server indicated an extension that was not requested"; - abortHandshake(websocket, socket, message); - return; - } - try { - perMessageDeflate.accept(extensions[PerMessageDeflate2.extensionName]); - } catch (err) { - const message = "Invalid Sec-WebSocket-Extensions header"; - abortHandshake(websocket, socket, message); - return; - } - websocket._extensions[PerMessageDeflate2.extensionName] = perMessageDeflate; - } - websocket.setSocket(socket, head, { - allowSynchronousEvents: opts.allowSynchronousEvents, - generateMask: opts.generateMask, - maxPayload: opts.maxPayload, - skipUTF8Validation: opts.skipUTF8Validation - }); - }); - if (opts.finishRequest) { - opts.finishRequest(req, websocket); - } else { - req.end(); - } - } - function emitErrorAndClose(websocket, err) { - websocket._readyState = WebSocket3.CLOSING; - websocket._errorEmitted = true; - websocket.emit("error", err); - websocket.emitClose(); - } - function netConnect(options) { - options.path = options.socketPath; - return net.connect(options); - } - function tlsConnect(options) { - options.path = void 0; - if (!options.servername && options.servername !== "") { - options.servername = net.isIP(options.host) ? "" : options.host; - } - return tls.connect(options); - } - function abortHandshake(websocket, stream, message) { - websocket._readyState = WebSocket3.CLOSING; - const err = new Error(message); - Error.captureStackTrace(err, abortHandshake); - if (stream.setHeader) { - stream[kAborted] = true; - stream.abort(); - if (stream.socket && !stream.socket.destroyed) { - stream.socket.destroy(); - } - process.nextTick(emitErrorAndClose, websocket, err); - } else { - stream.destroy(err); - stream.once("error", websocket.emit.bind(websocket, "error")); - stream.once("close", websocket.emitClose.bind(websocket)); - } - } - function sendAfterClose(websocket, data, cb) { - if (data) { - const length = isBlob2(data) ? data.size : toBuffer2(data).length; - if (websocket._socket) - websocket._sender._bufferedBytes += length; - else - websocket._bufferedAmount += length; - } - if (cb) { - const err = new Error( - `WebSocket is not open: readyState ${websocket.readyState} (${readyStates[websocket.readyState]})` - ); - process.nextTick(cb, err); - } - } - function receiverOnConclude(code, reason) { - const websocket = this[kWebSocket]; - websocket._closeFrameReceived = true; - websocket._closeMessage = reason; - websocket._closeCode = code; - if (websocket._socket[kWebSocket] === void 0) - return; - websocket._socket.removeListener("data", socketOnData); - process.nextTick(resume, websocket._socket); - if (code === 1005) - websocket.close(); - else - websocket.close(code, reason); - } - function receiverOnDrain() { - const websocket = this[kWebSocket]; - if (!websocket.isPaused) - websocket._socket.resume(); - } - function receiverOnError(err) { - const websocket = this[kWebSocket]; - if (websocket._socket[kWebSocket] !== void 0) { - websocket._socket.removeListener("data", socketOnData); - process.nextTick(resume, websocket._socket); - websocket.close(err[kStatusCode]); - } - if (!websocket._errorEmitted) { - websocket._errorEmitted = true; - websocket.emit("error", err); - } - } - function receiverOnFinish() { - this[kWebSocket].emitClose(); - } - function receiverOnMessage(data, isBinary) { - this[kWebSocket].emit("message", data, isBinary); - } - function receiverOnPing(data) { - const websocket = this[kWebSocket]; - if (websocket._autoPong) - websocket.pong(data, !this._isServer, NOOP); - websocket.emit("ping", data); - } - function receiverOnPong(data) { - this[kWebSocket].emit("pong", data); - } - function resume(stream) { - stream.resume(); - } - function senderOnError(err) { - const websocket = this[kWebSocket]; - if (websocket.readyState === WebSocket3.CLOSED) - return; - if (websocket.readyState === WebSocket3.OPEN) { - websocket._readyState = WebSocket3.CLOSING; - setCloseTimer(websocket); - } - this._socket.end(); - if (!websocket._errorEmitted) { - websocket._errorEmitted = true; - websocket.emit("error", err); - } - } - function setCloseTimer(websocket) { - websocket._closeTimer = setTimeout( - websocket._socket.destroy.bind(websocket._socket), - websocket._closeTimeout - ); - } - function socketOnClose() { - const websocket = this[kWebSocket]; - this.removeListener("close", socketOnClose); - this.removeListener("data", socketOnData); - this.removeListener("end", socketOnEnd); - websocket._readyState = WebSocket3.CLOSING; - if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) { - const chunk = this.read(this._readableState.length); - websocket._receiver.write(chunk); - } - websocket._receiver.end(); - this[kWebSocket] = void 0; - clearTimeout(websocket._closeTimer); - if (websocket._receiver._writableState.finished || websocket._receiver._writableState.errorEmitted) { - websocket.emitClose(); - } else { - websocket._receiver.on("error", receiverOnFinish); - websocket._receiver.on("finish", receiverOnFinish); - } - } - function socketOnData(chunk) { - if (!this[kWebSocket]._receiver.write(chunk)) { - this.pause(); - } - } - function socketOnEnd() { - const websocket = this[kWebSocket]; - websocket._readyState = WebSocket3.CLOSING; - websocket._receiver.end(); - this.end(); - } - function socketOnError() { - const websocket = this[kWebSocket]; - this.removeListener("error", socketOnError); - this.on("error", NOOP); - if (websocket) { - websocket._readyState = WebSocket3.CLOSING; - this.destroy(); - } - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/stream.js -var require_stream = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/stream.js"(exports2, module2) { - "use strict"; - var WebSocket3 = require_websocket(); - var { Duplex } = require("stream"); - function emitClose(stream) { - stream.emit("close"); - } - function duplexOnEnd() { - if (!this.destroyed && this._writableState.finished) { - this.destroy(); - } - } - function duplexOnError(err) { - this.removeListener("error", duplexOnError); - this.destroy(); - if (this.listenerCount("error") === 0) { - this.emit("error", err); - } - } - function createWebSocketStream2(ws, options) { - let terminateOnDestroy = true; - const duplex = new Duplex({ - ...options, - autoDestroy: false, - emitClose: false, - objectMode: false, - writableObjectMode: false - }); - ws.on("message", function message(msg, isBinary) { - const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg; - if (!duplex.push(data)) - ws.pause(); - }); - ws.once("error", function error(err) { - if (duplex.destroyed) - return; - terminateOnDestroy = false; - duplex.destroy(err); - }); - ws.once("close", function close() { - if (duplex.destroyed) - return; - duplex.push(null); - }); - duplex._destroy = function(err, callback) { - if (ws.readyState === ws.CLOSED) { - callback(err); - process.nextTick(emitClose, duplex); - return; - } - let called = false; - ws.once("error", function error(err2) { - called = true; - callback(err2); - }); - ws.once("close", function close() { - if (!called) - callback(err); - process.nextTick(emitClose, duplex); - }); - if (terminateOnDestroy) - ws.terminate(); - }; - duplex._final = function(callback) { - if (ws.readyState === ws.CONNECTING) { - ws.once("open", function open() { - duplex._final(callback); - }); - return; - } - if (ws._socket === null) - return; - if (ws._socket._writableState.finished) { - callback(); - if (duplex._readableState.endEmitted) - duplex.destroy(); - } else { - ws._socket.once("finish", function finish() { - callback(); - }); - ws.close(); - } - }; - duplex._read = function() { - if (ws.isPaused) - ws.resume(); - }; - duplex._write = function(chunk, encoding, callback) { - if (ws.readyState === ws.CONNECTING) { - ws.once("open", function open() { - duplex._write(chunk, encoding, callback); - }); - return; - } - ws.send(chunk, callback); - }; - duplex.on("end", duplexOnEnd); - duplex.on("error", duplexOnError); - return duplex; - } - module2.exports = createWebSocketStream2; - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/subprotocol.js -var require_subprotocol = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/subprotocol.js"(exports2, module2) { - "use strict"; - var { tokenChars } = require_validation3(); - function parse2(header) { - const protocols = /* @__PURE__ */ new Set(); - let start = -1; - let end = -1; - let i = 0; - for (i; i < header.length; i++) { - const code = header.charCodeAt(i); - if (end === -1 && tokenChars[code] === 1) { - if (start === -1) - start = i; - } else if (i !== 0 && (code === 32 || code === 9)) { - if (end === -1 && start !== -1) - end = i; - } else if (code === 44) { - if (start === -1) { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - if (end === -1) - end = i; - const protocol2 = header.slice(start, end); - if (protocols.has(protocol2)) { - throw new SyntaxError(`The "${protocol2}" subprotocol is duplicated`); - } - protocols.add(protocol2); - start = end = -1; - } else { - throw new SyntaxError(`Unexpected character at index ${i}`); - } - } - if (start === -1 || end !== -1) { - throw new SyntaxError("Unexpected end of input"); - } - const protocol = header.slice(start, i); - if (protocols.has(protocol)) { - throw new SyntaxError(`The "${protocol}" subprotocol is duplicated`); - } - protocols.add(protocol); - return protocols; - } - module2.exports = { parse: parse2 }; - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket-server.js -var require_websocket_server = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/lib/websocket-server.js"(exports2, module2) { - "use strict"; - var EventEmitter2 = require("events"); - var http2 = require("http"); - var { Duplex } = require("stream"); - var { createHash: createHash2 } = require("crypto"); - var extension2 = require_extension(); - var PerMessageDeflate2 = require_permessage_deflate(); - var subprotocol2 = require_subprotocol(); - var WebSocket3 = require_websocket(); - var { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants3(); - var keyRegex = /^[+/0-9A-Za-z]{22}==$/; - var RUNNING = 0; - var CLOSING = 1; - var CLOSED = 2; - var WebSocketServer2 = class extends EventEmitter2 { - /** - * Create a `WebSocketServer` instance. - * - * @param {Object} options Configuration options - * @param {Boolean} [options.allowSynchronousEvents=true] Specifies whether - * any of the `'message'`, `'ping'`, and `'pong'` events can be emitted - * multiple times in the same tick - * @param {Boolean} [options.autoPong=true] Specifies whether or not to - * automatically send a pong in response to a ping - * @param {Number} [options.backlog=511] The maximum length of the queue of - * pending connections - * @param {Boolean} [options.clientTracking=true] Specifies whether or not to - * track clients - * @param {Number} [options.closeTimeout=30000] Duration in milliseconds to - * wait for the closing handshake to finish after `websocket.close()` is - * called - * @param {Function} [options.handleProtocols] A hook to handle protocols - * @param {String} [options.host] The hostname where to bind the server - * @param {Number} [options.maxPayload=104857600] The maximum allowed message - * size - * @param {Boolean} [options.noServer=false] Enable no server mode - * @param {String} [options.path] Accept only connections matching this path - * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable - * permessage-deflate - * @param {Number} [options.port] The port where to bind the server - * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S - * server to use - * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or - * not to skip UTF-8 validation for text and close messages - * @param {Function} [options.verifyClient] A hook to reject connections - * @param {Function} [options.WebSocket=WebSocket] Specifies the `WebSocket` - * class to use. It must be the `WebSocket` class or class that extends it - * @param {Function} [callback] A listener for the `listening` event - */ - constructor(options, callback) { - super(); - options = { - allowSynchronousEvents: true, - autoPong: true, - maxPayload: 100 * 1024 * 1024, - skipUTF8Validation: false, - perMessageDeflate: false, - handleProtocols: null, - clientTracking: true, - closeTimeout: CLOSE_TIMEOUT, - verifyClient: null, - noServer: false, - backlog: null, - // use default (511 as implemented in net.js) - server: null, - host: null, - path: null, - port: null, - WebSocket: WebSocket3, - ...options - }; - if (options.port == null && !options.server && !options.noServer || options.port != null && (options.server || options.noServer) || options.server && options.noServer) { - throw new TypeError( - 'One and only one of the "port", "server", or "noServer" options must be specified' - ); - } - if (options.port != null) { - this._server = http2.createServer((req, res) => { - const body = http2.STATUS_CODES[426]; - res.writeHead(426, { - "Content-Length": body.length, - "Content-Type": "text/plain" - }); - res.end(body); - }); - this._server.listen( - options.port, - options.host, - options.backlog, - callback - ); - } else if (options.server) { - this._server = options.server; - } - if (this._server) { - const emitConnection = this.emit.bind(this, "connection"); - this._removeListeners = addListeners(this._server, { - listening: this.emit.bind(this, "listening"), - error: this.emit.bind(this, "error"), - upgrade: (req, socket, head) => { - this.handleUpgrade(req, socket, head, emitConnection); - } - }); - } - if (options.perMessageDeflate === true) - options.perMessageDeflate = {}; - if (options.clientTracking) { - this.clients = /* @__PURE__ */ new Set(); - this._shouldEmitClose = false; - } - this.options = options; - this._state = RUNNING; - } - /** - * Returns the bound address, the address family name, and port of the server - * as reported by the operating system if listening on an IP socket. - * If the server is listening on a pipe or UNIX domain socket, the name is - * returned as a string. - * - * @return {(Object|String|null)} The address of the server - * @public - */ - address() { - if (this.options.noServer) { - throw new Error('The server is operating in "noServer" mode'); - } - if (!this._server) - return null; - return this._server.address(); - } - /** - * Stop the server from accepting new connections and emit the `'close'` event - * when all existing connections are closed. - * - * @param {Function} [cb] A one-time listener for the `'close'` event - * @public - */ - close(cb) { - if (this._state === CLOSED) { - if (cb) { - this.once("close", () => { - cb(new Error("The server is not running")); - }); - } - process.nextTick(emitClose, this); - return; - } - if (cb) - this.once("close", cb); - if (this._state === CLOSING) - return; - this._state = CLOSING; - if (this.options.noServer || this.options.server) { - if (this._server) { - this._removeListeners(); - this._removeListeners = this._server = null; - } - if (this.clients) { - if (!this.clients.size) { - process.nextTick(emitClose, this); - } else { - this._shouldEmitClose = true; - } - } else { - process.nextTick(emitClose, this); - } - } else { - const server = this._server; - this._removeListeners(); - this._removeListeners = this._server = null; - server.close(() => { - emitClose(this); - }); - } - } - /** - * See if a given request should be handled by this server instance. - * - * @param {http.IncomingMessage} req Request object to inspect - * @return {Boolean} `true` if the request is valid, else `false` - * @public - */ - shouldHandle(req) { - if (this.options.path) { - const index = req.url.indexOf("?"); - const pathname = index !== -1 ? req.url.slice(0, index) : req.url; - if (pathname !== this.options.path) - return false; - } - return true; - } - /** - * Handle a HTTP Upgrade request. - * - * @param {http.IncomingMessage} req The request object - * @param {Duplex} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Function} cb Callback - * @public - */ - handleUpgrade(req, socket, head, cb) { - socket.on("error", socketOnError); - const key = req.headers["sec-websocket-key"]; - const upgrade = req.headers.upgrade; - const version2 = +req.headers["sec-websocket-version"]; - if (req.method !== "GET") { - const message = "Invalid HTTP method"; - abortHandshakeOrEmitwsClientError(this, req, socket, 405, message); - return; - } - if (upgrade === void 0 || upgrade.toLowerCase() !== "websocket") { - const message = "Invalid Upgrade header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - if (key === void 0 || !keyRegex.test(key)) { - const message = "Missing or invalid Sec-WebSocket-Key header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - if (version2 !== 13 && version2 !== 8) { - const message = "Missing or invalid Sec-WebSocket-Version header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, { - "Sec-WebSocket-Version": "13, 8" - }); - return; - } - if (!this.shouldHandle(req)) { - abortHandshake(socket, 400); - return; - } - const secWebSocketProtocol = req.headers["sec-websocket-protocol"]; - let protocols = /* @__PURE__ */ new Set(); - if (secWebSocketProtocol !== void 0) { - try { - protocols = subprotocol2.parse(secWebSocketProtocol); - } catch (err) { - const message = "Invalid Sec-WebSocket-Protocol header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - } - const secWebSocketExtensions = req.headers["sec-websocket-extensions"]; - const extensions = {}; - if (this.options.perMessageDeflate && secWebSocketExtensions !== void 0) { - const perMessageDeflate = new PerMessageDeflate2({ - ...this.options.perMessageDeflate, - isServer: true, - maxPayload: this.options.maxPayload - }); - try { - const offers = extension2.parse(secWebSocketExtensions); - if (offers[PerMessageDeflate2.extensionName]) { - perMessageDeflate.accept(offers[PerMessageDeflate2.extensionName]); - extensions[PerMessageDeflate2.extensionName] = perMessageDeflate; - } - } catch (err) { - const message = "Invalid or unacceptable Sec-WebSocket-Extensions header"; - abortHandshakeOrEmitwsClientError(this, req, socket, 400, message); - return; - } - } - if (this.options.verifyClient) { - const info = { - origin: req.headers[`${version2 === 8 ? "sec-websocket-origin" : "origin"}`], - secure: !!(req.socket.authorized || req.socket.encrypted), - req - }; - if (this.options.verifyClient.length === 2) { - this.options.verifyClient(info, (verified, code, message, headers) => { - if (!verified) { - return abortHandshake(socket, code || 401, message, headers); - } - this.completeUpgrade( - extensions, - key, - protocols, - req, - socket, - head, - cb - ); - }); - return; - } - if (!this.options.verifyClient(info)) - return abortHandshake(socket, 401); - } - this.completeUpgrade(extensions, key, protocols, req, socket, head, cb); - } - /** - * Upgrade the connection to WebSocket. - * - * @param {Object} extensions The accepted extensions - * @param {String} key The value of the `Sec-WebSocket-Key` header - * @param {Set} protocols The subprotocols - * @param {http.IncomingMessage} req The request object - * @param {Duplex} socket The network socket between the server and client - * @param {Buffer} head The first packet of the upgraded stream - * @param {Function} cb Callback - * @throws {Error} If called more than once with the same socket - * @private - */ - completeUpgrade(extensions, key, protocols, req, socket, head, cb) { - if (!socket.readable || !socket.writable) - return socket.destroy(); - if (socket[kWebSocket]) { - throw new Error( - "server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration" - ); - } - if (this._state > RUNNING) - return abortHandshake(socket, 503); - const digest = createHash2("sha1").update(key + GUID).digest("base64"); - const headers = [ - "HTTP/1.1 101 Switching Protocols", - "Upgrade: websocket", - "Connection: Upgrade", - `Sec-WebSocket-Accept: ${digest}` - ]; - const ws = new this.options.WebSocket(null, void 0, this.options); - if (protocols.size) { - const protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value; - if (protocol) { - headers.push(`Sec-WebSocket-Protocol: ${protocol}`); - ws._protocol = protocol; - } - } - if (extensions[PerMessageDeflate2.extensionName]) { - const params = extensions[PerMessageDeflate2.extensionName].params; - const value = extension2.format({ - [PerMessageDeflate2.extensionName]: [params] - }); - headers.push(`Sec-WebSocket-Extensions: ${value}`); - ws._extensions = extensions; - } - this.emit("headers", headers, req); - socket.write(headers.concat("\r\n").join("\r\n")); - socket.removeListener("error", socketOnError); - ws.setSocket(socket, head, { - allowSynchronousEvents: this.options.allowSynchronousEvents, - maxPayload: this.options.maxPayload, - skipUTF8Validation: this.options.skipUTF8Validation - }); - if (this.clients) { - this.clients.add(ws); - ws.on("close", () => { - this.clients.delete(ws); - if (this._shouldEmitClose && !this.clients.size) { - process.nextTick(emitClose, this); - } - }); - } - cb(ws, req); - } - }; - module2.exports = WebSocketServer2; - function addListeners(server, map) { - for (const event of Object.keys(map)) - server.on(event, map[event]); - return function removeListeners() { - for (const event of Object.keys(map)) { - server.removeListener(event, map[event]); - } - }; - } - function emitClose(server) { - server._state = CLOSED; - server.emit("close"); - } - function socketOnError() { - this.destroy(); - } - function abortHandshake(socket, code, message, headers) { - message = message || http2.STATUS_CODES[code]; - headers = { - Connection: "close", - "Content-Type": "text/html", - "Content-Length": Buffer.byteLength(message), - ...headers - }; - socket.once("finish", socket.destroy); - socket.end( - `HTTP/1.1 ${code} ${http2.STATUS_CODES[code]}\r -` + Object.keys(headers).map((h) => `${h}: ${headers[h]}`).join("\r\n") + "\r\n\r\n" + message - ); - } - function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) { - if (server.listenerCount("wsClientError")) { - const err = new Error(message); - Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError); - server.emit("wsClientError", err, socket, req); - } else { - abortHandshake(socket, code, message, headers); - } - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/wrapper.mjs -var import_stream2, import_extension, import_permessage_deflate, import_receiver, import_sender, import_subprotocol, import_websocket, import_websocket_server, wrapper_default; -var init_wrapper = __esm({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/wrapper.mjs"() { - import_stream2 = __toESM(require_stream(), 1); - import_extension = __toESM(require_extension(), 1); - import_permessage_deflate = __toESM(require_permessage_deflate(), 1); - import_receiver = __toESM(require_receiver(), 1); - import_sender = __toESM(require_sender(), 1); - import_subprotocol = __toESM(require_subprotocol(), 1); - import_websocket = __toESM(require_websocket(), 1); - import_websocket_server = __toESM(require_websocket_server(), 1); - wrapper_default = import_websocket.default; - } -}); - -// ../../node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.js -var require_eventemitter3 = __commonJS({ - "../../node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.js"(exports2, module2) { - "use strict"; - var has = Object.prototype.hasOwnProperty; - var prefix = "~"; - function Events() { - } - if (Object.create) { - Events.prototype = /* @__PURE__ */ Object.create(null); - if (!new Events().__proto__) - prefix = false; - } - function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; - } - function addListener(emitter, event, fn, context, once) { - if (typeof fn !== "function") { - throw new TypeError("The listener must be a function"); - } - var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event; - if (!emitter._events[evt]) - emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) - emitter._events[evt].push(listener); - else - emitter._events[evt] = [emitter._events[evt], listener]; - return emitter; - } - function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) - emitter._events = new Events(); - else - delete emitter._events[evt]; - } - function EventEmitter2() { - this._events = new Events(); - this._eventsCount = 0; - } - EventEmitter2.prototype.eventNames = function eventNames() { - var names = [], events, name; - if (this._eventsCount === 0) - return names; - for (name in events = this._events) { - if (has.call(events, name)) - names.push(prefix ? name.slice(1) : name); - } - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - return names; - }; - EventEmitter2.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event, handlers = this._events[evt]; - if (!handlers) - return []; - if (handlers.fn) - return [handlers.fn]; - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - return ee; - }; - EventEmitter2.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event, listeners = this._events[evt]; - if (!listeners) - return 0; - if (listeners.fn) - return 1; - return listeners.length; - }; - EventEmitter2.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - if (!this._events[evt]) - return false; - var listeners = this._events[evt], len = arguments.length, args, i; - if (listeners.fn) { - if (listeners.once) - this.removeListener(event, listeners.fn, void 0, true); - switch (len) { - case 1: - return listeners.fn.call(listeners.context), true; - case 2: - return listeners.fn.call(listeners.context, a1), true; - case 3: - return listeners.fn.call(listeners.context, a1, a2), true; - case 4: - return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: - return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: - return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - for (i = 1, args = new Array(len - 1); i < len; i++) { - args[i - 1] = arguments[i]; - } - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length, j; - for (i = 0; i < length; i++) { - if (listeners[i].once) - this.removeListener(event, listeners[i].fn, void 0, true); - switch (len) { - case 1: - listeners[i].fn.call(listeners[i].context); - break; - case 2: - listeners[i].fn.call(listeners[i].context, a1); - break; - case 3: - listeners[i].fn.call(listeners[i].context, a1, a2); - break; - case 4: - listeners[i].fn.call(listeners[i].context, a1, a2, a3); - break; - default: - if (!args) - for (j = 1, args = new Array(len - 1); j < len; j++) { - args[j - 1] = arguments[j]; - } - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - return true; - }; - EventEmitter2.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); - }; - EventEmitter2.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); - }; - EventEmitter2.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - if (!this._events[evt]) - return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - var listeners = this._events[evt]; - if (listeners.fn) { - if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) { - events.push(listeners[i]); - } - } - if (events.length) - this._events[evt] = events.length === 1 ? events[0] : events; - else - clearEvent(this, evt); - } - return this; - }; - EventEmitter2.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) - clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - return this; - }; - EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener; - EventEmitter2.prototype.addListener = EventEmitter2.prototype.on; - EventEmitter2.prefixed = prefix; - EventEmitter2.EventEmitter = EventEmitter2; - if ("undefined" !== typeof module2) { - module2.exports = EventEmitter2; - } - } -}); - -// ../../node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.mjs -var import_index; -var init_eventemitter3 = __esm({ - "../../node_modules/.pnpm/eventemitter3@5.0.4/node_modules/eventemitter3/index.mjs"() { - import_index = __toESM(require_eventemitter3(), 1); - } -}); - -// ../../node_modules/.pnpm/rpc-websockets@9.3.8/node_modules/rpc-websockets/dist/index.mjs -function WebSocket2(address, options) { - return new wrapper_default(address, options); -} -var DefaultDataPack, CommonClient; -var init_dist2 = __esm({ - "../../node_modules/.pnpm/rpc-websockets@9.3.8/node_modules/rpc-websockets/dist/index.mjs"() { - init_wrapper(); - init_eventemitter3(); - DefaultDataPack = class { - encode(value) { - return JSON.stringify(value); - } - decode(value) { - return JSON.parse(value); - } - }; - CommonClient = class extends import_index.default { - address; - rpc_id; - queue; - options; - autoconnect; - ready; - reconnect; - reconnect_timer_id; - reconnect_interval; - max_reconnects; - rest_options; - current_reconnects; - generate_request_id; - socket; - webSocketFactory; - dataPack; - /** - * Instantiate a Client class. - * @constructor - * @param {webSocketFactory} webSocketFactory - factory method for WebSocket - * @param {String} address - url to a websocket server - * @param {Object} options - ws options object with reconnect parameters - * @param {Function} generate_request_id - custom generation request Id - * @param {DataPack} dataPack - data pack contains encoder and decoder - * @return {CommonClient} - */ - constructor(webSocketFactory, address = "ws://localhost:8080", { - autoconnect = true, - reconnect = true, - reconnect_interval = 1e3, - max_reconnects = 5, - ...rest_options - } = {}, generate_request_id, dataPack) { - super(); - this.webSocketFactory = webSocketFactory; - this.queue = {}; - this.rpc_id = 0; - this.address = address; - this.autoconnect = autoconnect; - this.ready = false; - this.reconnect = reconnect; - this.reconnect_timer_id = void 0; - this.reconnect_interval = reconnect_interval; - this.max_reconnects = max_reconnects; - this.rest_options = rest_options; - this.current_reconnects = 0; - this.generate_request_id = generate_request_id || (() => typeof this.rpc_id === "number" ? ++this.rpc_id : Number(this.rpc_id) + 1); - if (!dataPack) - this.dataPack = new DefaultDataPack(); - else - this.dataPack = dataPack; - if (this.autoconnect) - this._connect(this.address, { - autoconnect: this.autoconnect, - reconnect: this.reconnect, - reconnect_interval: this.reconnect_interval, - max_reconnects: this.max_reconnects, - ...this.rest_options - }); - } - /** - * Connects to a defined server if not connected already. - * @method - * @return {Undefined} - */ - connect() { - if (this.socket) - return; - this._connect(this.address, { - autoconnect: this.autoconnect, - reconnect: this.reconnect, - reconnect_interval: this.reconnect_interval, - max_reconnects: this.max_reconnects, - ...this.rest_options - }); - } - /** - * Calls a registered RPC method on server. - * @method - * @param {String} method - RPC method name - * @param {Object|Array} params - optional method parameters - * @param {Number} timeout - RPC reply timeout value - * @param {Object} ws_opts - options passed to ws - * @return {Promise} - */ - call(method, params, timeout, ws_opts) { - if (!ws_opts && "object" === typeof timeout) { - ws_opts = timeout; - timeout = null; - } - return new Promise((resolve, reject) => { - if (!this.ready) - return reject(new Error("socket not ready")); - const rpc_id = this.generate_request_id(method, params); - const message = { - jsonrpc: "2.0", - method, - params: params || void 0, - id: rpc_id - }; - this.socket.send(this.dataPack.encode(message), ws_opts, (error) => { - if (error) - return reject(error); - this.queue[rpc_id] = { promise: [resolve, reject] }; - if (timeout) { - this.queue[rpc_id].timeout = setTimeout(() => { - delete this.queue[rpc_id]; - reject(new Error("reply timeout")); - }, timeout); - } - }); - }); - } - /** - * Logins with the other side of the connection. - * @method - * @param {Object} params - Login credentials object - * @return {Promise} - */ - async login(params) { - const resp = await this.call("rpc.login", params); - if (!resp) - throw new Error("authentication failed"); - return resp; - } - /** - * Fetches a list of client's methods registered on server. - * @method - * @return {Array} - */ - async listMethods() { - return await this.call("__listMethods"); - } - /** - * Sends a JSON-RPC 2.0 notification to server. - * @method - * @param {String} method - RPC method name - * @param {Object} params - optional method parameters - * @return {Promise} - */ - notify(method, params) { - return new Promise((resolve, reject) => { - if (!this.ready) - return reject(new Error("socket not ready")); - const message = { - jsonrpc: "2.0", - method, - params - }; - this.socket.send(this.dataPack.encode(message), (error) => { - if (error) - return reject(error); - resolve(); - }); - }); - } - /** - * Subscribes for a defined event. - * @method - * @param {String|Array} event - event name - * @return {Undefined} - * @throws {Error} - */ - async subscribe(event) { - if (typeof event === "string") - event = [event]; - const result = await this.call("rpc.on", event); - if (typeof event === "string" && result[event] !== "ok") - throw new Error( - "Failed subscribing to an event '" + event + "' with: " + result[event] - ); - return result; - } - /** - * Unsubscribes from a defined event. - * @method - * @param {String|Array} event - event name - * @return {Undefined} - * @throws {Error} - */ - async unsubscribe(event) { - if (typeof event === "string") - event = [event]; - const result = await this.call("rpc.off", event); - if (typeof event === "string" && result[event] !== "ok") - throw new Error("Failed unsubscribing from an event with: " + result); - return result; - } - /** - * Closes a WebSocket connection gracefully. - * @method - * @param {Number} code - socket close code - * @param {String} data - optional data to be sent before closing - * @return {Undefined} - */ - close(code, data) { - if (this.socket) - this.socket.close(code || 1e3, data); - } - /** - * Enable / disable automatic reconnection. - * @method - * @param {Boolean} reconnect - enable / disable reconnection - * @return {Undefined} - */ - setAutoReconnect(reconnect) { - this.reconnect = reconnect; - } - /** - * Set the interval between reconnection attempts. - * @method - * @param {Number} interval - reconnection interval in milliseconds - * @return {Undefined} - */ - setReconnectInterval(interval) { - this.reconnect_interval = interval; - } - /** - * Set the maximum number of reconnection attempts. - * @method - * @param {Number} max_reconnects - maximum reconnection attempts - * @return {Undefined} - */ - setMaxReconnects(max_reconnects) { - this.max_reconnects = max_reconnects; - } - /** - * Get the current number of reconnection attempts made. - * @method - * @return {Number} current reconnection attempts - */ - getCurrentReconnects() { - return this.current_reconnects; - } - /** - * Get the maximum number of reconnection attempts. - * @method - * @return {Number} maximum reconnection attempts - */ - getMaxReconnects() { - return this.max_reconnects; - } - /** - * Check if the client is currently attempting to reconnect. - * @method - * @return {Boolean} true if reconnection is in progress - */ - isReconnecting() { - return this.reconnect_timer_id !== void 0; - } - /** - * Check if the client will attempt to reconnect on the next close event. - * @method - * @return {Boolean} true if reconnection will be attempted - */ - willReconnect() { - return this.reconnect && (this.max_reconnects === 0 || this.current_reconnects < this.max_reconnects); - } - /** - * Connection/Message handler. - * @method - * @private - * @param {String} address - WebSocket API address - * @param {Object} options - ws options object - * @return {Undefined} - */ - _connect(address, options) { - clearTimeout(this.reconnect_timer_id); - this.socket = this.webSocketFactory(address, options); - this.socket.addEventListener("open", () => { - this.ready = true; - this.emit("open"); - this.current_reconnects = 0; - }); - this.socket.addEventListener("message", ({ data: message }) => { - if (message instanceof ArrayBuffer) - message = Buffer.from(message).toString(); - try { - message = this.dataPack.decode(message); - } catch (_error) { - return; - } - if (message.notification && this.listeners(message.notification).length) { - if (!Object.keys(message.params).length) - return this.emit(message.notification); - const args = [message.notification]; - if (message.params.constructor === Object) - args.push(message.params); - else - for (let i = 0; i < message.params.length; i++) - args.push(message.params[i]); - return Promise.resolve().then(() => { - this.emit.apply(this, args); - }); - } - if (!this.queue[message.id]) { - if (message.method) { - return Promise.resolve().then(() => { - this.emit(message.method, message?.params); - }); - } - return; - } - if ("error" in message === "result" in message) - this.queue[message.id].promise[1]( - new Error( - 'Server response malformed. Response must include either "result" or "error", but not both.' - ) - ); - if (this.queue[message.id].timeout) - clearTimeout(this.queue[message.id].timeout); - if (message.error) - this.queue[message.id].promise[1](message.error); - else - this.queue[message.id].promise[0](message.result); - delete this.queue[message.id]; - }); - this.socket.addEventListener("error", (error) => this.emit("error", error)); - this.socket.addEventListener("close", ({ code, reason }) => { - if (this.ready) - setTimeout(() => this.emit("close", code, reason), 0); - this.ready = false; - this.socket = void 0; - if (code === 1e3) - return; - this.current_reconnects++; - if (this.reconnect && (this.max_reconnects > this.current_reconnects || this.max_reconnects === 0)) - this.reconnect_timer_id = setTimeout( - () => this._connect(address, options), - this.reconnect_interval - ); - else if (this.reconnect && this.max_reconnects > 0 && this.current_reconnects >= this.max_reconnects) { - setTimeout(() => this.emit("max_reconnects_reached", code, reason), 1); - } - }); - } - }; - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js -function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - for (let round = 24 - rounds; round < 24; round++) { - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); -} -var _0n6, _1n6, _2n4, _7n2, _256n, _0x71n, SHA3_PI, SHA3_ROTL, _SHA3_IOTA, IOTAS, SHA3_IOTA_H, SHA3_IOTA_L, rotlH, rotlL, Keccak, gen, keccak_256; -var init_sha3 = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js"() { - init_u64(); - init_utils(); - _0n6 = BigInt(0); - _1n6 = BigInt(1); - _2n4 = BigInt(2); - _7n2 = BigInt(7); - _256n = BigInt(256); - _0x71n = BigInt(113); - SHA3_PI = []; - SHA3_ROTL = []; - _SHA3_IOTA = []; - for (let round = 0, R = _1n6, x = 1, y = 0; round < 24; round++) { - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64); - let t = _0n6; - for (let j = 0; j < 7; j++) { - R = (R << _1n6 ^ (R >> _7n2) * _0x71n) % _256n; - if (R & _2n4) - t ^= _1n6 << (_1n6 << /* @__PURE__ */ BigInt(j)) - _1n6; - } - _SHA3_IOTA.push(t); - } - IOTAS = split(_SHA3_IOTA, true); - SHA3_IOTA_H = IOTAS[0]; - SHA3_IOTA_L = IOTAS[1]; - rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s); - rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s); - Keccak = class _Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - this.enableXOF = false; - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - anumber(outputLen); - if (!(0 < blockLen && blockLen < 200)) - throw new Error("only keccak-f1600 function is supported"); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone() { - return this._cloneInto(); - } - keccak() { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - aexists(this); - data = toBytes(data); - abytes(data); - const { blockLen, state } = this; - const len = data.length; - for (let pos = 0; pos < len; ) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - state[pos] ^= suffix; - if ((suffix & 128) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 128; - this.keccak(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len; ) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - if (!this.enableXOF) - throw new Error("XOF is not possible for this instance"); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error("digest() was already called"); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } - }; - gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen)); - keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))(); - } -}); - -// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/hmac.js -var HMAC, hmac; -var init_hmac = __esm({ - "../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/hmac.js"() { - init_utils(); - HMAC = class extends Hash { - constructor(hash, _key) { - super(); - this.finished = false; - this.destroyed = false; - ahash(hash); - const key = toBytes(_key); - this.iHash = hash.create(); - if (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 blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 54; - this.iHash.update(pad); - this.oHash = hash.create(); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 54 ^ 92; - this.oHash.update(pad); - clean(pad); - } - update(buf) { - aexists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - aexists(this); - abytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone() { - return this._cloneInto(); - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } - }; - hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); - hmac.create = (hash, key) => new HMAC(hash, key); - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/weierstrass.js -function _splitEndoScalar(k, basis, n) { - const [[a1, b1], [a2, b2]] = basis; - const c1 = divNearest(b2 * k, n); - const c2 = divNearest(-b1 * k, n); - let k1 = k - c1 * a1 - c2 * a2; - let k2 = -c1 * b1 - c2 * b2; - const k1neg = k1 < _0n7; - const k2neg = k2 < _0n7; - if (k1neg) - k1 = -k1; - if (k2neg) - k2 = -k2; - const MAX_NUM = bitMask(Math.ceil(bitLen(n) / 2)) + _1n7; - if (k1 < _0n7 || k1 >= MAX_NUM || k2 < _0n7 || k2 >= MAX_NUM) { - throw new Error("splitScalar (endomorphism): failed, k=" + k); - } - return { k1neg, k1, k2neg, k2 }; -} -function validateSigFormat(format) { - if (!["compact", "recovered", "der"].includes(format)) - throw new Error('Signature format must be "compact", "recovered", or "der"'); - return format; -} -function validateSigOpts(opts, def) { - const optsn = {}; - for (let optName of Object.keys(def)) { - optsn[optName] = opts[optName] === void 0 ? def[optName] : opts[optName]; - } - _abool2(optsn.lowS, "lowS"); - _abool2(optsn.prehash, "prehash"); - if (optsn.format !== void 0) - validateSigFormat(optsn.format); - return optsn; -} -function _normFnElement(Fn2, key) { - const { BYTES: expected } = Fn2; - let num; - if (typeof key === "bigint") { - num = key; - } else { - let bytes = ensureBytes("private key", key); - try { - num = Fn2.fromBytes(bytes); - } catch (error) { - throw new Error(`invalid private key: expected ui8a of size ${expected}, got ${typeof key}`); - } - } - if (!Fn2.isValidNot0(num)) - throw new Error("invalid private key: out of range [1..N-1]"); - return num; -} -function weierstrassN(params, extraOpts = {}) { - const validated = _createCurveFields("weierstrass", params, extraOpts); - const { Fp: Fp2, Fn: Fn2 } = validated; - let CURVE = validated.CURVE; - const { h: cofactor, n: CURVE_ORDER } = CURVE; - _validateObject(extraOpts, {}, { - allowInfinityPoint: "boolean", - clearCofactor: "function", - isTorsionFree: "function", - fromBytes: "function", - toBytes: "function", - endo: "object", - wrapPrivateKey: "boolean" - }); - const { endo } = extraOpts; - if (endo) { - if (!Fp2.is0(CURVE.a) || typeof endo.beta !== "bigint" || !Array.isArray(endo.basises)) { - throw new Error('invalid endo: expected "beta": bigint and "basises": array'); - } - } - const lengths = getWLengths(Fp2, Fn2); - function assertCompressionIsSupported() { - if (!Fp2.isOdd) - throw new Error("compression is not supported: Field does not have .isOdd()"); - } - function pointToBytes(_c, point, isCompressed) { - const { x, y } = point.toAffine(); - const bx = Fp2.toBytes(x); - _abool2(isCompressed, "isCompressed"); - if (isCompressed) { - assertCompressionIsSupported(); - const hasEvenY = !Fp2.isOdd(y); - return concatBytes(pprefix(hasEvenY), bx); - } else { - return concatBytes(Uint8Array.of(4), bx, Fp2.toBytes(y)); - } - } - function pointFromBytes(bytes) { - _abytes2(bytes, void 0, "Point"); - const { publicKey: comp, publicKeyUncompressed: uncomp } = lengths; - const length = bytes.length; - const head = bytes[0]; - const tail = bytes.subarray(1); - if (length === comp && (head === 2 || head === 3)) { - const x = Fp2.fromBytes(tail); - if (!Fp2.isValid(x)) - throw new Error("bad point: is not on curve, wrong x"); - const y2 = weierstrassEquation(x); - let y; - try { - y = Fp2.sqrt(y2); - } catch (sqrtError) { - const err = sqrtError instanceof Error ? ": " + sqrtError.message : ""; - throw new Error("bad point: is not on curve, sqrt error" + err); - } - assertCompressionIsSupported(); - const isYOdd = Fp2.isOdd(y); - const isHeadOdd = (head & 1) === 1; - if (isHeadOdd !== isYOdd) - y = Fp2.neg(y); - return { x, y }; - } else if (length === uncomp && head === 4) { - const L = Fp2.BYTES; - const x = Fp2.fromBytes(tail.subarray(0, L)); - const y = Fp2.fromBytes(tail.subarray(L, L * 2)); - if (!isValidXY(x, y)) - throw new Error("bad point: is not on curve"); - return { x, y }; - } else { - throw new Error(`bad point: got length ${length}, expected compressed=${comp} or uncompressed=${uncomp}`); - } - } - const encodePoint = extraOpts.toBytes || pointToBytes; - const decodePoint = extraOpts.fromBytes || pointFromBytes; - function weierstrassEquation(x) { - const x2 = Fp2.sqr(x); - const x3 = Fp2.mul(x2, x); - return Fp2.add(Fp2.add(x3, Fp2.mul(x, CURVE.a)), CURVE.b); - } - function isValidXY(x, y) { - const left = Fp2.sqr(y); - const right = weierstrassEquation(x); - return Fp2.eql(left, right); - } - if (!isValidXY(CURVE.Gx, CURVE.Gy)) - throw new Error("bad curve params: generator point"); - const _4a3 = Fp2.mul(Fp2.pow(CURVE.a, _3n3), _4n2); - const _27b2 = Fp2.mul(Fp2.sqr(CURVE.b), BigInt(27)); - if (Fp2.is0(Fp2.add(_4a3, _27b2))) - throw new Error("bad curve params: a or b"); - function acoord(title, n, banZero = false) { - if (!Fp2.isValid(n) || banZero && Fp2.is0(n)) - throw new Error(`bad point coordinate ${title}`); - return n; - } - function aprjpoint(other) { - if (!(other instanceof Point)) - throw new Error("ProjectivePoint expected"); - } - function splitEndoScalarN(k) { - if (!endo || !endo.basises) - throw new Error("no endo"); - return _splitEndoScalar(k, endo.basises, Fn2.ORDER); - } - const toAffineMemo = memoized((p, iz) => { - const { X, Y, Z } = p; - if (Fp2.eql(Z, Fp2.ONE)) - return { x: X, y: Y }; - const is0 = p.is0(); - if (iz == null) - iz = is0 ? Fp2.ONE : Fp2.inv(Z); - const x = Fp2.mul(X, iz); - const y = Fp2.mul(Y, iz); - const zz = Fp2.mul(Z, iz); - if (is0) - return { x: Fp2.ZERO, y: Fp2.ZERO }; - if (!Fp2.eql(zz, Fp2.ONE)) - throw new Error("invZ was invalid"); - return { x, y }; - }); - const assertValidMemo = memoized((p) => { - if (p.is0()) { - if (extraOpts.allowInfinityPoint && !Fp2.is0(p.Y)) - return; - throw new Error("bad point: ZERO"); - } - const { x, y } = p.toAffine(); - if (!Fp2.isValid(x) || !Fp2.isValid(y)) - throw new Error("bad point: x or y not field elements"); - if (!isValidXY(x, y)) - throw new Error("bad point: equation left != right"); - if (!p.isTorsionFree()) - throw new Error("bad point: not in prime-order subgroup"); - return true; - }); - function finishEndo(endoBeta, k1p, k2p, k1neg, k2neg) { - k2p = new Point(Fp2.mul(k2p.X, endoBeta), k2p.Y, k2p.Z); - k1p = negateCt(k1neg, k1p); - k2p = negateCt(k2neg, k2p); - return k1p.add(k2p); - } - class Point { - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - constructor(X, Y, Z) { - this.X = acoord("x", X); - this.Y = acoord("y", Y, true); - this.Z = acoord("z", Z); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - /** Does NOT validate if the point is valid. Use `.assertValidity()`. */ - static fromAffine(p) { - const { x, y } = p || {}; - if (!p || !Fp2.isValid(x) || !Fp2.isValid(y)) - throw new Error("invalid affine point"); - if (p instanceof Point) - throw new Error("projective point not allowed"); - if (Fp2.is0(x) && Fp2.is0(y)) - return Point.ZERO; - return new Point(x, y, Fp2.ONE); - } - static fromBytes(bytes) { - const P = Point.fromAffine(decodePoint(_abytes2(bytes, void 0, "point"))); - P.assertValidity(); - return P; - } - static fromHex(hex) { - return Point.fromBytes(ensureBytes("pointHex", hex)); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - /** - * - * @param windowSize - * @param isLazy true will defer table computation until the first multiplication - * @returns - */ - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_3n3); - return this; - } - // TODO: return `this` - /** A point on curve is valid if it conforms to equation. */ - assertValidity() { - assertValidMemo(this); - } - hasEvenY() { - const { y } = this.toAffine(); - if (!Fp2.isOdd) - throw new Error("Field doesn't support isOdd"); - return !Fp2.isOdd(y); - } - /** Compare one point to another. */ - equals(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const U1 = Fp2.eql(Fp2.mul(X1, Z2), Fp2.mul(X2, Z1)); - const U2 = Fp2.eql(Fp2.mul(Y1, Z2), Fp2.mul(Y2, Z1)); - return U1 && U2; - } - /** Flips point to one corresponding to (x, -y) in Affine coordinates. */ - negate() { - return new Point(this.X, Fp2.neg(this.Y), this.Z); - } - // Renes-Costello-Batina exception-free doubling formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 3 - // Cost: 8M + 3S + 3*a + 2*b3 + 15add. - double() { - const { a, b } = CURVE; - const b3 = Fp2.mul(b, _3n3); - const { X: X1, Y: Y1, Z: Z1 } = this; - let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; - let t0 = Fp2.mul(X1, X1); - let t1 = Fp2.mul(Y1, Y1); - let t2 = Fp2.mul(Z1, Z1); - let t3 = Fp2.mul(X1, Y1); - t3 = Fp2.add(t3, t3); - Z3 = Fp2.mul(X1, Z1); - Z3 = Fp2.add(Z3, Z3); - X3 = Fp2.mul(a, Z3); - Y3 = Fp2.mul(b3, t2); - Y3 = Fp2.add(X3, Y3); - X3 = Fp2.sub(t1, Y3); - Y3 = Fp2.add(t1, Y3); - Y3 = Fp2.mul(X3, Y3); - X3 = Fp2.mul(t3, X3); - Z3 = Fp2.mul(b3, Z3); - t2 = Fp2.mul(a, t2); - t3 = Fp2.sub(t0, t2); - t3 = Fp2.mul(a, t3); - t3 = Fp2.add(t3, Z3); - Z3 = Fp2.add(t0, t0); - t0 = Fp2.add(Z3, t0); - t0 = Fp2.add(t0, t2); - t0 = Fp2.mul(t0, t3); - Y3 = Fp2.add(Y3, t0); - t2 = Fp2.mul(Y1, Z1); - t2 = Fp2.add(t2, t2); - t0 = Fp2.mul(t2, t3); - X3 = Fp2.sub(X3, t0); - Z3 = Fp2.mul(t2, t1); - Z3 = Fp2.add(Z3, Z3); - Z3 = Fp2.add(Z3, Z3); - return new Point(X3, Y3, Z3); - } - // Renes-Costello-Batina exception-free addition formula. - // There is 30% faster Jacobian formula, but it is not complete. - // https://eprint.iacr.org/2015/1060, algorithm 1 - // Cost: 12M + 0S + 3*a + 3*b3 + 23add. - add(other) { - aprjpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - let X3 = Fp2.ZERO, Y3 = Fp2.ZERO, Z3 = Fp2.ZERO; - const a = CURVE.a; - const b3 = Fp2.mul(CURVE.b, _3n3); - let t0 = Fp2.mul(X1, X2); - let t1 = Fp2.mul(Y1, Y2); - let t2 = Fp2.mul(Z1, Z2); - let t3 = Fp2.add(X1, Y1); - let t4 = Fp2.add(X2, Y2); - t3 = Fp2.mul(t3, t4); - t4 = Fp2.add(t0, t1); - t3 = Fp2.sub(t3, t4); - t4 = Fp2.add(X1, Z1); - let t5 = Fp2.add(X2, Z2); - t4 = Fp2.mul(t4, t5); - t5 = Fp2.add(t0, t2); - t4 = Fp2.sub(t4, t5); - t5 = Fp2.add(Y1, Z1); - X3 = Fp2.add(Y2, Z2); - t5 = Fp2.mul(t5, X3); - X3 = Fp2.add(t1, t2); - t5 = Fp2.sub(t5, X3); - Z3 = Fp2.mul(a, t4); - X3 = Fp2.mul(b3, t2); - Z3 = Fp2.add(X3, Z3); - X3 = Fp2.sub(t1, Z3); - Z3 = Fp2.add(t1, Z3); - Y3 = Fp2.mul(X3, Z3); - t1 = Fp2.add(t0, t0); - t1 = Fp2.add(t1, t0); - t2 = Fp2.mul(a, t2); - t4 = Fp2.mul(b3, t4); - t1 = Fp2.add(t1, t2); - t2 = Fp2.sub(t0, t2); - t2 = Fp2.mul(a, t2); - t4 = Fp2.add(t4, t2); - t0 = Fp2.mul(t1, t4); - Y3 = Fp2.add(Y3, t0); - t0 = Fp2.mul(t5, t4); - X3 = Fp2.mul(t3, X3); - X3 = Fp2.sub(X3, t0); - t0 = Fp2.mul(t3, t1); - Z3 = Fp2.mul(t5, Z3); - Z3 = Fp2.add(Z3, t0); - return new Point(X3, Y3, Z3); - } - subtract(other) { - return this.add(other.negate()); - } - is0() { - return this.equals(Point.ZERO); - } - /** - * Constant time multiplication. - * Uses wNAF method. Windowed method may be 10% faster, - * but takes 2x longer to generate and consumes 2x memory. - * Uses precomputes when available. - * Uses endomorphism for Koblitz curves. - * @param scalar by which the point would be multiplied - * @returns New point - */ - multiply(scalar) { - const { endo: endo2 } = extraOpts; - if (!Fn2.isValidNot0(scalar)) - throw new Error("invalid scalar: out of range"); - let point, fake; - const mul = (n) => wnaf.cached(this, n, (p) => normalizeZ(Point, p)); - if (endo2) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(scalar); - const { p: k1p, f: k1f } = mul(k1); - const { p: k2p, f: k2f } = mul(k2); - fake = k1f.add(k2f); - point = finishEndo(endo2.beta, k1p, k2p, k1neg, k2neg); - } else { - const { p, f } = mul(scalar); - point = p; - fake = f; - } - return normalizeZ(Point, [point, fake])[0]; - } - /** - * Non-constant-time multiplication. Uses double-and-add algorithm. - * It's faster, but should only be used when you don't care about - * an exposed secret key e.g. sig verification, which works over *public* keys. - */ - multiplyUnsafe(sc) { - const { endo: endo2 } = extraOpts; - const p = this; - if (!Fn2.isValid(sc)) - throw new Error("invalid scalar: out of range"); - if (sc === _0n7 || p.is0()) - return Point.ZERO; - if (sc === _1n7) - return p; - if (wnaf.hasCache(this)) - return this.multiply(sc); - if (endo2) { - const { k1neg, k1, k2neg, k2 } = splitEndoScalarN(sc); - const { p1, p2 } = mulEndoUnsafe(Point, p, k1, k2); - return finishEndo(endo2.beta, p1, p2, k1neg, k2neg); - } else { - return wnaf.unsafe(p, sc); - } - } - multiplyAndAddUnsafe(Q, a, b) { - const sum = this.multiplyUnsafe(a).add(Q.multiplyUnsafe(b)); - return sum.is0() ? void 0 : sum; - } - /** - * Converts Projective point to affine (x, y) coordinates. - * @param invertedZ Z^-1 (inverted zero) - optional, precomputation is useful for invertBatch - */ - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - /** - * Checks whether Point is free of torsion elements (is in prime subgroup). - * Always torsion-free for cofactor=1 curves. - */ - isTorsionFree() { - const { isTorsionFree } = extraOpts; - if (cofactor === _1n7) - return true; - if (isTorsionFree) - return isTorsionFree(Point, this); - return wnaf.unsafe(this, CURVE_ORDER).is0(); - } - clearCofactor() { - const { clearCofactor } = extraOpts; - if (cofactor === _1n7) - return this; - if (clearCofactor) - return clearCofactor(Point, this); - return this.multiplyUnsafe(cofactor); - } - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - toBytes(isCompressed = true) { - _abool2(isCompressed, "isCompressed"); - this.assertValidity(); - return encodePoint(Point, this, isCompressed); - } - toHex(isCompressed = true) { - return bytesToHex(this.toBytes(isCompressed)); - } - toString() { - return ``; - } - // TODO: remove - get px() { - return this.X; - } - get py() { - return this.X; - } - get pz() { - return this.Z; - } - toRawBytes(isCompressed = true) { - return this.toBytes(isCompressed); - } - _setWindowSize(windowSize) { - this.precompute(windowSize); - } - static normalizeZ(points) { - return normalizeZ(Point, points); - } - static msm(points, scalars) { - return pippenger(Point, Fn2, points, scalars); - } - static fromPrivateKey(privateKey) { - return Point.BASE.multiply(_normFnElement(Fn2, privateKey)); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, Fp2.ONE); - Point.ZERO = new Point(Fp2.ZERO, Fp2.ONE, Fp2.ZERO); - Point.Fp = Fp2; - Point.Fn = Fn2; - const bits = Fn2.BITS; - const wnaf = new wNAF(Point, extraOpts.endo ? Math.ceil(bits / 2) : bits); - Point.BASE.precompute(8); - return Point; -} -function pprefix(hasEvenY) { - return Uint8Array.of(hasEvenY ? 2 : 3); -} -function getWLengths(Fp2, Fn2) { - return { - secretKey: Fn2.BYTES, - publicKey: 1 + Fp2.BYTES, - publicKeyUncompressed: 1 + 2 * Fp2.BYTES, - publicKeyHasPrefix: true, - signature: 2 * Fn2.BYTES - }; -} -function ecdh(Point, ecdhOpts = {}) { - const { Fn: Fn2 } = Point; - const randomBytes_ = ecdhOpts.randomBytes || randomBytes; - const lengths = Object.assign(getWLengths(Point.Fp, Fn2), { seed: getMinHashLength(Fn2.ORDER) }); - function isValidSecretKey(secretKey) { - try { - return !!_normFnElement(Fn2, secretKey); - } catch (error) { - return false; - } - } - function isValidPublicKey2(publicKey2, isCompressed) { - const { publicKey: comp, publicKeyUncompressed } = lengths; - try { - const l = publicKey2.length; - if (isCompressed === true && l !== comp) - return false; - if (isCompressed === false && l !== publicKeyUncompressed) - return false; - return !!Point.fromBytes(publicKey2); - } catch (error) { - return false; - } - } - function randomSecretKey(seed = randomBytes_(lengths.seed)) { - return mapHashToField(_abytes2(seed, lengths.seed, "seed"), Fn2.ORDER); - } - function getPublicKey2(secretKey, isCompressed = true) { - return Point.BASE.multiply(_normFnElement(Fn2, secretKey)).toBytes(isCompressed); - } - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey2(secretKey) }; - } - function isProbPub(item) { - if (typeof item === "bigint") - return false; - if (item instanceof Point) - return true; - const { secretKey, publicKey: publicKey2, publicKeyUncompressed } = lengths; - if (Fn2.allowedLengths || secretKey === publicKey2) - return void 0; - const l = ensureBytes("key", item).length; - return l === publicKey2 || l === publicKeyUncompressed; - } - function getSharedSecret(secretKeyA, publicKeyB, isCompressed = true) { - if (isProbPub(secretKeyA) === true) - throw new Error("first arg must be private key"); - if (isProbPub(publicKeyB) === false) - throw new Error("second arg must be public key"); - const s = _normFnElement(Fn2, secretKeyA); - const b = Point.fromHex(publicKeyB); - return b.multiply(s).toBytes(isCompressed); - } - const utils = { - isValidSecretKey, - isValidPublicKey: isValidPublicKey2, - randomSecretKey, - // TODO: remove - isValidPrivateKey: isValidSecretKey, - randomPrivateKey: randomSecretKey, - normPrivateKeyToScalar: (key) => _normFnElement(Fn2, key), - precompute(windowSize = 8, point = Point.BASE) { - return point.precompute(windowSize, false); - } - }; - return Object.freeze({ getPublicKey: getPublicKey2, getSharedSecret, keygen, Point, utils, lengths }); -} -function ecdsa(Point, hash, ecdsaOpts = {}) { - ahash(hash); - _validateObject(ecdsaOpts, {}, { - hmac: "function", - lowS: "boolean", - randomBytes: "function", - bits2int: "function", - bits2int_modN: "function" - }); - const randomBytes3 = ecdsaOpts.randomBytes || randomBytes; - const hmac2 = ecdsaOpts.hmac || ((key, ...msgs) => hmac(hash, key, concatBytes(...msgs))); - const { Fp: Fp2, Fn: Fn2 } = Point; - const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn2; - const { keygen, getPublicKey: getPublicKey2, getSharedSecret, utils, lengths } = ecdh(Point, ecdsaOpts); - const defaultSigOpts = { - prehash: false, - lowS: typeof ecdsaOpts.lowS === "boolean" ? ecdsaOpts.lowS : false, - format: void 0, - //'compact' as ECDSASigFormat, - extraEntropy: false - }; - const defaultSigOpts_format = "compact"; - function isBiggerThanHalfOrder(number2) { - const HALF = CURVE_ORDER >> _1n7; - return number2 > HALF; - } - function validateRS(title, num) { - if (!Fn2.isValidNot0(num)) - throw new Error(`invalid signature ${title}: out of range 1..Point.Fn.ORDER`); - return num; - } - function validateSigLength(bytes, format) { - validateSigFormat(format); - const size = lengths.signature; - const sizer = format === "compact" ? size : format === "recovered" ? size + 1 : void 0; - return _abytes2(bytes, sizer, `${format} signature`); - } - class Signature { - constructor(r, s, recovery) { - this.r = validateRS("r", r); - this.s = validateRS("s", s); - if (recovery != null) - this.recovery = recovery; - Object.freeze(this); - } - static fromBytes(bytes, format = defaultSigOpts_format) { - validateSigLength(bytes, format); - let recid; - if (format === "der") { - const { r: r2, s: s2 } = DER.toSig(_abytes2(bytes)); - return new Signature(r2, s2); - } - if (format === "recovered") { - recid = bytes[0]; - format = "compact"; - bytes = bytes.subarray(1); - } - const L = Fn2.BYTES; - const r = bytes.subarray(0, L); - const s = bytes.subarray(L, L * 2); - return new Signature(Fn2.fromBytes(r), Fn2.fromBytes(s), recid); - } - static fromHex(hex, format) { - return this.fromBytes(hexToBytes(hex), format); - } - addRecoveryBit(recovery) { - return new Signature(this.r, this.s, recovery); - } - recoverPublicKey(messageHash) { - const FIELD_ORDER = Fp2.ORDER; - const { r, s, recovery: rec } = this; - if (rec == null || ![0, 1, 2, 3].includes(rec)) - throw new Error("recovery id invalid"); - const hasCofactor = CURVE_ORDER * _2n5 < FIELD_ORDER; - if (hasCofactor && rec > 1) - throw new Error("recovery id is ambiguous for h>1 curve"); - const radj = rec === 2 || rec === 3 ? r + CURVE_ORDER : r; - if (!Fp2.isValid(radj)) - throw new Error("recovery id 2 or 3 invalid"); - const x = Fp2.toBytes(radj); - const R = Point.fromBytes(concatBytes(pprefix((rec & 1) === 0), x)); - const ir = Fn2.inv(radj); - const h = bits2int_modN(ensureBytes("msgHash", messageHash)); - const u1 = Fn2.create(-h * ir); - const u2 = Fn2.create(s * ir); - const Q = Point.BASE.multiplyUnsafe(u1).add(R.multiplyUnsafe(u2)); - if (Q.is0()) - throw new Error("point at infinify"); - Q.assertValidity(); - return Q; - } - // Signatures should be low-s, to prevent malleability. - hasHighS() { - return isBiggerThanHalfOrder(this.s); - } - toBytes(format = defaultSigOpts_format) { - validateSigFormat(format); - if (format === "der") - return hexToBytes(DER.hexFromSig(this)); - const r = Fn2.toBytes(this.r); - const s = Fn2.toBytes(this.s); - if (format === "recovered") { - if (this.recovery == null) - throw new Error("recovery bit must be present"); - return concatBytes(Uint8Array.of(this.recovery), r, s); - } - return concatBytes(r, s); - } - toHex(format) { - return bytesToHex(this.toBytes(format)); - } - // TODO: remove - assertValidity() { - } - static fromCompact(hex) { - return Signature.fromBytes(ensureBytes("sig", hex), "compact"); - } - static fromDER(hex) { - return Signature.fromBytes(ensureBytes("sig", hex), "der"); - } - normalizeS() { - return this.hasHighS() ? new Signature(this.r, Fn2.neg(this.s), this.recovery) : this; - } - toDERRawBytes() { - return this.toBytes("der"); - } - toDERHex() { - return bytesToHex(this.toBytes("der")); - } - toCompactRawBytes() { - return this.toBytes("compact"); - } - toCompactHex() { - return bytesToHex(this.toBytes("compact")); - } - } - const bits2int = ecdsaOpts.bits2int || function bits2int_def(bytes) { - if (bytes.length > 8192) - throw new Error("input is too large"); - const num = bytesToNumberBE(bytes); - const delta = bytes.length * 8 - fnBits; - return delta > 0 ? num >> BigInt(delta) : num; - }; - const bits2int_modN = ecdsaOpts.bits2int_modN || function bits2int_modN_def(bytes) { - return Fn2.create(bits2int(bytes)); - }; - const ORDER_MASK = bitMask(fnBits); - function int2octets(num) { - aInRange("num < 2^" + fnBits, num, _0n7, ORDER_MASK); - return Fn2.toBytes(num); - } - function validateMsgAndHash(message, prehash) { - _abytes2(message, void 0, "message"); - return prehash ? _abytes2(hash(message), void 0, "prehashed message") : message; - } - function prepSig(message, privateKey, opts) { - if (["recovered", "canonical"].some((k) => k in opts)) - throw new Error("sign() legacy options not supported"); - const { lowS, prehash, extraEntropy } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); - const h1int = bits2int_modN(message); - const d = _normFnElement(Fn2, privateKey); - const seedArgs = [int2octets(d), int2octets(h1int)]; - if (extraEntropy != null && extraEntropy !== false) { - const e = extraEntropy === true ? randomBytes3(lengths.secretKey) : extraEntropy; - seedArgs.push(ensureBytes("extraEntropy", e)); - } - const seed = concatBytes(...seedArgs); - const m = h1int; - function k2sig(kBytes) { - const k = bits2int(kBytes); - if (!Fn2.isValidNot0(k)) - return; - const ik = Fn2.inv(k); - const q = Point.BASE.multiply(k).toAffine(); - const r = Fn2.create(q.x); - if (r === _0n7) - return; - const s = Fn2.create(ik * Fn2.create(m + r * d)); - if (s === _0n7) - return; - let recovery = (q.x === r ? 0 : 2) | Number(q.y & _1n7); - let normS = s; - if (lowS && isBiggerThanHalfOrder(s)) { - normS = Fn2.neg(s); - recovery ^= 1; - } - return new Signature(r, normS, recovery); - } - return { seed, k2sig }; - } - function sign2(message, secretKey, opts = {}) { - message = ensureBytes("message", message); - const { seed, k2sig } = prepSig(message, secretKey, opts); - const drbg = createHmacDrbg(hash.outputLen, Fn2.BYTES, hmac2); - const sig = drbg(seed, k2sig); - return sig; - } - function tryParsingSig(sg) { - let sig = void 0; - const isHex = typeof sg === "string" || isBytes(sg); - const isObj = !isHex && sg !== null && typeof sg === "object" && typeof sg.r === "bigint" && typeof sg.s === "bigint"; - if (!isHex && !isObj) - throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance"); - if (isObj) { - sig = new Signature(sg.r, sg.s); - } else if (isHex) { - try { - sig = Signature.fromBytes(ensureBytes("sig", sg), "der"); - } catch (derError) { - if (!(derError instanceof DER.Err)) - throw derError; - } - if (!sig) { - try { - sig = Signature.fromBytes(ensureBytes("sig", sg), "compact"); - } catch (error) { - return false; - } - } - } - if (!sig) - return false; - return sig; - } - function verify2(signature2, message, publicKey2, opts = {}) { - const { lowS, prehash, format } = validateSigOpts(opts, defaultSigOpts); - publicKey2 = ensureBytes("publicKey", publicKey2); - message = validateMsgAndHash(ensureBytes("message", message), prehash); - if ("strict" in opts) - throw new Error("options.strict was renamed to lowS"); - const sig = format === void 0 ? tryParsingSig(signature2) : Signature.fromBytes(ensureBytes("sig", signature2), format); - if (sig === false) - return false; - try { - const P = Point.fromBytes(publicKey2); - if (lowS && sig.hasHighS()) - return false; - const { r, s } = sig; - const h = bits2int_modN(message); - const is2 = Fn2.inv(s); - const u1 = Fn2.create(h * is2); - const u2 = Fn2.create(r * is2); - const R = Point.BASE.multiplyUnsafe(u1).add(P.multiplyUnsafe(u2)); - if (R.is0()) - return false; - const v = Fn2.create(R.x); - return v === r; - } catch (e) { - return false; - } - } - function recoverPublicKey(signature2, message, opts = {}) { - const { prehash } = validateSigOpts(opts, defaultSigOpts); - message = validateMsgAndHash(message, prehash); - return Signature.fromBytes(signature2, "recovered").recoverPublicKey(message).toBytes(); - } - return Object.freeze({ - keygen, - getPublicKey: getPublicKey2, - getSharedSecret, - utils, - lengths, - Point, - sign: sign2, - verify: verify2, - recoverPublicKey, - Signature, - hash - }); -} -function _weierstrass_legacy_opts_to_new(c) { - const CURVE = { - a: c.a, - b: c.b, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy - }; - const Fp2 = c.Fp; - let allowedLengths = c.allowedPrivateKeyLengths ? Array.from(new Set(c.allowedPrivateKeyLengths.map((l) => Math.ceil(l / 2)))) : void 0; - const Fn2 = Field(CURVE.n, { - BITS: c.nBitLength, - allowedLengths, - modFromBytes: c.wrapPrivateKey - }); - const curveOpts = { - Fp: Fp2, - Fn: Fn2, - allowInfinityPoint: c.allowInfinityPoint, - endo: c.endo, - isTorsionFree: c.isTorsionFree, - clearCofactor: c.clearCofactor, - fromBytes: c.fromBytes, - toBytes: c.toBytes - }; - return { CURVE, curveOpts }; -} -function _ecdsa_legacy_opts_to_new(c) { - const { CURVE, curveOpts } = _weierstrass_legacy_opts_to_new(c); - const ecdsaOpts = { - hmac: c.hmac, - randomBytes: c.randomBytes, - lowS: c.lowS, - bits2int: c.bits2int, - bits2int_modN: c.bits2int_modN - }; - return { CURVE, curveOpts, hash: c.hash, ecdsaOpts }; -} -function _ecdsa_new_output_to_legacy(c, _ecdsa) { - const Point = _ecdsa.Point; - return Object.assign({}, _ecdsa, { - ProjectivePoint: Point, - CURVE: Object.assign({}, c, nLength(Point.Fn.ORDER, Point.Fn.BITS)) - }); -} -function weierstrass(c) { - const { CURVE, curveOpts, hash, ecdsaOpts } = _ecdsa_legacy_opts_to_new(c); - const Point = weierstrassN(CURVE, curveOpts); - const signs = ecdsa(Point, hash, ecdsaOpts); - return _ecdsa_new_output_to_legacy(c, signs); -} -var divNearest, DERErr, DER, _0n7, _1n7, _2n5, _3n3, _4n2; -var init_weierstrass = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/abstract/weierstrass.js"() { - init_hmac(); - init_utils(); - init_utils2(); - init_curve(); - init_modular(); - divNearest = (num, den) => (num + (num >= 0 ? den : -den) / _2n5) / den; - DERErr = class extends Error { - constructor(m = "") { - super(m); - } - }; - DER = { - // asn.1 DER encoding utils - Err: DERErr, - // Basic building block is TLV (Tag-Length-Value) - _tlv: { - encode: (tag, data) => { - const { Err: E } = DER; - if (tag < 0 || tag > 256) - throw new E("tlv.encode: wrong tag"); - if (data.length & 1) - throw new E("tlv.encode: unpadded data"); - const dataLen = data.length / 2; - const len = numberToHexUnpadded(dataLen); - if (len.length / 2 & 128) - throw new E("tlv.encode: long form length too big"); - const lenLen = dataLen > 127 ? numberToHexUnpadded(len.length / 2 | 128) : ""; - const t = numberToHexUnpadded(tag); - return t + lenLen + len + data; - }, - // v - value, l - left bytes (unparsed) - decode(tag, data) { - const { Err: E } = DER; - let pos = 0; - if (tag < 0 || tag > 256) - throw new E("tlv.encode: wrong tag"); - if (data.length < 2 || data[pos++] !== tag) - throw new E("tlv.decode: wrong tlv"); - const first = data[pos++]; - const isLong = !!(first & 128); - let length = 0; - if (!isLong) - length = first; - else { - const lenLen = first & 127; - if (!lenLen) - throw new E("tlv.decode(long): indefinite length not supported"); - if (lenLen > 4) - throw new E("tlv.decode(long): byte length is too big"); - const lengthBytes = data.subarray(pos, pos + lenLen); - if (lengthBytes.length !== lenLen) - throw new E("tlv.decode: length bytes not complete"); - if (lengthBytes[0] === 0) - throw new E("tlv.decode(long): zero leftmost byte"); - for (const b of lengthBytes) - length = length << 8 | b; - pos += lenLen; - if (length < 128) - throw new E("tlv.decode(long): not minimal encoding"); - } - const v = data.subarray(pos, pos + length); - if (v.length !== length) - throw new E("tlv.decode: wrong value length"); - return { v, l: data.subarray(pos + length) }; - } - }, - // https://crypto.stackexchange.com/a/57734 Leftmost bit of first byte is 'negative' flag, - // since we always use positive integers here. It must always be empty: - // - add zero byte if exists - // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding) - _int: { - encode(num) { - const { Err: E } = DER; - if (num < _0n7) - throw new E("integer: negative integers are not allowed"); - let hex = numberToHexUnpadded(num); - if (Number.parseInt(hex[0], 16) & 8) - hex = "00" + hex; - if (hex.length & 1) - throw new E("unexpected DER parsing assertion: unpadded hex"); - return hex; - }, - decode(data) { - const { Err: E } = DER; - if (data[0] & 128) - throw new E("invalid signature integer: negative"); - if (data[0] === 0 && !(data[1] & 128)) - throw new E("invalid signature integer: unnecessary leading zero"); - return bytesToNumberBE(data); - } - }, - toSig(hex) { - const { Err: E, _int: int, _tlv: tlv } = DER; - const data = ensureBytes("signature", hex); - const { v: seqBytes, l: seqLeftBytes } = tlv.decode(48, data); - if (seqLeftBytes.length) - throw new E("invalid signature: left bytes after parsing"); - const { v: rBytes, l: rLeftBytes } = tlv.decode(2, seqBytes); - const { v: sBytes, l: sLeftBytes } = tlv.decode(2, rLeftBytes); - if (sLeftBytes.length) - throw new E("invalid signature: left bytes after parsing"); - return { r: int.decode(rBytes), s: int.decode(sBytes) }; - }, - hexFromSig(sig) { - const { _tlv: tlv, _int: int } = DER; - const rs = tlv.encode(2, int.encode(sig.r)); - const ss = tlv.encode(2, int.encode(sig.s)); - const seq2 = rs + ss; - return tlv.encode(48, seq2); - } - }; - _0n7 = BigInt(0); - _1n7 = BigInt(1); - _2n5 = BigInt(2); - _3n3 = BigInt(3); - _4n2 = BigInt(4); - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/_shortw_utils.js -function createCurve(curveDef, defHash) { - const create2 = (hash) => weierstrass({ ...curveDef, hash }); - return { ...create2(defHash), create: create2 }; -} -var init_shortw_utils = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/_shortw_utils.js"() { - init_weierstrass(); - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/secp256k1.js -function sqrtMod(y) { - const P = secp256k1_CURVE.p; - const _3n4 = BigInt(3), _6n = BigInt(6), _11n = BigInt(11), _22n = BigInt(22); - const _23n = BigInt(23), _44n = BigInt(44), _88n = BigInt(88); - const b2 = y * y * y % P; - const b3 = b2 * b2 * y % P; - const b6 = pow2(b3, _3n4, P) * b3 % P; - const b9 = pow2(b6, _3n4, P) * b3 % P; - const b11 = pow2(b9, _2n6, P) * b2 % P; - const b22 = pow2(b11, _11n, P) * b11 % P; - const b44 = pow2(b22, _22n, P) * b22 % P; - const b88 = pow2(b44, _44n, P) * b44 % P; - const b176 = pow2(b88, _88n, P) * b88 % P; - const b220 = pow2(b176, _44n, P) * b44 % P; - const b223 = pow2(b220, _3n4, P) * b3 % P; - const t1 = pow2(b223, _23n, P) * b22 % P; - const t2 = pow2(t1, _6n, P) * b2 % P; - const root = pow2(t2, _2n6, P); - if (!Fpk1.eql(Fpk1.sqr(root), y)) - throw new Error("Cannot find square root"); - return root; -} -var secp256k1_CURVE, secp256k1_ENDO, _2n6, Fpk1, secp256k1; -var init_secp256k1 = __esm({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/esm/secp256k1.js"() { - init_sha2(); - init_shortw_utils(); - init_modular(); - secp256k1_CURVE = { - p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), - n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), - h: BigInt(1), - a: BigInt(0), - b: BigInt(7), - Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"), - Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8") - }; - secp256k1_ENDO = { - beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"), - basises: [ - [BigInt("0x3086d221a7d46bcde86c90e49284eb15"), -BigInt("0xe4437ed6010e88286f547fa90abfe4c3")], - [BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"), BigInt("0x3086d221a7d46bcde86c90e49284eb15")] - ] - }; - _2n6 = /* @__PURE__ */ BigInt(2); - Fpk1 = Field(secp256k1_CURVE.p, { sqrt: sqrtMod }); - secp256k1 = createCurve({ ...secp256k1_CURVE, Fp: Fpk1, lowS: true, endo: secp256k1_ENDO }, sha256); - } -}); - -// ../../node_modules/.pnpm/@solana+web3.js@1.98.4_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/@solana/web3.js/lib/index.esm.js -var index_esm_exports = {}; -__export(index_esm_exports, { - Account: () => Account, - AddressLookupTableAccount: () => AddressLookupTableAccount, - AddressLookupTableInstruction: () => AddressLookupTableInstruction, - AddressLookupTableProgram: () => AddressLookupTableProgram, - Authorized: () => Authorized, - BLOCKHASH_CACHE_TIMEOUT_MS: () => BLOCKHASH_CACHE_TIMEOUT_MS, - BPF_LOADER_DEPRECATED_PROGRAM_ID: () => BPF_LOADER_DEPRECATED_PROGRAM_ID, - BPF_LOADER_PROGRAM_ID: () => BPF_LOADER_PROGRAM_ID, - BpfLoader: () => BpfLoader, - COMPUTE_BUDGET_INSTRUCTION_LAYOUTS: () => COMPUTE_BUDGET_INSTRUCTION_LAYOUTS, - ComputeBudgetInstruction: () => ComputeBudgetInstruction, - ComputeBudgetProgram: () => ComputeBudgetProgram, - Connection: () => Connection, - Ed25519Program: () => Ed25519Program, - Enum: () => Enum, - EpochSchedule: () => EpochSchedule, - FeeCalculatorLayout: () => FeeCalculatorLayout, - Keypair: () => Keypair, - LAMPORTS_PER_SOL: () => LAMPORTS_PER_SOL, - LOOKUP_TABLE_INSTRUCTION_LAYOUTS: () => LOOKUP_TABLE_INSTRUCTION_LAYOUTS, - Loader: () => Loader, - Lockup: () => Lockup, - MAX_SEED_LENGTH: () => MAX_SEED_LENGTH, - Message: () => Message, - MessageAccountKeys: () => MessageAccountKeys, - MessageV0: () => MessageV0, - NONCE_ACCOUNT_LENGTH: () => NONCE_ACCOUNT_LENGTH, - NonceAccount: () => NonceAccount, - PACKET_DATA_SIZE: () => PACKET_DATA_SIZE, - PUBLIC_KEY_LENGTH: () => PUBLIC_KEY_LENGTH, - PublicKey: () => PublicKey, - SIGNATURE_LENGTH_IN_BYTES: () => SIGNATURE_LENGTH_IN_BYTES, - SOLANA_SCHEMA: () => SOLANA_SCHEMA, - STAKE_CONFIG_ID: () => STAKE_CONFIG_ID, - STAKE_INSTRUCTION_LAYOUTS: () => STAKE_INSTRUCTION_LAYOUTS, - SYSTEM_INSTRUCTION_LAYOUTS: () => SYSTEM_INSTRUCTION_LAYOUTS, - SYSVAR_CLOCK_PUBKEY: () => SYSVAR_CLOCK_PUBKEY, - SYSVAR_EPOCH_SCHEDULE_PUBKEY: () => SYSVAR_EPOCH_SCHEDULE_PUBKEY, - SYSVAR_INSTRUCTIONS_PUBKEY: () => SYSVAR_INSTRUCTIONS_PUBKEY, - SYSVAR_RECENT_BLOCKHASHES_PUBKEY: () => SYSVAR_RECENT_BLOCKHASHES_PUBKEY, - SYSVAR_RENT_PUBKEY: () => SYSVAR_RENT_PUBKEY, - SYSVAR_REWARDS_PUBKEY: () => SYSVAR_REWARDS_PUBKEY, - SYSVAR_SLOT_HASHES_PUBKEY: () => SYSVAR_SLOT_HASHES_PUBKEY, - SYSVAR_SLOT_HISTORY_PUBKEY: () => SYSVAR_SLOT_HISTORY_PUBKEY, - SYSVAR_STAKE_HISTORY_PUBKEY: () => SYSVAR_STAKE_HISTORY_PUBKEY, - Secp256k1Program: () => Secp256k1Program, - SendTransactionError: () => SendTransactionError, - SolanaJSONRPCError: () => SolanaJSONRPCError, - SolanaJSONRPCErrorCode: () => SolanaJSONRPCErrorCode, - StakeAuthorizationLayout: () => StakeAuthorizationLayout, - StakeInstruction: () => StakeInstruction, - StakeProgram: () => StakeProgram, - Struct: () => Struct2, - SystemInstruction: () => SystemInstruction, - SystemProgram: () => SystemProgram, - Transaction: () => Transaction, - TransactionExpiredBlockheightExceededError: () => TransactionExpiredBlockheightExceededError, - TransactionExpiredNonceInvalidError: () => TransactionExpiredNonceInvalidError, - TransactionExpiredTimeoutError: () => TransactionExpiredTimeoutError, - TransactionInstruction: () => TransactionInstruction, - TransactionMessage: () => TransactionMessage, - TransactionStatus: () => TransactionStatus, - VALIDATOR_INFO_KEY: () => VALIDATOR_INFO_KEY, - VERSION_PREFIX_MASK: () => VERSION_PREFIX_MASK, - VOTE_PROGRAM_ID: () => VOTE_PROGRAM_ID, - ValidatorInfo: () => ValidatorInfo, - VersionedMessage: () => VersionedMessage, - VersionedTransaction: () => VersionedTransaction, - VoteAccount: () => VoteAccount, - VoteAuthorizationLayout: () => VoteAuthorizationLayout, - VoteInit: () => VoteInit, - VoteInstruction: () => VoteInstruction, - VoteProgram: () => VoteProgram, - clusterApiUrl: () => clusterApiUrl, - sendAndConfirmRawTransaction: () => sendAndConfirmRawTransaction, - sendAndConfirmTransaction: () => sendAndConfirmTransaction -}); -function isOnCurve(publicKey2) { - try { - ed25519.ExtendedPoint.fromHex(publicKey2); - return true; - } catch { - return false; - } -} -function isPublicKeyData(value) { - return value._bn !== void 0; -} -function getAlloc(type2, fields) { - const getItemAlloc = (item) => { - if (item.span >= 0) { - return item.span; - } else if (typeof item.alloc === "function") { - return item.alloc(fields[item.property]); - } else if ("count" in item && "elementLayout" in item) { - const field = fields[item.property]; - if (Array.isArray(field)) { - return field.length * getItemAlloc(item.elementLayout); - } - } else if ("fields" in item) { - return getAlloc({ - layout: item - }, fields[item.property]); - } - return 0; - }; - let alloc = 0; - type2.layout.fields.forEach((item) => { - alloc += getItemAlloc(item); - }); - return alloc; -} -function decodeLength(bytes) { - let len = 0; - let size = 0; - for (; ; ) { - let elem = bytes.shift(); - len |= (elem & 127) << size * 7; - size += 1; - if ((elem & 128) === 0) { - break; - } - } - return len; -} -function encodeLength(bytes, len) { - let rem_len = len; - for (; ; ) { - let elem = rem_len & 127; - rem_len >>= 7; - if (rem_len == 0) { - bytes.push(elem); - break; - } else { - elem |= 128; - bytes.push(elem); - } - } -} -function assert2(condition, message) { - if (!condition) { - throw new Error(message || "Assertion failed"); - } -} -function guardedShift(byteArray) { - if (byteArray.length === 0) { - throw new Error(END_OF_BUFFER_ERROR_MESSAGE); - } - return byteArray.shift(); -} -function guardedSplice(byteArray, ...args) { - const [start] = args; - if (args.length === 2 ? start + (args[1] ?? 0) > byteArray.length : start >= byteArray.length) { - throw new Error(END_OF_BUFFER_ERROR_MESSAGE); - } - return byteArray.splice(...args); -} -async function sendAndConfirmTransaction(connection, transaction, signers, options) { - const sendOptions = options && { - skipPreflight: options.skipPreflight, - preflightCommitment: options.preflightCommitment || options.commitment, - maxRetries: options.maxRetries, - minContextSlot: options.minContextSlot - }; - const signature2 = await connection.sendTransaction(transaction, signers, sendOptions); - let status; - if (transaction.recentBlockhash != null && transaction.lastValidBlockHeight != null) { - status = (await connection.confirmTransaction({ - abortSignal: options?.abortSignal, - signature: signature2, - blockhash: transaction.recentBlockhash, - lastValidBlockHeight: transaction.lastValidBlockHeight - }, options && options.commitment)).value; - } else if (transaction.minNonceContextSlot != null && transaction.nonceInfo != null) { - const { - nonceInstruction - } = transaction.nonceInfo; - const nonceAccountPubkey = nonceInstruction.keys[0].pubkey; - status = (await connection.confirmTransaction({ - abortSignal: options?.abortSignal, - minContextSlot: transaction.minNonceContextSlot, - nonceAccountPubkey, - nonceValue: transaction.nonceInfo.nonce, - signature: signature2 - }, options && options.commitment)).value; - } else { - if (options?.abortSignal != null) { - console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."); - } - status = (await connection.confirmTransaction(signature2, options && options.commitment)).value; - } - if (status.err) { - if (signature2 != null) { - throw new SendTransactionError({ - action: "send", - signature: signature2, - transactionMessage: `Status: (${JSON.stringify(status)})` - }); - } - throw new Error(`Transaction ${signature2} failed (${JSON.stringify(status)})`); - } - return signature2; -} -function sleep(ms2) { - return new Promise((resolve) => setTimeout(resolve, ms2)); -} -function encodeData(type2, fields) { - const allocLength = type2.layout.span >= 0 ? type2.layout.span : getAlloc(type2, fields); - const data = import_buffer.Buffer.alloc(allocLength); - const layoutFields = Object.assign({ - instruction: type2.index - }, fields); - type2.layout.encode(layoutFields, data); - return data; -} -function decodeData$1(type2, buffer) { - let data; - try { - data = type2.layout.decode(buffer); - } catch (err) { - throw new Error("invalid instruction; " + err); - } - if (data.instruction !== type2.index) { - throw new Error(`invalid instruction; instruction index mismatch ${data.instruction} != ${type2.index}`); - } - return data; -} -function u64(property) { - const layout = (0, import_buffer_layout.blob)(8, property); - const decode = layout.decode.bind(layout); - const encode = layout.encode.bind(layout); - const bigIntLayout = layout; - const codec = getU64Codec(); - bigIntLayout.decode = (buffer, offset2) => { - const src = decode(buffer, offset2); - return codec.decode(src); - }; - bigIntLayout.encode = (bigInt, buffer, offset2) => { - const src = codec.encode(bigInt); - return encode(src, buffer, offset2); - }; - return bigIntLayout; -} -function getDefaultExportFromCjs(x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; -} -function requireMs() { - if (hasRequiredMs) - return ms; - hasRequiredMs = 1; - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - ms = function(val, options) { - options = options || {}; - var type2 = typeof val; - if (type2 === "string" && val.length > 0) { - return parse2(val); - } else if (type2 === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse2(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms2) { - var msAbs = Math.abs(ms2); - if (msAbs >= d) { - return Math.round(ms2 / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms2 / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms2 / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms2 / s) + "s"; - } - return ms2 + "ms"; - } - function fmtLong(ms2) { - var msAbs = Math.abs(ms2); - if (msAbs >= d) { - return plural(ms2, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms2, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms2, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms2, msAbs, s, "second"); - } - return ms2 + " ms"; - } - function plural(ms2, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms2 / n) + " " + name + (isPlural ? "s" : ""); - } - return ms; -} -function requireHumanizeMs() { - if (hasRequiredHumanizeMs) - return humanizeMs; - hasRequiredHumanizeMs = 1; - var util = import_util.default; - var ms2 = /* @__PURE__ */ requireMs(); - humanizeMs = function(t) { - if (typeof t === "number") - return t; - var r = ms2(t); - if (r === void 0) { - var err = new Error(util.format("humanize-ms(%j) result undefined", t)); - console.warn(err.stack); - } - return r; - }; - return humanizeMs; -} -function requireConstants() { - if (hasRequiredConstants) - return constants; - hasRequiredConstants = 1; - constants = { - // agent - CURRENT_ID: Symbol("agentkeepalive#currentId"), - CREATE_ID: Symbol("agentkeepalive#createId"), - INIT_SOCKET: Symbol("agentkeepalive#initSocket"), - CREATE_HTTPS_CONNECTION: Symbol("agentkeepalive#createHttpsConnection"), - // socket - SOCKET_CREATED_TIME: Symbol("agentkeepalive#socketCreatedTime"), - SOCKET_NAME: Symbol("agentkeepalive#socketName"), - SOCKET_REQUEST_COUNT: Symbol("agentkeepalive#socketRequestCount"), - SOCKET_REQUEST_FINISHED_COUNT: Symbol("agentkeepalive#socketRequestFinishedCount") - }; - return constants; -} -function requireAgent() { - if (hasRequiredAgent) - return agent; - hasRequiredAgent = 1; - const OriginalAgent = import_http2.default.Agent; - const ms2 = /* @__PURE__ */ requireHumanizeMs(); - const debug = import_util.default.debuglog("agentkeepalive"); - const { - INIT_SOCKET, - CURRENT_ID, - CREATE_ID, - SOCKET_CREATED_TIME, - SOCKET_NAME, - SOCKET_REQUEST_COUNT, - SOCKET_REQUEST_FINISHED_COUNT - } = /* @__PURE__ */ requireConstants(); - let defaultTimeoutListenerCount = 1; - const majorVersion = parseInt(process.version.split(".", 1)[0].substring(1)); - if (majorVersion >= 11 && majorVersion <= 12) { - defaultTimeoutListenerCount = 2; - } else if (majorVersion >= 13) { - defaultTimeoutListenerCount = 3; - } - function deprecate(message) { - console.log("[agentkeepalive:deprecated] %s", message); - } - class Agent2 extends OriginalAgent { - constructor(options) { - options = options || {}; - options.keepAlive = options.keepAlive !== false; - if (options.freeSocketTimeout === void 0) { - options.freeSocketTimeout = 4e3; - } - if (options.keepAliveTimeout) { - deprecate("options.keepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"); - options.freeSocketTimeout = options.keepAliveTimeout; - delete options.keepAliveTimeout; - } - if (options.freeSocketKeepAliveTimeout) { - deprecate("options.freeSocketKeepAliveTimeout is deprecated, please use options.freeSocketTimeout instead"); - options.freeSocketTimeout = options.freeSocketKeepAliveTimeout; - delete options.freeSocketKeepAliveTimeout; - } - if (options.timeout === void 0) { - options.timeout = Math.max(options.freeSocketTimeout * 2, 8e3); - } - options.timeout = ms2(options.timeout); - options.freeSocketTimeout = ms2(options.freeSocketTimeout); - options.socketActiveTTL = options.socketActiveTTL ? ms2(options.socketActiveTTL) : 0; - super(options); - this[CURRENT_ID] = 0; - this.createSocketCount = 0; - this.createSocketCountLastCheck = 0; - this.createSocketErrorCount = 0; - this.createSocketErrorCountLastCheck = 0; - this.closeSocketCount = 0; - this.closeSocketCountLastCheck = 0; - this.errorSocketCount = 0; - this.errorSocketCountLastCheck = 0; - this.requestCount = 0; - this.requestCountLastCheck = 0; - this.timeoutSocketCount = 0; - this.timeoutSocketCountLastCheck = 0; - this.on("free", (socket) => { - const timeout = this.calcSocketTimeout(socket); - if (timeout > 0 && socket.timeout !== timeout) { - socket.setTimeout(timeout); - } - }); - } - get freeSocketKeepAliveTimeout() { - deprecate("agent.freeSocketKeepAliveTimeout is deprecated, please use agent.options.freeSocketTimeout instead"); - return this.options.freeSocketTimeout; - } - get timeout() { - deprecate("agent.timeout is deprecated, please use agent.options.timeout instead"); - return this.options.timeout; - } - get socketActiveTTL() { - deprecate("agent.socketActiveTTL is deprecated, please use agent.options.socketActiveTTL instead"); - return this.options.socketActiveTTL; - } - calcSocketTimeout(socket) { - let freeSocketTimeout = this.options.freeSocketTimeout; - const socketActiveTTL = this.options.socketActiveTTL; - if (socketActiveTTL) { - const aliveTime = Date.now() - socket[SOCKET_CREATED_TIME]; - const diff = socketActiveTTL - aliveTime; - if (diff <= 0) { - return diff; - } - if (freeSocketTimeout && diff < freeSocketTimeout) { - freeSocketTimeout = diff; - } - } - if (freeSocketTimeout) { - const customFreeSocketTimeout = socket.freeSocketTimeout || socket.freeSocketKeepAliveTimeout; - return customFreeSocketTimeout || freeSocketTimeout; - } - } - keepSocketAlive(socket) { - const result = super.keepSocketAlive(socket); - if (!result) - return result; - const customTimeout = this.calcSocketTimeout(socket); - if (typeof customTimeout === "undefined") { - return true; - } - if (customTimeout <= 0) { - debug( - "%s(requests: %s, finished: %s) free but need to destroy by TTL, request count %s, diff is %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - customTimeout - ); - return false; - } - if (socket.timeout !== customTimeout) { - socket.setTimeout(customTimeout); - } - return true; - } - // only call on addRequest - reuseSocket(...args) { - super.reuseSocket(...args); - const socket = args[0]; - const req = args[1]; - req.reusedSocket = true; - const agentTimeout = this.options.timeout; - if (getSocketTimeout(socket) !== agentTimeout) { - socket.setTimeout(agentTimeout); - debug("%s reset timeout to %sms", socket[SOCKET_NAME], agentTimeout); - } - socket[SOCKET_REQUEST_COUNT]++; - debug( - "%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - getSocketTimeout(socket) - ); - } - [CREATE_ID]() { - const id = this[CURRENT_ID]++; - if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) - this[CURRENT_ID] = 0; - return id; - } - [INIT_SOCKET](socket, options) { - if (options.timeout) { - const timeout = getSocketTimeout(socket); - if (!timeout) { - socket.setTimeout(options.timeout); - } - } - if (this.options.keepAlive) { - socket.setNoDelay(true); - } - this.createSocketCount++; - if (this.options.socketActiveTTL) { - socket[SOCKET_CREATED_TIME] = Date.now(); - } - socket[SOCKET_NAME] = `sock[${this[CREATE_ID]()}#${options._agentKey}]`.split("-----BEGIN", 1)[0]; - socket[SOCKET_REQUEST_COUNT] = 1; - socket[SOCKET_REQUEST_FINISHED_COUNT] = 0; - installListeners(this, socket, options); - } - createConnection(options, oncreate) { - let called = false; - const onNewCreate = (err, socket) => { - if (called) - return; - called = true; - if (err) { - this.createSocketErrorCount++; - return oncreate(err); - } - this[INIT_SOCKET](socket, options); - oncreate(err, socket); - }; - const newSocket = super.createConnection(options, onNewCreate); - if (newSocket) - onNewCreate(null, newSocket); - return newSocket; - } - get statusChanged() { - const changed = this.createSocketCount !== this.createSocketCountLastCheck || this.createSocketErrorCount !== this.createSocketErrorCountLastCheck || this.closeSocketCount !== this.closeSocketCountLastCheck || this.errorSocketCount !== this.errorSocketCountLastCheck || this.timeoutSocketCount !== this.timeoutSocketCountLastCheck || this.requestCount !== this.requestCountLastCheck; - if (changed) { - this.createSocketCountLastCheck = this.createSocketCount; - this.createSocketErrorCountLastCheck = this.createSocketErrorCount; - this.closeSocketCountLastCheck = this.closeSocketCount; - this.errorSocketCountLastCheck = this.errorSocketCount; - this.timeoutSocketCountLastCheck = this.timeoutSocketCount; - this.requestCountLastCheck = this.requestCount; - } - return changed; - } - getCurrentStatus() { - return { - createSocketCount: this.createSocketCount, - createSocketErrorCount: this.createSocketErrorCount, - closeSocketCount: this.closeSocketCount, - errorSocketCount: this.errorSocketCount, - timeoutSocketCount: this.timeoutSocketCount, - requestCount: this.requestCount, - freeSockets: inspect(this.freeSockets), - sockets: inspect(this.sockets), - requests: inspect(this.requests) - }; - } - } - function getSocketTimeout(socket) { - return socket.timeout || socket._idleTimeout; - } - function installListeners(agent2, socket, options) { - debug("%s create, timeout %sms", socket[SOCKET_NAME], getSocketTimeout(socket)); - function onFree() { - if (!socket._httpMessage && socket[SOCKET_REQUEST_COUNT] === 1) - return; - socket[SOCKET_REQUEST_FINISHED_COUNT]++; - agent2.requestCount++; - debug( - "%s(requests: %s, finished: %s) free", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT] - ); - const name = agent2.getName(options); - if (socket.writable && agent2.requests[name] && agent2.requests[name].length) { - socket[SOCKET_REQUEST_COUNT]++; - debug( - "%s(requests: %s, finished: %s) will be reuse on agent free event", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT] - ); - } - } - socket.on("free", onFree); - function onClose(isError) { - debug( - "%s(requests: %s, finished: %s) close, isError: %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - isError - ); - agent2.closeSocketCount++; - } - socket.on("close", onClose); - function onTimeout() { - const listenerCount = socket.listeners("timeout").length; - const timeout = getSocketTimeout(socket); - const req = socket._httpMessage; - const reqTimeoutListenerCount = req && req.listeners("timeout").length || 0; - debug( - "%s(requests: %s, finished: %s) timeout after %sms, listeners %s, defaultTimeoutListenerCount %s, hasHttpRequest %s, HttpRequest timeoutListenerCount %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - timeout, - listenerCount, - defaultTimeoutListenerCount, - !!req, - reqTimeoutListenerCount - ); - if (debug.enabled) { - debug("timeout listeners: %s", socket.listeners("timeout").map((f) => f.name).join(", ")); - } - agent2.timeoutSocketCount++; - const name = agent2.getName(options); - if (agent2.freeSockets[name] && agent2.freeSockets[name].indexOf(socket) !== -1) { - socket.destroy(); - agent2.removeSocket(socket, options); - debug("%s is free, destroy quietly", socket[SOCKET_NAME]); - } else { - if (reqTimeoutListenerCount === 0) { - const error = new Error("Socket timeout"); - error.code = "ERR_SOCKET_TIMEOUT"; - error.timeout = timeout; - socket.destroy(error); - agent2.removeSocket(socket, options); - debug("%s destroy with timeout error", socket[SOCKET_NAME]); - } - } - } - socket.on("timeout", onTimeout); - function onError(err) { - const listenerCount = socket.listeners("error").length; - debug( - "%s(requests: %s, finished: %s) error: %s, listenerCount: %s", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT], - err, - listenerCount - ); - agent2.errorSocketCount++; - if (listenerCount === 1) { - debug("%s emit uncaught error event", socket[SOCKET_NAME]); - socket.removeListener("error", onError); - socket.emit("error", err); - } - } - socket.on("error", onError); - function onRemove() { - debug( - "%s(requests: %s, finished: %s) agentRemove", - socket[SOCKET_NAME], - socket[SOCKET_REQUEST_COUNT], - socket[SOCKET_REQUEST_FINISHED_COUNT] - ); - socket.removeListener("close", onClose); - socket.removeListener("error", onError); - socket.removeListener("free", onFree); - socket.removeListener("timeout", onTimeout); - socket.removeListener("agentRemove", onRemove); - } - socket.on("agentRemove", onRemove); - } - agent = Agent2; - function inspect(obj) { - const res = {}; - for (const key in obj) { - res[key] = obj[key].length; - } - return res; - } - return agent; -} -function requireHttps_agent() { - if (hasRequiredHttps_agent) - return https_agent; - hasRequiredHttps_agent = 1; - const OriginalHttpsAgent = import_https2.default.Agent; - const HttpAgent = /* @__PURE__ */ requireAgent(); - const { - INIT_SOCKET, - CREATE_HTTPS_CONNECTION - } = /* @__PURE__ */ requireConstants(); - class HttpsAgent extends HttpAgent { - constructor(options) { - super(options); - this.defaultPort = 443; - this.protocol = "https:"; - this.maxCachedSessions = this.options.maxCachedSessions; - if (this.maxCachedSessions === void 0) { - this.maxCachedSessions = 100; - } - this._sessionCache = { - map: {}, - list: [] - }; - } - createConnection(options, oncreate) { - const socket = this[CREATE_HTTPS_CONNECTION](options, oncreate); - this[INIT_SOCKET](socket, options); - return socket; - } - } - HttpsAgent.prototype[CREATE_HTTPS_CONNECTION] = OriginalHttpsAgent.prototype.createConnection; - [ - "getName", - "_getSession", - "_cacheSession", - // https://github.com/nodejs/node/pull/4982 - "_evictSession" - ].forEach(function(method) { - if (typeof OriginalHttpsAgent.prototype[method] === "function") { - HttpsAgent.prototype[method] = OriginalHttpsAgent.prototype[method]; - } - }); - https_agent = HttpsAgent; - return https_agent; -} -function requireAgentkeepalive() { - if (hasRequiredAgentkeepalive) - return agentkeepalive.exports; - hasRequiredAgentkeepalive = 1; - agentkeepalive.exports = /* @__PURE__ */ requireAgent(); - agentkeepalive.exports.HttpsAgent = /* @__PURE__ */ requireHttps_agent(); - agentkeepalive.exports.constants = /* @__PURE__ */ requireConstants(); - return agentkeepalive.exports; -} -function requireFastStableStringify() { - if (hasRequiredFastStableStringify) - return fastStableStringify$1; - hasRequiredFastStableStringify = 1; - var objToString = Object.prototype.toString; - var objKeys = Object.keys || function(obj) { - var keys = []; - for (var name in obj) { - keys.push(name); - } - return keys; - }; - function stringify2(val, isArrayProp) { - var i, max, str, keys, key, propVal, toStr; - if (val === true) { - return "true"; - } - if (val === false) { - return "false"; - } - switch (typeof val) { - case "object": - if (val === null) { - return null; - } else if (val.toJSON && typeof val.toJSON === "function") { - return stringify2(val.toJSON(), isArrayProp); - } else { - toStr = objToString.call(val); - if (toStr === "[object Array]") { - str = "["; - max = val.length - 1; - for (i = 0; i < max; i++) { - str += stringify2(val[i], true) + ","; - } - if (max > -1) { - str += stringify2(val[i], true); - } - return str + "]"; - } else if (toStr === "[object Object]") { - keys = objKeys(val).sort(); - max = keys.length; - str = ""; - i = 0; - while (i < max) { - key = keys[i]; - propVal = stringify2(val[key], false); - if (propVal !== void 0) { - if (str) { - str += ","; - } - str += JSON.stringify(key) + ":" + propVal; - } - i++; - } - return "{" + str + "}"; - } else { - return JSON.stringify(val); - } - } - case "function": - case "undefined": - return isArrayProp ? null : void 0; - case "string": - return JSON.stringify(val); - default: - return isFinite(val) ? val : null; - } - } - fastStableStringify$1 = function(val) { - var returnVal = stringify2(val, false); - if (returnVal !== void 0) { - return "" + returnVal; - } - }; - return fastStableStringify$1; -} -function trailingZeros(n) { - let trailingZeros2 = 0; - while (n > 1) { - n /= 2; - trailingZeros2++; - } - return trailingZeros2; -} -function nextPowerOfTwo(n) { - if (n === 0) - return 1; - n--; - n |= n >> 1; - n |= n >> 2; - n |= n >> 4; - n |= n >> 8; - n |= n >> 16; - n |= n >> 32; - return n + 1; -} -function decodeData(type2, data) { - let decoded; - try { - decoded = type2.layout.decode(data); - } catch (err) { - throw new Error("invalid instruction; " + err); - } - if (decoded.typeIndex !== type2.index) { - throw new Error(`invalid account data; account type mismatch ${decoded.typeIndex} != ${type2.index}`); - } - return decoded; -} -function makeWebsocketUrl(endpoint2) { - const matches = endpoint2.match(URL_RE); - if (matches == null) { - throw TypeError(`Failed to validate endpoint URL \`${endpoint2}\``); - } - const [ - _, - // eslint-disable-line @typescript-eslint/no-unused-vars - hostish, - portWithColon, - rest - ] = matches; - const protocol = endpoint2.startsWith("https:") ? "wss:" : "ws:"; - const startPort = portWithColon == null ? null : parseInt(portWithColon.slice(1), 10); - const websocketPort = ( - // Only shift the port by +1 as a convention for ws(s) only if given endpoint - // is explicitly specifying the endpoint port (HTTP-based RPC), assuming - // we're directly trying to connect to agave-validator's ws listening port. - // When the endpoint omits the port, we're connecting to the protocol - // default ports: http(80) or https(443) and it's assumed we're behind a reverse - // proxy which manages WebSocket upgrade and backend port redirection. - startPort == null ? "" : `:${startPort + 1}` - ); - return `${protocol}//${hostish}${websocketPort}${rest}`; -} -function assertEndpointUrl(putativeUrl) { - if (/^https?:/.test(putativeUrl) === false) { - throw new TypeError("Endpoint URL must start with `http:` or `https:`."); - } - return putativeUrl; -} -function extractCommitmentFromConfig(commitmentOrConfig) { - let commitment; - let config; - if (typeof commitmentOrConfig === "string") { - commitment = commitmentOrConfig; - } else if (commitmentOrConfig) { - const { - commitment: specifiedCommitment, - ...specifiedConfig - } = commitmentOrConfig; - commitment = specifiedCommitment; - config = specifiedConfig; - } - return { - commitment, - config - }; -} -function applyDefaultMemcmpEncodingToFilters(filters) { - return filters.map((filter) => "memcmp" in filter ? { - ...filter, - memcmp: { - ...filter.memcmp, - encoding: filter.memcmp.encoding ?? "base58" - } - } : filter); -} -function createRpcResult(result) { - return union([type({ - jsonrpc: literal("2.0"), - id: string(), - result - }), type({ - jsonrpc: literal("2.0"), - id: string(), - error: type({ - code: unknown(), - message: string(), - data: optional(any()) - }) - })]); -} -function jsonRpcResult(schema) { - return coerce(createRpcResult(schema), UnknownRpcResult, (value) => { - if ("error" in value) { - return value; - } else { - return { - ...value, - result: create(value.result, schema) - }; - } - }); -} -function jsonRpcResultAndContext(value) { - return jsonRpcResult(type({ - context: type({ - slot: number() - }), - value - })); -} -function notificationResultAndContext(value) { - return type({ - context: type({ - slot: number() - }), - value - }); -} -function versionedMessageFromResponse(version2, response) { - if (version2 === 0) { - return new MessageV0({ - header: response.header, - staticAccountKeys: response.accountKeys.map((accountKey) => new PublicKey(accountKey)), - recentBlockhash: response.recentBlockhash, - compiledInstructions: response.instructions.map((ix) => ({ - programIdIndex: ix.programIdIndex, - accountKeyIndexes: ix.accounts, - data: import_bs58.default.decode(ix.data) - })), - addressTableLookups: response.addressTableLookups - }); - } else { - return new Message(response); - } -} -function createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) { - const fetch3 = customFetch ? customFetch : fetchImpl; - let agent2; - { - if (httpAgent == null) { - { - const agentOptions = { - // One second fewer than the Solana RPC's keepalive timeout. - // Read more: https://github.com/solana-labs/solana/issues/27859#issuecomment-1340097889 - freeSocketTimeout: 19e3, - keepAlive: true, - maxSockets: 25 - }; - if (url.startsWith("https:")) { - agent2 = new agentkeepaliveExports.HttpsAgent(agentOptions); - } else { - agent2 = new HttpKeepAliveAgent(agentOptions); - } - } - } else { - if (httpAgent !== false) { - const isHttps = url.startsWith("https:"); - if (isHttps && !(httpAgent instanceof import_https2.Agent)) { - throw new Error("The endpoint `" + url + "` can only be paired with an `https.Agent`. You have, instead, supplied an `http.Agent` through `httpAgent`."); - } else if (!isHttps && httpAgent instanceof import_https2.Agent) { - throw new Error("The endpoint `" + url + "` can only be paired with an `http.Agent`. You have, instead, supplied an `https.Agent` through `httpAgent`."); - } - agent2 = httpAgent; - } - } - } - let fetchWithMiddleware; - if (fetchMiddleware) { - fetchWithMiddleware = async (info, init) => { - const modifiedFetchArgs = await new Promise((resolve, reject) => { - try { - fetchMiddleware(info, init, (modifiedInfo, modifiedInit) => resolve([modifiedInfo, modifiedInit])); - } catch (error) { - reject(error); - } - }); - return await fetch3(...modifiedFetchArgs); - }; - } - const clientBrowser = new import_browser.default(async (request, callback) => { - const options = { - method: "POST", - body: request, - agent: agent2, - headers: Object.assign({ - "Content-Type": "application/json" - }, httpHeaders || {}, COMMON_HTTP_HEADERS) - }; - try { - let too_many_requests_retries = 5; - let res; - let waitTime = 500; - for (; ; ) { - if (fetchWithMiddleware) { - res = await fetchWithMiddleware(url, options); - } else { - res = await fetch3(url, options); - } - if (res.status !== 429) { - break; - } - if (disableRetryOnRateLimit === true) { - break; - } - too_many_requests_retries -= 1; - if (too_many_requests_retries === 0) { - break; - } - console.error(`Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`); - await sleep(waitTime); - waitTime *= 2; - } - const text = await res.text(); - if (res.ok) { - callback(null, text); - } else { - callback(new Error(`${res.status} ${res.statusText}: ${text}`)); - } - } catch (err) { - if (err instanceof Error) - callback(err); - } - }, {}); - return clientBrowser; -} -function createRpcRequest(client) { - return (method, args) => { - return new Promise((resolve, reject) => { - client.request(method, args, (err, response) => { - if (err) { - reject(err); - return; - } - resolve(response); - }); - }); - }; -} -function createRpcBatchRequest(client) { - return (requests) => { - return new Promise((resolve, reject) => { - if (requests.length === 0) - resolve([]); - const batch = requests.map((params) => { - return client.request(params.methodName, params.args); - }); - client.request(batch, (err, response) => { - if (err) { - reject(err); - return; - } - resolve(response); - }); - }); - }; -} -function parseAuthorizedVoter({ - authorizedVoter, - epoch -}) { - return { - epoch, - authorizedVoter: new PublicKey(authorizedVoter) - }; -} -function parsePriorVoters({ - authorizedPubkey, - epochOfLastAuthorizedSwitch, - targetEpoch -}) { - return { - authorizedPubkey: new PublicKey(authorizedPubkey), - epochOfLastAuthorizedSwitch, - targetEpoch - }; -} -function getPriorVoters({ - buf, - idx, - isEmpty -}) { - if (isEmpty) { - return []; - } - return [...buf.slice(idx + 1).map(parsePriorVoters), ...buf.slice(0, idx).map(parsePriorVoters)]; -} -function clusterApiUrl(cluster, tls) { - const key = tls === false ? "http" : "https"; - if (!cluster) { - return endpoint[key]["devnet"]; - } - const url = endpoint[key][cluster]; - if (!url) { - throw new Error(`Unknown ${key} cluster: ${cluster}`); - } - return url; -} -async function sendAndConfirmRawTransaction(connection, rawTransaction, confirmationStrategyOrConfirmOptions, maybeConfirmOptions) { - let confirmationStrategy; - let options; - if (confirmationStrategyOrConfirmOptions && Object.prototype.hasOwnProperty.call(confirmationStrategyOrConfirmOptions, "lastValidBlockHeight")) { - confirmationStrategy = confirmationStrategyOrConfirmOptions; - options = maybeConfirmOptions; - } else if (confirmationStrategyOrConfirmOptions && Object.prototype.hasOwnProperty.call(confirmationStrategyOrConfirmOptions, "nonceValue")) { - confirmationStrategy = confirmationStrategyOrConfirmOptions; - options = maybeConfirmOptions; - } else { - options = confirmationStrategyOrConfirmOptions; - } - const sendOptions = options && { - skipPreflight: options.skipPreflight, - preflightCommitment: options.preflightCommitment || options.commitment, - minContextSlot: options.minContextSlot - }; - const signature2 = await connection.sendRawTransaction(rawTransaction, sendOptions); - const commitment = options && options.commitment; - const confirmationPromise = confirmationStrategy ? connection.confirmTransaction(confirmationStrategy, commitment) : connection.confirmTransaction(signature2, commitment); - const status = (await confirmationPromise).value; - if (status.err) { - if (signature2 != null) { - throw new SendTransactionError({ - action: sendOptions?.skipPreflight ? "send" : "simulate", - signature: signature2, - transactionMessage: `Status: (${JSON.stringify(status)})` - }); - } - throw new Error(`Raw transaction ${signature2} failed (${JSON.stringify(status)})`); - } - return signature2; -} -var import_buffer, import_bn, import_bs58, import_borsh, BufferLayout, import_buffer_layout, import_util, import_http2, import_https2, import_browser, generatePrivateKey, generateKeypair, getPublicKey, sign, verify, toBuffer, Struct2, Enum, SOLANA_SCHEMA, _PublicKey, MAX_SEED_LENGTH, PUBLIC_KEY_LENGTH, uniquePublicKeyCounter, PublicKey, Account, BPF_LOADER_DEPRECATED_PROGRAM_ID, PACKET_DATA_SIZE, VERSION_PREFIX_MASK, SIGNATURE_LENGTH_IN_BYTES, TransactionExpiredBlockheightExceededError, TransactionExpiredTimeoutError, TransactionExpiredNonceInvalidError, MessageAccountKeys, publicKey, signature, rustString, authorized, lockup, voteInit, voteAuthorizeWithSeedArgs, CompiledKeys, END_OF_BUFFER_ERROR_MESSAGE, Message, MessageV0, VersionedMessage, TransactionStatus, DEFAULT_SIGNATURE, TransactionInstruction, Transaction, TransactionMessage, VersionedTransaction, NUM_TICKS_PER_SECOND, DEFAULT_TICKS_PER_SLOT, NUM_SLOTS_PER_SECOND, MS_PER_SLOT, SYSVAR_CLOCK_PUBKEY, SYSVAR_EPOCH_SCHEDULE_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_REWARDS_PUBKEY, SYSVAR_SLOT_HASHES_PUBKEY, SYSVAR_SLOT_HISTORY_PUBKEY, SYSVAR_STAKE_HISTORY_PUBKEY, SendTransactionError, SolanaJSONRPCErrorCode, SolanaJSONRPCError, FeeCalculatorLayout, NonceAccountLayout, NONCE_ACCOUNT_LENGTH, NonceAccount, SystemInstruction, SYSTEM_INSTRUCTION_LAYOUTS, SystemProgram, CHUNK_SIZE, Loader, BPF_LOADER_PROGRAM_ID, BpfLoader, agentkeepalive, ms, hasRequiredMs, humanizeMs, hasRequiredHumanizeMs, constants, hasRequiredConstants, agent, hasRequiredAgent, https_agent, hasRequiredHttps_agent, hasRequiredAgentkeepalive, agentkeepaliveExports, HttpKeepAliveAgent, fastStableStringify$1, hasRequiredFastStableStringify, fastStableStringifyExports, fastStableStringify, MINIMUM_SLOT_PER_EPOCH, EpochSchedule, fetchImpl, RpcWebSocketClient, LOOKUP_TABLE_META_SIZE, AddressLookupTableAccount, LookupTableMetaLayout, URL_RE, PublicKeyFromString, RawAccountDataResult, BufferFromRawAccountData, BLOCKHASH_CACHE_TIMEOUT_MS, UnknownRpcResult, GetInflationGovernorResult, GetInflationRewardResult, GetRecentPrioritizationFeesResult, GetInflationRateResult, GetEpochInfoResult, GetEpochScheduleResult, GetLeaderScheduleResult, TransactionErrorResult, SignatureStatusResult, SignatureReceivedResult, VersionResult, ParsedInstructionStruct, PartiallyDecodedInstructionStruct, SimulatedTransactionResponseStruct, BlockProductionResponseStruct, GetInflationGovernorRpcResult, GetInflationRateRpcResult, GetRecentPrioritizationFeesRpcResult, GetEpochInfoRpcResult, GetEpochScheduleRpcResult, GetLeaderScheduleRpcResult, SlotRpcResult, GetSupplyRpcResult, TokenAmountResult, GetTokenLargestAccountsResult, GetTokenAccountsByOwner, ParsedAccountDataResult, GetParsedTokenAccountsByOwner, GetLargestAccountsRpcResult, AccountInfoResult, KeyedAccountInfoResult, ParsedOrRawAccountData, ParsedAccountInfoResult, KeyedParsedAccountInfoResult, StakeActivationResult, GetConfirmedSignaturesForAddress2RpcResult, GetSignaturesForAddressRpcResult, AccountNotificationResult, ProgramAccountInfoResult, ProgramAccountNotificationResult, SlotInfoResult, SlotNotificationResult, SlotUpdateResult, SlotUpdateNotificationResult, SignatureNotificationResult, RootNotificationResult, ContactInfoResult, VoteAccountInfoResult, GetVoteAccounts, ConfirmationStatus, SignatureStatusResponse, GetSignatureStatusesRpcResult, GetMinimumBalanceForRentExemptionRpcResult, AddressTableLookupStruct, ConfirmedTransactionResult, AnnotatedAccountKey, ConfirmedTransactionAccountsModeResult, ParsedInstructionResult, RawInstructionResult, InstructionResult, UnknownInstructionResult, ParsedOrRawInstruction, ParsedConfirmedTransactionResult, TokenBalanceResult, LoadedAddressesResult, ConfirmedTransactionMetaResult, ParsedConfirmedTransactionMetaResult, TransactionVersionStruct, RewardsResult, GetBlockRpcResult, GetNoneModeBlockRpcResult, GetAccountsModeBlockRpcResult, GetParsedBlockRpcResult, GetParsedAccountsModeBlockRpcResult, GetParsedNoneModeBlockRpcResult, GetConfirmedBlockRpcResult, GetBlockSignaturesRpcResult, GetTransactionRpcResult, GetParsedTransactionRpcResult, GetLatestBlockhashRpcResult, IsBlockhashValidRpcResult, PerfSampleResult, GetRecentPerformanceSamplesRpcResult, GetFeeCalculatorRpcResult, RequestAirdropRpcResult, SendTransactionRpcResult, LogsResult, LogsNotificationResult, COMMON_HTTP_HEADERS, Connection, Keypair, LOOKUP_TABLE_INSTRUCTION_LAYOUTS, AddressLookupTableInstruction, AddressLookupTableProgram, ComputeBudgetInstruction, COMPUTE_BUDGET_INSTRUCTION_LAYOUTS, ComputeBudgetProgram, PRIVATE_KEY_BYTES$1, PUBLIC_KEY_BYTES$1, SIGNATURE_BYTES, ED25519_INSTRUCTION_LAYOUT, Ed25519Program, ecdsaSign, publicKeyCreate, PRIVATE_KEY_BYTES, ETHEREUM_ADDRESS_BYTES, PUBLIC_KEY_BYTES, SIGNATURE_OFFSETS_SERIALIZED_SIZE, SECP256K1_INSTRUCTION_LAYOUT, Secp256k1Program, _Lockup, STAKE_CONFIG_ID, Authorized, Lockup, StakeInstruction, STAKE_INSTRUCTION_LAYOUTS, StakeAuthorizationLayout, StakeProgram, VoteInit, VoteInstruction, VOTE_INSTRUCTION_LAYOUTS, VoteAuthorizationLayout, VoteProgram, VALIDATOR_INFO_KEY, InfoString, ValidatorInfo, VOTE_PROGRAM_ID, VoteAccountLayout, VoteAccount, endpoint, LAMPORTS_PER_SOL; -var init_index_esm = __esm({ - "../../node_modules/.pnpm/@solana+web3.js@1.98.4_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/@solana/web3.js/lib/index.esm.js"() { - import_buffer = require("buffer"); - init_ed25519(); - import_bn = __toESM(require_bn()); - import_bs58 = __toESM(require_bs58()); - init_sha256(); - import_borsh = __toESM(require_lib2()); - BufferLayout = __toESM(require_Layout()); - import_buffer_layout = __toESM(require_Layout()); - init_index_node3(); - import_util = __toESM(require("util")); - import_http2 = __toESM(require("http")); - import_https2 = __toESM(require("https")); - init_dist(); - import_browser = __toESM(require_browser()); - init_lib(); - init_dist2(); - init_sha3(); - init_secp256k1(); - generatePrivateKey = ed25519.utils.randomPrivateKey; - generateKeypair = () => { - const privateScalar = ed25519.utils.randomPrivateKey(); - const publicKey2 = getPublicKey(privateScalar); - const secretKey = new Uint8Array(64); - secretKey.set(privateScalar); - secretKey.set(publicKey2, 32); - return { - publicKey: publicKey2, - secretKey - }; - }; - getPublicKey = ed25519.getPublicKey; - sign = (message, secretKey) => ed25519.sign(message, secretKey.slice(0, 32)); - verify = ed25519.verify; - toBuffer = (arr) => { - if (import_buffer.Buffer.isBuffer(arr)) { - return arr; - } else if (arr instanceof Uint8Array) { - return import_buffer.Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength); - } else { - return import_buffer.Buffer.from(arr); - } - }; - Struct2 = class { - constructor(properties) { - Object.assign(this, properties); - } - encode() { - return import_buffer.Buffer.from((0, import_borsh.serialize)(SOLANA_SCHEMA, this)); - } - static decode(data) { - return (0, import_borsh.deserialize)(SOLANA_SCHEMA, this, data); - } - static decodeUnchecked(data) { - return (0, import_borsh.deserializeUnchecked)(SOLANA_SCHEMA, this, data); - } - }; - Enum = class extends Struct2 { - constructor(properties) { - super(properties); - this.enum = ""; - if (Object.keys(properties).length !== 1) { - throw new Error("Enum can only take single value"); - } - Object.keys(properties).map((key) => { - this.enum = key; - }); - } - }; - SOLANA_SCHEMA = /* @__PURE__ */ new Map(); - MAX_SEED_LENGTH = 32; - PUBLIC_KEY_LENGTH = 32; - uniquePublicKeyCounter = 1; - PublicKey = class _PublicKey2 extends Struct2 { - /** - * Create a new PublicKey object - * @param value ed25519 public key as buffer or base-58 encoded string - */ - constructor(value) { - super({}); - this._bn = void 0; - if (isPublicKeyData(value)) { - this._bn = value._bn; - } else { - if (typeof value === "string") { - const decoded = import_bs58.default.decode(value); - if (decoded.length != PUBLIC_KEY_LENGTH) { - throw new Error(`Invalid public key input`); - } - this._bn = new import_bn.default(decoded); - } else { - this._bn = new import_bn.default(value); - } - if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) { - throw new Error(`Invalid public key input`); - } - } - } - /** - * Returns a unique PublicKey for tests and benchmarks using a counter - */ - static unique() { - const key = new _PublicKey2(uniquePublicKeyCounter); - uniquePublicKeyCounter += 1; - return new _PublicKey2(key.toBuffer()); - } - /** - * Default public key value. The base58-encoded string representation is all ones (as seen below) - * The underlying BN number is 32 bytes that are all zeros - */ - /** - * Checks if two publicKeys are equal - */ - equals(publicKey2) { - return this._bn.eq(publicKey2._bn); - } - /** - * Return the base-58 representation of the public key - */ - toBase58() { - return import_bs58.default.encode(this.toBytes()); - } - toJSON() { - return this.toBase58(); - } - /** - * Return the byte array representation of the public key in big endian - */ - toBytes() { - const buf = this.toBuffer(); - return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength); - } - /** - * Return the Buffer representation of the public key in big endian - */ - toBuffer() { - const b = this._bn.toArrayLike(import_buffer.Buffer); - if (b.length === PUBLIC_KEY_LENGTH) { - return b; - } - const zeroPad = import_buffer.Buffer.alloc(32); - b.copy(zeroPad, 32 - b.length); - return zeroPad; - } - get [Symbol.toStringTag]() { - return `PublicKey(${this.toString()})`; - } - /** - * Return the base-58 representation of the public key - */ - toString() { - return this.toBase58(); - } - /** - * Derive a public key from another key, a seed, and a program ID. - * The program ID will also serve as the owner of the public key, giving - * it permission to write data to the account. - */ - /* eslint-disable require-await */ - static async createWithSeed(fromPublicKey, seed, programId) { - const buffer = import_buffer.Buffer.concat([fromPublicKey.toBuffer(), import_buffer.Buffer.from(seed), programId.toBuffer()]); - const publicKeyBytes = sha2562(buffer); - return new _PublicKey2(publicKeyBytes); - } - /** - * Derive a program address from seeds and a program ID. - */ - /* eslint-disable require-await */ - static createProgramAddressSync(seeds, programId) { - let buffer = import_buffer.Buffer.alloc(0); - seeds.forEach(function(seed) { - if (seed.length > MAX_SEED_LENGTH) { - throw new TypeError(`Max seed length exceeded`); - } - buffer = import_buffer.Buffer.concat([buffer, toBuffer(seed)]); - }); - buffer = import_buffer.Buffer.concat([buffer, programId.toBuffer(), import_buffer.Buffer.from("ProgramDerivedAddress")]); - const publicKeyBytes = sha2562(buffer); - if (isOnCurve(publicKeyBytes)) { - throw new Error(`Invalid seeds, address must fall off the curve`); - } - return new _PublicKey2(publicKeyBytes); - } - /** - * Async version of createProgramAddressSync - * For backwards compatibility - * - * @deprecated Use {@link createProgramAddressSync} instead - */ - /* eslint-disable require-await */ - static async createProgramAddress(seeds, programId) { - return this.createProgramAddressSync(seeds, programId); - } - /** - * Find a valid program address - * - * Valid program addresses must fall off the ed25519 curve. This function - * iterates a nonce until it finds one that when combined with the seeds - * results in a valid program address. - */ - static findProgramAddressSync(seeds, programId) { - let nonce = 255; - let address; - while (nonce != 0) { - try { - const seedsWithNonce = seeds.concat(import_buffer.Buffer.from([nonce])); - address = this.createProgramAddressSync(seedsWithNonce, programId); - } catch (err) { - if (err instanceof TypeError) { - throw err; - } - nonce--; - continue; - } - return [address, nonce]; - } - throw new Error(`Unable to find a viable program address nonce`); - } - /** - * Async version of findProgramAddressSync - * For backwards compatibility - * - * @deprecated Use {@link findProgramAddressSync} instead - */ - static async findProgramAddress(seeds, programId) { - return this.findProgramAddressSync(seeds, programId); - } - /** - * Check that a pubkey is on the ed25519 curve. - */ - static isOnCurve(pubkeyData) { - const pubkey = new _PublicKey2(pubkeyData); - return isOnCurve(pubkey.toBytes()); - } - }; - _PublicKey = PublicKey; - PublicKey.default = new _PublicKey("11111111111111111111111111111111"); - SOLANA_SCHEMA.set(PublicKey, { - kind: "struct", - fields: [["_bn", "u256"]] - }); - Account = class { - /** - * Create a new Account object - * - * If the secretKey parameter is not provided a new key pair is randomly - * created for the account - * - * @param secretKey Secret key for the account - */ - constructor(secretKey) { - this._publicKey = void 0; - this._secretKey = void 0; - if (secretKey) { - const secretKeyBuffer = toBuffer(secretKey); - if (secretKey.length !== 64) { - throw new Error("bad secret key size"); - } - this._publicKey = secretKeyBuffer.slice(32, 64); - this._secretKey = secretKeyBuffer.slice(0, 32); - } else { - this._secretKey = toBuffer(generatePrivateKey()); - this._publicKey = toBuffer(getPublicKey(this._secretKey)); - } - } - /** - * The public key for this account - */ - get publicKey() { - return new PublicKey(this._publicKey); - } - /** - * The **unencrypted** secret key for this account. The first 32 bytes - * is the private scalar and the last 32 bytes is the public key. - * Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/ - */ - get secretKey() { - return import_buffer.Buffer.concat([this._secretKey, this._publicKey], 64); - } - }; - BPF_LOADER_DEPRECATED_PROGRAM_ID = new PublicKey("BPFLoader1111111111111111111111111111111111"); - PACKET_DATA_SIZE = 1280 - 40 - 8; - VERSION_PREFIX_MASK = 127; - SIGNATURE_LENGTH_IN_BYTES = 64; - TransactionExpiredBlockheightExceededError = class extends Error { - constructor(signature2) { - super(`Signature ${signature2} has expired: block height exceeded.`); - this.signature = void 0; - this.signature = signature2; - } - }; - Object.defineProperty(TransactionExpiredBlockheightExceededError.prototype, "name", { - value: "TransactionExpiredBlockheightExceededError" - }); - TransactionExpiredTimeoutError = class extends Error { - constructor(signature2, timeoutSeconds) { - super(`Transaction was not confirmed in ${timeoutSeconds.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${signature2} using the Solana Explorer or CLI tools.`); - this.signature = void 0; - this.signature = signature2; - } - }; - Object.defineProperty(TransactionExpiredTimeoutError.prototype, "name", { - value: "TransactionExpiredTimeoutError" - }); - TransactionExpiredNonceInvalidError = class extends Error { - constructor(signature2) { - super(`Signature ${signature2} has expired: the nonce is no longer valid.`); - this.signature = void 0; - this.signature = signature2; - } - }; - Object.defineProperty(TransactionExpiredNonceInvalidError.prototype, "name", { - value: "TransactionExpiredNonceInvalidError" - }); - MessageAccountKeys = class { - constructor(staticAccountKeys, accountKeysFromLookups) { - this.staticAccountKeys = void 0; - this.accountKeysFromLookups = void 0; - this.staticAccountKeys = staticAccountKeys; - this.accountKeysFromLookups = accountKeysFromLookups; - } - keySegments() { - const keySegments = [this.staticAccountKeys]; - if (this.accountKeysFromLookups) { - keySegments.push(this.accountKeysFromLookups.writable); - keySegments.push(this.accountKeysFromLookups.readonly); - } - return keySegments; - } - get(index) { - for (const keySegment of this.keySegments()) { - if (index < keySegment.length) { - return keySegment[index]; - } else { - index -= keySegment.length; - } - } - return; - } - get length() { - return this.keySegments().flat().length; - } - compileInstructions(instructions) { - const U8_MAX = 255; - if (this.length > U8_MAX + 1) { - throw new Error("Account index overflow encountered during compilation"); - } - const keyIndexMap = /* @__PURE__ */ new Map(); - this.keySegments().flat().forEach((key, index) => { - keyIndexMap.set(key.toBase58(), index); - }); - const findKeyIndex = (key) => { - const keyIndex = keyIndexMap.get(key.toBase58()); - if (keyIndex === void 0) - throw new Error("Encountered an unknown instruction account key during compilation"); - return keyIndex; - }; - return instructions.map((instruction) => { - return { - programIdIndex: findKeyIndex(instruction.programId), - accountKeyIndexes: instruction.keys.map((meta) => findKeyIndex(meta.pubkey)), - data: instruction.data - }; - }); - } - }; - publicKey = (property = "publicKey") => { - return BufferLayout.blob(32, property); - }; - signature = (property = "signature") => { - return BufferLayout.blob(64, property); - }; - rustString = (property = "string") => { - const rsl = BufferLayout.struct([BufferLayout.u32("length"), BufferLayout.u32("lengthPadding"), BufferLayout.blob(BufferLayout.offset(BufferLayout.u32(), -8), "chars")], property); - const _decode = rsl.decode.bind(rsl); - const _encode = rsl.encode.bind(rsl); - const rslShim = rsl; - rslShim.decode = (b, offset2) => { - const data = _decode(b, offset2); - return data["chars"].toString(); - }; - rslShim.encode = (str, b, offset2) => { - const data = { - chars: import_buffer.Buffer.from(str, "utf8") - }; - return _encode(data, b, offset2); - }; - rslShim.alloc = (str) => { - return BufferLayout.u32().span + BufferLayout.u32().span + import_buffer.Buffer.from(str, "utf8").length; - }; - return rslShim; - }; - authorized = (property = "authorized") => { - return BufferLayout.struct([publicKey("staker"), publicKey("withdrawer")], property); - }; - lockup = (property = "lockup") => { - return BufferLayout.struct([BufferLayout.ns64("unixTimestamp"), BufferLayout.ns64("epoch"), publicKey("custodian")], property); - }; - voteInit = (property = "voteInit") => { - return BufferLayout.struct([publicKey("nodePubkey"), publicKey("authorizedVoter"), publicKey("authorizedWithdrawer"), BufferLayout.u8("commission")], property); - }; - voteAuthorizeWithSeedArgs = (property = "voteAuthorizeWithSeedArgs") => { - return BufferLayout.struct([BufferLayout.u32("voteAuthorizationType"), publicKey("currentAuthorityDerivedKeyOwnerPubkey"), rustString("currentAuthorityDerivedKeySeed"), publicKey("newAuthorized")], property); - }; - CompiledKeys = class _CompiledKeys { - constructor(payer, keyMetaMap) { - this.payer = void 0; - this.keyMetaMap = void 0; - this.payer = payer; - this.keyMetaMap = keyMetaMap; - } - static compile(instructions, payer) { - const keyMetaMap = /* @__PURE__ */ new Map(); - const getOrInsertDefault = (pubkey) => { - const address = pubkey.toBase58(); - let keyMeta = keyMetaMap.get(address); - if (keyMeta === void 0) { - keyMeta = { - isSigner: false, - isWritable: false, - isInvoked: false - }; - keyMetaMap.set(address, keyMeta); - } - return keyMeta; - }; - const payerKeyMeta = getOrInsertDefault(payer); - payerKeyMeta.isSigner = true; - payerKeyMeta.isWritable = true; - for (const ix of instructions) { - getOrInsertDefault(ix.programId).isInvoked = true; - for (const accountMeta of ix.keys) { - const keyMeta = getOrInsertDefault(accountMeta.pubkey); - keyMeta.isSigner ||= accountMeta.isSigner; - keyMeta.isWritable ||= accountMeta.isWritable; - } - } - return new _CompiledKeys(payer, keyMetaMap); - } - getMessageComponents() { - const mapEntries = [...this.keyMetaMap.entries()]; - assert2(mapEntries.length <= 256, "Max static account keys length exceeded"); - const writableSigners = mapEntries.filter(([, meta]) => meta.isSigner && meta.isWritable); - const readonlySigners = mapEntries.filter(([, meta]) => meta.isSigner && !meta.isWritable); - const writableNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && meta.isWritable); - const readonlyNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && !meta.isWritable); - const header = { - numRequiredSignatures: writableSigners.length + readonlySigners.length, - numReadonlySignedAccounts: readonlySigners.length, - numReadonlyUnsignedAccounts: readonlyNonSigners.length - }; - { - assert2(writableSigners.length > 0, "Expected at least one writable signer key"); - const [payerAddress] = writableSigners[0]; - assert2(payerAddress === this.payer.toBase58(), "Expected first writable signer key to be the fee payer"); - } - const staticAccountKeys = [...writableSigners.map(([address]) => new PublicKey(address)), ...readonlySigners.map(([address]) => new PublicKey(address)), ...writableNonSigners.map(([address]) => new PublicKey(address)), ...readonlyNonSigners.map(([address]) => new PublicKey(address))]; - return [header, staticAccountKeys]; - } - extractTableLookup(lookupTable) { - const [writableIndexes, drainedWritableKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, (keyMeta) => !keyMeta.isSigner && !keyMeta.isInvoked && keyMeta.isWritable); - const [readonlyIndexes, drainedReadonlyKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, (keyMeta) => !keyMeta.isSigner && !keyMeta.isInvoked && !keyMeta.isWritable); - if (writableIndexes.length === 0 && readonlyIndexes.length === 0) { - return; - } - return [{ - accountKey: lookupTable.key, - writableIndexes, - readonlyIndexes - }, { - writable: drainedWritableKeys, - readonly: drainedReadonlyKeys - }]; - } - /** @internal */ - drainKeysFoundInLookupTable(lookupTableEntries, keyMetaFilter) { - const lookupTableIndexes = new Array(); - const drainedKeys = new Array(); - for (const [address, keyMeta] of this.keyMetaMap.entries()) { - if (keyMetaFilter(keyMeta)) { - const key = new PublicKey(address); - const lookupTableIndex = lookupTableEntries.findIndex((entry) => entry.equals(key)); - if (lookupTableIndex >= 0) { - assert2(lookupTableIndex < 256, "Max lookup table index exceeded"); - lookupTableIndexes.push(lookupTableIndex); - drainedKeys.push(key); - this.keyMetaMap.delete(address); - } - } - } - return [lookupTableIndexes, drainedKeys]; - } - }; - END_OF_BUFFER_ERROR_MESSAGE = "Reached end of buffer unexpectedly"; - Message = class _Message { - constructor(args) { - this.header = void 0; - this.accountKeys = void 0; - this.recentBlockhash = void 0; - this.instructions = void 0; - this.indexToProgramIds = /* @__PURE__ */ new Map(); - this.header = args.header; - this.accountKeys = args.accountKeys.map((account) => new PublicKey(account)); - this.recentBlockhash = args.recentBlockhash; - this.instructions = args.instructions; - this.instructions.forEach((ix) => this.indexToProgramIds.set(ix.programIdIndex, this.accountKeys[ix.programIdIndex])); - } - get version() { - return "legacy"; - } - get staticAccountKeys() { - return this.accountKeys; - } - get compiledInstructions() { - return this.instructions.map((ix) => ({ - programIdIndex: ix.programIdIndex, - accountKeyIndexes: ix.accounts, - data: import_bs58.default.decode(ix.data) - })); - } - get addressTableLookups() { - return []; - } - getAccountKeys() { - return new MessageAccountKeys(this.staticAccountKeys); - } - static compile(args) { - const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey); - const [header, staticAccountKeys] = compiledKeys.getMessageComponents(); - const accountKeys = new MessageAccountKeys(staticAccountKeys); - const instructions = accountKeys.compileInstructions(args.instructions).map((ix) => ({ - programIdIndex: ix.programIdIndex, - accounts: ix.accountKeyIndexes, - data: import_bs58.default.encode(ix.data) - })); - return new _Message({ - header, - accountKeys: staticAccountKeys, - recentBlockhash: args.recentBlockhash, - instructions - }); - } - isAccountSigner(index) { - return index < this.header.numRequiredSignatures; - } - isAccountWritable(index) { - const numSignedAccounts = this.header.numRequiredSignatures; - if (index >= this.header.numRequiredSignatures) { - const unsignedAccountIndex = index - numSignedAccounts; - const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts; - const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts; - return unsignedAccountIndex < numWritableUnsignedAccounts; - } else { - const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts; - return index < numWritableSignedAccounts; - } - } - isProgramId(index) { - return this.indexToProgramIds.has(index); - } - programIds() { - return [...this.indexToProgramIds.values()]; - } - nonProgramIds() { - return this.accountKeys.filter((_, index) => !this.isProgramId(index)); - } - serialize() { - const numKeys = this.accountKeys.length; - let keyCount = []; - encodeLength(keyCount, numKeys); - const instructions = this.instructions.map((instruction) => { - const { - accounts, - programIdIndex - } = instruction; - const data = Array.from(import_bs58.default.decode(instruction.data)); - let keyIndicesCount = []; - encodeLength(keyIndicesCount, accounts.length); - let dataCount = []; - encodeLength(dataCount, data.length); - return { - programIdIndex, - keyIndicesCount: import_buffer.Buffer.from(keyIndicesCount), - keyIndices: accounts, - dataLength: import_buffer.Buffer.from(dataCount), - data - }; - }); - let instructionCount = []; - encodeLength(instructionCount, instructions.length); - let instructionBuffer = import_buffer.Buffer.alloc(PACKET_DATA_SIZE); - import_buffer.Buffer.from(instructionCount).copy(instructionBuffer); - let instructionBufferLength = instructionCount.length; - instructions.forEach((instruction) => { - const instructionLayout = BufferLayout.struct([BufferLayout.u8("programIdIndex"), BufferLayout.blob(instruction.keyIndicesCount.length, "keyIndicesCount"), BufferLayout.seq(BufferLayout.u8("keyIndex"), instruction.keyIndices.length, "keyIndices"), BufferLayout.blob(instruction.dataLength.length, "dataLength"), BufferLayout.seq(BufferLayout.u8("userdatum"), instruction.data.length, "data")]); - const length2 = instructionLayout.encode(instruction, instructionBuffer, instructionBufferLength); - instructionBufferLength += length2; - }); - instructionBuffer = instructionBuffer.slice(0, instructionBufferLength); - const signDataLayout = BufferLayout.struct([BufferLayout.blob(1, "numRequiredSignatures"), BufferLayout.blob(1, "numReadonlySignedAccounts"), BufferLayout.blob(1, "numReadonlyUnsignedAccounts"), BufferLayout.blob(keyCount.length, "keyCount"), BufferLayout.seq(publicKey("key"), numKeys, "keys"), publicKey("recentBlockhash")]); - const transaction = { - numRequiredSignatures: import_buffer.Buffer.from([this.header.numRequiredSignatures]), - numReadonlySignedAccounts: import_buffer.Buffer.from([this.header.numReadonlySignedAccounts]), - numReadonlyUnsignedAccounts: import_buffer.Buffer.from([this.header.numReadonlyUnsignedAccounts]), - keyCount: import_buffer.Buffer.from(keyCount), - keys: this.accountKeys.map((key) => toBuffer(key.toBytes())), - recentBlockhash: import_bs58.default.decode(this.recentBlockhash) - }; - let signData = import_buffer.Buffer.alloc(2048); - const length = signDataLayout.encode(transaction, signData); - instructionBuffer.copy(signData, length); - return signData.slice(0, length + instructionBuffer.length); - } - /** - * Decode a compiled message into a Message object. - */ - static from(buffer) { - let byteArray = [...buffer]; - const numRequiredSignatures = guardedShift(byteArray); - if (numRequiredSignatures !== (numRequiredSignatures & VERSION_PREFIX_MASK)) { - throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()"); - } - const numReadonlySignedAccounts = guardedShift(byteArray); - const numReadonlyUnsignedAccounts = guardedShift(byteArray); - const accountCount = decodeLength(byteArray); - let accountKeys = []; - for (let i = 0; i < accountCount; i++) { - const account = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH); - accountKeys.push(new PublicKey(import_buffer.Buffer.from(account))); - } - const recentBlockhash = guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH); - const instructionCount = decodeLength(byteArray); - let instructions = []; - for (let i = 0; i < instructionCount; i++) { - const programIdIndex = guardedShift(byteArray); - const accountCount2 = decodeLength(byteArray); - const accounts = guardedSplice(byteArray, 0, accountCount2); - const dataLength = decodeLength(byteArray); - const dataSlice = guardedSplice(byteArray, 0, dataLength); - const data = import_bs58.default.encode(import_buffer.Buffer.from(dataSlice)); - instructions.push({ - programIdIndex, - accounts, - data - }); - } - const messageArgs = { - header: { - numRequiredSignatures, - numReadonlySignedAccounts, - numReadonlyUnsignedAccounts - }, - recentBlockhash: import_bs58.default.encode(import_buffer.Buffer.from(recentBlockhash)), - accountKeys, - instructions - }; - return new _Message(messageArgs); - } - }; - MessageV0 = class _MessageV0 { - constructor(args) { - this.header = void 0; - this.staticAccountKeys = void 0; - this.recentBlockhash = void 0; - this.compiledInstructions = void 0; - this.addressTableLookups = void 0; - this.header = args.header; - this.staticAccountKeys = args.staticAccountKeys; - this.recentBlockhash = args.recentBlockhash; - this.compiledInstructions = args.compiledInstructions; - this.addressTableLookups = args.addressTableLookups; - } - get version() { - return 0; - } - get numAccountKeysFromLookups() { - let count = 0; - for (const lookup of this.addressTableLookups) { - count += lookup.readonlyIndexes.length + lookup.writableIndexes.length; - } - return count; - } - getAccountKeys(args) { - let accountKeysFromLookups; - if (args && "accountKeysFromLookups" in args && args.accountKeysFromLookups) { - if (this.numAccountKeysFromLookups != args.accountKeysFromLookups.writable.length + args.accountKeysFromLookups.readonly.length) { - throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups"); - } - accountKeysFromLookups = args.accountKeysFromLookups; - } else if (args && "addressLookupTableAccounts" in args && args.addressLookupTableAccounts) { - accountKeysFromLookups = this.resolveAddressTableLookups(args.addressLookupTableAccounts); - } else if (this.addressTableLookups.length > 0) { - throw new Error("Failed to get account keys because address table lookups were not resolved"); - } - return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups); - } - isAccountSigner(index) { - return index < this.header.numRequiredSignatures; - } - isAccountWritable(index) { - const numSignedAccounts = this.header.numRequiredSignatures; - const numStaticAccountKeys = this.staticAccountKeys.length; - if (index >= numStaticAccountKeys) { - const lookupAccountKeysIndex = index - numStaticAccountKeys; - const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup) => count + lookup.writableIndexes.length, 0); - return lookupAccountKeysIndex < numWritableLookupAccountKeys; - } else if (index >= this.header.numRequiredSignatures) { - const unsignedAccountIndex = index - numSignedAccounts; - const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts; - const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts; - return unsignedAccountIndex < numWritableUnsignedAccounts; - } else { - const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts; - return index < numWritableSignedAccounts; - } - } - resolveAddressTableLookups(addressLookupTableAccounts) { - const accountKeysFromLookups = { - writable: [], - readonly: [] - }; - for (const tableLookup of this.addressTableLookups) { - const tableAccount = addressLookupTableAccounts.find((account) => account.key.equals(tableLookup.accountKey)); - if (!tableAccount) { - throw new Error(`Failed to find address lookup table account for table key ${tableLookup.accountKey.toBase58()}`); - } - for (const index of tableLookup.writableIndexes) { - if (index < tableAccount.state.addresses.length) { - accountKeysFromLookups.writable.push(tableAccount.state.addresses[index]); - } else { - throw new Error(`Failed to find address for index ${index} in address lookup table ${tableLookup.accountKey.toBase58()}`); - } - } - for (const index of tableLookup.readonlyIndexes) { - if (index < tableAccount.state.addresses.length) { - accountKeysFromLookups.readonly.push(tableAccount.state.addresses[index]); - } else { - throw new Error(`Failed to find address for index ${index} in address lookup table ${tableLookup.accountKey.toBase58()}`); - } - } - } - return accountKeysFromLookups; - } - static compile(args) { - const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey); - const addressTableLookups = new Array(); - const accountKeysFromLookups = { - writable: new Array(), - readonly: new Array() - }; - const lookupTableAccounts = args.addressLookupTableAccounts || []; - for (const lookupTable of lookupTableAccounts) { - const extractResult = compiledKeys.extractTableLookup(lookupTable); - if (extractResult !== void 0) { - const [addressTableLookup, { - writable, - readonly - }] = extractResult; - addressTableLookups.push(addressTableLookup); - accountKeysFromLookups.writable.push(...writable); - accountKeysFromLookups.readonly.push(...readonly); - } - } - const [header, staticAccountKeys] = compiledKeys.getMessageComponents(); - const accountKeys = new MessageAccountKeys(staticAccountKeys, accountKeysFromLookups); - const compiledInstructions = accountKeys.compileInstructions(args.instructions); - return new _MessageV0({ - header, - staticAccountKeys, - recentBlockhash: args.recentBlockhash, - compiledInstructions, - addressTableLookups - }); - } - serialize() { - const encodedStaticAccountKeysLength = Array(); - encodeLength(encodedStaticAccountKeysLength, this.staticAccountKeys.length); - const serializedInstructions = this.serializeInstructions(); - const encodedInstructionsLength = Array(); - encodeLength(encodedInstructionsLength, this.compiledInstructions.length); - const serializedAddressTableLookups = this.serializeAddressTableLookups(); - const encodedAddressTableLookupsLength = Array(); - encodeLength(encodedAddressTableLookupsLength, this.addressTableLookups.length); - const messageLayout = BufferLayout.struct([BufferLayout.u8("prefix"), BufferLayout.struct([BufferLayout.u8("numRequiredSignatures"), BufferLayout.u8("numReadonlySignedAccounts"), BufferLayout.u8("numReadonlyUnsignedAccounts")], "header"), BufferLayout.blob(encodedStaticAccountKeysLength.length, "staticAccountKeysLength"), BufferLayout.seq(publicKey(), this.staticAccountKeys.length, "staticAccountKeys"), publicKey("recentBlockhash"), BufferLayout.blob(encodedInstructionsLength.length, "instructionsLength"), BufferLayout.blob(serializedInstructions.length, "serializedInstructions"), BufferLayout.blob(encodedAddressTableLookupsLength.length, "addressTableLookupsLength"), BufferLayout.blob(serializedAddressTableLookups.length, "serializedAddressTableLookups")]); - const serializedMessage = new Uint8Array(PACKET_DATA_SIZE); - const MESSAGE_VERSION_0_PREFIX = 1 << 7; - const serializedMessageLength = messageLayout.encode({ - prefix: MESSAGE_VERSION_0_PREFIX, - header: this.header, - staticAccountKeysLength: new Uint8Array(encodedStaticAccountKeysLength), - staticAccountKeys: this.staticAccountKeys.map((key) => key.toBytes()), - recentBlockhash: import_bs58.default.decode(this.recentBlockhash), - instructionsLength: new Uint8Array(encodedInstructionsLength), - serializedInstructions, - addressTableLookupsLength: new Uint8Array(encodedAddressTableLookupsLength), - serializedAddressTableLookups - }, serializedMessage); - return serializedMessage.slice(0, serializedMessageLength); - } - serializeInstructions() { - let serializedLength = 0; - const serializedInstructions = new Uint8Array(PACKET_DATA_SIZE); - for (const instruction of this.compiledInstructions) { - const encodedAccountKeyIndexesLength = Array(); - encodeLength(encodedAccountKeyIndexesLength, instruction.accountKeyIndexes.length); - const encodedDataLength = Array(); - encodeLength(encodedDataLength, instruction.data.length); - const instructionLayout = BufferLayout.struct([BufferLayout.u8("programIdIndex"), BufferLayout.blob(encodedAccountKeyIndexesLength.length, "encodedAccountKeyIndexesLength"), BufferLayout.seq(BufferLayout.u8(), instruction.accountKeyIndexes.length, "accountKeyIndexes"), BufferLayout.blob(encodedDataLength.length, "encodedDataLength"), BufferLayout.blob(instruction.data.length, "data")]); - serializedLength += instructionLayout.encode({ - programIdIndex: instruction.programIdIndex, - encodedAccountKeyIndexesLength: new Uint8Array(encodedAccountKeyIndexesLength), - accountKeyIndexes: instruction.accountKeyIndexes, - encodedDataLength: new Uint8Array(encodedDataLength), - data: instruction.data - }, serializedInstructions, serializedLength); - } - return serializedInstructions.slice(0, serializedLength); - } - serializeAddressTableLookups() { - let serializedLength = 0; - const serializedAddressTableLookups = new Uint8Array(PACKET_DATA_SIZE); - for (const lookup of this.addressTableLookups) { - const encodedWritableIndexesLength = Array(); - encodeLength(encodedWritableIndexesLength, lookup.writableIndexes.length); - const encodedReadonlyIndexesLength = Array(); - encodeLength(encodedReadonlyIndexesLength, lookup.readonlyIndexes.length); - const addressTableLookupLayout = BufferLayout.struct([publicKey("accountKey"), BufferLayout.blob(encodedWritableIndexesLength.length, "encodedWritableIndexesLength"), BufferLayout.seq(BufferLayout.u8(), lookup.writableIndexes.length, "writableIndexes"), BufferLayout.blob(encodedReadonlyIndexesLength.length, "encodedReadonlyIndexesLength"), BufferLayout.seq(BufferLayout.u8(), lookup.readonlyIndexes.length, "readonlyIndexes")]); - serializedLength += addressTableLookupLayout.encode({ - accountKey: lookup.accountKey.toBytes(), - encodedWritableIndexesLength: new Uint8Array(encodedWritableIndexesLength), - writableIndexes: lookup.writableIndexes, - encodedReadonlyIndexesLength: new Uint8Array(encodedReadonlyIndexesLength), - readonlyIndexes: lookup.readonlyIndexes - }, serializedAddressTableLookups, serializedLength); - } - return serializedAddressTableLookups.slice(0, serializedLength); - } - static deserialize(serializedMessage) { - let byteArray = [...serializedMessage]; - const prefix = guardedShift(byteArray); - const maskedPrefix = prefix & VERSION_PREFIX_MASK; - assert2(prefix !== maskedPrefix, `Expected versioned message but received legacy message`); - const version2 = maskedPrefix; - assert2(version2 === 0, `Expected versioned message with version 0 but found version ${version2}`); - const header = { - numRequiredSignatures: guardedShift(byteArray), - numReadonlySignedAccounts: guardedShift(byteArray), - numReadonlyUnsignedAccounts: guardedShift(byteArray) - }; - const staticAccountKeys = []; - const staticAccountKeysLength = decodeLength(byteArray); - for (let i = 0; i < staticAccountKeysLength; i++) { - staticAccountKeys.push(new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH))); - } - const recentBlockhash = import_bs58.default.encode(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)); - const instructionCount = decodeLength(byteArray); - const compiledInstructions = []; - for (let i = 0; i < instructionCount; i++) { - const programIdIndex = guardedShift(byteArray); - const accountKeyIndexesLength = decodeLength(byteArray); - const accountKeyIndexes = guardedSplice(byteArray, 0, accountKeyIndexesLength); - const dataLength = decodeLength(byteArray); - const data = new Uint8Array(guardedSplice(byteArray, 0, dataLength)); - compiledInstructions.push({ - programIdIndex, - accountKeyIndexes, - data - }); - } - const addressTableLookupsCount = decodeLength(byteArray); - const addressTableLookups = []; - for (let i = 0; i < addressTableLookupsCount; i++) { - const accountKey = new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)); - const writableIndexesLength = decodeLength(byteArray); - const writableIndexes = guardedSplice(byteArray, 0, writableIndexesLength); - const readonlyIndexesLength = decodeLength(byteArray); - const readonlyIndexes = guardedSplice(byteArray, 0, readonlyIndexesLength); - addressTableLookups.push({ - accountKey, - writableIndexes, - readonlyIndexes - }); - } - return new _MessageV0({ - header, - staticAccountKeys, - recentBlockhash, - compiledInstructions, - addressTableLookups - }); - } - }; - VersionedMessage = { - deserializeMessageVersion(serializedMessage) { - const prefix = serializedMessage[0]; - const maskedPrefix = prefix & VERSION_PREFIX_MASK; - if (maskedPrefix === prefix) { - return "legacy"; - } - return maskedPrefix; - }, - deserialize: (serializedMessage) => { - const version2 = VersionedMessage.deserializeMessageVersion(serializedMessage); - if (version2 === "legacy") { - return Message.from(serializedMessage); - } - if (version2 === 0) { - return MessageV0.deserialize(serializedMessage); - } else { - throw new Error(`Transaction message version ${version2} deserialization is not supported`); - } - } - }; - TransactionStatus = /* @__PURE__ */ function(TransactionStatus2) { - TransactionStatus2[TransactionStatus2["BLOCKHEIGHT_EXCEEDED"] = 0] = "BLOCKHEIGHT_EXCEEDED"; - TransactionStatus2[TransactionStatus2["PROCESSED"] = 1] = "PROCESSED"; - TransactionStatus2[TransactionStatus2["TIMED_OUT"] = 2] = "TIMED_OUT"; - TransactionStatus2[TransactionStatus2["NONCE_INVALID"] = 3] = "NONCE_INVALID"; - return TransactionStatus2; - }({}); - DEFAULT_SIGNATURE = import_buffer.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0); - TransactionInstruction = class { - constructor(opts) { - this.keys = void 0; - this.programId = void 0; - this.data = import_buffer.Buffer.alloc(0); - this.programId = opts.programId; - this.keys = opts.keys; - if (opts.data) { - this.data = opts.data; - } - } - /** - * @internal - */ - toJSON() { - return { - keys: this.keys.map(({ - pubkey, - isSigner, - isWritable - }) => ({ - pubkey: pubkey.toJSON(), - isSigner, - isWritable - })), - programId: this.programId.toJSON(), - data: [...this.data] - }; - } - }; - Transaction = class _Transaction { - /** - * The first (payer) Transaction signature - * - * @returns {Buffer | null} Buffer of payer's signature - */ - get signature() { - if (this.signatures.length > 0) { - return this.signatures[0].signature; - } - return null; - } - /** - * The transaction fee payer - */ - // Construct a transaction with a blockhash and lastValidBlockHeight - // Construct a transaction using a durable nonce - /** - * @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version. - * Please supply a `TransactionBlockhashCtor` instead. - */ - /** - * Construct an empty Transaction - */ - constructor(opts) { - this.signatures = []; - this.feePayer = void 0; - this.instructions = []; - this.recentBlockhash = void 0; - this.lastValidBlockHeight = void 0; - this.nonceInfo = void 0; - this.minNonceContextSlot = void 0; - this._message = void 0; - this._json = void 0; - if (!opts) { - return; - } - if (opts.feePayer) { - this.feePayer = opts.feePayer; - } - if (opts.signatures) { - this.signatures = opts.signatures; - } - if (Object.prototype.hasOwnProperty.call(opts, "nonceInfo")) { - const { - minContextSlot, - nonceInfo - } = opts; - this.minNonceContextSlot = minContextSlot; - this.nonceInfo = nonceInfo; - } else if (Object.prototype.hasOwnProperty.call(opts, "lastValidBlockHeight")) { - const { - blockhash, - lastValidBlockHeight - } = opts; - this.recentBlockhash = blockhash; - this.lastValidBlockHeight = lastValidBlockHeight; - } else { - const { - recentBlockhash, - nonceInfo - } = opts; - if (nonceInfo) { - this.nonceInfo = nonceInfo; - } - this.recentBlockhash = recentBlockhash; - } - } - /** - * @internal - */ - toJSON() { - return { - recentBlockhash: this.recentBlockhash || null, - feePayer: this.feePayer ? this.feePayer.toJSON() : null, - nonceInfo: this.nonceInfo ? { - nonce: this.nonceInfo.nonce, - nonceInstruction: this.nonceInfo.nonceInstruction.toJSON() - } : null, - instructions: this.instructions.map((instruction) => instruction.toJSON()), - signers: this.signatures.map(({ - publicKey: publicKey2 - }) => { - return publicKey2.toJSON(); - }) - }; - } - /** - * Add one or more instructions to this Transaction - * - * @param {Array< Transaction | TransactionInstruction | TransactionInstructionCtorFields >} items - Instructions to add to the Transaction - */ - add(...items) { - if (items.length === 0) { - throw new Error("No instructions"); - } - items.forEach((item) => { - if ("instructions" in item) { - this.instructions = this.instructions.concat(item.instructions); - } else if ("data" in item && "programId" in item && "keys" in item) { - this.instructions.push(item); - } else { - this.instructions.push(new TransactionInstruction(item)); - } - }); - return this; - } - /** - * Compile transaction data - */ - compileMessage() { - if (this._message && JSON.stringify(this.toJSON()) === JSON.stringify(this._json)) { - return this._message; - } - let recentBlockhash; - let instructions; - if (this.nonceInfo) { - recentBlockhash = this.nonceInfo.nonce; - if (this.instructions[0] != this.nonceInfo.nonceInstruction) { - instructions = [this.nonceInfo.nonceInstruction, ...this.instructions]; - } else { - instructions = this.instructions; - } - } else { - recentBlockhash = this.recentBlockhash; - instructions = this.instructions; - } - if (!recentBlockhash) { - throw new Error("Transaction recentBlockhash required"); - } - if (instructions.length < 1) { - console.warn("No instructions provided"); - } - let feePayer; - if (this.feePayer) { - feePayer = this.feePayer; - } else if (this.signatures.length > 0 && this.signatures[0].publicKey) { - feePayer = this.signatures[0].publicKey; - } else { - throw new Error("Transaction fee payer required"); - } - for (let i = 0; i < instructions.length; i++) { - if (instructions[i].programId === void 0) { - throw new Error(`Transaction instruction index ${i} has undefined program id`); - } - } - const programIds = []; - const accountMetas = []; - instructions.forEach((instruction) => { - instruction.keys.forEach((accountMeta) => { - accountMetas.push({ - ...accountMeta - }); - }); - const programId = instruction.programId.toString(); - if (!programIds.includes(programId)) { - programIds.push(programId); - } - }); - programIds.forEach((programId) => { - accountMetas.push({ - pubkey: new PublicKey(programId), - isSigner: false, - isWritable: false - }); - }); - const uniqueMetas = []; - accountMetas.forEach((accountMeta) => { - const pubkeyString = accountMeta.pubkey.toString(); - const uniqueIndex = uniqueMetas.findIndex((x) => { - return x.pubkey.toString() === pubkeyString; - }); - if (uniqueIndex > -1) { - uniqueMetas[uniqueIndex].isWritable = uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable; - uniqueMetas[uniqueIndex].isSigner = uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner; - } else { - uniqueMetas.push(accountMeta); - } - }); - uniqueMetas.sort(function(x, y) { - if (x.isSigner !== y.isSigner) { - return x.isSigner ? -1 : 1; - } - if (x.isWritable !== y.isWritable) { - return x.isWritable ? -1 : 1; - } - const options = { - localeMatcher: "best fit", - usage: "sort", - sensitivity: "variant", - ignorePunctuation: false, - numeric: false, - caseFirst: "lower" - }; - return x.pubkey.toBase58().localeCompare(y.pubkey.toBase58(), "en", options); - }); - const feePayerIndex = uniqueMetas.findIndex((x) => { - return x.pubkey.equals(feePayer); - }); - if (feePayerIndex > -1) { - const [payerMeta] = uniqueMetas.splice(feePayerIndex, 1); - payerMeta.isSigner = true; - payerMeta.isWritable = true; - uniqueMetas.unshift(payerMeta); - } else { - uniqueMetas.unshift({ - pubkey: feePayer, - isSigner: true, - isWritable: true - }); - } - for (const signature2 of this.signatures) { - const uniqueIndex = uniqueMetas.findIndex((x) => { - return x.pubkey.equals(signature2.publicKey); - }); - if (uniqueIndex > -1) { - if (!uniqueMetas[uniqueIndex].isSigner) { - uniqueMetas[uniqueIndex].isSigner = true; - console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."); - } - } else { - throw new Error(`unknown signer: ${signature2.publicKey.toString()}`); - } - } - let numRequiredSignatures = 0; - let numReadonlySignedAccounts = 0; - let numReadonlyUnsignedAccounts = 0; - const signedKeys = []; - const unsignedKeys = []; - uniqueMetas.forEach(({ - pubkey, - isSigner, - isWritable - }) => { - if (isSigner) { - signedKeys.push(pubkey.toString()); - numRequiredSignatures += 1; - if (!isWritable) { - numReadonlySignedAccounts += 1; - } - } else { - unsignedKeys.push(pubkey.toString()); - if (!isWritable) { - numReadonlyUnsignedAccounts += 1; - } - } - }); - const accountKeys = signedKeys.concat(unsignedKeys); - const compiledInstructions = instructions.map((instruction) => { - const { - data, - programId - } = instruction; - return { - programIdIndex: accountKeys.indexOf(programId.toString()), - accounts: instruction.keys.map((meta) => accountKeys.indexOf(meta.pubkey.toString())), - data: import_bs58.default.encode(data) - }; - }); - compiledInstructions.forEach((instruction) => { - assert2(instruction.programIdIndex >= 0); - instruction.accounts.forEach((keyIndex) => assert2(keyIndex >= 0)); - }); - return new Message({ - header: { - numRequiredSignatures, - numReadonlySignedAccounts, - numReadonlyUnsignedAccounts - }, - accountKeys, - recentBlockhash, - instructions: compiledInstructions - }); - } - /** - * @internal - */ - _compile() { - const message = this.compileMessage(); - const signedKeys = message.accountKeys.slice(0, message.header.numRequiredSignatures); - if (this.signatures.length === signedKeys.length) { - const valid = this.signatures.every((pair, index) => { - return signedKeys[index].equals(pair.publicKey); - }); - if (valid) - return message; - } - this.signatures = signedKeys.map((publicKey2) => ({ - signature: null, - publicKey: publicKey2 - })); - return message; - } - /** - * Get a buffer of the Transaction data that need to be covered by signatures - */ - serializeMessage() { - return this._compile().serialize(); - } - /** - * Get the estimated fee associated with a transaction - * - * @param {Connection} connection Connection to RPC Endpoint. - * - * @returns {Promise} The estimated fee for the transaction - */ - async getEstimatedFee(connection) { - return (await connection.getFeeForMessage(this.compileMessage())).value; - } - /** - * Specify the public keys which will be used to sign the Transaction. - * The first signer will be used as the transaction fee payer account. - * - * Signatures can be added with either `partialSign` or `addSignature` - * - * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be - * specified and it can be set in the Transaction constructor or with the - * `feePayer` property. - */ - setSigners(...signers) { - if (signers.length === 0) { - throw new Error("No signers"); - } - const seen = /* @__PURE__ */ new Set(); - this.signatures = signers.filter((publicKey2) => { - const key = publicKey2.toString(); - if (seen.has(key)) { - return false; - } else { - seen.add(key); - return true; - } - }).map((publicKey2) => ({ - signature: null, - publicKey: publicKey2 - })); - } - /** - * Sign the Transaction with the specified signers. Multiple signatures may - * be applied to a Transaction. The first signature is considered "primary" - * and is used identify and confirm transactions. - * - * If the Transaction `feePayer` is not set, the first signer will be used - * as the transaction fee payer account. - * - * Transaction fields should not be modified after the first call to `sign`, - * as doing so may invalidate the signature and cause the Transaction to be - * rejected. - * - * The Transaction must be assigned a valid `recentBlockhash` before invoking this method - * - * @param {Array} signers Array of signers that will sign the transaction - */ - sign(...signers) { - if (signers.length === 0) { - throw new Error("No signers"); - } - const seen = /* @__PURE__ */ new Set(); - const uniqueSigners = []; - for (const signer of signers) { - const key = signer.publicKey.toString(); - if (seen.has(key)) { - continue; - } else { - seen.add(key); - uniqueSigners.push(signer); - } - } - this.signatures = uniqueSigners.map((signer) => ({ - signature: null, - publicKey: signer.publicKey - })); - const message = this._compile(); - this._partialSign(message, ...uniqueSigners); - } - /** - * Partially sign a transaction with the specified accounts. All accounts must - * correspond to either the fee payer or a signer account in the transaction - * instructions. - * - * All the caveats from the `sign` method apply to `partialSign` - * - * @param {Array} signers Array of signers that will sign the transaction - */ - partialSign(...signers) { - if (signers.length === 0) { - throw new Error("No signers"); - } - const seen = /* @__PURE__ */ new Set(); - const uniqueSigners = []; - for (const signer of signers) { - const key = signer.publicKey.toString(); - if (seen.has(key)) { - continue; - } else { - seen.add(key); - uniqueSigners.push(signer); - } - } - const message = this._compile(); - this._partialSign(message, ...uniqueSigners); - } - /** - * @internal - */ - _partialSign(message, ...signers) { - const signData = message.serialize(); - signers.forEach((signer) => { - const signature2 = sign(signData, signer.secretKey); - this._addSignature(signer.publicKey, toBuffer(signature2)); - }); - } - /** - * Add an externally created signature to a transaction. The public key - * must correspond to either the fee payer or a signer account in the transaction - * instructions. - * - * @param {PublicKey} pubkey Public key that will be added to the transaction. - * @param {Buffer} signature An externally created signature to add to the transaction. - */ - addSignature(pubkey, signature2) { - this._compile(); - this._addSignature(pubkey, signature2); - } - /** - * @internal - */ - _addSignature(pubkey, signature2) { - assert2(signature2.length === 64); - const index = this.signatures.findIndex((sigpair) => pubkey.equals(sigpair.publicKey)); - if (index < 0) { - throw new Error(`unknown signer: ${pubkey.toString()}`); - } - this.signatures[index].signature = import_buffer.Buffer.from(signature2); - } - /** - * Verify signatures of a Transaction - * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one. - * If no boolean is provided, we expect a fully signed Transaction by default. - * - * @param {boolean} [requireAllSignatures=true] Require a fully signed Transaction - */ - verifySignatures(requireAllSignatures = true) { - const signatureErrors = this._getMessageSignednessErrors(this.serializeMessage(), requireAllSignatures); - return !signatureErrors; - } - /** - * @internal - */ - _getMessageSignednessErrors(message, requireAllSignatures) { - const errors = {}; - for (const { - signature: signature2, - publicKey: publicKey2 - } of this.signatures) { - if (signature2 === null) { - if (requireAllSignatures) { - (errors.missing ||= []).push(publicKey2); - } - } else { - if (!verify(signature2, message, publicKey2.toBytes())) { - (errors.invalid ||= []).push(publicKey2); - } - } - } - return errors.invalid || errors.missing ? errors : void 0; - } - /** - * Serialize the Transaction in the wire format. - * - * @param {Buffer} [config] Config of transaction. - * - * @returns {Buffer} Signature of transaction in wire format. - */ - serialize(config) { - const { - requireAllSignatures, - verifySignatures - } = Object.assign({ - requireAllSignatures: true, - verifySignatures: true - }, config); - const signData = this.serializeMessage(); - if (verifySignatures) { - const sigErrors = this._getMessageSignednessErrors(signData, requireAllSignatures); - if (sigErrors) { - let errorMessage = "Signature verification failed."; - if (sigErrors.invalid) { - errorMessage += ` -Invalid signature for public key${sigErrors.invalid.length === 1 ? "" : "(s)"} [\`${sigErrors.invalid.map((p) => p.toBase58()).join("`, `")}\`].`; - } - if (sigErrors.missing) { - errorMessage += ` -Missing signature for public key${sigErrors.missing.length === 1 ? "" : "(s)"} [\`${sigErrors.missing.map((p) => p.toBase58()).join("`, `")}\`].`; - } - throw new Error(errorMessage); - } - } - return this._serialize(signData); - } - /** - * @internal - */ - _serialize(signData) { - const { - signatures - } = this; - const signatureCount = []; - encodeLength(signatureCount, signatures.length); - const transactionLength = signatureCount.length + signatures.length * 64 + signData.length; - const wireTransaction = import_buffer.Buffer.alloc(transactionLength); - assert2(signatures.length < 256); - import_buffer.Buffer.from(signatureCount).copy(wireTransaction, 0); - signatures.forEach(({ - signature: signature2 - }, index) => { - if (signature2 !== null) { - assert2(signature2.length === 64, `signature has invalid length`); - import_buffer.Buffer.from(signature2).copy(wireTransaction, signatureCount.length + index * 64); - } - }); - signData.copy(wireTransaction, signatureCount.length + signatures.length * 64); - assert2(wireTransaction.length <= PACKET_DATA_SIZE, `Transaction too large: ${wireTransaction.length} > ${PACKET_DATA_SIZE}`); - return wireTransaction; - } - /** - * Deprecated method - * @internal - */ - get keys() { - assert2(this.instructions.length === 1); - return this.instructions[0].keys.map((keyObj) => keyObj.pubkey); - } - /** - * Deprecated method - * @internal - */ - get programId() { - assert2(this.instructions.length === 1); - return this.instructions[0].programId; - } - /** - * Deprecated method - * @internal - */ - get data() { - assert2(this.instructions.length === 1); - return this.instructions[0].data; - } - /** - * Parse a wire transaction into a Transaction object. - * - * @param {Buffer | Uint8Array | Array} buffer Signature of wire Transaction - * - * @returns {Transaction} Transaction associated with the signature - */ - static from(buffer) { - let byteArray = [...buffer]; - const signatureCount = decodeLength(byteArray); - let signatures = []; - for (let i = 0; i < signatureCount; i++) { - const signature2 = guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES); - signatures.push(import_bs58.default.encode(import_buffer.Buffer.from(signature2))); - } - return _Transaction.populate(Message.from(byteArray), signatures); - } - /** - * Populate Transaction object from message and signatures - * - * @param {Message} message Message of transaction - * @param {Array} signatures List of signatures to assign to the transaction - * - * @returns {Transaction} The populated Transaction - */ - static populate(message, signatures = []) { - const transaction = new _Transaction(); - transaction.recentBlockhash = message.recentBlockhash; - if (message.header.numRequiredSignatures > 0) { - transaction.feePayer = message.accountKeys[0]; - } - signatures.forEach((signature2, index) => { - const sigPubkeyPair = { - signature: signature2 == import_bs58.default.encode(DEFAULT_SIGNATURE) ? null : import_bs58.default.decode(signature2), - publicKey: message.accountKeys[index] - }; - transaction.signatures.push(sigPubkeyPair); - }); - message.instructions.forEach((instruction) => { - const keys = instruction.accounts.map((account) => { - const pubkey = message.accountKeys[account]; - return { - pubkey, - isSigner: transaction.signatures.some((keyObj) => keyObj.publicKey.toString() === pubkey.toString()) || message.isAccountSigner(account), - isWritable: message.isAccountWritable(account) - }; - }); - transaction.instructions.push(new TransactionInstruction({ - keys, - programId: message.accountKeys[instruction.programIdIndex], - data: import_bs58.default.decode(instruction.data) - })); - }); - transaction._message = message; - transaction._json = transaction.toJSON(); - return transaction; - } - }; - TransactionMessage = class _TransactionMessage { - constructor(args) { - this.payerKey = void 0; - this.instructions = void 0; - this.recentBlockhash = void 0; - this.payerKey = args.payerKey; - this.instructions = args.instructions; - this.recentBlockhash = args.recentBlockhash; - } - static decompile(message, args) { - const { - header, - compiledInstructions, - recentBlockhash - } = message; - const { - numRequiredSignatures, - numReadonlySignedAccounts, - numReadonlyUnsignedAccounts - } = header; - const numWritableSignedAccounts = numRequiredSignatures - numReadonlySignedAccounts; - assert2(numWritableSignedAccounts > 0, "Message header is invalid"); - const numWritableUnsignedAccounts = message.staticAccountKeys.length - numRequiredSignatures - numReadonlyUnsignedAccounts; - assert2(numWritableUnsignedAccounts >= 0, "Message header is invalid"); - const accountKeys = message.getAccountKeys(args); - const payerKey = accountKeys.get(0); - if (payerKey === void 0) { - throw new Error("Failed to decompile message because no account keys were found"); - } - const instructions = []; - for (const compiledIx of compiledInstructions) { - const keys = []; - for (const keyIndex of compiledIx.accountKeyIndexes) { - const pubkey = accountKeys.get(keyIndex); - if (pubkey === void 0) { - throw new Error(`Failed to find key for account key index ${keyIndex}`); - } - const isSigner = keyIndex < numRequiredSignatures; - let isWritable; - if (isSigner) { - isWritable = keyIndex < numWritableSignedAccounts; - } else if (keyIndex < accountKeys.staticAccountKeys.length) { - isWritable = keyIndex - numRequiredSignatures < numWritableUnsignedAccounts; - } else { - isWritable = keyIndex - accountKeys.staticAccountKeys.length < // accountKeysFromLookups cannot be undefined because we already found a pubkey for this index above - accountKeys.accountKeysFromLookups.writable.length; - } - keys.push({ - pubkey, - isSigner: keyIndex < header.numRequiredSignatures, - isWritable - }); - } - const programId = accountKeys.get(compiledIx.programIdIndex); - if (programId === void 0) { - throw new Error(`Failed to find program id for program id index ${compiledIx.programIdIndex}`); - } - instructions.push(new TransactionInstruction({ - programId, - data: toBuffer(compiledIx.data), - keys - })); - } - return new _TransactionMessage({ - payerKey, - instructions, - recentBlockhash - }); - } - compileToLegacyMessage() { - return Message.compile({ - payerKey: this.payerKey, - recentBlockhash: this.recentBlockhash, - instructions: this.instructions - }); - } - compileToV0Message(addressLookupTableAccounts) { - return MessageV0.compile({ - payerKey: this.payerKey, - recentBlockhash: this.recentBlockhash, - instructions: this.instructions, - addressLookupTableAccounts - }); - } - }; - VersionedTransaction = class _VersionedTransaction { - get version() { - return this.message.version; - } - constructor(message, signatures) { - this.signatures = void 0; - this.message = void 0; - if (signatures !== void 0) { - assert2(signatures.length === message.header.numRequiredSignatures, "Expected signatures length to be equal to the number of required signatures"); - this.signatures = signatures; - } else { - const defaultSignatures = []; - for (let i = 0; i < message.header.numRequiredSignatures; i++) { - defaultSignatures.push(new Uint8Array(SIGNATURE_LENGTH_IN_BYTES)); - } - this.signatures = defaultSignatures; - } - this.message = message; - } - serialize() { - const serializedMessage = this.message.serialize(); - const encodedSignaturesLength = Array(); - encodeLength(encodedSignaturesLength, this.signatures.length); - const transactionLayout = BufferLayout.struct([BufferLayout.blob(encodedSignaturesLength.length, "encodedSignaturesLength"), BufferLayout.seq(signature(), this.signatures.length, "signatures"), BufferLayout.blob(serializedMessage.length, "serializedMessage")]); - const serializedTransaction = new Uint8Array(2048); - const serializedTransactionLength = transactionLayout.encode({ - encodedSignaturesLength: new Uint8Array(encodedSignaturesLength), - signatures: this.signatures, - serializedMessage - }, serializedTransaction); - return serializedTransaction.slice(0, serializedTransactionLength); - } - static deserialize(serializedTransaction) { - let byteArray = [...serializedTransaction]; - const signatures = []; - const signaturesLength = decodeLength(byteArray); - for (let i = 0; i < signaturesLength; i++) { - signatures.push(new Uint8Array(guardedSplice(byteArray, 0, SIGNATURE_LENGTH_IN_BYTES))); - } - const message = VersionedMessage.deserialize(new Uint8Array(byteArray)); - return new _VersionedTransaction(message, signatures); - } - sign(signers) { - const messageData = this.message.serialize(); - const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures); - for (const signer of signers) { - const signerIndex = signerPubkeys.findIndex((pubkey) => pubkey.equals(signer.publicKey)); - assert2(signerIndex >= 0, `Cannot sign with non signer key ${signer.publicKey.toBase58()}`); - this.signatures[signerIndex] = sign(messageData, signer.secretKey); - } - } - addSignature(publicKey2, signature2) { - assert2(signature2.byteLength === 64, "Signature must be 64 bytes long"); - const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures); - const signerIndex = signerPubkeys.findIndex((pubkey) => pubkey.equals(publicKey2)); - assert2(signerIndex >= 0, `Can not add signature; \`${publicKey2.toBase58()}\` is not required to sign this transaction`); - this.signatures[signerIndex] = signature2; - } - }; - NUM_TICKS_PER_SECOND = 160; - DEFAULT_TICKS_PER_SLOT = 64; - NUM_SLOTS_PER_SECOND = NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT; - MS_PER_SLOT = 1e3 / NUM_SLOTS_PER_SECOND; - SYSVAR_CLOCK_PUBKEY = new PublicKey("SysvarC1ock11111111111111111111111111111111"); - SYSVAR_EPOCH_SCHEDULE_PUBKEY = new PublicKey("SysvarEpochSchedu1e111111111111111111111111"); - SYSVAR_INSTRUCTIONS_PUBKEY = new PublicKey("Sysvar1nstructions1111111111111111111111111"); - SYSVAR_RECENT_BLOCKHASHES_PUBKEY = new PublicKey("SysvarRecentB1ockHashes11111111111111111111"); - SYSVAR_RENT_PUBKEY = new PublicKey("SysvarRent111111111111111111111111111111111"); - SYSVAR_REWARDS_PUBKEY = new PublicKey("SysvarRewards111111111111111111111111111111"); - SYSVAR_SLOT_HASHES_PUBKEY = new PublicKey("SysvarS1otHashes111111111111111111111111111"); - SYSVAR_SLOT_HISTORY_PUBKEY = new PublicKey("SysvarS1otHistory11111111111111111111111111"); - SYSVAR_STAKE_HISTORY_PUBKEY = new PublicKey("SysvarStakeHistory1111111111111111111111111"); - SendTransactionError = class extends Error { - constructor({ - action, - signature: signature2, - transactionMessage, - logs - }) { - const maybeLogsOutput = logs ? `Logs: -${JSON.stringify(logs.slice(-10), null, 2)}. ` : ""; - const guideText = "\nCatch the `SendTransactionError` and call `getLogs()` on it for full details."; - let message; - switch (action) { - case "send": - message = `Transaction ${signature2} resulted in an error. -${transactionMessage}. ` + maybeLogsOutput + guideText; - break; - case "simulate": - message = `Simulation failed. -Message: ${transactionMessage}. -` + maybeLogsOutput + guideText; - break; - default: { - message = `Unknown action '${/* @__PURE__ */ ((a) => a)(action)}'`; - } - } - super(message); - this.signature = void 0; - this.transactionMessage = void 0; - this.transactionLogs = void 0; - this.signature = signature2; - this.transactionMessage = transactionMessage; - this.transactionLogs = logs ? logs : void 0; - } - get transactionError() { - return { - message: this.transactionMessage, - logs: Array.isArray(this.transactionLogs) ? this.transactionLogs : void 0 - }; - } - /* @deprecated Use `await getLogs()` instead */ - get logs() { - const cachedLogs = this.transactionLogs; - if (cachedLogs != null && typeof cachedLogs === "object" && "then" in cachedLogs) { - return void 0; - } - return cachedLogs; - } - async getLogs(connection) { - if (!Array.isArray(this.transactionLogs)) { - this.transactionLogs = new Promise((resolve, reject) => { - connection.getTransaction(this.signature).then((tx) => { - if (tx && tx.meta && tx.meta.logMessages) { - const logs = tx.meta.logMessages; - this.transactionLogs = logs; - resolve(logs); - } else { - reject(new Error("Log messages not found")); - } - }).catch(reject); - }); - } - return await this.transactionLogs; - } - }; - SolanaJSONRPCErrorCode = { - JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001, - JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002, - JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003, - JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004, - JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005, - JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006, - JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007, - JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008, - JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009, - JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010, - JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011, - JSON_RPC_SCAN_ERROR: -32012, - JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013, - JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014, - JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015, - JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016 - }; - SolanaJSONRPCError = class extends Error { - constructor({ - code, - message, - data - }, customMessage) { - super(customMessage != null ? `${customMessage}: ${message}` : message); - this.code = void 0; - this.data = void 0; - this.code = code; - this.data = data; - this.name = "SolanaJSONRPCError"; - } - }; - FeeCalculatorLayout = BufferLayout.nu64("lamportsPerSignature"); - NonceAccountLayout = BufferLayout.struct([BufferLayout.u32("version"), BufferLayout.u32("state"), publicKey("authorizedPubkey"), publicKey("nonce"), BufferLayout.struct([FeeCalculatorLayout], "feeCalculator")]); - NONCE_ACCOUNT_LENGTH = NonceAccountLayout.span; - NonceAccount = class _NonceAccount { - /** - * @internal - */ - constructor(args) { - this.authorizedPubkey = void 0; - this.nonce = void 0; - this.feeCalculator = void 0; - this.authorizedPubkey = args.authorizedPubkey; - this.nonce = args.nonce; - this.feeCalculator = args.feeCalculator; - } - /** - * Deserialize NonceAccount from the account data. - * - * @param buffer account data - * @return NonceAccount - */ - static fromAccountData(buffer) { - const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer), 0); - return new _NonceAccount({ - authorizedPubkey: new PublicKey(nonceAccount.authorizedPubkey), - nonce: new PublicKey(nonceAccount.nonce).toString(), - feeCalculator: nonceAccount.feeCalculator - }); - } - }; - SystemInstruction = class { - /** - * @internal - */ - constructor() { - } - /** - * Decode a system instruction and retrieve the instruction type. - */ - static decodeInstructionType(instruction) { - this.checkProgramId(instruction.programId); - const instructionTypeLayout = BufferLayout.u32("instruction"); - const typeIndex = instructionTypeLayout.decode(instruction.data); - let type2; - for (const [ixType, layout] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) { - if (layout.index == typeIndex) { - type2 = ixType; - break; - } - } - if (!type2) { - throw new Error("Instruction type incorrect; not a SystemInstruction"); - } - return type2; - } - /** - * Decode a create account system instruction and retrieve the instruction params. - */ - static decodeCreateAccount(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 2); - const { - lamports, - space, - programId - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Create, instruction.data); - return { - fromPubkey: instruction.keys[0].pubkey, - newAccountPubkey: instruction.keys[1].pubkey, - lamports, - space, - programId: new PublicKey(programId) - }; - } - /** - * Decode a transfer system instruction and retrieve the instruction params. - */ - static decodeTransfer(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 2); - const { - lamports - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Transfer, instruction.data); - return { - fromPubkey: instruction.keys[0].pubkey, - toPubkey: instruction.keys[1].pubkey, - lamports - }; - } - /** - * Decode a transfer with seed system instruction and retrieve the instruction params. - */ - static decodeTransferWithSeed(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - const { - lamports, - seed, - programId - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed, instruction.data); - return { - fromPubkey: instruction.keys[0].pubkey, - basePubkey: instruction.keys[1].pubkey, - toPubkey: instruction.keys[2].pubkey, - lamports, - seed, - programId: new PublicKey(programId) - }; - } - /** - * Decode an allocate system instruction and retrieve the instruction params. - */ - static decodeAllocate(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 1); - const { - space - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Allocate, instruction.data); - return { - accountPubkey: instruction.keys[0].pubkey, - space - }; - } - /** - * Decode an allocate with seed system instruction and retrieve the instruction params. - */ - static decodeAllocateWithSeed(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 1); - const { - base, - seed, - space, - programId - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed, instruction.data); - return { - accountPubkey: instruction.keys[0].pubkey, - basePubkey: new PublicKey(base), - seed, - space, - programId: new PublicKey(programId) - }; - } - /** - * Decode an assign system instruction and retrieve the instruction params. - */ - static decodeAssign(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 1); - const { - programId - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Assign, instruction.data); - return { - accountPubkey: instruction.keys[0].pubkey, - programId: new PublicKey(programId) - }; - } - /** - * Decode an assign with seed system instruction and retrieve the instruction params. - */ - static decodeAssignWithSeed(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 1); - const { - base, - seed, - programId - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed, instruction.data); - return { - accountPubkey: instruction.keys[0].pubkey, - basePubkey: new PublicKey(base), - seed, - programId: new PublicKey(programId) - }; - } - /** - * Decode a create account with seed system instruction and retrieve the instruction params. - */ - static decodeCreateWithSeed(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 2); - const { - base, - seed, - lamports, - space, - programId - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed, instruction.data); - return { - fromPubkey: instruction.keys[0].pubkey, - newAccountPubkey: instruction.keys[1].pubkey, - basePubkey: new PublicKey(base), - seed, - lamports, - space, - programId: new PublicKey(programId) - }; - } - /** - * Decode a nonce initialize system instruction and retrieve the instruction params. - */ - static decodeNonceInitialize(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - const { - authorized: authorized2 - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount, instruction.data); - return { - noncePubkey: instruction.keys[0].pubkey, - authorizedPubkey: new PublicKey(authorized2) - }; - } - /** - * Decode a nonce advance system instruction and retrieve the instruction params. - */ - static decodeNonceAdvance(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount, instruction.data); - return { - noncePubkey: instruction.keys[0].pubkey, - authorizedPubkey: instruction.keys[2].pubkey - }; - } - /** - * Decode a nonce withdraw system instruction and retrieve the instruction params. - */ - static decodeNonceWithdraw(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 5); - const { - lamports - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount, instruction.data); - return { - noncePubkey: instruction.keys[0].pubkey, - toPubkey: instruction.keys[1].pubkey, - authorizedPubkey: instruction.keys[4].pubkey, - lamports - }; - } - /** - * Decode a nonce authorize system instruction and retrieve the instruction params. - */ - static decodeNonceAuthorize(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 2); - const { - authorized: authorized2 - } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount, instruction.data); - return { - noncePubkey: instruction.keys[0].pubkey, - authorizedPubkey: instruction.keys[1].pubkey, - newAuthorizedPubkey: new PublicKey(authorized2) - }; - } - /** - * @internal - */ - static checkProgramId(programId) { - if (!programId.equals(SystemProgram.programId)) { - throw new Error("invalid instruction; programId is not SystemProgram"); - } - } - /** - * @internal - */ - static checkKeyLength(keys, expectedLength) { - if (keys.length < expectedLength) { - throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`); - } - } - }; - SYSTEM_INSTRUCTION_LAYOUTS = Object.freeze({ - Create: { - index: 0, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), BufferLayout.ns64("lamports"), BufferLayout.ns64("space"), publicKey("programId")]) - }, - Assign: { - index: 1, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("programId")]) - }, - Transfer: { - index: 2, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), u64("lamports")]) - }, - CreateWithSeed: { - index: 3, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("base"), rustString("seed"), BufferLayout.ns64("lamports"), BufferLayout.ns64("space"), publicKey("programId")]) - }, - AdvanceNonceAccount: { - index: 4, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - }, - WithdrawNonceAccount: { - index: 5, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), BufferLayout.ns64("lamports")]) - }, - InitializeNonceAccount: { - index: 6, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("authorized")]) - }, - AuthorizeNonceAccount: { - index: 7, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("authorized")]) - }, - Allocate: { - index: 8, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), BufferLayout.ns64("space")]) - }, - AllocateWithSeed: { - index: 9, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("base"), rustString("seed"), BufferLayout.ns64("space"), publicKey("programId")]) - }, - AssignWithSeed: { - index: 10, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("base"), rustString("seed"), publicKey("programId")]) - }, - TransferWithSeed: { - index: 11, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), u64("lamports"), rustString("seed"), publicKey("programId")]) - }, - UpgradeNonceAccount: { - index: 12, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - } - }); - SystemProgram = class _SystemProgram { - /** - * @internal - */ - constructor() { - } - /** - * Public key that identifies the System program - */ - /** - * Generate a transaction instruction that creates a new account - */ - static createAccount(params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.Create; - const data = encodeData(type2, { - lamports: params.lamports, - space: params.space, - programId: toBuffer(params.programId.toBuffer()) - }); - return new TransactionInstruction({ - keys: [{ - pubkey: params.fromPubkey, - isSigner: true, - isWritable: true - }, { - pubkey: params.newAccountPubkey, - isSigner: true, - isWritable: true - }], - programId: this.programId, - data - }); - } - /** - * Generate a transaction instruction that transfers lamports from one account to another - */ - static transfer(params) { - let data; - let keys; - if ("basePubkey" in params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed; - data = encodeData(type2, { - lamports: BigInt(params.lamports), - seed: params.seed, - programId: toBuffer(params.programId.toBuffer()) - }); - keys = [{ - pubkey: params.fromPubkey, - isSigner: false, - isWritable: true - }, { - pubkey: params.basePubkey, - isSigner: true, - isWritable: false - }, { - pubkey: params.toPubkey, - isSigner: false, - isWritable: true - }]; - } else { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.Transfer; - data = encodeData(type2, { - lamports: BigInt(params.lamports) - }); - keys = [{ - pubkey: params.fromPubkey, - isSigner: true, - isWritable: true - }, { - pubkey: params.toPubkey, - isSigner: false, - isWritable: true - }]; - } - return new TransactionInstruction({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a transaction instruction that assigns an account to a program - */ - static assign(params) { - let data; - let keys; - if ("basePubkey" in params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed; - data = encodeData(type2, { - base: toBuffer(params.basePubkey.toBuffer()), - seed: params.seed, - programId: toBuffer(params.programId.toBuffer()) - }); - keys = [{ - pubkey: params.accountPubkey, - isSigner: false, - isWritable: true - }, { - pubkey: params.basePubkey, - isSigner: true, - isWritable: false - }]; - } else { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.Assign; - data = encodeData(type2, { - programId: toBuffer(params.programId.toBuffer()) - }); - keys = [{ - pubkey: params.accountPubkey, - isSigner: true, - isWritable: true - }]; - } - return new TransactionInstruction({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a transaction instruction that creates a new account at - * an address generated with `from`, a seed, and programId - */ - static createAccountWithSeed(params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed; - const data = encodeData(type2, { - base: toBuffer(params.basePubkey.toBuffer()), - seed: params.seed, - lamports: params.lamports, - space: params.space, - programId: toBuffer(params.programId.toBuffer()) - }); - let keys = [{ - pubkey: params.fromPubkey, - isSigner: true, - isWritable: true - }, { - pubkey: params.newAccountPubkey, - isSigner: false, - isWritable: true - }]; - if (!params.basePubkey.equals(params.fromPubkey)) { - keys.push({ - pubkey: params.basePubkey, - isSigner: true, - isWritable: false - }); - } - return new TransactionInstruction({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a transaction that creates a new Nonce account - */ - static createNonceAccount(params) { - const transaction = new Transaction(); - if ("basePubkey" in params && "seed" in params) { - transaction.add(_SystemProgram.createAccountWithSeed({ - fromPubkey: params.fromPubkey, - newAccountPubkey: params.noncePubkey, - basePubkey: params.basePubkey, - seed: params.seed, - lamports: params.lamports, - space: NONCE_ACCOUNT_LENGTH, - programId: this.programId - })); - } else { - transaction.add(_SystemProgram.createAccount({ - fromPubkey: params.fromPubkey, - newAccountPubkey: params.noncePubkey, - lamports: params.lamports, - space: NONCE_ACCOUNT_LENGTH, - programId: this.programId - })); - } - const initParams = { - noncePubkey: params.noncePubkey, - authorizedPubkey: params.authorizedPubkey - }; - transaction.add(this.nonceInitialize(initParams)); - return transaction; - } - /** - * Generate an instruction to initialize a Nonce account - */ - static nonceInitialize(params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount; - const data = encodeData(type2, { - authorized: toBuffer(params.authorizedPubkey.toBuffer()) - }); - const instructionData = { - keys: [{ - pubkey: params.noncePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: SYSVAR_RENT_PUBKEY, - isSigner: false, - isWritable: false - }], - programId: this.programId, - data - }; - return new TransactionInstruction(instructionData); - } - /** - * Generate an instruction to advance the nonce in a Nonce account - */ - static nonceAdvance(params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount; - const data = encodeData(type2); - const instructionData = { - keys: [{ - pubkey: params.noncePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: params.authorizedPubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }; - return new TransactionInstruction(instructionData); - } - /** - * Generate a transaction instruction that withdraws lamports from a Nonce account - */ - static nonceWithdraw(params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount; - const data = encodeData(type2, { - lamports: params.lamports - }); - return new TransactionInstruction({ - keys: [{ - pubkey: params.noncePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: params.toPubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: SYSVAR_RENT_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: params.authorizedPubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }); - } - /** - * Generate a transaction instruction that authorizes a new PublicKey as the authority - * on a Nonce account. - */ - static nonceAuthorize(params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount; - const data = encodeData(type2, { - authorized: toBuffer(params.newAuthorizedPubkey.toBuffer()) - }); - return new TransactionInstruction({ - keys: [{ - pubkey: params.noncePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: params.authorizedPubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }); - } - /** - * Generate a transaction instruction that allocates space in an account without funding - */ - static allocate(params) { - let data; - let keys; - if ("basePubkey" in params) { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed; - data = encodeData(type2, { - base: toBuffer(params.basePubkey.toBuffer()), - seed: params.seed, - space: params.space, - programId: toBuffer(params.programId.toBuffer()) - }); - keys = [{ - pubkey: params.accountPubkey, - isSigner: false, - isWritable: true - }, { - pubkey: params.basePubkey, - isSigner: true, - isWritable: false - }]; - } else { - const type2 = SYSTEM_INSTRUCTION_LAYOUTS.Allocate; - data = encodeData(type2, { - space: params.space - }); - keys = [{ - pubkey: params.accountPubkey, - isSigner: true, - isWritable: true - }]; - } - return new TransactionInstruction({ - keys, - programId: this.programId, - data - }); - } - }; - SystemProgram.programId = new PublicKey("11111111111111111111111111111111"); - CHUNK_SIZE = PACKET_DATA_SIZE - 300; - Loader = class _Loader { - /** - * @internal - */ - constructor() { - } - /** - * Amount of program data placed in each load Transaction - */ - /** - * Minimum number of signatures required to load a program not including - * retries - * - * Can be used to calculate transaction fees - */ - static getMinNumSignatures(dataLength) { - return 2 * // Every transaction requires two signatures (payer + program) - (Math.ceil(dataLength / _Loader.chunkSize) + 1 + // Add one for Create transaction - 1); - } - /** - * Loads a generic program - * - * @param connection The connection to use - * @param payer System account that pays to load the program - * @param program Account to load the program into - * @param programId Public key that identifies the loader - * @param data Program octets - * @return true if program was loaded successfully, false if program was already loaded - */ - static async load(connection, payer, program, programId, data) { - { - const balanceNeeded = await connection.getMinimumBalanceForRentExemption(data.length); - const programInfo = await connection.getAccountInfo(program.publicKey, "confirmed"); - let transaction = null; - if (programInfo !== null) { - if (programInfo.executable) { - console.error("Program load failed, account is already executable"); - return false; - } - if (programInfo.data.length !== data.length) { - transaction = transaction || new Transaction(); - transaction.add(SystemProgram.allocate({ - accountPubkey: program.publicKey, - space: data.length - })); - } - if (!programInfo.owner.equals(programId)) { - transaction = transaction || new Transaction(); - transaction.add(SystemProgram.assign({ - accountPubkey: program.publicKey, - programId - })); - } - if (programInfo.lamports < balanceNeeded) { - transaction = transaction || new Transaction(); - transaction.add(SystemProgram.transfer({ - fromPubkey: payer.publicKey, - toPubkey: program.publicKey, - lamports: balanceNeeded - programInfo.lamports - })); - } - } else { - transaction = new Transaction().add(SystemProgram.createAccount({ - fromPubkey: payer.publicKey, - newAccountPubkey: program.publicKey, - lamports: balanceNeeded > 0 ? balanceNeeded : 1, - space: data.length, - programId - })); - } - if (transaction !== null) { - await sendAndConfirmTransaction(connection, transaction, [payer, program], { - commitment: "confirmed" - }); - } - } - const dataLayout = BufferLayout.struct([BufferLayout.u32("instruction"), BufferLayout.u32("offset"), BufferLayout.u32("bytesLength"), BufferLayout.u32("bytesLengthPadding"), BufferLayout.seq(BufferLayout.u8("byte"), BufferLayout.offset(BufferLayout.u32(), -8), "bytes")]); - const chunkSize = _Loader.chunkSize; - let offset2 = 0; - let array2 = data; - let transactions = []; - while (array2.length > 0) { - const bytes = array2.slice(0, chunkSize); - const data2 = import_buffer.Buffer.alloc(chunkSize + 16); - dataLayout.encode({ - instruction: 0, - // Load instruction - offset: offset2, - bytes, - bytesLength: 0, - bytesLengthPadding: 0 - }, data2); - const transaction = new Transaction().add({ - keys: [{ - pubkey: program.publicKey, - isSigner: true, - isWritable: true - }], - programId, - data: data2 - }); - transactions.push(sendAndConfirmTransaction(connection, transaction, [payer, program], { - commitment: "confirmed" - })); - if (connection._rpcEndpoint.includes("solana.com")) { - const REQUESTS_PER_SECOND = 4; - await sleep(1e3 / REQUESTS_PER_SECOND); - } - offset2 += chunkSize; - array2 = array2.slice(chunkSize); - } - await Promise.all(transactions); - { - const dataLayout2 = BufferLayout.struct([BufferLayout.u32("instruction")]); - const data2 = import_buffer.Buffer.alloc(dataLayout2.span); - dataLayout2.encode({ - instruction: 1 - // Finalize instruction - }, data2); - const transaction = new Transaction().add({ - keys: [{ - pubkey: program.publicKey, - isSigner: true, - isWritable: true - }, { - pubkey: SYSVAR_RENT_PUBKEY, - isSigner: false, - isWritable: false - }], - programId, - data: data2 - }); - const deployCommitment = "processed"; - const finalizeSignature = await connection.sendTransaction(transaction, [payer, program], { - preflightCommitment: deployCommitment - }); - const { - context, - value - } = await connection.confirmTransaction({ - signature: finalizeSignature, - lastValidBlockHeight: transaction.lastValidBlockHeight, - blockhash: transaction.recentBlockhash - }, deployCommitment); - if (value.err) { - throw new Error(`Transaction ${finalizeSignature} failed (${JSON.stringify(value)})`); - } - while (true) { - try { - const currentSlot = await connection.getSlot({ - commitment: deployCommitment - }); - if (currentSlot > context.slot) { - break; - } - } catch { - } - await new Promise((resolve) => setTimeout(resolve, Math.round(MS_PER_SLOT / 2))); - } - } - return true; - } - }; - Loader.chunkSize = CHUNK_SIZE; - BPF_LOADER_PROGRAM_ID = new PublicKey("BPFLoader2111111111111111111111111111111111"); - BpfLoader = class { - /** - * Minimum number of signatures required to load a program not including - * retries - * - * Can be used to calculate transaction fees - */ - static getMinNumSignatures(dataLength) { - return Loader.getMinNumSignatures(dataLength); - } - /** - * Load a SBF program - * - * @param connection The connection to use - * @param payer Account that will pay program loading fees - * @param program Account to load the program into - * @param elf The entire ELF containing the SBF program - * @param loaderProgramId The program id of the BPF loader to use - * @return true if program was loaded successfully, false if program was already loaded - */ - static load(connection, payer, program, elf, loaderProgramId) { - return Loader.load(connection, payer, program, loaderProgramId, elf); - } - }; - agentkeepalive = { exports: {} }; - agentkeepaliveExports = /* @__PURE__ */ requireAgentkeepalive(); - HttpKeepAliveAgent = /* @__PURE__ */ getDefaultExportFromCjs(agentkeepaliveExports); - fastStableStringifyExports = /* @__PURE__ */ requireFastStableStringify(); - fastStableStringify = /* @__PURE__ */ getDefaultExportFromCjs(fastStableStringifyExports); - MINIMUM_SLOT_PER_EPOCH = 32; - EpochSchedule = class { - constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) { - this.slotsPerEpoch = void 0; - this.leaderScheduleSlotOffset = void 0; - this.warmup = void 0; - this.firstNormalEpoch = void 0; - this.firstNormalSlot = void 0; - this.slotsPerEpoch = slotsPerEpoch; - this.leaderScheduleSlotOffset = leaderScheduleSlotOffset; - this.warmup = warmup; - this.firstNormalEpoch = firstNormalEpoch; - this.firstNormalSlot = firstNormalSlot; - } - getEpoch(slot) { - return this.getEpochAndSlotIndex(slot)[0]; - } - getEpochAndSlotIndex(slot) { - if (slot < this.firstNormalSlot) { - const epoch = trailingZeros(nextPowerOfTwo(slot + MINIMUM_SLOT_PER_EPOCH + 1)) - trailingZeros(MINIMUM_SLOT_PER_EPOCH) - 1; - const epochLen = this.getSlotsInEpoch(epoch); - const slotIndex = slot - (epochLen - MINIMUM_SLOT_PER_EPOCH); - return [epoch, slotIndex]; - } else { - const normalSlotIndex = slot - this.firstNormalSlot; - const normalEpochIndex = Math.floor(normalSlotIndex / this.slotsPerEpoch); - const epoch = this.firstNormalEpoch + normalEpochIndex; - const slotIndex = normalSlotIndex % this.slotsPerEpoch; - return [epoch, slotIndex]; - } - } - getFirstSlotInEpoch(epoch) { - if (epoch <= this.firstNormalEpoch) { - return (Math.pow(2, epoch) - 1) * MINIMUM_SLOT_PER_EPOCH; - } else { - return (epoch - this.firstNormalEpoch) * this.slotsPerEpoch + this.firstNormalSlot; - } - } - getLastSlotInEpoch(epoch) { - return this.getFirstSlotInEpoch(epoch) + this.getSlotsInEpoch(epoch) - 1; - } - getSlotsInEpoch(epoch) { - if (epoch < this.firstNormalEpoch) { - return Math.pow(2, epoch + trailingZeros(MINIMUM_SLOT_PER_EPOCH)); - } else { - return this.slotsPerEpoch; - } - } - }; - fetchImpl = typeof globalThis.fetch === "function" ? ( - // The Fetch API is supported experimentally in Node 17.5+ and natively in Node 18+. - globalThis.fetch - ) : ( - // Otherwise use the polyfill. - async function(input, init) { - const processedInput = typeof input === "string" && input.slice(0, 2) === "//" ? "https:" + input : input; - return await lib_default(processedInput, init); - } - ); - RpcWebSocketClient = class extends CommonClient { - constructor(address, options, generate_request_id) { - const webSocketFactory = (url) => { - const rpc = WebSocket2(url, { - autoconnect: true, - max_reconnects: 5, - reconnect: true, - reconnect_interval: 1e3, - ...options - }); - if ("socket" in rpc) { - this.underlyingSocket = rpc.socket; - } else { - this.underlyingSocket = rpc; - } - return rpc; - }; - super(webSocketFactory, address, options, generate_request_id); - this.underlyingSocket = void 0; - } - call(...args) { - const readyState = this.underlyingSocket?.readyState; - if (readyState === 1) { - return super.call(...args); - } - return Promise.reject(new Error("Tried to call a JSON-RPC method `" + args[0] + "` but the socket was not `CONNECTING` or `OPEN` (`readyState` was " + readyState + ")")); - } - notify(...args) { - const readyState = this.underlyingSocket?.readyState; - if (readyState === 1) { - return super.notify(...args); - } - return Promise.reject(new Error("Tried to send a JSON-RPC notification `" + args[0] + "` but the socket was not `CONNECTING` or `OPEN` (`readyState` was " + readyState + ")")); - } - }; - LOOKUP_TABLE_META_SIZE = 56; - AddressLookupTableAccount = class { - constructor(args) { - this.key = void 0; - this.state = void 0; - this.key = args.key; - this.state = args.state; - } - isActive() { - const U64_MAX = BigInt("0xffffffffffffffff"); - return this.state.deactivationSlot === U64_MAX; - } - static deserialize(accountData) { - const meta = decodeData(LookupTableMetaLayout, accountData); - const serializedAddressesLen = accountData.length - LOOKUP_TABLE_META_SIZE; - assert2(serializedAddressesLen >= 0, "lookup table is invalid"); - assert2(serializedAddressesLen % 32 === 0, "lookup table is invalid"); - const numSerializedAddresses = serializedAddressesLen / 32; - const { - addresses - } = BufferLayout.struct([BufferLayout.seq(publicKey(), numSerializedAddresses, "addresses")]).decode(accountData.slice(LOOKUP_TABLE_META_SIZE)); - return { - deactivationSlot: meta.deactivationSlot, - lastExtendedSlot: meta.lastExtendedSlot, - lastExtendedSlotStartIndex: meta.lastExtendedStartIndex, - authority: meta.authority.length !== 0 ? new PublicKey(meta.authority[0]) : void 0, - addresses: addresses.map((address) => new PublicKey(address)) - }; - } - }; - LookupTableMetaLayout = { - index: 1, - layout: BufferLayout.struct([ - BufferLayout.u32("typeIndex"), - u64("deactivationSlot"), - BufferLayout.nu64("lastExtendedSlot"), - BufferLayout.u8("lastExtendedStartIndex"), - BufferLayout.u8(), - // option - BufferLayout.seq(publicKey(), BufferLayout.offset(BufferLayout.u8(), -1), "authority") - ]) - }; - URL_RE = /^[^:]+:\/\/([^:[]+|\[[^\]]+\])(:\d+)?(.*)/i; - PublicKeyFromString = coerce(instance(PublicKey), string(), (value) => new PublicKey(value)); - RawAccountDataResult = tuple([string(), literal("base64")]); - BufferFromRawAccountData = coerce(instance(import_buffer.Buffer), RawAccountDataResult, (value) => import_buffer.Buffer.from(value[0], "base64")); - BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1e3; - UnknownRpcResult = createRpcResult(unknown()); - GetInflationGovernorResult = type({ - foundation: number(), - foundationTerm: number(), - initial: number(), - taper: number(), - terminal: number() - }); - GetInflationRewardResult = jsonRpcResult(array(nullable(type({ - epoch: number(), - effectiveSlot: number(), - amount: number(), - postBalance: number(), - commission: optional(nullable(number())) - })))); - GetRecentPrioritizationFeesResult = array(type({ - slot: number(), - prioritizationFee: number() - })); - GetInflationRateResult = type({ - total: number(), - validator: number(), - foundation: number(), - epoch: number() - }); - GetEpochInfoResult = type({ - epoch: number(), - slotIndex: number(), - slotsInEpoch: number(), - absoluteSlot: number(), - blockHeight: optional(number()), - transactionCount: optional(number()) - }); - GetEpochScheduleResult = type({ - slotsPerEpoch: number(), - leaderScheduleSlotOffset: number(), - warmup: boolean(), - firstNormalEpoch: number(), - firstNormalSlot: number() - }); - GetLeaderScheduleResult = record(string(), array(number())); - TransactionErrorResult = nullable(union([type({}), string()])); - SignatureStatusResult = type({ - err: TransactionErrorResult - }); - SignatureReceivedResult = literal("receivedSignature"); - VersionResult = type({ - "solana-core": string(), - "feature-set": optional(number()) - }); - ParsedInstructionStruct = type({ - program: string(), - programId: PublicKeyFromString, - parsed: unknown() - }); - PartiallyDecodedInstructionStruct = type({ - programId: PublicKeyFromString, - accounts: array(PublicKeyFromString), - data: string() - }); - SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({ - err: nullable(union([type({}), string()])), - logs: nullable(array(string())), - accounts: optional(nullable(array(nullable(type({ - executable: boolean(), - owner: string(), - lamports: number(), - data: array(string()), - rentEpoch: optional(number()) - }))))), - unitsConsumed: optional(number()), - returnData: optional(nullable(type({ - programId: string(), - data: tuple([string(), literal("base64")]) - }))), - innerInstructions: optional(nullable(array(type({ - index: number(), - instructions: array(union([ParsedInstructionStruct, PartiallyDecodedInstructionStruct])) - })))) - })); - BlockProductionResponseStruct = jsonRpcResultAndContext(type({ - byIdentity: record(string(), array(number())), - range: type({ - firstSlot: number(), - lastSlot: number() - }) - })); - GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult); - GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult); - GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult); - GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult); - GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult); - GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult); - SlotRpcResult = jsonRpcResult(number()); - GetSupplyRpcResult = jsonRpcResultAndContext(type({ - total: number(), - circulating: number(), - nonCirculating: number(), - nonCirculatingAccounts: array(PublicKeyFromString) - })); - TokenAmountResult = type({ - amount: string(), - uiAmount: nullable(number()), - decimals: number(), - uiAmountString: optional(string()) - }); - GetTokenLargestAccountsResult = jsonRpcResultAndContext(array(type({ - address: PublicKeyFromString, - amount: string(), - uiAmount: nullable(number()), - decimals: number(), - uiAmountString: optional(string()) - }))); - GetTokenAccountsByOwner = jsonRpcResultAndContext(array(type({ - pubkey: PublicKeyFromString, - account: type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number(), - data: BufferFromRawAccountData, - rentEpoch: number() - }) - }))); - ParsedAccountDataResult = type({ - program: string(), - parsed: unknown(), - space: number() - }); - GetParsedTokenAccountsByOwner = jsonRpcResultAndContext(array(type({ - pubkey: PublicKeyFromString, - account: type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number(), - data: ParsedAccountDataResult, - rentEpoch: number() - }) - }))); - GetLargestAccountsRpcResult = jsonRpcResultAndContext(array(type({ - lamports: number(), - address: PublicKeyFromString - }))); - AccountInfoResult = type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number(), - data: BufferFromRawAccountData, - rentEpoch: number() - }); - KeyedAccountInfoResult = type({ - pubkey: PublicKeyFromString, - account: AccountInfoResult - }); - ParsedOrRawAccountData = coerce(union([instance(import_buffer.Buffer), ParsedAccountDataResult]), union([RawAccountDataResult, ParsedAccountDataResult]), (value) => { - if (Array.isArray(value)) { - return create(value, BufferFromRawAccountData); - } else { - return value; - } - }); - ParsedAccountInfoResult = type({ - executable: boolean(), - owner: PublicKeyFromString, - lamports: number(), - data: ParsedOrRawAccountData, - rentEpoch: number() - }); - KeyedParsedAccountInfoResult = type({ - pubkey: PublicKeyFromString, - account: ParsedAccountInfoResult - }); - StakeActivationResult = type({ - state: union([literal("active"), literal("inactive"), literal("activating"), literal("deactivating")]), - active: number(), - inactive: number() - }); - GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(array(type({ - signature: string(), - slot: number(), - err: TransactionErrorResult, - memo: nullable(string()), - blockTime: optional(nullable(number())) - }))); - GetSignaturesForAddressRpcResult = jsonRpcResult(array(type({ - signature: string(), - slot: number(), - err: TransactionErrorResult, - memo: nullable(string()), - blockTime: optional(nullable(number())) - }))); - AccountNotificationResult = type({ - subscription: number(), - result: notificationResultAndContext(AccountInfoResult) - }); - ProgramAccountInfoResult = type({ - pubkey: PublicKeyFromString, - account: AccountInfoResult - }); - ProgramAccountNotificationResult = type({ - subscription: number(), - result: notificationResultAndContext(ProgramAccountInfoResult) - }); - SlotInfoResult = type({ - parent: number(), - slot: number(), - root: number() - }); - SlotNotificationResult = type({ - subscription: number(), - result: SlotInfoResult - }); - SlotUpdateResult = union([type({ - type: union([literal("firstShredReceived"), literal("completed"), literal("optimisticConfirmation"), literal("root")]), - slot: number(), - timestamp: number() - }), type({ - type: literal("createdBank"), - parent: number(), - slot: number(), - timestamp: number() - }), type({ - type: literal("frozen"), - slot: number(), - timestamp: number(), - stats: type({ - numTransactionEntries: number(), - numSuccessfulTransactions: number(), - numFailedTransactions: number(), - maxTransactionsPerEntry: number() - }) - }), type({ - type: literal("dead"), - slot: number(), - timestamp: number(), - err: string() - })]); - SlotUpdateNotificationResult = type({ - subscription: number(), - result: SlotUpdateResult - }); - SignatureNotificationResult = type({ - subscription: number(), - result: notificationResultAndContext(union([SignatureStatusResult, SignatureReceivedResult])) - }); - RootNotificationResult = type({ - subscription: number(), - result: number() - }); - ContactInfoResult = type({ - pubkey: string(), - gossip: nullable(string()), - tpu: nullable(string()), - rpc: nullable(string()), - version: nullable(string()) - }); - VoteAccountInfoResult = type({ - votePubkey: string(), - nodePubkey: string(), - activatedStake: number(), - epochVoteAccount: boolean(), - epochCredits: array(tuple([number(), number(), number()])), - commission: number(), - lastVote: number(), - rootSlot: nullable(number()) - }); - GetVoteAccounts = jsonRpcResult(type({ - current: array(VoteAccountInfoResult), - delinquent: array(VoteAccountInfoResult) - })); - ConfirmationStatus = union([literal("processed"), literal("confirmed"), literal("finalized")]); - SignatureStatusResponse = type({ - slot: number(), - confirmations: nullable(number()), - err: TransactionErrorResult, - confirmationStatus: optional(ConfirmationStatus) - }); - GetSignatureStatusesRpcResult = jsonRpcResultAndContext(array(nullable(SignatureStatusResponse))); - GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult(number()); - AddressTableLookupStruct = type({ - accountKey: PublicKeyFromString, - writableIndexes: array(number()), - readonlyIndexes: array(number()) - }); - ConfirmedTransactionResult = type({ - signatures: array(string()), - message: type({ - accountKeys: array(string()), - header: type({ - numRequiredSignatures: number(), - numReadonlySignedAccounts: number(), - numReadonlyUnsignedAccounts: number() - }), - instructions: array(type({ - accounts: array(number()), - data: string(), - programIdIndex: number() - })), - recentBlockhash: string(), - addressTableLookups: optional(array(AddressTableLookupStruct)) - }) - }); - AnnotatedAccountKey = type({ - pubkey: PublicKeyFromString, - signer: boolean(), - writable: boolean(), - source: optional(union([literal("transaction"), literal("lookupTable")])) - }); - ConfirmedTransactionAccountsModeResult = type({ - accountKeys: array(AnnotatedAccountKey), - signatures: array(string()) - }); - ParsedInstructionResult = type({ - parsed: unknown(), - program: string(), - programId: PublicKeyFromString - }); - RawInstructionResult = type({ - accounts: array(PublicKeyFromString), - data: string(), - programId: PublicKeyFromString - }); - InstructionResult = union([RawInstructionResult, ParsedInstructionResult]); - UnknownInstructionResult = union([type({ - parsed: unknown(), - program: string(), - programId: string() - }), type({ - accounts: array(string()), - data: string(), - programId: string() - })]); - ParsedOrRawInstruction = coerce(InstructionResult, UnknownInstructionResult, (value) => { - if ("accounts" in value) { - return create(value, RawInstructionResult); - } else { - return create(value, ParsedInstructionResult); - } - }); - ParsedConfirmedTransactionResult = type({ - signatures: array(string()), - message: type({ - accountKeys: array(AnnotatedAccountKey), - instructions: array(ParsedOrRawInstruction), - recentBlockhash: string(), - addressTableLookups: optional(nullable(array(AddressTableLookupStruct))) - }) - }); - TokenBalanceResult = type({ - accountIndex: number(), - mint: string(), - owner: optional(string()), - programId: optional(string()), - uiTokenAmount: TokenAmountResult - }); - LoadedAddressesResult = type({ - writable: array(PublicKeyFromString), - readonly: array(PublicKeyFromString) - }); - ConfirmedTransactionMetaResult = type({ - err: TransactionErrorResult, - fee: number(), - innerInstructions: optional(nullable(array(type({ - index: number(), - instructions: array(type({ - accounts: array(number()), - data: string(), - programIdIndex: number() - })) - })))), - preBalances: array(number()), - postBalances: array(number()), - logMessages: optional(nullable(array(string()))), - preTokenBalances: optional(nullable(array(TokenBalanceResult))), - postTokenBalances: optional(nullable(array(TokenBalanceResult))), - loadedAddresses: optional(LoadedAddressesResult), - computeUnitsConsumed: optional(number()), - costUnits: optional(number()) - }); - ParsedConfirmedTransactionMetaResult = type({ - err: TransactionErrorResult, - fee: number(), - innerInstructions: optional(nullable(array(type({ - index: number(), - instructions: array(ParsedOrRawInstruction) - })))), - preBalances: array(number()), - postBalances: array(number()), - logMessages: optional(nullable(array(string()))), - preTokenBalances: optional(nullable(array(TokenBalanceResult))), - postTokenBalances: optional(nullable(array(TokenBalanceResult))), - loadedAddresses: optional(LoadedAddressesResult), - computeUnitsConsumed: optional(number()), - costUnits: optional(number()) - }); - TransactionVersionStruct = union([literal(0), literal("legacy")]); - RewardsResult = type({ - pubkey: string(), - lamports: number(), - postBalance: nullable(number()), - rewardType: nullable(string()), - commission: optional(nullable(number())) - }); - GetBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - transactions: array(type({ - transaction: ConfirmedTransactionResult, - meta: nullable(ConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number()), - blockHeight: nullable(number()) - }))); - GetNoneModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number()), - blockHeight: nullable(number()) - }))); - GetAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - transactions: array(type({ - transaction: ConfirmedTransactionAccountsModeResult, - meta: nullable(ConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number()), - blockHeight: nullable(number()) - }))); - GetParsedBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - transactions: array(type({ - transaction: ParsedConfirmedTransactionResult, - meta: nullable(ParsedConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number()), - blockHeight: nullable(number()) - }))); - GetParsedAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - transactions: array(type({ - transaction: ConfirmedTransactionAccountsModeResult, - meta: nullable(ParsedConfirmedTransactionMetaResult), - version: optional(TransactionVersionStruct) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number()), - blockHeight: nullable(number()) - }))); - GetParsedNoneModeBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number()), - blockHeight: nullable(number()) - }))); - GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - transactions: array(type({ - transaction: ConfirmedTransactionResult, - meta: nullable(ConfirmedTransactionMetaResult) - })), - rewards: optional(array(RewardsResult)), - blockTime: nullable(number()) - }))); - GetBlockSignaturesRpcResult = jsonRpcResult(nullable(type({ - blockhash: string(), - previousBlockhash: string(), - parentSlot: number(), - signatures: array(string()), - blockTime: nullable(number()) - }))); - GetTransactionRpcResult = jsonRpcResult(nullable(type({ - slot: number(), - meta: nullable(ConfirmedTransactionMetaResult), - blockTime: optional(nullable(number())), - transaction: ConfirmedTransactionResult, - version: optional(TransactionVersionStruct) - }))); - GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({ - slot: number(), - transaction: ParsedConfirmedTransactionResult, - meta: nullable(ParsedConfirmedTransactionMetaResult), - blockTime: optional(nullable(number())), - version: optional(TransactionVersionStruct) - }))); - GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({ - blockhash: string(), - lastValidBlockHeight: number() - })); - IsBlockhashValidRpcResult = jsonRpcResultAndContext(boolean()); - PerfSampleResult = type({ - slot: number(), - numTransactions: number(), - numSlots: number(), - samplePeriodSecs: number() - }); - GetRecentPerformanceSamplesRpcResult = jsonRpcResult(array(PerfSampleResult)); - GetFeeCalculatorRpcResult = jsonRpcResultAndContext(nullable(type({ - feeCalculator: type({ - lamportsPerSignature: number() - }) - }))); - RequestAirdropRpcResult = jsonRpcResult(string()); - SendTransactionRpcResult = jsonRpcResult(string()); - LogsResult = type({ - err: TransactionErrorResult, - logs: array(string()), - signature: string() - }); - LogsNotificationResult = type({ - result: notificationResultAndContext(LogsResult), - subscription: number() - }); - COMMON_HTTP_HEADERS = { - "solana-client": `js/${"1.0.0-maintenance"}` - }; - Connection = class { - /** - * Establish a JSON RPC connection - * - * @param endpoint URL to the fullnode JSON RPC endpoint - * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object - */ - constructor(endpoint2, _commitmentOrConfig) { - this._commitment = void 0; - this._confirmTransactionInitialTimeout = void 0; - this._rpcEndpoint = void 0; - this._rpcWsEndpoint = void 0; - this._rpcClient = void 0; - this._rpcRequest = void 0; - this._rpcBatchRequest = void 0; - this._rpcWebSocket = void 0; - this._rpcWebSocketConnected = false; - this._rpcWebSocketHeartbeat = null; - this._rpcWebSocketIdleTimeout = null; - this._rpcWebSocketGeneration = 0; - this._disableBlockhashCaching = false; - this._pollingBlockhash = false; - this._blockhashInfo = { - latestBlockhash: null, - lastFetch: 0, - transactionSignatures: [], - simulatedSignatures: [] - }; - this._nextClientSubscriptionId = 0; - this._subscriptionDisposeFunctionsByClientSubscriptionId = {}; - this._subscriptionHashByClientSubscriptionId = {}; - this._subscriptionStateChangeCallbacksByHash = {}; - this._subscriptionCallbacksByServerSubscriptionId = {}; - this._subscriptionsByHash = {}; - this._subscriptionsAutoDisposedByRpc = /* @__PURE__ */ new Set(); - this.getBlockHeight = /* @__PURE__ */ (() => { - const requestPromises = {}; - return async (commitmentOrConfig) => { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config); - const requestHash = fastStableStringify(args); - requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => { - try { - const unsafeRes = await this._rpcRequest("getBlockHeight", args); - const res = create(unsafeRes, jsonRpcResult(number())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get block height information"); - } - return res.result; - } finally { - delete requestPromises[requestHash]; - } - })(); - return await requestPromises[requestHash]; - }; - })(); - let wsEndpoint; - let httpHeaders; - let fetch3; - let fetchMiddleware; - let disableRetryOnRateLimit; - let httpAgent; - if (_commitmentOrConfig && typeof _commitmentOrConfig === "string") { - this._commitment = _commitmentOrConfig; - } else if (_commitmentOrConfig) { - this._commitment = _commitmentOrConfig.commitment; - this._confirmTransactionInitialTimeout = _commitmentOrConfig.confirmTransactionInitialTimeout; - wsEndpoint = _commitmentOrConfig.wsEndpoint; - httpHeaders = _commitmentOrConfig.httpHeaders; - fetch3 = _commitmentOrConfig.fetch; - fetchMiddleware = _commitmentOrConfig.fetchMiddleware; - disableRetryOnRateLimit = _commitmentOrConfig.disableRetryOnRateLimit; - httpAgent = _commitmentOrConfig.httpAgent; - } - this._rpcEndpoint = assertEndpointUrl(endpoint2); - this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint2); - this._rpcClient = createRpcClient(endpoint2, httpHeaders, fetch3, fetchMiddleware, disableRetryOnRateLimit, httpAgent); - this._rpcRequest = createRpcRequest(this._rpcClient); - this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient); - this._rpcWebSocket = new RpcWebSocketClient(this._rpcWsEndpoint, { - autoconnect: false, - max_reconnects: Infinity - }); - this._rpcWebSocket.on("open", this._wsOnOpen.bind(this)); - this._rpcWebSocket.on("error", this._wsOnError.bind(this)); - this._rpcWebSocket.on("close", this._wsOnClose.bind(this)); - this._rpcWebSocket.on("accountNotification", this._wsOnAccountNotification.bind(this)); - this._rpcWebSocket.on("programNotification", this._wsOnProgramAccountNotification.bind(this)); - this._rpcWebSocket.on("slotNotification", this._wsOnSlotNotification.bind(this)); - this._rpcWebSocket.on("slotsUpdatesNotification", this._wsOnSlotUpdatesNotification.bind(this)); - this._rpcWebSocket.on("signatureNotification", this._wsOnSignatureNotification.bind(this)); - this._rpcWebSocket.on("rootNotification", this._wsOnRootNotification.bind(this)); - this._rpcWebSocket.on("logsNotification", this._wsOnLogsNotification.bind(this)); - } - /** - * The default commitment used for requests - */ - get commitment() { - return this._commitment; - } - /** - * The RPC endpoint - */ - get rpcEndpoint() { - return this._rpcEndpoint; - } - /** - * Fetch the balance for the specified public key, return with context - */ - async getBalanceAndContext(publicKey2, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getBalance", args); - const res = create(unsafeRes, jsonRpcResultAndContext(number())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get balance for ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch the balance for the specified public key - */ - async getBalance(publicKey2, commitmentOrConfig) { - return await this.getBalanceAndContext(publicKey2, commitmentOrConfig).then((x) => x.value).catch((e) => { - throw new Error("failed to get balance of account " + publicKey2.toBase58() + ": " + e); - }); - } - /** - * Fetch the estimated production time of a block - */ - async getBlockTime(slot) { - const unsafeRes = await this._rpcRequest("getBlockTime", [slot]); - const res = create(unsafeRes, jsonRpcResult(nullable(number()))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get block time for slot ${slot}`); - } - return res.result; - } - /** - * Fetch the lowest slot that the node has information about in its ledger. - * This value may increase over time if the node is configured to purge older ledger data - */ - async getMinimumLedgerSlot() { - const unsafeRes = await this._rpcRequest("minimumLedgerSlot", []); - const res = create(unsafeRes, jsonRpcResult(number())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get minimum ledger slot"); - } - return res.result; - } - /** - * Fetch the slot of the lowest confirmed block that has not been purged from the ledger - */ - async getFirstAvailableBlock() { - const unsafeRes = await this._rpcRequest("getFirstAvailableBlock", []); - const res = create(unsafeRes, SlotRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get first available block"); - } - return res.result; - } - /** - * Fetch information about the current supply - */ - async getSupply(config) { - let configArg = {}; - if (typeof config === "string") { - configArg = { - commitment: config - }; - } else if (config) { - configArg = { - ...config, - commitment: config && config.commitment || this.commitment - }; - } else { - configArg = { - commitment: this.commitment - }; - } - const unsafeRes = await this._rpcRequest("getSupply", [configArg]); - const res = create(unsafeRes, GetSupplyRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get supply"); - } - return res.result; - } - /** - * Fetch the current supply of a token mint - */ - async getTokenSupply(tokenMintAddress, commitment) { - const args = this._buildArgs([tokenMintAddress.toBase58()], commitment); - const unsafeRes = await this._rpcRequest("getTokenSupply", args); - const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get token supply"); - } - return res.result; - } - /** - * Fetch the current balance of a token account - */ - async getTokenAccountBalance(tokenAddress, commitment) { - const args = this._buildArgs([tokenAddress.toBase58()], commitment); - const unsafeRes = await this._rpcRequest("getTokenAccountBalance", args); - const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get token account balance"); - } - return res.result; - } - /** - * Fetch all the token accounts owned by the specified account - * - * @return {Promise} - */ - async getTokenAccountsByOwner(ownerAddress, filter, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - let _args = [ownerAddress.toBase58()]; - if ("mint" in filter) { - _args.push({ - mint: filter.mint.toBase58() - }); - } else { - _args.push({ - programId: filter.programId.toBase58() - }); - } - const args = this._buildArgs(_args, commitment, "base64", config); - const unsafeRes = await this._rpcRequest("getTokenAccountsByOwner", args); - const res = create(unsafeRes, GetTokenAccountsByOwner); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`); - } - return res.result; - } - /** - * Fetch parsed token accounts owned by the specified account - * - * @return {Promise}>>>} - */ - async getParsedTokenAccountsByOwner(ownerAddress, filter, commitment) { - let _args = [ownerAddress.toBase58()]; - if ("mint" in filter) { - _args.push({ - mint: filter.mint.toBase58() - }); - } else { - _args.push({ - programId: filter.programId.toBase58() - }); - } - const args = this._buildArgs(_args, commitment, "jsonParsed"); - const unsafeRes = await this._rpcRequest("getTokenAccountsByOwner", args); - const res = create(unsafeRes, GetParsedTokenAccountsByOwner); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`); - } - return res.result; - } - /** - * Fetch the 20 largest accounts with their current balances - */ - async getLargestAccounts(config) { - const arg = { - ...config, - commitment: config && config.commitment || this.commitment - }; - const args = arg.filter || arg.commitment ? [arg] : []; - const unsafeRes = await this._rpcRequest("getLargestAccounts", args); - const res = create(unsafeRes, GetLargestAccountsRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get largest accounts"); - } - return res.result; - } - /** - * Fetch the 20 largest token accounts with their current balances - * for a given mint. - */ - async getTokenLargestAccounts(mintAddress, commitment) { - const args = this._buildArgs([mintAddress.toBase58()], commitment); - const unsafeRes = await this._rpcRequest("getTokenLargestAccounts", args); - const res = create(unsafeRes, GetTokenLargestAccountsResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get token largest accounts"); - } - return res.result; - } - /** - * Fetch all the account info for the specified public key, return with context - */ - async getAccountInfoAndContext(publicKey2, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, "base64", config); - const unsafeRes = await this._rpcRequest("getAccountInfo", args); - const res = create(unsafeRes, jsonRpcResultAndContext(nullable(AccountInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch parsed account info for the specified public key - */ - async getParsedAccountInfo(publicKey2, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, "jsonParsed", config); - const unsafeRes = await this._rpcRequest("getAccountInfo", args); - const res = create(unsafeRes, jsonRpcResultAndContext(nullable(ParsedAccountInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch all the account info for the specified public key - */ - async getAccountInfo(publicKey2, commitmentOrConfig) { - try { - const res = await this.getAccountInfoAndContext(publicKey2, commitmentOrConfig); - return res.value; - } catch (e) { - throw new Error("failed to get info about account " + publicKey2.toBase58() + ": " + e); - } - } - /** - * Fetch all the account info for multiple accounts specified by an array of public keys, return with context - */ - async getMultipleParsedAccounts(publicKeys, rawConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(rawConfig); - const keys = publicKeys.map((key) => key.toBase58()); - const args = this._buildArgs([keys], commitment, "jsonParsed", config); - const unsafeRes = await this._rpcRequest("getMultipleAccounts", args); - const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult)))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`); - } - return res.result; - } - /** - * Fetch all the account info for multiple accounts specified by an array of public keys, return with context - */ - async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const keys = publicKeys.map((key) => key.toBase58()); - const args = this._buildArgs([keys], commitment, "base64", config); - const unsafeRes = await this._rpcRequest("getMultipleAccounts", args); - const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult)))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`); - } - return res.result; - } - /** - * Fetch all the account info for multiple accounts specified by an array of public keys - */ - async getMultipleAccountsInfo(publicKeys, commitmentOrConfig) { - const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig); - return res.value; - } - /** - * Returns epoch activation information for a stake account that has been delegated - * - * @deprecated Deprecated since RPC v1.18; will be removed in a future version. - */ - async getStakeActivation(publicKey2, commitmentOrConfig, epoch) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([publicKey2.toBase58()], commitment, void 0, { - ...config, - epoch: epoch != null ? epoch : config?.epoch - }); - const unsafeRes = await this._rpcRequest("getStakeActivation", args); - const res = create(unsafeRes, jsonRpcResult(StakeActivationResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get Stake Activation ${publicKey2.toBase58()}`); - } - return res.result; - } - /** - * Fetch all the accounts owned by the specified program id - * - * @return {Promise}>>} - */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - async getProgramAccounts(programId, configOrCommitment) { - const { - commitment, - config - } = extractCommitmentFromConfig(configOrCommitment); - const { - encoding, - ...configWithoutEncoding - } = config || {}; - const args = this._buildArgs([programId.toBase58()], commitment, encoding || "base64", { - ...configWithoutEncoding, - ...configWithoutEncoding.filters ? { - filters: applyDefaultMemcmpEncodingToFilters(configWithoutEncoding.filters) - } : null - }); - const unsafeRes = await this._rpcRequest("getProgramAccounts", args); - const baseSchema = array(KeyedAccountInfoResult); - const res = configWithoutEncoding.withContext === true ? create(unsafeRes, jsonRpcResultAndContext(baseSchema)) : create(unsafeRes, jsonRpcResult(baseSchema)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`); - } - return res.result; - } - /** - * Fetch and parse all the accounts owned by the specified program id - * - * @return {Promise}>>} - */ - async getParsedProgramAccounts(programId, configOrCommitment) { - const { - commitment, - config - } = extractCommitmentFromConfig(configOrCommitment); - const args = this._buildArgs([programId.toBase58()], commitment, "jsonParsed", config); - const unsafeRes = await this._rpcRequest("getProgramAccounts", args); - const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`); - } - return res.result; - } - /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - async confirmTransaction(strategy, commitment) { - let rawSignature; - if (typeof strategy == "string") { - rawSignature = strategy; - } else { - const config = strategy; - if (config.abortSignal?.aborted) { - return Promise.reject(config.abortSignal.reason); - } - rawSignature = config.signature; - } - let decodedSignature; - try { - decodedSignature = import_bs58.default.decode(rawSignature); - } catch (err) { - throw new Error("signature must be base58 encoded: " + rawSignature); - } - assert2(decodedSignature.length === 64, "signature has invalid length"); - if (typeof strategy === "string") { - return await this.confirmTransactionUsingLegacyTimeoutStrategy({ - commitment: commitment || this.commitment, - signature: rawSignature - }); - } else if ("lastValidBlockHeight" in strategy) { - return await this.confirmTransactionUsingBlockHeightExceedanceStrategy({ - commitment: commitment || this.commitment, - strategy - }); - } else { - return await this.confirmTransactionUsingDurableNonceStrategy({ - commitment: commitment || this.commitment, - strategy - }); - } - } - getCancellationPromise(signal) { - return new Promise((_, reject) => { - if (signal == null) { - return; - } - if (signal.aborted) { - reject(signal.reason); - } else { - signal.addEventListener("abort", () => { - reject(signal.reason); - }); - } - }); - } - getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }) { - let signatureSubscriptionId; - let disposeSignatureSubscriptionStateChangeObserver; - let done = false; - const confirmationPromise = new Promise((resolve, reject) => { - try { - signatureSubscriptionId = this.onSignature(signature2, (result, context) => { - signatureSubscriptionId = void 0; - const response = { - context, - value: result - }; - resolve({ - __type: TransactionStatus.PROCESSED, - response - }); - }, commitment); - const subscriptionSetupPromise = new Promise((resolveSubscriptionSetup) => { - if (signatureSubscriptionId == null) { - resolveSubscriptionSetup(); - } else { - disposeSignatureSubscriptionStateChangeObserver = this._onSubscriptionStateChange(signatureSubscriptionId, (nextState) => { - if (nextState === "subscribed") { - resolveSubscriptionSetup(); - } - }); - } - }); - (async () => { - await subscriptionSetupPromise; - if (done) - return; - const response = await this.getSignatureStatus(signature2); - if (done) - return; - if (response == null) { - return; - } - const { - context, - value - } = response; - if (value == null) { - return; - } - if (value?.err) { - reject(value.err); - } else { - switch (commitment) { - case "confirmed": - case "single": - case "singleGossip": { - if (value.confirmationStatus === "processed") { - return; - } - break; - } - case "finalized": - case "max": - case "root": { - if (value.confirmationStatus === "processed" || value.confirmationStatus === "confirmed") { - return; - } - break; - } - case "processed": - case "recent": - } - done = true; - resolve({ - __type: TransactionStatus.PROCESSED, - response: { - context, - value - } - }); - } - })(); - } catch (err) { - reject(err); - } - }); - const abortConfirmation = () => { - if (disposeSignatureSubscriptionStateChangeObserver) { - disposeSignatureSubscriptionStateChangeObserver(); - disposeSignatureSubscriptionStateChangeObserver = void 0; - } - if (signatureSubscriptionId != null) { - this.removeSignatureListener(signatureSubscriptionId); - signatureSubscriptionId = void 0; - } - }; - return { - abortConfirmation, - confirmationPromise - }; - } - async confirmTransactionUsingBlockHeightExceedanceStrategy({ - commitment, - strategy: { - abortSignal, - lastValidBlockHeight, - signature: signature2 - } - }) { - let done = false; - const expiryPromise = new Promise((resolve) => { - const checkBlockHeight = async () => { - try { - const blockHeight = await this.getBlockHeight(commitment); - return blockHeight; - } catch (_e) { - return -1; - } - }; - (async () => { - let currentBlockHeight = await checkBlockHeight(); - if (done) - return; - while (currentBlockHeight <= lastValidBlockHeight) { - await sleep(1e3); - if (done) - return; - currentBlockHeight = await checkBlockHeight(); - if (done) - return; - } - resolve({ - __type: TransactionStatus.BLOCKHEIGHT_EXCEEDED - }); - })(); - }); - const { - abortConfirmation, - confirmationPromise - } = this.getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }); - const cancellationPromise = this.getCancellationPromise(abortSignal); - let result; - try { - const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]); - if (outcome.__type === TransactionStatus.PROCESSED) { - result = outcome.response; - } else { - throw new TransactionExpiredBlockheightExceededError(signature2); - } - } finally { - done = true; - abortConfirmation(); - } - return result; - } - async confirmTransactionUsingDurableNonceStrategy({ - commitment, - strategy: { - abortSignal, - minContextSlot, - nonceAccountPubkey, - nonceValue, - signature: signature2 - } - }) { - let done = false; - const expiryPromise = new Promise((resolve) => { - let currentNonceValue = nonceValue; - let lastCheckedSlot = null; - const getCurrentNonceValue = async () => { - try { - const { - context, - value: nonceAccount - } = await this.getNonceAndContext(nonceAccountPubkey, { - commitment, - minContextSlot - }); - lastCheckedSlot = context.slot; - return nonceAccount?.nonce; - } catch (e) { - return currentNonceValue; - } - }; - (async () => { - currentNonceValue = await getCurrentNonceValue(); - if (done) - return; - while (true) { - if (nonceValue !== currentNonceValue) { - resolve({ - __type: TransactionStatus.NONCE_INVALID, - slotInWhichNonceDidAdvance: lastCheckedSlot - }); - return; - } - await sleep(2e3); - if (done) - return; - currentNonceValue = await getCurrentNonceValue(); - if (done) - return; - } - })(); - }); - const { - abortConfirmation, - confirmationPromise - } = this.getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }); - const cancellationPromise = this.getCancellationPromise(abortSignal); - let result; - try { - const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]); - if (outcome.__type === TransactionStatus.PROCESSED) { - result = outcome.response; - } else { - let signatureStatus; - while (true) { - const status = await this.getSignatureStatus(signature2); - if (status == null) { - break; - } - if (status.context.slot < (outcome.slotInWhichNonceDidAdvance ?? minContextSlot)) { - await sleep(400); - continue; - } - signatureStatus = status; - break; - } - if (signatureStatus?.value) { - const commitmentForStatus = commitment || "finalized"; - const { - confirmationStatus - } = signatureStatus.value; - switch (commitmentForStatus) { - case "processed": - case "recent": - if (confirmationStatus !== "processed" && confirmationStatus !== "confirmed" && confirmationStatus !== "finalized") { - throw new TransactionExpiredNonceInvalidError(signature2); - } - break; - case "confirmed": - case "single": - case "singleGossip": - if (confirmationStatus !== "confirmed" && confirmationStatus !== "finalized") { - throw new TransactionExpiredNonceInvalidError(signature2); - } - break; - case "finalized": - case "max": - case "root": - if (confirmationStatus !== "finalized") { - throw new TransactionExpiredNonceInvalidError(signature2); - } - break; - default: - /* @__PURE__ */ ((_) => { - })(commitmentForStatus); - } - result = { - context: signatureStatus.context, - value: { - err: signatureStatus.value.err - } - }; - } else { - throw new TransactionExpiredNonceInvalidError(signature2); - } - } - } finally { - done = true; - abortConfirmation(); - } - return result; - } - async confirmTransactionUsingLegacyTimeoutStrategy({ - commitment, - signature: signature2 - }) { - let timeoutId; - const expiryPromise = new Promise((resolve) => { - let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1e3; - switch (commitment) { - case "processed": - case "recent": - case "single": - case "confirmed": - case "singleGossip": { - timeoutMs = this._confirmTransactionInitialTimeout || 30 * 1e3; - break; - } - } - timeoutId = setTimeout(() => resolve({ - __type: TransactionStatus.TIMED_OUT, - timeoutMs - }), timeoutMs); - }); - const { - abortConfirmation, - confirmationPromise - } = this.getTransactionConfirmationPromise({ - commitment, - signature: signature2 - }); - let result; - try { - const outcome = await Promise.race([confirmationPromise, expiryPromise]); - if (outcome.__type === TransactionStatus.PROCESSED) { - result = outcome.response; - } else { - throw new TransactionExpiredTimeoutError(signature2, outcome.timeoutMs / 1e3); - } - } finally { - clearTimeout(timeoutId); - abortConfirmation(); - } - return result; - } - /** - * Return the list of nodes that are currently participating in the cluster - */ - async getClusterNodes() { - const unsafeRes = await this._rpcRequest("getClusterNodes", []); - const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get cluster nodes"); - } - return res.result; - } - /** - * Return the list of nodes that are currently participating in the cluster - */ - async getVoteAccounts(commitment) { - const args = this._buildArgs([], commitment); - const unsafeRes = await this._rpcRequest("getVoteAccounts", args); - const res = create(unsafeRes, GetVoteAccounts); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get vote accounts"); - } - return res.result; - } - /** - * Fetch the current slot that the node is processing - */ - async getSlot(commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getSlot", args); - const res = create(unsafeRes, jsonRpcResult(number())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get slot"); - } - return res.result; - } - /** - * Fetch the current slot leader of the cluster - */ - async getSlotLeader(commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getSlotLeader", args); - const res = create(unsafeRes, jsonRpcResult(string())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get slot leader"); - } - return res.result; - } - /** - * Fetch `limit` number of slot leaders starting from `startSlot` - * - * @param startSlot fetch slot leaders starting from this slot - * @param limit number of slot leaders to return - */ - async getSlotLeaders(startSlot, limit) { - const args = [startSlot, limit]; - const unsafeRes = await this._rpcRequest("getSlotLeaders", args); - const res = create(unsafeRes, jsonRpcResult(array(PublicKeyFromString))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get slot leaders"); - } - return res.result; - } - /** - * Fetch the current status of a signature - */ - async getSignatureStatus(signature2, config) { - const { - context, - value: values - } = await this.getSignatureStatuses([signature2], config); - assert2(values.length === 1); - const value = values[0]; - return { - context, - value - }; - } - /** - * Fetch the current statuses of a batch of signatures - */ - async getSignatureStatuses(signatures, config) { - const params = [signatures]; - if (config) { - params.push(config); - } - const unsafeRes = await this._rpcRequest("getSignatureStatuses", params); - const res = create(unsafeRes, GetSignatureStatusesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get signature status"); - } - return res.result; - } - /** - * Fetch the current transaction count of the cluster - */ - async getTransactionCount(commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getTransactionCount", args); - const res = create(unsafeRes, jsonRpcResult(number())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction count"); - } - return res.result; - } - /** - * Fetch the current total currency supply of the cluster in lamports - * - * @deprecated Deprecated since RPC v1.2.8. Please use {@link getSupply} instead. - */ - async getTotalSupply(commitment) { - const result = await this.getSupply({ - commitment, - excludeNonCirculatingAccountsList: true - }); - return result.value.total; - } - /** - * Fetch the cluster InflationGovernor parameters - */ - async getInflationGovernor(commitment) { - const args = this._buildArgs([], commitment); - const unsafeRes = await this._rpcRequest("getInflationGovernor", args); - const res = create(unsafeRes, GetInflationGovernorRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get inflation"); - } - return res.result; - } - /** - * Fetch the inflation reward for a list of addresses for an epoch - */ - async getInflationReward(addresses, epoch, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([addresses.map((pubkey) => pubkey.toBase58())], commitment, void 0, { - ...config, - epoch: epoch != null ? epoch : config?.epoch - }); - const unsafeRes = await this._rpcRequest("getInflationReward", args); - const res = create(unsafeRes, GetInflationRewardResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get inflation reward"); - } - return res.result; - } - /** - * Fetch the specific inflation values for the current epoch - */ - async getInflationRate() { - const unsafeRes = await this._rpcRequest("getInflationRate", []); - const res = create(unsafeRes, GetInflationRateRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get inflation rate"); - } - return res.result; - } - /** - * Fetch the Epoch Info parameters - */ - async getEpochInfo(commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getEpochInfo", args); - const res = create(unsafeRes, GetEpochInfoRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get epoch info"); - } - return res.result; - } - /** - * Fetch the Epoch Schedule parameters - */ - async getEpochSchedule() { - const unsafeRes = await this._rpcRequest("getEpochSchedule", []); - const res = create(unsafeRes, GetEpochScheduleRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get epoch schedule"); - } - const epochSchedule = res.result; - return new EpochSchedule(epochSchedule.slotsPerEpoch, epochSchedule.leaderScheduleSlotOffset, epochSchedule.warmup, epochSchedule.firstNormalEpoch, epochSchedule.firstNormalSlot); - } - /** - * Fetch the leader schedule for the current epoch - * @return {Promise>} - */ - async getLeaderSchedule() { - const unsafeRes = await this._rpcRequest("getLeaderSchedule", []); - const res = create(unsafeRes, GetLeaderScheduleRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get leader schedule"); - } - return res.result; - } - /** - * Fetch the minimum balance needed to exempt an account of `dataLength` - * size from rent - */ - async getMinimumBalanceForRentExemption(dataLength, commitment) { - const args = this._buildArgs([dataLength], commitment); - const unsafeRes = await this._rpcRequest("getMinimumBalanceForRentExemption", args); - const res = create(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult); - if ("error" in res) { - console.warn("Unable to fetch minimum balance for rent exemption"); - return 0; - } - return res.result; - } - /** - * Fetch a recent blockhash from the cluster, return with context - * @return {Promise>} - * - * @deprecated Deprecated since RPC v1.9.0. Please use {@link getLatestBlockhash} instead. - */ - async getRecentBlockhashAndContext(commitment) { - const { - context, - value: { - blockhash - } - } = await this.getLatestBlockhashAndContext(commitment); - const feeCalculator = { - get lamportsPerSignature() { - throw new Error("The capability to fetch `lamportsPerSignature` using the `getRecentBlockhash` API is no longer offered by the network. Use the `getFeeForMessage` API to obtain the fee for a given message."); - }, - toJSON() { - return {}; - } - }; - return { - context, - value: { - blockhash, - feeCalculator - } - }; - } - /** - * Fetch recent performance samples - * @return {Promise>} - */ - async getRecentPerformanceSamples(limit) { - const unsafeRes = await this._rpcRequest("getRecentPerformanceSamples", limit ? [limit] : []); - const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get recent performance samples"); - } - return res.result; - } - /** - * Fetch the fee calculator for a recent blockhash from the cluster, return with context - * - * @deprecated Deprecated since RPC v1.9.0. Please use {@link getFeeForMessage} instead. - */ - async getFeeCalculatorForBlockhash(blockhash, commitment) { - const args = this._buildArgs([blockhash], commitment); - const unsafeRes = await this._rpcRequest("getFeeCalculatorForBlockhash", args); - const res = create(unsafeRes, GetFeeCalculatorRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get fee calculator"); - } - const { - context, - value - } = res.result; - return { - context, - value: value !== null ? value.feeCalculator : null - }; - } - /** - * Fetch the fee for a message from the cluster, return with context - */ - async getFeeForMessage(message, commitment) { - const wireMessage = toBuffer(message.serialize()).toString("base64"); - const args = this._buildArgs([wireMessage], commitment); - const unsafeRes = await this._rpcRequest("getFeeForMessage", args); - const res = create(unsafeRes, jsonRpcResultAndContext(nullable(number()))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get fee for message"); - } - if (res.result === null) { - throw new Error("invalid blockhash"); - } - return res.result; - } - /** - * Fetch a list of prioritization fees from recent blocks. - */ - async getRecentPrioritizationFees(config) { - const accounts = config?.lockedWritableAccounts?.map((key) => key.toBase58()); - const args = accounts?.length ? [accounts] : []; - const unsafeRes = await this._rpcRequest("getRecentPrioritizationFees", args); - const res = create(unsafeRes, GetRecentPrioritizationFeesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get recent prioritization fees"); - } - return res.result; - } - /** - * Fetch a recent blockhash from the cluster - * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>} - * - * @deprecated Deprecated since RPC v1.8.0. Please use {@link getLatestBlockhash} instead. - */ - async getRecentBlockhash(commitment) { - try { - const res = await this.getRecentBlockhashAndContext(commitment); - return res.value; - } catch (e) { - throw new Error("failed to get recent blockhash: " + e); - } - } - /** - * Fetch the latest blockhash from the cluster - * @return {Promise} - */ - async getLatestBlockhash(commitmentOrConfig) { - try { - const res = await this.getLatestBlockhashAndContext(commitmentOrConfig); - return res.value; - } catch (e) { - throw new Error("failed to get recent blockhash: " + e); - } - } - /** - * Fetch the latest blockhash from the cluster - * @return {Promise} - */ - async getLatestBlockhashAndContext(commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs([], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getLatestBlockhash", args); - const res = create(unsafeRes, GetLatestBlockhashRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get latest blockhash"); - } - return res.result; - } - /** - * Returns whether a blockhash is still valid or not - */ - async isBlockhashValid(blockhash, rawConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgs([blockhash], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("isBlockhashValid", args); - const res = create(unsafeRes, IsBlockhashValidRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to determine if the blockhash `" + blockhash + "`is valid"); - } - return res.result; - } - /** - * Fetch the node version - */ - async getVersion() { - const unsafeRes = await this._rpcRequest("getVersion", []); - const res = create(unsafeRes, jsonRpcResult(VersionResult)); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get version"); - } - return res.result; - } - /** - * Fetch the genesis hash - */ - async getGenesisHash() { - const unsafeRes = await this._rpcRequest("getGenesisHash", []); - const res = create(unsafeRes, jsonRpcResult(string())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get genesis hash"); - } - return res.result; - } - /** - * Fetch a processed block from the cluster. - * - * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by - * setting the `maxSupportedTransactionVersion` property. - */ - /** - * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by - * setting the `maxSupportedTransactionVersion` property. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by - * setting the `maxSupportedTransactionVersion` property. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch a processed block from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch a processed block from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - async getBlock(slot, rawConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getBlock", args); - try { - switch (config?.transactionDetails) { - case "accounts": { - const res = create(unsafeRes, GetAccountsModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - case "none": { - const res = create(unsafeRes, GetNoneModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - default: { - const res = create(unsafeRes, GetBlockRpcResult); - if ("error" in res) { - throw res.error; - } - const { - result - } = res; - return result ? { - ...result, - transactions: result.transactions.map(({ - transaction, - meta, - version: version2 - }) => ({ - meta, - transaction: { - ...transaction, - message: versionedMessageFromResponse(version2, transaction.message) - }, - version: version2 - })) - } : null; - } - } - } catch (e) { - throw new SolanaJSONRPCError(e, "failed to get confirmed block"); - } - } - /** - * Fetch parsed transaction details for a confirmed or finalized block - */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - async getParsedBlock(slot, rawConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgsAtLeastConfirmed([slot], commitment, "jsonParsed", config); - const unsafeRes = await this._rpcRequest("getBlock", args); - try { - switch (config?.transactionDetails) { - case "accounts": { - const res = create(unsafeRes, GetParsedAccountsModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - case "none": { - const res = create(unsafeRes, GetParsedNoneModeBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - default: { - const res = create(unsafeRes, GetParsedBlockRpcResult); - if ("error" in res) { - throw res.error; - } - return res.result; - } - } - } catch (e) { - throw new SolanaJSONRPCError(e, "failed to get block"); - } - } - /* - * Returns recent block production information from the current or previous epoch - */ - async getBlockProduction(configOrCommitment) { - let extra; - let commitment; - if (typeof configOrCommitment === "string") { - commitment = configOrCommitment; - } else if (configOrCommitment) { - const { - commitment: c, - ...rest - } = configOrCommitment; - commitment = c; - extra = rest; - } - const args = this._buildArgs([], commitment, "base64", extra); - const unsafeRes = await this._rpcRequest("getBlockProduction", args); - const res = create(unsafeRes, BlockProductionResponseStruct); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get block production information"); - } - return res.result; - } - /** - * Fetch a confirmed or finalized transaction from the cluster. - * - * @deprecated Instead, call `getTransaction` using a - * `GetVersionedTransactionConfig` by setting the - * `maxSupportedTransactionVersion` property. - */ - /** - * Fetch a confirmed or finalized transaction from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch a confirmed or finalized transaction from the cluster. - */ - // eslint-disable-next-line no-dupe-class-members - async getTransaction(signature2, rawConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(rawConfig); - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, void 0, config); - const unsafeRes = await this._rpcRequest("getTransaction", args); - const res = create(unsafeRes, GetTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction"); - } - const result = res.result; - if (!result) - return result; - return { - ...result, - transaction: { - ...result.transaction, - message: versionedMessageFromResponse(result.version, result.transaction.message) - } - }; - } - /** - * Fetch parsed transaction details for a confirmed or finalized transaction - */ - async getParsedTransaction(signature2, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed", config); - const unsafeRes = await this._rpcRequest("getTransaction", args); - const res = create(unsafeRes, GetParsedTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction"); - } - return res.result; - } - /** - * Fetch parsed transaction details for a batch of confirmed transactions - */ - async getParsedTransactions(signatures, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const batch = signatures.map((signature2) => { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed", config); - return { - methodName: "getTransaction", - args - }; - }); - const unsafeRes = await this._rpcBatchRequest(batch); - const res = unsafeRes.map((unsafeRes2) => { - const res2 = create(unsafeRes2, GetParsedTransactionRpcResult); - if ("error" in res2) { - throw new SolanaJSONRPCError(res2.error, "failed to get transactions"); - } - return res2.result; - }); - return res; - } - /** - * Fetch transaction details for a batch of confirmed transactions. - * Similar to {@link getParsedTransactions} but returns a {@link TransactionResponse}. - * - * @deprecated Instead, call `getTransactions` using a - * `GetVersionedTransactionConfig` by setting the - * `maxSupportedTransactionVersion` property. - */ - /** - * Fetch transaction details for a batch of confirmed transactions. - * Similar to {@link getParsedTransactions} but returns a {@link - * VersionedTransactionResponse}. - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Fetch transaction details for a batch of confirmed transactions. - * Similar to {@link getParsedTransactions} but returns a {@link - * VersionedTransactionResponse}. - */ - // eslint-disable-next-line no-dupe-class-members - async getTransactions(signatures, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const batch = signatures.map((signature2) => { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, void 0, config); - return { - methodName: "getTransaction", - args - }; - }); - const unsafeRes = await this._rpcBatchRequest(batch); - const res = unsafeRes.map((unsafeRes2) => { - const res2 = create(unsafeRes2, GetTransactionRpcResult); - if ("error" in res2) { - throw new SolanaJSONRPCError(res2.error, "failed to get transactions"); - } - const result = res2.result; - if (!result) - return result; - return { - ...result, - transaction: { - ...result.transaction, - message: versionedMessageFromResponse(result.version, result.transaction.message) - } - }; - }); - return res; - } - /** - * Fetch a list of Transactions and transaction statuses from the cluster - * for a confirmed block. - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlock} instead. - */ - async getConfirmedBlock(slot, commitment) { - const args = this._buildArgsAtLeastConfirmed([slot], commitment); - const unsafeRes = await this._rpcRequest("getBlock", args); - const res = create(unsafeRes, GetConfirmedBlockRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed block"); - } - const result = res.result; - if (!result) { - throw new Error("Confirmed block " + slot + " not found"); - } - const block = { - ...result, - transactions: result.transactions.map(({ - transaction, - meta - }) => { - const message = new Message(transaction.message); - return { - meta, - transaction: { - ...transaction, - message - } - }; - }) - }; - return { - ...block, - transactions: block.transactions.map(({ - transaction, - meta - }) => { - return { - meta, - transaction: Transaction.populate(transaction.message, transaction.signatures) - }; - }) - }; - } - /** - * Fetch confirmed blocks between two slots - */ - async getBlocks(startSlot, endSlot, commitment) { - const args = this._buildArgsAtLeastConfirmed(endSlot !== void 0 ? [startSlot, endSlot] : [startSlot], commitment); - const unsafeRes = await this._rpcRequest("getBlocks", args); - const res = create(unsafeRes, jsonRpcResult(array(number()))); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get blocks"); - } - return res.result; - } - /** - * Fetch a list of Signatures from the cluster for a block, excluding rewards - */ - async getBlockSignatures(slot, commitment) { - const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, { - transactionDetails: "signatures", - rewards: false - }); - const unsafeRes = await this._rpcRequest("getBlock", args); - const res = create(unsafeRes, GetBlockSignaturesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get block"); - } - const result = res.result; - if (!result) { - throw new Error("Block " + slot + " not found"); - } - return result; - } - /** - * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getBlockSignatures} instead. - */ - async getConfirmedBlockSignatures(slot, commitment) { - const args = this._buildArgsAtLeastConfirmed([slot], commitment, void 0, { - transactionDetails: "signatures", - rewards: false - }); - const unsafeRes = await this._rpcRequest("getBlock", args); - const res = create(unsafeRes, GetBlockSignaturesRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed block"); - } - const result = res.result; - if (!result) { - throw new Error("Confirmed block " + slot + " not found"); - } - return result; - } - /** - * Fetch a transaction details for a confirmed transaction - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getTransaction} instead. - */ - async getConfirmedTransaction(signature2, commitment) { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment); - const unsafeRes = await this._rpcRequest("getTransaction", args); - const res = create(unsafeRes, GetTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get transaction"); - } - const result = res.result; - if (!result) - return result; - const message = new Message(result.transaction.message); - const signatures = result.transaction.signatures; - return { - ...result, - transaction: Transaction.populate(message, signatures) - }; - } - /** - * Fetch parsed transaction details for a confirmed transaction - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransaction} instead. - */ - async getParsedConfirmedTransaction(signature2, commitment) { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed"); - const unsafeRes = await this._rpcRequest("getTransaction", args); - const res = create(unsafeRes, GetParsedTransactionRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed transaction"); - } - return res.result; - } - /** - * Fetch parsed transaction details for a batch of confirmed transactions - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getParsedTransactions} instead. - */ - async getParsedConfirmedTransactions(signatures, commitment) { - const batch = signatures.map((signature2) => { - const args = this._buildArgsAtLeastConfirmed([signature2], commitment, "jsonParsed"); - return { - methodName: "getTransaction", - args - }; - }); - const unsafeRes = await this._rpcBatchRequest(batch); - const res = unsafeRes.map((unsafeRes2) => { - const res2 = create(unsafeRes2, GetParsedTransactionRpcResult); - if ("error" in res2) { - throw new SolanaJSONRPCError(res2.error, "failed to get confirmed transactions"); - } - return res2.result; - }); - return res; - } - /** - * Fetch a list of all the confirmed signatures for transactions involving an address - * within a specified slot range. Max range allowed is 10,000 slots. - * - * @deprecated Deprecated since RPC v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead. - * - * @param address queried address - * @param startSlot start slot, inclusive - * @param endSlot end slot, inclusive - */ - async getConfirmedSignaturesForAddress(address, startSlot, endSlot) { - let options = {}; - let firstAvailableBlock = await this.getFirstAvailableBlock(); - while (!("until" in options)) { - startSlot--; - if (startSlot <= 0 || startSlot < firstAvailableBlock) { - break; - } - try { - const block = await this.getConfirmedBlockSignatures(startSlot, "finalized"); - if (block.signatures.length > 0) { - options.until = block.signatures[block.signatures.length - 1].toString(); - } - } catch (err) { - if (err instanceof Error && err.message.includes("skipped")) { - continue; - } else { - throw err; - } - } - } - let highestConfirmedRoot = await this.getSlot("finalized"); - while (!("before" in options)) { - endSlot++; - if (endSlot > highestConfirmedRoot) { - break; - } - try { - const block = await this.getConfirmedBlockSignatures(endSlot); - if (block.signatures.length > 0) { - options.before = block.signatures[block.signatures.length - 1].toString(); - } - } catch (err) { - if (err instanceof Error && err.message.includes("skipped")) { - continue; - } else { - throw err; - } - } - } - const confirmedSignatureInfo = await this.getConfirmedSignaturesForAddress2(address, options); - return confirmedSignatureInfo.map((info) => info.signature); - } - /** - * Returns confirmed signatures for transactions involving an - * address backwards in time from the provided signature or most recent confirmed block - * - * @deprecated Deprecated since RPC v1.7.0. Please use {@link getSignaturesForAddress} instead. - */ - async getConfirmedSignaturesForAddress2(address, options, commitment) { - const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, void 0, options); - const unsafeRes = await this._rpcRequest("getConfirmedSignaturesForAddress2", args); - const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get confirmed signatures for address"); - } - return res.result; - } - /** - * Returns confirmed signatures for transactions involving an - * address backwards in time from the provided signature or most recent confirmed block - * - * - * @param address queried address - * @param options - */ - async getSignaturesForAddress(address, options, commitment) { - const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, void 0, options); - const unsafeRes = await this._rpcRequest("getSignaturesForAddress", args); - const res = create(unsafeRes, GetSignaturesForAddressRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, "failed to get signatures for address"); - } - return res.result; - } - async getAddressLookupTable(accountKey, config) { - const { - context, - value: accountInfo - } = await this.getAccountInfoAndContext(accountKey, config); - let value = null; - if (accountInfo !== null) { - value = new AddressLookupTableAccount({ - key: accountKey, - state: AddressLookupTableAccount.deserialize(accountInfo.data) - }); - } - return { - context, - value - }; - } - /** - * Fetch the contents of a Nonce account from the cluster, return with context - */ - async getNonceAndContext(nonceAccount, commitmentOrConfig) { - const { - context, - value: accountInfo - } = await this.getAccountInfoAndContext(nonceAccount, commitmentOrConfig); - let value = null; - if (accountInfo !== null) { - value = NonceAccount.fromAccountData(accountInfo.data); - } - return { - context, - value - }; - } - /** - * Fetch the contents of a Nonce account from the cluster - */ - async getNonce(nonceAccount, commitmentOrConfig) { - return await this.getNonceAndContext(nonceAccount, commitmentOrConfig).then((x) => x.value).catch((e) => { - throw new Error("failed to get nonce for account " + nonceAccount.toBase58() + ": " + e); - }); - } - /** - * Request an allocation of lamports to the specified address - * - * ```typescript - * import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js"; - * - * (async () => { - * const connection = new Connection("https://api.testnet.solana.com", "confirmed"); - * const myAddress = new PublicKey("2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM"); - * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL); - * await connection.confirmTransaction(signature); - * })(); - * ``` - */ - async requestAirdrop(to, lamports) { - const unsafeRes = await this._rpcRequest("requestAirdrop", [to.toBase58(), lamports]); - const res = create(unsafeRes, RequestAirdropRpcResult); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `airdrop to ${to.toBase58()} failed`); - } - return res.result; - } - /** - * @internal - */ - async _blockhashWithExpiryBlockHeight(disableCache) { - if (!disableCache) { - while (this._pollingBlockhash) { - await sleep(100); - } - const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch; - const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS; - if (this._blockhashInfo.latestBlockhash !== null && !expired) { - return this._blockhashInfo.latestBlockhash; - } - } - return await this._pollNewBlockhash(); - } - /** - * @internal - */ - async _pollNewBlockhash() { - this._pollingBlockhash = true; - try { - const startTime = Date.now(); - const cachedLatestBlockhash = this._blockhashInfo.latestBlockhash; - const cachedBlockhash = cachedLatestBlockhash ? cachedLatestBlockhash.blockhash : null; - for (let i = 0; i < 50; i++) { - const latestBlockhash = await this.getLatestBlockhash("finalized"); - if (cachedBlockhash !== latestBlockhash.blockhash) { - this._blockhashInfo = { - latestBlockhash, - lastFetch: Date.now(), - transactionSignatures: [], - simulatedSignatures: [] - }; - return latestBlockhash; - } - await sleep(MS_PER_SLOT / 2); - } - throw new Error(`Unable to obtain a new blockhash after ${Date.now() - startTime}ms`); - } finally { - this._pollingBlockhash = false; - } - } - /** - * get the stake minimum delegation - */ - async getStakeMinimumDelegation(config) { - const { - commitment, - config: configArg - } = extractCommitmentFromConfig(config); - const args = this._buildArgs([], commitment, "base64", configArg); - const unsafeRes = await this._rpcRequest("getStakeMinimumDelegation", args); - const res = create(unsafeRes, jsonRpcResultAndContext(number())); - if ("error" in res) { - throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`); - } - return res.result; - } - /** - * Simulate a transaction - * - * @deprecated Instead, call {@link simulateTransaction} with {@link - * VersionedTransaction} and {@link SimulateTransactionConfig} parameters - */ - /** - * Simulate a transaction - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Simulate a transaction - */ - // eslint-disable-next-line no-dupe-class-members - async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) { - if ("message" in transactionOrMessage) { - const versionedTx = transactionOrMessage; - const wireTransaction2 = versionedTx.serialize(); - const encodedTransaction2 = import_buffer.Buffer.from(wireTransaction2).toString("base64"); - if (Array.isArray(configOrSigners) || includeAccounts !== void 0) { - throw new Error("Invalid arguments"); - } - const config2 = configOrSigners || {}; - config2.encoding = "base64"; - if (!("commitment" in config2)) { - config2.commitment = this.commitment; - } - if (configOrSigners && typeof configOrSigners === "object" && "innerInstructions" in configOrSigners) { - config2.innerInstructions = configOrSigners.innerInstructions; - } - const args2 = [encodedTransaction2, config2]; - const unsafeRes2 = await this._rpcRequest("simulateTransaction", args2); - const res2 = create(unsafeRes2, SimulatedTransactionResponseStruct); - if ("error" in res2) { - throw new Error("failed to simulate transaction: " + res2.error.message); - } - return res2.result; - } - let transaction; - if (transactionOrMessage instanceof Transaction) { - let originalTx = transactionOrMessage; - transaction = new Transaction(); - transaction.feePayer = originalTx.feePayer; - transaction.instructions = transactionOrMessage.instructions; - transaction.nonceInfo = originalTx.nonceInfo; - transaction.signatures = originalTx.signatures; - } else { - transaction = Transaction.populate(transactionOrMessage); - transaction._message = transaction._json = void 0; - } - if (configOrSigners !== void 0 && !Array.isArray(configOrSigners)) { - throw new Error("Invalid arguments"); - } - const signers = configOrSigners; - if (transaction.nonceInfo && signers) { - transaction.sign(...signers); - } else { - let disableCache = this._disableBlockhashCaching; - for (; ; ) { - const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache); - transaction.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight; - transaction.recentBlockhash = latestBlockhash.blockhash; - if (!signers) - break; - transaction.sign(...signers); - if (!transaction.signature) { - throw new Error("!signature"); - } - const signature2 = transaction.signature.toString("base64"); - if (!this._blockhashInfo.simulatedSignatures.includes(signature2) && !this._blockhashInfo.transactionSignatures.includes(signature2)) { - this._blockhashInfo.simulatedSignatures.push(signature2); - break; - } else { - disableCache = true; - } - } - } - const message = transaction._compile(); - const signData = message.serialize(); - const wireTransaction = transaction._serialize(signData); - const encodedTransaction = wireTransaction.toString("base64"); - const config = { - encoding: "base64", - commitment: this.commitment - }; - if (includeAccounts) { - const addresses = (Array.isArray(includeAccounts) ? includeAccounts : message.nonProgramIds()).map((key) => key.toBase58()); - config["accounts"] = { - encoding: "base64", - addresses - }; - } - if (signers) { - config.sigVerify = true; - } - if (configOrSigners && typeof configOrSigners === "object" && "innerInstructions" in configOrSigners) { - config.innerInstructions = configOrSigners.innerInstructions; - } - const args = [encodedTransaction, config]; - const unsafeRes = await this._rpcRequest("simulateTransaction", args); - const res = create(unsafeRes, SimulatedTransactionResponseStruct); - if ("error" in res) { - let logs; - if ("data" in res.error) { - logs = res.error.data.logs; - if (logs && Array.isArray(logs)) { - const traceIndent = "\n "; - const logTrace = traceIndent + logs.join(traceIndent); - console.error(res.error.message, logTrace); - } - } - throw new SendTransactionError({ - action: "simulate", - signature: "", - transactionMessage: res.error.message, - logs - }); - } - return res.result; - } - /** - * Sign and send a transaction - * - * @deprecated Instead, call {@link sendTransaction} with a {@link - * VersionedTransaction} - */ - /** - * Send a signed transaction - */ - // eslint-disable-next-line no-dupe-class-members - /** - * Sign and send a transaction - */ - // eslint-disable-next-line no-dupe-class-members - async sendTransaction(transaction, signersOrOptions, options) { - if ("version" in transaction) { - if (signersOrOptions && Array.isArray(signersOrOptions)) { - throw new Error("Invalid arguments"); - } - const wireTransaction2 = transaction.serialize(); - return await this.sendRawTransaction(wireTransaction2, signersOrOptions); - } - if (signersOrOptions === void 0 || !Array.isArray(signersOrOptions)) { - throw new Error("Invalid arguments"); - } - const signers = signersOrOptions; - if (transaction.nonceInfo) { - transaction.sign(...signers); - } else { - let disableCache = this._disableBlockhashCaching; - for (; ; ) { - const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache); - transaction.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight; - transaction.recentBlockhash = latestBlockhash.blockhash; - transaction.sign(...signers); - if (!transaction.signature) { - throw new Error("!signature"); - } - const signature2 = transaction.signature.toString("base64"); - if (!this._blockhashInfo.transactionSignatures.includes(signature2)) { - this._blockhashInfo.transactionSignatures.push(signature2); - break; - } else { - disableCache = true; - } - } - } - const wireTransaction = transaction.serialize(); - return await this.sendRawTransaction(wireTransaction, options); - } - /** - * Send a transaction that has already been signed and serialized into the - * wire format - */ - async sendRawTransaction(rawTransaction, options) { - const encodedTransaction = toBuffer(rawTransaction).toString("base64"); - const result = await this.sendEncodedTransaction(encodedTransaction, options); - return result; - } - /** - * Send a transaction that has already been signed, serialized into the - * wire format, and encoded as a base64 string - */ - async sendEncodedTransaction(encodedTransaction, options) { - const config = { - encoding: "base64" - }; - const skipPreflight = options && options.skipPreflight; - const preflightCommitment = skipPreflight === true ? "processed" : options && options.preflightCommitment || this.commitment; - if (options && options.maxRetries != null) { - config.maxRetries = options.maxRetries; - } - if (options && options.minContextSlot != null) { - config.minContextSlot = options.minContextSlot; - } - if (skipPreflight) { - config.skipPreflight = skipPreflight; - } - if (preflightCommitment) { - config.preflightCommitment = preflightCommitment; - } - const args = [encodedTransaction, config]; - const unsafeRes = await this._rpcRequest("sendTransaction", args); - const res = create(unsafeRes, SendTransactionRpcResult); - if ("error" in res) { - let logs = void 0; - if ("data" in res.error) { - logs = res.error.data.logs; - } - throw new SendTransactionError({ - action: skipPreflight ? "send" : "simulate", - signature: "", - transactionMessage: res.error.message, - logs - }); - } - return res.result; - } - /** - * @internal - */ - _wsOnOpen() { - this._rpcWebSocketConnected = true; - this._rpcWebSocketHeartbeat = setInterval(() => { - (async () => { - try { - await this._rpcWebSocket.notify("ping"); - } catch { - } - })(); - }, 5e3); - this._updateSubscriptions(); - } - /** - * @internal - */ - _wsOnError(err) { - this._rpcWebSocketConnected = false; - console.error("ws error:", err.message); - } - /** - * @internal - */ - _wsOnClose(code) { - this._rpcWebSocketConnected = false; - this._rpcWebSocketGeneration = (this._rpcWebSocketGeneration + 1) % Number.MAX_SAFE_INTEGER; - if (this._rpcWebSocketIdleTimeout) { - clearTimeout(this._rpcWebSocketIdleTimeout); - this._rpcWebSocketIdleTimeout = null; - } - if (this._rpcWebSocketHeartbeat) { - clearInterval(this._rpcWebSocketHeartbeat); - this._rpcWebSocketHeartbeat = null; - } - if (code === 1e3) { - this._updateSubscriptions(); - return; - } - this._subscriptionCallbacksByServerSubscriptionId = {}; - Object.entries(this._subscriptionsByHash).forEach(([hash, subscription]) => { - this._setSubscription(hash, { - ...subscription, - state: "pending" - }); - }); - } - /** - * @internal - */ - _setSubscription(hash, nextSubscription) { - const prevState = this._subscriptionsByHash[hash]?.state; - this._subscriptionsByHash[hash] = nextSubscription; - if (prevState !== nextSubscription.state) { - const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash]; - if (stateChangeCallbacks) { - stateChangeCallbacks.forEach((cb) => { - try { - cb(nextSubscription.state); - } catch { - } - }); - } - } - } - /** - * @internal - */ - _onSubscriptionStateChange(clientSubscriptionId, callback) { - const hash = this._subscriptionHashByClientSubscriptionId[clientSubscriptionId]; - if (hash == null) { - return () => { - }; - } - const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash] ||= /* @__PURE__ */ new Set(); - stateChangeCallbacks.add(callback); - return () => { - stateChangeCallbacks.delete(callback); - if (stateChangeCallbacks.size === 0) { - delete this._subscriptionStateChangeCallbacksByHash[hash]; - } - }; - } - /** - * @internal - */ - async _updateSubscriptions() { - if (Object.keys(this._subscriptionsByHash).length === 0) { - if (this._rpcWebSocketConnected) { - this._rpcWebSocketConnected = false; - this._rpcWebSocketIdleTimeout = setTimeout(() => { - this._rpcWebSocketIdleTimeout = null; - try { - this._rpcWebSocket.close(); - } catch (err) { - if (err instanceof Error) { - console.log(`Error when closing socket connection: ${err.message}`); - } - } - }, 500); - } - return; - } - if (this._rpcWebSocketIdleTimeout !== null) { - clearTimeout(this._rpcWebSocketIdleTimeout); - this._rpcWebSocketIdleTimeout = null; - this._rpcWebSocketConnected = true; - } - if (!this._rpcWebSocketConnected) { - this._rpcWebSocket.connect(); - return; - } - const activeWebSocketGeneration = this._rpcWebSocketGeneration; - const isCurrentConnectionStillActive = () => { - return activeWebSocketGeneration === this._rpcWebSocketGeneration; - }; - await Promise.all( - // Don't be tempted to change this to `Object.entries`. We call - // `_updateSubscriptions` recursively when processing the state, - // so it's important that we look up the *current* version of - // each subscription, every time we process a hash. - Object.keys(this._subscriptionsByHash).map(async (hash) => { - const subscription = this._subscriptionsByHash[hash]; - if (subscription === void 0) { - return; - } - switch (subscription.state) { - case "pending": - case "unsubscribed": - if (subscription.callbacks.size === 0) { - delete this._subscriptionsByHash[hash]; - if (subscription.state === "unsubscribed") { - delete this._subscriptionCallbacksByServerSubscriptionId[subscription.serverSubscriptionId]; - } - await this._updateSubscriptions(); - return; - } - await (async () => { - const { - args, - method - } = subscription; - try { - this._setSubscription(hash, { - ...subscription, - state: "subscribing" - }); - const serverSubscriptionId = await this._rpcWebSocket.call(method, args); - this._setSubscription(hash, { - ...subscription, - serverSubscriptionId, - state: "subscribed" - }); - this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId] = subscription.callbacks; - await this._updateSubscriptions(); - } catch (e) { - console.error(`Received ${e instanceof Error ? "" : "JSON-RPC "}error calling \`${method}\``, { - args, - error: e - }); - if (!isCurrentConnectionStillActive()) { - return; - } - this._setSubscription(hash, { - ...subscription, - state: "pending" - }); - await this._updateSubscriptions(); - } - })(); - break; - case "subscribed": - if (subscription.callbacks.size === 0) { - await (async () => { - const { - serverSubscriptionId, - unsubscribeMethod - } = subscription; - if (this._subscriptionsAutoDisposedByRpc.has(serverSubscriptionId)) { - this._subscriptionsAutoDisposedByRpc.delete(serverSubscriptionId); - } else { - this._setSubscription(hash, { - ...subscription, - state: "unsubscribing" - }); - this._setSubscription(hash, { - ...subscription, - state: "unsubscribing" - }); - try { - await this._rpcWebSocket.call(unsubscribeMethod, [serverSubscriptionId]); - } catch (e) { - if (e instanceof Error) { - console.error(`${unsubscribeMethod} error:`, e.message); - } - if (!isCurrentConnectionStillActive()) { - return; - } - this._setSubscription(hash, { - ...subscription, - state: "subscribed" - }); - await this._updateSubscriptions(); - return; - } - } - this._setSubscription(hash, { - ...subscription, - state: "unsubscribed" - }); - await this._updateSubscriptions(); - })(); - } - break; - } - }) - ); - } - /** - * @internal - */ - _handleServerNotification(serverSubscriptionId, callbackArgs) { - const callbacks = this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId]; - if (callbacks === void 0) { - return; - } - callbacks.forEach((cb) => { - try { - cb( - ...callbackArgs - ); - } catch (e) { - console.error(e); - } - }); - } - /** - * @internal - */ - _wsOnAccountNotification(notification) { - const { - result, - subscription - } = create(notification, AccountNotificationResult); - this._handleServerNotification(subscription, [result.value, result.context]); - } - /** - * @internal - */ - _makeSubscription(subscriptionConfig, args) { - const clientSubscriptionId = this._nextClientSubscriptionId++; - const hash = fastStableStringify([subscriptionConfig.method, args]); - const existingSubscription = this._subscriptionsByHash[hash]; - if (existingSubscription === void 0) { - this._subscriptionsByHash[hash] = { - ...subscriptionConfig, - args, - callbacks: /* @__PURE__ */ new Set([subscriptionConfig.callback]), - state: "pending" - }; - } else { - existingSubscription.callbacks.add(subscriptionConfig.callback); - } - this._subscriptionHashByClientSubscriptionId[clientSubscriptionId] = hash; - this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId] = async () => { - delete this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId]; - delete this._subscriptionHashByClientSubscriptionId[clientSubscriptionId]; - const subscription = this._subscriptionsByHash[hash]; - assert2(subscription !== void 0, `Could not find a \`Subscription\` when tearing down client subscription #${clientSubscriptionId}`); - subscription.callbacks.delete(subscriptionConfig.callback); - await this._updateSubscriptions(); - }; - this._updateSubscriptions(); - return clientSubscriptionId; - } - /** - * Register a callback to be invoked whenever the specified account changes - * - * @param publicKey Public key of the account to monitor - * @param callback Function to invoke whenever the account is changed - * @param config - * @return subscription id - */ - /** @deprecated Instead, pass in an {@link AccountSubscriptionConfig} */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - onAccountChange(publicKey2, callback, commitmentOrConfig) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs( - [publicKey2.toBase58()], - commitment || this._commitment || "finalized", - // Apply connection/server default. - "base64", - config - ); - return this._makeSubscription({ - callback, - method: "accountSubscribe", - unsubscribeMethod: "accountUnsubscribe" - }, args); - } - /** - * Deregister an account notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeAccountChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "account change"); - } - /** - * @internal - */ - _wsOnProgramAccountNotification(notification) { - const { - result, - subscription - } = create(notification, ProgramAccountNotificationResult); - this._handleServerNotification(subscription, [{ - accountId: result.value.pubkey, - accountInfo: result.value.account - }, result.context]); - } - /** - * Register a callback to be invoked whenever accounts owned by the - * specified program change - * - * @param programId Public key of the program to monitor - * @param callback Function to invoke whenever the account is changed - * @param config - * @return subscription id - */ - /** @deprecated Instead, pass in a {@link ProgramAccountSubscriptionConfig} */ - // eslint-disable-next-line no-dupe-class-members - // eslint-disable-next-line no-dupe-class-members - onProgramAccountChange(programId, callback, commitmentOrConfig, maybeFilters) { - const { - commitment, - config - } = extractCommitmentFromConfig(commitmentOrConfig); - const args = this._buildArgs( - [programId.toBase58()], - commitment || this._commitment || "finalized", - // Apply connection/server default. - "base64", - config ? config : maybeFilters ? { - filters: applyDefaultMemcmpEncodingToFilters(maybeFilters) - } : void 0 - /* extra */ - ); - return this._makeSubscription({ - callback, - method: "programSubscribe", - unsubscribeMethod: "programUnsubscribe" - }, args); - } - /** - * Deregister an account notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeProgramAccountChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "program account change"); - } - /** - * Registers a callback to be invoked whenever logs are emitted. - */ - onLogs(filter, callback, commitment) { - const args = this._buildArgs( - [typeof filter === "object" ? { - mentions: [filter.toString()] - } : filter], - commitment || this._commitment || "finalized" - // Apply connection/server default. - ); - return this._makeSubscription({ - callback, - method: "logsSubscribe", - unsubscribeMethod: "logsUnsubscribe" - }, args); - } - /** - * Deregister a logs callback. - * - * @param clientSubscriptionId client subscription id to deregister. - */ - async removeOnLogsListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "logs"); - } - /** - * @internal - */ - _wsOnLogsNotification(notification) { - const { - result, - subscription - } = create(notification, LogsNotificationResult); - this._handleServerNotification(subscription, [result.value, result.context]); - } - /** - * @internal - */ - _wsOnSlotNotification(notification) { - const { - result, - subscription - } = create(notification, SlotNotificationResult); - this._handleServerNotification(subscription, [result]); - } - /** - * Register a callback to be invoked upon slot changes - * - * @param callback Function to invoke whenever the slot changes - * @return subscription id - */ - onSlotChange(callback) { - return this._makeSubscription( - { - callback, - method: "slotSubscribe", - unsubscribeMethod: "slotUnsubscribe" - }, - [] - /* args */ - ); - } - /** - * Deregister a slot notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeSlotChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "slot change"); - } - /** - * @internal - */ - _wsOnSlotUpdatesNotification(notification) { - const { - result, - subscription - } = create(notification, SlotUpdateNotificationResult); - this._handleServerNotification(subscription, [result]); - } - /** - * Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s - * may be useful to track live progress of a cluster. - * - * @param callback Function to invoke whenever the slot updates - * @return subscription id - */ - onSlotUpdate(callback) { - return this._makeSubscription( - { - callback, - method: "slotsUpdatesSubscribe", - unsubscribeMethod: "slotsUpdatesUnsubscribe" - }, - [] - /* args */ - ); - } - /** - * Deregister a slot update notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeSlotUpdateListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "slot update"); - } - /** - * @internal - */ - async _unsubscribeClientSubscription(clientSubscriptionId, subscriptionName) { - const dispose = this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId]; - if (dispose) { - await dispose(); - } else { - console.warn(`Ignored unsubscribe request because an active subscription with id \`${clientSubscriptionId}\` for '${subscriptionName}' events could not be found.`); - } - } - _buildArgs(args, override, encoding, extra) { - const commitment = override || this._commitment; - if (commitment || encoding || extra) { - let options = {}; - if (encoding) { - options.encoding = encoding; - } - if (commitment) { - options.commitment = commitment; - } - if (extra) { - options = Object.assign(options, extra); - } - args.push(options); - } - return args; - } - /** - * @internal - */ - _buildArgsAtLeastConfirmed(args, override, encoding, extra) { - const commitment = override || this._commitment; - if (commitment && !["confirmed", "finalized"].includes(commitment)) { - throw new Error("Using Connection with default commitment: `" + this._commitment + "`, but method requires at least `confirmed`"); - } - return this._buildArgs(args, override, encoding, extra); - } - /** - * @internal - */ - _wsOnSignatureNotification(notification) { - const { - result, - subscription - } = create(notification, SignatureNotificationResult); - if (result.value !== "receivedSignature") { - this._subscriptionsAutoDisposedByRpc.add(subscription); - } - this._handleServerNotification(subscription, result.value === "receivedSignature" ? [{ - type: "received" - }, result.context] : [{ - type: "status", - result: result.value - }, result.context]); - } - /** - * Register a callback to be invoked upon signature updates - * - * @param signature Transaction signature string in base 58 - * @param callback Function to invoke on signature notifications - * @param commitment Specify the commitment level signature must reach before notification - * @return subscription id - */ - onSignature(signature2, callback, commitment) { - const args = this._buildArgs( - [signature2], - commitment || this._commitment || "finalized" - // Apply connection/server default. - ); - const clientSubscriptionId = this._makeSubscription({ - callback: (notification, context) => { - if (notification.type === "status") { - callback(notification.result, context); - try { - this.removeSignatureListener(clientSubscriptionId); - } catch (_err) { - } - } - }, - method: "signatureSubscribe", - unsubscribeMethod: "signatureUnsubscribe" - }, args); - return clientSubscriptionId; - } - /** - * Register a callback to be invoked when a transaction is - * received and/or processed. - * - * @param signature Transaction signature string in base 58 - * @param callback Function to invoke on signature notifications - * @param options Enable received notifications and set the commitment - * level that signature must reach before notification - * @return subscription id - */ - onSignatureWithOptions(signature2, callback, options) { - const { - commitment, - ...extra - } = { - ...options, - commitment: options && options.commitment || this._commitment || "finalized" - // Apply connection/server default. - }; - const args = this._buildArgs([signature2], commitment, void 0, extra); - const clientSubscriptionId = this._makeSubscription({ - callback: (notification, context) => { - callback(notification, context); - try { - this.removeSignatureListener(clientSubscriptionId); - } catch (_err) { - } - }, - method: "signatureSubscribe", - unsubscribeMethod: "signatureUnsubscribe" - }, args); - return clientSubscriptionId; - } - /** - * Deregister a signature notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeSignatureListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "signature result"); - } - /** - * @internal - */ - _wsOnRootNotification(notification) { - const { - result, - subscription - } = create(notification, RootNotificationResult); - this._handleServerNotification(subscription, [result]); - } - /** - * Register a callback to be invoked upon root changes - * - * @param callback Function to invoke whenever the root changes - * @return subscription id - */ - onRootChange(callback) { - return this._makeSubscription( - { - callback, - method: "rootSubscribe", - unsubscribeMethod: "rootUnsubscribe" - }, - [] - /* args */ - ); - } - /** - * Deregister a root notification callback - * - * @param clientSubscriptionId client subscription id to deregister - */ - async removeRootChangeListener(clientSubscriptionId) { - await this._unsubscribeClientSubscription(clientSubscriptionId, "root change"); - } - }; - Keypair = class _Keypair { - /** - * Create a new keypair instance. - * Generate random keypair if no {@link Ed25519Keypair} is provided. - * - * @param {Ed25519Keypair} keypair ed25519 keypair - */ - constructor(keypair) { - this._keypair = void 0; - this._keypair = keypair ?? generateKeypair(); - } - /** - * Generate a new random keypair - * - * @returns {Keypair} Keypair - */ - static generate() { - return new _Keypair(generateKeypair()); - } - /** - * Create a keypair from a raw secret key byte array. - * - * This method should only be used to recreate a keypair from a previously - * generated secret key. Generating keypairs from a random seed should be done - * with the {@link Keypair.fromSeed} method. - * - * @throws error if the provided secret key is invalid and validation is not skipped. - * - * @param secretKey secret key byte array - * @param options skip secret key validation - * - * @returns {Keypair} Keypair - */ - static fromSecretKey(secretKey, options) { - if (secretKey.byteLength !== 64) { - throw new Error("bad secret key size"); - } - const publicKey2 = secretKey.slice(32, 64); - if (!options || !options.skipValidation) { - const privateScalar = secretKey.slice(0, 32); - const computedPublicKey = getPublicKey(privateScalar); - for (let ii = 0; ii < 32; ii++) { - if (publicKey2[ii] !== computedPublicKey[ii]) { - throw new Error("provided secretKey is invalid"); - } - } - } - return new _Keypair({ - publicKey: publicKey2, - secretKey - }); - } - /** - * Generate a keypair from a 32 byte seed. - * - * @param seed seed byte array - * - * @returns {Keypair} Keypair - */ - static fromSeed(seed) { - const publicKey2 = getPublicKey(seed); - const secretKey = new Uint8Array(64); - secretKey.set(seed); - secretKey.set(publicKey2, 32); - return new _Keypair({ - publicKey: publicKey2, - secretKey - }); - } - /** - * The public key for this keypair - * - * @returns {PublicKey} PublicKey - */ - get publicKey() { - return new PublicKey(this._keypair.publicKey); - } - /** - * The raw secret key for this keypair - * @returns {Uint8Array} Secret key in an array of Uint8 bytes - */ - get secretKey() { - return new Uint8Array(this._keypair.secretKey); - } - }; - LOOKUP_TABLE_INSTRUCTION_LAYOUTS = Object.freeze({ - CreateLookupTable: { - index: 0, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), u64("recentSlot"), BufferLayout.u8("bumpSeed")]) - }, - FreezeLookupTable: { - index: 1, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - }, - ExtendLookupTable: { - index: 2, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), u64(), BufferLayout.seq(publicKey(), BufferLayout.offset(BufferLayout.u32(), -8), "addresses")]) - }, - DeactivateLookupTable: { - index: 3, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - }, - CloseLookupTable: { - index: 4, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - } - }); - AddressLookupTableInstruction = class { - /** - * @internal - */ - constructor() { - } - static decodeInstructionType(instruction) { - this.checkProgramId(instruction.programId); - const instructionTypeLayout = BufferLayout.u32("instruction"); - const index = instructionTypeLayout.decode(instruction.data); - let type2; - for (const [layoutType, layout] of Object.entries(LOOKUP_TABLE_INSTRUCTION_LAYOUTS)) { - if (layout.index == index) { - type2 = layoutType; - break; - } - } - if (!type2) { - throw new Error("Invalid Instruction. Should be a LookupTable Instruction"); - } - return type2; - } - static decodeCreateLookupTable(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeysLength(instruction.keys, 4); - const { - recentSlot - } = decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable, instruction.data); - return { - authority: instruction.keys[1].pubkey, - payer: instruction.keys[2].pubkey, - recentSlot: Number(recentSlot) - }; - } - static decodeExtendLookupTable(instruction) { - this.checkProgramId(instruction.programId); - if (instruction.keys.length < 2) { - throw new Error(`invalid instruction; found ${instruction.keys.length} keys, expected at least 2`); - } - const { - addresses - } = decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable, instruction.data); - return { - lookupTable: instruction.keys[0].pubkey, - authority: instruction.keys[1].pubkey, - payer: instruction.keys.length > 2 ? instruction.keys[2].pubkey : void 0, - addresses: addresses.map((buffer) => new PublicKey(buffer)) - }; - } - static decodeCloseLookupTable(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeysLength(instruction.keys, 3); - return { - lookupTable: instruction.keys[0].pubkey, - authority: instruction.keys[1].pubkey, - recipient: instruction.keys[2].pubkey - }; - } - static decodeFreezeLookupTable(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeysLength(instruction.keys, 2); - return { - lookupTable: instruction.keys[0].pubkey, - authority: instruction.keys[1].pubkey - }; - } - static decodeDeactivateLookupTable(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeysLength(instruction.keys, 2); - return { - lookupTable: instruction.keys[0].pubkey, - authority: instruction.keys[1].pubkey - }; - } - /** - * @internal - */ - static checkProgramId(programId) { - if (!programId.equals(AddressLookupTableProgram.programId)) { - throw new Error("invalid instruction; programId is not AddressLookupTable Program"); - } - } - /** - * @internal - */ - static checkKeysLength(keys, expectedLength) { - if (keys.length < expectedLength) { - throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`); - } - } - }; - AddressLookupTableProgram = class { - /** - * @internal - */ - constructor() { - } - static createLookupTable(params) { - const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(), getU64Encoder().encode(params.recentSlot)], this.programId); - const type2 = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable; - const data = encodeData(type2, { - recentSlot: BigInt(params.recentSlot), - bumpSeed - }); - const keys = [{ - pubkey: lookupTableAddress, - isSigner: false, - isWritable: true - }, { - pubkey: params.authority, - isSigner: true, - isWritable: false - }, { - pubkey: params.payer, - isSigner: true, - isWritable: true - }, { - pubkey: SystemProgram.programId, - isSigner: false, - isWritable: false - }]; - return [new TransactionInstruction({ - programId: this.programId, - keys, - data - }), lookupTableAddress]; - } - static freezeLookupTable(params) { - const type2 = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.FreezeLookupTable; - const data = encodeData(type2); - const keys = [{ - pubkey: params.lookupTable, - isSigner: false, - isWritable: true - }, { - pubkey: params.authority, - isSigner: true, - isWritable: false - }]; - return new TransactionInstruction({ - programId: this.programId, - keys, - data - }); - } - static extendLookupTable(params) { - const type2 = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable; - const data = encodeData(type2, { - addresses: params.addresses.map((addr) => addr.toBytes()) - }); - const keys = [{ - pubkey: params.lookupTable, - isSigner: false, - isWritable: true - }, { - pubkey: params.authority, - isSigner: true, - isWritable: false - }]; - if (params.payer) { - keys.push({ - pubkey: params.payer, - isSigner: true, - isWritable: true - }, { - pubkey: SystemProgram.programId, - isSigner: false, - isWritable: false - }); - } - return new TransactionInstruction({ - programId: this.programId, - keys, - data - }); - } - static deactivateLookupTable(params) { - const type2 = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.DeactivateLookupTable; - const data = encodeData(type2); - const keys = [{ - pubkey: params.lookupTable, - isSigner: false, - isWritable: true - }, { - pubkey: params.authority, - isSigner: true, - isWritable: false - }]; - return new TransactionInstruction({ - programId: this.programId, - keys, - data - }); - } - static closeLookupTable(params) { - const type2 = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CloseLookupTable; - const data = encodeData(type2); - const keys = [{ - pubkey: params.lookupTable, - isSigner: false, - isWritable: true - }, { - pubkey: params.authority, - isSigner: true, - isWritable: false - }, { - pubkey: params.recipient, - isSigner: false, - isWritable: true - }]; - return new TransactionInstruction({ - programId: this.programId, - keys, - data - }); - } - }; - AddressLookupTableProgram.programId = new PublicKey("AddressLookupTab1e1111111111111111111111111"); - ComputeBudgetInstruction = class { - /** - * @internal - */ - constructor() { - } - /** - * Decode a compute budget instruction and retrieve the instruction type. - */ - static decodeInstructionType(instruction) { - this.checkProgramId(instruction.programId); - const instructionTypeLayout = BufferLayout.u8("instruction"); - const typeIndex = instructionTypeLayout.decode(instruction.data); - let type2; - for (const [ixType, layout] of Object.entries(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS)) { - if (layout.index == typeIndex) { - type2 = ixType; - break; - } - } - if (!type2) { - throw new Error("Instruction type incorrect; not a ComputeBudgetInstruction"); - } - return type2; - } - /** - * Decode request units compute budget instruction and retrieve the instruction params. - */ - static decodeRequestUnits(instruction) { - this.checkProgramId(instruction.programId); - const { - units, - additionalFee - } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits, instruction.data); - return { - units, - additionalFee - }; - } - /** - * Decode request heap frame compute budget instruction and retrieve the instruction params. - */ - static decodeRequestHeapFrame(instruction) { - this.checkProgramId(instruction.programId); - const { - bytes - } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame, instruction.data); - return { - bytes - }; - } - /** - * Decode set compute unit limit compute budget instruction and retrieve the instruction params. - */ - static decodeSetComputeUnitLimit(instruction) { - this.checkProgramId(instruction.programId); - const { - units - } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit, instruction.data); - return { - units - }; - } - /** - * Decode set compute unit price compute budget instruction and retrieve the instruction params. - */ - static decodeSetComputeUnitPrice(instruction) { - this.checkProgramId(instruction.programId); - const { - microLamports - } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice, instruction.data); - return { - microLamports - }; - } - /** - * @internal - */ - static checkProgramId(programId) { - if (!programId.equals(ComputeBudgetProgram.programId)) { - throw new Error("invalid instruction; programId is not ComputeBudgetProgram"); - } - } - }; - COMPUTE_BUDGET_INSTRUCTION_LAYOUTS = Object.freeze({ - RequestUnits: { - index: 0, - layout: BufferLayout.struct([BufferLayout.u8("instruction"), BufferLayout.u32("units"), BufferLayout.u32("additionalFee")]) - }, - RequestHeapFrame: { - index: 1, - layout: BufferLayout.struct([BufferLayout.u8("instruction"), BufferLayout.u32("bytes")]) - }, - SetComputeUnitLimit: { - index: 2, - layout: BufferLayout.struct([BufferLayout.u8("instruction"), BufferLayout.u32("units")]) - }, - SetComputeUnitPrice: { - index: 3, - layout: BufferLayout.struct([BufferLayout.u8("instruction"), u64("microLamports")]) - } - }); - ComputeBudgetProgram = class { - /** - * @internal - */ - constructor() { - } - /** - * Public key that identifies the Compute Budget program - */ - /** - * @deprecated Instead, call {@link setComputeUnitLimit} and/or {@link setComputeUnitPrice} - */ - static requestUnits(params) { - const type2 = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits; - const data = encodeData(type2, params); - return new TransactionInstruction({ - keys: [], - programId: this.programId, - data - }); - } - static requestHeapFrame(params) { - const type2 = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame; - const data = encodeData(type2, params); - return new TransactionInstruction({ - keys: [], - programId: this.programId, - data - }); - } - static setComputeUnitLimit(params) { - const type2 = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit; - const data = encodeData(type2, params); - return new TransactionInstruction({ - keys: [], - programId: this.programId, - data - }); - } - static setComputeUnitPrice(params) { - const type2 = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice; - const data = encodeData(type2, { - microLamports: BigInt(params.microLamports) - }); - return new TransactionInstruction({ - keys: [], - programId: this.programId, - data - }); - } - }; - ComputeBudgetProgram.programId = new PublicKey("ComputeBudget111111111111111111111111111111"); - PRIVATE_KEY_BYTES$1 = 64; - PUBLIC_KEY_BYTES$1 = 32; - SIGNATURE_BYTES = 64; - ED25519_INSTRUCTION_LAYOUT = BufferLayout.struct([BufferLayout.u8("numSignatures"), BufferLayout.u8("padding"), BufferLayout.u16("signatureOffset"), BufferLayout.u16("signatureInstructionIndex"), BufferLayout.u16("publicKeyOffset"), BufferLayout.u16("publicKeyInstructionIndex"), BufferLayout.u16("messageDataOffset"), BufferLayout.u16("messageDataSize"), BufferLayout.u16("messageInstructionIndex")]); - Ed25519Program = class _Ed25519Program { - /** - * @internal - */ - constructor() { - } - /** - * Public key that identifies the ed25519 program - */ - /** - * Create an ed25519 instruction with a public key and signature. The - * public key must be a buffer that is 32 bytes long, and the signature - * must be a buffer of 64 bytes. - */ - static createInstructionWithPublicKey(params) { - const { - publicKey: publicKey2, - message, - signature: signature2, - instructionIndex - } = params; - assert2(publicKey2.length === PUBLIC_KEY_BYTES$1, `Public Key must be ${PUBLIC_KEY_BYTES$1} bytes but received ${publicKey2.length} bytes`); - assert2(signature2.length === SIGNATURE_BYTES, `Signature must be ${SIGNATURE_BYTES} bytes but received ${signature2.length} bytes`); - const publicKeyOffset = ED25519_INSTRUCTION_LAYOUT.span; - const signatureOffset = publicKeyOffset + publicKey2.length; - const messageDataOffset = signatureOffset + signature2.length; - const numSignatures = 1; - const instructionData = import_buffer.Buffer.alloc(messageDataOffset + message.length); - const index = instructionIndex == null ? 65535 : instructionIndex; - ED25519_INSTRUCTION_LAYOUT.encode({ - numSignatures, - padding: 0, - signatureOffset, - signatureInstructionIndex: index, - publicKeyOffset, - publicKeyInstructionIndex: index, - messageDataOffset, - messageDataSize: message.length, - messageInstructionIndex: index - }, instructionData); - instructionData.fill(publicKey2, publicKeyOffset); - instructionData.fill(signature2, signatureOffset); - instructionData.fill(message, messageDataOffset); - return new TransactionInstruction({ - keys: [], - programId: _Ed25519Program.programId, - data: instructionData - }); - } - /** - * Create an ed25519 instruction with a private key. The private key - * must be a buffer that is 64 bytes long. - */ - static createInstructionWithPrivateKey(params) { - const { - privateKey, - message, - instructionIndex - } = params; - assert2(privateKey.length === PRIVATE_KEY_BYTES$1, `Private key must be ${PRIVATE_KEY_BYTES$1} bytes but received ${privateKey.length} bytes`); - try { - const keypair = Keypair.fromSecretKey(privateKey); - const publicKey2 = keypair.publicKey.toBytes(); - const signature2 = sign(message, keypair.secretKey); - return this.createInstructionWithPublicKey({ - publicKey: publicKey2, - message, - signature: signature2, - instructionIndex - }); - } catch (error) { - throw new Error(`Error creating instruction; ${error}`); - } - } - }; - Ed25519Program.programId = new PublicKey("Ed25519SigVerify111111111111111111111111111"); - ecdsaSign = (msgHash, privKey) => { - const signature2 = secp256k1.sign(msgHash, privKey); - return [signature2.toCompactRawBytes(), signature2.recovery]; - }; - secp256k1.utils.isValidPrivateKey; - publicKeyCreate = secp256k1.getPublicKey; - PRIVATE_KEY_BYTES = 32; - ETHEREUM_ADDRESS_BYTES = 20; - PUBLIC_KEY_BYTES = 64; - SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11; - SECP256K1_INSTRUCTION_LAYOUT = BufferLayout.struct([BufferLayout.u8("numSignatures"), BufferLayout.u16("signatureOffset"), BufferLayout.u8("signatureInstructionIndex"), BufferLayout.u16("ethAddressOffset"), BufferLayout.u8("ethAddressInstructionIndex"), BufferLayout.u16("messageDataOffset"), BufferLayout.u16("messageDataSize"), BufferLayout.u8("messageInstructionIndex"), BufferLayout.blob(20, "ethAddress"), BufferLayout.blob(64, "signature"), BufferLayout.u8("recoveryId")]); - Secp256k1Program = class _Secp256k1Program { - /** - * @internal - */ - constructor() { - } - /** - * Public key that identifies the secp256k1 program - */ - /** - * Construct an Ethereum address from a secp256k1 public key buffer. - * @param {Buffer} publicKey a 64 byte secp256k1 public key buffer - */ - static publicKeyToEthAddress(publicKey2) { - assert2(publicKey2.length === PUBLIC_KEY_BYTES, `Public key must be ${PUBLIC_KEY_BYTES} bytes but received ${publicKey2.length} bytes`); - try { - return import_buffer.Buffer.from(keccak_256(toBuffer(publicKey2))).slice(-ETHEREUM_ADDRESS_BYTES); - } catch (error) { - throw new Error(`Error constructing Ethereum address: ${error}`); - } - } - /** - * Create an secp256k1 instruction with a public key. The public key - * must be a buffer that is 64 bytes long. - */ - static createInstructionWithPublicKey(params) { - const { - publicKey: publicKey2, - message, - signature: signature2, - recoveryId, - instructionIndex - } = params; - return _Secp256k1Program.createInstructionWithEthAddress({ - ethAddress: _Secp256k1Program.publicKeyToEthAddress(publicKey2), - message, - signature: signature2, - recoveryId, - instructionIndex - }); - } - /** - * Create an secp256k1 instruction with an Ethereum address. The address - * must be a hex string or a buffer that is 20 bytes long. - */ - static createInstructionWithEthAddress(params) { - const { - ethAddress: rawAddress, - message, - signature: signature2, - recoveryId, - instructionIndex = 0 - } = params; - let ethAddress; - if (typeof rawAddress === "string") { - if (rawAddress.startsWith("0x")) { - ethAddress = import_buffer.Buffer.from(rawAddress.substr(2), "hex"); - } else { - ethAddress = import_buffer.Buffer.from(rawAddress, "hex"); - } - } else { - ethAddress = rawAddress; - } - assert2(ethAddress.length === ETHEREUM_ADDRESS_BYTES, `Address must be ${ETHEREUM_ADDRESS_BYTES} bytes but received ${ethAddress.length} bytes`); - const dataStart = 1 + SIGNATURE_OFFSETS_SERIALIZED_SIZE; - const ethAddressOffset = dataStart; - const signatureOffset = dataStart + ethAddress.length; - const messageDataOffset = signatureOffset + signature2.length + 1; - const numSignatures = 1; - const instructionData = import_buffer.Buffer.alloc(SECP256K1_INSTRUCTION_LAYOUT.span + message.length); - SECP256K1_INSTRUCTION_LAYOUT.encode({ - numSignatures, - signatureOffset, - signatureInstructionIndex: instructionIndex, - ethAddressOffset, - ethAddressInstructionIndex: instructionIndex, - messageDataOffset, - messageDataSize: message.length, - messageInstructionIndex: instructionIndex, - signature: toBuffer(signature2), - ethAddress: toBuffer(ethAddress), - recoveryId - }, instructionData); - instructionData.fill(toBuffer(message), SECP256K1_INSTRUCTION_LAYOUT.span); - return new TransactionInstruction({ - keys: [], - programId: _Secp256k1Program.programId, - data: instructionData - }); - } - /** - * Create an secp256k1 instruction with a private key. The private key - * must be a buffer that is 32 bytes long. - */ - static createInstructionWithPrivateKey(params) { - const { - privateKey: pkey, - message, - instructionIndex - } = params; - assert2(pkey.length === PRIVATE_KEY_BYTES, `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`); - try { - const privateKey = toBuffer(pkey); - const publicKey2 = publicKeyCreate( - privateKey, - false - /* isCompressed */ - ).slice(1); - const messageHash = import_buffer.Buffer.from(keccak_256(toBuffer(message))); - const [signature2, recoveryId] = ecdsaSign(messageHash, privateKey); - return this.createInstructionWithPublicKey({ - publicKey: publicKey2, - message, - signature: signature2, - recoveryId, - instructionIndex - }); - } catch (error) { - throw new Error(`Error creating instruction; ${error}`); - } - } - }; - Secp256k1Program.programId = new PublicKey("KeccakSecp256k11111111111111111111111111111"); - STAKE_CONFIG_ID = new PublicKey("StakeConfig11111111111111111111111111111111"); - Authorized = class { - /** - * Create a new Authorized object - * @param staker the stake authority - * @param withdrawer the withdraw authority - */ - constructor(staker, withdrawer) { - this.staker = void 0; - this.withdrawer = void 0; - this.staker = staker; - this.withdrawer = withdrawer; - } - }; - Lockup = class { - /** - * Create a new Lockup object - */ - constructor(unixTimestamp, epoch, custodian) { - this.unixTimestamp = void 0; - this.epoch = void 0; - this.custodian = void 0; - this.unixTimestamp = unixTimestamp; - this.epoch = epoch; - this.custodian = custodian; - } - /** - * Default, inactive Lockup value - */ - }; - _Lockup = Lockup; - Lockup.default = new _Lockup(0, 0, PublicKey.default); - StakeInstruction = class { - /** - * @internal - */ - constructor() { - } - /** - * Decode a stake instruction and retrieve the instruction type. - */ - static decodeInstructionType(instruction) { - this.checkProgramId(instruction.programId); - const instructionTypeLayout = BufferLayout.u32("instruction"); - const typeIndex = instructionTypeLayout.decode(instruction.data); - let type2; - for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) { - if (layout.index == typeIndex) { - type2 = ixType; - break; - } - } - if (!type2) { - throw new Error("Instruction type incorrect; not a StakeInstruction"); - } - return type2; - } - /** - * Decode a initialize stake instruction and retrieve the instruction params. - */ - static decodeInitialize(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 2); - const { - authorized: authorized2, - lockup: lockup2 - } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Initialize, instruction.data); - return { - stakePubkey: instruction.keys[0].pubkey, - authorized: new Authorized(new PublicKey(authorized2.staker), new PublicKey(authorized2.withdrawer)), - lockup: new Lockup(lockup2.unixTimestamp, lockup2.epoch, new PublicKey(lockup2.custodian)) - }; - } - /** - * Decode a delegate stake instruction and retrieve the instruction params. - */ - static decodeDelegate(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 6); - decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Delegate, instruction.data); - return { - stakePubkey: instruction.keys[0].pubkey, - votePubkey: instruction.keys[1].pubkey, - authorizedPubkey: instruction.keys[5].pubkey - }; - } - /** - * Decode an authorize stake instruction and retrieve the instruction params. - */ - static decodeAuthorize(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - const { - newAuthorized, - stakeAuthorizationType - } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Authorize, instruction.data); - const o = { - stakePubkey: instruction.keys[0].pubkey, - authorizedPubkey: instruction.keys[2].pubkey, - newAuthorizedPubkey: new PublicKey(newAuthorized), - stakeAuthorizationType: { - index: stakeAuthorizationType - } - }; - if (instruction.keys.length > 3) { - o.custodianPubkey = instruction.keys[3].pubkey; - } - return o; - } - /** - * Decode an authorize-with-seed stake instruction and retrieve the instruction params. - */ - static decodeAuthorizeWithSeed(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 2); - const { - newAuthorized, - stakeAuthorizationType, - authoritySeed, - authorityOwner - } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed, instruction.data); - const o = { - stakePubkey: instruction.keys[0].pubkey, - authorityBase: instruction.keys[1].pubkey, - authoritySeed, - authorityOwner: new PublicKey(authorityOwner), - newAuthorizedPubkey: new PublicKey(newAuthorized), - stakeAuthorizationType: { - index: stakeAuthorizationType - } - }; - if (instruction.keys.length > 3) { - o.custodianPubkey = instruction.keys[3].pubkey; - } - return o; - } - /** - * Decode a split stake instruction and retrieve the instruction params. - */ - static decodeSplit(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - const { - lamports - } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Split, instruction.data); - return { - stakePubkey: instruction.keys[0].pubkey, - splitStakePubkey: instruction.keys[1].pubkey, - authorizedPubkey: instruction.keys[2].pubkey, - lamports - }; - } - /** - * Decode a merge stake instruction and retrieve the instruction params. - */ - static decodeMerge(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Merge, instruction.data); - return { - stakePubkey: instruction.keys[0].pubkey, - sourceStakePubKey: instruction.keys[1].pubkey, - authorizedPubkey: instruction.keys[4].pubkey - }; - } - /** - * Decode a withdraw stake instruction and retrieve the instruction params. - */ - static decodeWithdraw(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 5); - const { - lamports - } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Withdraw, instruction.data); - const o = { - stakePubkey: instruction.keys[0].pubkey, - toPubkey: instruction.keys[1].pubkey, - authorizedPubkey: instruction.keys[4].pubkey, - lamports - }; - if (instruction.keys.length > 5) { - o.custodianPubkey = instruction.keys[5].pubkey; - } - return o; - } - /** - * Decode a deactivate stake instruction and retrieve the instruction params. - */ - static decodeDeactivate(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Deactivate, instruction.data); - return { - stakePubkey: instruction.keys[0].pubkey, - authorizedPubkey: instruction.keys[2].pubkey - }; - } - /** - * @internal - */ - static checkProgramId(programId) { - if (!programId.equals(StakeProgram.programId)) { - throw new Error("invalid instruction; programId is not StakeProgram"); - } - } - /** - * @internal - */ - static checkKeyLength(keys, expectedLength) { - if (keys.length < expectedLength) { - throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`); - } - } - }; - STAKE_INSTRUCTION_LAYOUTS = Object.freeze({ - Initialize: { - index: 0, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), authorized(), lockup()]) - }, - Authorize: { - index: 1, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("newAuthorized"), BufferLayout.u32("stakeAuthorizationType")]) - }, - Delegate: { - index: 2, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - }, - Split: { - index: 3, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), BufferLayout.ns64("lamports")]) - }, - Withdraw: { - index: 4, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), BufferLayout.ns64("lamports")]) - }, - Deactivate: { - index: 5, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - }, - Merge: { - index: 7, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - }, - AuthorizeWithSeed: { - index: 8, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("newAuthorized"), BufferLayout.u32("stakeAuthorizationType"), rustString("authoritySeed"), publicKey("authorityOwner")]) - } - }); - StakeAuthorizationLayout = Object.freeze({ - Staker: { - index: 0 - }, - Withdrawer: { - index: 1 - } - }); - StakeProgram = class { - /** - * @internal - */ - constructor() { - } - /** - * Public key that identifies the Stake program - */ - /** - * Generate an Initialize instruction to add to a Stake Create transaction - */ - static initialize(params) { - const { - stakePubkey, - authorized: authorized2, - lockup: maybeLockup - } = params; - const lockup2 = maybeLockup || Lockup.default; - const type2 = STAKE_INSTRUCTION_LAYOUTS.Initialize; - const data = encodeData(type2, { - authorized: { - staker: toBuffer(authorized2.staker.toBuffer()), - withdrawer: toBuffer(authorized2.withdrawer.toBuffer()) - }, - lockup: { - unixTimestamp: lockup2.unixTimestamp, - epoch: lockup2.epoch, - custodian: toBuffer(lockup2.custodian.toBuffer()) - } - }); - const instructionData = { - keys: [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_RENT_PUBKEY, - isSigner: false, - isWritable: false - }], - programId: this.programId, - data - }; - return new TransactionInstruction(instructionData); - } - /** - * Generate a Transaction that creates a new Stake account at - * an address generated with `from`, a seed, and the Stake programId - */ - static createAccountWithSeed(params) { - const transaction = new Transaction(); - transaction.add(SystemProgram.createAccountWithSeed({ - fromPubkey: params.fromPubkey, - newAccountPubkey: params.stakePubkey, - basePubkey: params.basePubkey, - seed: params.seed, - lamports: params.lamports, - space: this.space, - programId: this.programId - })); - const { - stakePubkey, - authorized: authorized2, - lockup: lockup2 - } = params; - return transaction.add(this.initialize({ - stakePubkey, - authorized: authorized2, - lockup: lockup2 - })); - } - /** - * Generate a Transaction that creates a new Stake account - */ - static createAccount(params) { - const transaction = new Transaction(); - transaction.add(SystemProgram.createAccount({ - fromPubkey: params.fromPubkey, - newAccountPubkey: params.stakePubkey, - lamports: params.lamports, - space: this.space, - programId: this.programId - })); - const { - stakePubkey, - authorized: authorized2, - lockup: lockup2 - } = params; - return transaction.add(this.initialize({ - stakePubkey, - authorized: authorized2, - lockup: lockup2 - })); - } - /** - * Generate a Transaction that delegates Stake tokens to a validator - * Vote PublicKey. This transaction can also be used to redelegate Stake - * to a new validator Vote PublicKey. - */ - static delegate(params) { - const { - stakePubkey, - authorizedPubkey, - votePubkey - } = params; - const type2 = STAKE_INSTRUCTION_LAYOUTS.Delegate; - const data = encodeData(type2); - return new Transaction().add({ - keys: [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: votePubkey, - isSigner: false, - isWritable: false - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: SYSVAR_STAKE_HISTORY_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: STAKE_CONFIG_ID, - isSigner: false, - isWritable: false - }, { - pubkey: authorizedPubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }); - } - /** - * Generate a Transaction that authorizes a new PublicKey as Staker - * or Withdrawer on the Stake account. - */ - static authorize(params) { - const { - stakePubkey, - authorizedPubkey, - newAuthorizedPubkey, - stakeAuthorizationType, - custodianPubkey - } = params; - const type2 = STAKE_INSTRUCTION_LAYOUTS.Authorize; - const data = encodeData(type2, { - newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()), - stakeAuthorizationType: stakeAuthorizationType.index - }); - const keys = [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: true - }, { - pubkey: authorizedPubkey, - isSigner: true, - isWritable: false - }]; - if (custodianPubkey) { - keys.push({ - pubkey: custodianPubkey, - isSigner: true, - isWritable: false - }); - } - return new Transaction().add({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a Transaction that authorizes a new PublicKey as Staker - * or Withdrawer on the Stake account. - */ - static authorizeWithSeed(params) { - const { - stakePubkey, - authorityBase, - authoritySeed, - authorityOwner, - newAuthorizedPubkey, - stakeAuthorizationType, - custodianPubkey - } = params; - const type2 = STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed; - const data = encodeData(type2, { - newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()), - stakeAuthorizationType: stakeAuthorizationType.index, - authoritySeed, - authorityOwner: toBuffer(authorityOwner.toBuffer()) - }); - const keys = [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: authorityBase, - isSigner: true, - isWritable: false - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }]; - if (custodianPubkey) { - keys.push({ - pubkey: custodianPubkey, - isSigner: true, - isWritable: false - }); - } - return new Transaction().add({ - keys, - programId: this.programId, - data - }); - } - /** - * @internal - */ - static splitInstruction(params) { - const { - stakePubkey, - authorizedPubkey, - splitStakePubkey, - lamports - } = params; - const type2 = STAKE_INSTRUCTION_LAYOUTS.Split; - const data = encodeData(type2, { - lamports - }); - return new TransactionInstruction({ - keys: [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: splitStakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: authorizedPubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }); - } - /** - * Generate a Transaction that splits Stake tokens into another stake account - */ - static split(params, rentExemptReserve) { - const transaction = new Transaction(); - transaction.add(SystemProgram.createAccount({ - fromPubkey: params.authorizedPubkey, - newAccountPubkey: params.splitStakePubkey, - lamports: rentExemptReserve, - space: this.space, - programId: this.programId - })); - return transaction.add(this.splitInstruction(params)); - } - /** - * Generate a Transaction that splits Stake tokens into another account - * derived from a base public key and seed - */ - static splitWithSeed(params, rentExemptReserve) { - const { - stakePubkey, - authorizedPubkey, - splitStakePubkey, - basePubkey, - seed, - lamports - } = params; - const transaction = new Transaction(); - transaction.add(SystemProgram.allocate({ - accountPubkey: splitStakePubkey, - basePubkey, - seed, - space: this.space, - programId: this.programId - })); - if (rentExemptReserve && rentExemptReserve > 0) { - transaction.add(SystemProgram.transfer({ - fromPubkey: params.authorizedPubkey, - toPubkey: splitStakePubkey, - lamports: rentExemptReserve - })); - } - return transaction.add(this.splitInstruction({ - stakePubkey, - authorizedPubkey, - splitStakePubkey, - lamports - })); - } - /** - * Generate a Transaction that merges Stake accounts. - */ - static merge(params) { - const { - stakePubkey, - sourceStakePubKey, - authorizedPubkey - } = params; - const type2 = STAKE_INSTRUCTION_LAYOUTS.Merge; - const data = encodeData(type2); - return new Transaction().add({ - keys: [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: sourceStakePubKey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: SYSVAR_STAKE_HISTORY_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: authorizedPubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }); - } - /** - * Generate a Transaction that withdraws deactivated Stake tokens. - */ - static withdraw(params) { - const { - stakePubkey, - authorizedPubkey, - toPubkey, - lamports, - custodianPubkey - } = params; - const type2 = STAKE_INSTRUCTION_LAYOUTS.Withdraw; - const data = encodeData(type2, { - lamports - }); - const keys = [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: toPubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: SYSVAR_STAKE_HISTORY_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: authorizedPubkey, - isSigner: true, - isWritable: false - }]; - if (custodianPubkey) { - keys.push({ - pubkey: custodianPubkey, - isSigner: true, - isWritable: false - }); - } - return new Transaction().add({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a Transaction that deactivates Stake tokens. - */ - static deactivate(params) { - const { - stakePubkey, - authorizedPubkey - } = params; - const type2 = STAKE_INSTRUCTION_LAYOUTS.Deactivate; - const data = encodeData(type2); - return new Transaction().add({ - keys: [{ - pubkey: stakePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: authorizedPubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }); - } - }; - StakeProgram.programId = new PublicKey("Stake11111111111111111111111111111111111111"); - StakeProgram.space = 200; - VoteInit = class { - /** [0, 100] */ - constructor(nodePubkey, authorizedVoter, authorizedWithdrawer, commission) { - this.nodePubkey = void 0; - this.authorizedVoter = void 0; - this.authorizedWithdrawer = void 0; - this.commission = void 0; - this.nodePubkey = nodePubkey; - this.authorizedVoter = authorizedVoter; - this.authorizedWithdrawer = authorizedWithdrawer; - this.commission = commission; - } - }; - VoteInstruction = class { - /** - * @internal - */ - constructor() { - } - /** - * Decode a vote instruction and retrieve the instruction type. - */ - static decodeInstructionType(instruction) { - this.checkProgramId(instruction.programId); - const instructionTypeLayout = BufferLayout.u32("instruction"); - const typeIndex = instructionTypeLayout.decode(instruction.data); - let type2; - for (const [ixType, layout] of Object.entries(VOTE_INSTRUCTION_LAYOUTS)) { - if (layout.index == typeIndex) { - type2 = ixType; - break; - } - } - if (!type2) { - throw new Error("Instruction type incorrect; not a VoteInstruction"); - } - return type2; - } - /** - * Decode an initialize vote instruction and retrieve the instruction params. - */ - static decodeInitializeAccount(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 4); - const { - voteInit: voteInit2 - } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.InitializeAccount, instruction.data); - return { - votePubkey: instruction.keys[0].pubkey, - nodePubkey: instruction.keys[3].pubkey, - voteInit: new VoteInit(new PublicKey(voteInit2.nodePubkey), new PublicKey(voteInit2.authorizedVoter), new PublicKey(voteInit2.authorizedWithdrawer), voteInit2.commission) - }; - } - /** - * Decode an authorize instruction and retrieve the instruction params. - */ - static decodeAuthorize(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - const { - newAuthorized, - voteAuthorizationType - } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Authorize, instruction.data); - return { - votePubkey: instruction.keys[0].pubkey, - authorizedPubkey: instruction.keys[2].pubkey, - newAuthorizedPubkey: new PublicKey(newAuthorized), - voteAuthorizationType: { - index: voteAuthorizationType - } - }; - } - /** - * Decode an authorize instruction and retrieve the instruction params. - */ - static decodeAuthorizeWithSeed(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - const { - voteAuthorizeWithSeedArgs: { - currentAuthorityDerivedKeyOwnerPubkey, - currentAuthorityDerivedKeySeed, - newAuthorized, - voteAuthorizationType - } - } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed, instruction.data); - return { - currentAuthorityDerivedKeyBasePubkey: instruction.keys[2].pubkey, - currentAuthorityDerivedKeyOwnerPubkey: new PublicKey(currentAuthorityDerivedKeyOwnerPubkey), - currentAuthorityDerivedKeySeed, - newAuthorizedPubkey: new PublicKey(newAuthorized), - voteAuthorizationType: { - index: voteAuthorizationType - }, - votePubkey: instruction.keys[0].pubkey - }; - } - /** - * Decode a withdraw instruction and retrieve the instruction params. - */ - static decodeWithdraw(instruction) { - this.checkProgramId(instruction.programId); - this.checkKeyLength(instruction.keys, 3); - const { - lamports - } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Withdraw, instruction.data); - return { - votePubkey: instruction.keys[0].pubkey, - authorizedWithdrawerPubkey: instruction.keys[2].pubkey, - lamports, - toPubkey: instruction.keys[1].pubkey - }; - } - /** - * @internal - */ - static checkProgramId(programId) { - if (!programId.equals(VoteProgram.programId)) { - throw new Error("invalid instruction; programId is not VoteProgram"); - } - } - /** - * @internal - */ - static checkKeyLength(keys, expectedLength) { - if (keys.length < expectedLength) { - throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`); - } - } - }; - VOTE_INSTRUCTION_LAYOUTS = Object.freeze({ - InitializeAccount: { - index: 0, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), voteInit()]) - }, - Authorize: { - index: 1, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), publicKey("newAuthorized"), BufferLayout.u32("voteAuthorizationType")]) - }, - Withdraw: { - index: 3, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), BufferLayout.ns64("lamports")]) - }, - UpdateValidatorIdentity: { - index: 4, - layout: BufferLayout.struct([BufferLayout.u32("instruction")]) - }, - AuthorizeWithSeed: { - index: 10, - layout: BufferLayout.struct([BufferLayout.u32("instruction"), voteAuthorizeWithSeedArgs()]) - } - }); - VoteAuthorizationLayout = Object.freeze({ - Voter: { - index: 0 - }, - Withdrawer: { - index: 1 - } - }); - VoteProgram = class _VoteProgram { - /** - * @internal - */ - constructor() { - } - /** - * Public key that identifies the Vote program - */ - /** - * Generate an Initialize instruction. - */ - static initializeAccount(params) { - const { - votePubkey, - nodePubkey, - voteInit: voteInit2 - } = params; - const type2 = VOTE_INSTRUCTION_LAYOUTS.InitializeAccount; - const data = encodeData(type2, { - voteInit: { - nodePubkey: toBuffer(voteInit2.nodePubkey.toBuffer()), - authorizedVoter: toBuffer(voteInit2.authorizedVoter.toBuffer()), - authorizedWithdrawer: toBuffer(voteInit2.authorizedWithdrawer.toBuffer()), - commission: voteInit2.commission - } - }); - const instructionData = { - keys: [{ - pubkey: votePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_RENT_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: nodePubkey, - isSigner: true, - isWritable: false - }], - programId: this.programId, - data - }; - return new TransactionInstruction(instructionData); - } - /** - * Generate a transaction that creates a new Vote account. - */ - static createAccount(params) { - const transaction = new Transaction(); - transaction.add(SystemProgram.createAccount({ - fromPubkey: params.fromPubkey, - newAccountPubkey: params.votePubkey, - lamports: params.lamports, - space: this.space, - programId: this.programId - })); - return transaction.add(this.initializeAccount({ - votePubkey: params.votePubkey, - nodePubkey: params.voteInit.nodePubkey, - voteInit: params.voteInit - })); - } - /** - * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account. - */ - static authorize(params) { - const { - votePubkey, - authorizedPubkey, - newAuthorizedPubkey, - voteAuthorizationType - } = params; - const type2 = VOTE_INSTRUCTION_LAYOUTS.Authorize; - const data = encodeData(type2, { - newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()), - voteAuthorizationType: voteAuthorizationType.index - }); - const keys = [{ - pubkey: votePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: authorizedPubkey, - isSigner: true, - isWritable: false - }]; - return new Transaction().add({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account - * where the current Voter or Withdrawer authority is a derived key. - */ - static authorizeWithSeed(params) { - const { - currentAuthorityDerivedKeyBasePubkey, - currentAuthorityDerivedKeyOwnerPubkey, - currentAuthorityDerivedKeySeed, - newAuthorizedPubkey, - voteAuthorizationType, - votePubkey - } = params; - const type2 = VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed; - const data = encodeData(type2, { - voteAuthorizeWithSeedArgs: { - currentAuthorityDerivedKeyOwnerPubkey: toBuffer(currentAuthorityDerivedKeyOwnerPubkey.toBuffer()), - currentAuthorityDerivedKeySeed, - newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()), - voteAuthorizationType: voteAuthorizationType.index - } - }); - const keys = [{ - pubkey: votePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: SYSVAR_CLOCK_PUBKEY, - isSigner: false, - isWritable: false - }, { - pubkey: currentAuthorityDerivedKeyBasePubkey, - isSigner: true, - isWritable: false - }]; - return new Transaction().add({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a transaction to withdraw from a Vote account. - */ - static withdraw(params) { - const { - votePubkey, - authorizedWithdrawerPubkey, - lamports, - toPubkey - } = params; - const type2 = VOTE_INSTRUCTION_LAYOUTS.Withdraw; - const data = encodeData(type2, { - lamports - }); - const keys = [{ - pubkey: votePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: toPubkey, - isSigner: false, - isWritable: true - }, { - pubkey: authorizedWithdrawerPubkey, - isSigner: true, - isWritable: false - }]; - return new Transaction().add({ - keys, - programId: this.programId, - data - }); - } - /** - * Generate a transaction to withdraw safely from a Vote account. - * - * This function was created as a safeguard for vote accounts running validators, `safeWithdraw` - * checks that the withdraw amount will not exceed the specified balance while leaving enough left - * to cover rent. If you wish to close the vote account by withdrawing the full amount, call the - * `withdraw` method directly. - */ - static safeWithdraw(params, currentVoteAccountBalance, rentExemptMinimum) { - if (params.lamports > currentVoteAccountBalance - rentExemptMinimum) { - throw new Error("Withdraw will leave vote account with insufficient funds."); - } - return _VoteProgram.withdraw(params); - } - /** - * Generate a transaction to update the validator identity (node pubkey) of a Vote account. - */ - static updateValidatorIdentity(params) { - const { - votePubkey, - authorizedWithdrawerPubkey, - nodePubkey - } = params; - const type2 = VOTE_INSTRUCTION_LAYOUTS.UpdateValidatorIdentity; - const data = encodeData(type2); - const keys = [{ - pubkey: votePubkey, - isSigner: false, - isWritable: true - }, { - pubkey: nodePubkey, - isSigner: true, - isWritable: false - }, { - pubkey: authorizedWithdrawerPubkey, - isSigner: true, - isWritable: false - }]; - return new Transaction().add({ - keys, - programId: this.programId, - data - }); - } - }; - VoteProgram.programId = new PublicKey("Vote111111111111111111111111111111111111111"); - VoteProgram.space = 3762; - VALIDATOR_INFO_KEY = new PublicKey("Va1idator1nfo111111111111111111111111111111"); - InfoString = type({ - name: string(), - website: optional(string()), - details: optional(string()), - iconUrl: optional(string()), - keybaseUsername: optional(string()) - }); - ValidatorInfo = class _ValidatorInfo { - /** - * Construct a valid ValidatorInfo - * - * @param key validator public key - * @param info validator information - */ - constructor(key, info) { - this.key = void 0; - this.info = void 0; - this.key = key; - this.info = info; - } - /** - * Deserialize ValidatorInfo from the config account data. Exactly two config - * keys are required in the data. - * - * @param buffer config account data - * @return null if info was not found - */ - static fromConfigData(buffer) { - let byteArray = [...buffer]; - const configKeyCount = decodeLength(byteArray); - if (configKeyCount !== 2) - return null; - const configKeys = []; - for (let i = 0; i < 2; i++) { - const publicKey2 = new PublicKey(guardedSplice(byteArray, 0, PUBLIC_KEY_LENGTH)); - const isSigner = guardedShift(byteArray) === 1; - configKeys.push({ - publicKey: publicKey2, - isSigner - }); - } - if (configKeys[0].publicKey.equals(VALIDATOR_INFO_KEY)) { - if (configKeys[1].isSigner) { - const rawInfo = rustString().decode(import_buffer.Buffer.from(byteArray)); - const info = JSON.parse(rawInfo); - assert(info, InfoString); - return new _ValidatorInfo(configKeys[1].publicKey, info); - } - } - return null; - } - }; - VOTE_PROGRAM_ID = new PublicKey("Vote111111111111111111111111111111111111111"); - VoteAccountLayout = BufferLayout.struct([ - publicKey("nodePubkey"), - publicKey("authorizedWithdrawer"), - BufferLayout.u8("commission"), - BufferLayout.nu64(), - // votes.length - BufferLayout.seq(BufferLayout.struct([BufferLayout.nu64("slot"), BufferLayout.u32("confirmationCount")]), BufferLayout.offset(BufferLayout.u32(), -8), "votes"), - BufferLayout.u8("rootSlotValid"), - BufferLayout.nu64("rootSlot"), - BufferLayout.nu64(), - // authorizedVoters.length - BufferLayout.seq(BufferLayout.struct([BufferLayout.nu64("epoch"), publicKey("authorizedVoter")]), BufferLayout.offset(BufferLayout.u32(), -8), "authorizedVoters"), - BufferLayout.struct([BufferLayout.seq(BufferLayout.struct([publicKey("authorizedPubkey"), BufferLayout.nu64("epochOfLastAuthorizedSwitch"), BufferLayout.nu64("targetEpoch")]), 32, "buf"), BufferLayout.nu64("idx"), BufferLayout.u8("isEmpty")], "priorVoters"), - BufferLayout.nu64(), - // epochCredits.length - BufferLayout.seq(BufferLayout.struct([BufferLayout.nu64("epoch"), BufferLayout.nu64("credits"), BufferLayout.nu64("prevCredits")]), BufferLayout.offset(BufferLayout.u32(), -8), "epochCredits"), - BufferLayout.struct([BufferLayout.nu64("slot"), BufferLayout.nu64("timestamp")], "lastTimestamp") - ]); - VoteAccount = class _VoteAccount { - /** - * @internal - */ - constructor(args) { - this.nodePubkey = void 0; - this.authorizedWithdrawer = void 0; - this.commission = void 0; - this.rootSlot = void 0; - this.votes = void 0; - this.authorizedVoters = void 0; - this.priorVoters = void 0; - this.epochCredits = void 0; - this.lastTimestamp = void 0; - this.nodePubkey = args.nodePubkey; - this.authorizedWithdrawer = args.authorizedWithdrawer; - this.commission = args.commission; - this.rootSlot = args.rootSlot; - this.votes = args.votes; - this.authorizedVoters = args.authorizedVoters; - this.priorVoters = args.priorVoters; - this.epochCredits = args.epochCredits; - this.lastTimestamp = args.lastTimestamp; - } - /** - * Deserialize VoteAccount from the account data. - * - * @param buffer account data - * @return VoteAccount - */ - static fromAccountData(buffer) { - const versionOffset = 4; - const va = VoteAccountLayout.decode(toBuffer(buffer), versionOffset); - let rootSlot = va.rootSlot; - if (!va.rootSlotValid) { - rootSlot = null; - } - return new _VoteAccount({ - nodePubkey: new PublicKey(va.nodePubkey), - authorizedWithdrawer: new PublicKey(va.authorizedWithdrawer), - commission: va.commission, - votes: va.votes, - rootSlot, - authorizedVoters: va.authorizedVoters.map(parseAuthorizedVoter), - priorVoters: getPriorVoters(va.priorVoters), - epochCredits: va.epochCredits, - lastTimestamp: va.lastTimestamp - }); - } - }; - endpoint = { - http: { - devnet: "http://api.devnet.solana.com", - testnet: "http://api.testnet.solana.com", - "mainnet-beta": "http://api.mainnet-beta.solana.com/" - }, - https: { - devnet: "https://api.devnet.solana.com", - testnet: "https://api.testnet.solana.com", - "mainnet-beta": "https://api.mainnet-beta.solana.com/" - } - }; - LAMPORTS_PER_SOL = 1e9; - } -}); - -// ../../node_modules/.pnpm/base-x@5.0.1/node_modules/base-x/src/cjs/index.cjs -var require_cjs = __commonJS({ - "../../node_modules/.pnpm/base-x@5.0.1/node_modules/base-x/src/cjs/index.cjs"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - function base(ALPHABET) { - if (ALPHABET.length >= 255) { - throw new TypeError("Alphabet too long"); - } - const BASE_MAP = new Uint8Array(256); - for (let j = 0; j < BASE_MAP.length; j++) { - BASE_MAP[j] = 255; - } - for (let i = 0; i < ALPHABET.length; i++) { - const x = ALPHABET.charAt(i); - const xc = x.charCodeAt(0); - if (BASE_MAP[xc] !== 255) { - throw new TypeError(x + " is ambiguous"); - } - BASE_MAP[xc] = i; - } - const BASE = ALPHABET.length; - const LEADER = ALPHABET.charAt(0); - const FACTOR = Math.log(BASE) / Math.log(256); - const iFACTOR = Math.log(256) / Math.log(BASE); - function encode(source) { - if (source instanceof Uint8Array) { - } else if (ArrayBuffer.isView(source)) { - source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength); - } else if (Array.isArray(source)) { - source = Uint8Array.from(source); - } - if (!(source instanceof Uint8Array)) { - throw new TypeError("Expected Uint8Array"); - } - if (source.length === 0) { - return ""; - } - let zeroes = 0; - let length = 0; - let pbegin = 0; - const pend = source.length; - while (pbegin !== pend && source[pbegin] === 0) { - pbegin++; - zeroes++; - } - const size = (pend - pbegin) * iFACTOR + 1 >>> 0; - const b58 = new Uint8Array(size); - while (pbegin !== pend) { - let carry = source[pbegin]; - let i = 0; - for (let it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) { - carry += 256 * b58[it1] >>> 0; - b58[it1] = carry % BASE >>> 0; - carry = carry / BASE >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i; - pbegin++; - } - let it2 = size - length; - while (it2 !== size && b58[it2] === 0) { - it2++; - } - let str = LEADER.repeat(zeroes); - for (; it2 < size; ++it2) { - str += ALPHABET.charAt(b58[it2]); - } - return str; - } - function decodeUnsafe(source) { - if (typeof source !== "string") { - throw new TypeError("Expected String"); - } - if (source.length === 0) { - return new Uint8Array(); - } - let psz = 0; - let zeroes = 0; - let length = 0; - while (source[psz] === LEADER) { - zeroes++; - psz++; - } - const size = (source.length - psz) * FACTOR + 1 >>> 0; - const b256 = new Uint8Array(size); - while (psz < source.length) { - const charCode = source.charCodeAt(psz); - if (charCode > 255) { - return; - } - let carry = BASE_MAP[charCode]; - if (carry === 255) { - return; - } - let i = 0; - for (let it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) { - carry += BASE * b256[it3] >>> 0; - b256[it3] = carry % 256 >>> 0; - carry = carry / 256 >>> 0; - } - if (carry !== 0) { - throw new Error("Non-zero carry"); - } - length = i; - psz++; - } - let it4 = size - length; - while (it4 !== size && b256[it4] === 0) { - it4++; - } - const vch = new Uint8Array(zeroes + (size - it4)); - let j = zeroes; - while (it4 !== size) { - vch[j++] = b256[it4++]; - } - return vch; - } - function decode(string2) { - const buffer = decodeUnsafe(string2); - if (buffer) { - return buffer; - } - throw new Error("Non-base" + BASE + " character"); - } - return { - encode, - decodeUnsafe, - decode - }; - } - exports2.default = base; - } -}); - -// ../../node_modules/.pnpm/bs58@6.0.0/node_modules/bs58/src/cjs/index.cjs -var require_cjs2 = __commonJS({ - "../../node_modules/.pnpm/bs58@6.0.0/node_modules/bs58/src/cjs/index.cjs"(exports2) { - "use strict"; - var __importDefault = exports2 && exports2.__importDefault || function(mod2) { - return mod2 && mod2.__esModule ? mod2 : { "default": mod2 }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - var base_x_1 = __importDefault(require_cjs()); - var ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - exports2.default = (0, base_x_1.default)(ALPHABET); - } -}); - -// ../../node_modules/.pnpm/tweetnacl@1.0.3/node_modules/tweetnacl/nacl-fast.js -var require_nacl_fast = __commonJS({ - "../../node_modules/.pnpm/tweetnacl@1.0.3/node_modules/tweetnacl/nacl-fast.js"(exports2, module2) { - (function(nacl2) { - "use strict"; - var gf = function(init) { - var i, r = new Float64Array(16); - if (init) - for (i = 0; i < init.length; i++) - r[i] = init[i]; - return r; - }; - var randombytes = function() { - throw new Error("no PRNG"); - }; - var _0 = new Uint8Array(16); - var _9 = new Uint8Array(32); - _9[0] = 9; - var gf0 = gf(), gf1 = gf([1]), _121665 = gf([56129, 1]), D = gf([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]), D2 = gf([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]), X = gf([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]), Y = gf([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]), I = gf([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]); - function ts64(x, i, h, l) { - x[i] = h >> 24 & 255; - x[i + 1] = h >> 16 & 255; - x[i + 2] = h >> 8 & 255; - x[i + 3] = h & 255; - x[i + 4] = l >> 24 & 255; - x[i + 5] = l >> 16 & 255; - x[i + 6] = l >> 8 & 255; - x[i + 7] = l & 255; - } - function vn(x, xi, y, yi, n) { - var i, d = 0; - for (i = 0; i < n; i++) - d |= x[xi + i] ^ y[yi + i]; - return (1 & d - 1 >>> 8) - 1; - } - function crypto_verify_16(x, xi, y, yi) { - return vn(x, xi, y, yi, 16); - } - function crypto_verify_32(x, xi, y, yi) { - return vn(x, xi, y, yi, 32); - } - function core_salsa20(o, p, k, c) { - var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; - var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; - for (var i = 0; i < 20; i += 2) { - u = x0 + x12 | 0; - x4 ^= u << 7 | u >>> 32 - 7; - u = x4 + x0 | 0; - x8 ^= u << 9 | u >>> 32 - 9; - u = x8 + x4 | 0; - x12 ^= u << 13 | u >>> 32 - 13; - u = x12 + x8 | 0; - x0 ^= u << 18 | u >>> 32 - 18; - u = x5 + x1 | 0; - x9 ^= u << 7 | u >>> 32 - 7; - u = x9 + x5 | 0; - x13 ^= u << 9 | u >>> 32 - 9; - u = x13 + x9 | 0; - x1 ^= u << 13 | u >>> 32 - 13; - u = x1 + x13 | 0; - x5 ^= u << 18 | u >>> 32 - 18; - u = x10 + x6 | 0; - x14 ^= u << 7 | u >>> 32 - 7; - u = x14 + x10 | 0; - x2 ^= u << 9 | u >>> 32 - 9; - u = x2 + x14 | 0; - x6 ^= u << 13 | u >>> 32 - 13; - u = x6 + x2 | 0; - x10 ^= u << 18 | u >>> 32 - 18; - u = x15 + x11 | 0; - x3 ^= u << 7 | u >>> 32 - 7; - u = x3 + x15 | 0; - x7 ^= u << 9 | u >>> 32 - 9; - u = x7 + x3 | 0; - x11 ^= u << 13 | u >>> 32 - 13; - u = x11 + x7 | 0; - x15 ^= u << 18 | u >>> 32 - 18; - u = x0 + x3 | 0; - x1 ^= u << 7 | u >>> 32 - 7; - u = x1 + x0 | 0; - x2 ^= u << 9 | u >>> 32 - 9; - u = x2 + x1 | 0; - x3 ^= u << 13 | u >>> 32 - 13; - u = x3 + x2 | 0; - x0 ^= u << 18 | u >>> 32 - 18; - u = x5 + x4 | 0; - x6 ^= u << 7 | u >>> 32 - 7; - u = x6 + x5 | 0; - x7 ^= u << 9 | u >>> 32 - 9; - u = x7 + x6 | 0; - x4 ^= u << 13 | u >>> 32 - 13; - u = x4 + x7 | 0; - x5 ^= u << 18 | u >>> 32 - 18; - u = x10 + x9 | 0; - x11 ^= u << 7 | u >>> 32 - 7; - u = x11 + x10 | 0; - x8 ^= u << 9 | u >>> 32 - 9; - u = x8 + x11 | 0; - x9 ^= u << 13 | u >>> 32 - 13; - u = x9 + x8 | 0; - x10 ^= u << 18 | u >>> 32 - 18; - u = x15 + x14 | 0; - x12 ^= u << 7 | u >>> 32 - 7; - u = x12 + x15 | 0; - x13 ^= u << 9 | u >>> 32 - 9; - u = x13 + x12 | 0; - x14 ^= u << 13 | u >>> 32 - 13; - u = x14 + x13 | 0; - x15 ^= u << 18 | u >>> 32 - 18; - } - x0 = x0 + j0 | 0; - x1 = x1 + j1 | 0; - x2 = x2 + j2 | 0; - x3 = x3 + j3 | 0; - x4 = x4 + j4 | 0; - x5 = x5 + j5 | 0; - x6 = x6 + j6 | 0; - x7 = x7 + j7 | 0; - x8 = x8 + j8 | 0; - x9 = x9 + j9 | 0; - x10 = x10 + j10 | 0; - x11 = x11 + j11 | 0; - x12 = x12 + j12 | 0; - x13 = x13 + j13 | 0; - x14 = x14 + j14 | 0; - x15 = x15 + j15 | 0; - o[0] = x0 >>> 0 & 255; - o[1] = x0 >>> 8 & 255; - o[2] = x0 >>> 16 & 255; - o[3] = x0 >>> 24 & 255; - o[4] = x1 >>> 0 & 255; - o[5] = x1 >>> 8 & 255; - o[6] = x1 >>> 16 & 255; - o[7] = x1 >>> 24 & 255; - o[8] = x2 >>> 0 & 255; - o[9] = x2 >>> 8 & 255; - o[10] = x2 >>> 16 & 255; - o[11] = x2 >>> 24 & 255; - o[12] = x3 >>> 0 & 255; - o[13] = x3 >>> 8 & 255; - o[14] = x3 >>> 16 & 255; - o[15] = x3 >>> 24 & 255; - o[16] = x4 >>> 0 & 255; - o[17] = x4 >>> 8 & 255; - o[18] = x4 >>> 16 & 255; - o[19] = x4 >>> 24 & 255; - o[20] = x5 >>> 0 & 255; - o[21] = x5 >>> 8 & 255; - o[22] = x5 >>> 16 & 255; - o[23] = x5 >>> 24 & 255; - o[24] = x6 >>> 0 & 255; - o[25] = x6 >>> 8 & 255; - o[26] = x6 >>> 16 & 255; - o[27] = x6 >>> 24 & 255; - o[28] = x7 >>> 0 & 255; - o[29] = x7 >>> 8 & 255; - o[30] = x7 >>> 16 & 255; - o[31] = x7 >>> 24 & 255; - o[32] = x8 >>> 0 & 255; - o[33] = x8 >>> 8 & 255; - o[34] = x8 >>> 16 & 255; - o[35] = x8 >>> 24 & 255; - o[36] = x9 >>> 0 & 255; - o[37] = x9 >>> 8 & 255; - o[38] = x9 >>> 16 & 255; - o[39] = x9 >>> 24 & 255; - o[40] = x10 >>> 0 & 255; - o[41] = x10 >>> 8 & 255; - o[42] = x10 >>> 16 & 255; - o[43] = x10 >>> 24 & 255; - o[44] = x11 >>> 0 & 255; - o[45] = x11 >>> 8 & 255; - o[46] = x11 >>> 16 & 255; - o[47] = x11 >>> 24 & 255; - o[48] = x12 >>> 0 & 255; - o[49] = x12 >>> 8 & 255; - o[50] = x12 >>> 16 & 255; - o[51] = x12 >>> 24 & 255; - o[52] = x13 >>> 0 & 255; - o[53] = x13 >>> 8 & 255; - o[54] = x13 >>> 16 & 255; - o[55] = x13 >>> 24 & 255; - o[56] = x14 >>> 0 & 255; - o[57] = x14 >>> 8 & 255; - o[58] = x14 >>> 16 & 255; - o[59] = x14 >>> 24 & 255; - o[60] = x15 >>> 0 & 255; - o[61] = x15 >>> 8 & 255; - o[62] = x15 >>> 16 & 255; - o[63] = x15 >>> 24 & 255; - } - function core_hsalsa20(o, p, k, c) { - var j0 = c[0] & 255 | (c[1] & 255) << 8 | (c[2] & 255) << 16 | (c[3] & 255) << 24, j1 = k[0] & 255 | (k[1] & 255) << 8 | (k[2] & 255) << 16 | (k[3] & 255) << 24, j2 = k[4] & 255 | (k[5] & 255) << 8 | (k[6] & 255) << 16 | (k[7] & 255) << 24, j3 = k[8] & 255 | (k[9] & 255) << 8 | (k[10] & 255) << 16 | (k[11] & 255) << 24, j4 = k[12] & 255 | (k[13] & 255) << 8 | (k[14] & 255) << 16 | (k[15] & 255) << 24, j5 = c[4] & 255 | (c[5] & 255) << 8 | (c[6] & 255) << 16 | (c[7] & 255) << 24, j6 = p[0] & 255 | (p[1] & 255) << 8 | (p[2] & 255) << 16 | (p[3] & 255) << 24, j7 = p[4] & 255 | (p[5] & 255) << 8 | (p[6] & 255) << 16 | (p[7] & 255) << 24, j8 = p[8] & 255 | (p[9] & 255) << 8 | (p[10] & 255) << 16 | (p[11] & 255) << 24, j9 = p[12] & 255 | (p[13] & 255) << 8 | (p[14] & 255) << 16 | (p[15] & 255) << 24, j10 = c[8] & 255 | (c[9] & 255) << 8 | (c[10] & 255) << 16 | (c[11] & 255) << 24, j11 = k[16] & 255 | (k[17] & 255) << 8 | (k[18] & 255) << 16 | (k[19] & 255) << 24, j12 = k[20] & 255 | (k[21] & 255) << 8 | (k[22] & 255) << 16 | (k[23] & 255) << 24, j13 = k[24] & 255 | (k[25] & 255) << 8 | (k[26] & 255) << 16 | (k[27] & 255) << 24, j14 = k[28] & 255 | (k[29] & 255) << 8 | (k[30] & 255) << 16 | (k[31] & 255) << 24, j15 = c[12] & 255 | (c[13] & 255) << 8 | (c[14] & 255) << 16 | (c[15] & 255) << 24; - var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, u; - for (var i = 0; i < 20; i += 2) { - u = x0 + x12 | 0; - x4 ^= u << 7 | u >>> 32 - 7; - u = x4 + x0 | 0; - x8 ^= u << 9 | u >>> 32 - 9; - u = x8 + x4 | 0; - x12 ^= u << 13 | u >>> 32 - 13; - u = x12 + x8 | 0; - x0 ^= u << 18 | u >>> 32 - 18; - u = x5 + x1 | 0; - x9 ^= u << 7 | u >>> 32 - 7; - u = x9 + x5 | 0; - x13 ^= u << 9 | u >>> 32 - 9; - u = x13 + x9 | 0; - x1 ^= u << 13 | u >>> 32 - 13; - u = x1 + x13 | 0; - x5 ^= u << 18 | u >>> 32 - 18; - u = x10 + x6 | 0; - x14 ^= u << 7 | u >>> 32 - 7; - u = x14 + x10 | 0; - x2 ^= u << 9 | u >>> 32 - 9; - u = x2 + x14 | 0; - x6 ^= u << 13 | u >>> 32 - 13; - u = x6 + x2 | 0; - x10 ^= u << 18 | u >>> 32 - 18; - u = x15 + x11 | 0; - x3 ^= u << 7 | u >>> 32 - 7; - u = x3 + x15 | 0; - x7 ^= u << 9 | u >>> 32 - 9; - u = x7 + x3 | 0; - x11 ^= u << 13 | u >>> 32 - 13; - u = x11 + x7 | 0; - x15 ^= u << 18 | u >>> 32 - 18; - u = x0 + x3 | 0; - x1 ^= u << 7 | u >>> 32 - 7; - u = x1 + x0 | 0; - x2 ^= u << 9 | u >>> 32 - 9; - u = x2 + x1 | 0; - x3 ^= u << 13 | u >>> 32 - 13; - u = x3 + x2 | 0; - x0 ^= u << 18 | u >>> 32 - 18; - u = x5 + x4 | 0; - x6 ^= u << 7 | u >>> 32 - 7; - u = x6 + x5 | 0; - x7 ^= u << 9 | u >>> 32 - 9; - u = x7 + x6 | 0; - x4 ^= u << 13 | u >>> 32 - 13; - u = x4 + x7 | 0; - x5 ^= u << 18 | u >>> 32 - 18; - u = x10 + x9 | 0; - x11 ^= u << 7 | u >>> 32 - 7; - u = x11 + x10 | 0; - x8 ^= u << 9 | u >>> 32 - 9; - u = x8 + x11 | 0; - x9 ^= u << 13 | u >>> 32 - 13; - u = x9 + x8 | 0; - x10 ^= u << 18 | u >>> 32 - 18; - u = x15 + x14 | 0; - x12 ^= u << 7 | u >>> 32 - 7; - u = x12 + x15 | 0; - x13 ^= u << 9 | u >>> 32 - 9; - u = x13 + x12 | 0; - x14 ^= u << 13 | u >>> 32 - 13; - u = x14 + x13 | 0; - x15 ^= u << 18 | u >>> 32 - 18; - } - o[0] = x0 >>> 0 & 255; - o[1] = x0 >>> 8 & 255; - o[2] = x0 >>> 16 & 255; - o[3] = x0 >>> 24 & 255; - o[4] = x5 >>> 0 & 255; - o[5] = x5 >>> 8 & 255; - o[6] = x5 >>> 16 & 255; - o[7] = x5 >>> 24 & 255; - o[8] = x10 >>> 0 & 255; - o[9] = x10 >>> 8 & 255; - o[10] = x10 >>> 16 & 255; - o[11] = x10 >>> 24 & 255; - o[12] = x15 >>> 0 & 255; - o[13] = x15 >>> 8 & 255; - o[14] = x15 >>> 16 & 255; - o[15] = x15 >>> 24 & 255; - o[16] = x6 >>> 0 & 255; - o[17] = x6 >>> 8 & 255; - o[18] = x6 >>> 16 & 255; - o[19] = x6 >>> 24 & 255; - o[20] = x7 >>> 0 & 255; - o[21] = x7 >>> 8 & 255; - o[22] = x7 >>> 16 & 255; - o[23] = x7 >>> 24 & 255; - o[24] = x8 >>> 0 & 255; - o[25] = x8 >>> 8 & 255; - o[26] = x8 >>> 16 & 255; - o[27] = x8 >>> 24 & 255; - o[28] = x9 >>> 0 & 255; - o[29] = x9 >>> 8 & 255; - o[30] = x9 >>> 16 & 255; - o[31] = x9 >>> 24 & 255; - } - function crypto_core_salsa20(out, inp, k, c) { - core_salsa20(out, inp, k, c); - } - function crypto_core_hsalsa20(out, inp, k, c) { - core_hsalsa20(out, inp, k, c); - } - var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); - function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { - var z = new Uint8Array(16), x = new Uint8Array(64); - var u, i; - for (i = 0; i < 16; i++) - z[i] = 0; - for (i = 0; i < 8; i++) - z[i] = n[i]; - while (b >= 64) { - crypto_core_salsa20(x, z, k, sigma); - for (i = 0; i < 64; i++) - c[cpos + i] = m[mpos + i] ^ x[i]; - u = 1; - for (i = 8; i < 16; i++) { - u = u + (z[i] & 255) | 0; - z[i] = u & 255; - u >>>= 8; - } - b -= 64; - cpos += 64; - mpos += 64; - } - if (b > 0) { - crypto_core_salsa20(x, z, k, sigma); - for (i = 0; i < b; i++) - c[cpos + i] = m[mpos + i] ^ x[i]; - } - return 0; - } - function crypto_stream_salsa20(c, cpos, b, n, k) { - var z = new Uint8Array(16), x = new Uint8Array(64); - var u, i; - for (i = 0; i < 16; i++) - z[i] = 0; - for (i = 0; i < 8; i++) - z[i] = n[i]; - while (b >= 64) { - crypto_core_salsa20(x, z, k, sigma); - for (i = 0; i < 64; i++) - c[cpos + i] = x[i]; - u = 1; - for (i = 8; i < 16; i++) { - u = u + (z[i] & 255) | 0; - z[i] = u & 255; - u >>>= 8; - } - b -= 64; - cpos += 64; - } - if (b > 0) { - crypto_core_salsa20(x, z, k, sigma); - for (i = 0; i < b; i++) - c[cpos + i] = x[i]; - } - return 0; - } - function crypto_stream(c, cpos, d, n, k) { - var s = new Uint8Array(32); - crypto_core_hsalsa20(s, n, k, sigma); - var sn = new Uint8Array(8); - for (var i = 0; i < 8; i++) - sn[i] = n[i + 16]; - return crypto_stream_salsa20(c, cpos, d, sn, s); - } - function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { - var s = new Uint8Array(32); - crypto_core_hsalsa20(s, n, k, sigma); - var sn = new Uint8Array(8); - for (var i = 0; i < 8; i++) - sn[i] = n[i + 16]; - return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); - } - var poly1305 = function(key) { - this.buffer = new Uint8Array(16); - this.r = new Uint16Array(10); - this.h = new Uint16Array(10); - this.pad = new Uint16Array(8); - this.leftover = 0; - this.fin = 0; - var t0, t1, t2, t3, t4, t5, t6, t7; - t0 = key[0] & 255 | (key[1] & 255) << 8; - this.r[0] = t0 & 8191; - t1 = key[2] & 255 | (key[3] & 255) << 8; - this.r[1] = (t0 >>> 13 | t1 << 3) & 8191; - t2 = key[4] & 255 | (key[5] & 255) << 8; - this.r[2] = (t1 >>> 10 | t2 << 6) & 7939; - t3 = key[6] & 255 | (key[7] & 255) << 8; - this.r[3] = (t2 >>> 7 | t3 << 9) & 8191; - t4 = key[8] & 255 | (key[9] & 255) << 8; - this.r[4] = (t3 >>> 4 | t4 << 12) & 255; - this.r[5] = t4 >>> 1 & 8190; - t5 = key[10] & 255 | (key[11] & 255) << 8; - this.r[6] = (t4 >>> 14 | t5 << 2) & 8191; - t6 = key[12] & 255 | (key[13] & 255) << 8; - this.r[7] = (t5 >>> 11 | t6 << 5) & 8065; - t7 = key[14] & 255 | (key[15] & 255) << 8; - this.r[8] = (t6 >>> 8 | t7 << 8) & 8191; - this.r[9] = t7 >>> 5 & 127; - this.pad[0] = key[16] & 255 | (key[17] & 255) << 8; - this.pad[1] = key[18] & 255 | (key[19] & 255) << 8; - this.pad[2] = key[20] & 255 | (key[21] & 255) << 8; - this.pad[3] = key[22] & 255 | (key[23] & 255) << 8; - this.pad[4] = key[24] & 255 | (key[25] & 255) << 8; - this.pad[5] = key[26] & 255 | (key[27] & 255) << 8; - this.pad[6] = key[28] & 255 | (key[29] & 255) << 8; - this.pad[7] = key[30] & 255 | (key[31] & 255) << 8; - }; - poly1305.prototype.blocks = function(m, mpos, bytes) { - var hibit = this.fin ? 0 : 1 << 11; - var t0, t1, t2, t3, t4, t5, t6, t7, c; - var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; - var h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9]; - var r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; - while (bytes >= 16) { - t0 = m[mpos + 0] & 255 | (m[mpos + 1] & 255) << 8; - h0 += t0 & 8191; - t1 = m[mpos + 2] & 255 | (m[mpos + 3] & 255) << 8; - h1 += (t0 >>> 13 | t1 << 3) & 8191; - t2 = m[mpos + 4] & 255 | (m[mpos + 5] & 255) << 8; - h2 += (t1 >>> 10 | t2 << 6) & 8191; - t3 = m[mpos + 6] & 255 | (m[mpos + 7] & 255) << 8; - h3 += (t2 >>> 7 | t3 << 9) & 8191; - t4 = m[mpos + 8] & 255 | (m[mpos + 9] & 255) << 8; - h4 += (t3 >>> 4 | t4 << 12) & 8191; - h5 += t4 >>> 1 & 8191; - t5 = m[mpos + 10] & 255 | (m[mpos + 11] & 255) << 8; - h6 += (t4 >>> 14 | t5 << 2) & 8191; - t6 = m[mpos + 12] & 255 | (m[mpos + 13] & 255) << 8; - h7 += (t5 >>> 11 | t6 << 5) & 8191; - t7 = m[mpos + 14] & 255 | (m[mpos + 15] & 255) << 8; - h8 += (t6 >>> 8 | t7 << 8) & 8191; - h9 += t7 >>> 5 | hibit; - c = 0; - d0 = c; - d0 += h0 * r0; - d0 += h1 * (5 * r9); - d0 += h2 * (5 * r8); - d0 += h3 * (5 * r7); - d0 += h4 * (5 * r6); - c = d0 >>> 13; - d0 &= 8191; - d0 += h5 * (5 * r5); - d0 += h6 * (5 * r4); - d0 += h7 * (5 * r3); - d0 += h8 * (5 * r2); - d0 += h9 * (5 * r1); - c += d0 >>> 13; - d0 &= 8191; - d1 = c; - d1 += h0 * r1; - d1 += h1 * r0; - d1 += h2 * (5 * r9); - d1 += h3 * (5 * r8); - d1 += h4 * (5 * r7); - c = d1 >>> 13; - d1 &= 8191; - d1 += h5 * (5 * r6); - d1 += h6 * (5 * r5); - d1 += h7 * (5 * r4); - d1 += h8 * (5 * r3); - d1 += h9 * (5 * r2); - c += d1 >>> 13; - d1 &= 8191; - d2 = c; - d2 += h0 * r2; - d2 += h1 * r1; - d2 += h2 * r0; - d2 += h3 * (5 * r9); - d2 += h4 * (5 * r8); - c = d2 >>> 13; - d2 &= 8191; - d2 += h5 * (5 * r7); - d2 += h6 * (5 * r6); - d2 += h7 * (5 * r5); - d2 += h8 * (5 * r4); - d2 += h9 * (5 * r3); - c += d2 >>> 13; - d2 &= 8191; - d3 = c; - d3 += h0 * r3; - d3 += h1 * r2; - d3 += h2 * r1; - d3 += h3 * r0; - d3 += h4 * (5 * r9); - c = d3 >>> 13; - d3 &= 8191; - d3 += h5 * (5 * r8); - d3 += h6 * (5 * r7); - d3 += h7 * (5 * r6); - d3 += h8 * (5 * r5); - d3 += h9 * (5 * r4); - c += d3 >>> 13; - d3 &= 8191; - d4 = c; - d4 += h0 * r4; - d4 += h1 * r3; - d4 += h2 * r2; - d4 += h3 * r1; - d4 += h4 * r0; - c = d4 >>> 13; - d4 &= 8191; - d4 += h5 * (5 * r9); - d4 += h6 * (5 * r8); - d4 += h7 * (5 * r7); - d4 += h8 * (5 * r6); - d4 += h9 * (5 * r5); - c += d4 >>> 13; - d4 &= 8191; - d5 = c; - d5 += h0 * r5; - d5 += h1 * r4; - d5 += h2 * r3; - d5 += h3 * r2; - d5 += h4 * r1; - c = d5 >>> 13; - d5 &= 8191; - d5 += h5 * r0; - d5 += h6 * (5 * r9); - d5 += h7 * (5 * r8); - d5 += h8 * (5 * r7); - d5 += h9 * (5 * r6); - c += d5 >>> 13; - d5 &= 8191; - d6 = c; - d6 += h0 * r6; - d6 += h1 * r5; - d6 += h2 * r4; - d6 += h3 * r3; - d6 += h4 * r2; - c = d6 >>> 13; - d6 &= 8191; - d6 += h5 * r1; - d6 += h6 * r0; - d6 += h7 * (5 * r9); - d6 += h8 * (5 * r8); - d6 += h9 * (5 * r7); - c += d6 >>> 13; - d6 &= 8191; - d7 = c; - d7 += h0 * r7; - d7 += h1 * r6; - d7 += h2 * r5; - d7 += h3 * r4; - d7 += h4 * r3; - c = d7 >>> 13; - d7 &= 8191; - d7 += h5 * r2; - d7 += h6 * r1; - d7 += h7 * r0; - d7 += h8 * (5 * r9); - d7 += h9 * (5 * r8); - c += d7 >>> 13; - d7 &= 8191; - d8 = c; - d8 += h0 * r8; - d8 += h1 * r7; - d8 += h2 * r6; - d8 += h3 * r5; - d8 += h4 * r4; - c = d8 >>> 13; - d8 &= 8191; - d8 += h5 * r3; - d8 += h6 * r2; - d8 += h7 * r1; - d8 += h8 * r0; - d8 += h9 * (5 * r9); - c += d8 >>> 13; - d8 &= 8191; - d9 = c; - d9 += h0 * r9; - d9 += h1 * r8; - d9 += h2 * r7; - d9 += h3 * r6; - d9 += h4 * r5; - c = d9 >>> 13; - d9 &= 8191; - d9 += h5 * r4; - d9 += h6 * r3; - d9 += h7 * r2; - d9 += h8 * r1; - d9 += h9 * r0; - c += d9 >>> 13; - d9 &= 8191; - c = (c << 2) + c | 0; - c = c + d0 | 0; - d0 = c & 8191; - c = c >>> 13; - d1 += c; - h0 = d0; - h1 = d1; - h2 = d2; - h3 = d3; - h4 = d4; - h5 = d5; - h6 = d6; - h7 = d7; - h8 = d8; - h9 = d9; - mpos += 16; - bytes -= 16; - } - this.h[0] = h0; - this.h[1] = h1; - this.h[2] = h2; - this.h[3] = h3; - this.h[4] = h4; - this.h[5] = h5; - this.h[6] = h6; - this.h[7] = h7; - this.h[8] = h8; - this.h[9] = h9; - }; - poly1305.prototype.finish = function(mac, macpos) { - var g = new Uint16Array(10); - var c, mask2, f, i; - if (this.leftover) { - i = this.leftover; - this.buffer[i++] = 1; - for (; i < 16; i++) - this.buffer[i] = 0; - this.fin = 1; - this.blocks(this.buffer, 0, 16); - } - c = this.h[1] >>> 13; - this.h[1] &= 8191; - for (i = 2; i < 10; i++) { - this.h[i] += c; - c = this.h[i] >>> 13; - this.h[i] &= 8191; - } - this.h[0] += c * 5; - c = this.h[0] >>> 13; - this.h[0] &= 8191; - this.h[1] += c; - c = this.h[1] >>> 13; - this.h[1] &= 8191; - this.h[2] += c; - g[0] = this.h[0] + 5; - c = g[0] >>> 13; - g[0] &= 8191; - for (i = 1; i < 10; i++) { - g[i] = this.h[i] + c; - c = g[i] >>> 13; - g[i] &= 8191; - } - g[9] -= 1 << 13; - mask2 = (c ^ 1) - 1; - for (i = 0; i < 10; i++) - g[i] &= mask2; - mask2 = ~mask2; - for (i = 0; i < 10; i++) - this.h[i] = this.h[i] & mask2 | g[i]; - this.h[0] = (this.h[0] | this.h[1] << 13) & 65535; - this.h[1] = (this.h[1] >>> 3 | this.h[2] << 10) & 65535; - this.h[2] = (this.h[2] >>> 6 | this.h[3] << 7) & 65535; - this.h[3] = (this.h[3] >>> 9 | this.h[4] << 4) & 65535; - this.h[4] = (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14) & 65535; - this.h[5] = (this.h[6] >>> 2 | this.h[7] << 11) & 65535; - this.h[6] = (this.h[7] >>> 5 | this.h[8] << 8) & 65535; - this.h[7] = (this.h[8] >>> 8 | this.h[9] << 5) & 65535; - f = this.h[0] + this.pad[0]; - this.h[0] = f & 65535; - for (i = 1; i < 8; i++) { - f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0; - this.h[i] = f & 65535; - } - mac[macpos + 0] = this.h[0] >>> 0 & 255; - mac[macpos + 1] = this.h[0] >>> 8 & 255; - mac[macpos + 2] = this.h[1] >>> 0 & 255; - mac[macpos + 3] = this.h[1] >>> 8 & 255; - mac[macpos + 4] = this.h[2] >>> 0 & 255; - mac[macpos + 5] = this.h[2] >>> 8 & 255; - mac[macpos + 6] = this.h[3] >>> 0 & 255; - mac[macpos + 7] = this.h[3] >>> 8 & 255; - mac[macpos + 8] = this.h[4] >>> 0 & 255; - mac[macpos + 9] = this.h[4] >>> 8 & 255; - mac[macpos + 10] = this.h[5] >>> 0 & 255; - mac[macpos + 11] = this.h[5] >>> 8 & 255; - mac[macpos + 12] = this.h[6] >>> 0 & 255; - mac[macpos + 13] = this.h[6] >>> 8 & 255; - mac[macpos + 14] = this.h[7] >>> 0 & 255; - mac[macpos + 15] = this.h[7] >>> 8 & 255; - }; - poly1305.prototype.update = function(m, mpos, bytes) { - var i, want; - if (this.leftover) { - want = 16 - this.leftover; - if (want > bytes) - want = bytes; - for (i = 0; i < want; i++) - this.buffer[this.leftover + i] = m[mpos + i]; - bytes -= want; - mpos += want; - this.leftover += want; - if (this.leftover < 16) - return; - this.blocks(this.buffer, 0, 16); - this.leftover = 0; - } - if (bytes >= 16) { - want = bytes - bytes % 16; - this.blocks(m, mpos, want); - mpos += want; - bytes -= want; - } - if (bytes) { - for (i = 0; i < bytes; i++) - this.buffer[this.leftover + i] = m[mpos + i]; - this.leftover += bytes; - } - }; - function crypto_onetimeauth(out, outpos, m, mpos, n, k) { - var s = new poly1305(k); - s.update(m, mpos, n); - s.finish(out, outpos); - return 0; - } - function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { - var x = new Uint8Array(16); - crypto_onetimeauth(x, 0, m, mpos, n, k); - return crypto_verify_16(h, hpos, x, 0); - } - function crypto_secretbox(c, m, d, n, k) { - var i; - if (d < 32) - return -1; - crypto_stream_xor(c, 0, m, 0, d, n, k); - crypto_onetimeauth(c, 16, c, 32, d - 32, c); - for (i = 0; i < 16; i++) - c[i] = 0; - return 0; - } - function crypto_secretbox_open(m, c, d, n, k) { - var i; - var x = new Uint8Array(32); - if (d < 32) - return -1; - crypto_stream(x, 0, 32, n, k); - if (crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x) !== 0) - return -1; - crypto_stream_xor(m, 0, c, 0, d, n, k); - for (i = 0; i < 32; i++) - m[i] = 0; - return 0; - } - function set25519(r, a) { - var i; - for (i = 0; i < 16; i++) - r[i] = a[i] | 0; - } - function car25519(o) { - var i, v, c = 1; - for (i = 0; i < 16; i++) { - v = o[i] + c + 65535; - c = Math.floor(v / 65536); - o[i] = v - c * 65536; - } - o[0] += c - 1 + 37 * (c - 1); - } - function sel25519(p, q, b) { - var t, c = ~(b - 1); - for (var i = 0; i < 16; i++) { - t = c & (p[i] ^ q[i]); - p[i] ^= t; - q[i] ^= t; - } - } - function pack25519(o, n) { - var i, j, b; - var m = gf(), t = gf(); - for (i = 0; i < 16; i++) - t[i] = n[i]; - car25519(t); - car25519(t); - car25519(t); - for (j = 0; j < 2; j++) { - m[0] = t[0] - 65517; - for (i = 1; i < 15; i++) { - m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1); - m[i - 1] &= 65535; - } - m[15] = t[15] - 32767 - (m[14] >> 16 & 1); - b = m[15] >> 16 & 1; - m[14] &= 65535; - sel25519(t, m, 1 - b); - } - for (i = 0; i < 16; i++) { - o[2 * i] = t[i] & 255; - o[2 * i + 1] = t[i] >> 8; - } - } - function neq25519(a, b) { - var c = new Uint8Array(32), d = new Uint8Array(32); - pack25519(c, a); - pack25519(d, b); - return crypto_verify_32(c, 0, d, 0); - } - function par25519(a) { - var d = new Uint8Array(32); - pack25519(d, a); - return d[0] & 1; - } - function unpack25519(o, n) { - var i; - for (i = 0; i < 16; i++) - o[i] = n[2 * i] + (n[2 * i + 1] << 8); - o[15] &= 32767; - } - function A(o, a, b) { - for (var i = 0; i < 16; i++) - o[i] = a[i] + b[i]; - } - function Z(o, a, b) { - for (var i = 0; i < 16; i++) - o[i] = a[i] - b[i]; - } - function M(o, a, b) { - var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; - v = a[0]; - t0 += v * b0; - t1 += v * b1; - t2 += v * b2; - t3 += v * b3; - t4 += v * b4; - t5 += v * b5; - t6 += v * b6; - t7 += v * b7; - t8 += v * b8; - t9 += v * b9; - t10 += v * b10; - t11 += v * b11; - t12 += v * b12; - t13 += v * b13; - t14 += v * b14; - t15 += v * b15; - v = a[1]; - t1 += v * b0; - t2 += v * b1; - t3 += v * b2; - t4 += v * b3; - t5 += v * b4; - t6 += v * b5; - t7 += v * b6; - t8 += v * b7; - t9 += v * b8; - t10 += v * b9; - t11 += v * b10; - t12 += v * b11; - t13 += v * b12; - t14 += v * b13; - t15 += v * b14; - t16 += v * b15; - v = a[2]; - t2 += v * b0; - t3 += v * b1; - t4 += v * b2; - t5 += v * b3; - t6 += v * b4; - t7 += v * b5; - t8 += v * b6; - t9 += v * b7; - t10 += v * b8; - t11 += v * b9; - t12 += v * b10; - t13 += v * b11; - t14 += v * b12; - t15 += v * b13; - t16 += v * b14; - t17 += v * b15; - v = a[3]; - t3 += v * b0; - t4 += v * b1; - t5 += v * b2; - t6 += v * b3; - t7 += v * b4; - t8 += v * b5; - t9 += v * b6; - t10 += v * b7; - t11 += v * b8; - t12 += v * b9; - t13 += v * b10; - t14 += v * b11; - t15 += v * b12; - t16 += v * b13; - t17 += v * b14; - t18 += v * b15; - v = a[4]; - t4 += v * b0; - t5 += v * b1; - t6 += v * b2; - t7 += v * b3; - t8 += v * b4; - t9 += v * b5; - t10 += v * b6; - t11 += v * b7; - t12 += v * b8; - t13 += v * b9; - t14 += v * b10; - t15 += v * b11; - t16 += v * b12; - t17 += v * b13; - t18 += v * b14; - t19 += v * b15; - v = a[5]; - t5 += v * b0; - t6 += v * b1; - t7 += v * b2; - t8 += v * b3; - t9 += v * b4; - t10 += v * b5; - t11 += v * b6; - t12 += v * b7; - t13 += v * b8; - t14 += v * b9; - t15 += v * b10; - t16 += v * b11; - t17 += v * b12; - t18 += v * b13; - t19 += v * b14; - t20 += v * b15; - v = a[6]; - t6 += v * b0; - t7 += v * b1; - t8 += v * b2; - t9 += v * b3; - t10 += v * b4; - t11 += v * b5; - t12 += v * b6; - t13 += v * b7; - t14 += v * b8; - t15 += v * b9; - t16 += v * b10; - t17 += v * b11; - t18 += v * b12; - t19 += v * b13; - t20 += v * b14; - t21 += v * b15; - v = a[7]; - t7 += v * b0; - t8 += v * b1; - t9 += v * b2; - t10 += v * b3; - t11 += v * b4; - t12 += v * b5; - t13 += v * b6; - t14 += v * b7; - t15 += v * b8; - t16 += v * b9; - t17 += v * b10; - t18 += v * b11; - t19 += v * b12; - t20 += v * b13; - t21 += v * b14; - t22 += v * b15; - v = a[8]; - t8 += v * b0; - t9 += v * b1; - t10 += v * b2; - t11 += v * b3; - t12 += v * b4; - t13 += v * b5; - t14 += v * b6; - t15 += v * b7; - t16 += v * b8; - t17 += v * b9; - t18 += v * b10; - t19 += v * b11; - t20 += v * b12; - t21 += v * b13; - t22 += v * b14; - t23 += v * b15; - v = a[9]; - t9 += v * b0; - t10 += v * b1; - t11 += v * b2; - t12 += v * b3; - t13 += v * b4; - t14 += v * b5; - t15 += v * b6; - t16 += v * b7; - t17 += v * b8; - t18 += v * b9; - t19 += v * b10; - t20 += v * b11; - t21 += v * b12; - t22 += v * b13; - t23 += v * b14; - t24 += v * b15; - v = a[10]; - t10 += v * b0; - t11 += v * b1; - t12 += v * b2; - t13 += v * b3; - t14 += v * b4; - t15 += v * b5; - t16 += v * b6; - t17 += v * b7; - t18 += v * b8; - t19 += v * b9; - t20 += v * b10; - t21 += v * b11; - t22 += v * b12; - t23 += v * b13; - t24 += v * b14; - t25 += v * b15; - v = a[11]; - t11 += v * b0; - t12 += v * b1; - t13 += v * b2; - t14 += v * b3; - t15 += v * b4; - t16 += v * b5; - t17 += v * b6; - t18 += v * b7; - t19 += v * b8; - t20 += v * b9; - t21 += v * b10; - t22 += v * b11; - t23 += v * b12; - t24 += v * b13; - t25 += v * b14; - t26 += v * b15; - v = a[12]; - t12 += v * b0; - t13 += v * b1; - t14 += v * b2; - t15 += v * b3; - t16 += v * b4; - t17 += v * b5; - t18 += v * b6; - t19 += v * b7; - t20 += v * b8; - t21 += v * b9; - t22 += v * b10; - t23 += v * b11; - t24 += v * b12; - t25 += v * b13; - t26 += v * b14; - t27 += v * b15; - v = a[13]; - t13 += v * b0; - t14 += v * b1; - t15 += v * b2; - t16 += v * b3; - t17 += v * b4; - t18 += v * b5; - t19 += v * b6; - t20 += v * b7; - t21 += v * b8; - t22 += v * b9; - t23 += v * b10; - t24 += v * b11; - t25 += v * b12; - t26 += v * b13; - t27 += v * b14; - t28 += v * b15; - v = a[14]; - t14 += v * b0; - t15 += v * b1; - t16 += v * b2; - t17 += v * b3; - t18 += v * b4; - t19 += v * b5; - t20 += v * b6; - t21 += v * b7; - t22 += v * b8; - t23 += v * b9; - t24 += v * b10; - t25 += v * b11; - t26 += v * b12; - t27 += v * b13; - t28 += v * b14; - t29 += v * b15; - v = a[15]; - t15 += v * b0; - t16 += v * b1; - t17 += v * b2; - t18 += v * b3; - t19 += v * b4; - t20 += v * b5; - t21 += v * b6; - t22 += v * b7; - t23 += v * b8; - t24 += v * b9; - t25 += v * b10; - t26 += v * b11; - t27 += v * b12; - t28 += v * b13; - t29 += v * b14; - t30 += v * b15; - t0 += 38 * t16; - t1 += 38 * t17; - t2 += 38 * t18; - t3 += 38 * t19; - t4 += 38 * t20; - t5 += 38 * t21; - t6 += 38 * t22; - t7 += 38 * t23; - t8 += 38 * t24; - t9 += 38 * t25; - t10 += 38 * t26; - t11 += 38 * t27; - t12 += 38 * t28; - t13 += 38 * t29; - t14 += 38 * t30; - c = 1; - v = t0 + c + 65535; - c = Math.floor(v / 65536); - t0 = v - c * 65536; - v = t1 + c + 65535; - c = Math.floor(v / 65536); - t1 = v - c * 65536; - v = t2 + c + 65535; - c = Math.floor(v / 65536); - t2 = v - c * 65536; - v = t3 + c + 65535; - c = Math.floor(v / 65536); - t3 = v - c * 65536; - v = t4 + c + 65535; - c = Math.floor(v / 65536); - t4 = v - c * 65536; - v = t5 + c + 65535; - c = Math.floor(v / 65536); - t5 = v - c * 65536; - v = t6 + c + 65535; - c = Math.floor(v / 65536); - t6 = v - c * 65536; - v = t7 + c + 65535; - c = Math.floor(v / 65536); - t7 = v - c * 65536; - v = t8 + c + 65535; - c = Math.floor(v / 65536); - t8 = v - c * 65536; - v = t9 + c + 65535; - c = Math.floor(v / 65536); - t9 = v - c * 65536; - v = t10 + c + 65535; - c = Math.floor(v / 65536); - t10 = v - c * 65536; - v = t11 + c + 65535; - c = Math.floor(v / 65536); - t11 = v - c * 65536; - v = t12 + c + 65535; - c = Math.floor(v / 65536); - t12 = v - c * 65536; - v = t13 + c + 65535; - c = Math.floor(v / 65536); - t13 = v - c * 65536; - v = t14 + c + 65535; - c = Math.floor(v / 65536); - t14 = v - c * 65536; - v = t15 + c + 65535; - c = Math.floor(v / 65536); - t15 = v - c * 65536; - t0 += c - 1 + 37 * (c - 1); - c = 1; - v = t0 + c + 65535; - c = Math.floor(v / 65536); - t0 = v - c * 65536; - v = t1 + c + 65535; - c = Math.floor(v / 65536); - t1 = v - c * 65536; - v = t2 + c + 65535; - c = Math.floor(v / 65536); - t2 = v - c * 65536; - v = t3 + c + 65535; - c = Math.floor(v / 65536); - t3 = v - c * 65536; - v = t4 + c + 65535; - c = Math.floor(v / 65536); - t4 = v - c * 65536; - v = t5 + c + 65535; - c = Math.floor(v / 65536); - t5 = v - c * 65536; - v = t6 + c + 65535; - c = Math.floor(v / 65536); - t6 = v - c * 65536; - v = t7 + c + 65535; - c = Math.floor(v / 65536); - t7 = v - c * 65536; - v = t8 + c + 65535; - c = Math.floor(v / 65536); - t8 = v - c * 65536; - v = t9 + c + 65535; - c = Math.floor(v / 65536); - t9 = v - c * 65536; - v = t10 + c + 65535; - c = Math.floor(v / 65536); - t10 = v - c * 65536; - v = t11 + c + 65535; - c = Math.floor(v / 65536); - t11 = v - c * 65536; - v = t12 + c + 65535; - c = Math.floor(v / 65536); - t12 = v - c * 65536; - v = t13 + c + 65535; - c = Math.floor(v / 65536); - t13 = v - c * 65536; - v = t14 + c + 65535; - c = Math.floor(v / 65536); - t14 = v - c * 65536; - v = t15 + c + 65535; - c = Math.floor(v / 65536); - t15 = v - c * 65536; - t0 += c - 1 + 37 * (c - 1); - o[0] = t0; - o[1] = t1; - o[2] = t2; - o[3] = t3; - o[4] = t4; - o[5] = t5; - o[6] = t6; - o[7] = t7; - o[8] = t8; - o[9] = t9; - o[10] = t10; - o[11] = t11; - o[12] = t12; - o[13] = t13; - o[14] = t14; - o[15] = t15; - } - function S(o, a) { - M(o, a, a); - } - function inv25519(o, i) { - var c = gf(); - var a; - for (a = 0; a < 16; a++) - c[a] = i[a]; - for (a = 253; a >= 0; a--) { - S(c, c); - if (a !== 2 && a !== 4) - M(c, c, i); - } - for (a = 0; a < 16; a++) - o[a] = c[a]; - } - function pow2523(o, i) { - var c = gf(); - var a; - for (a = 0; a < 16; a++) - c[a] = i[a]; - for (a = 250; a >= 0; a--) { - S(c, c); - if (a !== 1) - M(c, c, i); - } - for (a = 0; a < 16; a++) - o[a] = c[a]; - } - function crypto_scalarmult(q, n, p) { - var z = new Uint8Array(32); - var x = new Float64Array(80), r, i; - var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); - for (i = 0; i < 31; i++) - z[i] = n[i]; - z[31] = n[31] & 127 | 64; - z[0] &= 248; - unpack25519(x, p); - for (i = 0; i < 16; i++) { - b[i] = x[i]; - d[i] = a[i] = c[i] = 0; - } - a[0] = d[0] = 1; - for (i = 254; i >= 0; --i) { - r = z[i >>> 3] >>> (i & 7) & 1; - sel25519(a, b, r); - sel25519(c, d, r); - A(e, a, c); - Z(a, a, c); - A(c, b, d); - Z(b, b, d); - S(d, e); - S(f, a); - M(a, c, a); - M(c, b, e); - A(e, a, c); - Z(a, a, c); - S(b, a); - Z(c, d, f); - M(a, c, _121665); - A(a, a, d); - M(c, c, a); - M(a, d, f); - M(d, b, x); - S(b, e); - sel25519(a, b, r); - sel25519(c, d, r); - } - for (i = 0; i < 16; i++) { - x[i + 16] = a[i]; - x[i + 32] = c[i]; - x[i + 48] = b[i]; - x[i + 64] = d[i]; - } - var x32 = x.subarray(32); - var x16 = x.subarray(16); - inv25519(x32, x32); - M(x16, x16, x32); - pack25519(q, x16); - return 0; - } - function crypto_scalarmult_base(q, n) { - return crypto_scalarmult(q, n, _9); - } - function crypto_box_keypair(y, x) { - randombytes(x, 32); - return crypto_scalarmult_base(y, x); - } - function crypto_box_beforenm(k, y, x) { - var s = new Uint8Array(32); - crypto_scalarmult(s, x, y); - return crypto_core_hsalsa20(k, _0, s, sigma); - } - var crypto_box_afternm = crypto_secretbox; - var crypto_box_open_afternm = crypto_secretbox_open; - function crypto_box(c, m, d, n, y, x) { - var k = new Uint8Array(32); - crypto_box_beforenm(k, y, x); - return crypto_box_afternm(c, m, d, n, k); - } - function crypto_box_open(m, c, d, n, y, x) { - var k = new Uint8Array(32); - crypto_box_beforenm(k, y, x); - return crypto_box_open_afternm(m, c, d, n, k); - } - var K = [ - 1116352408, - 3609767458, - 1899447441, - 602891725, - 3049323471, - 3964484399, - 3921009573, - 2173295548, - 961987163, - 4081628472, - 1508970993, - 3053834265, - 2453635748, - 2937671579, - 2870763221, - 3664609560, - 3624381080, - 2734883394, - 310598401, - 1164996542, - 607225278, - 1323610764, - 1426881987, - 3590304994, - 1925078388, - 4068182383, - 2162078206, - 991336113, - 2614888103, - 633803317, - 3248222580, - 3479774868, - 3835390401, - 2666613458, - 4022224774, - 944711139, - 264347078, - 2341262773, - 604807628, - 2007800933, - 770255983, - 1495990901, - 1249150122, - 1856431235, - 1555081692, - 3175218132, - 1996064986, - 2198950837, - 2554220882, - 3999719339, - 2821834349, - 766784016, - 2952996808, - 2566594879, - 3210313671, - 3203337956, - 3336571891, - 1034457026, - 3584528711, - 2466948901, - 113926993, - 3758326383, - 338241895, - 168717936, - 666307205, - 1188179964, - 773529912, - 1546045734, - 1294757372, - 1522805485, - 1396182291, - 2643833823, - 1695183700, - 2343527390, - 1986661051, - 1014477480, - 2177026350, - 1206759142, - 2456956037, - 344077627, - 2730485921, - 1290863460, - 2820302411, - 3158454273, - 3259730800, - 3505952657, - 3345764771, - 106217008, - 3516065817, - 3606008344, - 3600352804, - 1432725776, - 4094571909, - 1467031594, - 275423344, - 851169720, - 430227734, - 3100823752, - 506948616, - 1363258195, - 659060556, - 3750685593, - 883997877, - 3785050280, - 958139571, - 3318307427, - 1322822218, - 3812723403, - 1537002063, - 2003034995, - 1747873779, - 3602036899, - 1955562222, - 1575990012, - 2024104815, - 1125592928, - 2227730452, - 2716904306, - 2361852424, - 442776044, - 2428436474, - 593698344, - 2756734187, - 3733110249, - 3204031479, - 2999351573, - 3329325298, - 3815920427, - 3391569614, - 3928383900, - 3515267271, - 566280711, - 3940187606, - 3454069534, - 4118630271, - 4000239992, - 116418474, - 1914138554, - 174292421, - 2731055270, - 289380356, - 3203993006, - 460393269, - 320620315, - 685471733, - 587496836, - 852142971, - 1086792851, - 1017036298, - 365543100, - 1126000580, - 2618297676, - 1288033470, - 3409855158, - 1501505948, - 4234509866, - 1607167915, - 987167468, - 1816402316, - 1246189591 - ]; - function crypto_hashblocks_hl(hh, hl, m, n) { - var wh = new Int32Array(16), wl = new Int32Array(16), bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d; - var ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7]; - var pos = 0; - while (n >= 128) { - for (i = 0; i < 16; i++) { - j = 8 * i + pos; - wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3]; - wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; - } - for (i = 0; i < 80; i++) { - bh0 = ah0; - bh1 = ah1; - bh2 = ah2; - bh3 = ah3; - bh4 = ah4; - bh5 = ah5; - bh6 = ah6; - bh7 = ah7; - bl0 = al0; - bl1 = al1; - bl2 = al2; - bl3 = al3; - bl4 = al4; - bl5 = al5; - bl6 = al6; - bl7 = al7; - h = ah7; - l = al7; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = (ah4 >>> 14 | al4 << 32 - 14) ^ (ah4 >>> 18 | al4 << 32 - 18) ^ (al4 >>> 41 - 32 | ah4 << 32 - (41 - 32)); - l = (al4 >>> 14 | ah4 << 32 - 14) ^ (al4 >>> 18 | ah4 << 32 - 18) ^ (ah4 >>> 41 - 32 | al4 << 32 - (41 - 32)); - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - h = ah4 & ah5 ^ ~ah4 & ah6; - l = al4 & al5 ^ ~al4 & al6; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - h = K[i * 2]; - l = K[i * 2 + 1]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - h = wh[i % 16]; - l = wl[i % 16]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - th = c & 65535 | d << 16; - tl = a & 65535 | b << 16; - h = th; - l = tl; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = (ah0 >>> 28 | al0 << 32 - 28) ^ (al0 >>> 34 - 32 | ah0 << 32 - (34 - 32)) ^ (al0 >>> 39 - 32 | ah0 << 32 - (39 - 32)); - l = (al0 >>> 28 | ah0 << 32 - 28) ^ (ah0 >>> 34 - 32 | al0 << 32 - (34 - 32)) ^ (ah0 >>> 39 - 32 | al0 << 32 - (39 - 32)); - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2; - l = al0 & al1 ^ al0 & al2 ^ al1 & al2; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - bh7 = c & 65535 | d << 16; - bl7 = a & 65535 | b << 16; - h = bh3; - l = bl3; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = th; - l = tl; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - bh3 = c & 65535 | d << 16; - bl3 = a & 65535 | b << 16; - ah1 = bh0; - ah2 = bh1; - ah3 = bh2; - ah4 = bh3; - ah5 = bh4; - ah6 = bh5; - ah7 = bh6; - ah0 = bh7; - al1 = bl0; - al2 = bl1; - al3 = bl2; - al4 = bl3; - al5 = bl4; - al6 = bl5; - al7 = bl6; - al0 = bl7; - if (i % 16 === 15) { - for (j = 0; j < 16; j++) { - h = wh[j]; - l = wl[j]; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = wh[(j + 9) % 16]; - l = wl[(j + 9) % 16]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - th = wh[(j + 1) % 16]; - tl = wl[(j + 1) % 16]; - h = (th >>> 1 | tl << 32 - 1) ^ (th >>> 8 | tl << 32 - 8) ^ th >>> 7; - l = (tl >>> 1 | th << 32 - 1) ^ (tl >>> 8 | th << 32 - 8) ^ (tl >>> 7 | th << 32 - 7); - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - th = wh[(j + 14) % 16]; - tl = wl[(j + 14) % 16]; - h = (th >>> 19 | tl << 32 - 19) ^ (tl >>> 61 - 32 | th << 32 - (61 - 32)) ^ th >>> 6; - l = (tl >>> 19 | th << 32 - 19) ^ (th >>> 61 - 32 | tl << 32 - (61 - 32)) ^ (tl >>> 6 | th << 32 - 6); - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - wh[j] = c & 65535 | d << 16; - wl[j] = a & 65535 | b << 16; - } - } - } - h = ah0; - l = al0; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[0]; - l = hl[0]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[0] = ah0 = c & 65535 | d << 16; - hl[0] = al0 = a & 65535 | b << 16; - h = ah1; - l = al1; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[1]; - l = hl[1]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[1] = ah1 = c & 65535 | d << 16; - hl[1] = al1 = a & 65535 | b << 16; - h = ah2; - l = al2; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[2]; - l = hl[2]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[2] = ah2 = c & 65535 | d << 16; - hl[2] = al2 = a & 65535 | b << 16; - h = ah3; - l = al3; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[3]; - l = hl[3]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[3] = ah3 = c & 65535 | d << 16; - hl[3] = al3 = a & 65535 | b << 16; - h = ah4; - l = al4; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[4]; - l = hl[4]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[4] = ah4 = c & 65535 | d << 16; - hl[4] = al4 = a & 65535 | b << 16; - h = ah5; - l = al5; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[5]; - l = hl[5]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[5] = ah5 = c & 65535 | d << 16; - hl[5] = al5 = a & 65535 | b << 16; - h = ah6; - l = al6; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[6]; - l = hl[6]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[6] = ah6 = c & 65535 | d << 16; - hl[6] = al6 = a & 65535 | b << 16; - h = ah7; - l = al7; - a = l & 65535; - b = l >>> 16; - c = h & 65535; - d = h >>> 16; - h = hh[7]; - l = hl[7]; - a += l & 65535; - b += l >>> 16; - c += h & 65535; - d += h >>> 16; - b += a >>> 16; - c += b >>> 16; - d += c >>> 16; - hh[7] = ah7 = c & 65535 | d << 16; - hl[7] = al7 = a & 65535 | b << 16; - pos += 128; - n -= 128; - } - return n; - } - function crypto_hash(out, m, n) { - var hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), i, b = n; - hh[0] = 1779033703; - hh[1] = 3144134277; - hh[2] = 1013904242; - hh[3] = 2773480762; - hh[4] = 1359893119; - hh[5] = 2600822924; - hh[6] = 528734635; - hh[7] = 1541459225; - hl[0] = 4089235720; - hl[1] = 2227873595; - hl[2] = 4271175723; - hl[3] = 1595750129; - hl[4] = 2917565137; - hl[5] = 725511199; - hl[6] = 4215389547; - hl[7] = 327033209; - crypto_hashblocks_hl(hh, hl, m, n); - n %= 128; - for (i = 0; i < n; i++) - x[i] = m[b - n + i]; - x[n] = 128; - n = 256 - 128 * (n < 112 ? 1 : 0); - x[n - 9] = 0; - ts64(x, n - 8, b / 536870912 | 0, b << 3); - crypto_hashblocks_hl(hh, hl, x, n); - for (i = 0; i < 8; i++) - ts64(out, 8 * i, hh[i], hl[i]); - return 0; - } - function add2(p, q) { - var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); - Z(a, p[1], p[0]); - Z(t, q[1], q[0]); - M(a, a, t); - A(b, p[0], p[1]); - A(t, q[0], q[1]); - M(b, b, t); - M(c, p[3], q[3]); - M(c, c, D2); - M(d, p[2], q[2]); - A(d, d, d); - Z(e, b, a); - Z(f, d, c); - A(g, d, c); - A(h, b, a); - M(p[0], e, f); - M(p[1], h, g); - M(p[2], g, f); - M(p[3], e, h); - } - function cswap(p, q, b) { - var i; - for (i = 0; i < 4; i++) { - sel25519(p[i], q[i], b); - } - } - function pack(r, p) { - var tx = gf(), ty = gf(), zi = gf(); - inv25519(zi, p[2]); - M(tx, p[0], zi); - M(ty, p[1], zi); - pack25519(r, ty); - r[31] ^= par25519(tx) << 7; - } - function scalarmult(p, q, s) { - var b, i; - set25519(p[0], gf0); - set25519(p[1], gf1); - set25519(p[2], gf1); - set25519(p[3], gf0); - for (i = 255; i >= 0; --i) { - b = s[i / 8 | 0] >> (i & 7) & 1; - cswap(p, q, b); - add2(q, p); - add2(p, p); - cswap(p, q, b); - } - } - function scalarbase(p, s) { - var q = [gf(), gf(), gf(), gf()]; - set25519(q[0], X); - set25519(q[1], Y); - set25519(q[2], gf1); - M(q[3], X, Y); - scalarmult(p, q, s); - } - function crypto_sign_keypair(pk, sk, seeded) { - var d = new Uint8Array(64); - var p = [gf(), gf(), gf(), gf()]; - var i; - if (!seeded) - randombytes(sk, 32); - crypto_hash(d, sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - scalarbase(p, d); - pack(pk, p); - for (i = 0; i < 32; i++) - sk[i + 32] = pk[i]; - return 0; - } - var L = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]); - function modL(r, x) { - var carry, i, j, k; - for (i = 63; i >= 32; --i) { - carry = 0; - for (j = i - 32, k = i - 12; j < k; ++j) { - x[j] += carry - 16 * x[i] * L[j - (i - 32)]; - carry = Math.floor((x[j] + 128) / 256); - x[j] -= carry * 256; - } - x[j] += carry; - x[i] = 0; - } - carry = 0; - for (j = 0; j < 32; j++) { - x[j] += carry - (x[31] >> 4) * L[j]; - carry = x[j] >> 8; - x[j] &= 255; - } - for (j = 0; j < 32; j++) - x[j] -= carry * L[j]; - for (i = 0; i < 32; i++) { - x[i + 1] += x[i] >> 8; - r[i] = x[i] & 255; - } - } - function reduce(r) { - var x = new Float64Array(64), i; - for (i = 0; i < 64; i++) - x[i] = r[i]; - for (i = 0; i < 64; i++) - r[i] = 0; - modL(r, x); - } - function crypto_sign(sm, m, n, sk) { - var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); - var i, j, x = new Float64Array(64); - var p = [gf(), gf(), gf(), gf()]; - crypto_hash(d, sk, 32); - d[0] &= 248; - d[31] &= 127; - d[31] |= 64; - var smlen = n + 64; - for (i = 0; i < n; i++) - sm[64 + i] = m[i]; - for (i = 0; i < 32; i++) - sm[32 + i] = d[32 + i]; - crypto_hash(r, sm.subarray(32), n + 32); - reduce(r); - scalarbase(p, r); - pack(sm, p); - for (i = 32; i < 64; i++) - sm[i] = sk[i]; - crypto_hash(h, sm, n + 64); - reduce(h); - for (i = 0; i < 64; i++) - x[i] = 0; - for (i = 0; i < 32; i++) - x[i] = r[i]; - for (i = 0; i < 32; i++) { - for (j = 0; j < 32; j++) { - x[i + j] += h[i] * d[j]; - } - } - modL(sm.subarray(32), x); - return smlen; - } - function unpackneg(r, p) { - var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); - set25519(r[2], gf1); - unpack25519(r[1], p); - S(num, r[1]); - M(den, num, D); - Z(num, num, r[2]); - A(den, r[2], den); - S(den2, den); - S(den4, den2); - M(den6, den4, den2); - M(t, den6, num); - M(t, t, den); - pow2523(t, t); - M(t, t, num); - M(t, t, den); - M(t, t, den); - M(r[0], t, den); - S(chk, r[0]); - M(chk, chk, den); - if (neq25519(chk, num)) - M(r[0], r[0], I); - S(chk, r[0]); - M(chk, chk, den); - if (neq25519(chk, num)) - return -1; - if (par25519(r[0]) === p[31] >> 7) - Z(r[0], gf0, r[0]); - M(r[3], r[0], r[1]); - return 0; - } - function crypto_sign_open(m, sm, n, pk) { - var i; - var t = new Uint8Array(32), h = new Uint8Array(64); - var p = [gf(), gf(), gf(), gf()], q = [gf(), gf(), gf(), gf()]; - if (n < 64) - return -1; - if (unpackneg(q, pk)) - return -1; - for (i = 0; i < n; i++) - m[i] = sm[i]; - for (i = 0; i < 32; i++) - m[i + 32] = pk[i]; - crypto_hash(h, m, n); - reduce(h); - scalarmult(p, q, h); - scalarbase(q, sm.subarray(32)); - add2(p, q); - pack(t, p); - n -= 64; - if (crypto_verify_32(sm, 0, t, 0)) { - for (i = 0; i < n; i++) - m[i] = 0; - return -1; - } - for (i = 0; i < n; i++) - m[i] = sm[i + 64]; - return n; - } - var crypto_secretbox_KEYBYTES = 32, crypto_secretbox_NONCEBYTES = 24, crypto_secretbox_ZEROBYTES = 32, crypto_secretbox_BOXZEROBYTES = 16, crypto_scalarmult_BYTES = 32, crypto_scalarmult_SCALARBYTES = 32, crypto_box_PUBLICKEYBYTES = 32, crypto_box_SECRETKEYBYTES = 32, crypto_box_BEFORENMBYTES = 32, crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, crypto_sign_BYTES = 64, crypto_sign_PUBLICKEYBYTES = 32, crypto_sign_SECRETKEYBYTES = 64, crypto_sign_SEEDBYTES = 32, crypto_hash_BYTES = 64; - nacl2.lowlevel = { - crypto_core_hsalsa20, - crypto_stream_xor, - crypto_stream, - crypto_stream_salsa20_xor, - crypto_stream_salsa20, - crypto_onetimeauth, - crypto_onetimeauth_verify, - crypto_verify_16, - crypto_verify_32, - crypto_secretbox, - crypto_secretbox_open, - crypto_scalarmult, - crypto_scalarmult_base, - crypto_box_beforenm, - crypto_box_afternm, - crypto_box, - crypto_box_open, - crypto_box_keypair, - crypto_hash, - crypto_sign, - crypto_sign_keypair, - crypto_sign_open, - crypto_secretbox_KEYBYTES, - crypto_secretbox_NONCEBYTES, - crypto_secretbox_ZEROBYTES, - crypto_secretbox_BOXZEROBYTES, - crypto_scalarmult_BYTES, - crypto_scalarmult_SCALARBYTES, - crypto_box_PUBLICKEYBYTES, - crypto_box_SECRETKEYBYTES, - crypto_box_BEFORENMBYTES, - crypto_box_NONCEBYTES, - crypto_box_ZEROBYTES, - crypto_box_BOXZEROBYTES, - crypto_sign_BYTES, - crypto_sign_PUBLICKEYBYTES, - crypto_sign_SECRETKEYBYTES, - crypto_sign_SEEDBYTES, - crypto_hash_BYTES, - gf, - D, - L, - pack25519, - unpack25519, - M, - A, - S, - Z, - pow2523, - add: add2, - set25519, - modL, - scalarmult, - scalarbase - }; - function checkLengths(k, n) { - if (k.length !== crypto_secretbox_KEYBYTES) - throw new Error("bad key size"); - if (n.length !== crypto_secretbox_NONCEBYTES) - throw new Error("bad nonce size"); - } - function checkBoxLengths(pk, sk) { - if (pk.length !== crypto_box_PUBLICKEYBYTES) - throw new Error("bad public key size"); - if (sk.length !== crypto_box_SECRETKEYBYTES) - throw new Error("bad secret key size"); - } - function checkArrayTypes() { - for (var i = 0; i < arguments.length; i++) { - if (!(arguments[i] instanceof Uint8Array)) - throw new TypeError("unexpected type, use Uint8Array"); - } - } - function cleanup(arr) { - for (var i = 0; i < arr.length; i++) - arr[i] = 0; - } - nacl2.randomBytes = function(n) { - var b = new Uint8Array(n); - randombytes(b, n); - return b; - }; - nacl2.secretbox = function(msg, nonce, key) { - checkArrayTypes(msg, nonce, key); - checkLengths(key, nonce); - var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); - var c = new Uint8Array(m.length); - for (var i = 0; i < msg.length; i++) - m[i + crypto_secretbox_ZEROBYTES] = msg[i]; - crypto_secretbox(c, m, m.length, nonce, key); - return c.subarray(crypto_secretbox_BOXZEROBYTES); - }; - nacl2.secretbox.open = function(box, nonce, key) { - checkArrayTypes(box, nonce, key); - checkLengths(key, nonce); - var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); - var m = new Uint8Array(c.length); - for (var i = 0; i < box.length; i++) - c[i + crypto_secretbox_BOXZEROBYTES] = box[i]; - if (c.length < 32) - return null; - if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) - return null; - return m.subarray(crypto_secretbox_ZEROBYTES); - }; - nacl2.secretbox.keyLength = crypto_secretbox_KEYBYTES; - nacl2.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; - nacl2.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; - nacl2.scalarMult = function(n, p) { - checkArrayTypes(n, p); - if (n.length !== crypto_scalarmult_SCALARBYTES) - throw new Error("bad n size"); - if (p.length !== crypto_scalarmult_BYTES) - throw new Error("bad p size"); - var q = new Uint8Array(crypto_scalarmult_BYTES); - crypto_scalarmult(q, n, p); - return q; - }; - nacl2.scalarMult.base = function(n) { - checkArrayTypes(n); - if (n.length !== crypto_scalarmult_SCALARBYTES) - throw new Error("bad n size"); - var q = new Uint8Array(crypto_scalarmult_BYTES); - crypto_scalarmult_base(q, n); - return q; - }; - nacl2.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; - nacl2.scalarMult.groupElementLength = crypto_scalarmult_BYTES; - nacl2.box = function(msg, nonce, publicKey2, secretKey) { - var k = nacl2.box.before(publicKey2, secretKey); - return nacl2.secretbox(msg, nonce, k); - }; - nacl2.box.before = function(publicKey2, secretKey) { - checkArrayTypes(publicKey2, secretKey); - checkBoxLengths(publicKey2, secretKey); - var k = new Uint8Array(crypto_box_BEFORENMBYTES); - crypto_box_beforenm(k, publicKey2, secretKey); - return k; - }; - nacl2.box.after = nacl2.secretbox; - nacl2.box.open = function(msg, nonce, publicKey2, secretKey) { - var k = nacl2.box.before(publicKey2, secretKey); - return nacl2.secretbox.open(msg, nonce, k); - }; - nacl2.box.open.after = nacl2.secretbox.open; - nacl2.box.keyPair = function() { - var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); - var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); - crypto_box_keypair(pk, sk); - return { publicKey: pk, secretKey: sk }; - }; - nacl2.box.keyPair.fromSecretKey = function(secretKey) { - checkArrayTypes(secretKey); - if (secretKey.length !== crypto_box_SECRETKEYBYTES) - throw new Error("bad secret key size"); - var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); - crypto_scalarmult_base(pk, secretKey); - return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; - }; - nacl2.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; - nacl2.box.secretKeyLength = crypto_box_SECRETKEYBYTES; - nacl2.box.sharedKeyLength = crypto_box_BEFORENMBYTES; - nacl2.box.nonceLength = crypto_box_NONCEBYTES; - nacl2.box.overheadLength = nacl2.secretbox.overheadLength; - nacl2.sign = function(msg, secretKey) { - checkArrayTypes(msg, secretKey); - if (secretKey.length !== crypto_sign_SECRETKEYBYTES) - throw new Error("bad secret key size"); - var signedMsg = new Uint8Array(crypto_sign_BYTES + msg.length); - crypto_sign(signedMsg, msg, msg.length, secretKey); - return signedMsg; - }; - nacl2.sign.open = function(signedMsg, publicKey2) { - checkArrayTypes(signedMsg, publicKey2); - if (publicKey2.length !== crypto_sign_PUBLICKEYBYTES) - throw new Error("bad public key size"); - var tmp = new Uint8Array(signedMsg.length); - var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey2); - if (mlen < 0) - return null; - var m = new Uint8Array(mlen); - for (var i = 0; i < m.length; i++) - m[i] = tmp[i]; - return m; - }; - nacl2.sign.detached = function(msg, secretKey) { - var signedMsg = nacl2.sign(msg, secretKey); - var sig = new Uint8Array(crypto_sign_BYTES); - for (var i = 0; i < sig.length; i++) - sig[i] = signedMsg[i]; - return sig; - }; - nacl2.sign.detached.verify = function(msg, sig, publicKey2) { - checkArrayTypes(msg, sig, publicKey2); - if (sig.length !== crypto_sign_BYTES) - throw new Error("bad signature size"); - if (publicKey2.length !== crypto_sign_PUBLICKEYBYTES) - throw new Error("bad public key size"); - var sm = new Uint8Array(crypto_sign_BYTES + msg.length); - var m = new Uint8Array(crypto_sign_BYTES + msg.length); - var i; - for (i = 0; i < crypto_sign_BYTES; i++) - sm[i] = sig[i]; - for (i = 0; i < msg.length; i++) - sm[i + crypto_sign_BYTES] = msg[i]; - return crypto_sign_open(m, sm, sm.length, publicKey2) >= 0; - }; - nacl2.sign.keyPair = function() { - var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); - var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); - crypto_sign_keypair(pk, sk); - return { publicKey: pk, secretKey: sk }; - }; - nacl2.sign.keyPair.fromSecretKey = function(secretKey) { - checkArrayTypes(secretKey); - if (secretKey.length !== crypto_sign_SECRETKEYBYTES) - throw new Error("bad secret key size"); - var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); - for (var i = 0; i < pk.length; i++) - pk[i] = secretKey[32 + i]; - return { publicKey: pk, secretKey: new Uint8Array(secretKey) }; - }; - nacl2.sign.keyPair.fromSeed = function(seed) { - checkArrayTypes(seed); - if (seed.length !== crypto_sign_SEEDBYTES) - throw new Error("bad seed size"); - var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); - var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); - for (var i = 0; i < 32; i++) - sk[i] = seed[i]; - crypto_sign_keypair(pk, sk, true); - return { publicKey: pk, secretKey: sk }; - }; - nacl2.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; - nacl2.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; - nacl2.sign.seedLength = crypto_sign_SEEDBYTES; - nacl2.sign.signatureLength = crypto_sign_BYTES; - nacl2.hash = function(msg) { - checkArrayTypes(msg); - var h = new Uint8Array(crypto_hash_BYTES); - crypto_hash(h, msg, msg.length); - return h; - }; - nacl2.hash.hashLength = crypto_hash_BYTES; - nacl2.verify = function(x, y) { - checkArrayTypes(x, y); - if (x.length === 0 || y.length === 0) - return false; - if (x.length !== y.length) - return false; - return vn(x, 0, y, 0, x.length) === 0 ? true : false; - }; - nacl2.setPRNG = function(fn) { - randombytes = fn; - }; - (function() { - var crypto6 = typeof self !== "undefined" ? self.crypto || self.msCrypto : null; - if (crypto6 && crypto6.getRandomValues) { - var QUOTA = 65536; - nacl2.setPRNG(function(x, n) { - var i, v = new Uint8Array(n); - for (i = 0; i < n; i += QUOTA) { - crypto6.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); - } - for (i = 0; i < n; i++) - x[i] = v[i]; - cleanup(v); - }); - } else if (typeof require !== "undefined") { - crypto6 = require("crypto"); - if (crypto6 && crypto6.randomBytes) { - nacl2.setPRNG(function(x, n) { - var i, v = crypto6.randomBytes(n); - for (i = 0; i < n; i++) - x[i] = v[i]; - cleanup(v); - }); - } - } - })(); - })(typeof module2 !== "undefined" && module2.exports ? module2.exports : self.nacl = self.nacl || {}); - } -}); - -// ../dcp-core/dist/index.js -var require_dist5 = __commonJS({ - "../dcp-core/dist/index.js"(exports2, module2) { - "use strict"; - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod2, isNodeMode, target) => (target = mod2 != null ? __create2(__getProtoOf2(mod2)) : {}, __copyProps2( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod2 || !mod2.__esModule ? __defProp2(target, "default", { value: mod2, enumerable: true }) : target, - mod2 - )); - var __toCommonJS2 = (mod2) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod2); - var index_exports = {}; - __export2(index_exports, { - BudgetEngine: () => BudgetEngine, - DEFAULT_BUDGET_CONFIG: () => DEFAULT_BUDGET_CONFIG, - DEFAULT_CURRENCIES: () => DEFAULT_CURRENCIES, - DEFAULT_PAIRING_TTL_MS: () => DEFAULT_PAIRING_TTL_MS, - DEFAULT_RELAY_URL: () => DEFAULT_RELAY_URL2, - DEFAULT_SESSION_TOKEN_TTL_MS: () => DEFAULT_SESSION_TOKEN_TTL_MS, - DEFAULT_VAULT_CONFIG: () => DEFAULT_VAULT_CONFIG, - ED25519_PRIVATE_KEY_SIZE: () => ED25519_PRIVATE_KEY_SIZE, - ED25519_PUBLIC_KEY_SIZE: () => ED25519_PUBLIC_KEY_SIZE, - ED25519_SIGNATURE_SIZE: () => ED25519_SIGNATURE_SIZE, - KEY_SIZE: () => KEY_SIZE, - KNOWN_SERVICES: () => KNOWN_SERVICES, - NONCE_SIZE: () => NONCE_SIZE, - PAIRING_GRANT_PREFIX: () => PAIRING_GRANT_PREFIX, - RATE_LIMIT_PER_MINUTE: () => RATE_LIMIT_PER_MINUTE, - RELAY_URLS: () => RELAY_URLS, - SESSION_TOKEN_PREFIX: () => SESSION_TOKEN_PREFIX, - TAG_SIZE: () => TAG_SIZE, - VPS_INVITE_PREFIX: () => VPS_INVITE_PREFIX, - VaultError: () => VaultError2, - VaultStorage: () => VaultStorage, - canonicalJson: () => canonicalJson2, - createSessionToken: () => createSessionToken, - createSignedPairingGrant: () => createSignedPairingGrant2, - createVpsPairingInvite: () => createVpsPairingInvite2, - createWallet: () => createWallet, - decodePairingGrant: () => decodePairingGrant2, - decodeSessionToken: () => decodeSessionToken, - decrypt: () => decrypt, - deriveKeyFromMnemonic: () => deriveKeyFromMnemonic, - deriveKeyFromPassphrase: () => deriveKeyFromPassphrase, - encrypt: () => encrypt, - encryptWalletKey: () => encryptWalletKey, - envelopeDecrypt: () => envelopeDecrypt2, - envelopeEncrypt: () => envelopeEncrypt, - exportSolanaPrivateKey: () => exportSolanaPrivateKey, - exportWalletPrivateKey: () => exportWalletPrivateKey, - generateKey: () => generateKey, - generateNonce: () => generateNonce, - generateRecoveryMnemonic: () => generateRecoveryMnemonic, - generateRecoveryPhrase: () => generateRecoveryPhrase, - generateSalt: () => generateSalt, - generateSigningKeyPair: () => generateSigningKeyPair2, - generateWalletKeypair: () => generateWalletKeypair, - getBudgetEngine: () => getBudgetEngine2, - getKnownService: () => getKnownService, - getPublicAddress: () => getPublicAddress, - getStorage: () => getStorage2, - getSupportedOperations: () => getSupportedOperations, - importWallet: () => importWallet, - isChainSupported: () => isChainSupported, - isKnownService: () => isKnownService, - isPairingGrant: () => isPairingGrant, - isSessionToken: () => isSessionToken, - isValidPublicKey: () => isValidPublicKey2, - isVpsInviteExpired: () => isVpsInviteExpired, - isVpsPairingInvite: () => isVpsPairingInvite, - listKnownServices: () => listKnownServices2, - parsePublicKey: () => parsePublicKey, - parseVpsPairingInvite: () => parseVpsPairingInvite2, - resetBudgetEngine: () => resetBudgetEngine, - resetStorage: () => resetStorage, - secureAlloc: () => secureAlloc, - signMessage: () => signMessage, - signSolanaMessage: () => signSolanaMessage2, - signSolanaTransaction: () => signSolanaTransaction, - signTransaction: () => signTransaction2, - validateMnemonic: () => validateMnemonic2, - verifyCryptoReady: () => verifyCryptoReady, - verifyPairingGrant: () => verifyPairingGrant, - verifyPairingGrantWithKey: () => verifyPairingGrantWithKey2, - verifySessionToken: () => verifySessionToken, - verifySignature: () => verifySignature, - zeroize: () => zeroize - }); - module2.exports = __toCommonJS2(index_exports); - var VaultError2 = class extends Error { - constructor(code, message, details) { - super(message); - this.code = code; - this.details = details; - this.name = "VaultError"; - } - code; - details; - toJSON() { - return { - error: { - code: this.code, - message: this.message, - details: this.details - } - }; - } - }; - var import_sodium_native = __toESM2(require("sodium-native")); - var bip39 = __toESM2(require_src()); - var KEY_SIZE = 32; - var NONCE_SIZE = 24; - var TAG_SIZE = 16; - var ARGON2_MEMORY = 65536; - var ARGON2_TIME = 3; - var SALT_SIZE = 16; - function generateKey() { - const key = import_sodium_native.default.sodium_malloc(KEY_SIZE); - import_sodium_native.default.randombytes_buf(key); - return key; - } - function generateNonce() { - const nonce = Buffer.allocUnsafe(NONCE_SIZE); - import_sodium_native.default.randombytes_buf(nonce); - return nonce; - } - function generateSalt() { - const salt = Buffer.allocUnsafe(SALT_SIZE); - import_sodium_native.default.randombytes_buf(salt); - return salt; - } - function deriveKeyFromPassphrase(passphrase, salt) { - if (salt.length !== SALT_SIZE) { - throw new VaultError2("INTERNAL_ERROR", `Salt must be ${SALT_SIZE} bytes`); - } - const key = import_sodium_native.default.sodium_malloc(KEY_SIZE); - const passphraseBuffer = Buffer.from(passphrase, "utf8"); - try { - import_sodium_native.default.crypto_pwhash( - key, - passphraseBuffer, - salt, - ARGON2_TIME, - ARGON2_MEMORY * 1024, - // Convert KB to bytes - import_sodium_native.default.crypto_pwhash_ALG_ARGON2ID13 - ); - return key; - } finally { - zeroize(passphraseBuffer); - } - } - function encrypt(plaintext, key, associatedData) { - if (key.length !== KEY_SIZE) { - throw new VaultError2("INTERNAL_ERROR", `Key must be ${KEY_SIZE} bytes`); - } - const nonce = generateNonce(); - const ciphertext = Buffer.allocUnsafe(plaintext.length + TAG_SIZE); - import_sodium_native.default.crypto_aead_xchacha20poly1305_ietf_encrypt( - ciphertext, - plaintext, - associatedData || null, - null, - // nsec (not used) - nonce, - key - ); - return { ciphertext, nonce }; - } - function decrypt(ciphertext, nonce, key, associatedData) { - if (key.length !== KEY_SIZE) { - throw new VaultError2("INTERNAL_ERROR", `Key must be ${KEY_SIZE} bytes`); - } - if (nonce.length !== NONCE_SIZE) { - throw new VaultError2("INTERNAL_ERROR", `Nonce must be ${NONCE_SIZE} bytes`); - } - const plaintext = import_sodium_native.default.sodium_malloc(ciphertext.length - TAG_SIZE); - try { - import_sodium_native.default.crypto_aead_xchacha20poly1305_ietf_decrypt( - plaintext, - null, - // nsec (not used) - ciphertext, - associatedData || null, - nonce, - key - ); - return plaintext; - } catch { - throw new VaultError2("INTERNAL_ERROR", "Decryption failed - data may be tampered or key incorrect"); - } - } - function envelopeEncrypt(plaintext, masterKey) { - const dek = generateKey(); - try { - const { ciphertext, nonce } = encrypt(plaintext, dek); - const { ciphertext: dekWrapped, nonce: dekNonce } = encrypt(dek, masterKey); - return { - ciphertext, - nonce, - dek_wrapped: dekWrapped, - dek_nonce: dekNonce - }; - } finally { - zeroize(dek); - } - } - function envelopeDecrypt2(payload, masterKey) { - const dek = decrypt(payload.dek_wrapped, payload.dek_nonce, masterKey); - try { - const plaintext = decrypt(payload.ciphertext, payload.nonce, dek); - return plaintext; - } finally { - zeroize(dek); - } - } - function zeroize(buffer) { - if (buffer && buffer.length > 0) { - import_sodium_native.default.sodium_memzero(buffer); - } - } - function secureAlloc(size) { - return import_sodium_native.default.sodium_malloc(size); - } - function generateRecoveryMnemonic() { - const entropy = Buffer.allocUnsafe(16); - import_sodium_native.default.randombytes_buf(entropy); - const mnemonic = bip39.entropyToMnemonic(entropy.toString("hex")); - import_sodium_native.default.sodium_memzero(entropy); - return mnemonic; - } - function deriveKeyFromMnemonic(mnemonic, passphrase = "") { - if (!bip39.validateMnemonic(mnemonic)) { - throw new VaultError2("INTERNAL_ERROR", "Invalid recovery phrase"); - } - const seed = bip39.mnemonicToSeedSync(mnemonic, passphrase); - const masterKey = import_sodium_native.default.sodium_malloc(KEY_SIZE); - seed.copy(masterKey, 0, 0, KEY_SIZE); - import_sodium_native.default.sodium_memzero(seed); - return masterKey; - } - function validateMnemonic2(mnemonic) { - return bip39.validateMnemonic(mnemonic); - } - function generateRecoveryPhrase(_masterKey) { - return generateRecoveryMnemonic(); - } - function verifyCryptoReady() { - try { - const testKey = generateKey(); - const testNonce = generateNonce(); - const testData = Buffer.from("test"); - const encrypted = encrypt(testData, testKey); - const decrypted = decrypt(encrypted.ciphertext, encrypted.nonce, testKey); - const success = decrypted.equals(testData); - zeroize(testKey); - zeroize(decrypted); - return success && testNonce.length === NONCE_SIZE; - } catch { - return false; - } - } - var ED25519_PUBLIC_KEY_SIZE = 32; - var ED25519_PRIVATE_KEY_SIZE = 64; - var ED25519_SIGNATURE_SIZE = 64; - function generateSigningKeyPair2() { - const publicKey2 = import_sodium_native.default.sodium_malloc(ED25519_PUBLIC_KEY_SIZE); - const privateKey = import_sodium_native.default.sodium_malloc(ED25519_PRIVATE_KEY_SIZE); - import_sodium_native.default.crypto_sign_keypair(publicKey2, privateKey); - return { - publicKey: Buffer.from(publicKey2), - privateKey: Buffer.from(privateKey) - }; - } - function signMessage(message, privateKey) { - if (privateKey.length !== ED25519_PRIVATE_KEY_SIZE) { - throw new VaultError2( - "INTERNAL_ERROR", - `Ed25519 private key must be ${ED25519_PRIVATE_KEY_SIZE} bytes` - ); - } - const signature2 = import_sodium_native.default.sodium_malloc(ED25519_SIGNATURE_SIZE); - import_sodium_native.default.crypto_sign_detached(signature2, message, privateKey); - return Buffer.from(signature2); - } - function verifySignature(message, signature2, publicKey2) { - if (publicKey2.length !== ED25519_PUBLIC_KEY_SIZE) { - return false; - } - if (signature2.length !== ED25519_SIGNATURE_SIZE) { - return false; - } - try { - return import_sodium_native.default.crypto_sign_verify_detached(signature2, message, publicKey2); - } catch { - return false; - } - } - function canonicalJson2(value) { - const normalize = (input) => { - if (input === null || input === void 0) - return input; - if (typeof input === "bigint") - return input.toString(); - if (Array.isArray(input)) - return input.map(normalize); - if (typeof input === "object") { - const obj = input; - const sorted = {}; - for (const key of Object.keys(obj).sort()) { - sorted[key] = normalize(obj[key]); - } - return sorted; - } - return input; - }; - return JSON.stringify(normalize(value)); - } - var import_web3 = (init_index_esm(), __toCommonJS(index_esm_exports)); - var import_bs582 = __toESM2(require_cjs2()); - var CHAIN_KEY_TYPES = { - solana: "ed25519" - }; - function generateWalletKeypair(chain) { - const keyType = CHAIN_KEY_TYPES[chain]; - if (!keyType) { - throw new VaultError2("INVALID_CHAIN", `Unsupported chain: ${chain}`); - } - return generateSolanaKeypair(chain); - } - function generateSolanaKeypair(chain) { - const keypair = import_web3.Keypair.generate(); - const publicAddress = keypair.publicKey.toBase58(); - const privateKey = Buffer.from(keypair.secretKey.slice(0, 32)); - return { - chain, - public_address: publicAddress, - key_type: "ed25519", - private_key: privateKey - }; - } - function encryptWalletKey(walletData, masterKey) { - try { - const encrypted = envelopeEncrypt(walletData.private_key, masterKey); - const info = { - chain: walletData.chain, - public_address: walletData.public_address, - key_type: walletData.key_type, - operations: ["sign_tx", "sign_message", "get_address"] - }; - return { encrypted, info }; - } finally { - zeroize(walletData.private_key); - } - } - function createWallet(chain, masterKey) { - const walletData = generateWalletKeypair(chain); - return encryptWalletKey(walletData, masterKey); - } - function exportSolanaPrivateKey(encryptedKey, masterKey) { - const privateKey = envelopeDecrypt2(encryptedKey, masterKey); - try { - const keypair = import_web3.Keypair.fromSeed(privateKey); - const secretKey = Buffer.from(keypair.secretKey); - try { - return import_bs582.default.encode(secretKey); - } finally { - zeroize(secretKey); - keypair.secretKey.fill(0); - } - } finally { - zeroize(privateKey); - } - } - function exportWalletPrivateKey(encryptedKey, masterKey, chain) { - if (!CHAIN_KEY_TYPES[chain]) { - throw new VaultError2("INVALID_CHAIN", `Unsupported chain: ${chain}`); - } - return exportSolanaPrivateKey(encryptedKey, masterKey); - } - function signSolanaTransaction(encryptedKey, masterKey, unsignedTx) { - const privateKey = envelopeDecrypt2(encryptedKey, masterKey); - const encode = import_bs582.default.encode; - try { - const keypair = import_web3.Keypair.fromSeed(privateKey); - const txBuffer = Buffer.from(unsignedTx, "base64"); - let signedTx; - let signature2; - try { - const versionedTx = import_web3.VersionedTransaction.deserialize(txBuffer); - versionedTx.sign([keypair]); - signedTx = Buffer.from(versionedTx.serialize()).toString("base64"); - signature2 = encode(versionedTx.signatures[0]); - } catch { - const legacyTx = import_web3.Transaction.from(txBuffer); - legacyTx.sign(keypair); - signedTx = legacyTx.serialize().toString("base64"); - signature2 = legacyTx.signature ? encode(legacyTx.signature) : ""; - } - return { - signed_tx: signedTx, - signature: signature2, - chain: "solana" - }; - } finally { - zeroize(privateKey); - } - } - async function signTransaction2(encryptedKey, masterKey, chain, unsignedTx) { - if (!CHAIN_KEY_TYPES[chain]) { - throw new VaultError2("INVALID_CHAIN", `Unsupported chain: ${chain}`); - } - return signSolanaTransaction(encryptedKey, masterKey, unsignedTx); - } - function signSolanaMessage2(encryptedKey, masterKey, message, encoding = "utf8") { - const privateKey = envelopeDecrypt2(encryptedKey, masterKey); - const encode = import_bs582.default.encode; - try { - const keypair = import_web3.Keypair.fromSeed(privateKey); - const messageBuffer = Buffer.from(message, encoding); - const nacl2 = require_nacl_fast(); - const signature2 = nacl2.sign.detached(messageBuffer, keypair.secretKey); - return encode(signature2); - } finally { - zeroize(privateKey); - } - } - function importWallet(chain, privateKeyInput, masterKey) { - if (!CHAIN_KEY_TYPES[chain]) { - throw new VaultError2("INVALID_CHAIN", `Unsupported chain: ${chain}`); - } - const walletData = importSolanaWallet(chain, privateKeyInput); - return encryptWalletKey(walletData, masterKey); - } - function importSolanaWallet(chain, privateKeyBase58) { - try { - const secretKey = import_bs582.default.decode(privateKeyBase58); - let seed; - if (secretKey.length === 64) { - seed = Buffer.from(secretKey.slice(0, 32)); - } else if (secretKey.length === 32) { - seed = Buffer.from(secretKey); - } else { - throw new VaultError2("INTERNAL_ERROR", "Invalid Solana private key length"); - } - const keypair = import_web3.Keypair.fromSeed(seed); - return { - chain, - public_address: keypair.publicKey.toBase58(), - key_type: "ed25519", - private_key: seed - }; - } catch (error) { - if (error instanceof VaultError2) - throw error; - throw new VaultError2("INTERNAL_ERROR", "Failed to import Solana wallet: invalid key format"); - } - } - function getPublicAddress(walletInfo) { - return walletInfo.public_address; - } - function getSupportedOperations(chain) { - if (!CHAIN_KEY_TYPES[chain]) { - throw new VaultError2("INVALID_CHAIN", `Unsupported chain: ${chain}`); - } - return ["sign_tx", "sign_message", "get_address"]; - } - function isChainSupported(chain) { - return chain in CHAIN_KEY_TYPES; - } - var import_better_sqlite3 = __toESM2(require("better-sqlite3")); - var fs2 = __toESM2(require("fs")); - var path2 = __toESM2(require("path")); - var os2 = __toESM2(require("os")); - var import_crypto22 = require("crypto"); - var keytar2 = null; - async function getKeytar() { - if (keytar2 === null) { - try { - keytar2 = await import("keytar"); - } catch { - keytar2 = null; - } - } - return keytar2; - } - var DEFAULT_VAULT_DIR = process.env.DCP_VAULT_DIR || process.env.VAULT_DIR || path2.join(os2.homedir(), ".dcp"); - var KEYCHAIN_SERVICE = "dcp"; - var KEYCHAIN_ACCOUNT_PREFIX = "master-key:"; - var KEY_FILE_MODE = 384; - var INIT_MARKER_FILE = "vault.initialized"; - function generateId() { - if (typeof import_crypto22.randomUUID === "function") { - return (0, import_crypto22.randomUUID)(); - } - return (0, import_crypto22.randomBytes)(16).toString("hex"); - } - var VaultStorage = class { - db; - vaultDir; - masterKey = null; - constructor(vaultDir = DEFAULT_VAULT_DIR) { - this.vaultDir = vaultDir; - this.db = this.openDatabase(); - } - // ========================================================================== - // Database Management - // ========================================================================== - openDatabase() { - if (!fs2.existsSync(this.vaultDir)) { - fs2.mkdirSync(this.vaultDir, { recursive: true, mode: 448 }); - } - const dbPath = path2.join(this.vaultDir, "vault.db"); - const db = new import_better_sqlite3.default(dbPath); - db.pragma("journal_mode = WAL"); - db.pragma("foreign_keys = ON"); - return db; - } - /** - * Initialize the database schema - */ - initializeSchema() { - this.db.exec(` - -- Vault records (encrypted data) - CREATE TABLE IF NOT EXISTS vault_records ( - id TEXT PRIMARY KEY, - scope TEXT NOT NULL UNIQUE, - item_type TEXT NOT NULL, - sensitivity TEXT NOT NULL, - ciphertext BLOB NOT NULL, - nonce BLOB NOT NULL, - dek_wrapped BLOB NOT NULL, - dek_nonce BLOB NOT NULL, - chain TEXT, - public_address TEXT, - schema_version TEXT NOT NULL DEFAULT '1.0', - created_at TEXT NOT NULL, - updated_at TEXT NOT NULL - ); - - -- Agent sessions - CREATE TABLE IF NOT EXISTS agent_sessions ( - id TEXT PRIMARY KEY, - agent_name TEXT NOT NULL, - agent_fingerprint TEXT, - marketplace TEXT, - trust_tier TEXT NOT NULL DEFAULT 'unknown', - granted_scopes TEXT NOT NULL, - purpose TEXT, - consent_mode TEXT NOT NULL, - profile_name TEXT, - token_id TEXT, - expires_at TEXT NOT NULL, - created_at TEXT NOT NULL, - last_used_at TEXT, - revoked_at TEXT - ); - - -- Spend events (budget tracking) - CREATE TABLE IF NOT EXISTS spend_events ( - id TEXT PRIMARY KEY, - agent_session_id TEXT NOT NULL, - amount REAL NOT NULL, - currency TEXT NOT NULL, - chain TEXT NOT NULL, - operation TEXT NOT NULL, - destination TEXT, - idempotency_key TEXT UNIQUE, - status TEXT NOT NULL, - tx_signature TEXT, - created_at TEXT NOT NULL, - FOREIGN KEY (agent_session_id) REFERENCES agent_sessions(id) - ); - - -- Audit events (immutable log) - CREATE TABLE IF NOT EXISTS audit_events ( - id TEXT PRIMARY KEY, - event_type TEXT NOT NULL, - agent_name TEXT, - scope TEXT, - operation TEXT, - details TEXT, - outcome TEXT NOT NULL, - created_at TEXT NOT NULL - ); - - -- Pending consents - CREATE TABLE IF NOT EXISTS pending_consents ( - id TEXT PRIMARY KEY, - agent_name TEXT NOT NULL, - action TEXT NOT NULL, - scope TEXT NOT NULL, - details TEXT, - status TEXT NOT NULL DEFAULT 'pending', - created_at TEXT NOT NULL, - expires_at TEXT NOT NULL, - resolved_at TEXT - ); - - -- Saved profiles - CREATE TABLE IF NOT EXISTS saved_profiles ( - id TEXT PRIMARY KEY, - name TEXT NOT NULL UNIQUE, - allowed_scopes TEXT NOT NULL, - spending_limit_per_tx TEXT, - spending_limit_daily TEXT, - approval_threshold TEXT, - allowed_purposes TEXT, - allow_always_expiry_days INTEGER DEFAULT 90, - created_at TEXT NOT NULL, - updated_at TEXT NOT NULL - ); - - -- Trusted services (protocol spec section B2) - CREATE TABLE IF NOT EXISTS trusted_services ( - service_id TEXT PRIMARY KEY, - name TEXT NOT NULL, - public_key TEXT NOT NULL, - scopes TEXT NOT NULL, - budget_daily REAL NOT NULL, - budget_currency TEXT NOT NULL DEFAULT 'USDC', - budget_auto_approve_under REAL NOT NULL DEFAULT 0, - trusted_at TEXT NOT NULL, - connected_at TEXT, - enabled INTEGER NOT NULL DEFAULT 1, - verified INTEGER NOT NULL DEFAULT 0 - ); - - -- Agent connections (DCP v1 Agent Connectivity) - CREATE TABLE IF NOT EXISTS agent_connections ( - agent_id TEXT PRIMARY KEY, - name TEXT NOT NULL, - mode TEXT NOT NULL, - status TEXT NOT NULL DEFAULT 'pending', - service_id TEXT, - service_public_key TEXT, - permission_scopes TEXT NOT NULL, - budget_daily REAL NOT NULL, - budget_currency TEXT NOT NULL DEFAULT 'USDC', - budget_auto_approve_under REAL NOT NULL DEFAULT 0, - tier TEXT NOT NULL DEFAULT 'free', - token_hash TEXT, - created_at TEXT NOT NULL, - paired_at TEXT, - last_seen_at TEXT, - last_request_at TEXT, - request_count INTEGER NOT NULL DEFAULT 0, - revoked_at TEXT - ); - - -- Create indexes - CREATE INDEX IF NOT EXISTS idx_vault_records_scope ON vault_records(scope); - CREATE INDEX IF NOT EXISTS idx_vault_records_chain ON vault_records(chain); - CREATE INDEX IF NOT EXISTS idx_agent_sessions_agent_name ON agent_sessions(agent_name); - CREATE INDEX IF NOT EXISTS idx_agent_sessions_expires_at ON agent_sessions(expires_at); - CREATE INDEX IF NOT EXISTS idx_spend_events_session ON spend_events(agent_session_id); - CREATE INDEX IF NOT EXISTS idx_spend_events_created_at ON spend_events(created_at); - CREATE INDEX IF NOT EXISTS idx_audit_events_type ON audit_events(event_type); - CREATE INDEX IF NOT EXISTS idx_audit_events_created_at ON audit_events(created_at); - CREATE INDEX IF NOT EXISTS idx_pending_consents_status ON pending_consents(status); - CREATE INDEX IF NOT EXISTS idx_trusted_services_enabled ON trusted_services(enabled); - CREATE INDEX IF NOT EXISTS idx_trusted_services_connected ON trusted_services(connected_at); - CREATE INDEX IF NOT EXISTS idx_agent_connections_status ON agent_connections(status); - CREATE INDEX IF NOT EXISTS idx_agent_connections_service ON agent_connections(service_id); - CREATE INDEX IF NOT EXISTS idx_agent_connections_last_seen ON agent_connections(last_seen_at); - - -- Pairing tokens (for proxy pairing flow) - CREATE TABLE IF NOT EXISTS pairing_tokens ( - token_hash TEXT PRIMARY KEY, - service_id TEXT NOT NULL, - scopes TEXT NOT NULL, - budget_daily REAL NOT NULL, - budget_currency TEXT NOT NULL DEFAULT 'USDC', - budget_auto_approve_under REAL NOT NULL DEFAULT 0, - created_at TEXT NOT NULL, - expires_at TEXT NOT NULL, - used_at TEXT - ); - - CREATE INDEX IF NOT EXISTS idx_pairing_tokens_expires ON pairing_tokens(expires_at); - - -- Telegram configuration (protocol spec section 15) - CREATE TABLE IF NOT EXISTS telegram_configs ( - id TEXT PRIMARY KEY, - chat_id TEXT NOT NULL UNIQUE, - bot_token_ciphertext BLOB NOT NULL, - bot_token_nonce BLOB NOT NULL, - bot_token_dek_wrapped BLOB NOT NULL, - bot_token_dek_nonce BLOB NOT NULL, - enabled INTEGER NOT NULL DEFAULT 1, - notify_consent INTEGER NOT NULL DEFAULT 1, - rate_limit_per_hour INTEGER NOT NULL DEFAULT 30, - last_notification_at TEXT, - notifications_this_hour INTEGER NOT NULL DEFAULT 0, - hour_window_start TEXT, - created_at TEXT NOT NULL, - updated_at TEXT NOT NULL, - paired_at TEXT, - muted_until TEXT - ); - - -- Telegram pairing codes (6-digit codes for linking) - CREATE TABLE IF NOT EXISTS telegram_pairing_codes ( - code TEXT PRIMARY KEY, - vault_id TEXT NOT NULL, - expires_at TEXT NOT NULL, - used INTEGER NOT NULL DEFAULT 0, - created_at TEXT NOT NULL - ); - - CREATE INDEX IF NOT EXISTS idx_telegram_pairing_expires ON telegram_pairing_codes(expires_at); - - -- Telegram notification log (audit trail) - CREATE TABLE IF NOT EXISTS telegram_notification_log ( - id TEXT PRIMARY KEY, - chat_id TEXT NOT NULL, - consent_id TEXT, - notification_type TEXT NOT NULL, - category TEXT, - agent_name TEXT, - sent_at TEXT NOT NULL, - delivered_at TEXT, - error TEXT - ); - - CREATE INDEX IF NOT EXISTS idx_telegram_log_chat ON telegram_notification_log(chat_id); - CREATE INDEX IF NOT EXISTS idx_telegram_log_sent ON telegram_notification_log(sent_at); - `); - this.migrateSchema(); - } - /** - * Run schema migrations for existing databases - */ - migrateSchema() { - const sessionsInfo = this.db.pragma("table_info(agent_sessions)"); - const hasLastUsedAt = sessionsInfo.some((col) => col.name === "last_used_at"); - if (!hasLastUsedAt) { - this.db.exec("ALTER TABLE agent_sessions ADD COLUMN last_used_at TEXT"); - } - const consentsInfo = this.db.pragma("table_info(pending_consents)"); - const hasSessionId = consentsInfo.some((col) => col.name === "session_id"); - if (!hasSessionId) { - this.db.exec("ALTER TABLE pending_consents ADD COLUMN session_id TEXT"); - } - const pairingTable = this.db.prepare( - "SELECT name FROM sqlite_master WHERE type='table' AND name='pairing_tokens'" - ).get(); - if (!pairingTable) { - this.db.exec(` - CREATE TABLE IF NOT EXISTS pairing_tokens ( - token_hash TEXT PRIMARY KEY, - service_id TEXT NOT NULL, - scopes TEXT NOT NULL, - budget_daily REAL NOT NULL, - budget_currency TEXT NOT NULL DEFAULT 'USDC', - budget_auto_approve_under REAL NOT NULL DEFAULT 0, - created_at TEXT NOT NULL, - expires_at TEXT NOT NULL, - used_at TEXT - ); - - CREATE INDEX IF NOT EXISTS idx_pairing_tokens_expires ON pairing_tokens(expires_at); - `); - } - const agentConnectionsTable = this.db.prepare( - "SELECT name FROM sqlite_master WHERE type='table' AND name='agent_connections'" - ).get(); - if (!agentConnectionsTable) { - this.db.exec(` - CREATE TABLE IF NOT EXISTS agent_connections ( - agent_id TEXT PRIMARY KEY, - name TEXT NOT NULL, - mode TEXT NOT NULL, - status TEXT NOT NULL DEFAULT 'pending', - service_id TEXT, - service_public_key TEXT, - permission_scopes TEXT NOT NULL, - budget_daily REAL NOT NULL, - budget_currency TEXT NOT NULL DEFAULT 'USDC', - budget_auto_approve_under REAL NOT NULL DEFAULT 0, - tier TEXT NOT NULL DEFAULT 'free', - token_hash TEXT, - created_at TEXT NOT NULL, - paired_at TEXT, - last_seen_at TEXT, - last_request_at TEXT, - request_count INTEGER NOT NULL DEFAULT 0, - revoked_at TEXT - ); - - CREATE INDEX IF NOT EXISTS idx_agent_connections_status ON agent_connections(status); - CREATE INDEX IF NOT EXISTS idx_agent_connections_service ON agent_connections(service_id); - CREATE INDEX IF NOT EXISTS idx_agent_connections_last_seen ON agent_connections(last_seen_at); - `); - } else { - const columns = this.db.prepare("PRAGMA table_info(agent_connections)").all(); - const hasServicePublicKey = columns.some((col) => col.name === "service_public_key"); - if (!hasServicePublicKey) { - this.db.exec(`ALTER TABLE agent_connections ADD COLUMN service_public_key TEXT`); - } - } - const telegramConfigsTable = this.db.prepare( - "SELECT name FROM sqlite_master WHERE type='table' AND name='telegram_configs'" - ).get(); - if (!telegramConfigsTable) { - this.db.exec(` - CREATE TABLE IF NOT EXISTS telegram_configs ( - id TEXT PRIMARY KEY, - chat_id TEXT NOT NULL UNIQUE, - bot_token_ciphertext BLOB NOT NULL, - bot_token_nonce BLOB NOT NULL, - bot_token_dek_wrapped BLOB NOT NULL, - bot_token_dek_nonce BLOB NOT NULL, - enabled INTEGER NOT NULL DEFAULT 1, - notify_consent INTEGER NOT NULL DEFAULT 1, - rate_limit_per_hour INTEGER NOT NULL DEFAULT 30, - last_notification_at TEXT, - notifications_this_hour INTEGER NOT NULL DEFAULT 0, - hour_window_start TEXT, - created_at TEXT NOT NULL, - updated_at TEXT NOT NULL, - paired_at TEXT, - muted_until TEXT - ); - - CREATE TABLE IF NOT EXISTS telegram_pairing_codes ( - code TEXT PRIMARY KEY, - vault_id TEXT NOT NULL, - expires_at TEXT NOT NULL, - used INTEGER NOT NULL DEFAULT 0, - created_at TEXT NOT NULL - ); - - CREATE INDEX IF NOT EXISTS idx_telegram_pairing_expires ON telegram_pairing_codes(expires_at); - - CREATE TABLE IF NOT EXISTS telegram_notification_log ( - id TEXT PRIMARY KEY, - chat_id TEXT NOT NULL, - consent_id TEXT, - notification_type TEXT NOT NULL, - category TEXT, - agent_name TEXT, - sent_at TEXT NOT NULL, - delivered_at TEXT, - error TEXT - ); - - CREATE INDEX IF NOT EXISTS idx_telegram_log_chat ON telegram_notification_log(chat_id); - CREATE INDEX IF NOT EXISTS idx_telegram_log_sent ON telegram_notification_log(sent_at); - `); - } - } - // ========================================================================== - // Master Key Management - // ========================================================================== - /** - * Initialize master key (called during vault init) - * - * Security model: - * 1. Generate 256-bit master key (random) - * 2. Generate 128-bit salt (random) - * 3. Derive wrapping key from passphrase + salt using Argon2id - * 4. Encrypt master key with wrapping key using XChaCha20-Poly1305 (AEAD) - * 5. Store: encrypted_master_key + nonce + salt - * - * The AEAD encryption provides: - * - Confidentiality: master key is encrypted - * - Integrity: tampering is detected via authentication tag - * - Wrong passphrase detection: decryption fails if passphrase is wrong - * - * @param passphrase - User's passphrase to protect the master key - * @returns The master key (caller should store it in memory briefly, then zeroize) - */ - async initializeMasterKey(passphrase) { - const masterKey = generateKey(); - const salt = generateSalt(); - const wrappingKey = deriveKeyFromPassphrase(passphrase, salt); - try { - const { ciphertext, nonce } = encrypt(masterKey, wrappingKey); - const stored = await this.storeMasterKeyInKeychain(ciphertext, nonce, salt); - if (!stored) { - this.storeMasterKeyInFile(ciphertext, nonce, salt); - } - this.writeInitializationMarker(); - this.masterKey = masterKey; - return masterKey; - } finally { - zeroize(wrappingKey); - } - } - /** - * Store an existing master key with a new passphrase - * - * Used for recovery: the master key is derived from the recovery mnemonic, - * then encrypted with the user's new passphrase. - * - * @param masterKey - The master key (e.g., derived from recovery mnemonic) - * @param passphrase - User's passphrase to protect the master key - */ - async storeMasterKeyWithPassphrase(masterKey, passphrase) { - const salt = generateSalt(); - const wrappingKey = deriveKeyFromPassphrase(passphrase, salt); - try { - const { ciphertext, nonce } = encrypt(masterKey, wrappingKey); - const stored = await this.storeMasterKeyInKeychain(ciphertext, nonce, salt); - if (!stored) { - this.storeMasterKeyInFile(ciphertext, nonce, salt); - } - this.writeInitializationMarker(); - this.masterKey = masterKey; - } finally { - zeroize(wrappingKey); - } - } - /** - * Unlock vault with passphrase - * - * @param passphrase - User's passphrase - * @returns The master key - * @throws VaultError with code VAULT_NOT_INITIALIZED if vault not set up - * @throws VaultError with code INTERNAL_ERROR if wrong passphrase (AEAD auth fails) - */ - async unlock(passphrase) { - let keyData = await this.loadMasterKeyFromKeychain(); - let keySource = keyData ? "keychain" : null; - if (!keyData) { - keyData = this.loadMasterKeyFromFile(); - keySource = keyData ? "file" : null; - } - if (!keyData) { - throw new VaultError2("VAULT_NOT_INITIALIZED", "Vault not initialized. Run dcp init"); - } - const tryDecrypt = (data) => { - const wrappingKey = deriveKeyFromPassphrase(passphrase, data.salt); - try { - return decrypt(data.encryptedKey, data.nonce, wrappingKey); - } finally { - zeroize(wrappingKey); - } - }; - try { - const masterKey = tryDecrypt(keyData); - this.masterKey = masterKey; - this.writeInitializationMarker(); - return masterKey; - } catch (error) { - if (keySource === "keychain") { - const fileData = this.loadMasterKeyFromFile(); - if (fileData) { - try { - const masterKey = tryDecrypt(fileData); - this.masterKey = masterKey; - this.writeInitializationMarker(); - await this.storeMasterKeyInKeychain( - fileData.encryptedKey, - fileData.nonce, - fileData.salt - ); - return masterKey; - } catch { - } - } - } - if (error instanceof VaultError2 && error.message.includes("Decryption failed")) { - throw new VaultError2( - "INTERNAL_ERROR", - "Wrong passphrase or corrupted vault data" - ); - } - throw error; - } - } - /** - * Lock vault (zeroize master key from memory) - */ - lock() { - if (this.masterKey) { - zeroize(this.masterKey); - this.masterKey = null; - } - } - /** - * Get cached master key (throws if locked) - */ - getMasterKey() { - if (!this.masterKey) { - throw new VaultError2("VAULT_LOCKED", "Vault is locked. Please unlock first."); - } - return this.masterKey; - } - /** - * Set master key directly (used by trusted local session cache) - * - * This is intentionally not exposed to agents. It is used by the CLI - * to restore an already-unlocked master key from a local session cache. - */ - setMasterKey(masterKey) { - this.masterKey = masterKey; - } - /** - * Check if vault is unlocked - */ - isUnlocked() { - return this.masterKey !== null; - } - /** - * Store encrypted master key in OS Keychain - * Returns false if keychain is not available - */ - async storeMasterKeyInKeychain(encryptedKey, nonce, salt) { - try { - const kt = await getKeytar(); - if (!kt) - return false; - const data = JSON.stringify({ - encrypted_key: encryptedKey.toString("base64"), - nonce: nonce.toString("base64"), - salt: salt.toString("base64"), - version: "2.0" - // Version 2.0 = AEAD encryption - }); - await kt.setPassword(KEYCHAIN_SERVICE, this.getKeychainAccount(), data); - return true; - } catch { - return false; - } - } - /** - * Load encrypted master key from OS Keychain - * Returns null if not found or keychain not available - */ - async loadMasterKeyFromKeychain() { - try { - const kt = await getKeytar(); - if (!kt) - return null; - const dataStr = await kt.getPassword(KEYCHAIN_SERVICE, this.getKeychainAccount()); - if (!dataStr) { - return null; - } - const data = JSON.parse(dataStr); - if (data.version !== "2.0") { - return null; - } - return { - encryptedKey: Buffer.from(data.encrypted_key, "base64"), - nonce: Buffer.from(data.nonce, "base64"), - salt: Buffer.from(data.salt, "base64") - }; - } catch { - return null; - } - } - /** - * Store encrypted master key in file (fallback when keychain unavailable) - */ - storeMasterKeyInFile(encryptedKey, nonce, salt) { - const keyPath = path2.join(this.vaultDir, "vault.key"); - const data = { - encrypted_key: encryptedKey.toString("base64"), - nonce: nonce.toString("base64"), - salt: salt.toString("base64"), - version: "2.0" - // Version 2.0 = AEAD encryption - }; - fs2.writeFileSync(keyPath, JSON.stringify(data, null, 2), { mode: KEY_FILE_MODE }); - } - getInitializationMarkerPath() { - return path2.join(this.vaultDir, INIT_MARKER_FILE); - } - getKeychainAccount() { - const normalizedVaultDir = path2.resolve(this.vaultDir); - const vaultHash = (0, import_crypto22.createHash)("sha256").update(normalizedVaultDir).digest("hex").slice(0, 32); - return `${KEYCHAIN_ACCOUNT_PREFIX}${vaultHash}`; - } - writeInitializationMarker() { - fs2.writeFileSync( - this.getInitializationMarkerPath(), - JSON.stringify({ initialized: true, version: "1.0" }, null, 2), - { mode: KEY_FILE_MODE } - ); - } - hasInitializationMarker() { - return fs2.existsSync(this.getInitializationMarkerPath()); - } - hasLocalInitializationArtifacts() { - return this.hasInitializationMarker() || this.loadMasterKeyFromFile() !== null; - } - hasVaultRecords() { - const stmt = this.db.prepare(` - SELECT COUNT(*) as count FROM vault_records - `); - const row = stmt.get(); - return row.count > 0; - } - async hasStoredMasterKey() { - if (this.hasLocalInitializationArtifacts()) { - return true; - } - const keyData = await this.loadMasterKeyFromKeychain(); - if (keyData && this.hasVaultRecords()) { - this.writeInitializationMarker(); - return true; - } - return false; - } - async isProvisioned() { - const dbPath = path2.join(this.vaultDir, "vault.db"); - if (!fs2.existsSync(dbPath)) - return false; - const stmt = this.db.prepare(` - SELECT COUNT(*) as count FROM sqlite_master - WHERE type='table' AND name='vault_records' - `); - const row = stmt.get(); - return row.count > 0 && await this.hasStoredMasterKey(); - } - /** - * Load encrypted master key from file - * Returns null if file doesn't exist or has wrong format - */ - loadMasterKeyFromFile() { - const keyPath = path2.join(this.vaultDir, "vault.key"); - if (!fs2.existsSync(keyPath)) { - return null; - } - try { - const data = JSON.parse(fs2.readFileSync(keyPath, "utf8")); - if (data.version !== "2.0") { - return null; - } - return { - encryptedKey: Buffer.from(data.encrypted_key, "base64"), - nonce: Buffer.from(data.nonce, "base64"), - salt: Buffer.from(data.salt, "base64") - }; - } catch { - return null; - } - } - // ========================================================================== - // Vault Records CRUD - // ========================================================================== - /** - * Store an encrypted vault record - */ - storeRecord(scope, itemType, sensitivity, encrypted, chain, publicAddress) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const id = generateId(); - const stmt = this.db.prepare(` - INSERT INTO vault_records ( - id, scope, item_type, sensitivity, ciphertext, nonce, - dek_wrapped, dek_nonce, chain, public_address, schema_version, - created_at, updated_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '1.0', ?, ?) - `); - stmt.run( - id, - scope, - itemType, - sensitivity, - encrypted.ciphertext, - encrypted.nonce, - encrypted.dek_wrapped, - encrypted.dek_nonce, - chain || null, - publicAddress || null, - now, - now - ); - return { - id, - scope, - item_type: itemType, - sensitivity, - ciphertext: encrypted.ciphertext, - nonce: encrypted.nonce, - dek_wrapped: encrypted.dek_wrapped, - dek_nonce: encrypted.dek_nonce, - chain, - public_address: publicAddress, - schema_version: "1.0", - created_at: now, - updated_at: now - }; - } - /** - * Get a vault record by scope - */ - getRecord(scope) { - const stmt = this.db.prepare("SELECT * FROM vault_records WHERE scope = ?"); - const row = stmt.get(scope); - if (!row) - return null; - return { - ...row, - ciphertext: row.ciphertext, - nonce: row.nonce, - dek_wrapped: row.dek_wrapped, - dek_nonce: row.dek_nonce - }; - } - /** - * Get encrypted payload from a record - */ - getEncryptedPayload(scope) { - const record2 = this.getRecord(scope); - if (!record2) - return null; - return { - ciphertext: record2.ciphertext, - nonce: record2.nonce, - dek_wrapped: record2.dek_wrapped, - dek_nonce: record2.dek_nonce - }; - } - /** - * List all scopes (metadata only, no values) - */ - listScopes() { - const stmt = this.db.prepare(` - SELECT scope, item_type, sensitivity, chain, public_address - FROM vault_records - ORDER BY created_at DESC - `); - return stmt.all(); - } - /** - * Get wallets by chain - */ - getWalletsByChain(chain) { - const stmt = this.db.prepare(` - SELECT * FROM vault_records - WHERE chain = ? AND item_type = 'WALLET_KEY' - `); - return stmt.all(chain); - } - /** - * Delete a vault record - */ - deleteRecord(scope) { - const stmt = this.db.prepare("DELETE FROM vault_records WHERE scope = ?"); - const result = stmt.run(scope); - return result.changes > 0; - } - /** - * List all records with full metadata (for CLI) - * Returns records with created_at/updated_at, but no decrypted data - */ - listRecords() { - const stmt = this.db.prepare(` - SELECT id, scope, item_type, sensitivity, chain, public_address, created_at, updated_at - FROM vault_records - ORDER BY created_at DESC - `); - return stmt.all(); - } - /** - * Create a record with automatic encryption (convenience method) - * - * @param options - Record options including data to encrypt - * @returns Created record - */ - createRecord(options) { - const masterKey = this.getMasterKey(); - let encrypted; - if ("ciphertext" in options.data && "nonce" in options.data) { - encrypted = options.data; - } else { - const plaintext = Buffer.from(JSON.stringify(options.data), "utf8"); - try { - encrypted = envelopeEncrypt(plaintext, masterKey); - } finally { - zeroize(plaintext); - } - } - return this.storeRecord( - options.scope, - options.item_type, - options.sensitivity, - encrypted, - options.chain, - options.public_address - ); - } - /** - * Update a record's encrypted data - * - * @param recordId - Record ID to update - * @param data - New data to encrypt - * @param masterKey - Master key for encryption - */ - updateRecord(recordId, data, masterKey) { - const plaintext = Buffer.from(JSON.stringify(data), "utf8"); - try { - const encrypted = envelopeEncrypt(plaintext, masterKey); - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE vault_records SET - ciphertext = ?, - nonce = ?, - dek_wrapped = ?, - dek_nonce = ?, - updated_at = ? - WHERE id = ? - `); - stmt.run( - encrypted.ciphertext, - encrypted.nonce, - encrypted.dek_wrapped, - encrypted.dek_nonce, - now, - recordId - ); - } finally { - zeroize(plaintext); - } - } - /** - * Update an existing wallet record with an already encrypted private key. - * - * Used by owner-only wallet replacement flows. This keeps the stable record - * scope while updating both encrypted key material and public metadata. - */ - updateWalletRecord(recordId, encrypted, chain, publicAddress) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE vault_records SET - ciphertext = ?, - nonce = ?, - dek_wrapped = ?, - dek_nonce = ?, - chain = ?, - public_address = ?, - updated_at = ? - WHERE id = ? - `); - stmt.run( - encrypted.ciphertext, - encrypted.nonce, - encrypted.dek_wrapped, - encrypted.dek_nonce, - chain, - publicAddress, - now, - recordId - ); - } - // ========================================================================== - // Agent Sessions CRUD - // ========================================================================== - /** - * Create an agent session - */ - createSession(agentName, grantedScopes, consentMode, expiresAt, options) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const id = generateId(); - const stmt = this.db.prepare(` - INSERT INTO agent_sessions ( - id, agent_name, agent_fingerprint, marketplace, trust_tier, - granted_scopes, purpose, consent_mode, profile_name, token_id, - expires_at, created_at, last_used_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `); - stmt.run( - id, - agentName, - options?.agentFingerprint || null, - options?.marketplace || null, - options?.trustTier || "unknown", - JSON.stringify(grantedScopes), - options?.purpose || null, - consentMode, - options?.profileName || null, - options?.tokenId || null, - expiresAt.toISOString(), - now, - now - // last_used_at = created_at initially - ); - return { - id, - agent_name: agentName, - agent_fingerprint: options?.agentFingerprint, - marketplace: options?.marketplace, - trust_tier: options?.trustTier || "unknown", - granted_scopes: grantedScopes, - purpose: options?.purpose, - consent_mode: consentMode, - profile_name: options?.profileName, - token_id: options?.tokenId, - expires_at: expiresAt.toISOString(), - created_at: now, - last_used_at: now - }; - } - /** - * Get active session by agent name - */ - getActiveSession(agentName) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - SELECT * FROM agent_sessions - WHERE agent_name = ? - AND expires_at > ? - AND revoked_at IS NULL - ORDER BY created_at DESC - LIMIT 1 - `); - const row = stmt.get(agentName, now); - if (!row) - return null; - return { - ...row, - granted_scopes: JSON.parse(row.granted_scopes) - }; - } - /** - * Get session by ID - */ - getSession(sessionId) { - const stmt = this.db.prepare("SELECT * FROM agent_sessions WHERE id = ?"); - const row = stmt.get(sessionId); - if (!row) - return null; - return { - ...row, - granted_scopes: JSON.parse(row.granted_scopes) - }; - } - /** - * Update session last_used_at timestamp (touch) - */ - touchSession(sessionId) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare("UPDATE agent_sessions SET last_used_at = ? WHERE id = ?"); - const result = stmt.run(now, sessionId); - return result.changes > 0; - } - /** - * Revoke a session - */ - revokeSession(sessionId) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare("UPDATE agent_sessions SET revoked_at = ? WHERE id = ?"); - const result = stmt.run(now, sessionId); - return result.changes > 0; - } - /** - * Revoke all sessions for an agent - */ - revokeAgentSessions(agentName) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE agent_sessions - SET revoked_at = ? - WHERE agent_name = ? AND revoked_at IS NULL - `); - const result = stmt.run(now, agentName); - return result.changes; - } - /** - * List all active sessions - */ - listActiveSessions() { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - SELECT * FROM agent_sessions - WHERE expires_at > ? AND revoked_at IS NULL - ORDER BY created_at DESC - `); - const rows = stmt.all(now); - return rows.map((row) => ({ - ...row, - granted_scopes: JSON.parse(row.granted_scopes) - })); - } - /** - * List all active sessions for a specific agent - */ - listActiveSessionsForAgent(agentName) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - SELECT * FROM agent_sessions - WHERE agent_name = ? - AND expires_at > ? - AND revoked_at IS NULL - ORDER BY created_at DESC - `); - const rows = stmt.all(agentName, now); - return rows.map((row) => ({ - ...row, - granted_scopes: JSON.parse(row.granted_scopes) - })); - } - /** - * List all sessions (including expired and revoked) - */ - listAllSessions() { - const stmt = this.db.prepare(` - SELECT * FROM agent_sessions - ORDER BY created_at DESC - `); - const rows = stmt.all(); - return rows.map((row) => ({ - ...row, - granted_scopes: JSON.parse(row.granted_scopes) - })); - } - // ========================================================================== - // Spend Events CRUD - // ========================================================================== - /** - * Record a spend event - */ - recordSpend(sessionId, amount, currency, chain, operation, status, options) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const id = generateId(); - const stmt = this.db.prepare(` - INSERT INTO spend_events ( - id, agent_session_id, amount, currency, chain, operation, - destination, idempotency_key, status, tx_signature, created_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) - `); - try { - stmt.run( - id, - sessionId, - amount, - currency, - chain, - operation, - options?.destination || null, - options?.idempotencyKey || null, - status, - options?.txSignature || null, - now - ); - } catch (error) { - if (error && typeof error === "object" && "code" in error && error.code === "SQLITE_CONSTRAINT_UNIQUE") { - throw new VaultError2("IDEMPOTENCY_CONFLICT", "Duplicate idempotency key"); - } - throw error; - } - return { - id, - agent_session_id: sessionId, - amount, - currency, - chain, - operation, - destination: options?.destination, - idempotency_key: options?.idempotencyKey, - status, - tx_signature: options?.txSignature, - created_at: now - }; - } - /** - * Get daily spend total for a currency - */ - getDailySpend(currency, chain) { - const twentyFourHoursAgo = new Date(Date.now() - 24 * 60 * 60 * 1e3).toISOString(); - const stmt = this.db.prepare(` - SELECT COALESCE(SUM(amount), 0) as total - FROM spend_events - WHERE currency = ? - AND chain = ? - AND status = 'committed' - AND created_at > ? - `); - const row = stmt.get(currency, chain, twentyFourHoursAgo); - return row.total; - } - /** - * Get spend event by idempotency key - */ - getSpendByIdempotencyKey(idempotencyKey) { - const stmt = this.db.prepare("SELECT * FROM spend_events WHERE idempotency_key = ?"); - return stmt.get(idempotencyKey); - } - // ========================================================================== - // Audit Events - // ========================================================================== - /** - * Log an audit event - */ - logAudit(eventType, outcome, options) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const id = generateId(); - const stmt = this.db.prepare(` - INSERT INTO audit_events ( - id, event_type, agent_name, scope, operation, details, outcome, created_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) - `); - stmt.run( - id, - eventType, - options?.agentName || null, - options?.scope || null, - options?.operation || null, - options?.details || null, - outcome, - now - ); - return { - id, - event_type: eventType, - agent_name: options?.agentName, - scope: options?.scope, - operation: options?.operation, - details: options?.details, - outcome, - created_at: now - }; - } - /** - * Get recent audit events - */ - getAuditEvents(limit = 100, filters) { - let query = "SELECT * FROM audit_events WHERE 1=1"; - const params = []; - if (filters?.eventType) { - query += " AND event_type = ?"; - params.push(filters.eventType); - } - if (filters?.agentName) { - query += " AND agent_name = ?"; - params.push(filters.agentName); - } - if (filters?.since) { - query += " AND created_at > ?"; - params.push(filters.since.toISOString()); - } - query += " ORDER BY created_at DESC LIMIT ?"; - params.push(limit); - const stmt = this.db.prepare(query); - return stmt.all(...params); - } - // ========================================================================== - // Pending Consents - // ========================================================================== - /** - * Find existing pending consent for same agent/action/scope (deduplication) - */ - findPendingConsent(agentName, action, scope) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - SELECT * FROM pending_consents - WHERE agent_name = ? AND action = ? AND scope = ? - AND status = 'pending' AND expires_at > ? - ORDER BY created_at DESC - LIMIT 1 - `); - return stmt.get(agentName, action, scope, now); - } - /** - * Create a pending consent request (with deduplication) - * If an existing pending consent exists for the same agent/action/scope, returns that instead - * @returns Object with consent and isNew flag (false if deduped) - */ - createPendingConsent(agentName, action, scope, details) { - const existing = this.findPendingConsent(agentName, action, scope); - if (existing) { - return { ...existing, consent: existing, isNew: false }; - } - const now = /* @__PURE__ */ new Date(); - const expiresAt = new Date(now.getTime() + 5 * 60 * 1e3); - const id = generateId(); - const stmt = this.db.prepare(` - INSERT INTO pending_consents ( - id, agent_name, action, scope, details, status, created_at, expires_at - ) VALUES (?, ?, ?, ?, ?, 'pending', ?, ?) - `); - stmt.run(id, agentName, action, scope, details || null, now.toISOString(), expiresAt.toISOString()); - const consent = { - id, - agent_name: agentName, - action, - scope, - details, - status: "pending", - created_at: now.toISOString(), - expires_at: expiresAt.toISOString() - }; - return { ...consent, consent, isNew: true }; - } - /** - * Get pending consent by ID - */ - getPendingConsent(id) { - const stmt = this.db.prepare("SELECT * FROM pending_consents WHERE id = ?"); - return stmt.get(id); - } - /** - * Resolve a pending consent - * @param id - Consent ID - * @param status - Resolution status - * @param sessionId - Optional session ID if a session was created during approval - */ - resolveConsent(id, status, sessionId) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE pending_consents - SET status = ?, resolved_at = ?, session_id = ? - WHERE id = ? AND status = 'pending' - `); - const result = stmt.run(status, now, sessionId || null, id); - return result.changes > 0; - } - /** - * Find an approved consent for this agent/action/scope and consume it (mark as 'consumed') - * This implements "approve once" semantics - after one use, the consent cannot be reused - * @returns The consumed consent if found, null otherwise - */ - consumeApprovedConsent(agentName, action, scope) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const findStmt = this.db.prepare(` - SELECT * FROM pending_consents - WHERE agent_name = ? AND action = ? AND scope = ? - AND status = 'approved' - ORDER BY resolved_at DESC - LIMIT 1 - `); - const consent = findStmt.get(agentName, action, scope); - if (!consent) { - return null; - } - const updateStmt = this.db.prepare(` - UPDATE pending_consents - SET status = 'consumed', resolved_at = ? - WHERE id = ? AND status = 'approved' - `); - const result = updateStmt.run(now, consent.id); - if (result.changes === 0) { - return null; - } - return { ...consent, status: "consumed" }; - } - /** - * Get pending consents (not expired) - */ - getPendingConsents() { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - SELECT * FROM pending_consents - WHERE status = 'pending' AND expires_at > ? - ORDER BY created_at DESC - `); - return stmt.all(now); - } - /** - * Expire old pending consents - */ - expireOldConsents() { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE pending_consents - SET status = 'expired', resolved_at = ? - WHERE status = 'pending' AND expires_at < ? - `); - const result = stmt.run(now, now); - return result.changes; - } - // ========================================================================== - // Trusted Services CRUD (protocol spec section B2) - // ========================================================================== - /** - * Add a trusted service - * - * @param service - Service configuration - * @returns Created trusted service - * @throws VaultError with SERVICE_ALREADY_TRUSTED if service already exists - */ - addTrustedService(service) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const existing = this.getTrustedService(service.service_id); - if (existing) { - throw new VaultError2("SERVICE_ALREADY_TRUSTED", `Service '${service.service_id}' is already trusted`); - } - const stmt = this.db.prepare(` - INSERT INTO trusted_services ( - service_id, name, public_key, scopes, - budget_daily, budget_currency, budget_auto_approve_under, - trusted_at, enabled, verified - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, 1, ?) - `); - stmt.run( - service.service_id, - service.name, - service.public_key, - JSON.stringify(service.scopes), - service.budget.daily, - service.budget.currency, - service.budget.auto_approve_under, - now, - service.verified ? 1 : 0 - ); - this.logAudit("CONFIG", "success", { - operation: "trust_service", - details: JSON.stringify({ - service_id: service.service_id, - scopes: service.scopes, - budget_daily: service.budget.daily - }) - }); - return { - ...service, - trusted_at: now, - enabled: true - }; - } - /** - * Get a trusted service by ID - */ - getTrustedService(serviceId) { - const stmt = this.db.prepare("SELECT * FROM trusted_services WHERE service_id = ?"); - const row = stmt.get(serviceId); - if (!row) - return null; - return { - service_id: row.service_id, - name: row.name, - public_key: row.public_key, - scopes: JSON.parse(row.scopes), - budget: { - daily: row.budget_daily, - currency: row.budget_currency, - auto_approve_under: row.budget_auto_approve_under - }, - trusted_at: row.trusted_at, - connected_at: row.connected_at || void 0, - enabled: row.enabled === 1, - verified: row.verified === 1 - }; - } - /** - * List all trusted services - */ - listTrustedServices(enabledOnly = false) { - let query = "SELECT * FROM trusted_services"; - if (enabledOnly) { - query += " WHERE enabled = 1"; - } - query += " ORDER BY trusted_at DESC"; - const stmt = this.db.prepare(query); - const rows = stmt.all(); - return rows.map((row) => ({ - service_id: row.service_id, - name: row.name, - public_key: row.public_key, - scopes: JSON.parse(row.scopes), - budget: { - daily: row.budget_daily, - currency: row.budget_currency, - auto_approve_under: row.budget_auto_approve_under - }, - trusted_at: row.trusted_at, - connected_at: row.connected_at || void 0, - enabled: row.enabled === 1, - verified: row.verified === 1 - })); - } - /** - * Update a trusted service - */ - updateTrustedService(serviceId, updates) { - const existing = this.getTrustedService(serviceId); - if (!existing) { - throw new VaultError2("SERVICE_NOT_FOUND", `Service '${serviceId}' not found`); - } - const fields = []; - const values = []; - if (updates.name !== void 0) { - fields.push("name = ?"); - values.push(updates.name); - } - if (updates.public_key !== void 0) { - fields.push("public_key = ?"); - values.push(updates.public_key); - } - if (updates.scopes !== void 0) { - fields.push("scopes = ?"); - values.push(JSON.stringify(updates.scopes)); - } - if (updates.budget !== void 0) { - fields.push("budget_daily = ?", "budget_currency = ?", "budget_auto_approve_under = ?"); - values.push(updates.budget.daily, updates.budget.currency, updates.budget.auto_approve_under); - } - if (updates.enabled !== void 0) { - fields.push("enabled = ?"); - values.push(updates.enabled ? 1 : 0); - } - if (updates.verified !== void 0) { - fields.push("verified = ?"); - values.push(updates.verified ? 1 : 0); - } - if (fields.length === 0) - return false; - values.push(serviceId); - const stmt = this.db.prepare(`UPDATE trusted_services SET ${fields.join(", ")} WHERE service_id = ?`); - const result = stmt.run(...values); - this.logAudit("CONFIG", "success", { - operation: "update_service", - details: JSON.stringify({ service_id: serviceId, updates }) - }); - return result.changes > 0; - } - /** - * Mark a service as connected (after dcp connect) - */ - markServiceConnected(serviceId) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare("UPDATE trusted_services SET connected_at = ? WHERE service_id = ?"); - const result = stmt.run(now, serviceId); - this.logAudit("CONFIG", "success", { - operation: "connect_service", - details: JSON.stringify({ service_id: serviceId }) - }); - return result.changes > 0; - } - /** - * Revoke (delete) a trusted service - */ - revokeTrustedService(serviceId) { - const stmt = this.db.prepare("DELETE FROM trusted_services WHERE service_id = ?"); - const result = stmt.run(serviceId); - if (result.changes > 0) { - this.logAudit("REVOKE", "success", { - operation: "revoke_service", - details: JSON.stringify({ service_id: serviceId }) - }); - } - return result.changes > 0; - } - // ========================================================================== - // Agent Connections CRUD (DCP v1 Agent Connectivity) - // ========================================================================== - rowToAgentConnection(row) { - return { - agent_id: row.agent_id, - name: row.name, - mode: row.mode, - status: row.status, - service_id: row.service_id || void 0, - service_public_key: row.service_public_key || void 0, - permission_scopes: JSON.parse(row.permission_scopes), - budget: { - daily: row.budget_daily, - currency: row.budget_currency, - auto_approve_under: row.budget_auto_approve_under - }, - tier: row.tier, - token_hash: row.token_hash || void 0, - created_at: row.created_at, - paired_at: row.paired_at || void 0, - last_seen_at: row.last_seen_at || void 0, - last_request_at: row.last_request_at || void 0, - request_count: row.request_count, - revoked_at: row.revoked_at || void 0 - }; - } - /** - * Create an agent connection record. - */ - createAgentConnection(input) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const agentId = input.agent_id || `agent_${generateId()}`; - const tier = input.tier || "free"; - const stmt = this.db.prepare(` - INSERT INTO agent_connections ( - agent_id, name, mode, status, service_id, permission_scopes, - budget_daily, budget_currency, budget_auto_approve_under, - tier, token_hash, created_at - ) VALUES (?, ?, ?, 'pending', ?, ?, ?, ?, ?, ?, ?, ?) - `); - stmt.run( - agentId, - input.name, - input.mode, - input.service_id || null, - JSON.stringify(input.permission_scopes), - input.budget.daily, - input.budget.currency, - input.budget.auto_approve_under, - tier, - input.token_hash || null, - now - ); - this.logAudit("CONFIG", "success", { - operation: "create_agent_connection", - details: JSON.stringify({ - agent_id: agentId, - name: input.name, - mode: input.mode, - service_id: input.service_id - }) - }); - return { - agent_id: agentId, - name: input.name, - mode: input.mode, - status: "pending", - service_id: input.service_id, - permission_scopes: input.permission_scopes, - budget: input.budget, - tier, - token_hash: input.token_hash, - created_at: now, - request_count: 0 - }; - } - /** - * Get an agent connection by ID. - */ - getAgentConnection(agentId) { - const stmt = this.db.prepare("SELECT * FROM agent_connections WHERE agent_id = ?"); - const row = stmt.get(agentId); - return row ? this.rowToAgentConnection(row) : null; - } - /** - * Get an agent connection by name (for local request permission checking). - * Returns the most recently active agent with this name. - */ - getAgentConnectionByName(name) { - const stmt = this.db.prepare(` - SELECT * FROM agent_connections - WHERE name = ? AND status = 'active' AND revoked_at IS NULL - ORDER BY last_seen_at DESC, paired_at DESC - LIMIT 1 - `); - const row = stmt.get(name); - return row ? this.rowToAgentConnection(row) : null; - } - /** - * List agent connections ordered by most recent activity. - */ - listAgentConnections() { - const stmt = this.db.prepare(` - SELECT * FROM agent_connections - ORDER BY - CASE WHEN last_seen_at IS NULL THEN 1 ELSE 0 END, - last_seen_at DESC, - created_at DESC - `); - const rows = stmt.all(); - return rows.map((row) => this.rowToAgentConnection(row)); - } - /** - * Mark an agent as paired and active. - * Per protocol spec section 7.3, stores the agent's service public key for relay authentication. - */ - markAgentPaired(agentId, tokenHash, servicePublicKey) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE agent_connections - SET status = 'active', - paired_at = COALESCE(paired_at, ?), - last_seen_at = ?, - token_hash = COALESCE(?, token_hash), - service_public_key = COALESCE(?, service_public_key) - WHERE agent_id = ? AND revoked_at IS NULL - `); - const result = stmt.run(now, now, tokenHash || null, servicePublicKey || null, agentId); - return result.changes > 0; - } - /** - * Record agent heartbeat. - */ - recordAgentHeartbeat(agentId) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE agent_connections - SET status = 'active', last_seen_at = ? - WHERE agent_id = ? AND revoked_at IS NULL - `); - const result = stmt.run(now, agentId); - return result.changes > 0; - } - /** - * Record an agent request for dashboard counters. - * Also updates last_seen_at since a request means the agent is active. - */ - recordAgentRequest(agentId) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE agent_connections - SET last_request_at = ?, last_seen_at = ?, request_count = request_count + 1 - WHERE agent_id = ? AND revoked_at IS NULL - `); - const result = stmt.run(now, now, agentId); - return result.changes > 0; - } - /** - * Revoke an agent connection without deleting history. - */ - revokeAgentConnection(agentId) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - UPDATE agent_connections - SET status = 'revoked', revoked_at = ?, token_hash = NULL - WHERE agent_id = ? AND revoked_at IS NULL - `); - const result = stmt.run(now, agentId); - if (result.changes > 0) { - this.logAudit("REVOKE", "success", { - operation: "revoke_agent_connection", - details: JSON.stringify({ agent_id: agentId }) - }); - } - return result.changes > 0; - } - /** - * Delete an agent connection completely (revokes and removes from DB). - */ - deleteAgentConnection(agentId) { - this.revokeAgentConnection(agentId); - const stmt = this.db.prepare(` - DELETE FROM agent_connections - WHERE agent_id = ? - `); - const result = stmt.run(agentId); - if (result.changes > 0) { - this.logAudit("REVOKE", "success", { - operation: "delete_agent_connection", - details: JSON.stringify({ agent_id: agentId }) - }); - } - return result.changes > 0; - } - /** - * Update an agent connection's permissions and budget. - * Only allows updating non-revoked agents. - */ - updateAgentConnection(agentId, updates) { - const agent2 = this.getAgentConnection(agentId); - if (!agent2 || agent2.status === "revoked") { - return false; - } - const setClauses = []; - const values = []; - if (updates.permission_scopes !== void 0) { - setClauses.push("permission_scopes = ?"); - values.push(JSON.stringify(updates.permission_scopes)); - } - if (updates.budget_daily !== void 0) { - setClauses.push("budget_daily = ?"); - values.push(updates.budget_daily); - } - if (updates.budget_currency !== void 0) { - setClauses.push("budget_currency = ?"); - values.push(updates.budget_currency); - } - if (updates.budget_auto_approve_under !== void 0) { - setClauses.push("budget_auto_approve_under = ?"); - values.push(updates.budget_auto_approve_under); - } - if (setClauses.length === 0) { - return true; - } - values.push(agentId); - const stmt = this.db.prepare(` - UPDATE agent_connections - SET ${setClauses.join(", ")} - WHERE agent_id = ? AND revoked_at IS NULL - `); - const result = stmt.run(...values); - if (result.changes > 0) { - this.logAudit("CONFIG", "success", { - operation: "update_agent_connection", - details: JSON.stringify({ agent_id: agentId, updates }) - }); - } - return result.changes > 0; - } - // ========================================================================== - // Pairing Tokens (Proxy Pairing Flow) - // ========================================================================== - /** - * Create a pairing token for a service/proxy - */ - createPairingToken(input) { - const now = /* @__PURE__ */ new Date(); - const ttlSeconds = input.ttl_seconds ?? 600; - const expiresAt = new Date(now.getTime() + ttlSeconds * 1e3); - const token = (0, import_crypto22.randomBytes)(32).toString("base64url"); - const tokenHash = (0, import_crypto22.createHash)("sha256").update(token).digest("hex"); - const stmt = this.db.prepare(` - INSERT INTO pairing_tokens ( - token_hash, service_id, scopes, - budget_daily, budget_currency, budget_auto_approve_under, - created_at, expires_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) - `); - stmt.run( - tokenHash, - input.service_id, - JSON.stringify(input.scopes), - input.budget.daily, - input.budget.currency, - input.budget.auto_approve_under, - now.toISOString(), - expiresAt.toISOString() - ); - this.logAudit("CONFIG", "success", { - operation: "pairing_token", - details: JSON.stringify({ - service_id: input.service_id, - scopes: input.scopes, - expires_at: expiresAt.toISOString() - }) - }); - return { token, expires_at: expiresAt.toISOString() }; - } - /** - * Get a pairing token record by plaintext token - */ - getPairingToken(token) { - const tokenHash = (0, import_crypto22.createHash)("sha256").update(token).digest("hex"); - const stmt = this.db.prepare("SELECT * FROM pairing_tokens WHERE token_hash = ?"); - const row = stmt.get(tokenHash); - if (!row) - return null; - const now = /* @__PURE__ */ new Date(); - const expires = new Date(row.expires_at); - if (expires < now) { - return null; - } - if (row.used_at) { - return null; - } - return { - service_id: row.service_id, - scopes: JSON.parse(row.scopes), - budget: { - daily: row.budget_daily, - currency: row.budget_currency, - auto_approve_under: row.budget_auto_approve_under - }, - expires_at: row.expires_at, - used_at: row.used_at - }; - } - /** - * Mark a pairing token as used - */ - markPairingTokenUsed(token) { - const tokenHash = (0, import_crypto22.createHash)("sha256").update(token).digest("hex"); - const now = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare("UPDATE pairing_tokens SET used_at = ? WHERE token_hash = ?"); - const result = stmt.run(now, tokenHash); - return result.changes > 0; - } - /** - * Check if a service is trusted and has permission for a scope - */ - isServiceAuthorized(serviceId, scope) { - const service = this.getTrustedService(serviceId); - if (!service) { - return { authorized: false, reason: "Service not trusted" }; - } - if (!service.enabled) { - return { authorized: false, service, reason: "Service is disabled" }; - } - const isAllowed = service.scopes.some((allowedScope) => { - if (allowedScope === scope) - return true; - if (allowedScope.endsWith(":*")) { - const prefix = allowedScope.slice(0, -1); - return scope.startsWith(prefix); - } - if (allowedScope.endsWith(".*")) { - const prefix = allowedScope.slice(0, -1); - return scope.startsWith(prefix); - } - if (scope.startsWith(allowedScope + ".")) { - return true; - } - return false; - }); - if (!isAllowed) { - return { authorized: false, service, reason: `Scope '${scope}' not allowed for service` }; - } - return { authorized: true, service }; - } - // ========================================================================== - // Telegram Notification Methods (protocol spec section 15) - // ========================================================================== - /** - * Create Telegram configuration. - * Bot token is stored encrypted using envelope encryption. - */ - createTelegramConfig(input) { - if (!this.masterKey) { - throw new VaultError2("VAULT_LOCKED", "Vault must be unlocked to store Telegram config"); - } - const now = (/* @__PURE__ */ new Date()).toISOString(); - const id = `tg_${generateId()}`; - const botTokenBuffer = Buffer.from(input.bot_token, "utf8"); - const encrypted = envelopeEncrypt(botTokenBuffer, this.masterKey); - const stmt = this.db.prepare(` - INSERT INTO telegram_configs ( - id, chat_id, bot_token_ciphertext, bot_token_nonce, - bot_token_dek_wrapped, bot_token_dek_nonce, - enabled, notify_consent, rate_limit_per_hour, - notifications_this_hour, created_at, updated_at, paired_at - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?) - `); - stmt.run( - id, - input.chat_id, - encrypted.ciphertext, - encrypted.nonce, - encrypted.dek_wrapped, - encrypted.dek_nonce, - input.enabled !== false ? 1 : 0, - input.notify_consent !== false ? 1 : 0, - input.rate_limit_per_hour ?? 30, - now, - now, - now - ); - this.logAudit("CONFIG", "success", { - operation: "telegram_config_create", - details: JSON.stringify({ chat_id: input.chat_id }) - }); - return { - id, - chat_id: input.chat_id, - enabled: input.enabled !== false, - notify_consent: input.notify_consent !== false, - rate_limit_per_hour: input.rate_limit_per_hour ?? 30, - notifications_this_hour: 0, - created_at: now, - updated_at: now, - paired_at: now - }; - } - /** - * Get Telegram configuration (without decrypted bot token). - * Returns null if not configured. - */ - getTelegramConfig() { - const stmt = this.db.prepare("SELECT * FROM telegram_configs LIMIT 1"); - const row = stmt.get(); - if (!row) - return null; - return { - id: row.id, - chat_id: row.chat_id, - enabled: row.enabled === 1, - notify_consent: row.notify_consent === 1, - rate_limit_per_hour: row.rate_limit_per_hour, - last_notification_at: row.last_notification_at ?? void 0, - notifications_this_hour: row.notifications_this_hour, - hour_window_start: row.hour_window_start ?? void 0, - created_at: row.created_at, - updated_at: row.updated_at, - paired_at: row.paired_at ?? void 0, - muted_until: row.muted_until ?? void 0 - }; - } - /** - * Get decrypted bot token. - * Requires vault to be unlocked. - */ - getTelegramBotToken() { - if (!this.masterKey) { - throw new VaultError2("VAULT_LOCKED", "Vault must be unlocked to retrieve bot token"); - } - const stmt = this.db.prepare(` - SELECT bot_token_ciphertext, bot_token_nonce, bot_token_dek_wrapped, bot_token_dek_nonce - FROM telegram_configs LIMIT 1 - `); - const row = stmt.get(); - if (!row) - return null; - const encrypted = { - ciphertext: row.bot_token_ciphertext, - nonce: row.bot_token_nonce, - dek_wrapped: row.bot_token_dek_wrapped, - dek_nonce: row.bot_token_dek_nonce - }; - const decrypted = envelopeDecrypt2(encrypted, this.masterKey); - return decrypted.toString("utf8"); - } - /** - * Update Telegram configuration. - */ - updateTelegramConfig(updates) { - const now = (/* @__PURE__ */ new Date()).toISOString(); - const config = this.getTelegramConfig(); - if (!config) - return false; - const fields = ["updated_at = ?"]; - const values = [now]; - if (updates.enabled !== void 0) { - fields.push("enabled = ?"); - values.push(updates.enabled ? 1 : 0); - } - if (updates.chat_id !== void 0) { - fields.push("chat_id = ?"); - values.push(updates.chat_id); - } - if (updates.notify_consent !== void 0) { - fields.push("notify_consent = ?"); - values.push(updates.notify_consent ? 1 : 0); - } - if (updates.rate_limit_per_hour !== void 0) { - fields.push("rate_limit_per_hour = ?"); - values.push(updates.rate_limit_per_hour); - } - if (updates.muted_until !== void 0) { - fields.push("muted_until = ?"); - values.push(updates.muted_until ?? ""); - } - if (updates.paired_at !== void 0) { - fields.push("paired_at = ?"); - values.push(updates.paired_at ?? ""); - } - values.push(config.id); - const stmt = this.db.prepare(` - UPDATE telegram_configs SET ${fields.join(", ")} WHERE id = ? - `); - const result = stmt.run(...values); - if (result.changes > 0) { - this.logAudit("CONFIG", "success", { - operation: "telegram_config_update", - details: JSON.stringify(updates) - }); - } - return result.changes > 0; - } - /** - * Delete Telegram configuration (unlink). - */ - deleteTelegramConfig() { - const config = this.getTelegramConfig(); - if (!config) - return false; - this.db.exec("DELETE FROM telegram_configs"); - this.db.exec("DELETE FROM telegram_pairing_codes"); - this.logAudit("CONFIG", "success", { - operation: "telegram_config_delete", - details: JSON.stringify({ chat_id: config.chat_id }) - }); - return true; - } - /** - * Create a 6-digit pairing code for Telegram linking. - * Code expires in 10 minutes. - */ - createTelegramPairingCode(vaultId) { - const now = /* @__PURE__ */ new Date(); - const expiresAt = new Date(now.getTime() + 10 * 60 * 1e3); - const code = (0, import_crypto22.randomInt)(1e5, 1e6).toString(); - this.db.prepare("DELETE FROM telegram_pairing_codes WHERE vault_id = ? AND used = 0").run(vaultId); - const stmt = this.db.prepare(` - INSERT INTO telegram_pairing_codes (code, vault_id, expires_at, used, created_at) - VALUES (?, ?, ?, 0, ?) - `); - stmt.run(code, vaultId, expiresAt.toISOString(), now.toISOString()); - return { - code, - vault_id: vaultId, - expires_at: expiresAt.toISOString(), - used: false, - created_at: now.toISOString() - }; - } - /** - * Validate a pairing code and return the vault ID if valid. - */ - validateTelegramPairingCode(code) { - const stmt = this.db.prepare(` - SELECT * FROM telegram_pairing_codes WHERE code = ? AND used = 0 - `); - const row = stmt.get(code); - if (!row) { - return { valid: false }; - } - const now = /* @__PURE__ */ new Date(); - const expires = new Date(row.expires_at); - if (expires < now) { - return { valid: false }; - } - return { valid: true, vault_id: row.vault_id }; - } - /** - * Mark a pairing code as used. - */ - markTelegramPairingCodeUsed(code) { - const stmt = this.db.prepare("UPDATE telegram_pairing_codes SET used = 1 WHERE code = ?"); - const result = stmt.run(code); - return result.changes > 0; - } - /** - * Check if Telegram notifications are rate limited. - * Returns true if rate limited (should NOT send), false if OK to send. - */ - checkTelegramRateLimit() { - const config = this.getTelegramConfig(); - if (!config) - return true; - if (config.muted_until) { - const mutedUntil = new Date(config.muted_until); - if (mutedUntil > /* @__PURE__ */ new Date()) { - return true; - } - } - const now = /* @__PURE__ */ new Date(); - const hourAgo = new Date(now.getTime() - 60 * 60 * 1e3); - if (!config.hour_window_start || new Date(config.hour_window_start) < hourAgo) { - this.db.prepare(` - UPDATE telegram_configs - SET hour_window_start = ?, notifications_this_hour = 0 - WHERE id = ? - `).run(now.toISOString(), config.id); - return false; - } - return config.notifications_this_hour >= config.rate_limit_per_hour; - } - /** - * Increment notification counter and record last notification time. - */ - recordTelegramNotification() { - const config = this.getTelegramConfig(); - if (!config) - return; - const now = (/* @__PURE__ */ new Date()).toISOString(); - this.db.prepare(` - UPDATE telegram_configs - SET notifications_this_hour = notifications_this_hour + 1, - last_notification_at = ? - WHERE id = ? - `).run(now, config.id); - } - /** - * Log a Telegram notification for audit trail. - */ - logTelegramNotification(log) { - const id = `tglog_${generateId()}`; - const sentAt = (/* @__PURE__ */ new Date()).toISOString(); - const stmt = this.db.prepare(` - INSERT INTO telegram_notification_log ( - id, chat_id, consent_id, notification_type, category, agent_name, sent_at, delivered_at, error - ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) - `); - stmt.run( - id, - log.chat_id, - log.consent_id ?? null, - log.notification_type, - log.category ?? null, - log.agent_name ?? null, - sentAt, - log.delivered_at ?? null, - log.error ?? null - ); - return { - id, - ...log, - sent_at: sentAt - }; - } - /** - * Get recent Telegram notification logs. - */ - getTelegramNotificationLogs(limit = 50) { - const stmt = this.db.prepare(` - SELECT * FROM telegram_notification_log ORDER BY sent_at DESC LIMIT ? - `); - const rows = stmt.all(limit); - return rows.map((row) => ({ - id: row.id, - chat_id: row.chat_id, - consent_id: row.consent_id ?? void 0, - notification_type: row.notification_type, - category: row.category, - agent_name: row.agent_name ?? void 0, - sent_at: row.sent_at, - delivered_at: row.delivered_at ?? void 0, - error: row.error ?? void 0 - })); - } - // ========================================================================== - // Utility Methods - // ========================================================================== - /** - * Check if vault is initialized - */ - isInitialized() { - const dbPath = path2.join(this.vaultDir, "vault.db"); - if (!fs2.existsSync(dbPath)) - return false; - const stmt = this.db.prepare(` - SELECT COUNT(*) as count FROM sqlite_master - WHERE type='table' AND name='vault_records' - `); - const row = stmt.get(); - return row.count > 0; - } - /** - * Get vault directory path - */ - getVaultDir() { - return this.vaultDir; - } - /** - * Close database connection - */ - close() { - this.lock(); - this.db.close(); - } - }; - var defaultStorage = null; - function getStorage2(vaultDir) { - if (!defaultStorage || vaultDir && vaultDir !== defaultStorage.getVaultDir()) { - defaultStorage = new VaultStorage(vaultDir); - } - return defaultStorage; - } - function resetStorage() { - if (defaultStorage) { - defaultStorage.close(); - defaultStorage = null; - } - } - var fs22 = __toESM2(require("fs")); - var path22 = __toESM2(require("path")); - var os22 = __toESM2(require("os")); - var DEFAULT_VAULT_DIR2 = process.env.DCP_VAULT_DIR || process.env.VAULT_DIR || path22.join(os22.homedir(), ".dcp"); - var CONFIG_FILE = "config.json"; - var DEFAULT_BUDGET_CONFIG = { - daily_budget: { - SOL: 0.05, - USDC: 5, - USDT: 5, - "1LY": 100 - }, - tx_limit: { - SOL: 0.01, - USDC: 1, - USDT: 1, - "1LY": 10 - }, - approval_threshold: { - SOL: 1e-4, - USDC: 1e-4, - USDT: 1e-4, - "1LY": 1e3 - } - }; - var RATE_LIMIT_PER_MINUTE = 5; - var RATE_LIMIT_WINDOW_MS = 60 * 1e3; - var DEFAULT_CURRENCIES = ["SOL", "USDC", "USDT", "1LY"]; - var DEFAULT_VAULT_CONFIG = { - version: "1.0.0", - server_port: 8420, - default_chain: "solana", - // Use spread to create copies, not references - daily_budget: { ...DEFAULT_BUDGET_CONFIG.daily_budget }, - tx_limit: { ...DEFAULT_BUDGET_CONFIG.tx_limit }, - approval_threshold: { ...DEFAULT_BUDGET_CONFIG.approval_threshold }, - session_timeout_minutes: 30, - session_max_hours: 4, - consent_timeout_seconds: 300, - rate_limit_per_minute: RATE_LIMIT_PER_MINUTE, - trust_sources: [], - keychain_service: "dcp", - write_permissions: {} - }; - function deepCloneConfig(config) { - return { - ...config, - daily_budget: { ...config.daily_budget }, - tx_limit: { ...config.tx_limit }, - approval_threshold: { ...config.approval_threshold }, - trust_sources: [...config.trust_sources], - write_permissions: config.write_permissions ? { ...config.write_permissions } : {}, - desktop_owner: config.desktop_owner ? { ...config.desktop_owner } : void 0, - custom_currencies: config.custom_currencies ? [...config.custom_currencies] : [], - vault_id: config.vault_id, - relay_url: config.relay_url, - relay_hpke_public_key: config.relay_hpke_public_key, - relay_hpke_private_key: config.relay_hpke_private_key, - relay_signing_public_key: config.relay_signing_public_key, - relay_signing_private_key: config.relay_signing_private_key, - relay_pairing_token: config.relay_pairing_token - }; - } - var BudgetEngine = class { - config; - vaultDir; - storage; - /** In-memory rate limit tracking: sessionId -> timestamps */ - rateLimitMap = /* @__PURE__ */ new Map(); - constructor(storage2, vaultDir = DEFAULT_VAULT_DIR2) { - this.storage = storage2; - this.vaultDir = vaultDir; - this.config = this.loadConfig(); - } - // ========================================================================== - // Configuration Management - // ========================================================================== - /** - * Load configuration from file, falling back to defaults - */ - loadConfig() { - const configPath = path22.join(this.vaultDir, CONFIG_FILE); - const defaults = deepCloneConfig(DEFAULT_VAULT_CONFIG); - if (fs22.existsSync(configPath)) { - try { - const data = JSON.parse(fs22.readFileSync(configPath, "utf8")); - return { - ...defaults, - ...data, - daily_budget: { ...defaults.daily_budget, ...data.daily_budget }, - tx_limit: { ...defaults.tx_limit, ...data.tx_limit }, - approval_threshold: { ...defaults.approval_threshold, ...data.approval_threshold }, - write_permissions: { - ...defaults.write_permissions || {}, - ...data.write_permissions || {} - } - }; - } catch { - return defaults; - } - } - return defaults; - } - /** - * Save configuration to file - */ - saveConfig() { - const configPath = path22.join(this.vaultDir, CONFIG_FILE); - if (!fs22.existsSync(this.vaultDir)) { - fs22.mkdirSync(this.vaultDir, { recursive: true, mode: 448 }); - } - fs22.writeFileSync(configPath, JSON.stringify(this.config, null, 2), { mode: 384 }); - } - /** - * Get current configuration (deep cloned to prevent external mutation) - */ - getConfig() { - return deepCloneConfig(this.config); - } - /** - * Update a configuration value - */ - setConfig(key, value) { - this.config[key] = value; - this.saveConfig(); - this.storage.logAudit("CONFIG", "success", { - operation: "set_config", - details: JSON.stringify({ key, value }) - }); - } - /** - * Set a budget limit for a specific currency - */ - setLimit(type2, currency, amount) { - if (amount < 0) { - throw new VaultError2("INTERNAL_ERROR", "Budget limit cannot be negative"); - } - this.config[type2][currency] = amount; - this.saveConfig(); - this.storage.logAudit("CONFIG", "success", { - operation: "set_limit", - details: JSON.stringify({ type: type2, currency, amount }) - }); - } - /** - * Get budget limits for a currency - */ - getLimits(currency) { - return { - daily_budget: this.config.daily_budget[currency] ?? 0, - tx_limit: this.config.tx_limit[currency] ?? 0, - approval_threshold: this.config.approval_threshold[currency] ?? 0 - }; - } - // ========================================================================== - // Budget Check (from protocol spec section 3.1.7) - // ========================================================================== - /** - * Check if a proposed transaction is within budget - * - * Budget check flow (every `vault_sign_tx`): - * 1. Sum SpendEvents for this currency in last 24h - * 2. proposed amount <= tx_limit? No -> BUDGET_EXCEEDED_TX - * 3. total + proposed <= daily_limit? No -> BUDGET_EXCEEDED_DAILY - * 4. proposed > approval_threshold? Yes -> require manual approval - * 5. All pass -> allowed - * - * @param amount - Proposed transaction amount - * @param currency - Currency code (SOL, USDC, etc.) - * @param chain - Blockchain - * @returns Budget check result - */ - checkBudget(amount, currency, chain) { - const limits = this.getLimits(currency); - const result = { - allowed: true, - requires_approval: false, - remaining_daily: limits.daily_budget, - remaining_tx: limits.tx_limit - }; - if (limits.tx_limit === 0 && limits.daily_budget === 0) { - return result; - } - const dailySpent = this.storage.getDailySpend(currency, chain); - if (limits.tx_limit > 0 && amount > limits.tx_limit) { - return { - allowed: false, - requires_approval: false, - remaining_daily: Math.max(0, limits.daily_budget - dailySpent), - remaining_tx: limits.tx_limit, - // Max you can do in single tx - reason: `BUDGET_EXCEEDED_TX: Transaction amount ${amount} ${currency} exceeds per-transaction limit of ${limits.tx_limit} ${currency}` - }; - } - if (limits.daily_budget > 0 && dailySpent + amount > limits.daily_budget) { - return { - allowed: false, - requires_approval: false, - remaining_daily: Math.max(0, limits.daily_budget - dailySpent), - remaining_tx: limits.tx_limit > 0 ? Math.min(limits.tx_limit, Math.max(0, limits.daily_budget - dailySpent)) : 0, - reason: `BUDGET_EXCEEDED_DAILY: Daily spending limit reached. Spent: ${dailySpent} ${currency}, Limit: ${limits.daily_budget} ${currency}` - }; - } - const requiresApproval = limits.approval_threshold > 0 && amount > limits.approval_threshold; - const remainingDaily = limits.daily_budget > 0 ? Math.max(0, limits.daily_budget - dailySpent - amount) : 0; - const remainingTx = limits.tx_limit > 0 ? Math.max(0, limits.tx_limit - amount) : 0; - return { - allowed: true, - requires_approval: requiresApproval, - remaining_daily: remainingDaily, - remaining_tx: remainingTx, - reason: requiresApproval ? `APPROVAL_REQUIRED: Amount ${amount} ${currency} exceeds approval threshold of ${limits.approval_threshold} ${currency}` : void 0 - }; - } - /** - * Enforce budget check - throws if budget exceeded - * - * @param amount - Proposed transaction amount - * @param currency - Currency code - * @param chain - Blockchain - * @throws VaultError with BUDGET_EXCEEDED_TX or BUDGET_EXCEEDED_DAILY - */ - enforceBudget(amount, currency, chain) { - const result = this.checkBudget(amount, currency, chain); - if (!result.allowed) { - const errorCode = result.reason?.includes("BUDGET_EXCEEDED_TX") ? "BUDGET_EXCEEDED_TX" : "BUDGET_EXCEEDED_DAILY"; - throw new VaultError2(errorCode, result.reason || "Budget exceeded", { - amount, - currency, - chain, - remaining_daily: result.remaining_daily, - remaining_tx: result.remaining_tx - }); - } - return result; - } - // ========================================================================== - // Rate Limiting (from protocol spec B5: 5 executions/minute) - // ========================================================================== - /** - * Check if a session is rate limited - * - * @param sessionId - Agent session ID - * @returns true if rate limited, false if allowed - */ - isRateLimited(sessionId) { - const now = Date.now(); - const windowStart = now - RATE_LIMIT_WINDOW_MS; - let timestamps = this.rateLimitMap.get(sessionId) || []; - timestamps = timestamps.filter((t) => t > windowStart); - if (timestamps.length === 0) { - this.rateLimitMap.delete(sessionId); - } else { - this.rateLimitMap.set(sessionId, timestamps); - } - return timestamps.length >= this.config.rate_limit_per_minute; - } - /** - * Record an execution for rate limiting - * - * @param sessionId - Agent session ID - * @throws VaultError with RATE_LIMITED if limit exceeded - */ - recordExecution(sessionId) { - const now = Date.now(); - const windowStart = now - RATE_LIMIT_WINDOW_MS; - let timestamps = this.rateLimitMap.get(sessionId) || []; - timestamps = timestamps.filter((t) => t > windowStart); - if (timestamps.length >= this.config.rate_limit_per_minute) { - throw new VaultError2("RATE_LIMITED", "Rate limit exceeded. Maximum 5 executions per minute.", { - limit: this.config.rate_limit_per_minute, - window_seconds: 60, - retry_after_ms: timestamps[0] + RATE_LIMIT_WINDOW_MS - now - }); - } - timestamps.push(now); - this.rateLimitMap.set(sessionId, timestamps); - } - /** - * Get remaining executions in current window - * - * @param sessionId - Agent session ID - * @returns Number of remaining executions allowed - */ - getRemainingExecutions(sessionId) { - const now = Date.now(); - const windowStart = now - RATE_LIMIT_WINDOW_MS; - let timestamps = this.rateLimitMap.get(sessionId) || []; - timestamps = timestamps.filter((t) => t > windowStart); - if (timestamps.length === 0) { - this.rateLimitMap.delete(sessionId); - } else { - this.rateLimitMap.set(sessionId, timestamps); - } - const recentCount = timestamps.length; - return Math.max(0, this.config.rate_limit_per_minute - recentCount); - } - /** - * Clear rate limit data for a session (e.g., on session end) - */ - clearRateLimit(sessionId) { - this.rateLimitMap.delete(sessionId); - } - // ========================================================================== - // Currency Mapping - // ========================================================================== - /** - * Get the native currency code for a chain - */ - static getCurrencyForChain(chain) { - const currencyMap = { - solana: "SOL" - }; - return currencyMap[chain]; - } - /** - * Get supported currencies - */ - getSupportedCurrencies() { - return [ - ...Object.keys(this.config.daily_budget), - ...Object.keys(this.config.tx_limit), - ...Object.keys(this.config.approval_threshold) - ].filter((v, i, a) => a.indexOf(v) === i); - } - // ========================================================================== - // Custom Currency Management - // ========================================================================== - /** - * Get default currencies (cannot be removed) - */ - getDefaultCurrencies() { - return [...DEFAULT_CURRENCIES]; - } - /** - * Get custom currencies added by user - */ - getCustomCurrencies() { - return this.config.custom_currencies ? [...this.config.custom_currencies] : []; - } - /** - * Get all currencies (default + custom) - */ - getAllCurrencies() { - return { - default: this.getDefaultCurrencies(), - custom: this.getCustomCurrencies() - }; - } - /** - * Add a custom currency - * @param code - Currency code (e.g., 'BONK', 'WIF') - * @throws VaultError if code is invalid or already exists - */ - addCustomCurrency(code) { - const normalized = code.toUpperCase().trim(); - if (!/^[A-Z0-9]{2,10}$/.test(normalized)) { - throw new VaultError2("VALIDATION_ERROR", "Currency code must be 2-10 uppercase alphanumeric characters"); - } - if (DEFAULT_CURRENCIES.includes(normalized)) { - throw new VaultError2("VALIDATION_ERROR", `${normalized} is a default currency`); - } - const customCurrencies = this.config.custom_currencies || []; - if (customCurrencies.includes(normalized)) { - throw new VaultError2("VALIDATION_ERROR", `${normalized} already exists`); - } - this.config.custom_currencies = [...customCurrencies, normalized]; - this.config.daily_budget[normalized] = 0; - this.config.tx_limit[normalized] = 0; - this.config.approval_threshold[normalized] = 0; - this.saveConfig(); - this.storage.logAudit("CONFIG", "success", { - operation: "add_currency", - details: JSON.stringify({ currency: normalized }) - }); - } - /** - * Remove a custom currency - * @param code - Currency code to remove - * @throws VaultError if code is a default currency or doesn't exist - */ - removeCustomCurrency(code) { - const normalized = code.toUpperCase().trim(); - if (DEFAULT_CURRENCIES.includes(normalized)) { - throw new VaultError2("VALIDATION_ERROR", `Cannot remove default currency ${normalized}`); - } - const customCurrencies = this.config.custom_currencies || []; - const index = customCurrencies.indexOf(normalized); - if (index === -1) { - throw new VaultError2("VALIDATION_ERROR", `Currency ${normalized} not found`); - } - this.config.custom_currencies = customCurrencies.filter((c) => c !== normalized); - delete this.config.daily_budget[normalized]; - delete this.config.tx_limit[normalized]; - delete this.config.approval_threshold[normalized]; - this.saveConfig(); - this.storage.logAudit("CONFIG", "success", { - operation: "remove_currency", - details: JSON.stringify({ currency: normalized }) - }); - } - }; - var defaultBudgetEngine = null; - function getBudgetEngine2(storage2, vaultDir) { - if (!defaultBudgetEngine) { - defaultBudgetEngine = new BudgetEngine(storage2, vaultDir); - } - return defaultBudgetEngine; - } - function resetBudgetEngine() { - defaultBudgetEngine = null; - } - var KNOWN_SERVICES = { - "1ly": { - service_id: "1ly", - name: "1ly.store", - connect_url: "https://1ly.store/api/dcp/connect", - auth_url: "https://1ly.store/auth/dcp", - public_key: "ed25519:7Kf9xPQzTm8wKvYR5gH3nJ4bL6cM2dF1qE8sW0tU9vA", - default_scopes: [ - "sign:solana", - "read:credentials.api.1ly", - "write:credentials.api.1ly" - ], - verified: true, - description: "API marketplace with autonomous agent payments", - icon_url: "https://1ly.store/favicon.ico" - }, - virtuals: { - service_id: "virtuals", - name: "Virtuals Protocol", - connect_url: "https://virtuals.io/api/dcp/connect", - auth_url: "https://virtuals.io/auth/dcp", - public_key: "ed25519:placeholder_virtuals_key", - default_scopes: ["sign:solana", "read:credentials.api.virtuals"], - verified: true, - description: "AI agent ecosystem" - }, - eliza: { - service_id: "eliza", - name: "Eliza Framework", - connect_url: "https://eliza.ai/api/dcp/connect", - auth_url: "https://eliza.ai/auth/dcp", - public_key: "ed25519:placeholder_eliza_key", - default_scopes: ["sign:solana", "read:credentials.api.eliza"], - verified: true, - description: "Open-source AI agent framework" - } - }; - function getKnownService(serviceId) { - return KNOWN_SERVICES[serviceId.toLowerCase()]; - } - function listKnownServices2() { - return Object.values(KNOWN_SERVICES); - } - function isKnownService(serviceId) { - return serviceId.toLowerCase() in KNOWN_SERVICES; - } - function parsePublicKey(key) { - if (key.startsWith("ed25519:")) { - return { - algorithm: "ed25519", - keyData: key.slice(8) - }; - } - return { - algorithm: "ed25519", - keyData: key - }; - } - function isValidPublicKey2(key) { - try { - const { keyData } = parsePublicKey(key); - const buffer = Buffer.from(keyData, "base64"); - return buffer.length === 32; - } catch { - return false; - } - } - var DEFAULT_RELAY_URL2 = "wss://relay.dcp.1ly.store"; - var RELAY_URLS = { - primary: "wss://relay.dcp.1ly.store", - fallback: "wss://relay.dcprotocol.org" - }; - var import_crypto42 = require("crypto"); - var PAIRING_GRANT_PREFIX = "dcp_pair_v1_"; - var SESSION_TOKEN_PREFIX = "dcp_session_v1_"; - var DEFAULT_PAIRING_TTL_MS = 60 * 60 * 1e3; - var DEFAULT_SESSION_TOKEN_TTL_MS = 24 * 60 * 60 * 1e3; - function createSignedPairingGrant2(input, signingPrivateKey) { - const now = /* @__PURE__ */ new Date(); - const ttl = input.ttl_ms ?? DEFAULT_PAIRING_TTL_MS; - const expiresAt = new Date(now.getTime() + ttl); - const payload = { - version: 1, - grant_id: `grant_${(0, import_crypto42.randomUUID)().replace(/-/g, "").slice(0, 12)}`, - vault_id: input.vault_id, - agent_id: input.agent_id, - agent_name: input.agent_name, - mode: input.mode, - vault_hpke_public_key: input.vault_hpke_public_key, - vault_signing_public_key: input.vault_signing_public_key, - relay_url: input.relay_url, - created_at: now.toISOString(), - expires_at: expiresAt.toISOString() - // NOTE: permission_scopes, budget, and tier are intentionally NOT included - // These are stored ONLY in the vault policy database - }; - const canonicalPayload = canonicalJson2(payload); - const signature2 = signMessage(Buffer.from(canonicalPayload, "utf8"), signingPrivateKey); - const encoded = { - payload, - signature: signature2.toString("base64") - }; - const jsonStr = JSON.stringify(encoded); - const base64url = Buffer.from(jsonStr, "utf8").toString("base64url"); - return PAIRING_GRANT_PREFIX + base64url; - } - function decodePairingGrant2(token) { - if (!token.startsWith(PAIRING_GRANT_PREFIX)) { - return null; - } - try { - const base64url = token.slice(PAIRING_GRANT_PREFIX.length); - const jsonStr = Buffer.from(base64url, "base64url").toString("utf8"); - const decoded = JSON.parse(jsonStr); - if (!decoded.payload || !decoded.signature) { - return null; - } - if (decoded.payload.version !== 1) { - return null; - } - return decoded; - } catch { - return null; - } - } - function verifyPairingGrant(token) { - const decoded = decodePairingGrant2(token); - if (!decoded) { - return null; - } - try { - const publicKey2 = Buffer.from(decoded.payload.vault_signing_public_key, "base64"); - const signature2 = Buffer.from(decoded.signature, "base64"); - const canonicalPayload = canonicalJson2(decoded.payload); - const message = Buffer.from(canonicalPayload, "utf8"); - if (!verifySignature(message, signature2, publicKey2)) { - return null; - } - const expiresAt = new Date(decoded.payload.expires_at); - if (expiresAt < /* @__PURE__ */ new Date()) { - return null; - } - return decoded.payload; - } catch { - return null; - } - } - function verifyPairingGrantWithKey2(token, vaultSigningPublicKey) { - const decoded = decodePairingGrant2(token); - if (!decoded) { - return null; - } - try { - const signature2 = Buffer.from(decoded.signature, "base64"); - const canonicalPayload = canonicalJson2(decoded.payload); - const message = Buffer.from(canonicalPayload, "utf8"); - if (!verifySignature(message, signature2, vaultSigningPublicKey)) { - return null; - } - const expiresAt = new Date(decoded.payload.expires_at); - if (expiresAt < /* @__PURE__ */ new Date()) { - return null; - } - return decoded.payload; - } catch { - return null; - } - } - function isPairingGrant(token) { - return token.startsWith(PAIRING_GRANT_PREFIX); - } - var VPS_INVITE_PREFIX = "dcp_vps_v1_"; - function createVpsPairingInvite2(vaultId, relayUrl, vaultPublicKey, vaultSigningKey, ttlMs = DEFAULT_PAIRING_TTL_MS) { - const invite = { - version: 1, - invite_id: `inv_${(0, import_crypto42.randomUUID)().replace(/-/g, "").slice(0, 16)}`, - vault_id: vaultId, - relay_url: relayUrl, - vault_public_key: vaultPublicKey, - vault_signing_key: vaultSigningKey, - expires_at: Date.now() + ttlMs - }; - const json = JSON.stringify(invite); - const base64url = Buffer.from(json, "utf8").toString("base64url"); - return VPS_INVITE_PREFIX + base64url; - } - function parseVpsPairingInvite2(invite) { - if (!invite.startsWith(VPS_INVITE_PREFIX)) { - return null; - } - try { - const base64url = invite.slice(VPS_INVITE_PREFIX.length); - const json = Buffer.from(base64url, "base64url").toString("utf8"); - const data = JSON.parse(json); - if (data.version !== 1 || !data.invite_id || !data.vault_id || !data.relay_url || !data.vault_public_key || !data.vault_signing_key || !data.expires_at) { - return null; - } - return data; - } catch { - return null; - } - } - function isVpsInviteExpired(invite) { - return Date.now() > invite.expires_at; - } - function isVpsPairingInvite(token) { - return token.startsWith(VPS_INVITE_PREFIX); - } - function createSessionToken(input, signingPrivateKey) { - const now = /* @__PURE__ */ new Date(); - const ttl = input.ttl_ms ?? DEFAULT_SESSION_TOKEN_TTL_MS; - const expiresAt = new Date(now.getTime() + ttl); - const payload = { - version: 1, - token_id: `token_${(0, import_crypto42.randomUUID)().replace(/-/g, "").slice(0, 12)}`, - vault_id: input.vault_id, - agent_id: input.agent_id, - agent_name: input.agent_name, - tier: input.tier, - scopes: input.scopes, - issued_at: now.toISOString(), - expires_at: expiresAt.toISOString() - }; - const canonicalPayload = canonicalJson2(payload); - const signature2 = signMessage(Buffer.from(canonicalPayload, "utf8"), signingPrivateKey); - const encoded = { - payload, - signature: signature2.toString("base64") - }; - const jsonStr = JSON.stringify(encoded); - const base64url = Buffer.from(jsonStr, "utf8").toString("base64url"); - return SESSION_TOKEN_PREFIX + base64url; - } - function decodeSessionToken(token) { - if (!token.startsWith(SESSION_TOKEN_PREFIX)) { - return null; - } - try { - const base64url = token.slice(SESSION_TOKEN_PREFIX.length); - const jsonStr = Buffer.from(base64url, "base64url").toString("utf8"); - const decoded = JSON.parse(jsonStr); - if (!decoded.payload || !decoded.signature) { - return null; - } - if (decoded.payload.version !== 1) { - return null; - } - return decoded; - } catch { - return null; - } - } - function verifySessionToken(token, vaultSigningPublicKey) { - const decoded = decodeSessionToken(token); - if (!decoded) { - return null; - } - try { - const signature2 = Buffer.from(decoded.signature, "base64"); - const canonicalPayload = canonicalJson2(decoded.payload); - const message = Buffer.from(canonicalPayload, "utf8"); - if (!verifySignature(message, signature2, vaultSigningPublicKey)) { - return null; - } - const expiresAt = new Date(decoded.payload.expires_at); - if (expiresAt < /* @__PURE__ */ new Date()) { - return null; - } - return decoded.payload; - } catch { - return null; - } - } - function isSessionToken(token) { - return token.startsWith(SESSION_TOKEN_PREFIX); - } - } -}); - -// ../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/index.js -var require_ws = __commonJS({ - "../../node_modules/.pnpm/ws@8.20.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/ws/index.js"(exports2, module2) { - "use strict"; - var createWebSocketStream2 = require_stream(); - var extension2 = require_extension(); - var PerMessageDeflate2 = require_permessage_deflate(); - var Receiver2 = require_receiver(); - var Sender2 = require_sender(); - var subprotocol2 = require_subprotocol(); - var WebSocket3 = require_websocket(); - var WebSocketServer2 = require_websocket_server(); - WebSocket3.createWebSocketStream = createWebSocketStream2; - WebSocket3.extension = extension2; - WebSocket3.PerMessageDeflate = PerMessageDeflate2; - WebSocket3.Receiver = Receiver2; - WebSocket3.Sender = Sender2; - WebSocket3.Server = WebSocketServer2; - WebSocket3.subprotocol = subprotocol2; - WebSocket3.WebSocket = WebSocket3; - WebSocket3.WebSocketServer = WebSocketServer2; - module2.exports = WebSocket3; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream.js -var require_stream2 = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) { - module2.exports = require("stream"); - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js -var require_buffer_list = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module2) { - "use strict"; - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && (symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 ? ownKeys(Object(source), true).forEach(function(key) { - _defineProperty(target, key, source[key]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - return target; - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; - } - return obj; - } - function _classCallCheck(instance2, Constructor) { - if (!(instance2 instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - Object.defineProperty(Constructor, "prototype", { writable: false }); - return Constructor; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - return typeof key === "symbol" ? key : String(key); - } - function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - var _require = require("buffer"); - var Buffer3 = _require.Buffer; - var _require2 = require("util"); - var inspect = _require2.inspect; - var custom = inspect && inspect.custom || "inspect"; - function copyBuffer(src, target, offset2) { - Buffer3.prototype.copy.call(src, target, offset2); - } - module2.exports = /* @__PURE__ */ function() { - function BufferList() { - _classCallCheck(this, BufferList); - this.head = null; - this.tail = null; - this.length = 0; - } - _createClass(BufferList, [{ - key: "push", - value: function push(v) { - var entry = { - data: v, - next: null - }; - if (this.length > 0) - this.tail.next = entry; - else - this.head = entry; - this.tail = entry; - ++this.length; - } - }, { - key: "unshift", - value: function unshift(v) { - var entry = { - data: v, - next: this.head - }; - if (this.length === 0) - this.tail = entry; - this.head = entry; - ++this.length; - } - }, { - key: "shift", - value: function shift() { - if (this.length === 0) - return; - var ret = this.head.data; - if (this.length === 1) - this.head = this.tail = null; - else - this.head = this.head.next; - --this.length; - return ret; - } - }, { - key: "clear", - value: function clear() { - this.head = this.tail = null; - this.length = 0; - } - }, { - key: "join", - value: function join2(s) { - if (this.length === 0) - return ""; - var p = this.head; - var ret = "" + p.data; - while (p = p.next) - ret += s + p.data; - return ret; - } - }, { - key: "concat", - value: function concat(n) { - if (this.length === 0) - return Buffer3.alloc(0); - var ret = Buffer3.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - } - // Consumes a specified amount of bytes or characters from the buffered data. - }, { - key: "consume", - value: function consume(n, hasStrings) { - var ret; - if (n < this.head.data.length) { - ret = this.head.data.slice(0, n); - this.head.data = this.head.data.slice(n); - } else if (n === this.head.data.length) { - ret = this.shift(); - } else { - ret = hasStrings ? this._getString(n) : this._getBuffer(n); - } - return ret; - } - }, { - key: "first", - value: function first() { - return this.head.data; - } - // Consumes a specified amount of characters from the buffered data. - }, { - key: "_getString", - value: function _getString(n) { - var p = this.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) - ret += str; - else - ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) - this.head = p.next; - else - this.head = this.tail = null; - } else { - this.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - // Consumes a specified amount of bytes from the buffered data. - }, { - key: "_getBuffer", - value: function _getBuffer(n) { - var ret = Buffer3.allocUnsafe(n); - var p = this.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) - this.head = p.next; - else - this.head = this.tail = null; - } else { - this.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - this.length -= c; - return ret; - } - // Make sure the linked list only shows the minimal necessary information. - }, { - key: custom, - value: function value(_, options) { - return inspect(this, _objectSpread(_objectSpread({}, options), {}, { - // Only inspect one level. - depth: 0, - // It should not recurse. - customInspect: false - })); - } - }]); - return BufferList; - }(); - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js -var require_destroy = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) { - "use strict"; - function destroy(err, cb) { - var _this = this; - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err) { - if (!this._writableState) { - process.nextTick(emitErrorNT, this, err); - } else if (!this._writableState.errorEmitted) { - this._writableState.errorEmitted = true; - process.nextTick(emitErrorNT, this, err); - } - } - return this; - } - if (this._readableState) { - this._readableState.destroyed = true; - } - if (this._writableState) { - this._writableState.destroyed = true; - } - this._destroy(err || null, function(err2) { - if (!cb && err2) { - if (!_this._writableState) { - process.nextTick(emitErrorAndCloseNT, _this, err2); - } else if (!_this._writableState.errorEmitted) { - _this._writableState.errorEmitted = true; - process.nextTick(emitErrorAndCloseNT, _this, err2); - } else { - process.nextTick(emitCloseNT, _this); - } - } else if (cb) { - process.nextTick(emitCloseNT, _this); - cb(err2); - } else { - process.nextTick(emitCloseNT, _this); - } - }); - return this; - } - function emitErrorAndCloseNT(self2, err) { - emitErrorNT(self2, err); - emitCloseNT(self2); - } - function emitCloseNT(self2) { - if (self2._writableState && !self2._writableState.emitClose) - return; - if (self2._readableState && !self2._readableState.emitClose) - return; - self2.emit("close"); - } - function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finalCalled = false; - this._writableState.prefinished = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } - } - function emitErrorNT(self2, err) { - self2.emit("error", err); - } - function errorOrDestroy(stream, err) { - var rState = stream._readableState; - var wState = stream._writableState; - if (rState && rState.autoDestroy || wState && wState.autoDestroy) - stream.destroy(err); - else - stream.emit("error", err); - } - module2.exports = { - destroy, - undestroy, - errorOrDestroy - }; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors.js -var require_errors5 = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors.js"(exports2, module2) { - "use strict"; - var codes = {}; - function createErrorType(code, message, Base) { - if (!Base) { - Base = Error; - } - function getMessage(arg1, arg2, arg3) { - if (typeof message === "string") { - return message; - } else { - return message(arg1, arg2, arg3); - } - } - class NodeError extends Base { - constructor(arg1, arg2, arg3) { - super(getMessage(arg1, arg2, arg3)); - } - } - NodeError.prototype.name = Base.name; - NodeError.prototype.code = code; - codes[code] = NodeError; - } - function oneOf(expected, thing) { - if (Array.isArray(expected)) { - const len = expected.length; - expected = expected.map((i) => String(i)); - if (len > 2) { - return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; - } else if (len === 2) { - return `one of ${thing} ${expected[0]} or ${expected[1]}`; - } else { - return `of ${thing} ${expected[0]}`; - } - } else { - return `of ${thing} ${String(expected)}`; - } - } - function startsWith(str, search, pos) { - return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; - } - function endsWith(str, search, this_len) { - if (this_len === void 0 || this_len > str.length) { - this_len = str.length; - } - return str.substring(this_len - search.length, this_len) === search; - } - function includes(str, search, start) { - if (typeof start !== "number") { - start = 0; - } - if (start + search.length > str.length) { - return false; - } else { - return str.indexOf(search, start) !== -1; - } - } - createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { - return 'The value "' + value + '" is invalid for option "' + name + '"'; - }, TypeError); - createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { - let determiner; - if (typeof expected === "string" && startsWith(expected, "not ")) { - determiner = "must not be"; - expected = expected.replace(/^not /, ""); - } else { - determiner = "must be"; - } - let msg; - if (endsWith(name, " argument")) { - msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; - } else { - const type2 = includes(name, ".") ? "property" : "argument"; - msg = `The "${name}" ${type2} ${determiner} ${oneOf(expected, "type")}`; - } - msg += `. Received type ${typeof actual}`; - return msg; - }, TypeError); - createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); - createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { - return "The " + name + " method is not implemented"; - }); - createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); - createErrorType("ERR_STREAM_DESTROYED", function(name) { - return "Cannot call " + name + " after a stream was destroyed"; - }); - createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); - createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); - createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); - createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); - createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { - return "Unknown encoding: " + arg; - }, TypeError); - createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); - module2.exports.codes = codes; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js -var require_state = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js"(exports2, module2) { - "use strict"; - var ERR_INVALID_OPT_VALUE = require_errors5().codes.ERR_INVALID_OPT_VALUE; - function highWaterMarkFrom(options, isDuplex, duplexKey) { - return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; - } - function getHighWaterMark(state, options, duplexKey, isDuplex) { - var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); - if (hwm != null) { - if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { - var name = isDuplex ? duplexKey : "highWaterMark"; - throw new ERR_INVALID_OPT_VALUE(name, hwm); - } - return Math.floor(hwm); - } - return state.objectMode ? 16 : 16 * 1024; - } - module2.exports = { - getHighWaterMark - }; - } -}); - -// ../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js -var require_inherits_browser = __commonJS({ - "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports2, module2) { - if (typeof Object.create === "function") { - module2.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; - } else { - module2.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - }; - } - } -}); - -// ../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js -var require_inherits = __commonJS({ - "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports2, module2) { - try { - util = require("util"); - if (typeof util.inherits !== "function") - throw ""; - module2.exports = util.inherits; - } catch (e) { - module2.exports = require_inherits_browser(); - } - var util; - } -}); - -// ../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js -var require_node2 = __commonJS({ - "../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js"(exports2, module2) { - module2.exports = require("util").deprecate; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js -var require_stream_writable = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) { - "use strict"; - module2.exports = Writable; - function CorkedRequest(state) { - var _this = this; - this.next = null; - this.entry = null; - this.finish = function() { - onCorkedFinish(_this, state); - }; - } - var Duplex; - Writable.WritableState = WritableState; - var internalUtil = { - deprecate: require_node2() - }; - var Stream2 = require_stream2(); - var Buffer3 = require("buffer").Buffer; - var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer3.from(chunk); - } - function _isUint8Array(obj) { - return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array; - } - var destroyImpl = require_destroy(); - var _require = require_state(); - var getHighWaterMark = _require.getHighWaterMark; - var _require$codes = require_errors5().codes; - var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; - var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; - var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; - var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; - var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; - var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END; - var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; - var errorOrDestroy = destroyImpl.errorOrDestroy; - require_inherits()(Writable, Stream2); - function nop() { - } - function WritableState(options, stream, isDuplex) { - Duplex = Duplex || require_stream_duplex(); - options = options || {}; - if (typeof isDuplex !== "boolean") - isDuplex = stream instanceof Duplex; - this.objectMode = !!options.objectMode; - if (isDuplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); - this.finalCalled = false; - this.needDrain = false; - this.ending = false; - this.ended = false; - this.finished = false; - this.destroyed = false; - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - this.defaultEncoding = options.defaultEncoding || "utf8"; - this.length = 0; - this.writing = false; - this.corked = 0; - this.sync = true; - this.bufferProcessing = false; - this.onwrite = function(er) { - onwrite(stream, er); - }; - this.writecb = null; - this.writelen = 0; - this.bufferedRequest = null; - this.lastBufferedRequest = null; - this.pendingcb = 0; - this.prefinished = false; - this.errorEmitted = false; - this.emitClose = options.emitClose !== false; - this.autoDestroy = !!options.autoDestroy; - this.bufferedRequestCount = 0; - this.corkedRequestsFree = new CorkedRequest(this); - } - WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; - }; - (function() { - try { - Object.defineProperty(WritableState.prototype, "buffer", { - get: internalUtil.deprecate(function writableStateBufferGetter() { - return this.getBuffer(); - }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") - }); - } catch (_) { - } - })(); - var realHasInstance; - if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function value(object) { - if (realHasInstance.call(this, object)) - return true; - if (this !== Writable) - return false; - return object && object._writableState instanceof WritableState; - } - }); - } else { - realHasInstance = function realHasInstance2(object) { - return object instanceof this; - }; - } - function Writable(options) { - Duplex = Duplex || require_stream_duplex(); - var isDuplex = this instanceof Duplex; - if (!isDuplex && !realHasInstance.call(Writable, this)) - return new Writable(options); - this._writableState = new WritableState(options, this, isDuplex); - this.writable = true; - if (options) { - if (typeof options.write === "function") - this._write = options.write; - if (typeof options.writev === "function") - this._writev = options.writev; - if (typeof options.destroy === "function") - this._destroy = options.destroy; - if (typeof options.final === "function") - this._final = options.final; - } - Stream2.call(this); - } - Writable.prototype.pipe = function() { - errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); - }; - function writeAfterEnd(stream, cb) { - var er = new ERR_STREAM_WRITE_AFTER_END(); - errorOrDestroy(stream, er); - process.nextTick(cb, er); - } - function validChunk(stream, state, chunk, cb) { - var er; - if (chunk === null) { - er = new ERR_STREAM_NULL_VALUES(); - } else if (typeof chunk !== "string" && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); - } - if (er) { - errorOrDestroy(stream, er); - process.nextTick(cb, er); - return false; - } - return true; - } - Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - if (isBuf && !Buffer3.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - if (isBuf) - encoding = "buffer"; - else if (!encoding) - encoding = state.defaultEncoding; - if (typeof cb !== "function") - cb = nop; - if (state.ending) - writeAfterEnd(this, cb); - else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - return ret; - }; - Writable.prototype.cork = function() { - this._writableState.corked++; - }; - Writable.prototype.uncork = function() { - var state = this._writableState; - if (state.corked) { - state.corked--; - if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) - clearBuffer(this, state); - } - }; - Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - if (typeof encoding === "string") - encoding = encoding.toLowerCase(); - if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) - throw new ERR_UNKNOWN_ENCODING(encoding); - this._writableState.defaultEncoding = encoding; - return this; - }; - Object.defineProperty(Writable.prototype, "writableBuffer", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } - }); - function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { - chunk = Buffer3.from(chunk, encoding); - } - return chunk; - } - Object.defineProperty(Writable.prototype, "writableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } - }); - function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = "buffer"; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - state.length += len; - var ret = state.length < state.highWaterMark; - if (!ret) - state.needDrain = true; - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk, - encoding, - isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - return ret; - } - function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (state.destroyed) - state.onwrite(new ERR_STREAM_DESTROYED("write")); - else if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; - } - function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) { - process.nextTick(cb, er); - process.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - } else { - cb(er); - stream._writableState.errorEmitted = true; - errorOrDestroy(stream, er); - finishMaybe(stream, state); - } - } - function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; - } - function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - if (typeof cb !== "function") - throw new ERR_MULTIPLE_CALLBACK(); - onwriteStateUpdate(state); - if (er) - onwriteError(stream, state, sync, er, cb); - else { - var finished = needFinish(state) || stream.destroyed; - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - if (sync) { - process.nextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } - } - function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); - } - function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit("drain"); - } - } - function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - if (stream._writev && entry && entry.next) { - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) - allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - doWrite(stream, state, true, state.length, buffer, "", holder.finish); - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - if (state.writing) { - break; - } - } - if (entry === null) - state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; - } - Writable.prototype._write = function(chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); - }; - Writable.prototype._writev = null; - Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - if (typeof chunk === "function") { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === "function") { - cb = encoding; - encoding = null; - } - if (chunk !== null && chunk !== void 0) - this.write(chunk, encoding); - if (state.corked) { - state.corked = 1; - this.uncork(); - } - if (!state.ending) - endWritable(this, state, cb); - return this; - }; - Object.defineProperty(Writable.prototype, "writableLength", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } - }); - function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; - } - function callFinal(stream, state) { - stream._final(function(err) { - state.pendingcb--; - if (err) { - errorOrDestroy(stream, err); - } - state.prefinished = true; - stream.emit("prefinish"); - finishMaybe(stream, state); - }); - } - function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === "function" && !state.destroyed) { - state.pendingcb++; - state.finalCalled = true; - process.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit("prefinish"); - } - } - } - function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit("finish"); - if (state.autoDestroy) { - var rState = stream._readableState; - if (!rState || rState.autoDestroy && rState.endEmitted) { - stream.destroy(); - } - } - } - } - return need; - } - function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - process.nextTick(cb); - else - stream.once("finish", cb); - } - state.ended = true; - stream.writable = false; - } - function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - state.corkedRequestsFree.next = corkReq; - } - Object.defineProperty(Writable.prototype, "destroyed", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._writableState === void 0) { - return false; - } - return this._writableState.destroyed; - }, - set: function set(value) { - if (!this._writableState) { - return; - } - this._writableState.destroyed = value; - } - }); - Writable.prototype.destroy = destroyImpl.destroy; - Writable.prototype._undestroy = destroyImpl.undestroy; - Writable.prototype._destroy = function(err, cb) { - cb(err); - }; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js -var require_stream_duplex = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) { - "use strict"; - var objectKeys = Object.keys || function(obj) { - var keys2 = []; - for (var key in obj) - keys2.push(key); - return keys2; - }; - module2.exports = Duplex; - var Readable2 = require_stream_readable(); - var Writable = require_stream_writable(); - require_inherits()(Duplex, Readable2); - { - keys = objectKeys(Writable.prototype); - for (v = 0; v < keys.length; v++) { - method = keys[v]; - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; - } - } - var keys; - var method; - var v; - function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - Readable2.call(this, options); - Writable.call(this, options); - this.allowHalfOpen = true; - if (options) { - if (options.readable === false) - this.readable = false; - if (options.writable === false) - this.writable = false; - if (options.allowHalfOpen === false) { - this.allowHalfOpen = false; - this.once("end", onend); - } - } - } - Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.highWaterMark; - } - }); - Object.defineProperty(Duplex.prototype, "writableBuffer", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState && this._writableState.getBuffer(); - } - }); - Object.defineProperty(Duplex.prototype, "writableLength", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._writableState.length; - } - }); - function onend() { - if (this._writableState.ended) - return; - process.nextTick(onEndNT, this); - } - function onEndNT(self2) { - self2.end(); - } - Object.defineProperty(Duplex.prototype, "destroyed", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === void 0 || this._writableState === void 0) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function set(value) { - if (this._readableState === void 0 || this._writableState === void 0) { - return; - } - this._readableState.destroyed = value; - this._writableState.destroyed = value; - } - }); - } -}); - -// ../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js -var require_string_decoder = __commonJS({ - "../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js"(exports2) { - "use strict"; - var Buffer3 = require_safe_buffer().Buffer; - var isEncoding = Buffer3.isEncoding || function(encoding) { - encoding = "" + encoding; - switch (encoding && encoding.toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - case "raw": - return true; - default: - return false; - } - }; - function _normalizeEncoding(enc) { - if (!enc) - return "utf8"; - var retried; - while (true) { - switch (enc) { - case "utf8": - case "utf-8": - return "utf8"; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return "utf16le"; - case "latin1": - case "binary": - return "latin1"; - case "base64": - case "ascii": - case "hex": - return enc; - default: - if (retried) - return; - enc = ("" + enc).toLowerCase(); - retried = true; - } - } - } - function normalizeEncoding(enc) { - var nenc = _normalizeEncoding(enc); - if (typeof nenc !== "string" && (Buffer3.isEncoding === isEncoding || !isEncoding(enc))) - throw new Error("Unknown encoding: " + enc); - return nenc || enc; - } - exports2.StringDecoder = StringDecoder; - function StringDecoder(encoding) { - this.encoding = normalizeEncoding(encoding); - var nb; - switch (this.encoding) { - case "utf16le": - this.text = utf16Text; - this.end = utf16End; - nb = 4; - break; - case "utf8": - this.fillLast = utf8FillLast; - nb = 4; - break; - case "base64": - this.text = base64Text; - this.end = base64End; - nb = 3; - break; - default: - this.write = simpleWrite; - this.end = simpleEnd; - return; - } - this.lastNeed = 0; - this.lastTotal = 0; - this.lastChar = Buffer3.allocUnsafe(nb); - } - StringDecoder.prototype.write = function(buf) { - if (buf.length === 0) - return ""; - var r; - var i; - if (this.lastNeed) { - r = this.fillLast(buf); - if (r === void 0) - return ""; - i = this.lastNeed; - this.lastNeed = 0; - } else { - i = 0; - } - if (i < buf.length) - return r ? r + this.text(buf, i) : this.text(buf, i); - return r || ""; - }; - StringDecoder.prototype.end = utf8End; - StringDecoder.prototype.text = utf8Text; - StringDecoder.prototype.fillLast = function(buf) { - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); - this.lastNeed -= buf.length; - }; - function utf8CheckByte(byte) { - if (byte <= 127) - return 0; - else if (byte >> 5 === 6) - return 2; - else if (byte >> 4 === 14) - return 3; - else if (byte >> 3 === 30) - return 4; - return byte >> 6 === 2 ? -1 : -2; - } - function utf8CheckIncomplete(self2, buf, i) { - var j = buf.length - 1; - if (j < i) - return 0; - var nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) - self2.lastNeed = nb - 1; - return nb; - } - if (--j < i || nb === -2) - return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) - self2.lastNeed = nb - 2; - return nb; - } - if (--j < i || nb === -2) - return 0; - nb = utf8CheckByte(buf[j]); - if (nb >= 0) { - if (nb > 0) { - if (nb === 2) - nb = 0; - else - self2.lastNeed = nb - 3; - } - return nb; - } - return 0; - } - function utf8CheckExtraBytes(self2, buf, p) { - if ((buf[0] & 192) !== 128) { - self2.lastNeed = 0; - return "\uFFFD"; - } - if (self2.lastNeed > 1 && buf.length > 1) { - if ((buf[1] & 192) !== 128) { - self2.lastNeed = 1; - return "\uFFFD"; - } - if (self2.lastNeed > 2 && buf.length > 2) { - if ((buf[2] & 192) !== 128) { - self2.lastNeed = 2; - return "\uFFFD"; - } - } - } - } - function utf8FillLast(buf) { - var p = this.lastTotal - this.lastNeed; - var r = utf8CheckExtraBytes(this, buf, p); - if (r !== void 0) - return r; - if (this.lastNeed <= buf.length) { - buf.copy(this.lastChar, p, 0, this.lastNeed); - return this.lastChar.toString(this.encoding, 0, this.lastTotal); - } - buf.copy(this.lastChar, p, 0, buf.length); - this.lastNeed -= buf.length; - } - function utf8Text(buf, i) { - var total = utf8CheckIncomplete(this, buf, i); - if (!this.lastNeed) - return buf.toString("utf8", i); - this.lastTotal = total; - var end = buf.length - (total - this.lastNeed); - buf.copy(this.lastChar, 0, end); - return buf.toString("utf8", i, end); - } - function utf8End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) - return r + "\uFFFD"; - return r; - } - function utf16Text(buf, i) { - if ((buf.length - i) % 2 === 0) { - var r = buf.toString("utf16le", i); - if (r) { - var c = r.charCodeAt(r.length - 1); - if (c >= 55296 && c <= 56319) { - this.lastNeed = 2; - this.lastTotal = 4; - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - return r.slice(0, -1); - } - } - return r; - } - this.lastNeed = 1; - this.lastTotal = 2; - this.lastChar[0] = buf[buf.length - 1]; - return buf.toString("utf16le", i, buf.length - 1); - } - function utf16End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) { - var end = this.lastTotal - this.lastNeed; - return r + this.lastChar.toString("utf16le", 0, end); - } - return r; - } - function base64Text(buf, i) { - var n = (buf.length - i) % 3; - if (n === 0) - return buf.toString("base64", i); - this.lastNeed = 3 - n; - this.lastTotal = 3; - if (n === 1) { - this.lastChar[0] = buf[buf.length - 1]; - } else { - this.lastChar[0] = buf[buf.length - 2]; - this.lastChar[1] = buf[buf.length - 1]; - } - return buf.toString("base64", i, buf.length - n); - } - function base64End(buf) { - var r = buf && buf.length ? this.write(buf) : ""; - if (this.lastNeed) - return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed); - return r; - } - function simpleWrite(buf) { - return buf.toString(this.encoding); - } - function simpleEnd(buf) { - return buf && buf.length ? this.write(buf) : ""; - } - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js -var require_end_of_stream = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) { - "use strict"; - var ERR_STREAM_PREMATURE_CLOSE = require_errors5().codes.ERR_STREAM_PREMATURE_CLOSE; - function once(callback) { - var called = false; - return function() { - if (called) - return; - called = true; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - callback.apply(this, args); - }; - } - function noop() { - } - function isRequest2(stream) { - return stream.setHeader && typeof stream.abort === "function"; - } - function eos(stream, opts, callback) { - if (typeof opts === "function") - return eos(stream, null, opts); - if (!opts) - opts = {}; - callback = once(callback || noop); - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var onlegacyfinish = function onlegacyfinish2() { - if (!stream.writable) - onfinish(); - }; - var writableEnded = stream._writableState && stream._writableState.finished; - var onfinish = function onfinish2() { - writable = false; - writableEnded = true; - if (!readable) - callback.call(stream); - }; - var readableEnded = stream._readableState && stream._readableState.endEmitted; - var onend = function onend2() { - readable = false; - readableEnded = true; - if (!writable) - callback.call(stream); - }; - var onerror = function onerror2(err) { - callback.call(stream, err); - }; - var onclose = function onclose2() { - var err; - if (readable && !readableEnded) { - if (!stream._readableState || !stream._readableState.ended) - err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - if (writable && !writableEnded) { - if (!stream._writableState || !stream._writableState.ended) - err = new ERR_STREAM_PREMATURE_CLOSE(); - return callback.call(stream, err); - } - }; - var onrequest = function onrequest2() { - stream.req.on("finish", onfinish); - }; - if (isRequest2(stream)) { - stream.on("complete", onfinish); - stream.on("abort", onclose); - if (stream.req) - onrequest(); - else - stream.on("request", onrequest); - } else if (writable && !stream._writableState) { - stream.on("end", onlegacyfinish); - stream.on("close", onlegacyfinish); - } - stream.on("end", onend); - stream.on("finish", onfinish); - if (opts.error !== false) - stream.on("error", onerror); - stream.on("close", onclose); - return function() { - stream.removeListener("complete", onfinish); - stream.removeListener("abort", onclose); - stream.removeListener("request", onrequest); - if (stream.req) - stream.req.removeListener("finish", onfinish); - stream.removeListener("end", onlegacyfinish); - stream.removeListener("close", onlegacyfinish); - stream.removeListener("finish", onfinish); - stream.removeListener("end", onend); - stream.removeListener("error", onerror); - stream.removeListener("close", onclose); - }; - } - module2.exports = eos; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js -var require_async_iterator = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports2, module2) { - "use strict"; - var _Object$setPrototypeO; - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - return typeof key === "symbol" ? key : String(key); - } - function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - var finished = require_end_of_stream(); - var kLastResolve = Symbol("lastResolve"); - var kLastReject = Symbol("lastReject"); - var kError = Symbol("error"); - var kEnded = Symbol("ended"); - var kLastPromise = Symbol("lastPromise"); - var kHandlePromise = Symbol("handlePromise"); - var kStream = Symbol("stream"); - function createIterResult(value, done) { - return { - value, - done - }; - } - function readAndResolve(iter) { - var resolve = iter[kLastResolve]; - if (resolve !== null) { - var data = iter[kStream].read(); - if (data !== null) { - iter[kLastPromise] = null; - iter[kLastResolve] = null; - iter[kLastReject] = null; - resolve(createIterResult(data, false)); - } - } - } - function onReadable(iter) { - process.nextTick(readAndResolve, iter); - } - function wrapForNext(lastPromise, iter) { - return function(resolve, reject) { - lastPromise.then(function() { - if (iter[kEnded]) { - resolve(createIterResult(void 0, true)); - return; - } - iter[kHandlePromise](resolve, reject); - }, reject); - }; - } - var AsyncIteratorPrototype = Object.getPrototypeOf(function() { - }); - var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { - get stream() { - return this[kStream]; - }, - next: function next() { - var _this = this; - var error = this[kError]; - if (error !== null) { - return Promise.reject(error); - } - if (this[kEnded]) { - return Promise.resolve(createIterResult(void 0, true)); - } - if (this[kStream].destroyed) { - return new Promise(function(resolve, reject) { - process.nextTick(function() { - if (_this[kError]) { - reject(_this[kError]); - } else { - resolve(createIterResult(void 0, true)); - } - }); - }); - } - var lastPromise = this[kLastPromise]; - var promise; - if (lastPromise) { - promise = new Promise(wrapForNext(lastPromise, this)); - } else { - var data = this[kStream].read(); - if (data !== null) { - return Promise.resolve(createIterResult(data, false)); - } - promise = new Promise(this[kHandlePromise]); - } - this[kLastPromise] = promise; - return promise; - } - }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { - return this; - }), _defineProperty(_Object$setPrototypeO, "return", function _return() { - var _this2 = this; - return new Promise(function(resolve, reject) { - _this2[kStream].destroy(null, function(err) { - if (err) { - reject(err); - return; - } - resolve(createIterResult(void 0, true)); - }); - }); - }), _Object$setPrototypeO), AsyncIteratorPrototype); - var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) { - var _Object$create; - var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { - value: stream, - writable: true - }), _defineProperty(_Object$create, kLastResolve, { - value: null, - writable: true - }), _defineProperty(_Object$create, kLastReject, { - value: null, - writable: true - }), _defineProperty(_Object$create, kError, { - value: null, - writable: true - }), _defineProperty(_Object$create, kEnded, { - value: stream._readableState.endEmitted, - writable: true - }), _defineProperty(_Object$create, kHandlePromise, { - value: function value(resolve, reject) { - var data = iterator[kStream].read(); - if (data) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(data, false)); - } else { - iterator[kLastResolve] = resolve; - iterator[kLastReject] = reject; - } - }, - writable: true - }), _Object$create)); - iterator[kLastPromise] = null; - finished(stream, function(err) { - if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { - var reject = iterator[kLastReject]; - if (reject !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - reject(err); - } - iterator[kError] = err; - return; - } - var resolve = iterator[kLastResolve]; - if (resolve !== null) { - iterator[kLastPromise] = null; - iterator[kLastResolve] = null; - iterator[kLastReject] = null; - resolve(createIterResult(void 0, true)); - } - iterator[kEnded] = true; - }); - stream.on("readable", onReadable.bind(null, iterator)); - return iterator; - }; - module2.exports = createReadableStreamAsyncIterator; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js -var require_from = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) { - "use strict"; - function asyncGeneratorStep(gen2, resolve, reject, _next, _throw, key, arg) { - try { - var info = gen2[key](arg); - var value = info.value; - } catch (error) { - reject(error); - return; - } - if (info.done) { - resolve(value); - } else { - Promise.resolve(value).then(_next, _throw); - } - } - function _asyncToGenerator(fn) { - return function() { - var self2 = this, args = arguments; - return new Promise(function(resolve, reject) { - var gen2 = fn.apply(self2, args); - function _next(value) { - asyncGeneratorStep(gen2, resolve, reject, _next, _throw, "next", value); - } - function _throw(err) { - asyncGeneratorStep(gen2, resolve, reject, _next, _throw, "throw", err); - } - _next(void 0); - }); - }; - } - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && (symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); - } - return keys; - } - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = null != arguments[i] ? arguments[i] : {}; - i % 2 ? ownKeys(Object(source), true).forEach(function(key) { - _defineProperty(target, key, source[key]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - return target; - } - function _defineProperty(obj, key, value) { - key = _toPropertyKey(key); - if (key in obj) { - Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); - } else { - obj[key] = value; - } - return obj; - } - function _toPropertyKey(arg) { - var key = _toPrimitive(arg, "string"); - return typeof key === "symbol" ? key : String(key); - } - function _toPrimitive(input, hint) { - if (typeof input !== "object" || input === null) - return input; - var prim = input[Symbol.toPrimitive]; - if (prim !== void 0) { - var res = prim.call(input, hint || "default"); - if (typeof res !== "object") - return res; - throw new TypeError("@@toPrimitive must return a primitive value."); - } - return (hint === "string" ? String : Number)(input); - } - var ERR_INVALID_ARG_TYPE = require_errors5().codes.ERR_INVALID_ARG_TYPE; - function from(Readable2, iterable, opts) { - var iterator; - if (iterable && typeof iterable.next === "function") { - iterator = iterable; - } else if (iterable && iterable[Symbol.asyncIterator]) - iterator = iterable[Symbol.asyncIterator](); - else if (iterable && iterable[Symbol.iterator]) - iterator = iterable[Symbol.iterator](); - else - throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); - var readable = new Readable2(_objectSpread({ - objectMode: true - }, opts)); - var reading = false; - readable._read = function() { - if (!reading) { - reading = true; - next(); - } - }; - function next() { - return _next2.apply(this, arguments); - } - function _next2() { - _next2 = _asyncToGenerator(function* () { - try { - var _yield$iterator$next = yield iterator.next(), value = _yield$iterator$next.value, done = _yield$iterator$next.done; - if (done) { - readable.push(null); - } else if (readable.push(yield value)) { - next(); - } else { - reading = false; - } - } catch (err) { - readable.destroy(err); - } - }); - return _next2.apply(this, arguments); - } - return readable; - } - module2.exports = from; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js -var require_stream_readable = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) { - "use strict"; - module2.exports = Readable2; - var Duplex; - Readable2.ReadableState = ReadableState; - var EE = require("events").EventEmitter; - var EElistenerCount = function EElistenerCount2(emitter, type2) { - return emitter.listeners(type2).length; - }; - var Stream2 = require_stream2(); - var Buffer3 = require("buffer").Buffer; - var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { - }; - function _uint8ArrayToBuffer(chunk) { - return Buffer3.from(chunk); - } - function _isUint8Array(obj) { - return Buffer3.isBuffer(obj) || obj instanceof OurUint8Array; - } - var debugUtil = require("util"); - var debug; - if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog("stream"); - } else { - debug = function debug2() { - }; - } - var BufferList = require_buffer_list(); - var destroyImpl = require_destroy(); - var _require = require_state(); - var getHighWaterMark = _require.getHighWaterMark; - var _require$codes = require_errors5().codes; - var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; - var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; - var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; - var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; - var StringDecoder; - var createReadableStreamAsyncIterator; - var from; - require_inherits()(Readable2, Stream2); - var errorOrDestroy = destroyImpl.errorOrDestroy; - var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; - function prependListener(emitter, event, fn) { - if (typeof emitter.prependListener === "function") - return emitter.prependListener(event, fn); - if (!emitter._events || !emitter._events[event]) - emitter.on(event, fn); - else if (Array.isArray(emitter._events[event])) - emitter._events[event].unshift(fn); - else - emitter._events[event] = [fn, emitter._events[event]]; - } - function ReadableState(options, stream, isDuplex) { - Duplex = Duplex || require_stream_duplex(); - options = options || {}; - if (typeof isDuplex !== "boolean") - isDuplex = stream instanceof Duplex; - this.objectMode = !!options.objectMode; - if (isDuplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - this.sync = true; - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - this.paused = true; - this.emitClose = options.emitClose !== false; - this.autoDestroy = !!options.autoDestroy; - this.destroyed = false; - this.defaultEncoding = options.defaultEncoding || "utf8"; - this.awaitDrain = 0; - this.readingMore = false; - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require_string_decoder().StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } - } - function Readable2(options) { - Duplex = Duplex || require_stream_duplex(); - if (!(this instanceof Readable2)) - return new Readable2(options); - var isDuplex = this instanceof Duplex; - this._readableState = new ReadableState(options, this, isDuplex); - this.readable = true; - if (options) { - if (typeof options.read === "function") - this._read = options.read; - if (typeof options.destroy === "function") - this._destroy = options.destroy; - } - Stream2.call(this); - } - Object.defineProperty(Readable2.prototype, "destroyed", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - if (this._readableState === void 0) { - return false; - } - return this._readableState.destroyed; - }, - set: function set(value) { - if (!this._readableState) { - return; - } - this._readableState.destroyed = value; - } - }); - Readable2.prototype.destroy = destroyImpl.destroy; - Readable2.prototype._undestroy = destroyImpl.undestroy; - Readable2.prototype._destroy = function(err, cb) { - cb(err); - }; - Readable2.prototype.push = function(chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; - if (!state.objectMode) { - if (typeof chunk === "string") { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer3.from(chunk, encoding); - encoding = ""; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; - } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); - }; - Readable2.prototype.unshift = function(chunk) { - return readableAddChunk(this, chunk, null, true, false); - }; - function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - debug("readableAddChunk", chunk); - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) - er = chunkInvalid(state, chunk); - if (er) { - errorOrDestroy(stream, er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer3.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } - if (addToFront) { - if (state.endEmitted) - errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); - else - addChunk(stream, state, chunk, true); - } else if (state.ended) { - errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); - } else if (state.destroyed) { - return false; - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) - addChunk(stream, state, chunk, false); - else - maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - maybeReadMore(stream, state); - } - } - return !state.ended && (state.length < state.highWaterMark || state.length === 0); - } - function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - state.awaitDrain = 0; - stream.emit("data", chunk); - } else { - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - if (state.needReadable) - emitReadable(stream); - } - maybeReadMore(stream, state); - } - function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { - er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); - } - return er; - } - Readable2.prototype.isPaused = function() { - return this._readableState.flowing === false; - }; - Readable2.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require_string_decoder().StringDecoder; - var decoder = new StringDecoder(enc); - this._readableState.decoder = decoder; - this._readableState.encoding = this._readableState.decoder.encoding; - var p = this._readableState.buffer.head; - var content = ""; - while (p !== null) { - content += decoder.write(p.data); - p = p.next; - } - this._readableState.buffer.clear(); - if (content !== "") - this._readableState.buffer.push(content); - this._readableState.length = content.length; - return this; - }; - var MAX_HWM = 1073741824; - function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; - } - function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) - return 0; - if (state.objectMode) - return 1; - if (n !== n) { - if (state.flowing && state.length) - return state.buffer.head.data.length; - else - return state.length; - } - if (n > state.highWaterMark) - state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) - return n; - if (!state.ended) { - state.needReadable = true; - return 0; - } - return state.length; - } - Readable2.prototype.read = function(n) { - debug("read", n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - if (n !== 0) - state.emittedReadable = false; - if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { - debug("read: emitReadable", state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - n = howMuchToRead(n, state); - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - var doRead = state.needReadable; - debug("need readable", doRead); - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug("length less than watermark", doRead); - } - if (state.ended || state.reading) { - doRead = false; - debug("reading or ended", doRead); - } else if (doRead) { - debug("do read"); - state.reading = true; - state.sync = true; - if (state.length === 0) - state.needReadable = true; - this._read(state.highWaterMark); - state.sync = false; - if (!state.reading) - n = howMuchToRead(nOrig, state); - } - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - if (ret === null) { - state.needReadable = state.length <= state.highWaterMark; - n = 0; - } else { - state.length -= n; - state.awaitDrain = 0; - } - if (state.length === 0) { - if (!state.ended) - state.needReadable = true; - if (nOrig !== n && state.ended) - endReadable(this); - } - if (ret !== null) - this.emit("data", ret); - return ret; - }; - function onEofChunk(stream, state) { - debug("onEofChunk"); - if (state.ended) - return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - if (state.sync) { - emitReadable(stream); - } else { - state.needReadable = false; - if (!state.emittedReadable) { - state.emittedReadable = true; - emitReadable_(stream); - } - } - } - function emitReadable(stream) { - var state = stream._readableState; - debug("emitReadable", state.needReadable, state.emittedReadable); - state.needReadable = false; - if (!state.emittedReadable) { - debug("emitReadable", state.flowing); - state.emittedReadable = true; - process.nextTick(emitReadable_, stream); - } - } - function emitReadable_(stream) { - var state = stream._readableState; - debug("emitReadable_", state.destroyed, state.length, state.ended); - if (!state.destroyed && (state.length || state.ended)) { - stream.emit("readable"); - state.emittedReadable = false; - } - state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; - flow(stream); - } - function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - process.nextTick(maybeReadMore_, stream, state); - } - } - function maybeReadMore_(stream, state) { - while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { - var len = state.length; - debug("maybeReadMore read 0"); - stream.read(0); - if (len === state.length) - break; - } - state.readingMore = false; - } - Readable2.prototype._read = function(n) { - errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); - }; - Readable2.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) - process.nextTick(endFn); - else - src.once("end", endFn); - dest.on("unpipe", onunpipe); - function onunpipe(readable, unpipeInfo) { - debug("onunpipe"); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } - } - function onend() { - debug("onend"); - dest.end(); - } - var ondrain = pipeOnDrain(src); - dest.on("drain", ondrain); - var cleanedUp = false; - function cleanup() { - debug("cleanup"); - dest.removeListener("close", onclose); - dest.removeListener("finish", onfinish); - dest.removeListener("drain", ondrain); - dest.removeListener("error", onerror); - dest.removeListener("unpipe", onunpipe); - src.removeListener("end", onend); - src.removeListener("end", unpipe); - src.removeListener("data", ondata); - cleanedUp = true; - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - src.on("data", ondata); - function ondata(chunk) { - debug("ondata"); - var ret = dest.write(chunk); - debug("dest.write", ret); - if (ret === false) { - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug("false write response, pause", state.awaitDrain); - state.awaitDrain++; - } - src.pause(); - } - } - function onerror(er) { - debug("onerror", er); - unpipe(); - dest.removeListener("error", onerror); - if (EElistenerCount(dest, "error") === 0) - errorOrDestroy(dest, er); - } - prependListener(dest, "error", onerror); - function onclose() { - dest.removeListener("finish", onfinish); - unpipe(); - } - dest.once("close", onclose); - function onfinish() { - debug("onfinish"); - dest.removeListener("close", onclose); - unpipe(); - } - dest.once("finish", onfinish); - function unpipe() { - debug("unpipe"); - src.unpipe(dest); - } - dest.emit("pipe", src); - if (!state.flowing) { - debug("pipe resume"); - src.resume(); - } - return dest; - }; - function pipeOnDrain(src) { - return function pipeOnDrainFunctionResult() { - var state = src._readableState; - debug("pipeOnDrain", state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { - state.flowing = true; - flow(src); - } - }; - } - Readable2.prototype.unpipe = function(dest) { - var state = this._readableState; - var unpipeInfo = { - hasUnpiped: false - }; - if (state.pipesCount === 0) - return this; - if (state.pipesCount === 1) { - if (dest && dest !== state.pipes) - return this; - if (!dest) - dest = state.pipes; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit("unpipe", this, unpipeInfo); - return this; - } - if (!dest) { - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - for (var i = 0; i < len; i++) - dests[i].emit("unpipe", this, { - hasUnpiped: false - }); - return this; - } - var index = indexOf(state.pipes, dest); - if (index === -1) - return this; - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - dest.emit("unpipe", this, unpipeInfo); - return this; - }; - Readable2.prototype.on = function(ev, fn) { - var res = Stream2.prototype.on.call(this, ev, fn); - var state = this._readableState; - if (ev === "data") { - state.readableListening = this.listenerCount("readable") > 0; - if (state.flowing !== false) - this.resume(); - } else if (ev === "readable") { - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.flowing = false; - state.emittedReadable = false; - debug("on readable", state.length, state.reading); - if (state.length) { - emitReadable(this); - } else if (!state.reading) { - process.nextTick(nReadingNextTick, this); - } - } - } - return res; - }; - Readable2.prototype.addListener = Readable2.prototype.on; - Readable2.prototype.removeListener = function(ev, fn) { - var res = Stream2.prototype.removeListener.call(this, ev, fn); - if (ev === "readable") { - process.nextTick(updateReadableListening, this); - } - return res; - }; - Readable2.prototype.removeAllListeners = function(ev) { - var res = Stream2.prototype.removeAllListeners.apply(this, arguments); - if (ev === "readable" || ev === void 0) { - process.nextTick(updateReadableListening, this); - } - return res; - }; - function updateReadableListening(self2) { - var state = self2._readableState; - state.readableListening = self2.listenerCount("readable") > 0; - if (state.resumeScheduled && !state.paused) { - state.flowing = true; - } else if (self2.listenerCount("data") > 0) { - self2.resume(); - } - } - function nReadingNextTick(self2) { - debug("readable nexttick read 0"); - self2.read(0); - } - Readable2.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug("resume"); - state.flowing = !state.readableListening; - resume(this, state); - } - state.paused = false; - return this; - }; - function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - process.nextTick(resume_, stream, state); - } - } - function resume_(stream, state) { - debug("resume", state.reading); - if (!state.reading) { - stream.read(0); - } - state.resumeScheduled = false; - stream.emit("resume"); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); - } - Readable2.prototype.pause = function() { - debug("call pause flowing=%j", this._readableState.flowing); - if (this._readableState.flowing !== false) { - debug("pause"); - this._readableState.flowing = false; - this.emit("pause"); - } - this._readableState.paused = true; - return this; - }; - function flow(stream) { - var state = stream._readableState; - debug("flow", state.flowing); - while (state.flowing && stream.read() !== null) - ; - } - Readable2.prototype.wrap = function(stream) { - var _this = this; - var state = this._readableState; - var paused = false; - stream.on("end", function() { - debug("wrapped end"); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - _this.push(chunk); - } - _this.push(null); - }); - stream.on("data", function(chunk) { - debug("wrapped data"); - if (state.decoder) - chunk = state.decoder.write(chunk); - if (state.objectMode && (chunk === null || chunk === void 0)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - for (var i in stream) { - if (this[i] === void 0 && typeof stream[i] === "function") { - this[i] = /* @__PURE__ */ function methodWrap(method) { - return function methodWrapReturnFunction() { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - this._read = function(n2) { - debug("wrapped _read", n2); - if (paused) { - paused = false; - stream.resume(); - } - }; - return this; - }; - if (typeof Symbol === "function") { - Readable2.prototype[Symbol.asyncIterator] = function() { - if (createReadableStreamAsyncIterator === void 0) { - createReadableStreamAsyncIterator = require_async_iterator(); - } - return createReadableStreamAsyncIterator(this); - }; - } - Object.defineProperty(Readable2.prototype, "readableHighWaterMark", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.highWaterMark; - } - }); - Object.defineProperty(Readable2.prototype, "readableBuffer", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState && this._readableState.buffer; - } - }); - Object.defineProperty(Readable2.prototype, "readableFlowing", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.flowing; - }, - set: function set(state) { - if (this._readableState) { - this._readableState.flowing = state; - } - } - }); - Readable2._fromList = fromList; - Object.defineProperty(Readable2.prototype, "readableLength", { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function get() { - return this._readableState.length; - } - }); - function fromList(n, state) { - if (state.length === 0) - return null; - var ret; - if (state.objectMode) - ret = state.buffer.shift(); - else if (!n || n >= state.length) { - if (state.decoder) - ret = state.buffer.join(""); - else if (state.buffer.length === 1) - ret = state.buffer.first(); - else - ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - ret = state.buffer.consume(n, state.decoder); - } - return ret; - } - function endReadable(stream) { - var state = stream._readableState; - debug("endReadable", state.endEmitted); - if (!state.endEmitted) { - state.ended = true; - process.nextTick(endReadableNT, state, stream); - } - } - function endReadableNT(state, stream) { - debug("endReadableNT", state.endEmitted, state.length); - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit("end"); - if (state.autoDestroy) { - var wState = stream._writableState; - if (!wState || wState.autoDestroy && wState.finished) { - stream.destroy(); - } - } - } - } - if (typeof Symbol === "function") { - Readable2.from = function(iterable, opts) { - if (from === void 0) { - from = require_from(); - } - return from(Readable2, iterable, opts); - }; - } - function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) - return i; - } - return -1; - } - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js -var require_stream_transform = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) { - "use strict"; - module2.exports = Transform; - var _require$codes = require_errors5().codes; - var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; - var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; - var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; - var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; - var Duplex = require_stream_duplex(); - require_inherits()(Transform, Duplex); - function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - var cb = ts.writecb; - if (cb === null) { - return this.emit("error", new ERR_MULTIPLE_CALLBACK()); - } - ts.writechunk = null; - ts.writecb = null; - if (data != null) - this.push(data); - cb(er); - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } - } - function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - Duplex.call(this, options); - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - this._readableState.needReadable = true; - this._readableState.sync = false; - if (options) { - if (typeof options.transform === "function") - this._transform = options.transform; - if (typeof options.flush === "function") - this._flush = options.flush; - } - this.on("prefinish", prefinish); - } - function prefinish() { - var _this = this; - if (typeof this._flush === "function" && !this._readableState.destroyed) { - this._flush(function(er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } - } - Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); - }; - Transform.prototype._transform = function(chunk, encoding, cb) { - cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); - }; - Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } - }; - Transform.prototype._read = function(n) { - var ts = this._transformState; - if (ts.writechunk !== null && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - ts.needTransform = true; - } - }; - Transform.prototype._destroy = function(err, cb) { - Duplex.prototype._destroy.call(this, err, function(err2) { - cb(err2); - }); - }; - function done(stream, er, data) { - if (er) - return stream.emit("error", er); - if (data != null) - stream.push(data); - if (stream._writableState.length) - throw new ERR_TRANSFORM_WITH_LENGTH_0(); - if (stream._transformState.transforming) - throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); - return stream.push(null); - } - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js -var require_stream_passthrough = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) { - "use strict"; - module2.exports = PassThrough2; - var Transform = require_stream_transform(); - require_inherits()(PassThrough2, Transform); - function PassThrough2(options) { - if (!(this instanceof PassThrough2)) - return new PassThrough2(options); - Transform.call(this, options); - } - PassThrough2.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); - }; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js -var require_pipeline = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) { - "use strict"; - var eos; - function once(callback) { - var called = false; - return function() { - if (called) - return; - called = true; - callback.apply(void 0, arguments); - }; - } - var _require$codes = require_errors5().codes; - var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; - var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; - function noop(err) { - if (err) - throw err; - } - function isRequest2(stream) { - return stream.setHeader && typeof stream.abort === "function"; - } - function destroyer(stream, reading, writing, callback) { - callback = once(callback); - var closed = false; - stream.on("close", function() { - closed = true; - }); - if (eos === void 0) - eos = require_end_of_stream(); - eos(stream, { - readable: reading, - writable: writing - }, function(err) { - if (err) - return callback(err); - closed = true; - callback(); - }); - var destroyed = false; - return function(err) { - if (closed) - return; - if (destroyed) - return; - destroyed = true; - if (isRequest2(stream)) - return stream.abort(); - if (typeof stream.destroy === "function") - return stream.destroy(); - callback(err || new ERR_STREAM_DESTROYED("pipe")); - }; - } - function call(fn) { - fn(); - } - function pipe(from, to) { - return from.pipe(to); - } - function popCallback(streams) { - if (!streams.length) - return noop; - if (typeof streams[streams.length - 1] !== "function") - return noop; - return streams.pop(); - } - function pipeline() { - for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { - streams[_key] = arguments[_key]; - } - var callback = popCallback(streams); - if (Array.isArray(streams[0])) - streams = streams[0]; - if (streams.length < 2) { - throw new ERR_MISSING_ARGS("streams"); - } - var error; - var destroys = streams.map(function(stream, i) { - var reading = i < streams.length - 1; - var writing = i > 0; - return destroyer(stream, reading, writing, function(err) { - if (!error) - error = err; - if (err) - destroys.forEach(call); - if (reading) - return; - destroys.forEach(call); - callback(error); - }); - }); - return streams.reduce(pipe); - } - module2.exports = pipeline; - } -}); - -// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable.js -var require_readable = __commonJS({ - "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable.js"(exports2, module2) { - var Stream2 = require("stream"); - if (process.env.READABLE_STREAM === "disable" && Stream2) { - module2.exports = Stream2.Readable; - Object.assign(module2.exports, Stream2); - module2.exports.Stream = Stream2; - } else { - exports2 = module2.exports = require_stream_readable(); - exports2.Stream = Stream2 || exports2; - exports2.Readable = exports2; - exports2.Writable = require_stream_writable(); - exports2.Duplex = require_stream_duplex(); - exports2.Transform = require_stream_transform(); - exports2.PassThrough = require_stream_passthrough(); - exports2.finished = require_end_of_stream(); - exports2.pipeline = require_pipeline(); - } - } -}); - -// ../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js -var require_wrappy = __commonJS({ - "../../node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js"(exports2, module2) { - module2.exports = wrappy; - function wrappy(fn, cb) { - if (fn && cb) - return wrappy(fn)(cb); - if (typeof fn !== "function") - throw new TypeError("need wrapper function"); - Object.keys(fn).forEach(function(k) { - wrapper[k] = fn[k]; - }); - return wrapper; - function wrapper() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - var ret = fn.apply(this, args); - var cb2 = args[args.length - 1]; - if (typeof ret === "function" && ret !== cb2) { - Object.keys(cb2).forEach(function(k) { - ret[k] = cb2[k]; - }); - } - return ret; - } - } - } -}); - -// ../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js -var require_once = __commonJS({ - "../../node_modules/.pnpm/once@1.4.0/node_modules/once/once.js"(exports2, module2) { - var wrappy = require_wrappy(); - module2.exports = wrappy(once); - module2.exports.strict = wrappy(onceStrict); - once.proto = once(function() { - Object.defineProperty(Function.prototype, "once", { - value: function() { - return once(this); - }, - configurable: true - }); - Object.defineProperty(Function.prototype, "onceStrict", { - value: function() { - return onceStrict(this); - }, - configurable: true - }); - }); - function once(fn) { - var f = function() { - if (f.called) - return f.value; - f.called = true; - return f.value = fn.apply(this, arguments); - }; - f.called = false; - return f; - } - function onceStrict(fn) { - var f = function() { - if (f.called) - throw new Error(f.onceError); - f.called = true; - return f.value = fn.apply(this, arguments); - }; - var name = fn.name || "Function wrapped with `once`"; - f.onceError = name + " shouldn't be called more than once"; - f.called = false; - return f; - } - } -}); - -// ../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js -var require_end_of_stream2 = __commonJS({ - "../../node_modules/.pnpm/end-of-stream@1.4.5/node_modules/end-of-stream/index.js"(exports2, module2) { - var once = require_once(); - var noop = function() { - }; - var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process); - var isRequest2 = function(stream) { - return stream.setHeader && typeof stream.abort === "function"; - }; - var isChildProcess = function(stream) { - return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3; - }; - var eos = function(stream, opts, callback) { - if (typeof opts === "function") - return eos(stream, null, opts); - if (!opts) - opts = {}; - callback = once(callback || noop); - var ws = stream._writableState; - var rs = stream._readableState; - var readable = opts.readable || opts.readable !== false && stream.readable; - var writable = opts.writable || opts.writable !== false && stream.writable; - var cancelled = false; - var onlegacyfinish = function() { - if (!stream.writable) - onfinish(); - }; - var onfinish = function() { - writable = false; - if (!readable) - callback.call(stream); - }; - var onend = function() { - readable = false; - if (!writable) - callback.call(stream); - }; - var onexit = function(exitCode) { - callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null); - }; - var onerror = function(err) { - callback.call(stream, err); - }; - var onclose = function() { - qnt(onclosenexttick); - }; - var onclosenexttick = function() { - if (cancelled) - return; - if (readable && !(rs && (rs.ended && !rs.destroyed))) - return callback.call(stream, new Error("premature close")); - if (writable && !(ws && (ws.ended && !ws.destroyed))) - return callback.call(stream, new Error("premature close")); - }; - var onrequest = function() { - stream.req.on("finish", onfinish); - }; - if (isRequest2(stream)) { - stream.on("complete", onfinish); - stream.on("abort", onclose); - if (stream.req) - onrequest(); - else - stream.on("request", onrequest); - } else if (writable && !ws) { - stream.on("end", onlegacyfinish); - stream.on("close", onlegacyfinish); - } - if (isChildProcess(stream)) - stream.on("exit", onexit); - stream.on("end", onend); - stream.on("finish", onfinish); - if (opts.error !== false) - stream.on("error", onerror); - stream.on("close", onclose); - return function() { - cancelled = true; - stream.removeListener("complete", onfinish); - stream.removeListener("abort", onclose); - stream.removeListener("request", onrequest); - if (stream.req) - stream.req.removeListener("finish", onfinish); - stream.removeListener("end", onlegacyfinish); - stream.removeListener("close", onlegacyfinish); - stream.removeListener("finish", onfinish); - stream.removeListener("exit", onexit); - stream.removeListener("end", onend); - stream.removeListener("error", onerror); - stream.removeListener("close", onclose); - }; - }; - module2.exports = eos; - } -}); - -// ../../node_modules/.pnpm/stream-shift@1.0.3/node_modules/stream-shift/index.js -var require_stream_shift = __commonJS({ - "../../node_modules/.pnpm/stream-shift@1.0.3/node_modules/stream-shift/index.js"(exports2, module2) { - module2.exports = shift; - function shift(stream) { - var rs = stream._readableState; - if (!rs) - return null; - return rs.objectMode || typeof stream._duplexState === "number" ? stream.read() : stream.read(getStateLength(rs)); - } - function getStateLength(state) { - if (state.buffer.length) { - var idx = state.bufferIndex || 0; - if (state.buffer.head) { - return state.buffer.head.data.length; - } else if (state.buffer.length - idx > 0 && state.buffer[idx]) { - return state.buffer[idx].length; - } - } - return state.length; - } - } -}); - -// ../../node_modules/.pnpm/duplexify@4.1.3/node_modules/duplexify/index.js -var require_duplexify = __commonJS({ - "../../node_modules/.pnpm/duplexify@4.1.3/node_modules/duplexify/index.js"(exports2, module2) { - var stream = require_readable(); - var eos = require_end_of_stream2(); - var inherits = require_inherits(); - var shift = require_stream_shift(); - var SIGNAL_FLUSH = Buffer.from && Buffer.from !== Uint8Array.from ? Buffer.from([0]) : new Buffer([0]); - var onuncork = function(self2, fn) { - if (self2._corked) - self2.once("uncork", fn); - else - fn(); - }; - var autoDestroy = function(self2, err) { - if (self2._autoDestroy) - self2.destroy(err); - }; - var destroyer = function(self2, end2) { - return function(err) { - if (err) - autoDestroy(self2, err.message === "premature close" ? null : err); - else if (end2 && !self2._ended) - self2.end(); - }; - }; - var end = function(ws, fn) { - if (!ws) - return fn(); - if (ws._writableState && ws._writableState.finished) - return fn(); - if (ws._writableState) - return ws.end(fn); - ws.end(); - fn(); - }; - var noop = function() { - }; - var toStreams2 = function(rs) { - return new stream.Readable({ objectMode: true, highWaterMark: 16 }).wrap(rs); - }; - var Duplexify = function(writable, readable, opts) { - if (!(this instanceof Duplexify)) - return new Duplexify(writable, readable, opts); - stream.Duplex.call(this, opts); - this._writable = null; - this._readable = null; - this._readable2 = null; - this._autoDestroy = !opts || opts.autoDestroy !== false; - this._forwardDestroy = !opts || opts.destroy !== false; - this._forwardEnd = !opts || opts.end !== false; - this._corked = 1; - this._ondrain = null; - this._drained = false; - this._forwarding = false; - this._unwrite = null; - this._unread = null; - this._ended = false; - this.destroyed = false; - if (writable) - this.setWritable(writable); - if (readable) - this.setReadable(readable); - }; - inherits(Duplexify, stream.Duplex); - Duplexify.obj = function(writable, readable, opts) { - if (!opts) - opts = {}; - opts.objectMode = true; - opts.highWaterMark = 16; - return new Duplexify(writable, readable, opts); - }; - Duplexify.prototype.cork = function() { - if (++this._corked === 1) - this.emit("cork"); - }; - Duplexify.prototype.uncork = function() { - if (this._corked && --this._corked === 0) - this.emit("uncork"); - }; - Duplexify.prototype.setWritable = function(writable) { - if (this._unwrite) - this._unwrite(); - if (this.destroyed) { - if (writable && writable.destroy) - writable.destroy(); - return; - } - if (writable === null || writable === false) { - this.end(); - return; - } - var self2 = this; - var unend = eos(writable, { writable: true, readable: false }, destroyer(this, this._forwardEnd)); - var ondrain = function() { - var ondrain2 = self2._ondrain; - self2._ondrain = null; - if (ondrain2) - ondrain2(); - }; - var clear = function() { - self2._writable.removeListener("drain", ondrain); - unend(); - }; - if (this._unwrite) - process.nextTick(ondrain); - this._writable = writable; - this._writable.on("drain", ondrain); - this._unwrite = clear; - this.uncork(); - }; - Duplexify.prototype.setReadable = function(readable) { - if (this._unread) - this._unread(); - if (this.destroyed) { - if (readable && readable.destroy) - readable.destroy(); - return; - } - if (readable === null || readable === false) { - this.push(null); - this.resume(); - return; - } - var self2 = this; - var unend = eos(readable, { writable: false, readable: true }, destroyer(this)); - var onreadable = function() { - self2._forward(); - }; - var onend = function() { - self2.push(null); - }; - var clear = function() { - self2._readable2.removeListener("readable", onreadable); - self2._readable2.removeListener("end", onend); - unend(); - }; - this._drained = true; - this._readable = readable; - this._readable2 = readable._readableState ? readable : toStreams2(readable); - this._readable2.on("readable", onreadable); - this._readable2.on("end", onend); - this._unread = clear; - this._forward(); - }; - Duplexify.prototype._read = function() { - this._drained = true; - this._forward(); - }; - Duplexify.prototype._forward = function() { - if (this._forwarding || !this._readable2 || !this._drained) - return; - this._forwarding = true; - var data; - while (this._drained && (data = shift(this._readable2)) !== null) { - if (this.destroyed) - continue; - this._drained = this.push(data); - } - this._forwarding = false; - }; - Duplexify.prototype.destroy = function(err, cb) { - if (!cb) - cb = noop; - if (this.destroyed) - return cb(null); - this.destroyed = true; - var self2 = this; - process.nextTick(function() { - self2._destroy(err); - cb(null); - }); - }; - Duplexify.prototype._destroy = function(err) { - if (err) { - var ondrain = this._ondrain; - this._ondrain = null; - if (ondrain) - ondrain(err); - else - this.emit("error", err); - } - if (this._forwardDestroy) { - if (this._readable && this._readable.destroy) - this._readable.destroy(); - if (this._writable && this._writable.destroy) - this._writable.destroy(); - } - this.emit("close"); - }; - Duplexify.prototype._write = function(data, enc, cb) { - if (this.destroyed) - return; - if (this._corked) - return onuncork(this, this._write.bind(this, data, enc, cb)); - if (data === SIGNAL_FLUSH) - return this._finish(cb); - if (!this._writable) - return cb(); - if (this._writable.write(data) === false) - this._ondrain = cb; - else if (!this.destroyed) - cb(); - }; - Duplexify.prototype._finish = function(cb) { - var self2 = this; - this.emit("preend"); - onuncork(this, function() { - end(self2._forwardEnd && self2._writable, function() { - if (self2._writableState.prefinished === false) - self2._writableState.prefinished = true; - self2.emit("prefinish"); - onuncork(self2, cb); - }); - }); - }; - Duplexify.prototype.end = function(data, enc, cb) { - if (typeof data === "function") - return this.end(null, null, data); - if (typeof enc === "function") - return this.end(data, null, enc); - this._ended = true; - if (data) - this.write(data); - if (!this._writableState.ending && !this._writableState.destroyed) - this.write(SIGNAL_FLUSH); - return stream.Writable.prototype.end.call(this, cb); - }; - module2.exports = Duplexify; - } -}); - -// ../../node_modules/.pnpm/@fastify+websocket@11.2.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/@fastify/websocket/index.js -var require_websocket2 = __commonJS({ - "../../node_modules/.pnpm/@fastify+websocket@11.2.0_bufferutil@4.1.0_utf-8-validate@6.0.6/node_modules/@fastify/websocket/index.js"(exports2, module2) { - "use strict"; - var { ServerResponse } = require("node:http"); - var { PassThrough: PassThrough2 } = require("node:stream"); - var { randomBytes: randomBytes3 } = require("node:crypto"); - var fp = require_plugin2(); - var WebSocket3 = require_ws(); - var Duplexify = require_duplexify(); - var kWs = Symbol("ws-socket"); - var kWsHead = Symbol("ws-head"); - var statusCodeReg = /HTTP\/1.1 (\d+)/u; - function fastifyWebsocket(fastify, opts, next) { - fastify.decorateRequest("ws", null); - let errorHandler = defaultErrorHandler; - if (opts.errorHandler) { - if (typeof opts.errorHandler !== "function") { - return next(new Error("invalid errorHandler function")); - } - errorHandler = opts.errorHandler; - } - let preClose = defaultPreClose; - if (opts?.preClose) { - if (typeof opts.preClose !== "function") { - return next(new Error("invalid preClose function")); - } - preClose = opts.preClose; - } - if (opts.options?.noServer) { - return next(new Error("fastify-websocket doesn't support the ws noServer option. If you want to create a websocket server detatched from fastify, use the ws library directly.")); - } - const wssOptions = Object.assign({ noServer: true }, opts.options); - if (wssOptions.path) { - fastify.log.warn("ws server path option shouldn't be provided, use a route instead"); - } - const websocketListenServer = wssOptions.server || fastify.server; - delete wssOptions.server; - const wss = new WebSocket3.Server(wssOptions); - fastify.decorate("websocketServer", wss); - async function injectWS(path2 = "/", upgradeContext = {}, options = {}) { - const server2Client = new PassThrough2(); - const client2Server = new PassThrough2(); - const serverStream = new Duplexify(server2Client, client2Server); - const clientStream = new Duplexify(client2Server, server2Client); - const ws = new WebSocket3(null, void 0, { isServer: false }); - const head = Buffer.from([]); - let resolve, reject; - const promise = new Promise((_resolve, _reject) => { - resolve = _resolve; - reject = _reject; - }); - typeof options.onInit === "function" && options.onInit(ws); - ws.on("open", () => { - typeof options.onOpen === "function" && options.onOpen(ws); - clientStream.removeListener("data", onData); - resolve(ws); - }); - const onData = (chunk) => { - if (chunk.toString().includes("HTTP/1.1 101 Switching Protocols")) { - ws._isServer = false; - ws.setSocket(clientStream, head, { maxPayload: 0 }); - } else { - clientStream.removeListener("data", onData); - const statusCode = Number(statusCodeReg.exec(chunk.toString())[1]); - reject(new Error("Unexpected server response: " + statusCode)); - } - }; - clientStream.on("data", onData); - const req = { - ...upgradeContext, - method: "GET", - headers: { - ...upgradeContext.headers, - connection: "upgrade", - upgrade: "websocket", - "sec-websocket-version": 13, - "sec-websocket-key": randomBytes3(16).toString("base64") - }, - httpVersion: "1.1", - url: path2, - [kWs]: serverStream, - [kWsHead]: head - }; - websocketListenServer.emit("upgrade", req, req[kWs], req[kWsHead]); - return promise; - } - fastify.decorate("injectWS", injectWS); - function onUpgrade(rawRequest, socket, head) { - rawRequest[kWs] = socket; - rawRequest[kWsHead] = head; - const rawResponse = new ServerResponse(rawRequest); - try { - rawResponse.assignSocket(socket); - fastify.routing(rawRequest, rawResponse); - } catch (err) { - fastify.log.warn({ err }, "websocket upgrade failed"); - } - } - websocketListenServer.on("upgrade", onUpgrade); - const handleUpgrade = (rawRequest, callback) => { - wss.handleUpgrade(rawRequest, rawRequest[kWs], rawRequest[kWsHead], (socket) => { - wss.emit("connection", socket, rawRequest); - socket.on("error", (error) => { - fastify.log.error(error); - }); - callback(socket); - }); - }; - fastify.addHook("onRequest", (request, _reply, done) => { - if (request.raw[kWs]) { - request.ws = true; - } else { - request.ws = false; - } - done(); - }); - fastify.addHook("onResponse", (request, _reply, done) => { - if (request.ws) { - request.raw[kWs].destroy(); - } - done(); - }); - fastify.addHook("onRoute", (routeOptions) => { - let isWebsocketRoute = false; - let wsHandler = routeOptions.wsHandler; - let handler = routeOptions.handler; - if (routeOptions.websocket || routeOptions.wsHandler) { - if (routeOptions.method === "HEAD") { - return; - } else if (routeOptions.method !== "GET") { - throw new Error("websocket handler can only be declared in GET method"); - } - isWebsocketRoute = true; - if (routeOptions.websocket) { - if (!routeOptions.schema) { - routeOptions.schema = {}; - } - routeOptions.schema.hide = true; - wsHandler = routeOptions.handler; - handler = function(_, reply) { - reply.code(404).send(); - }; - } - if (typeof wsHandler !== "function") { - throw new TypeError("invalid wsHandler function"); - } - } - routeOptions.handler = function(request, reply) { - if (request.raw[kWs]) { - reply.hijack(); - handleUpgrade(request.raw, (socket) => { - let result; - try { - if (isWebsocketRoute) { - result = wsHandler.call(this, socket, request); - } else { - result = noHandle.call(this, socket, request); - } - } catch (err) { - return errorHandler.call(this, err, socket, request, reply); - } - if (result && typeof result.catch === "function") { - result.catch((err) => errorHandler.call(this, err, socket, request, reply)); - } - }); - } else { - return handler.call(this, request, reply); - } - }; - }); - fastify.addHook("preClose", preClose); - function defaultPreClose(done) { - const server = this.websocketServer; - if (server.clients) { - for (const client of server.clients) { - client.close(); - } - } - fastify.server.removeListener("upgrade", onUpgrade); - server.close(done); - done(); - } - function noHandle(socket, rawRequest) { - this.log.info({ path: rawRequest.url }, "closed incoming websocket connection for path with no websocket handler"); - socket.close(); - } - function defaultErrorHandler(error, socket, request) { - request.log.error(error); - socket.terminate(); - } - next(); - } - module2.exports = fp(fastifyWebsocket, { - fastify: "5.x", - name: "@fastify/websocket" - }); - module2.exports.default = fastifyWebsocket; - module2.exports.fastifyWebsocket = fastifyWebsocket; - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/utils.js -var require_utils4 = __commonJS({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/utils.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.notImplemented = exports2.bitMask = exports2.utf8ToBytes = exports2.randomBytes = exports2.isBytes = exports2.hexToBytes = exports2.concatBytes = exports2.bytesToUtf8 = exports2.bytesToHex = exports2.anumber = exports2.abytes = void 0; - exports2.abool = abool; - exports2._abool2 = _abool22; - exports2._abytes2 = _abytes22; - exports2.numberToHexUnpadded = numberToHexUnpadded2; - exports2.hexToNumber = hexToNumber2; - exports2.bytesToNumberBE = bytesToNumberBE2; - exports2.bytesToNumberLE = bytesToNumberLE2; - exports2.numberToBytesBE = numberToBytesBE2; - exports2.numberToBytesLE = numberToBytesLE2; - exports2.numberToVarBytesBE = numberToVarBytesBE; - exports2.ensureBytes = ensureBytes2; - exports2.equalBytes = equalBytes2; - exports2.copyBytes = copyBytes2; - exports2.asciiToBytes = asciiToBytes; - exports2.inRange = inRange2; - exports2.aInRange = aInRange2; - exports2.bitLen = bitLen2; - exports2.bitGet = bitGet; - exports2.bitSet = bitSet; - exports2.createHmacDrbg = createHmacDrbg2; - exports2.validateObject = validateObject2; - exports2.isHash = isHash; - exports2._validateObject = _validateObject2; - exports2.memoized = memoized2; - var utils_js_1 = require_utils2(); - var utils_js_2 = require_utils2(); - Object.defineProperty(exports2, "abytes", { enumerable: true, get: function() { - return utils_js_2.abytes; - } }); - Object.defineProperty(exports2, "anumber", { enumerable: true, get: function() { - return utils_js_2.anumber; - } }); - Object.defineProperty(exports2, "bytesToHex", { enumerable: true, get: function() { - return utils_js_2.bytesToHex; - } }); - Object.defineProperty(exports2, "bytesToUtf8", { enumerable: true, get: function() { - return utils_js_2.bytesToUtf8; - } }); - Object.defineProperty(exports2, "concatBytes", { enumerable: true, get: function() { - return utils_js_2.concatBytes; - } }); - Object.defineProperty(exports2, "hexToBytes", { enumerable: true, get: function() { - return utils_js_2.hexToBytes; - } }); - Object.defineProperty(exports2, "isBytes", { enumerable: true, get: function() { - return utils_js_2.isBytes; - } }); - Object.defineProperty(exports2, "randomBytes", { enumerable: true, get: function() { - return utils_js_2.randomBytes; - } }); - Object.defineProperty(exports2, "utf8ToBytes", { enumerable: true, get: function() { - return utils_js_2.utf8ToBytes; - } }); - var _0n8 = /* @__PURE__ */ BigInt(0); - var _1n8 = /* @__PURE__ */ BigInt(1); - function abool(title, value) { - if (typeof value !== "boolean") - throw new Error(title + " boolean expected, got " + value); - } - function _abool22(value, title = "") { - if (typeof value !== "boolean") { - const prefix = title && `"${title}"`; - throw new Error(prefix + "expected boolean, got type=" + typeof value); - } - return value; - } - function _abytes22(value, length, title = "") { - const bytes = (0, utils_js_1.isBytes)(value); - const len = value?.length; - const needsLen = length !== void 0; - if (!bytes || needsLen && len !== length) { - const prefix = title && `"${title}" `; - const ofLen = needsLen ? ` of length ${length}` : ""; - const got = bytes ? `length=${len}` : `type=${typeof value}`; - throw new Error(prefix + "expected Uint8Array" + ofLen + ", got " + got); - } - return value; - } - function numberToHexUnpadded2(num) { - const hex = num.toString(16); - return hex.length & 1 ? "0" + hex : hex; - } - function hexToNumber2(hex) { - if (typeof hex !== "string") - throw new Error("hex string expected, got " + typeof hex); - return hex === "" ? _0n8 : BigInt("0x" + hex); - } - function bytesToNumberBE2(bytes) { - return hexToNumber2((0, utils_js_1.bytesToHex)(bytes)); - } - function bytesToNumberLE2(bytes) { - (0, utils_js_1.abytes)(bytes); - return hexToNumber2((0, utils_js_1.bytesToHex)(Uint8Array.from(bytes).reverse())); - } - function numberToBytesBE2(n, len) { - return (0, utils_js_1.hexToBytes)(n.toString(16).padStart(len * 2, "0")); - } - function numberToBytesLE2(n, len) { - return numberToBytesBE2(n, len).reverse(); - } - function numberToVarBytesBE(n) { - return (0, utils_js_1.hexToBytes)(numberToHexUnpadded2(n)); - } - function ensureBytes2(title, hex, expectedLength) { - let res; - if (typeof hex === "string") { - try { - res = (0, utils_js_1.hexToBytes)(hex); - } catch (e) { - throw new Error(title + " must be hex string or Uint8Array, cause: " + e); - } - } else if ((0, utils_js_1.isBytes)(hex)) { - res = Uint8Array.from(hex); - } else { - throw new Error(title + " must be hex string or Uint8Array"); - } - const len = res.length; - if (typeof expectedLength === "number" && len !== expectedLength) - throw new Error(title + " of length " + expectedLength + " expected, got " + len); - return res; - } - function equalBytes2(a, b) { - if (a.length !== b.length) - return false; - let diff = 0; - for (let i = 0; i < a.length; i++) - diff |= a[i] ^ b[i]; - return diff === 0; - } - function copyBytes2(bytes) { - return Uint8Array.from(bytes); - } - function asciiToBytes(ascii) { - return Uint8Array.from(ascii, (c, i) => { - const charCode = c.charCodeAt(0); - if (c.length !== 1 || charCode > 127) { - throw new Error(`string contains non-ASCII character "${ascii[i]}" with code ${charCode} at position ${i}`); - } - return charCode; - }); - } - var isPosBig2 = (n) => typeof n === "bigint" && _0n8 <= n; - function inRange2(n, min, max) { - return isPosBig2(n) && isPosBig2(min) && isPosBig2(max) && min <= n && n < max; - } - function aInRange2(title, n, min, max) { - if (!inRange2(n, min, max)) - throw new Error("expected valid " + title + ": " + min + " <= n < " + max + ", got " + n); - } - function bitLen2(n) { - let len; - for (len = 0; n > _0n8; n >>= _1n8, len += 1) - ; - return len; - } - function bitGet(n, pos) { - return n >> BigInt(pos) & _1n8; - } - function bitSet(n, pos, value) { - return n | (value ? _1n8 : _0n8) << BigInt(pos); - } - var bitMask2 = (n) => (_1n8 << BigInt(n)) - _1n8; - exports2.bitMask = bitMask2; - function createHmacDrbg2(hashLen, qByteLen, hmacFn) { - if (typeof hashLen !== "number" || hashLen < 2) - throw new Error("hashLen must be a number"); - if (typeof qByteLen !== "number" || qByteLen < 2) - throw new Error("qByteLen must be a number"); - if (typeof hmacFn !== "function") - throw new Error("hmacFn must be a function"); - const u8n = (len) => new Uint8Array(len); - const u8of = (byte) => Uint8Array.of(byte); - let v = u8n(hashLen); - let k = u8n(hashLen); - let i = 0; - const reset = () => { - v.fill(1); - k.fill(0); - i = 0; - }; - const h = (...b) => hmacFn(k, v, ...b); - const reseed = (seed = u8n(0)) => { - k = h(u8of(0), seed); - v = h(); - if (seed.length === 0) - return; - k = h(u8of(1), seed); - v = h(); - }; - const gen2 = () => { - if (i++ >= 1e3) - throw new Error("drbg: tried 1000 values"); - let len = 0; - const out = []; - while (len < qByteLen) { - v = h(); - const sl = v.slice(); - out.push(sl); - len += v.length; - } - return (0, utils_js_1.concatBytes)(...out); - }; - const genUntil = (seed, pred) => { - reset(); - reseed(seed); - let res = void 0; - while (!(res = pred(gen2()))) - reseed(); - reset(); - return res; - }; - return genUntil; - } - var validatorFns = { - bigint: (val) => typeof val === "bigint", - function: (val) => typeof val === "function", - boolean: (val) => typeof val === "boolean", - string: (val) => typeof val === "string", - stringOrUint8Array: (val) => typeof val === "string" || (0, utils_js_1.isBytes)(val), - isSafeInteger: (val) => Number.isSafeInteger(val), - array: (val) => Array.isArray(val), - field: (val, object) => object.Fp.isValid(val), - hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen) - }; - function validateObject2(object, validators, optValidators = {}) { - const checkField = (fieldName, type2, isOptional) => { - const checkVal = validatorFns[type2]; - if (typeof checkVal !== "function") - throw new Error("invalid validator function"); - const val = object[fieldName]; - if (isOptional && val === void 0) - return; - if (!checkVal(val, object)) { - throw new Error("param " + String(fieldName) + " is invalid. Expected " + type2 + ", got " + val); - } - }; - for (const [fieldName, type2] of Object.entries(validators)) - checkField(fieldName, type2, false); - for (const [fieldName, type2] of Object.entries(optValidators)) - checkField(fieldName, type2, true); - return object; - } - function isHash(val) { - return typeof val === "function" && Number.isSafeInteger(val.outputLen); - } - function _validateObject2(object, fields, optFields = {}) { - if (!object || typeof object !== "object") - throw new Error("expected valid options object"); - function checkField(fieldName, expectedType, isOpt) { - const val = object[fieldName]; - if (isOpt && val === void 0) - return; - const current = typeof val; - if (current !== expectedType || val === null) - throw new Error(`param "${fieldName}" is invalid: expected ${expectedType}, got ${current}`); - } - Object.entries(fields).forEach(([k, v]) => checkField(k, v, false)); - Object.entries(optFields).forEach(([k, v]) => checkField(k, v, true)); - } - var notImplemented2 = () => { - throw new Error("not implemented"); - }; - exports2.notImplemented = notImplemented2; - function memoized2(fn) { - const map = /* @__PURE__ */ new WeakMap(); - return (arg, ...args) => { - const val = map.get(arg); - if (val !== void 0) - return val; - const computed = fn(arg, ...args); - map.set(arg, computed); - return computed; - }; - } - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/modular.js -var require_modular = __commonJS({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/modular.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNegativeLE = void 0; - exports2.mod = mod2; - exports2.pow = pow; - exports2.pow2 = pow22; - exports2.invert = invert2; - exports2.tonelliShanks = tonelliShanks2; - exports2.FpSqrt = FpSqrt2; - exports2.validateField = validateField2; - exports2.FpPow = FpPow2; - exports2.FpInvertBatch = FpInvertBatch2; - exports2.FpDiv = FpDiv; - exports2.FpLegendre = FpLegendre2; - exports2.FpIsSquare = FpIsSquare; - exports2.nLength = nLength2; - exports2.Field = Field2; - exports2.FpSqrtOdd = FpSqrtOdd; - exports2.FpSqrtEven = FpSqrtEven2; - exports2.hashToPrivateScalar = hashToPrivateScalar; - exports2.getFieldBytesLength = getFieldBytesLength2; - exports2.getMinHashLength = getMinHashLength2; - exports2.mapHashToField = mapHashToField2; - var utils_ts_1 = require_utils4(); - var _0n8 = BigInt(0); - var _1n8 = BigInt(1); - var _2n7 = /* @__PURE__ */ BigInt(2); - var _3n4 = /* @__PURE__ */ BigInt(3); - var _4n3 = /* @__PURE__ */ BigInt(4); - var _5n3 = /* @__PURE__ */ BigInt(5); - var _7n3 = /* @__PURE__ */ BigInt(7); - var _8n4 = /* @__PURE__ */ BigInt(8); - var _9n2 = /* @__PURE__ */ BigInt(9); - var _16n2 = /* @__PURE__ */ BigInt(16); - function mod2(a, b) { - const result = a % b; - return result >= _0n8 ? result : b + result; - } - function pow(num, power, modulo) { - return FpPow2(Field2(modulo), num, power); - } - function pow22(x, power, modulo) { - let res = x; - while (power-- > _0n8) { - res *= res; - res %= modulo; - } - return res; - } - function invert2(number2, modulo) { - if (number2 === _0n8) - throw new Error("invert: expected non-zero number"); - if (modulo <= _0n8) - throw new Error("invert: expected positive modulus, got " + modulo); - let a = mod2(number2, modulo); - let b = modulo; - let x = _0n8, y = _1n8, u = _1n8, v = _0n8; - while (a !== _0n8) { - const q = b / a; - const r = b % a; - const m = x - u * q; - const n = y - v * q; - b = a, a = r, x = u, y = v, u = m, v = n; - } - const gcd = b; - if (gcd !== _1n8) - throw new Error("invert: does not exist"); - return mod2(x, modulo); - } - function assertIsSquare2(Fp2, root, n) { - if (!Fp2.eql(Fp2.sqr(root), n)) - throw new Error("Cannot find square root"); - } - function sqrt3mod42(Fp2, n) { - const p1div4 = (Fp2.ORDER + _1n8) / _4n3; - const root = Fp2.pow(n, p1div4); - assertIsSquare2(Fp2, root, n); - return root; - } - function sqrt5mod82(Fp2, n) { - const p5div8 = (Fp2.ORDER - _5n3) / _8n4; - const n2 = Fp2.mul(n, _2n7); - const v = Fp2.pow(n2, p5div8); - const nv = Fp2.mul(n, v); - const i = Fp2.mul(Fp2.mul(nv, _2n7), v); - const root = Fp2.mul(nv, Fp2.sub(i, Fp2.ONE)); - assertIsSquare2(Fp2, root, n); - return root; - } - function sqrt9mod162(P) { - const Fp_ = Field2(P); - const tn = tonelliShanks2(P); - const c1 = tn(Fp_, Fp_.neg(Fp_.ONE)); - const c2 = tn(Fp_, c1); - const c3 = tn(Fp_, Fp_.neg(c1)); - const c4 = (P + _7n3) / _16n2; - return (Fp2, n) => { - let tv1 = Fp2.pow(n, c4); - let tv2 = Fp2.mul(tv1, c1); - const tv3 = Fp2.mul(tv1, c2); - const tv4 = Fp2.mul(tv1, c3); - const e1 = Fp2.eql(Fp2.sqr(tv2), n); - const e2 = Fp2.eql(Fp2.sqr(tv3), n); - tv1 = Fp2.cmov(tv1, tv2, e1); - tv2 = Fp2.cmov(tv4, tv3, e2); - const e3 = Fp2.eql(Fp2.sqr(tv2), n); - const root = Fp2.cmov(tv1, tv2, e3); - assertIsSquare2(Fp2, root, n); - return root; - }; - } - function tonelliShanks2(P) { - if (P < _3n4) - throw new Error("sqrt is not defined for small field"); - let Q = P - _1n8; - let S = 0; - while (Q % _2n7 === _0n8) { - Q /= _2n7; - S++; - } - let Z = _2n7; - const _Fp = Field2(P); - while (FpLegendre2(_Fp, Z) === 1) { - if (Z++ > 1e3) - throw new Error("Cannot find square root: probably non-prime P"); - } - if (S === 1) - return sqrt3mod42; - let cc = _Fp.pow(Z, Q); - const Q1div2 = (Q + _1n8) / _2n7; - return function tonelliSlow(Fp2, n) { - if (Fp2.is0(n)) - return n; - if (FpLegendre2(Fp2, n) !== 1) - throw new Error("Cannot find square root"); - let M = S; - let c = Fp2.mul(Fp2.ONE, cc); - let t = Fp2.pow(n, Q); - let R = Fp2.pow(n, Q1div2); - while (!Fp2.eql(t, Fp2.ONE)) { - if (Fp2.is0(t)) - return Fp2.ZERO; - let i = 1; - let t_tmp = Fp2.sqr(t); - while (!Fp2.eql(t_tmp, Fp2.ONE)) { - i++; - t_tmp = Fp2.sqr(t_tmp); - if (i === M) - throw new Error("Cannot find square root"); - } - const exponent = _1n8 << BigInt(M - i - 1); - const b = Fp2.pow(c, exponent); - M = i; - c = Fp2.sqr(b); - t = Fp2.mul(t, c); - R = Fp2.mul(R, b); - } - return R; - }; - } - function FpSqrt2(P) { - if (P % _4n3 === _3n4) - return sqrt3mod42; - if (P % _8n4 === _5n3) - return sqrt5mod82; - if (P % _16n2 === _9n2) - return sqrt9mod162(P); - return tonelliShanks2(P); - } - var isNegativeLE2 = (num, modulo) => (mod2(num, modulo) & _1n8) === _1n8; - exports2.isNegativeLE = isNegativeLE2; - var FIELD_FIELDS2 = [ - "create", - "isValid", - "is0", - "neg", - "inv", - "sqrt", - "sqr", - "eql", - "add", - "sub", - "mul", - "pow", - "div", - "addN", - "subN", - "mulN", - "sqrN" - ]; - function validateField2(field) { - const initial = { - ORDER: "bigint", - MASK: "bigint", - BYTES: "number", - BITS: "number" - }; - const opts = FIELD_FIELDS2.reduce((map, val) => { - map[val] = "function"; - return map; - }, initial); - (0, utils_ts_1._validateObject)(field, opts); - return field; - } - function FpPow2(Fp2, num, power) { - if (power < _0n8) - throw new Error("invalid exponent, negatives unsupported"); - if (power === _0n8) - return Fp2.ONE; - if (power === _1n8) - return num; - let p = Fp2.ONE; - let d = num; - while (power > _0n8) { - if (power & _1n8) - p = Fp2.mul(p, d); - d = Fp2.sqr(d); - power >>= _1n8; - } - return p; - } - function FpInvertBatch2(Fp2, nums, passZero = false) { - const inverted = new Array(nums.length).fill(passZero ? Fp2.ZERO : void 0); - const multipliedAcc = nums.reduce((acc, num, i) => { - if (Fp2.is0(num)) - return acc; - inverted[i] = acc; - return Fp2.mul(acc, num); - }, Fp2.ONE); - const invertedAcc = Fp2.inv(multipliedAcc); - nums.reduceRight((acc, num, i) => { - if (Fp2.is0(num)) - return acc; - inverted[i] = Fp2.mul(acc, inverted[i]); - return Fp2.mul(acc, num); - }, invertedAcc); - return inverted; - } - function FpDiv(Fp2, lhs, rhs) { - return Fp2.mul(lhs, typeof rhs === "bigint" ? invert2(rhs, Fp2.ORDER) : Fp2.inv(rhs)); - } - function FpLegendre2(Fp2, n) { - const p1mod2 = (Fp2.ORDER - _1n8) / _2n7; - const powered = Fp2.pow(n, p1mod2); - const yes = Fp2.eql(powered, Fp2.ONE); - const zero = Fp2.eql(powered, Fp2.ZERO); - const no = Fp2.eql(powered, Fp2.neg(Fp2.ONE)); - if (!yes && !zero && !no) - throw new Error("invalid Legendre symbol result"); - return yes ? 1 : zero ? 0 : -1; - } - function FpIsSquare(Fp2, n) { - const l = FpLegendre2(Fp2, n); - return l === 1; - } - function nLength2(n, nBitLength) { - if (nBitLength !== void 0) - (0, utils_ts_1.anumber)(nBitLength); - const _nBitLength = nBitLength !== void 0 ? nBitLength : n.toString(2).length; - const nByteLength = Math.ceil(_nBitLength / 8); - return { nBitLength: _nBitLength, nByteLength }; - } - function Field2(ORDER, bitLenOrOpts, isLE2 = false, opts = {}) { - if (ORDER <= _0n8) - throw new Error("invalid field: expected ORDER > 0, got " + ORDER); - let _nbitLength = void 0; - let _sqrt = void 0; - let modFromBytes = false; - let allowedLengths = void 0; - if (typeof bitLenOrOpts === "object" && bitLenOrOpts != null) { - if (opts.sqrt || isLE2) - throw new Error("cannot specify opts in two arguments"); - const _opts = bitLenOrOpts; - if (_opts.BITS) - _nbitLength = _opts.BITS; - if (_opts.sqrt) - _sqrt = _opts.sqrt; - if (typeof _opts.isLE === "boolean") - isLE2 = _opts.isLE; - if (typeof _opts.modFromBytes === "boolean") - modFromBytes = _opts.modFromBytes; - allowedLengths = _opts.allowedLengths; - } else { - if (typeof bitLenOrOpts === "number") - _nbitLength = bitLenOrOpts; - if (opts.sqrt) - _sqrt = opts.sqrt; - } - const { nBitLength: BITS, nByteLength: BYTES } = nLength2(ORDER, _nbitLength); - if (BYTES > 2048) - throw new Error("invalid field: expected ORDER of <= 2048 bytes"); - let sqrtP; - const f = Object.freeze({ - ORDER, - isLE: isLE2, - BITS, - BYTES, - MASK: (0, utils_ts_1.bitMask)(BITS), - ZERO: _0n8, - ONE: _1n8, - allowedLengths, - create: (num) => mod2(num, ORDER), - isValid: (num) => { - if (typeof num !== "bigint") - throw new Error("invalid field element: expected bigint, got " + typeof num); - return _0n8 <= num && num < ORDER; - }, - is0: (num) => num === _0n8, - // is valid and invertible - isValidNot0: (num) => !f.is0(num) && f.isValid(num), - isOdd: (num) => (num & _1n8) === _1n8, - neg: (num) => mod2(-num, ORDER), - eql: (lhs, rhs) => lhs === rhs, - sqr: (num) => mod2(num * num, ORDER), - add: (lhs, rhs) => mod2(lhs + rhs, ORDER), - sub: (lhs, rhs) => mod2(lhs - rhs, ORDER), - mul: (lhs, rhs) => mod2(lhs * rhs, ORDER), - pow: (num, power) => FpPow2(f, num, power), - div: (lhs, rhs) => mod2(lhs * invert2(rhs, ORDER), ORDER), - // Same as above, but doesn't normalize - sqrN: (num) => num * num, - addN: (lhs, rhs) => lhs + rhs, - subN: (lhs, rhs) => lhs - rhs, - mulN: (lhs, rhs) => lhs * rhs, - inv: (num) => invert2(num, ORDER), - sqrt: _sqrt || ((n) => { - if (!sqrtP) - sqrtP = FpSqrt2(ORDER); - return sqrtP(f, n); - }), - toBytes: (num) => isLE2 ? (0, utils_ts_1.numberToBytesLE)(num, BYTES) : (0, utils_ts_1.numberToBytesBE)(num, BYTES), - fromBytes: (bytes, skipValidation = true) => { - if (allowedLengths) { - if (!allowedLengths.includes(bytes.length) || bytes.length > BYTES) { - throw new Error("Field.fromBytes: expected " + allowedLengths + " bytes, got " + bytes.length); - } - const padded = new Uint8Array(BYTES); - padded.set(bytes, isLE2 ? 0 : padded.length - bytes.length); - bytes = padded; - } - if (bytes.length !== BYTES) - throw new Error("Field.fromBytes: expected " + BYTES + " bytes, got " + bytes.length); - let scalar = isLE2 ? (0, utils_ts_1.bytesToNumberLE)(bytes) : (0, utils_ts_1.bytesToNumberBE)(bytes); - if (modFromBytes) - scalar = mod2(scalar, ORDER); - if (!skipValidation) { - if (!f.isValid(scalar)) - throw new Error("invalid field element: outside of range 0..ORDER"); - } - return scalar; - }, - // TODO: we don't need it here, move out to separate fn - invertBatch: (lst) => FpInvertBatch2(f, lst), - // We can't move this out because Fp6, Fp12 implement it - // and it's unclear what to return in there. - cmov: (a, b, c) => c ? b : a - }); - return Object.freeze(f); - } - function FpSqrtOdd(Fp2, elm) { - if (!Fp2.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp2.sqrt(elm); - return Fp2.isOdd(root) ? root : Fp2.neg(root); - } - function FpSqrtEven2(Fp2, elm) { - if (!Fp2.isOdd) - throw new Error("Field doesn't have isOdd"); - const root = Fp2.sqrt(elm); - return Fp2.isOdd(root) ? Fp2.neg(root) : root; - } - function hashToPrivateScalar(hash, groupOrder, isLE2 = false) { - hash = (0, utils_ts_1.ensureBytes)("privateHash", hash); - const hashLen = hash.length; - const minLen = nLength2(groupOrder).nByteLength + 8; - if (minLen < 24 || hashLen < minLen || hashLen > 1024) - throw new Error("hashToPrivateScalar: expected " + minLen + "-1024 bytes of input, got " + hashLen); - const num = isLE2 ? (0, utils_ts_1.bytesToNumberLE)(hash) : (0, utils_ts_1.bytesToNumberBE)(hash); - return mod2(num, groupOrder - _1n8) + _1n8; - } - function getFieldBytesLength2(fieldOrder) { - if (typeof fieldOrder !== "bigint") - throw new Error("field order must be bigint"); - const bitLength = fieldOrder.toString(2).length; - return Math.ceil(bitLength / 8); - } - function getMinHashLength2(fieldOrder) { - const length = getFieldBytesLength2(fieldOrder); - return length + Math.ceil(length / 2); - } - function mapHashToField2(key, fieldOrder, isLE2 = false) { - const len = key.length; - const fieldLen = getFieldBytesLength2(fieldOrder); - const minLen = getMinHashLength2(fieldOrder); - if (len < 16 || len < minLen || len > 1024) - throw new Error("expected " + minLen + "-1024 bytes of input, got " + len); - const num = isLE2 ? (0, utils_ts_1.bytesToNumberLE)(key) : (0, utils_ts_1.bytesToNumberBE)(key); - const reduced = mod2(num, fieldOrder - _1n8) + _1n8; - return isLE2 ? (0, utils_ts_1.numberToBytesLE)(reduced, fieldLen) : (0, utils_ts_1.numberToBytesBE)(reduced, fieldLen); - } - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/curve.js -var require_curve = __commonJS({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/curve.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.wNAF = void 0; - exports2.negateCt = negateCt2; - exports2.normalizeZ = normalizeZ2; - exports2.mulEndoUnsafe = mulEndoUnsafe2; - exports2.pippenger = pippenger2; - exports2.precomputeMSMUnsafe = precomputeMSMUnsafe; - exports2.validateBasic = validateBasic; - exports2._createCurveFields = _createCurveFields2; - var utils_ts_1 = require_utils4(); - var modular_ts_1 = require_modular(); - var _0n8 = BigInt(0); - var _1n8 = BigInt(1); - function negateCt2(condition, item) { - const neg = item.negate(); - return condition ? neg : item; - } - function normalizeZ2(c, points) { - const invertedZs = (0, modular_ts_1.FpInvertBatch)(c.Fp, points.map((p) => p.Z)); - return points.map((p, i) => c.fromAffine(p.toAffine(invertedZs[i]))); - } - function validateW2(W, bits) { - if (!Number.isSafeInteger(W) || W <= 0 || W > bits) - throw new Error("invalid window size, expected [1.." + bits + "], got W=" + W); - } - function calcWOpts2(W, scalarBits) { - validateW2(W, scalarBits); - const windows = Math.ceil(scalarBits / W) + 1; - const windowSize = 2 ** (W - 1); - const maxNumber = 2 ** W; - const mask2 = (0, utils_ts_1.bitMask)(W); - const shiftBy = BigInt(W); - return { windows, windowSize, mask: mask2, maxNumber, shiftBy }; - } - function calcOffsets2(n, window2, wOpts) { - const { windowSize, mask: mask2, maxNumber, shiftBy } = wOpts; - let wbits = Number(n & mask2); - let nextN = n >> shiftBy; - if (wbits > windowSize) { - wbits -= maxNumber; - nextN += _1n8; - } - const offsetStart = window2 * windowSize; - const offset2 = offsetStart + Math.abs(wbits) - 1; - const isZero = wbits === 0; - const isNeg = wbits < 0; - const isNegF = window2 % 2 !== 0; - const offsetF = offsetStart; - return { nextN, offset: offset2, isZero, isNeg, isNegF, offsetF }; - } - function validateMSMPoints2(points, c) { - if (!Array.isArray(points)) - throw new Error("array expected"); - points.forEach((p, i) => { - if (!(p instanceof c)) - throw new Error("invalid point at index " + i); - }); - } - function validateMSMScalars2(scalars, field) { - if (!Array.isArray(scalars)) - throw new Error("array of scalars expected"); - scalars.forEach((s, i) => { - if (!field.isValid(s)) - throw new Error("invalid scalar at index " + i); - }); - } - var pointPrecomputes2 = /* @__PURE__ */ new WeakMap(); - var pointWindowSizes2 = /* @__PURE__ */ new WeakMap(); - function getW2(P) { - return pointWindowSizes2.get(P) || 1; - } - function assert02(n) { - if (n !== _0n8) - throw new Error("invalid wNAF"); - } - var wNAF2 = class { - // Parametrized with a given Point class (not individual point) - constructor(Point, bits) { - this.BASE = Point.BASE; - this.ZERO = Point.ZERO; - this.Fn = Point.Fn; - this.bits = bits; - } - // non-const time multiplication ladder - _unsafeLadder(elm, n, p = this.ZERO) { - let d = elm; - while (n > _0n8) { - if (n & _1n8) - p = p.add(d); - d = d.double(); - n >>= _1n8; - } - return p; - } - /** - * Creates a wNAF precomputation window. Used for caching. - * Default window size is set by `utils.precompute()` and is equal to 8. - * Number of precomputed points depends on the curve size: - * 2^(𝑊−1) * (Math.ceil(𝑛 / 𝑊) + 1), where: - * - 𝑊 is the window size - * - 𝑛 is the bitlength of the curve order. - * For a 256-bit curve and window size 8, the number of precomputed points is 128 * 33 = 4224. - * @param point Point instance - * @param W window size - * @returns precomputed point tables flattened to a single array - */ - precomputeWindow(point, W) { - const { windows, windowSize } = calcWOpts2(W, this.bits); - const points = []; - let p = point; - let base = p; - for (let window2 = 0; window2 < windows; window2++) { - base = p; - points.push(base); - for (let i = 1; i < windowSize; i++) { - base = base.add(p); - points.push(base); - } - p = base.double(); - } - return points; - } - /** - * Implements ec multiplication using precomputed tables and w-ary non-adjacent form. - * More compact implementation: - * https://github.com/paulmillr/noble-secp256k1/blob/47cb1669b6e506ad66b35fe7d76132ae97465da2/index.ts#L502-L541 - * @returns real and fake (for const-time) points - */ - wNAF(W, precomputes, n) { - if (!this.Fn.isValid(n)) - throw new Error("invalid scalar"); - let p = this.ZERO; - let f = this.BASE; - const wo = calcWOpts2(W, this.bits); - for (let window2 = 0; window2 < wo.windows; window2++) { - const { nextN, offset: offset2, isZero, isNeg, isNegF, offsetF } = calcOffsets2(n, window2, wo); - n = nextN; - if (isZero) { - f = f.add(negateCt2(isNegF, precomputes[offsetF])); - } else { - p = p.add(negateCt2(isNeg, precomputes[offset2])); - } - } - assert02(n); - return { p, f }; - } - /** - * Implements ec unsafe (non const-time) multiplication using precomputed tables and w-ary non-adjacent form. - * @param acc accumulator point to add result of multiplication - * @returns point - */ - wNAFUnsafe(W, precomputes, n, acc = this.ZERO) { - const wo = calcWOpts2(W, this.bits); - for (let window2 = 0; window2 < wo.windows; window2++) { - if (n === _0n8) - break; - const { nextN, offset: offset2, isZero, isNeg } = calcOffsets2(n, window2, wo); - n = nextN; - if (isZero) { - continue; - } else { - const item = precomputes[offset2]; - acc = acc.add(isNeg ? item.negate() : item); - } - } - assert02(n); - return acc; - } - getPrecomputes(W, point, transform) { - let comp = pointPrecomputes2.get(point); - if (!comp) { - comp = this.precomputeWindow(point, W); - if (W !== 1) { - if (typeof transform === "function") - comp = transform(comp); - pointPrecomputes2.set(point, comp); - } - } - return comp; - } - cached(point, scalar, transform) { - const W = getW2(point); - return this.wNAF(W, this.getPrecomputes(W, point, transform), scalar); - } - unsafe(point, scalar, transform, prev) { - const W = getW2(point); - if (W === 1) - return this._unsafeLadder(point, scalar, prev); - return this.wNAFUnsafe(W, this.getPrecomputes(W, point, transform), scalar, prev); - } - // We calculate precomputes for elliptic curve point multiplication - // using windowed method. This specifies window size and - // stores precomputed values. Usually only base point would be precomputed. - createCache(P, W) { - validateW2(W, this.bits); - pointWindowSizes2.set(P, W); - pointPrecomputes2.delete(P); - } - hasCache(elm) { - return getW2(elm) !== 1; - } - }; - exports2.wNAF = wNAF2; - function mulEndoUnsafe2(Point, point, k1, k2) { - let acc = point; - let p1 = Point.ZERO; - let p2 = Point.ZERO; - while (k1 > _0n8 || k2 > _0n8) { - if (k1 & _1n8) - p1 = p1.add(acc); - if (k2 & _1n8) - p2 = p2.add(acc); - acc = acc.double(); - k1 >>= _1n8; - k2 >>= _1n8; - } - return { p1, p2 }; - } - function pippenger2(c, fieldN, points, scalars) { - validateMSMPoints2(points, c); - validateMSMScalars2(scalars, fieldN); - const plength = points.length; - const slength = scalars.length; - if (plength !== slength) - throw new Error("arrays of points and scalars must have equal length"); - const zero = c.ZERO; - const wbits = (0, utils_ts_1.bitLen)(BigInt(plength)); - let windowSize = 1; - if (wbits > 12) - windowSize = wbits - 3; - else if (wbits > 4) - windowSize = wbits - 2; - else if (wbits > 0) - windowSize = 2; - const MASK = (0, utils_ts_1.bitMask)(windowSize); - const buckets = new Array(Number(MASK) + 1).fill(zero); - const lastBits = Math.floor((fieldN.BITS - 1) / windowSize) * windowSize; - let sum = zero; - for (let i = lastBits; i >= 0; i -= windowSize) { - buckets.fill(zero); - for (let j = 0; j < slength; j++) { - const scalar = scalars[j]; - const wbits2 = Number(scalar >> BigInt(i) & MASK); - buckets[wbits2] = buckets[wbits2].add(points[j]); - } - let resI = zero; - for (let j = buckets.length - 1, sumI = zero; j > 0; j--) { - sumI = sumI.add(buckets[j]); - resI = resI.add(sumI); - } - sum = sum.add(resI); - if (i !== 0) - for (let j = 0; j < windowSize; j++) - sum = sum.double(); - } - return sum; - } - function precomputeMSMUnsafe(c, fieldN, points, windowSize) { - validateW2(windowSize, fieldN.BITS); - validateMSMPoints2(points, c); - const zero = c.ZERO; - const tableSize = 2 ** windowSize - 1; - const chunks = Math.ceil(fieldN.BITS / windowSize); - const MASK = (0, utils_ts_1.bitMask)(windowSize); - const tables = points.map((p) => { - const res = []; - for (let i = 0, acc = p; i < tableSize; i++) { - res.push(acc); - acc = acc.add(p); - } - return res; - }); - return (scalars) => { - validateMSMScalars2(scalars, fieldN); - if (scalars.length > points.length) - throw new Error("array of scalars must be smaller than array of points"); - let res = zero; - for (let i = 0; i < chunks; i++) { - if (res !== zero) - for (let j = 0; j < windowSize; j++) - res = res.double(); - const shiftBy = BigInt(chunks * windowSize - (i + 1) * windowSize); - for (let j = 0; j < scalars.length; j++) { - const n = scalars[j]; - const curr = Number(n >> shiftBy & MASK); - if (!curr) - continue; - res = res.add(tables[j][curr - 1]); - } - } - return res; - }; - } - function validateBasic(curve) { - (0, modular_ts_1.validateField)(curve.Fp); - (0, utils_ts_1.validateObject)(curve, { - n: "bigint", - h: "bigint", - Gx: "field", - Gy: "field" - }, { - nBitLength: "isSafeInteger", - nByteLength: "isSafeInteger" - }); - return Object.freeze({ - ...(0, modular_ts_1.nLength)(curve.n, curve.nBitLength), - ...curve, - ...{ p: curve.Fp.ORDER } - }); - } - function createField2(order, field, isLE2) { - if (field) { - if (field.ORDER !== order) - throw new Error("Field.ORDER must match order: Fp == p, Fn == n"); - (0, modular_ts_1.validateField)(field); - return field; - } else { - return (0, modular_ts_1.Field)(order, { isLE: isLE2 }); - } - } - function _createCurveFields2(type2, CURVE, curveOpts = {}, FpFnLE) { - if (FpFnLE === void 0) - FpFnLE = type2 === "edwards"; - if (!CURVE || typeof CURVE !== "object") - throw new Error(`expected valid ${type2} CURVE object`); - for (const p of ["p", "n", "h"]) { - const val = CURVE[p]; - if (!(typeof val === "bigint" && val > _0n8)) - throw new Error(`CURVE.${p} must be positive bigint`); - } - const Fp2 = createField2(CURVE.p, curveOpts.Fp, FpFnLE); - const Fn2 = createField2(CURVE.n, curveOpts.Fn, FpFnLE); - const _b = type2 === "weierstrass" ? "b" : "d"; - const params = ["Gx", "Gy", "a", _b]; - for (const p of params) { - if (!Fp2.isValid(CURVE[p])) - throw new Error(`CURVE.${p} must be valid field element of CURVE.Fp`); - } - CURVE = Object.freeze(Object.assign({}, CURVE)); - return { CURVE, Fp: Fp2, Fn: Fn2 }; - } - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/edwards.js -var require_edwards = __commonJS({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/edwards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.PrimeEdwardsPoint = void 0; - exports2.edwards = edwards2; - exports2.eddsa = eddsa2; - exports2.twistedEdwards = twistedEdwards2; - var utils_ts_1 = require_utils4(); - var curve_ts_1 = require_curve(); - var modular_ts_1 = require_modular(); - var _0n8 = BigInt(0); - var _1n8 = BigInt(1); - var _2n7 = BigInt(2); - var _8n4 = BigInt(8); - function isEdValidXY2(Fp2, CURVE, x, y) { - const x2 = Fp2.sqr(x); - const y2 = Fp2.sqr(y); - const left = Fp2.add(Fp2.mul(CURVE.a, x2), y2); - const right = Fp2.add(Fp2.ONE, Fp2.mul(CURVE.d, Fp2.mul(x2, y2))); - return Fp2.eql(left, right); - } - function edwards2(params, extraOpts = {}) { - const validated = (0, curve_ts_1._createCurveFields)("edwards", params, extraOpts, extraOpts.FpFnLE); - const { Fp: Fp2, Fn: Fn2 } = validated; - let CURVE = validated.CURVE; - const { h: cofactor } = CURVE; - (0, utils_ts_1._validateObject)(extraOpts, {}, { uvRatio: "function" }); - const MASK = _2n7 << BigInt(Fn2.BYTES * 8) - _1n8; - const modP = (n) => Fp2.create(n); - const uvRatio2 = extraOpts.uvRatio || ((u, v) => { - try { - return { isValid: true, value: Fp2.sqrt(Fp2.div(u, v)) }; - } catch (e) { - return { isValid: false, value: _0n8 }; - } - }); - if (!isEdValidXY2(Fp2, CURVE, CURVE.Gx, CURVE.Gy)) - throw new Error("bad curve params: generator point"); - function acoord(title, n, banZero = false) { - const min = banZero ? _1n8 : _0n8; - (0, utils_ts_1.aInRange)("coordinate " + title, n, min, MASK); - return n; - } - function aextpoint(other) { - if (!(other instanceof Point)) - throw new Error("ExtendedPoint expected"); - } - const toAffineMemo = (0, utils_ts_1.memoized)((p, iz) => { - const { X, Y, Z } = p; - const is0 = p.is0(); - if (iz == null) - iz = is0 ? _8n4 : Fp2.inv(Z); - const x = modP(X * iz); - const y = modP(Y * iz); - const zz = Fp2.mul(Z, iz); - if (is0) - return { x: _0n8, y: _1n8 }; - if (zz !== _1n8) - throw new Error("invZ was invalid"); - return { x, y }; - }); - const assertValidMemo = (0, utils_ts_1.memoized)((p) => { - const { a, d } = CURVE; - if (p.is0()) - throw new Error("bad point: ZERO"); - const { X, Y, Z, T } = p; - const X2 = modP(X * X); - const Y2 = modP(Y * Y); - const Z2 = modP(Z * Z); - const Z4 = modP(Z2 * Z2); - const aX2 = modP(X2 * a); - const left = modP(Z2 * modP(aX2 + Y2)); - const right = modP(Z4 + modP(d * modP(X2 * Y2))); - if (left !== right) - throw new Error("bad point: equation left != right (1)"); - const XY = modP(X * Y); - const ZT = modP(Z * T); - if (XY !== ZT) - throw new Error("bad point: equation left != right (2)"); - return true; - }); - class Point { - constructor(X, Y, Z, T) { - this.X = acoord("x", X); - this.Y = acoord("y", Y); - this.Z = acoord("z", Z, true); - this.T = acoord("t", T); - Object.freeze(this); - } - static CURVE() { - return CURVE; - } - static fromAffine(p) { - if (p instanceof Point) - throw new Error("extended point not allowed"); - const { x, y } = p || {}; - acoord("x", x); - acoord("y", y); - return new Point(x, y, _1n8, modP(x * y)); - } - // Uses algo from RFC8032 5.1.3. - static fromBytes(bytes, zip215 = false) { - const len = Fp2.BYTES; - const { a, d } = CURVE; - bytes = (0, utils_ts_1.copyBytes)((0, utils_ts_1._abytes2)(bytes, len, "point")); - (0, utils_ts_1._abool2)(zip215, "zip215"); - const normed = (0, utils_ts_1.copyBytes)(bytes); - const lastByte = bytes[len - 1]; - normed[len - 1] = lastByte & ~128; - const y = (0, utils_ts_1.bytesToNumberLE)(normed); - const max = zip215 ? MASK : Fp2.ORDER; - (0, utils_ts_1.aInRange)("point.y", y, _0n8, max); - const y2 = modP(y * y); - const u = modP(y2 - _1n8); - const v = modP(d * y2 - a); - let { isValid, value: x } = uvRatio2(u, v); - if (!isValid) - throw new Error("bad point: invalid y coordinate"); - const isXOdd = (x & _1n8) === _1n8; - const isLastByteOdd = (lastByte & 128) !== 0; - if (!zip215 && x === _0n8 && isLastByteOdd) - throw new Error("bad point: x=0 and x_0=1"); - if (isLastByteOdd !== isXOdd) - x = modP(-x); - return Point.fromAffine({ x, y }); - } - static fromHex(bytes, zip215 = false) { - return Point.fromBytes((0, utils_ts_1.ensureBytes)("point", bytes), zip215); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - precompute(windowSize = 8, isLazy = true) { - wnaf.createCache(this, windowSize); - if (!isLazy) - this.multiply(_2n7); - return this; - } - // Useful in fromAffine() - not for fromBytes(), which always created valid points. - assertValidity() { - assertValidMemo(this); - } - // Compare one point to another. - equals(other) { - aextpoint(other); - const { X: X1, Y: Y1, Z: Z1 } = this; - const { X: X2, Y: Y2, Z: Z2 } = other; - const X1Z2 = modP(X1 * Z2); - const X2Z1 = modP(X2 * Z1); - const Y1Z2 = modP(Y1 * Z2); - const Y2Z1 = modP(Y2 * Z1); - return X1Z2 === X2Z1 && Y1Z2 === Y2Z1; - } - is0() { - return this.equals(Point.ZERO); - } - negate() { - return new Point(modP(-this.X), this.Y, this.Z, modP(-this.T)); - } - // Fast algo for doubling Extended Point. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // Cost: 4M + 4S + 1*a + 6add + 1*2. - double() { - const { a } = CURVE; - const { X: X1, Y: Y1, Z: Z1 } = this; - const A = modP(X1 * X1); - const B = modP(Y1 * Y1); - const C = modP(_2n7 * modP(Z1 * Z1)); - const D = modP(a * A); - const x1y1 = X1 + Y1; - const E = modP(modP(x1y1 * x1y1) - A - B); - const G = D + B; - const F = G - C; - const H = D - B; - const X3 = modP(E * F); - const Y3 = modP(G * H); - const T3 = modP(E * H); - const Z3 = modP(F * G); - return new Point(X3, Y3, Z3, T3); - } - // Fast algo for adding 2 Extended Points. - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // Cost: 9M + 1*a + 1*d + 7add. - add(other) { - aextpoint(other); - const { a, d } = CURVE; - const { X: X1, Y: Y1, Z: Z1, T: T1 } = this; - const { X: X2, Y: Y2, Z: Z2, T: T2 } = other; - const A = modP(X1 * X2); - const B = modP(Y1 * Y2); - const C = modP(T1 * d * T2); - const D = modP(Z1 * Z2); - const E = modP((X1 + Y1) * (X2 + Y2) - A - B); - const F = D - C; - const G = D + C; - const H = modP(B - a * A); - const X3 = modP(E * F); - const Y3 = modP(G * H); - const T3 = modP(E * H); - const Z3 = modP(F * G); - return new Point(X3, Y3, Z3, T3); - } - subtract(other) { - return this.add(other.negate()); - } - // Constant-time multiplication. - multiply(scalar) { - if (!Fn2.isValidNot0(scalar)) - throw new Error("invalid scalar: expected 1 <= sc < curve.n"); - const { p, f } = wnaf.cached(this, scalar, (p2) => (0, curve_ts_1.normalizeZ)(Point, p2)); - return (0, curve_ts_1.normalizeZ)(Point, [p, f])[0]; - } - // Non-constant-time multiplication. Uses double-and-add algorithm. - // It's faster, but should only be used when you don't care about - // an exposed private key e.g. sig verification. - // Does NOT allow scalars higher than CURVE.n. - // Accepts optional accumulator to merge with multiply (important for sparse scalars) - multiplyUnsafe(scalar, acc = Point.ZERO) { - if (!Fn2.isValid(scalar)) - throw new Error("invalid scalar: expected 0 <= sc < curve.n"); - if (scalar === _0n8) - return Point.ZERO; - if (this.is0() || scalar === _1n8) - return this; - return wnaf.unsafe(this, scalar, (p) => (0, curve_ts_1.normalizeZ)(Point, p), acc); - } - // Checks if point is of small order. - // If you add something to small order point, you will have "dirty" - // point with torsion component. - // Multiplies point by cofactor and checks if the result is 0. - isSmallOrder() { - return this.multiplyUnsafe(cofactor).is0(); - } - // Multiplies point by curve order and checks if the result is 0. - // Returns `false` is the point is dirty. - isTorsionFree() { - return wnaf.unsafe(this, CURVE.n).is0(); - } - // Converts Extended point to default (x, y) coordinates. - // Can accept precomputed Z^-1 - for example, from invertBatch. - toAffine(invertedZ) { - return toAffineMemo(this, invertedZ); - } - clearCofactor() { - if (cofactor === _1n8) - return this; - return this.multiplyUnsafe(cofactor); - } - toBytes() { - const { x, y } = this.toAffine(); - const bytes = Fp2.toBytes(y); - bytes[bytes.length - 1] |= x & _1n8 ? 128 : 0; - return bytes; - } - toHex() { - return (0, utils_ts_1.bytesToHex)(this.toBytes()); - } - toString() { - return ``; - } - // TODO: remove - get ex() { - return this.X; - } - get ey() { - return this.Y; - } - get ez() { - return this.Z; - } - get et() { - return this.T; - } - static normalizeZ(points) { - return (0, curve_ts_1.normalizeZ)(Point, points); - } - static msm(points, scalars) { - return (0, curve_ts_1.pippenger)(Point, Fn2, points, scalars); - } - _setWindowSize(windowSize) { - this.precompute(windowSize); - } - toRawBytes() { - return this.toBytes(); - } - } - Point.BASE = new Point(CURVE.Gx, CURVE.Gy, _1n8, modP(CURVE.Gx * CURVE.Gy)); - Point.ZERO = new Point(_0n8, _1n8, _1n8, _0n8); - Point.Fp = Fp2; - Point.Fn = Fn2; - const wnaf = new curve_ts_1.wNAF(Point, Fn2.BITS); - Point.BASE.precompute(8); - return Point; - } - var PrimeEdwardsPoint2 = class { - constructor(ep) { - this.ep = ep; - } - // Static methods that must be implemented by subclasses - static fromBytes(_bytes) { - (0, utils_ts_1.notImplemented)(); - } - static fromHex(_hex) { - (0, utils_ts_1.notImplemented)(); - } - get x() { - return this.toAffine().x; - } - get y() { - return this.toAffine().y; - } - // Common implementations - clearCofactor() { - return this; - } - assertValidity() { - this.ep.assertValidity(); - } - toAffine(invertedZ) { - return this.ep.toAffine(invertedZ); - } - toHex() { - return (0, utils_ts_1.bytesToHex)(this.toBytes()); - } - toString() { - return this.toHex(); - } - isTorsionFree() { - return true; - } - isSmallOrder() { - return false; - } - add(other) { - this.assertSame(other); - return this.init(this.ep.add(other.ep)); - } - subtract(other) { - this.assertSame(other); - return this.init(this.ep.subtract(other.ep)); - } - multiply(scalar) { - return this.init(this.ep.multiply(scalar)); - } - multiplyUnsafe(scalar) { - return this.init(this.ep.multiplyUnsafe(scalar)); - } - double() { - return this.init(this.ep.double()); - } - negate() { - return this.init(this.ep.negate()); - } - precompute(windowSize, isLazy) { - return this.init(this.ep.precompute(windowSize, isLazy)); - } - /** @deprecated use `toBytes` */ - toRawBytes() { - return this.toBytes(); - } - }; - exports2.PrimeEdwardsPoint = PrimeEdwardsPoint2; - function eddsa2(Point, cHash, eddsaOpts = {}) { - if (typeof cHash !== "function") - throw new Error('"hash" function param is required'); - (0, utils_ts_1._validateObject)(eddsaOpts, {}, { - adjustScalarBytes: "function", - randomBytes: "function", - domain: "function", - prehash: "function", - mapToCurve: "function" - }); - const { prehash } = eddsaOpts; - const { BASE, Fp: Fp2, Fn: Fn2 } = Point; - const randomBytes3 = eddsaOpts.randomBytes || utils_ts_1.randomBytes; - const adjustScalarBytes2 = eddsaOpts.adjustScalarBytes || ((bytes) => bytes); - const domain = eddsaOpts.domain || ((data, ctx, phflag) => { - (0, utils_ts_1._abool2)(phflag, "phflag"); - if (ctx.length || phflag) - throw new Error("Contexts/pre-hash are not supported"); - return data; - }); - function modN_LE(hash) { - return Fn2.create((0, utils_ts_1.bytesToNumberLE)(hash)); - } - function getPrivateScalar(key) { - const len = lengths.secretKey; - key = (0, utils_ts_1.ensureBytes)("private key", key, len); - const hashed = (0, utils_ts_1.ensureBytes)("hashed private key", cHash(key), 2 * len); - const head = adjustScalarBytes2(hashed.slice(0, len)); - const prefix = hashed.slice(len, 2 * len); - const scalar = modN_LE(head); - return { head, prefix, scalar }; - } - function getExtendedPublicKey(secretKey) { - const { head, prefix, scalar } = getPrivateScalar(secretKey); - const point = BASE.multiply(scalar); - const pointBytes = point.toBytes(); - return { head, prefix, scalar, point, pointBytes }; - } - function getPublicKey2(secretKey) { - return getExtendedPublicKey(secretKey).pointBytes; - } - function hashDomainToScalar(context = Uint8Array.of(), ...msgs) { - const msg = (0, utils_ts_1.concatBytes)(...msgs); - return modN_LE(cHash(domain(msg, (0, utils_ts_1.ensureBytes)("context", context), !!prehash))); - } - function sign2(msg, secretKey, options = {}) { - msg = (0, utils_ts_1.ensureBytes)("message", msg); - if (prehash) - msg = prehash(msg); - const { prefix, scalar, pointBytes } = getExtendedPublicKey(secretKey); - const r = hashDomainToScalar(options.context, prefix, msg); - const R = BASE.multiply(r).toBytes(); - const k = hashDomainToScalar(options.context, R, pointBytes, msg); - const s = Fn2.create(r + k * scalar); - if (!Fn2.isValid(s)) - throw new Error("sign failed: invalid s"); - const rs = (0, utils_ts_1.concatBytes)(R, Fn2.toBytes(s)); - return (0, utils_ts_1._abytes2)(rs, lengths.signature, "result"); - } - const verifyOpts = { zip215: true }; - function verify2(sig, msg, publicKey2, options = verifyOpts) { - const { context, zip215 } = options; - const len = lengths.signature; - sig = (0, utils_ts_1.ensureBytes)("signature", sig, len); - msg = (0, utils_ts_1.ensureBytes)("message", msg); - publicKey2 = (0, utils_ts_1.ensureBytes)("publicKey", publicKey2, lengths.publicKey); - if (zip215 !== void 0) - (0, utils_ts_1._abool2)(zip215, "zip215"); - if (prehash) - msg = prehash(msg); - const mid = len / 2; - const r = sig.subarray(0, mid); - const s = (0, utils_ts_1.bytesToNumberLE)(sig.subarray(mid, len)); - let A, R, SB; - try { - A = Point.fromBytes(publicKey2, zip215); - R = Point.fromBytes(r, zip215); - SB = BASE.multiplyUnsafe(s); - } catch (error) { - return false; - } - if (!zip215 && A.isSmallOrder()) - return false; - const k = hashDomainToScalar(context, R.toBytes(), A.toBytes(), msg); - const RkA = R.add(A.multiplyUnsafe(k)); - return RkA.subtract(SB).clearCofactor().is0(); - } - const _size = Fp2.BYTES; - const lengths = { - secretKey: _size, - publicKey: _size, - signature: 2 * _size, - seed: _size - }; - function randomSecretKey(seed = randomBytes3(lengths.seed)) { - return (0, utils_ts_1._abytes2)(seed, lengths.seed, "seed"); - } - function keygen(seed) { - const secretKey = utils.randomSecretKey(seed); - return { secretKey, publicKey: getPublicKey2(secretKey) }; - } - function isValidSecretKey(key) { - return (0, utils_ts_1.isBytes)(key) && key.length === Fn2.BYTES; - } - function isValidPublicKey2(key, zip215) { - try { - return !!Point.fromBytes(key, zip215); - } catch (error) { - return false; - } - } - const utils = { - getExtendedPublicKey, - randomSecretKey, - isValidSecretKey, - isValidPublicKey: isValidPublicKey2, - /** - * Converts ed public key to x public key. Uses formula: - * - ed25519: - * - `(u, v) = ((1+y)/(1-y), sqrt(-486664)*u/x)` - * - `(x, y) = (sqrt(-486664)*u/v, (u-1)/(u+1))` - * - ed448: - * - `(u, v) = ((y-1)/(y+1), sqrt(156324)*u/x)` - * - `(x, y) = (sqrt(156324)*u/v, (1+u)/(1-u))` - */ - toMontgomery(publicKey2) { - const { y } = Point.fromBytes(publicKey2); - const size = lengths.publicKey; - const is25519 = size === 32; - if (!is25519 && size !== 57) - throw new Error("only defined for 25519 and 448"); - const u = is25519 ? Fp2.div(_1n8 + y, _1n8 - y) : Fp2.div(y - _1n8, y + _1n8); - return Fp2.toBytes(u); - }, - toMontgomerySecret(secretKey) { - const size = lengths.secretKey; - (0, utils_ts_1._abytes2)(secretKey, size); - const hashed = cHash(secretKey.subarray(0, size)); - return adjustScalarBytes2(hashed).subarray(0, size); - }, - /** @deprecated */ - randomPrivateKey: randomSecretKey, - /** @deprecated */ - precompute(windowSize = 8, point = Point.BASE) { - return point.precompute(windowSize, false); - } - }; - return Object.freeze({ - keygen, - getPublicKey: getPublicKey2, - sign: sign2, - verify: verify2, - utils, - Point, - lengths - }); - } - function _eddsa_legacy_opts_to_new2(c) { - const CURVE = { - a: c.a, - d: c.d, - p: c.Fp.ORDER, - n: c.n, - h: c.h, - Gx: c.Gx, - Gy: c.Gy - }; - const Fp2 = c.Fp; - const Fn2 = (0, modular_ts_1.Field)(CURVE.n, c.nBitLength, true); - const curveOpts = { Fp: Fp2, Fn: Fn2, uvRatio: c.uvRatio }; - const eddsaOpts = { - randomBytes: c.randomBytes, - adjustScalarBytes: c.adjustScalarBytes, - domain: c.domain, - prehash: c.prehash, - mapToCurve: c.mapToCurve - }; - return { CURVE, curveOpts, hash: c.hash, eddsaOpts }; - } - function _eddsa_new_output_to_legacy2(c, eddsa3) { - const Point = eddsa3.Point; - const legacy = Object.assign({}, eddsa3, { - ExtendedPoint: Point, - CURVE: c, - nBitLength: Point.Fn.BITS, - nByteLength: Point.Fn.BYTES - }); - return legacy; - } - function twistedEdwards2(c) { - const { CURVE, curveOpts, hash, eddsaOpts } = _eddsa_legacy_opts_to_new2(c); - const Point = edwards2(CURVE, curveOpts); - const EDDSA = eddsa2(Point, hash, eddsaOpts); - return _eddsa_new_output_to_legacy2(c, EDDSA); - } - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/hash-to-curve.js -var require_hash_to_curve = __commonJS({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/hash-to-curve.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._DST_scalar = void 0; - exports2.expand_message_xmd = expand_message_xmd; - exports2.expand_message_xof = expand_message_xof; - exports2.hash_to_field = hash_to_field; - exports2.isogenyMap = isogenyMap; - exports2.createHasher = createHasher2; - var utils_ts_1 = require_utils4(); - var modular_ts_1 = require_modular(); - var os2ip = utils_ts_1.bytesToNumberBE; - function i2osp(value, length) { - anum(value); - anum(length); - if (value < 0 || value >= 1 << 8 * length) - throw new Error("invalid I2OSP input: " + value); - const res = Array.from({ length }).fill(0); - for (let i = length - 1; i >= 0; i--) { - res[i] = value & 255; - value >>>= 8; - } - return new Uint8Array(res); - } - function strxor(a, b) { - const arr = new Uint8Array(a.length); - for (let i = 0; i < a.length; i++) { - arr[i] = a[i] ^ b[i]; - } - return arr; - } - function anum(item) { - if (!Number.isSafeInteger(item)) - throw new Error("number expected"); - } - function normDST(DST) { - if (!(0, utils_ts_1.isBytes)(DST) && typeof DST !== "string") - throw new Error("DST must be Uint8Array or string"); - return typeof DST === "string" ? (0, utils_ts_1.utf8ToBytes)(DST) : DST; - } - function expand_message_xmd(msg, DST, lenInBytes, H) { - (0, utils_ts_1.abytes)(msg); - anum(lenInBytes); - DST = normDST(DST); - if (DST.length > 255) - DST = H((0, utils_ts_1.concatBytes)((0, utils_ts_1.utf8ToBytes)("H2C-OVERSIZE-DST-"), DST)); - const { outputLen: b_in_bytes, blockLen: r_in_bytes } = H; - const ell = Math.ceil(lenInBytes / b_in_bytes); - if (lenInBytes > 65535 || ell > 255) - throw new Error("expand_message_xmd: invalid lenInBytes"); - const DST_prime = (0, utils_ts_1.concatBytes)(DST, i2osp(DST.length, 1)); - const Z_pad = i2osp(0, r_in_bytes); - const l_i_b_str = i2osp(lenInBytes, 2); - const b = new Array(ell); - const b_0 = H((0, utils_ts_1.concatBytes)(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime)); - b[0] = H((0, utils_ts_1.concatBytes)(b_0, i2osp(1, 1), DST_prime)); - for (let i = 1; i <= ell; i++) { - const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime]; - b[i] = H((0, utils_ts_1.concatBytes)(...args)); - } - const pseudo_random_bytes = (0, utils_ts_1.concatBytes)(...b); - return pseudo_random_bytes.slice(0, lenInBytes); - } - function expand_message_xof(msg, DST, lenInBytes, k, H) { - (0, utils_ts_1.abytes)(msg); - anum(lenInBytes); - DST = normDST(DST); - if (DST.length > 255) { - const dkLen = Math.ceil(2 * k / 8); - DST = H.create({ dkLen }).update((0, utils_ts_1.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(DST).digest(); - } - if (lenInBytes > 65535 || DST.length > 255) - throw new Error("expand_message_xof: invalid lenInBytes"); - return H.create({ dkLen: lenInBytes }).update(msg).update(i2osp(lenInBytes, 2)).update(DST).update(i2osp(DST.length, 1)).digest(); - } - function hash_to_field(msg, count, options) { - (0, utils_ts_1._validateObject)(options, { - p: "bigint", - m: "number", - k: "number", - hash: "function" - }); - const { p, k, m, hash, expand, DST } = options; - if (!(0, utils_ts_1.isHash)(options.hash)) - throw new Error("expected valid hash"); - (0, utils_ts_1.abytes)(msg); - anum(count); - const log2p = p.toString(2).length; - const L = Math.ceil((log2p + k) / 8); - const len_in_bytes = count * m * L; - let prb; - if (expand === "xmd") { - prb = expand_message_xmd(msg, DST, len_in_bytes, hash); - } else if (expand === "xof") { - prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } else if (expand === "_internal_pass") { - prb = msg; - } else { - throw new Error('expand must be "xmd" or "xof"'); - } - const u = new Array(count); - for (let i = 0; i < count; i++) { - const e = new Array(m); - for (let j = 0; j < m; j++) { - const elm_offset = L * (j + i * m); - const tv = prb.subarray(elm_offset, elm_offset + L); - e[j] = (0, modular_ts_1.mod)(os2ip(tv), p); - } - u[i] = e; - } - return u; - } - function isogenyMap(field, map) { - const coeff = map.map((i) => Array.from(i).reverse()); - return (x, y) => { - const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i))); - const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(field, [xd, yd], true); - x = field.mul(xn, xd_inv); - y = field.mul(y, field.mul(yn, yd_inv)); - return { x, y }; - }; - } - exports2._DST_scalar = (0, utils_ts_1.utf8ToBytes)("HashToScalar-"); - function createHasher2(Point, mapToCurve, defaults) { - if (typeof mapToCurve !== "function") - throw new Error("mapToCurve() must be defined"); - function map(num) { - return Point.fromAffine(mapToCurve(num)); - } - function clear(initial) { - const P = initial.clearCofactor(); - if (P.equals(Point.ZERO)) - return Point.ZERO; - P.assertValidity(); - return P; - } - return { - defaults, - hashToCurve(msg, options) { - const opts = Object.assign({}, defaults, options); - const u = hash_to_field(msg, 2, opts); - const u0 = map(u[0]); - const u1 = map(u[1]); - return clear(u0.add(u1)); - }, - encodeToCurve(msg, options) { - const optsDst = defaults.encodeDST ? { DST: defaults.encodeDST } : {}; - const opts = Object.assign({}, defaults, optsDst, options); - const u = hash_to_field(msg, 1, opts); - const u0 = map(u[0]); - return clear(u0); - }, - /** See {@link H2CHasher} */ - mapToCurve(scalars) { - if (!Array.isArray(scalars)) - throw new Error("expected array of bigints"); - for (const i of scalars) - if (typeof i !== "bigint") - throw new Error("expected array of bigints"); - return clear(map(scalars)); - }, - // hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393 - // RFC 9380, draft-irtf-cfrg-bbs-signatures-08 - hashToScalar(msg, options) { - const N = Point.Fn.ORDER; - const opts = Object.assign({}, defaults, { p: N, m: 1, DST: exports2._DST_scalar }, options); - return hash_to_field(msg, 1, opts)[0][0]; - } - }; - } - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/montgomery.js -var require_montgomery = __commonJS({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/abstract/montgomery.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.montgomery = montgomery; - var utils_ts_1 = require_utils4(); - var modular_ts_1 = require_modular(); - var _0n8 = BigInt(0); - var _1n8 = BigInt(1); - var _2n7 = BigInt(2); - function validateOpts(curve) { - (0, utils_ts_1._validateObject)(curve, { - adjustScalarBytes: "function", - powPminus2: "function" - }); - return Object.freeze({ ...curve }); - } - function montgomery(curveDef) { - const CURVE = validateOpts(curveDef); - const { P, type: type2, adjustScalarBytes: adjustScalarBytes2, powPminus2, randomBytes: rand } = CURVE; - const is25519 = type2 === "x25519"; - if (!is25519 && type2 !== "x448") - throw new Error("invalid type"); - const randomBytes_ = rand || utils_ts_1.randomBytes; - const montgomeryBits = is25519 ? 255 : 448; - const fieldLen = is25519 ? 32 : 56; - const Gu = is25519 ? BigInt(9) : BigInt(5); - const a24 = is25519 ? BigInt(121665) : BigInt(39081); - const minScalar = is25519 ? _2n7 ** BigInt(254) : _2n7 ** BigInt(447); - const maxAdded = is25519 ? BigInt(8) * _2n7 ** BigInt(251) - _1n8 : BigInt(4) * _2n7 ** BigInt(445) - _1n8; - const maxScalar = minScalar + maxAdded + _1n8; - const modP = (n) => (0, modular_ts_1.mod)(n, P); - const GuBytes = encodeU(Gu); - function encodeU(u) { - return (0, utils_ts_1.numberToBytesLE)(modP(u), fieldLen); - } - function decodeU(u) { - const _u = (0, utils_ts_1.ensureBytes)("u coordinate", u, fieldLen); - if (is25519) - _u[31] &= 127; - return modP((0, utils_ts_1.bytesToNumberLE)(_u)); - } - function decodeScalar(scalar) { - return (0, utils_ts_1.bytesToNumberLE)(adjustScalarBytes2((0, utils_ts_1.ensureBytes)("scalar", scalar, fieldLen))); - } - function scalarMult(scalar, u) { - const pu = montgomeryLadder(decodeU(u), decodeScalar(scalar)); - if (pu === _0n8) - throw new Error("invalid private or public key received"); - return encodeU(pu); - } - function scalarMultBase(scalar) { - return scalarMult(scalar, GuBytes); - } - function cswap(swap, x_2, x_3) { - const dummy = modP(swap * (x_2 - x_3)); - x_2 = modP(x_2 - dummy); - x_3 = modP(x_3 + dummy); - return { x_2, x_3 }; - } - function montgomeryLadder(u, scalar) { - (0, utils_ts_1.aInRange)("u", u, _0n8, P); - (0, utils_ts_1.aInRange)("scalar", scalar, minScalar, maxScalar); - const k = scalar; - const x_1 = u; - let x_2 = _1n8; - let z_2 = _0n8; - let x_3 = u; - let z_3 = _1n8; - let swap = _0n8; - for (let t = BigInt(montgomeryBits - 1); t >= _0n8; t--) { - const k_t = k >> t & _1n8; - swap ^= k_t; - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - swap = k_t; - const A = x_2 + z_2; - const AA = modP(A * A); - const B = x_2 - z_2; - const BB = modP(B * B); - const E = AA - BB; - const C = x_3 + z_3; - const D = x_3 - z_3; - const DA = modP(D * A); - const CB = modP(C * B); - const dacb = DA + CB; - const da_cb = DA - CB; - x_3 = modP(dacb * dacb); - z_3 = modP(x_1 * modP(da_cb * da_cb)); - x_2 = modP(AA * BB); - z_2 = modP(E * (AA + modP(a24 * E))); - } - ({ x_2, x_3 } = cswap(swap, x_2, x_3)); - ({ x_2: z_2, x_3: z_3 } = cswap(swap, z_2, z_3)); - const z2 = powPminus2(z_2); - return modP(x_2 * z2); - } - const lengths = { - secretKey: fieldLen, - publicKey: fieldLen, - seed: fieldLen - }; - const randomSecretKey = (seed = randomBytes_(fieldLen)) => { - (0, utils_ts_1.abytes)(seed, lengths.seed); - return seed; - }; - function keygen(seed) { - const secretKey = randomSecretKey(seed); - return { secretKey, publicKey: scalarMultBase(secretKey) }; - } - const utils = { - randomSecretKey, - randomPrivateKey: randomSecretKey - }; - return { - keygen, - getSharedSecret: (secretKey, publicKey2) => scalarMult(secretKey, publicKey2), - getPublicKey: (secretKey) => scalarMultBase(secretKey), - scalarMult, - scalarMultBase, - utils, - GuBytes: GuBytes.slice(), - lengths - }; - } - } -}); - -// ../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/ed25519.js -var require_ed25519 = __commonJS({ - "../../node_modules/.pnpm/@noble+curves@1.9.7/node_modules/@noble/curves/ed25519.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hash_to_ristretto255 = exports2.hashToRistretto255 = exports2.encodeToCurve = exports2.hashToCurve = exports2.RistrettoPoint = exports2.edwardsToMontgomery = exports2.ED25519_TORSION_SUBGROUP = exports2.ristretto255_hasher = exports2.ristretto255 = exports2.ed25519_hasher = exports2.x25519 = exports2.ed25519ph = exports2.ed25519ctx = exports2.ed25519 = void 0; - exports2.edwardsToMontgomeryPub = edwardsToMontgomeryPub; - exports2.edwardsToMontgomeryPriv = edwardsToMontgomeryPriv; - var sha2_js_1 = require_sha2(); - var utils_js_1 = require_utils2(); - var curve_ts_1 = require_curve(); - var edwards_ts_1 = require_edwards(); - var hash_to_curve_ts_1 = require_hash_to_curve(); - var modular_ts_1 = require_modular(); - var montgomery_ts_1 = require_montgomery(); - var utils_ts_1 = require_utils4(); - var _0n8 = /* @__PURE__ */ BigInt(0); - var _1n8 = BigInt(1); - var _2n7 = BigInt(2); - var _3n4 = BigInt(3); - var _5n3 = BigInt(5); - var _8n4 = BigInt(8); - var ed25519_CURVE_p2 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"); - var ed25519_CURVE2 = /* @__PURE__ */ (() => ({ - p: ed25519_CURVE_p2, - n: BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"), - h: _8n4, - a: BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"), - d: BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"), - Gx: BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"), - Gy: BigInt("0x6666666666666666666666666666666666666666666666666666666666666658") - }))(); - function ed25519_pow_2_252_32(x) { - const _10n = BigInt(10), _20n = BigInt(20), _40n = BigInt(40), _80n = BigInt(80); - const P = ed25519_CURVE_p2; - const x2 = x * x % P; - const b2 = x2 * x % P; - const b4 = (0, modular_ts_1.pow2)(b2, _2n7, P) * b2 % P; - const b5 = (0, modular_ts_1.pow2)(b4, _1n8, P) * x % P; - const b10 = (0, modular_ts_1.pow2)(b5, _5n3, P) * b5 % P; - const b20 = (0, modular_ts_1.pow2)(b10, _10n, P) * b10 % P; - const b40 = (0, modular_ts_1.pow2)(b20, _20n, P) * b20 % P; - const b80 = (0, modular_ts_1.pow2)(b40, _40n, P) * b40 % P; - const b160 = (0, modular_ts_1.pow2)(b80, _80n, P) * b80 % P; - const b240 = (0, modular_ts_1.pow2)(b160, _80n, P) * b80 % P; - const b250 = (0, modular_ts_1.pow2)(b240, _10n, P) * b10 % P; - const pow_p_5_8 = (0, modular_ts_1.pow2)(b250, _2n7, P) * x % P; - return { pow_p_5_8, b2 }; - } - function adjustScalarBytes2(bytes) { - bytes[0] &= 248; - bytes[31] &= 127; - bytes[31] |= 64; - return bytes; - } - var ED25519_SQRT_M12 = /* @__PURE__ */ BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"); - function uvRatio2(u, v) { - const P = ed25519_CURVE_p2; - const v32 = (0, modular_ts_1.mod)(v * v * v, P); - const v7 = (0, modular_ts_1.mod)(v32 * v32 * v, P); - const pow = ed25519_pow_2_252_32(u * v7).pow_p_5_8; - let x = (0, modular_ts_1.mod)(u * v32 * pow, P); - const vx2 = (0, modular_ts_1.mod)(v * x * x, P); - const root1 = x; - const root2 = (0, modular_ts_1.mod)(x * ED25519_SQRT_M12, P); - const useRoot1 = vx2 === u; - const useRoot2 = vx2 === (0, modular_ts_1.mod)(-u, P); - const noRoot = vx2 === (0, modular_ts_1.mod)(-u * ED25519_SQRT_M12, P); - if (useRoot1) - x = root1; - if (useRoot2 || noRoot) - x = root2; - if ((0, modular_ts_1.isNegativeLE)(x, P)) - x = (0, modular_ts_1.mod)(-x, P); - return { isValid: useRoot1 || useRoot2, value: x }; - } - var Fp2 = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed25519_CURVE2.p, { isLE: true }))(); - var Fn2 = /* @__PURE__ */ (() => (0, modular_ts_1.Field)(ed25519_CURVE2.n, { isLE: true }))(); - var ed25519Defaults2 = /* @__PURE__ */ (() => ({ - ...ed25519_CURVE2, - Fp: Fp2, - hash: sha2_js_1.sha512, - adjustScalarBytes: adjustScalarBytes2, - // dom2 - // Ratio of u to v. Allows us to combine inversion and square root. Uses algo from RFC8032 5.1.3. - // Constant-time, u/√v - uvRatio: uvRatio2 - }))(); - exports2.ed25519 = (() => (0, edwards_ts_1.twistedEdwards)(ed25519Defaults2))(); - function ed25519_domain(data, ctx, phflag) { - if (ctx.length > 255) - throw new Error("Context is too big"); - return (0, utils_js_1.concatBytes)((0, utils_js_1.utf8ToBytes)("SigEd25519 no Ed25519 collisions"), new Uint8Array([phflag ? 1 : 0, ctx.length]), ctx, data); - } - exports2.ed25519ctx = (() => (0, edwards_ts_1.twistedEdwards)({ - ...ed25519Defaults2, - domain: ed25519_domain - }))(); - exports2.ed25519ph = (() => (0, edwards_ts_1.twistedEdwards)(Object.assign({}, ed25519Defaults2, { - domain: ed25519_domain, - prehash: sha2_js_1.sha512 - })))(); - exports2.x25519 = (() => { - const P = Fp2.ORDER; - return (0, montgomery_ts_1.montgomery)({ - P, - type: "x25519", - powPminus2: (x) => { - const { pow_p_5_8, b2 } = ed25519_pow_2_252_32(x); - return (0, modular_ts_1.mod)((0, modular_ts_1.pow2)(pow_p_5_8, _3n4, P) * b2, P); - }, - adjustScalarBytes: adjustScalarBytes2 - }); - })(); - var ELL2_C1 = /* @__PURE__ */ (() => (ed25519_CURVE_p2 + _3n4) / _8n4)(); - var ELL2_C2 = /* @__PURE__ */ (() => Fp2.pow(_2n7, ELL2_C1))(); - var ELL2_C3 = /* @__PURE__ */ (() => Fp2.sqrt(Fp2.neg(Fp2.ONE)))(); - function map_to_curve_elligator2_curve25519(u) { - const ELL2_C4 = (ed25519_CURVE_p2 - _5n3) / _8n4; - const ELL2_J = BigInt(486662); - let tv1 = Fp2.sqr(u); - tv1 = Fp2.mul(tv1, _2n7); - let xd = Fp2.add(tv1, Fp2.ONE); - let x1n = Fp2.neg(ELL2_J); - let tv2 = Fp2.sqr(xd); - let gxd = Fp2.mul(tv2, xd); - let gx1 = Fp2.mul(tv1, ELL2_J); - gx1 = Fp2.mul(gx1, x1n); - gx1 = Fp2.add(gx1, tv2); - gx1 = Fp2.mul(gx1, x1n); - let tv3 = Fp2.sqr(gxd); - tv2 = Fp2.sqr(tv3); - tv3 = Fp2.mul(tv3, gxd); - tv3 = Fp2.mul(tv3, gx1); - tv2 = Fp2.mul(tv2, tv3); - let y11 = Fp2.pow(tv2, ELL2_C4); - y11 = Fp2.mul(y11, tv3); - let y12 = Fp2.mul(y11, ELL2_C3); - tv2 = Fp2.sqr(y11); - tv2 = Fp2.mul(tv2, gxd); - let e1 = Fp2.eql(tv2, gx1); - let y1 = Fp2.cmov(y12, y11, e1); - let x2n = Fp2.mul(x1n, tv1); - let y21 = Fp2.mul(y11, u); - y21 = Fp2.mul(y21, ELL2_C2); - let y22 = Fp2.mul(y21, ELL2_C3); - let gx2 = Fp2.mul(gx1, tv1); - tv2 = Fp2.sqr(y21); - tv2 = Fp2.mul(tv2, gxd); - let e2 = Fp2.eql(tv2, gx2); - let y2 = Fp2.cmov(y22, y21, e2); - tv2 = Fp2.sqr(y1); - tv2 = Fp2.mul(tv2, gxd); - let e3 = Fp2.eql(tv2, gx1); - let xn = Fp2.cmov(x2n, x1n, e3); - let y = Fp2.cmov(y2, y1, e3); - let e4 = Fp2.isOdd(y); - y = Fp2.cmov(y, Fp2.neg(y), e3 !== e4); - return { xMn: xn, xMd: xd, yMn: y, yMd: _1n8 }; - } - var ELL2_C1_EDWARDS = /* @__PURE__ */ (() => (0, modular_ts_1.FpSqrtEven)(Fp2, Fp2.neg(BigInt(486664))))(); - function map_to_curve_elligator2_edwards25519(u) { - const { xMn, xMd, yMn, yMd } = map_to_curve_elligator2_curve25519(u); - let xn = Fp2.mul(xMn, yMd); - xn = Fp2.mul(xn, ELL2_C1_EDWARDS); - let xd = Fp2.mul(xMd, yMn); - let yn = Fp2.sub(xMn, xMd); - let yd = Fp2.add(xMn, xMd); - let tv1 = Fp2.mul(xd, yd); - let e = Fp2.eql(tv1, Fp2.ZERO); - xn = Fp2.cmov(xn, Fp2.ZERO, e); - xd = Fp2.cmov(xd, Fp2.ONE, e); - yn = Fp2.cmov(yn, Fp2.ONE, e); - yd = Fp2.cmov(yd, Fp2.ONE, e); - const [xd_inv, yd_inv] = (0, modular_ts_1.FpInvertBatch)(Fp2, [xd, yd], true); - return { x: Fp2.mul(xn, xd_inv), y: Fp2.mul(yn, yd_inv) }; - } - exports2.ed25519_hasher = (() => (0, hash_to_curve_ts_1.createHasher)(exports2.ed25519.Point, (scalars) => map_to_curve_elligator2_edwards25519(scalars[0]), { - DST: "edwards25519_XMD:SHA-512_ELL2_RO_", - encodeDST: "edwards25519_XMD:SHA-512_ELL2_NU_", - p: ed25519_CURVE_p2, - m: 1, - k: 128, - expand: "xmd", - hash: sha2_js_1.sha512 - }))(); - var SQRT_M12 = ED25519_SQRT_M12; - var SQRT_AD_MINUS_ONE2 = /* @__PURE__ */ BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"); - var INVSQRT_A_MINUS_D2 = /* @__PURE__ */ BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"); - var ONE_MINUS_D_SQ2 = /* @__PURE__ */ BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"); - var D_MINUS_ONE_SQ2 = /* @__PURE__ */ BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"); - var invertSqrt2 = (number2) => uvRatio2(_1n8, number2); - var MAX_255B2 = /* @__PURE__ */ BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - var bytes255ToNumberLE2 = (bytes) => exports2.ed25519.Point.Fp.create((0, utils_ts_1.bytesToNumberLE)(bytes) & MAX_255B2); - function calcElligatorRistrettoMap2(r0) { - const { d } = ed25519_CURVE2; - const P = ed25519_CURVE_p2; - const mod2 = (n) => Fp2.create(n); - const r = mod2(SQRT_M12 * r0 * r0); - const Ns = mod2((r + _1n8) * ONE_MINUS_D_SQ2); - let c = BigInt(-1); - const D = mod2((c - d * r) * mod2(r + d)); - let { isValid: Ns_D_is_sq, value: s } = uvRatio2(Ns, D); - let s_ = mod2(s * r0); - if (!(0, modular_ts_1.isNegativeLE)(s_, P)) - s_ = mod2(-s_); - if (!Ns_D_is_sq) - s = s_; - if (!Ns_D_is_sq) - c = r; - const Nt = mod2(c * (r - _1n8) * D_MINUS_ONE_SQ2 - D); - const s2 = s * s; - const W0 = mod2((s + s) * D); - const W1 = mod2(Nt * SQRT_AD_MINUS_ONE2); - const W2 = mod2(_1n8 - s2); - const W3 = mod2(_1n8 + s2); - return new exports2.ed25519.Point(mod2(W0 * W3), mod2(W2 * W1), mod2(W1 * W3), mod2(W0 * W2)); - } - function ristretto255_map2(bytes) { - (0, utils_js_1.abytes)(bytes, 64); - const r1 = bytes255ToNumberLE2(bytes.subarray(0, 32)); - const R1 = calcElligatorRistrettoMap2(r1); - const r2 = bytes255ToNumberLE2(bytes.subarray(32, 64)); - const R2 = calcElligatorRistrettoMap2(r2); - return new _RistrettoPoint2(R1.add(R2)); - } - var _RistrettoPoint2 = class __RistrettoPoint extends edwards_ts_1.PrimeEdwardsPoint { - constructor(ep) { - super(ep); - } - static fromAffine(ap) { - return new __RistrettoPoint(exports2.ed25519.Point.fromAffine(ap)); - } - assertSame(other) { - if (!(other instanceof __RistrettoPoint)) - throw new Error("RistrettoPoint expected"); - } - init(ep) { - return new __RistrettoPoint(ep); - } - /** @deprecated use `import { ristretto255_hasher } from '@noble/curves/ed25519.js';` */ - static hashToCurve(hex) { - return ristretto255_map2((0, utils_ts_1.ensureBytes)("ristrettoHash", hex, 64)); - } - static fromBytes(bytes) { - (0, utils_js_1.abytes)(bytes, 32); - const { a, d } = ed25519_CURVE2; - const P = ed25519_CURVE_p2; - const mod2 = (n) => Fp2.create(n); - const s = bytes255ToNumberLE2(bytes); - if (!(0, utils_ts_1.equalBytes)(Fp2.toBytes(s), bytes) || (0, modular_ts_1.isNegativeLE)(s, P)) - throw new Error("invalid ristretto255 encoding 1"); - const s2 = mod2(s * s); - const u1 = mod2(_1n8 + a * s2); - const u2 = mod2(_1n8 - a * s2); - const u1_2 = mod2(u1 * u1); - const u2_2 = mod2(u2 * u2); - const v = mod2(a * d * u1_2 - u2_2); - const { isValid, value: I } = invertSqrt2(mod2(v * u2_2)); - const Dx = mod2(I * u2); - const Dy = mod2(I * Dx * v); - let x = mod2((s + s) * Dx); - if ((0, modular_ts_1.isNegativeLE)(x, P)) - x = mod2(-x); - const y = mod2(u1 * Dy); - const t = mod2(x * y); - if (!isValid || (0, modular_ts_1.isNegativeLE)(t, P) || y === _0n8) - throw new Error("invalid ristretto255 encoding 2"); - return new __RistrettoPoint(new exports2.ed25519.Point(x, y, _1n8, t)); - } - /** - * Converts ristretto-encoded string to ristretto point. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-decode). - * @param hex Ristretto-encoded 32 bytes. Not every 32-byte string is valid ristretto encoding - */ - static fromHex(hex) { - return __RistrettoPoint.fromBytes((0, utils_ts_1.ensureBytes)("ristrettoHex", hex, 32)); - } - static msm(points, scalars) { - return (0, curve_ts_1.pippenger)(__RistrettoPoint, exports2.ed25519.Point.Fn, points, scalars); - } - /** - * Encodes ristretto point to Uint8Array. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-encode). - */ - toBytes() { - let { X, Y, Z, T } = this.ep; - const P = ed25519_CURVE_p2; - const mod2 = (n) => Fp2.create(n); - const u1 = mod2(mod2(Z + Y) * mod2(Z - Y)); - const u2 = mod2(X * Y); - const u2sq = mod2(u2 * u2); - const { value: invsqrt } = invertSqrt2(mod2(u1 * u2sq)); - const D1 = mod2(invsqrt * u1); - const D2 = mod2(invsqrt * u2); - const zInv = mod2(D1 * D2 * T); - let D; - if ((0, modular_ts_1.isNegativeLE)(T * zInv, P)) { - let _x = mod2(Y * SQRT_M12); - let _y = mod2(X * SQRT_M12); - X = _x; - Y = _y; - D = mod2(D1 * INVSQRT_A_MINUS_D2); - } else { - D = D2; - } - if ((0, modular_ts_1.isNegativeLE)(X * zInv, P)) - Y = mod2(-Y); - let s = mod2((Z - Y) * D); - if ((0, modular_ts_1.isNegativeLE)(s, P)) - s = mod2(-s); - return Fp2.toBytes(s); - } - /** - * Compares two Ristretto points. - * Described in [RFC9496](https://www.rfc-editor.org/rfc/rfc9496#name-equals). - */ - equals(other) { - this.assertSame(other); - const { X: X1, Y: Y1 } = this.ep; - const { X: X2, Y: Y2 } = other.ep; - const mod2 = (n) => Fp2.create(n); - const one = mod2(X1 * Y2) === mod2(Y1 * X2); - const two = mod2(Y1 * Y2) === mod2(X1 * X2); - return one || two; - } - is0() { - return this.equals(__RistrettoPoint.ZERO); - } - }; - _RistrettoPoint2.BASE = /* @__PURE__ */ (() => new _RistrettoPoint2(exports2.ed25519.Point.BASE))(); - _RistrettoPoint2.ZERO = /* @__PURE__ */ (() => new _RistrettoPoint2(exports2.ed25519.Point.ZERO))(); - _RistrettoPoint2.Fp = /* @__PURE__ */ (() => Fp2)(); - _RistrettoPoint2.Fn = /* @__PURE__ */ (() => Fn2)(); - exports2.ristretto255 = { Point: _RistrettoPoint2 }; - exports2.ristretto255_hasher = { - hashToCurve(msg, options) { - const DST = options?.DST || "ristretto255_XMD:SHA-512_R255MAP_RO_"; - const xmd = (0, hash_to_curve_ts_1.expand_message_xmd)(msg, DST, 64, sha2_js_1.sha512); - return ristretto255_map2(xmd); - }, - hashToScalar(msg, options = { DST: hash_to_curve_ts_1._DST_scalar }) { - const xmd = (0, hash_to_curve_ts_1.expand_message_xmd)(msg, options.DST, 64, sha2_js_1.sha512); - return Fn2.create((0, utils_ts_1.bytesToNumberLE)(xmd)); - } - }; - exports2.ED25519_TORSION_SUBGROUP = [ - "0100000000000000000000000000000000000000000000000000000000000000", - "c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a", - "0000000000000000000000000000000000000000000000000000000000000080", - "26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05", - "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", - "26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85", - "0000000000000000000000000000000000000000000000000000000000000000", - "c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa" - ]; - function edwardsToMontgomeryPub(edwardsPub) { - return exports2.ed25519.utils.toMontgomery((0, utils_ts_1.ensureBytes)("pub", edwardsPub)); - } - exports2.edwardsToMontgomery = edwardsToMontgomeryPub; - function edwardsToMontgomeryPriv(edwardsPriv) { - return exports2.ed25519.utils.toMontgomerySecret((0, utils_ts_1.ensureBytes)("pub", edwardsPriv)); - } - exports2.RistrettoPoint = _RistrettoPoint2; - exports2.hashToCurve = (() => exports2.ed25519_hasher.hashToCurve)(); - exports2.encodeToCurve = (() => exports2.ed25519_hasher.encodeToCurve)(); - exports2.hashToRistretto255 = (() => exports2.ristretto255_hasher.hashToCurve)(); - exports2.hash_to_ristretto255 = (() => exports2.ristretto255_hasher.hashToCurve)(); - } -}); - -// ../dcp-relay/dist/index.js -var require_dist6 = __commonJS({ - "../dcp-relay/dist/index.js"(exports2, module2) { - "use strict"; - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod2, isNodeMode, target) => (target = mod2 != null ? __create2(__getProtoOf2(mod2)) : {}, __copyProps2( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod2 || !mod2.__esModule ? __defProp2(target, "default", { value: mod2, enumerable: true }) : target, - mod2 - )); - var __toCommonJS2 = (mod2) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod2); - var index_exports = {}; - __export2(index_exports, { - ConnectionStore: () => ConnectionStore, - DEFAULT_RELAY_CONFIG: () => DEFAULT_RELAY_CONFIG, - HEARTBEAT_INTERVAL_MS: () => HEARTBEAT_INTERVAL_MS2, - MAX_CLOCK_SKEW_MS: () => MAX_CLOCK_SKEW_MS, - MESSAGE_TTL_MS: () => MESSAGE_TTL_MS2, - MIN_NONCE_SIZE: () => MIN_NONCE_SIZE, - MessageStore: () => MessageStore, - RECONNECT_MAX_MS: () => RECONNECT_MAX_MS2, - RECONNECT_MIN_MS: () => RECONNECT_MIN_MS2, - RELAY_VERSION: () => RELAY_VERSION2, - RateLimiter: () => RateLimiter, - RelayError: () => RelayError2, - RelayServer: () => RelayServer, - authenticateRegistration: () => authenticateRegistration, - closeAuth: () => closeAuth, - tokenStore: () => tokenStore, - verifyRegistrationSignature: () => verifyRegistrationSignature - }); - module2.exports = __toCommonJS2(index_exports); - var import_fastify2 = __toESM2(require_fastify()); - var import_websocket2 = __toESM2(require_websocket2()); - var import_cors2 = __toESM2(require_cors()); - var import_ed255192 = require_ed25519(); - var RELAY_VERSION2 = "1"; - var HEARTBEAT_INTERVAL_MS2 = 3e4; - var MESSAGE_TTL_MS2 = 5 * 60 * 1e3; - var RECONNECT_MIN_MS2 = 1e3; - var RECONNECT_MAX_MS2 = 6e4; - var MAX_CLOCK_SKEW_MS = 5 * 60 * 1e3; - var MIN_NONCE_SIZE = 32; - var RelayError2 = class extends Error { - constructor(code, message, details) { - super(message); - this.code = code; - this.details = details; - this.name = "RelayError"; - } - code; - details; - toJSON() { - return { - error: { - code: this.code, - message: this.message, - details: this.details - } - }; - } - }; - var DEFAULT_RELAY_CONFIG = { - port: 8422, - // Note: 8421 is used by vault, relay uses 8422 - host: "0.0.0.0", - // Relay is meant to be publicly accessible - enableLongPoll: true, - heartbeatIntervalMs: HEARTBEAT_INTERVAL_MS2, - messageTtlMs: MESSAGE_TTL_MS2, - maxPendingMessages: 100, - debug: false, - rateLimitPerMinute: 60, - rateLimitWindowMs: 6e4 - }; - var import_node_crypto = require("crypto"); - var MessageStore = class { - messages = /* @__PURE__ */ new Map(); - requestIdIndex = /* @__PURE__ */ new Map(); - // request_id -> message key - vaultMessages = /* @__PURE__ */ new Map(); - // vault_id -> message keys - config; - cleanupInterval = null; - constructor(config = {}) { - this.config = { - port: 8422, - // Note: 8421 is used by vault, relay uses 8422 - host: "0.0.0.0", - enableLongPoll: true, - heartbeatIntervalMs: 3e4, - messageTtlMs: config.messageTtlMs ?? MESSAGE_TTL_MS2, - maxPendingMessages: config.maxPendingMessages ?? 100, - debug: config.debug ?? false, - rateLimitPerMinute: config.rateLimitPerMinute ?? 60, - rateLimitWindowMs: config.rateLimitWindowMs ?? 6e4 - }; - this.startCleanup(); - } - // -------------------------------------------------------------------------- - // Message Operations - // -------------------------------------------------------------------------- - /** - * Store a new message - * @throws RelayError if duplicate request_id - */ - storeMessage(envelope) { - const key = this.getMessageKey(envelope.vault_id, envelope.request_id); - if (this.requestIdIndex.has(envelope.request_id)) { - throw new RelayError2( - "RELAY_DUPLICATE_REQUEST", - `Duplicate request_id: ${envelope.request_id}`, - { request_id: envelope.request_id } - ); - } - const vaultMsgs = this.vaultMessages.get(envelope.vault_id); - if (vaultMsgs && vaultMsgs.size >= this.config.maxPendingMessages) { - this.pruneVaultMessages(envelope.vault_id); - } - const stored = { - envelope, - received_at: Date.now(), - delivered: false - }; - this.messages.set(key, stored); - this.requestIdIndex.set(envelope.request_id, key); - if (!this.vaultMessages.has(envelope.vault_id)) { - this.vaultMessages.set(envelope.vault_id, /* @__PURE__ */ new Set()); - } - this.vaultMessages.get(envelope.vault_id).add(key); - } - /** - * Get pending messages for a vault - */ - getPendingMessages(vaultId) { - const keys = this.vaultMessages.get(vaultId); - if (!keys) - return []; - const messages = []; - const now = Date.now(); - for (const key of keys) { - const stored = this.messages.get(key); - if (!stored) - continue; - if (this.isExpired(stored, now)) { - this.removeMessage(key, stored.envelope.request_id, vaultId); - continue; - } - if (!stored.delivered) { - messages.push(stored.envelope); - } - } - return messages; - } - /** - * Mark a message as delivered - */ - markDelivered(requestId) { - const key = this.requestIdIndex.get(requestId); - if (!key) - return false; - const stored = this.messages.get(key); - if (!stored) - return false; - stored.delivered = true; - return true; - } - /** - * Store a response for a request - */ - storeResponse(requestId, response) { - const key = this.requestIdIndex.get(requestId); - if (!key) - return false; - const stored = this.messages.get(key); - if (!stored) - return false; - stored.response = response; - return true; - } - /** - * Get response for a request (for idempotent replay) - */ - getResponse(requestId) { - const key = this.requestIdIndex.get(requestId); - if (!key) - return void 0; - const stored = this.messages.get(key); - return stored?.response; - } - /** - * Check if a request_id exists (for idempotency check) - */ - hasRequest(requestId) { - return this.requestIdIndex.has(requestId); - } - /** - * Get a stored message by request_id - */ - getMessage(requestId) { - const key = this.requestIdIndex.get(requestId); - if (!key) - return void 0; - return this.messages.get(key); - } - // -------------------------------------------------------------------------- - // Cleanup Operations - // -------------------------------------------------------------------------- - /** - * Remove expired messages - */ - cleanup() { - const now = Date.now(); - let removed = 0; - for (const [key, stored] of this.messages) { - if (this.isExpired(stored, now)) { - this.removeMessage(key, stored.envelope.request_id, stored.envelope.vault_id); - removed++; - } - } - return removed; - } - /** - * Clear all messages for a vault - */ - clearVault(vaultId) { - const keys = this.vaultMessages.get(vaultId); - if (!keys) - return; - for (const key of keys) { - const stored = this.messages.get(key); - if (stored) { - this.requestIdIndex.delete(stored.envelope.request_id); - this.messages.delete(key); - } - } - this.vaultMessages.delete(vaultId); - } - /** - * Stop cleanup interval - */ - close() { - if (this.cleanupInterval) { - clearInterval(this.cleanupInterval); - this.cleanupInterval = null; - } - } - // -------------------------------------------------------------------------- - // Stats - // -------------------------------------------------------------------------- - getStats() { - let pending = 0; - let delivered = 0; - for (const stored of this.messages.values()) { - if (stored.delivered) { - delivered++; - } else { - pending++; - } - } - return { - totalMessages: this.messages.size, - pendingMessages: pending, - deliveredMessages: delivered, - vaultCount: this.vaultMessages.size - }; - } - // -------------------------------------------------------------------------- - // Private Helpers - // -------------------------------------------------------------------------- - getMessageKey(vaultId, requestId) { - return `${vaultId}:${requestId}`; - } - isExpired(stored, now) { - const expiresAt = new Date(stored.envelope.expires_at).getTime(); - if (now > expiresAt) - return true; - if (now - stored.received_at > this.config.messageTtlMs) - return true; - return false; - } - removeMessage(key, requestId, vaultId) { - this.messages.delete(key); - this.requestIdIndex.delete(requestId); - this.vaultMessages.get(vaultId)?.delete(key); - } - pruneVaultMessages(vaultId) { - const keys = this.vaultMessages.get(vaultId); - if (!keys) - return; - const sorted = Array.from(keys).map((key) => ({ key, stored: this.messages.get(key) })).filter((item) => item.stored !== void 0).sort((a, b) => a.stored.received_at - b.stored.received_at); - const toRemove = Math.max(1, Math.floor(sorted.length * 0.2)); - for (let i = 0; i < toRemove; i++) { - const item = sorted[i]; - if (item.stored) { - this.removeMessage(item.key, item.stored.envelope.request_id, vaultId); - } - } - } - startCleanup() { - this.cleanupInterval = setInterval(() => { - this.cleanup(); - }, 6e4); - } - }; - var ConnectionStore = class { - connections = /* @__PURE__ */ new Map(); - /** - * Register a vault connection - */ - register(vaultId, publicKey2, ws) { - const conn = { - vault_id: vaultId, - public_key: publicKey2, - connected_at: Date.now(), - last_heartbeat: Date.now(), - ws - }; - this.connections.set(vaultId, conn); - } - /** - * Unregister a vault connection - */ - unregister(vaultId) { - this.connections.delete(vaultId); - } - /** - * Get a vault connection - */ - get(vaultId) { - return this.connections.get(vaultId); - } - /** - * Check if a vault is connected - */ - isConnected(vaultId) { - return this.connections.has(vaultId); - } - /** - * Update heartbeat timestamp - */ - updateHeartbeat(vaultId) { - const conn = this.connections.get(vaultId); - if (!conn) - return false; - conn.last_heartbeat = Date.now(); - return true; - } - /** - * Get all connected vault IDs - */ - getConnectedVaults() { - return Array.from(this.connections.keys()); - } - /** - * Remove stale connections (no heartbeat for 2x interval) - */ - removeStale(heartbeatIntervalMs) { - const threshold = Date.now() - heartbeatIntervalMs * 2; - const stale = []; - for (const [vaultId, conn] of this.connections) { - if (conn.last_heartbeat < threshold) { - stale.push(vaultId); - this.connections.delete(vaultId); - } - } - return stale; - } - /** - * Get stats - */ - getStats() { - return { connectedVaults: this.connections.size }; - } - }; - var RateLimiter = class { - limits = /* @__PURE__ */ new Map(); - maxRequests; - windowMs; - cleanupInterval = null; - constructor(maxRequests = 60, windowMs = 6e4) { - this.maxRequests = maxRequests; - this.windowMs = windowMs; - this.cleanupInterval = setInterval(() => { - this.cleanup(); - }, 5 * 6e4); - } - /** - * Check if a request is allowed for a vault_id - * Returns true if allowed, false if rate limited - */ - checkLimit(vaultId) { - const now = Date.now(); - const windowStart = now - this.windowMs; - let entry = this.limits.get(vaultId); - if (!entry) { - entry = { timestamps: [], lastCleanup: now }; - this.limits.set(vaultId, entry); - } - entry.timestamps = entry.timestamps.filter((ts) => ts > windowStart); - entry.lastCleanup = now; - if (entry.timestamps.length >= this.maxRequests) { - return false; - } - entry.timestamps.push(now); - return true; - } - /** - * Get current request count for a vault_id in the window - */ - getCount(vaultId) { - const entry = this.limits.get(vaultId); - if (!entry) - return 0; - const windowStart = Date.now() - this.windowMs; - return entry.timestamps.filter((ts) => ts > windowStart).length; - } - /** - * Get remaining requests for a vault_id - */ - getRemaining(vaultId) { - return Math.max(0, this.maxRequests - this.getCount(vaultId)); - } - /** - * Get time until rate limit resets (in ms) - */ - getResetTime(vaultId) { - const entry = this.limits.get(vaultId); - if (!entry || entry.timestamps.length === 0) - return 0; - const oldestTimestamp = Math.min(...entry.timestamps); - const resetTime = oldestTimestamp + this.windowMs - Date.now(); - return Math.max(0, resetTime); - } - /** - * Reset rate limit for a vault_id - */ - reset(vaultId) { - this.limits.delete(vaultId); - } - /** - * Cleanup entries not accessed in the last 10 minutes - */ - cleanup() { - const staleThreshold = Date.now() - 10 * 6e4; - let removed = 0; - for (const [vaultId, entry] of this.limits) { - if (entry.lastCleanup < staleThreshold) { - this.limits.delete(vaultId); - removed++; - } - } - return removed; - } - /** - * Get stats - */ - getStats() { - return { - trackedVaults: this.limits.size, - maxRequests: this.maxRequests, - windowMs: this.windowMs - }; - } - /** - * Stop cleanup interval - */ - close() { - if (this.cleanupInterval) { - clearInterval(this.cleanupInterval); - this.cleanupInterval = null; - } - } - }; - var WORD_LIST = [ - "apple", - "banana", - "cherry", - "dragon", - "eagle", - "falcon", - "grape", - "harbor", - "island", - "jungle", - "kettle", - "lemon", - "mango", - "nectar", - "orange", - "pepper", - "quartz", - "river", - "sunset", - "tiger", - "umbrella", - "violet", - "walnut", - "xylophone", - "yellow", - "zebra", - "anchor", - "bridge", - "castle", - "delta", - "ember", - "forest" - ]; - var PAIRING_CLAIM_TTL_MS = 10 * 60 * 1e3; - var PairingClaimStore = class { - /** claim_id -> stored claim */ - claims = /* @__PURE__ */ new Map(); - /** invite_id -> claim_id (for routing claims to vaults) */ - inviteIndex = /* @__PURE__ */ new Map(); - /** vault_id -> Set (for pushing claims to connected vaults) */ - vaultClaims = /* @__PURE__ */ new Map(); - cleanupInterval = null; - constructor() { - this.cleanupInterval = setInterval(() => { - this.cleanup(); - }, 6e4); - } - /** - * Store a new pairing claim - * - * @param claim - The pairing claim from the agent - * @param vaultId - The vault ID this claim routes to (from invite lookup) - * @returns claim_id and verification_phrase - */ - storeClaim(claim, vaultId) { - const claimId = `claim_${(0, import_node_crypto.randomUUID)().replace(/-/g, "").slice(0, 16)}`; - const verificationPhrase = this.generateVerificationPhrase( - claim.agent_public_key, - claim.invite_id - ); - const stored = { - claim_id: claimId, - claim, - verification_phrase: verificationPhrase, - received_at: Date.now(), - status: "pending", - vault_id: vaultId - }; - this.claims.set(claimId, stored); - this.inviteIndex.set(claim.invite_id, claimId); - if (vaultId) { - if (!this.vaultClaims.has(vaultId)) { - this.vaultClaims.set(vaultId, /* @__PURE__ */ new Set()); - } - this.vaultClaims.get(vaultId).add(claimId); - } - return { claim_id: claimId, verification_phrase: verificationPhrase }; - } - /** - * Get a stored claim by claim_id - */ - getClaim(claimId) { - return this.claims.get(claimId); - } - /** - * Get claim by invite_id - */ - getClaimByInvite(inviteId) { - const claimId = this.inviteIndex.get(inviteId); - if (!claimId) - return void 0; - return this.claims.get(claimId); - } - /** - * Get pending claims for a vault - */ - getPendingClaimsForVault(vaultId) { - const claimIds = this.vaultClaims.get(vaultId); - if (!claimIds) - return []; - const pending = []; - for (const claimId of claimIds) { - const claim = this.claims.get(claimId); - if (claim && claim.status === "pending") { - pending.push(claim); - } - } - return pending; - } - /** - * Update claim status (vault approves/denies) - */ - updateClaimStatus(claimId, status, agentId) { - const claim = this.claims.get(claimId); - if (!claim) - return false; - claim.status = status; - claim.resolved_at = Date.now(); - if (agentId) { - claim.agent_id = agentId; - } - return true; - } - /** - * Associate a claim with a vault_id (when invite_id is resolved) - */ - associateWithVault(claimId, vaultId) { - const claim = this.claims.get(claimId); - if (!claim) - return false; - claim.vault_id = vaultId; - if (!this.vaultClaims.has(vaultId)) { - this.vaultClaims.set(vaultId, /* @__PURE__ */ new Set()); - } - this.vaultClaims.get(vaultId).add(claimId); - return true; - } - /** - * Generate verification phrase (must match agent implementation) - * - * Same algorithm as dcp-agent/src/pairing.ts:generateVerificationPhrase - */ - generateVerificationPhrase(agentPublicKey, inviteId) { - const publicKeyBytes = Buffer.from(agentPublicKey, "base64"); - const combined = Buffer.concat([ - publicKeyBytes, - Buffer.from(inviteId) - ]); - const hash = (0, import_node_crypto.createHash)("sha256").update(combined).digest(); - const word1 = WORD_LIST[hash[0] % WORD_LIST.length]; - const word2 = WORD_LIST[hash[1] % WORD_LIST.length]; - const word3 = WORD_LIST[hash[2] % WORD_LIST.length]; - return `${word1}-${word2}-${word3}`; - } - /** - * Cleanup expired claims - */ - cleanup() { - const now = Date.now(); - let removed = 0; - for (const [claimId, claim] of this.claims) { - if (claim.status === "pending" && now - claim.received_at > PAIRING_CLAIM_TTL_MS) { - claim.status = "expired"; - claim.resolved_at = now; - } - if (claim.status !== "pending" && claim.resolved_at) { - if (now - claim.resolved_at > 60 * 60 * 1e3) { - this.claims.delete(claimId); - this.inviteIndex.delete(claim.claim.invite_id); - if (claim.vault_id) { - this.vaultClaims.get(claim.vault_id)?.delete(claimId); - } - removed++; - } - } - } - return removed; - } - /** - * Get stats - */ - getStats() { - let pending = 0; - let approved = 0; - let denied = 0; - for (const claim of this.claims.values()) { - switch (claim.status) { - case "pending": - pending++; - break; - case "approved": - approved++; - break; - case "denied": - denied++; - break; - } - } - return { - totalClaims: this.claims.size, - pendingClaims: pending, - approvedClaims: approved, - deniedClaims: denied - }; - } - /** - * Stop cleanup interval - */ - close() { - if (this.cleanupInterval) { - clearInterval(this.cleanupInterval); - this.cleanupInterval = null; - } - } - }; - var import_crypto5 = require("crypto"); - var NonceStore = class { - nonces = /* @__PURE__ */ new Map(); - cleanupInterval = null; - constructor() { - this.cleanupInterval = setInterval(() => this.cleanup(), 6e4); - } - /** - * Check if nonce was already used, and mark it as used - * @returns true if nonce is fresh, false if replay - */ - checkAndMark(nonce) { - if (this.nonces.has(nonce)) { - return false; - } - this.nonces.set(nonce, Date.now()); - return true; - } - cleanup() { - const cutoff = Date.now() - MAX_CLOCK_SKEW_MS * 2; - for (const [nonce, timestamp] of this.nonces) { - if (timestamp < cutoff) { - this.nonces.delete(nonce); - } - } - } - close() { - if (this.cleanupInterval) { - clearInterval(this.cleanupInterval); - this.cleanupInterval = null; - } - } - }; - var nonceStore = new NonceStore(); - function verifyRegistrationSignature(payload) { - const timestamp = new Date(payload.timestamp).getTime(); - if (isNaN(timestamp)) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Invalid timestamp format"); - } - const now = Date.now(); - const skew = Math.abs(now - timestamp); - if (skew > MAX_CLOCK_SKEW_MS) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Timestamp too far from server time", { - skew_ms: skew, - max_skew_ms: MAX_CLOCK_SKEW_MS - }); - } - const nonceBuffer = Buffer.from(payload.nonce, "base64"); - if (nonceBuffer.length < MIN_NONCE_SIZE) { - throw new RelayError2("RELAY_UNAUTHORIZED", `Nonce must be at least ${MIN_NONCE_SIZE} bytes`); - } - if (!nonceStore.checkAndMark(payload.nonce)) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Nonce already used (replay detected)"); - } - const signingKeyBuffer = Buffer.from(payload.signing_public_key, "base64"); - if (signingKeyBuffer.length !== 32) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Invalid signing public key size"); - } - const signatureBuffer = Buffer.from(payload.signature, "base64"); - if (signatureBuffer.length !== 64) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Invalid signature size"); - } - const message = Buffer.concat([ - Buffer.from(payload.vault_id, "utf8"), - Buffer.from(payload.timestamp, "utf8"), - nonceBuffer - ]); - const isValid = verifyEd25519(message, signatureBuffer, signingKeyBuffer); - if (!isValid) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Invalid signature"); - } - } - function verifyEd25519(message, signature2, publicKey2) { - try { - const spkiPrefix = Buffer.from([ - 48, - 42, - // SEQUENCE, length 42 - 48, - 5, - // SEQUENCE, length 5 - 6, - 3, - 43, - 101, - 112, - // OID 1.3.101.112 (Ed25519) - 3, - 33, - 0 - // BIT STRING, length 33, no unused bits - ]); - const spkiKey = Buffer.concat([spkiPrefix, publicKey2]); - return (0, import_crypto5.verify)( - null, - message, - { key: spkiKey, format: "der", type: "spki" }, - signature2 - ); - } catch { - return false; - } - } - var TokenStore = class { - tokens = /* @__PURE__ */ new Map(); - /** - * Register a pairing token (called during 'dcp connect' flow) - */ - registerToken(token, vaultId, scopes, expiresInMs) { - this.tokens.set(token, { - vault_id: vaultId, - expires_at: Date.now() + expiresInMs, - scopes - }); - } - /** - * Validate a pairing token - * @returns vault_id if valid, throws if invalid - */ - validateToken(token, expectedVaultId) { - const entry = this.tokens.get(token); - if (!entry) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Invalid pairing token"); - } - if (Date.now() > entry.expires_at) { - this.tokens.delete(token); - throw new RelayError2("RELAY_UNAUTHORIZED", "Pairing token expired"); - } - if (entry.vault_id !== expectedVaultId) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Pairing token does not match vault_id"); - } - } - /** - * Revoke a pairing token - */ - revokeToken(token) { - return this.tokens.delete(token); - } - /** - * Check if any tokens exist (for determining if token validation is required) - */ - hasTokens() { - return this.tokens.size > 0; - } - }; - var tokenStore = new TokenStore(); - var DEFAULT_AUTH_CONFIG = { - requirePairingToken: false - // Will be true after Sprint 3 - }; - function authenticateRegistration(payload, config = DEFAULT_AUTH_CONFIG) { - verifyRegistrationSignature(payload); - if (config.requirePairingToken || payload.pairing_token) { - if (!payload.pairing_token) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Pairing token required"); - } - tokenStore.validateToken(payload.pairing_token, payload.vault_id); - } - } - function authenticateRequest(token, vaultId, config = DEFAULT_AUTH_CONFIG) { - if (!config.requirePairingToken) { - return; - } - if (!token) { - throw new RelayError2("RELAY_UNAUTHORIZED", "Pairing token required"); - } - tokenStore.validateToken(token, vaultId); - } - function closeAuth() { - nonceStore.close(); - } - var RelayServer = class { - server; - messageStore; - connectionStore; - rateLimiter; - pairingClaimStore; - config; - authConfig; - heartbeatInterval = null; - wsConnections = /* @__PURE__ */ new Map(); - clientSockets = /* @__PURE__ */ new Set(); - clientRequestMap = /* @__PURE__ */ new Map(); - clientRequestsBySocket = /* @__PURE__ */ new Map(); - /** invite_id -> vault_id mapping (populated when vault registers) */ - inviteVaultMap = /* @__PURE__ */ new Map(); - constructor(config = {}) { - this.config = { ...DEFAULT_RELAY_CONFIG, ...config }; - this.authConfig = config.authConfig ?? { requirePairingToken: false }; - this.messageStore = new MessageStore(this.config); - this.connectionStore = new ConnectionStore(); - this.rateLimiter = new RateLimiter( - this.config.rateLimitPerMinute, - this.config.rateLimitWindowMs - ); - this.pairingClaimStore = new PairingClaimStore(); - this.server = (0, import_fastify2.default)({ - logger: this.config.debug ? { - transport: { - target: "pino-pretty", - options: { colorize: true } - } - } : false - }); - this.setupRoutes(); - } - // -------------------------------------------------------------------------- - // Server Lifecycle - // -------------------------------------------------------------------------- - async start() { - await this.server.register( - import_cors2.default, - { origin: true } - ); - await this.server.register( - import_websocket2.default - ); - this.setupWebSocket(); - await this.server.listen({ port: this.config.port, host: this.config.host }); - this.startHeartbeatChecker(); - if (this.config.debug) { - console.log(`DCP Relay listening on ${this.config.host}:${this.config.port}`); - } - } - async stop() { - if (this.heartbeatInterval) { - clearInterval(this.heartbeatInterval); - this.heartbeatInterval = null; - } - for (const ws of this.wsConnections.values()) { - ws.close(1e3, "Server shutting down"); - } - this.wsConnections.clear(); - for (const ws of this.clientSockets) { - ws.close(1e3, "Server shutting down"); - } - this.clientSockets.clear(); - this.clientRequestMap.clear(); - this.clientRequestsBySocket.clear(); - this.messageStore.close(); - this.rateLimiter.close(); - this.pairingClaimStore.close(); - closeAuth(); - await this.server.close(); - } - // -------------------------------------------------------------------------- - // HTTP Routes (REST + Long-Poll) - // -------------------------------------------------------------------------- - setupRoutes() { - this.server.get("/health", async () => ({ - status: "ok", - version: RELAY_VERSION2, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - })); - this.server.get("/stats", async () => ({ - ...this.messageStore.getStats(), - ...this.connectionStore.getStats(), - rateLimit: this.rateLimiter.getStats(), - pairingClaims: this.pairingClaimStore.getStats(), - timestamp: (/* @__PURE__ */ new Date()).toISOString() - })); - this.server.get( - "/metrics", - async (request, reply) => { - const messageStats = this.messageStore.getStats(); - const connectionStats = this.connectionStore.getStats(); - const rateLimitStats = this.rateLimiter.getStats(); - const pairingStats = this.pairingClaimStore.getStats(); - const format = request.query.format; - if (format === "prometheus") { - const lines = [ - "# HELP dcp_relay_messages_total Total messages in store", - "# TYPE dcp_relay_messages_total gauge", - `dcp_relay_messages_total ${messageStats.totalMessages}`, - "# HELP dcp_relay_messages_pending Pending messages waiting for delivery", - "# TYPE dcp_relay_messages_pending gauge", - `dcp_relay_messages_pending ${messageStats.pendingMessages}`, - "# HELP dcp_relay_messages_delivered Messages successfully delivered", - "# TYPE dcp_relay_messages_delivered gauge", - `dcp_relay_messages_delivered ${messageStats.deliveredMessages}`, - "# HELP dcp_relay_vaults_connected Currently connected vaults", - "# TYPE dcp_relay_vaults_connected gauge", - `dcp_relay_vaults_connected ${connectionStats.connectedVaults}`, - "# HELP dcp_relay_vaults_tracked Vaults tracked by rate limiter", - "# TYPE dcp_relay_vaults_tracked gauge", - `dcp_relay_vaults_tracked ${rateLimitStats.trackedVaults}`, - "# HELP dcp_relay_rate_limit_max Max requests per window", - "# TYPE dcp_relay_rate_limit_max gauge", - `dcp_relay_rate_limit_max ${rateLimitStats.maxRequests}`, - "# HELP dcp_relay_ws_clients Connected WebSocket clients", - "# TYPE dcp_relay_ws_clients gauge", - `dcp_relay_ws_clients ${this.clientSockets.size}`, - "# HELP dcp_relay_pairing_claims_total Total pairing claims", - "# TYPE dcp_relay_pairing_claims_total gauge", - `dcp_relay_pairing_claims_total ${pairingStats.totalClaims}`, - "# HELP dcp_relay_pairing_claims_pending Pending pairing claims", - "# TYPE dcp_relay_pairing_claims_pending gauge", - `dcp_relay_pairing_claims_pending ${pairingStats.pendingClaims}`, - "" - ]; - reply.header("Content-Type", "text/plain; charset=utf-8"); - return lines.join("\n"); - } - return { - messages: messageStats, - connections: connectionStats, - rateLimit: rateLimitStats, - pairingClaims: pairingStats, - websockets: { - vaultConnections: this.wsConnections.size, - clientConnections: this.clientSockets.size, - pendingClientRequests: this.clientRequestMap.size - }, - config: { - rateLimitPerMinute: this.config.rateLimitPerMinute, - rateLimitWindowMs: this.config.rateLimitWindowMs, - messageTtlMs: this.config.messageTtlMs, - heartbeatIntervalMs: this.config.heartbeatIntervalMs - }, - uptime: process.uptime(), - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - } - ); - this.server.post( - "/relay/request", - async (request, reply) => { - return this.handleRequest(request.body, reply); - } - ); - this.server.get( - "/relay/response/:requestId", - async (request, reply) => { - return this.handleGetResponse(request.params.requestId, reply); - } - ); - if (this.config.enableLongPoll) { - this.server.post( - "/relay/poll", - async (request, reply) => { - return this.handleLongPoll(request.body, reply); - } - ); - this.server.post( - "/relay/respond", - async (request, reply) => { - return this.handleRespond(request.body, reply); - } - ); - } - this.server.post( - "/v1/pairing-claims", - async (request, reply) => { - return this.handlePairingClaim(request.body, reply); - } - ); - this.server.get( - "/v1/pairing-claims/:claimId/status", - async (request, reply) => { - return this.handlePairingStatus(request.params.claimId, reply); - } - ); - this.server.post( - "/v1/pairing-claims/:claimId/resolve", - async (request, reply) => { - return this.handlePairingResolve( - request.params.claimId, - request.body, - reply - ); - } - ); - this.server.post( - "/v1/invites/register", - async (request, reply) => { - const { invite_id, vault_id } = request.body; - if (!invite_id || !vault_id) { - return reply.status(400).send({ error: "Missing invite_id or vault_id" }); - } - this.inviteVaultMap.set(invite_id, vault_id); - return reply.send({ success: true }); - } - ); - } - async handleRequest(envelope, reply) { - const validationError = this.validateEnvelope(envelope); - if (validationError) { - return reply.status(400).send(validationError.toJSON()); - } - try { - const authHeader = reply.request.headers["authorization"]; - const tokenHeader = reply.request.headers["x-dcp-pairing-token"]; - const authToken = this.extractAuthToken(authHeader, tokenHeader); - authenticateRequest(authToken, envelope.vault_id, this.authConfig); - } catch (err) { - if (err instanceof RelayError2) { - return reply.status(401).send(err.toJSON()); - } - throw err; - } - const existingResponse = this.messageStore.getResponse(envelope.request_id); - if (existingResponse) { - return reply.send(existingResponse); - } - if (!this.rateLimiter.checkLimit(envelope.vault_id)) { - const resetTime = this.rateLimiter.getResetTime(envelope.vault_id); - reply.header("X-RateLimit-Limit", this.config.rateLimitPerMinute.toString()); - reply.header("X-RateLimit-Remaining", "0"); - reply.header("X-RateLimit-Reset", Math.ceil(resetTime / 1e3).toString()); - reply.header("Retry-After", Math.ceil(resetTime / 1e3).toString()); - return reply.status(429).send( - new RelayError2( - "RELAY_RATE_LIMITED", - `Rate limit exceeded for vault ${envelope.vault_id}. Try again in ${Math.ceil(resetTime / 1e3)} seconds.`, - { - vault_id: envelope.vault_id, - limit: this.config.rateLimitPerMinute, - window_ms: this.config.rateLimitWindowMs, - retry_after_ms: resetTime - } - ).toJSON() - ); - } - reply.header("X-RateLimit-Limit", this.config.rateLimitPerMinute.toString()); - reply.header("X-RateLimit-Remaining", this.rateLimiter.getRemaining(envelope.vault_id).toString()); - if (!this.connectionStore.isConnected(envelope.vault_id)) { - return reply.status(503).send( - new RelayError2( - "RELAY_VAULT_NOT_CONNECTED", - `Vault ${envelope.vault_id} is not connected` - ).toJSON() - ); - } - try { - this.messageStore.storeMessage(envelope); - } catch (err) { - if (err instanceof RelayError2) { - return reply.status(409).send(err.toJSON()); - } - throw err; - } - const ws = this.wsConnections.get(envelope.vault_id); - if (ws && ws.readyState === 1) { - const wsMsg = { - type: "request", - payload: envelope, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(wsMsg)); - this.messageStore.markDelivered(envelope.request_id); - } - return reply.status(202).send({ - queued: true, - accepted: true, - request_id: envelope.request_id, - message: "Request queued for delivery" - }); - } - extractAuthToken(authHeader, tokenHeader) { - const tokenValue = Array.isArray(tokenHeader) ? tokenHeader[0] : tokenHeader; - if (tokenValue && tokenValue.trim()) { - return tokenValue.trim(); - } - const authValue = Array.isArray(authHeader) ? authHeader[0] : authHeader; - if (!authValue) { - return void 0; - } - const match = authValue.match(/^Bearer\s+(.+)$/i); - return match ? match[1].trim() : void 0; - } - async handleGetResponse(requestId, reply) { - const response = this.messageStore.getResponse(requestId); - if (response) { - return reply.send(response); - } - const message = this.messageStore.getMessage(requestId); - if (!message) { - return reply.status(404).send( - new RelayError2("RELAY_TIMEOUT", "Request not found or expired").toJSON() - ); - } - return reply.status(202).send({ - pending: true, - request_id: requestId, - message: "Response not yet available" - }); - } - async handleLongPoll(req, reply) { - const timeoutMs = Math.min(req.timeout_ms ?? 3e4, 6e4); - const startTime = Date.now(); - while (Date.now() - startTime < timeoutMs) { - const messages = this.messageStore.getPendingMessages(req.vault_id); - if (messages.length > 0) { - for (const msg of messages) { - this.messageStore.markDelivered(msg.request_id); - } - const response2 = { - messages, - last_message_id: messages[messages.length - 1].request_id - }; - return reply.send(response2); - } - await new Promise((resolve) => setTimeout(resolve, 500)); - } - const response = { - messages: [], - last_message_id: req.last_message_id ?? "" - }; - return reply.send(response); - } - async handleRespond(response, reply) { - const stored = this.messageStore.storeResponse(response.request_id, response); - if (!stored) { - return reply.status(404).send( - new RelayError2("RELAY_TIMEOUT", "Original request not found or expired").toJSON() - ); - } - this.notifyClientResponse(response); - return reply.send({ success: true, request_id: response.request_id }); - } - // -------------------------------------------------------------------------- - // Pairing Claim Handlers - // -------------------------------------------------------------------------- - /** - * Handle pairing claim submission from VPS agent - * - * Flow: - * 1. Receive claim from agent - * 2. Look up vault_id from invite_id - * 3. Store claim with verification phrase - * 4. Push claim to connected vault via WebSocket (if connected) - * 5. Return claim_id for polling - */ - async handlePairingClaim(claim, reply) { - if (!claim.invite_id || !claim.agent_public_key || !claim.signature) { - return reply.status(400).send({ - success: false, - error: "Missing required fields (invite_id, agent_public_key, signature)" - }); - } - const now = Date.now(); - if (Math.abs(now - claim.timestamp) > 5 * 60 * 1e3) { - return reply.status(400).send({ - success: false, - error: "Claim timestamp too old or in the future" - }); - } - try { - const payload = { - invite_id: claim.invite_id, - agent_public_key: claim.agent_public_key, - agent_hostname: claim.agent_hostname, - agent_version: claim.agent_version, - timestamp: claim.timestamp, - nonce: claim.nonce - }; - if (claim.vault_id) { - payload.vault_id = claim.vault_id; - } - const canonical = JSON.stringify(payload, Object.keys(payload).sort()); - const message = Buffer.from(canonical, "utf8"); - const signature2 = Buffer.from(claim.signature, "base64"); - const publicKey2 = Buffer.from(claim.agent_public_key, "base64"); - const isValid = import_ed255192.ed25519.verify(signature2, message, publicKey2); - if (!isValid) { - return reply.status(400).send({ - success: false, - error: "Invalid signature - claim not signed by the provided public key" - }); - } - } catch (err) { - return reply.status(400).send({ - success: false, - error: "Failed to verify signature: " + (err instanceof Error ? err.message : "unknown error") - }); - } - const vaultId = this.inviteVaultMap.get(claim.invite_id) ?? claim.vault_id; - const { claim_id, verification_phrase } = this.pairingClaimStore.storeClaim( - claim, - vaultId - ); - if (vaultId) { - const ws = this.wsConnections.get(vaultId); - if (ws && ws.readyState === 1) { - const storedClaim = this.pairingClaimStore.getClaim(claim_id); - if (storedClaim) { - const wsMsg = { - type: "pairing_claim", - payload: storedClaim, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(wsMsg)); - if (this.config.debug) { - console.log(`Pushed pairing claim ${claim_id} to vault ${vaultId}`); - } - } - } - } - if (this.config.debug) { - console.log( - `Pairing claim received: ${claim_id} (invite: ${claim.invite_id}, vault: ${vaultId ?? "unknown"})` - ); - } - return reply.status(201).send({ - success: true, - claim_id, - verification_phrase - }); - } - /** - * Handle pairing status polling from agent - */ - async handlePairingStatus(claimId, reply) { - const claim = this.pairingClaimStore.getClaim(claimId); - if (!claim) { - return reply.status(404).send({ - status: "not_found", - error: "Claim not found or expired" - }); - } - return reply.send({ - status: claim.status, - agent_id: claim.agent_id, - vault_id: claim.vault_id - }); - } - /** - * Handle pairing resolution from vault (approve/deny) - */ - async handlePairingResolve(claimId, body, reply) { - const { action, agent_id, vault_id } = body; - const claim = this.pairingClaimStore.getClaim(claimId); - if (!claim) { - return reply.status(404).send({ error: "Claim not found" }); - } - if (claim.vault_id && claim.vault_id !== vault_id) { - return reply.status(403).send({ error: "Vault ID mismatch" }); - } - const status = action === "approve" ? "approved" : "denied"; - const updated = this.pairingClaimStore.updateClaimStatus(claimId, status, agent_id); - if (!updated) { - return reply.status(500).send({ error: "Failed to update claim status" }); - } - if (this.config.debug) { - console.log(`Pairing claim ${claimId} ${status} by vault ${vault_id}`); - } - return reply.send({ - success: true, - claim_id: claimId, - status, - agent_id - }); - } - // -------------------------------------------------------------------------- - // WebSocket Handler - // -------------------------------------------------------------------------- - setupWebSocket() { - const websocketRoute = { websocket: true }; - this.server.get("/ws", websocketRoute, (socket, _req) => { - const ws = socket; - let vaultId = null; - ws.on("message", (data) => { - try { - const msg = JSON.parse(data.toString()); - this.handleWsMessage(ws, msg, (id) => { - vaultId = id; - }); - } catch (err) { - this.sendWsError(ws, "RELAY_INVALID_ENVELOPE", "Invalid message format"); - } - }); - ws.on("close", () => { - if (vaultId) { - this.connectionStore.unregister(vaultId); - this.wsConnections.delete(vaultId); - if (this.config.debug) { - console.log(`Vault ${vaultId} disconnected`); - } - } - }); - ws.on("error", (err) => { - if (this.config.debug) { - console.error("WebSocket error:", err); - } - }); - }); - this.server.get("/ws-client", websocketRoute, (socket, _req) => { - const ws = socket; - this.clientSockets.add(ws); - ws.on("message", (data) => { - try { - const msg = JSON.parse(data.toString()); - this.handleClientWsMessage(ws, msg); - } catch { - this.sendWsError(ws, "RELAY_INVALID_ENVELOPE", "Invalid message format"); - } - }); - ws.on("close", () => { - this.cleanupClientRequests(ws); - this.clientSockets.delete(ws); - }); - ws.on("error", (err) => { - if (this.config.debug) { - console.error("Client WebSocket error:", err); - } - }); - }); - } - handleWsMessage(ws, msg, setVaultId) { - switch (msg.type) { - case "register": { - const payload = msg.payload; - if (!payload.vault_id || !payload.public_key) { - this.sendWsError(ws, "RELAY_INVALID_ENVELOPE", "Missing vault_id or public_key"); - return; - } - if (!payload.signing_public_key || !payload.timestamp || !payload.nonce || !payload.signature) { - this.sendWsError(ws, "RELAY_UNAUTHORIZED", "Missing authentication fields (signing_public_key, timestamp, nonce, signature)"); - return; - } - try { - authenticateRegistration(payload, this.authConfig); - } catch (err) { - if (err instanceof RelayError2) { - this.sendWsError(ws, err.code, err.message); - } else { - this.sendWsError(ws, "RELAY_UNAUTHORIZED", "Authentication failed"); - } - return; - } - this.connectionStore.register(payload.vault_id, payload.public_key, ws); - this.wsConnections.set(payload.vault_id, ws); - setVaultId(payload.vault_id); - const ack = { - type: "ack", - payload: { vault_id: payload.vault_id, registered: true }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(ack)); - const pending = this.messageStore.getPendingMessages(payload.vault_id); - for (const envelope of pending) { - const reqMsg = { - type: "request", - payload: envelope, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(reqMsg)); - this.messageStore.markDelivered(envelope.request_id); - } - const pendingClaims = this.pairingClaimStore.getPendingClaimsForVault(payload.vault_id); - for (const claim of pendingClaims) { - const claimMsg = { - type: "pairing_claim", - payload: claim, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(claimMsg)); - } - if (this.config.debug) { - console.log( - `Vault ${payload.vault_id} registered (authenticated) - ${pending.length} pending messages, ${pendingClaims.length} pending claims` - ); - } - break; - } - case "heartbeat": { - const payload = msg.payload; - if (payload.vault_id) { - this.connectionStore.updateHeartbeat(payload.vault_id); - } - const ack = { - type: "heartbeat", - payload: { timestamp: (/* @__PURE__ */ new Date()).toISOString() }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(ack)); - break; - } - case "response": { - const response = msg.payload; - if (!response.request_id || !response.encrypted_payload) { - this.sendWsError(ws, "RELAY_INVALID_ENVELOPE", "Invalid response envelope"); - return; - } - this.messageStore.storeResponse(response.request_id, response); - this.notifyClientResponse(response); - const ack = { - type: "ack", - payload: { request_id: response.request_id, stored: true }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(ack)); - break; - } - case "unregister": { - const payload = msg.payload; - if (payload.vault_id) { - this.connectionStore.unregister(payload.vault_id); - this.wsConnections.delete(payload.vault_id); - setVaultId(""); - } - break; - } - case "pairing_result": { - const payload = msg.payload; - if (!payload.claim_id || !payload.action || !payload.vault_id) { - this.sendWsError(ws, "RELAY_INVALID_ENVELOPE", "Invalid pairing_result payload"); - return; - } - const status = payload.action === "approve" ? "approved" : "denied"; - const updated = this.pairingClaimStore.updateClaimStatus( - payload.claim_id, - status, - payload.agent_id - ); - const ack = { - type: "ack", - payload: { - claim_id: payload.claim_id, - status: updated ? status : "not_found" - }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - ws.send(JSON.stringify(ack)); - if (this.config.debug && updated) { - console.log(`Pairing claim ${payload.claim_id} ${status} via WebSocket`); - } - break; - } - default: - this.sendWsError(ws, "RELAY_INVALID_ENVELOPE", `Unknown message type: ${msg.type}`); - } - } - handleClientWsMessage(ws, msg) { - switch (msg.type) { - case "request": { - const envelope = msg.payload; - this.handleClientRequest(ws, envelope); - break; - } - case "heartbeat": { - const ack = { - type: "heartbeat", - payload: { timestamp: (/* @__PURE__ */ new Date()).toISOString() }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - this.sendWsMessage(ws, ack); - break; - } - default: - this.sendWsError(ws, "RELAY_INVALID_ENVELOPE", `Unknown message type: ${msg.type}`); - } - } - handleClientRequest(ws, envelope) { - const validationError = this.validateEnvelope(envelope); - if (validationError) { - this.sendWsError(ws, validationError.code, validationError.message, envelope.request_id); - return; - } - const existingResponse = this.messageStore.getResponse(envelope.request_id); - if (existingResponse) { - const responseMsg = { - type: "response", - payload: existingResponse, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - this.sendWsMessage(ws, responseMsg); - return; - } - if (this.messageStore.hasRequest(envelope.request_id)) { - this.registerClientRequest(envelope.request_id, ws); - this.sendWsMessage(ws, { - type: "ack", - payload: { request_id: envelope.request_id, accepted: true }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }); - return; - } - if (!this.rateLimiter.checkLimit(envelope.vault_id)) { - const resetTime = this.rateLimiter.getResetTime(envelope.vault_id); - this.sendWsError( - ws, - "RELAY_RATE_LIMITED", - `Rate limit exceeded for vault ${envelope.vault_id}. Try again in ${Math.ceil(resetTime / 1e3)} seconds.`, - envelope.request_id - ); - return; - } - if (!this.connectionStore.isConnected(envelope.vault_id)) { - this.sendWsError( - ws, - "RELAY_VAULT_NOT_CONNECTED", - `Vault ${envelope.vault_id} is not connected`, - envelope.request_id - ); - return; - } - try { - this.messageStore.storeMessage(envelope); - } catch (err) { - if (err instanceof RelayError2) { - this.sendWsError(ws, err.code, err.message, envelope.request_id); - return; - } - this.sendWsError(ws, "RELAY_UNAVAILABLE", "Failed to store message", envelope.request_id); - return; - } - this.registerClientRequest(envelope.request_id, ws); - const vaultWs = this.wsConnections.get(envelope.vault_id); - if (vaultWs && vaultWs.readyState === 1) { - const wsMsg = { - type: "request", - payload: envelope, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - vaultWs.send(JSON.stringify(wsMsg)); - this.messageStore.markDelivered(envelope.request_id); - } - this.sendWsMessage(ws, { - type: "ack", - payload: { request_id: envelope.request_id, accepted: true }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }); - } - registerClientRequest(requestId, ws) { - this.clientRequestMap.set(requestId, ws); - if (!this.clientRequestsBySocket.has(ws)) { - this.clientRequestsBySocket.set(ws, /* @__PURE__ */ new Set()); - } - this.clientRequestsBySocket.get(ws).add(requestId); - } - unregisterClientRequest(requestId) { - const ws = this.clientRequestMap.get(requestId); - if (!ws) - return; - this.clientRequestMap.delete(requestId); - const set = this.clientRequestsBySocket.get(ws); - if (set) { - set.delete(requestId); - if (set.size === 0) { - this.clientRequestsBySocket.delete(ws); - } - } - } - cleanupClientRequests(ws) { - const set = this.clientRequestsBySocket.get(ws); - if (!set) - return; - for (const requestId of set) { - this.clientRequestMap.delete(requestId); - } - this.clientRequestsBySocket.delete(ws); - } - notifyClientResponse(response) { - const ws = this.clientRequestMap.get(response.request_id); - if (!ws) - return; - if (ws.readyState === 1) { - const msg = { - type: "response", - payload: response, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - this.sendWsMessage(ws, msg); - } - this.unregisterClientRequest(response.request_id); - } - sendWsMessage(ws, msg) { - try { - ws.send(JSON.stringify(msg)); - } catch (err) { - if (this.config.debug) { - console.error("Failed to send WebSocket message:", err); - } - } - } - sendWsError(ws, code, message, requestId) { - const errMsg = { - type: "error", - payload: { code, message, request_id: requestId }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - this.sendWsMessage(ws, errMsg); - } - // -------------------------------------------------------------------------- - // Heartbeat Checker - // -------------------------------------------------------------------------- - startHeartbeatChecker() { - this.heartbeatInterval = setInterval(() => { - const stale = this.connectionStore.removeStale(this.config.heartbeatIntervalMs); - for (const vaultId of stale) { - const ws = this.wsConnections.get(vaultId); - if (ws) { - ws.close(1e3, "Heartbeat timeout"); - this.wsConnections.delete(vaultId); - } - if (this.config.debug) { - console.log(`Vault ${vaultId} removed (heartbeat timeout)`); - } - } - this.messageStore.cleanup(); - }, this.config.heartbeatIntervalMs); - } - // -------------------------------------------------------------------------- - // Validation - // -------------------------------------------------------------------------- - validateEnvelope(envelope) { - if (!envelope.version) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "Missing version"); - } - if (!envelope.vault_id) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "Missing vault_id"); - } - if (!envelope.request_id) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "Missing request_id"); - } - if (!envelope.action_type) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "Missing action_type"); - } - if (!["sign", "read", "write", "budget"].includes(envelope.action_type)) { - return new RelayError2("RELAY_INVALID_ENVELOPE", `Invalid action_type: ${envelope.action_type}`); - } - if (!envelope.encrypted_payload) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "Missing encrypted_payload"); - } - if (!envelope.expires_at) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "Missing expires_at"); - } - const expiresAt = new Date(envelope.expires_at).getTime(); - if (isNaN(expiresAt)) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "Invalid expires_at format"); - } - if (Date.now() > expiresAt) { - return new RelayError2("RELAY_MESSAGE_EXPIRED", "Message has expired"); - } - const ttl = expiresAt - Date.now(); - if (ttl > this.config.messageTtlMs) { - return new RelayError2("RELAY_INVALID_ENVELOPE", "TTL too long (max 5 minutes)", { - ttl_ms: ttl, - max_ttl_ms: this.config.messageTtlMs - }); - } - return null; - } - // -------------------------------------------------------------------------- - // Getters (for testing) - // -------------------------------------------------------------------------- - getMessageStore() { - return this.messageStore; - } - getConnectionStore() { - return this.connectionStore; - } - }; - var import_node_path = __toESM2(require("path")); - function parseArgs() { - const args = process.argv.slice(2); - let port = parseInt(process.env.DCP_RELAY_PORT || "", 10) || DEFAULT_RELAY_CONFIG.port; - let host = process.env.DCP_RELAY_HOST || DEFAULT_RELAY_CONFIG.host; - let debug = process.env.DCP_RELAY_DEBUG === "true" || false; - let rateLimitPerMinute = parseInt(process.env.DCP_RELAY_RATE_LIMIT || "", 10) || DEFAULT_RELAY_CONFIG.rateLimitPerMinute; - for (let i = 0; i < args.length; i++) { - const arg = args[i]; - if (arg === "--port" || arg === "-p") { - port = parseInt(args[++i], 10) || port; - } else if (arg === "--host" || arg === "-h") { - host = args[++i] || host; - } else if (arg === "--debug" || arg === "-d") { - debug = true; - } else if (arg === "--rate-limit" || arg === "-r") { - rateLimitPerMinute = parseInt(args[++i], 10) || rateLimitPerMinute; - } else if (arg === "--help") { - console.log(` -DCP Relay - Encrypted message bus for cloud MCP clients - -Usage: - dcp-relay [options] - -Options: - -p, --port Port to listen on (default: 8422) - -h, --host Host to bind to (default: 0.0.0.0) - -r, --rate-limit Max requests per vault per minute (default: 60) - -d, --debug Enable debug logging - --help Show this help message - -Environment Variables: - DCP_RELAY_PORT Port to listen on - DCP_RELAY_HOST Host to bind to - DCP_RELAY_DEBUG Enable debug logging (true/false) - DCP_RELAY_RATE_LIMIT Max requests per vault per minute - -Examples: - dcp-relay # Start on default port - dcp-relay --port 9000 # Start on port 9000 - dcp-relay --rate-limit 120 # 120 requests/min per vault - dcp-relay --debug # Start with debug logging -`); - process.exit(0); - } - } - return { port, host, debug, rateLimitPerMinute }; - } - async function main2() { - const { port, host, debug, rateLimitPerMinute } = parseArgs(); - const relay = new RelayServer({ - port, - host, - debug, - enableLongPoll: true, - rateLimitPerMinute - }); - const shutdown = async () => { - console.log("\nShutting down relay..."); - await relay.stop(); - process.exit(0); - }; - process.on("SIGINT", shutdown); - process.on("SIGTERM", shutdown); - try { - await relay.start(); - console.log(`DCP Relay running on ${host}:${port}`); - console.log("Press Ctrl+C to stop"); - } catch (err) { - console.error("Failed to start relay:", err); - process.exit(1); - } - } - var argvEntry = process.argv[1] ? import_node_path.default.basename(process.argv[1]) : ""; - var isDirectCliInvocation = argvEntry === "dcp-relay" || argvEntry === "dcp-relay.js" || argvEntry === "dcp-relay.mjs"; - var isMainModule = typeof require !== "undefined" && typeof module2 !== "undefined" && require.main === module2 || isDirectCliInvocation; - if (isMainModule) { - main2().catch(console.error); - } - } -}); - -// ../dcp-relay-client/dist/index.js -var require_dist7 = __commonJS({ - "../dcp-relay-client/dist/index.js"(exports2, module2) { - "use strict"; - var __create2 = Object.create; - var __defProp2 = Object.defineProperty; - var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; - var __getOwnPropNames2 = Object.getOwnPropertyNames; - var __getProtoOf2 = Object.getPrototypeOf; - var __hasOwnProp2 = Object.prototype.hasOwnProperty; - var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps2 = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames2(from)) - if (!__hasOwnProp2.call(to, key) && key !== except) - __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM2 = (mod2, isNodeMode, target) => (target = mod2 != null ? __create2(__getProtoOf2(mod2)) : {}, __copyProps2( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod2 || !mod2.__esModule ? __defProp2(target, "default", { value: mod2, enumerable: true }) : target, - mod2 - )); - var __toCommonJS2 = (mod2) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod2); - var index_exports = {}; - __export2(index_exports, { - ClientError: () => ClientError, - DEFAULT_CLIENT_CONFIG: () => DEFAULT_CLIENT_CONFIG, - HEARTBEAT_INTERVAL_MS: () => import_relay.HEARTBEAT_INTERVAL_MS, - HPKE_KEY_SIZE: () => HPKE_KEY_SIZE, - HPKE_NONCE_SIZE: () => HPKE_NONCE_SIZE, - HPKE_TAG_SIZE: () => HPKE_TAG_SIZE, - MESSAGE_TTL_MS: () => import_relay.MESSAGE_TTL_MS, - RECONNECT_MAX_MS: () => import_relay.RECONNECT_MAX_MS, - RECONNECT_MIN_MS: () => import_relay.RECONNECT_MIN_MS, - RELAY_VERSION: () => import_relay.RELAY_VERSION, - RelayClient: () => RelayClient2, - RelayError: () => import_relay.RelayError, - constructAad: () => constructAad, - createRelayClient: () => createRelayClient, - decodeFromBase64: () => decodeFromBase64, - decodePublicKey: () => decodePublicKey, - decrypt: () => decrypt, - deserializeEncrypted: () => deserializeEncrypted, - encodePublicKey: () => encodePublicKey, - encodeToBase64: () => encodeToBase64, - encrypt: () => encrypt, - generateKeyPair: () => generateKeyPair2, - generateKeyPairSync: () => generateKeyPairSync, - generateNonce: () => generateNonce, - generateSigningKeyPair: () => generateSigningKeyPair2, - serializeEncrypted: () => serializeEncrypted, - sign: () => sign2, - zeroize: () => zeroize - }); - module2.exports = __toCommonJS2(index_exports); - var import_ws2 = __toESM2(require_ws()); - var import_relay2 = require_dist6(); - var import_relay = require_dist6(); - var HPKE_KEY_SIZE = 32; - var HPKE_NONCE_SIZE = 0; - var HPKE_TAG_SIZE = 16; - var DEFAULT_CLIENT_CONFIG = { - autoReconnect: true, - reconnectMinMs: 1e3, - reconnectMaxMs: 6e4, - heartbeatIntervalMs: 3e4, - debug: false - }; - var ClientError = class extends Error { - constructor(code, message, details) { - super(message); - this.code = code; - this.details = details; - this.name = "ClientError"; - } - code; - details; - toJSON() { - return { - error: { - code: this.code, - message: this.message, - details: this.details - } - }; - } - }; - var import_core2 = require("@hpke/core"); - var import_dhkem_x25519 = require("@hpke/dhkem-x25519"); - var import_chacha20poly1305 = require("@hpke/chacha20poly1305"); - var import_sodium_native = __toESM2(require("sodium-native")); - var suite = new import_core2.CipherSuite({ - kem: new import_dhkem_x25519.DhkemX25519HkdfSha256(), - kdf: new import_core2.HkdfSha256(), - aead: new import_chacha20poly1305.Chacha20Poly1305() - }); - var ENCAP_SIZE = 32; - async function generateKeyPair2() { - const keyPair = await suite.kem.generateKeyPair(); - const publicKeyArray = await suite.kem.serializePublicKey(keyPair.publicKey); - const privateKeyArray = await suite.kem.serializePrivateKey(keyPair.privateKey); - return { - publicKey: Buffer.from(publicKeyArray), - privateKey: Buffer.from(privateKeyArray) - }; - } - function generateKeyPairSync() { - const publicKey2 = import_sodium_native.default.sodium_malloc(HPKE_KEY_SIZE); - const privateKey = import_sodium_native.default.sodium_malloc(HPKE_KEY_SIZE); - import_sodium_native.default.crypto_box_keypair(publicKey2, privateKey); - return { - publicKey: Buffer.from(publicKey2), - privateKey: Buffer.from(privateKey) - }; - } - function constructAad(envelope) { - const parts = [ - envelope.version, - envelope.vault_id, - envelope.request_id, - envelope.action_type - ]; - return new TextEncoder().encode(parts.join("|")); - } - async function encrypt(plaintext, recipientPublicKey, aad) { - if (recipientPublicKey.length !== HPKE_KEY_SIZE) { - throw new ClientError( - "CLIENT_INVALID_KEY", - `Recipient public key must be ${HPKE_KEY_SIZE} bytes` - ); - } - try { - const pubKeyArrayBuffer = new Uint8Array(recipientPublicKey).buffer; - const publicKey2 = await suite.kem.deserializePublicKey(pubKeyArrayBuffer); - const sender = await suite.createSenderContext({ recipientPublicKey: publicKey2 }); - const aadBytes = aad ? constructAad(aad) : new Uint8Array(0); - const aadArrayBuffer = aadBytes.buffer.slice( - aadBytes.byteOffset, - aadBytes.byteOffset + aadBytes.byteLength - ); - const plaintextArrayBuffer = new Uint8Array(plaintext).buffer; - const ciphertext = await sender.seal(plaintextArrayBuffer, aadArrayBuffer); - return { - // The encapsulated key (enc) is used instead of raw ephemeral public key - ephemeralPublicKey: Buffer.from(sender.enc), - nonce: Buffer.alloc(0), - // HPKE handles nonce internally - ciphertext: Buffer.from(ciphertext) - }; - } catch (err) { - throw new ClientError("CLIENT_ENCRYPTION_FAILED", "HPKE encryption failed", { - error: err instanceof Error ? err.message : String(err) - }); - } - } - async function decrypt(encrypted, privateKey, aad) { - if (privateKey.length !== HPKE_KEY_SIZE) { - throw new ClientError( - "CLIENT_INVALID_KEY", - `Private key must be ${HPKE_KEY_SIZE} bytes` - ); - } - if (encrypted.ephemeralPublicKey.length !== ENCAP_SIZE) { - throw new ClientError( - "CLIENT_INVALID_KEY", - `Encapsulated key must be ${ENCAP_SIZE} bytes` - ); - } - try { - const privKeyArrayBuffer = new Uint8Array(privateKey).buffer; - const recipientPrivateKey = await suite.kem.deserializePrivateKey(privKeyArrayBuffer); - const encArrayBuffer = new Uint8Array(encrypted.ephemeralPublicKey).buffer; - const recipient = await suite.createRecipientContext({ - recipientKey: recipientPrivateKey, - enc: encArrayBuffer - }); - const aadBytes = aad ? constructAad(aad) : new Uint8Array(0); - const aadArrayBuffer = aadBytes.buffer.slice( - aadBytes.byteOffset, - aadBytes.byteOffset + aadBytes.byteLength - ); - const ciphertextArrayBuffer = new Uint8Array(encrypted.ciphertext).buffer; - const plaintext = await recipient.open(ciphertextArrayBuffer, aadArrayBuffer); - return Buffer.from(plaintext); - } catch (err) { - throw new ClientError("CLIENT_DECRYPTION_FAILED", "HPKE decryption failed - invalid ciphertext, key, or AAD mismatch", { - error: err instanceof Error ? err.message : String(err) - }); - } - } - function serializeEncrypted(encrypted) { - return Buffer.concat([ - encrypted.ephemeralPublicKey, - encrypted.ciphertext - ]); - } - function deserializeEncrypted(data) { - if (data.length < ENCAP_SIZE + 16) { - throw new ClientError( - "CLIENT_DECRYPTION_FAILED", - "Encrypted data too short" - ); - } - const ephemeralPublicKey = data.subarray(0, ENCAP_SIZE); - const ciphertext = data.subarray(ENCAP_SIZE); - return { - ephemeralPublicKey: Buffer.from(ephemeralPublicKey), - nonce: Buffer.alloc(0), - // HPKE handles nonce internally - ciphertext: Buffer.from(ciphertext) - }; - } - function encodeToBase64(encrypted) { - return serializeEncrypted(encrypted).toString("base64"); - } - function decodeFromBase64(base64) { - const buffer = Buffer.from(base64, "base64"); - return deserializeEncrypted(buffer); - } - function encodePublicKey(publicKey2) { - return publicKey2.toString("base64"); - } - function decodePublicKey(base64) { - const key = Buffer.from(base64, "base64"); - if (key.length !== HPKE_KEY_SIZE) { - throw new ClientError( - "CLIENT_INVALID_KEY", - `Invalid public key length: ${key.length}, expected ${HPKE_KEY_SIZE}` - ); - } - return key; - } - function zeroize(buffer) { - import_sodium_native.default.sodium_memzero(buffer); - } - function generateSigningKeyPair2() { - const publicKey2 = import_sodium_native.default.sodium_malloc(32); - const privateKey = import_sodium_native.default.sodium_malloc(64); - import_sodium_native.default.crypto_sign_keypair(publicKey2, privateKey); - return { - publicKey: Buffer.from(publicKey2), - privateKey: Buffer.from(privateKey) - }; - } - function sign2(message, privateKey) { - if (privateKey.length !== 64) { - throw new ClientError("CLIENT_INVALID_KEY", "Ed25519 private key must be 64 bytes"); - } - const signature2 = import_sodium_native.default.sodium_malloc(64); - import_sodium_native.default.crypto_sign_detached(signature2, message, privateKey); - return Buffer.from(signature2); - } - function generateNonce(size = 32) { - const nonce = import_sodium_native.default.sodium_malloc(size); - import_sodium_native.default.randombytes_buf(nonce); - return Buffer.from(nonce); - } - var SimpleEmitter = class { - listeners = /* @__PURE__ */ new Map(); - on(event, callback) { - if (!this.listeners.has(event)) { - this.listeners.set(event, /* @__PURE__ */ new Set()); - } - this.listeners.get(event).add(callback); - } - off(event, callback) { - this.listeners.get(event)?.delete(callback); - } - emit(event, ...args) { - for (const callback of this.listeners.get(event) ?? []) { - try { - callback(...args); - } catch (err) { - console.error(`Error in event listener for ${event}:`, err); - } - } - } - }; - var RelayClient2 = class extends SimpleEmitter { - config; - ws = null; - state = "disconnected"; - reconnectAttempt = 0; - reconnectTimeout = null; - heartbeatInterval = null; - requestHandler = null; - pendingResponses = /* @__PURE__ */ new Map(); - constructor(config) { - super(); - this.config = { - ...DEFAULT_CLIENT_CONFIG, - ...config - }; - } - // -------------------------------------------------------------------------- - // Public API - // -------------------------------------------------------------------------- - /** - * Connect to the relay server - */ - async connect() { - if (this.state === "connected" || this.state === "connecting") { - throw new ClientError("CLIENT_ALREADY_CONNECTED", "Client is already connected or connecting"); - } - this.state = "connecting"; - await this.doConnect(); - } - /** - * Disconnect from the relay server - */ - disconnect() { - this.clearReconnectTimeout(); - this.clearHeartbeat(); - if (this.ws) { - this.sendWsMessage({ - type: "unregister", - payload: { vault_id: this.config.vaultId }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }); - this.ws.close(1e3, "Client disconnected"); - this.ws = null; - } - this.state = "disconnected"; - this.emit("disconnected", "Client disconnected"); - } - /** - * Set the request handler for incoming relay requests - */ - setRequestHandler(handler) { - this.requestHandler = handler; - } - /** - * Get current connection state - */ - getState() { - return this.state; - } - /** - * Check if connected - */ - isConnected() { - return this.state === "connected" && this.ws?.readyState === import_ws2.default.OPEN; - } - /** - * Encrypt a payload for sending to a recipient with AAD binding - * Used by MCP clients sending requests to vaults - */ - async encryptPayload(plaintext, recipientPublicKey, aad) { - const encrypted = await encrypt(plaintext, recipientPublicKey, aad); - return encodeToBase64(encrypted); - } - /** - * Decrypt a payload received from relay with AAD verification - */ - async decryptPayload(encryptedBase64, aad) { - const encrypted = decodeFromBase64(encryptedBase64); - return decrypt(encrypted, this.config.keyPair.privateKey, aad); - } - /** - * Get HPKE public key for sharing with clients - */ - getPublicKey() { - return encodePublicKey(this.config.keyPair.publicKey); - } - /** - * Get signing public key for relay authentication - */ - getSigningPublicKey() { - return this.config.signingKeyPair.publicKey.toString("base64"); - } - /** - * Send pairing result back to relay after user approves/denies a claim - * @param claimId - The claim ID to respond to - * @param approved - Whether the pairing was approved - * @param agentId - The assigned agent ID (only if approved) - */ - sendPairingResult(claimId, approved, agentId) { - return this.sendWsMessage({ - type: "pairing_result", - payload: { - claim_id: claimId, - action: approved ? "approve" : "deny", - agent_id: agentId, - vault_id: this.config.vaultId - }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }); - } - /** - * Cleanup resources - */ - destroy() { - this.disconnect(); - zeroize(this.config.keyPair.privateKey); - zeroize(this.config.signingKeyPair.privateKey); - } - // -------------------------------------------------------------------------- - // Connection Management - // -------------------------------------------------------------------------- - async doConnect() { - return new Promise((resolve, reject) => { - try { - let wsUrl = this.config.relayUrl; - if (wsUrl.startsWith("http://")) { - wsUrl = wsUrl.replace("http://", "ws://"); - } else if (wsUrl.startsWith("https://")) { - wsUrl = wsUrl.replace("https://", "wss://"); - } - if (!wsUrl.endsWith("/ws")) { - wsUrl = wsUrl.replace(/\/?$/, "/ws"); - } - this.ws = new import_ws2.default(wsUrl); - this.ws.on("open", () => { - this.state = "connected"; - this.reconnectAttempt = 0; - this.startHeartbeat(); - this.register(); - this.emit("connected"); - resolve(); - }); - this.ws.on("message", (data) => { - this.handleMessage(data); - }); - this.ws.on("close", (code, reason) => { - const reasonStr = reason.toString() || `Code ${code}`; - this.handleDisconnect(reasonStr); - }); - this.ws.on("error", (err) => { - if (this.state === "connecting") { - reject(new ClientError("CLIENT_CONNECTION_FAILED", err.message)); - } - this.emit("error", err); - }); - } catch (err) { - reject(new ClientError("CLIENT_CONNECTION_FAILED", err instanceof Error ? err.message : String(err))); - } - }); - } - /** - * Register with relay using signed authentication - */ - register() { - const timestamp = (/* @__PURE__ */ new Date()).toISOString(); - const nonce = generateNonce(32); - const message = Buffer.concat([ - Buffer.from(this.config.vaultId, "utf8"), - Buffer.from(timestamp, "utf8"), - nonce - ]); - const signature2 = sign2(message, this.config.signingKeyPair.privateKey); - const payload = { - vault_id: this.config.vaultId, - public_key: this.getPublicKey(), - signing_public_key: this.getSigningPublicKey(), - timestamp, - nonce: nonce.toString("base64"), - signature: signature2.toString("base64"), - pairing_token: this.config.pairingToken - }; - this.sendWsMessage({ - type: "register", - payload, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }); - } - handleDisconnect(reason) { - this.clearHeartbeat(); - this.ws = null; - const wasConnected = this.state === "connected"; - this.state = "disconnected"; - if (wasConnected) { - this.emit("disconnected", reason); - } - if (this.config.autoReconnect) { - this.scheduleReconnect(); - } - } - // -------------------------------------------------------------------------- - // Reconnection with Exponential Backoff + Jitter - // -------------------------------------------------------------------------- - scheduleReconnect() { - this.reconnectAttempt++; - const delay = this.calculateBackoff(); - this.state = "reconnecting"; - this.emit("reconnecting", this.reconnectAttempt, delay); - if (this.config.debug) { - console.log(`Reconnecting in ${delay}ms (attempt ${this.reconnectAttempt})`); - } - this.reconnectTimeout = setTimeout(async () => { - try { - this.state = "connecting"; - await this.doConnect(); - } catch (err) { - if (this.config.debug) { - console.error("Reconnect failed:", err); - } - this.emit("error", err instanceof Error ? err : new Error(String(err))); - this.handleDisconnect("Reconnect failed"); - } - }, delay); - } - /** - * Calculate backoff delay with jitter - * Formula: min(max, min * 2^attempt) + random jitter - */ - calculateBackoff() { - const minDelay = this.config.reconnectMinMs ?? import_relay.RECONNECT_MIN_MS; - const maxDelay = this.config.reconnectMaxMs ?? import_relay.RECONNECT_MAX_MS; - const exponentialDelay = minDelay * Math.pow(2, this.reconnectAttempt - 1); - const baseDelay = Math.min(exponentialDelay, maxDelay); - const jitter = Math.random() * 0.25 * baseDelay; - return Math.floor(baseDelay + jitter); - } - clearReconnectTimeout() { - if (this.reconnectTimeout) { - clearTimeout(this.reconnectTimeout); - this.reconnectTimeout = null; - } - } - // -------------------------------------------------------------------------- - // Heartbeat - // -------------------------------------------------------------------------- - startHeartbeat() { - this.clearHeartbeat(); - const interval = this.config.heartbeatIntervalMs ?? import_relay.HEARTBEAT_INTERVAL_MS; - this.heartbeatInterval = setInterval(() => { - if (this.isConnected()) { - this.sendWsMessage({ - type: "heartbeat", - payload: { - vault_id: this.config.vaultId, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }); - } - }, interval); - } - clearHeartbeat() { - if (this.heartbeatInterval) { - clearInterval(this.heartbeatInterval); - this.heartbeatInterval = null; - } - } - // -------------------------------------------------------------------------- - // Message Handling - // -------------------------------------------------------------------------- - handleMessage(data) { - try { - const msg = JSON.parse(data.toString()); - switch (msg.type) { - case "request": - this.handleRequest(msg.payload); - break; - case "ack": - if (this.config.debug) { - console.log("Received ack:", msg.payload); - } - break; - case "heartbeat": - break; - case "error": - const errPayload = msg.payload; - this.emit("error", new ClientError( - errPayload.code, - errPayload.message - )); - break; - case "pairing_claim": - this.emit("pairingClaim", msg.payload); - break; - default: - if (this.config.debug) { - console.log("Unknown message type:", msg.type); - } - } - } catch (err) { - if (this.config.debug) { - console.error("Failed to parse message:", err); - } - } - } - async handleRequest(envelope) { - this.emit("request", envelope); - if (!this.requestHandler) { - if (this.config.debug) { - console.log("No request handler set, ignoring request:", envelope.request_id); - } - return; - } - try { - const aad = { - version: envelope.version, - vault_id: envelope.vault_id, - request_id: envelope.request_id, - action_type: envelope.action_type - }; - const decryptedPayload = await this.decryptPayload(envelope.encrypted_payload, aad); - const responseData = await this.requestHandler(envelope.action_type, decryptedPayload); - if (!responseData || !Buffer.isBuffer(responseData.payload) || !Buffer.isBuffer(responseData.recipientPublicKey)) { - throw new Error("Request handler must return { payload: Buffer, recipientPublicKey: Buffer }"); - } - const encryptedResponse = await encrypt(responseData.payload, responseData.recipientPublicKey, aad); - const response = { - version: import_relay2.RELAY_VERSION, - request_id: envelope.request_id, - encrypted_payload: encodeToBase64(encryptedResponse), - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }; - this.sendWsMessage({ - type: "response", - payload: response, - timestamp: (/* @__PURE__ */ new Date()).toISOString() - }); - } catch (err) { - if (this.config.debug) { - console.error("Failed to handle request:", err); - } - this.emit("error", err instanceof Error ? err : new Error(String(err))); - } - } - // -------------------------------------------------------------------------- - // WebSocket Utilities - // -------------------------------------------------------------------------- - sendWsMessage(msg) { - if (!this.ws || this.ws.readyState !== import_ws2.default.OPEN) { - return false; - } - try { - this.ws.send(JSON.stringify(msg)); - return true; - } catch (err) { - if (this.config.debug) { - console.error("Failed to send message:", err); - } - return false; - } - } - }; - function createRelayClient(relayUrl, vaultId, keyPair, signingKeyPair, options = {}) { - return new RelayClient2({ - relayUrl, - vaultId, - keyPair, - signingKeyPair, - ...options - }); - } - } -}); - -// ../dcp-vault/dist/index.js -var dist_exports = {}; -__export(dist_exports, { - buildServer: () => buildServer -}); -module.exports = __toCommonJS(dist_exports); - -// ../dcp-vault/dist/server/index.js -var import_fastify = __toESM(require_fastify(), 1); -var import_cors = __toESM(require_cors(), 1); -var import_core = __toESM(require_dist5(), 1); -var fs = __toESM(require("fs"), 1); -var path = __toESM(require("path"), 1); -var os = __toESM(require("os"), 1); -var crypto5 = __toESM(require("crypto"), 1); -var import_keytar = __toESM(require("keytar"), 1); -var import_tweetnacl = __toESM(require_nacl_fast(), 1); -var import_relay_client = __toESM(require_dist7(), 1); -var DEFAULT_PORT = 8421; -var HOST = "127.0.0.1"; -var MCP_UNLOCK_KEYCHAIN_SERVICE = "dcp-mcp-unlock"; -var MCP_UNLOCK_KEYCHAIN_ACCOUNT = "passphrase"; -var MCP_UNLOCK_META_ACCOUNT = "meta"; -var MCP_UNLOCK_SESSION_MINUTES = parseInt(process.env.DCP_MCP_SESSION_MINUTES || "30", 10); -var PACKAGE_VERSION = getPackageVersion(); -var OWNER_TOKEN_IDLE_TIMEOUT_MS = 30 * 60 * 1e3; -var OWNER_TOKEN_MAX_AGE_MS = 4 * 60 * 60 * 1e3; -var CHALLENGE_TIMEOUT_MS = 60 * 1e3; -var DEFAULT_RELAY_URL = process.env.DCP_RELAY_URL || ""; -var ownerTokens = /* @__PURE__ */ new Map(); -var pendingChallenges = /* @__PURE__ */ new Map(); -var UNLOCK_MAX_ATTEMPTS = 5; -var UNLOCK_WINDOW_MS = 60 * 1e3; -var UNLOCK_LOCKOUT_MS = 5 * 60 * 1e3; -var unlockAttempts = /* @__PURE__ */ new Map(); -function getUnlockRateLimitKey(request) { - return "local"; -} -function checkUnlockRateLimit(key) { - const now = Date.now(); - let tracker = unlockAttempts.get(key); - if (!tracker) { - tracker = { attempts: [], locked_until: null }; - unlockAttempts.set(key, tracker); - } - if (tracker.locked_until && now < tracker.locked_until) { - const retry_after_seconds = Math.ceil((tracker.locked_until - now) / 1e3); - return { allowed: false, retry_after_seconds }; - } - if (tracker.locked_until && now >= tracker.locked_until) { - tracker.locked_until = null; - tracker.attempts = []; - } - const windowStart = now - UNLOCK_WINDOW_MS; - tracker.attempts = tracker.attempts.filter((t) => t > windowStart); - return { allowed: true }; -} -function recordUnlockFailure(key) { - const now = Date.now(); - let tracker = unlockAttempts.get(key); - if (!tracker) { - tracker = { attempts: [], locked_until: null }; - unlockAttempts.set(key, tracker); - } - tracker.attempts.push(now); - const windowStart = now - UNLOCK_WINDOW_MS; - tracker.attempts = tracker.attempts.filter((t) => t > windowStart); - if (tracker.attempts.length >= UNLOCK_MAX_ATTEMPTS) { - tracker.locked_until = now + UNLOCK_LOCKOUT_MS; - const retry_after_seconds = Math.ceil(UNLOCK_LOCKOUT_MS / 1e3); - return { locked: true, retry_after_seconds }; - } - return { locked: false }; -} -function clearUnlockRateLimit(key) { - unlockAttempts.delete(key); -} -var SIGNING_CHAINS = ["solana"]; -function normalizePermissionScope(scope) { - if (scope.startsWith("read:") || scope.startsWith("write:") || scope.startsWith("sign:")) { - return scope; - } - const lowerScope = scope.toLowerCase(); - if (SIGNING_CHAINS.includes(lowerScope)) { - return `sign:${lowerScope}`; - } - return `read:${scope}`; -} -function normalizePermissionScopes(scopes) { - if (!scopes || !Array.isArray(scopes)) - return []; - const normalized = scopes.map(normalizePermissionScope); - return [...new Set(normalized)]; -} -function getPackageVersion() { - try { - const entryPath = process.argv[1] ? path.dirname(process.argv[1]) : process.cwd(); - const candidates = [ - path.join(entryPath, "..", "package.json"), - path.join(process.cwd(), "packages", "dcp-vault", "package.json"), - path.join(process.cwd(), "package.json") - ]; - for (const p of candidates) { - if (fs.existsSync(p)) { - const raw = fs.readFileSync(p, "utf8"); - const json = JSON.parse(raw); - if (json.version) - return json.version; - } - } - return "0.0.0"; - } catch { - return "0.0.0"; - } -} -var storage; -var budget; -var relayClient = null; -var relayConnected = false; -var pendingPairingClaims = /* @__PURE__ */ new Map(); -var pendingVpsInviteNames = /* @__PURE__ */ new Map(); -var notifiedConsentIds = /* @__PURE__ */ new Set(); -var CONSENT_POLL_INTERVAL_MS = 1500; -var REMOTE_APPROVAL_POLL_INTERVAL_MS = parseInt(process.env.DCP_TELEGRAM_APPROVAL_POLL_MS || "5000", 10); -var REMOTE_APPROVAL_FETCH_TIMEOUT_MS = parseInt(process.env.DCP_TELEGRAM_APPROVAL_FETCH_TIMEOUT_MS || "8000", 10); -async function fetchWithTimeout(url, init) { - const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), REMOTE_APPROVAL_FETCH_TIMEOUT_MS); - try { - return await fetch(url, { - ...init, - signal: controller.signal - }); - } finally { - clearTimeout(timeout); - } -} -function findActiveSessionForScope(agentName, scope) { - const sessions = storage.listActiveSessionsForAgent(agentName); - for (const session of sessions) { - if (session.granted_scopes.includes(scope)) { - return session.id; - } - for (const granted of session.granted_scopes) { - if (granted.endsWith(".*")) { - const prefix = granted.slice(0, -2); - if (scope.startsWith(prefix + ".")) { - return session.id; - } - } - } - } - return void 0; -} -function scopeMatches(pattern, scope) { - if (pattern === scope) - return true; - if (pattern.endsWith(".*")) { - const prefix = pattern.slice(0, -2); - return scope.startsWith(prefix + "."); - } - return false; -} -function isWriteAllowed(agentName, scope) { - const config = budget.getConfig(); - const permissions = config.write_permissions || {}; - const allowed = permissions[agentName]; - if (!allowed || allowed.length === 0) { - return false; - } - return allowed.some((pattern) => scopeMatches(pattern, scope)); -} -function inferItemType(scope) { - if (scope.startsWith("identity.")) - return "IDENTITY"; - if (scope.startsWith("address.")) - return "ADDRESS"; - if (scope.startsWith("preferences.")) - return "PREFERENCES"; - if (scope.startsWith("crypto.")) - return "WALLET_KEY"; - if (scope.startsWith("credentials.")) - return "CREDENTIALS"; - if (scope.startsWith("health.")) - return "HEALTH"; - if (scope.startsWith("budget.")) - return "BUDGET"; - return "PREFERENCES"; -} -function inferSensitivity(scope) { - if (scope.startsWith("identity.passport") || scope.startsWith("identity.drivers_license") || scope.startsWith("crypto.")) { - return "critical"; - } - if (scope.startsWith("credentials.")) { - return "sensitive"; - } - if (scope.startsWith("identity.") || scope.startsWith("address.") || scope.startsWith("health.")) { - return "sensitive"; - } - return "standard"; -} -function ensureSchemaVersion(data) { - if ("schema_version" in data) { - return data; - } - return { ...data, schema_version: "1.0" }; -} -function normalizeWriteData(scope, data) { - const base = ensureSchemaVersion(data); - if (scope.startsWith("credentials.api.")) { - return validateAndNormalizeCredentialsApi(base); - } - return base; -} -function validateAndNormalizeCredentialsApi(data) { - const allowedKeys = [ - "schema_version", - "label", - "service", - "key", - "base_url", - "auth_type", - "headers" - ]; - for (const key of Object.keys(data)) { - if (!allowedKeys.includes(key)) { - throw new import_core.VaultError("INVALID_SCHEMA", `Unexpected field in credentials.api: ${key}`); - } - } - const normalized = { - schema_version: String(data.schema_version || "1.0"), - label: data.label ?? null, - service: data.service ?? null, - key: data.key ?? null, - base_url: data.base_url ?? null, - auth_type: data.auth_type ?? null, - headers: data.headers ?? null - }; - if (typeof normalized.schema_version !== "string") { - throw new import_core.VaultError("INVALID_SCHEMA", "schema_version must be a string"); - } - if (normalized.label !== null && typeof normalized.label !== "string") { - throw new import_core.VaultError("INVALID_SCHEMA", "label must be a string or null"); - } - if (normalized.service !== null && typeof normalized.service !== "string") { - throw new import_core.VaultError("INVALID_SCHEMA", "service must be a string or null"); - } - if (normalized.key !== null && typeof normalized.key !== "string") { - throw new import_core.VaultError("INVALID_SCHEMA", "key must be a string or null"); - } - if (normalized.base_url !== null && typeof normalized.base_url !== "string") { - throw new import_core.VaultError("INVALID_SCHEMA", "base_url must be a string or null"); - } - if (normalized.auth_type !== null && typeof normalized.auth_type !== "string") { - throw new import_core.VaultError("INVALID_SCHEMA", "auth_type must be a string or null"); - } - if (normalized.headers !== null && (typeof normalized.headers !== "object" || Array.isArray(normalized.headers))) { - throw new import_core.VaultError("INVALID_SCHEMA", "headers must be an object or null"); - } - return normalized; -} -function normalizeAmount(amount) { - if (amount === void 0 || amount === null) - return void 0; - if (typeof amount === "number") - return amount; - if (typeof amount === "string" && amount.trim().length > 0) { - const parsed = Number(amount); - if (!Number.isFinite(parsed)) { - throw new import_core.VaultError("INTERNAL_ERROR", "Invalid amount"); - } - return parsed; - } - return void 0; -} -var TELEGRAM_CLOUD_URL = process.env.DCP_TELEGRAM_CLOUD_URL || "https://telegram.dcp.1ly.store"; -function categorizeTelegramRequest(action, scope) { - if (action === "sign_tx" || scope.startsWith("crypto.wallet")) { - return "transaction_signing"; - } - if (action === "sign_message") { - return "message_signing"; - } - if (action === "read") { - return "data_read"; - } - if (action === "write") { - return "data_write"; - } - if (scope.startsWith("credentials.")) { - return "credential_access"; - } - return "other"; -} -function getApprovalBaseUrl() { - const port = process.env.VAULT_PORT || String(DEFAULT_PORT); - return `http://127.0.0.1:${port}`; -} -function getAgentDisplayNameForRequest(body, fallbackAgentName) { - const serviceId = typeof body.service_id === "string" ? body.service_id : void 0; - if (!serviceId || !serviceId.startsWith("agent_") && !serviceId.startsWith("vps_")) { - return void 0; - } - const agent2 = storage.getAgentConnection(serviceId); - if (!agent2 || agent2.status !== "active" || !agent2.name || agent2.name === fallbackAgentName) { - return void 0; - } - return agent2.name; -} -function consentDetailsWithDisplayName(body, fallbackAgentName, details) { - const merged = { ...details || {} }; - const displayAgentName = getAgentDisplayNameForRequest(body, fallbackAgentName); - if (displayAgentName) { - merged.display_agent_name = displayAgentName; - } - return Object.keys(merged).length > 0 ? JSON.stringify(merged) : void 0; -} -async function dispatchTelegramNotification(consent) { - console.log("[TG] dispatchTelegramNotification called for consent:", consent.id); - try { - const telegramConfig = storage.getTelegramConfig(); - if (!telegramConfig || !telegramConfig.enabled) { - console.log("[TG] Skipping - not enabled"); - return; - } - if (!telegramConfig.notify_consent) { - console.log("[TG] Skipping - consent notifications disabled"); - return; - } - const identity = await ensureRelayIdentity(); - const vaultId = identity.vaultId; - console.log("[TG] vault_id:", vaultId); - const nonce = crypto5.randomBytes(16).toString("base64"); - const category = categorizeTelegramRequest(consent.action, consent.scope); - let amount; - let currency; - let chain; - let displayAgentName = consent.agent_name; - if (consent.details) { - try { - const details = typeof consent.details === "string" ? JSON.parse(consent.details) : consent.details; - amount = typeof details.amount === "number" ? details.amount : void 0; - currency = typeof details.currency === "string" ? details.currency : void 0; - chain = typeof details.chain === "string" ? details.chain : void 0; - displayAgentName = typeof details.display_agent_name === "string" ? details.display_agent_name : displayAgentName; - } catch { - } - } - const payloadWithoutSig = { - vault_id: vaultId, - event: "consent_created", - data: { - consent_id: consent.id, - agent_name: displayAgentName, - category, - scope: consent.scope, - // Include scope for better context (e.g., "identity.email", "sign:solana") - created_at: consent.created_at || (/* @__PURE__ */ new Date()).toISOString(), - expires_at: consent.expires_at, - review_link: `${getApprovalBaseUrl()}/consent/${consent.id}`, - // Include transaction context for informed consent decisions - ...amount !== void 0 && { amount }, - ...currency && { currency }, - ...chain && { chain } - }, - timestamp: (/* @__PURE__ */ new Date()).toISOString(), - nonce - }; - const message = Buffer.from((0, import_core.canonicalJson)(payloadWithoutSig), "utf8"); - const signatureBytes = import_tweetnacl.default.sign.detached(new Uint8Array(message), new Uint8Array(identity.signingKeyPair.privateKey)); - const signature2 = Buffer.from(signatureBytes).toString("base64"); - const payload = { - ...payloadWithoutSig, - signature: signature2 - }; - const webhookUrl = `${TELEGRAM_CLOUD_URL}/webhook/consent`; - console.log("[TG] Calling cloud webhook:", webhookUrl); - const response = await fetch(webhookUrl, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(payload) - }); - const result = await response.json(); - console.log("[TG] Cloud response:", response.status, result); - if (response.ok && result.sent) { - storage.recordTelegramNotification(); - storage.logTelegramNotification({ - consent_id: consent.id, - chat_id: telegramConfig.chat_id || "cloud", - notification_type: "consent_request" - }); - console.log("[TG] Notification sent via cloud"); - } else if (response.status === 404) { - console.log("[TG] Vault not paired with cloud Telegram service"); - } else { - console.log("[TG] Cloud error:", result.error || result.reason); - } - } catch (err) { - console.log("[TG] Exception:", err); - } -} -async function dispatchBudgetExceededNotification(params) { - console.log("[TG] dispatchBudgetExceededNotification called:", params.error_code); - try { - const telegramConfig = storage.getTelegramConfig(); - if (!telegramConfig || !telegramConfig.enabled) { - console.log("[TG] Skipping budget notification - not enabled"); - return; - } - const identity = await ensureRelayIdentity(); - const vaultId = identity.vaultId; - const publicKeyBase64 = identity.signingKeyPair.publicKey.toString("base64"); - try { - await fetch(`${TELEGRAM_CLOUD_URL}/register`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ vault_id: vaultId, public_key: publicKeyBase64 }) - }); - } catch { - } - const nonce = crypto5.randomBytes(16).toString("base64"); - const payloadWithoutSig = { - vault_id: vaultId, - event: "budget_exceeded", - data: { - agent_name: params.agent_name, - amount: params.amount, - currency: params.currency, - chain: params.chain, - error_code: params.error_code, - remaining_daily: params.remaining_daily, - remaining_tx: params.remaining_tx, - limit_daily: params.limit_daily, - limit_tx: params.limit_tx, - message: params.error_code === "BUDGET_EXCEEDED_DAILY" ? `Daily budget exceeded! Agent "${params.agent_name}" tried to spend ${params.amount} ${params.currency} but daily limit is ${params.limit_daily} ${params.currency}. Open Desktop app to increase limits.` : `Transaction limit exceeded! Agent "${params.agent_name}" tried to spend ${params.amount} ${params.currency} but per-tx limit is ${params.limit_tx} ${params.currency}. Open Desktop app to increase limits.` - }, - timestamp: (/* @__PURE__ */ new Date()).toISOString(), - nonce - }; - const message = Buffer.from((0, import_core.canonicalJson)(payloadWithoutSig), "utf8"); - const signatureBytes = import_tweetnacl.default.sign.detached(new Uint8Array(message), new Uint8Array(identity.signingKeyPair.privateKey)); - const signature2 = Buffer.from(signatureBytes).toString("base64"); - const payload = { - ...payloadWithoutSig, - signature: signature2 - }; - const webhookUrl = `${TELEGRAM_CLOUD_URL}/webhook/budget`; - console.log("[TG] Calling budget webhook:", webhookUrl); - const response = await fetch(webhookUrl, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(payload) - }); - const result = await response.json(); - console.log("[TG] Budget notification response:", response.status, result); - if (response.ok && result.sent) { - storage.logTelegramNotification({ - consent_id: `budget_${Date.now()}`, - chat_id: telegramConfig.chat_id || "cloud", - notification_type: "budget_alert" - }); - console.log("[TG] Budget exceeded notification sent via cloud"); - } else if (response.status === 404) { - console.log("[TG] Vault not paired with cloud Telegram service"); - } else { - console.log("[TG] Cloud error:", result.error || result.reason); - } - } catch (err) { - console.log("[TG] Budget notification exception:", err); - } -} -function startConsentWatcher() { - console.log("[TG-WATCHER] Starting consent watcher..."); - const poll = () => { - try { - const pendingConsents = storage.getPendingConsents(); - for (const consent of pendingConsents) { - if (notifiedConsentIds.has(consent.id)) { - continue; - } - notifiedConsentIds.add(consent.id); - if (consent.status === "pending") { - console.log("[TG-WATCHER] New consent detected:", consent.id); - dispatchTelegramNotification({ - id: consent.id, - agent_name: consent.agent_name, - action: consent.action, - scope: consent.scope, - created_at: consent.created_at, - expires_at: consent.expires_at, - details: consent.details - }).catch((err) => { - console.log("[TG-WATCHER] Notification error:", err); - }); - } - } - const pendingIds = new Set(pendingConsents.map((c) => c.id)); - for (const id of notifiedConsentIds) { - if (!pendingIds.has(id)) { - notifiedConsentIds.delete(id); - } - } - } catch (err) { - console.log("[TG-WATCHER] Poll error:", err); - } - setTimeout(poll, CONSENT_POLL_INTERVAL_MS); - }; - poll(); -} -function processRemoteApprovalCommand(command) { - const consent = storage.getPendingConsent(command.consent_id); - if (!consent) { - return "consent not found"; - } - if (consent.status !== "pending") { - return `consent already ${consent.status}`; - } - if (new Date(consent.expires_at) < /* @__PURE__ */ new Date()) { - storage.resolveConsent(consent.id, "expired"); - return "consent expired"; - } - if (command.action === "approve") { - storage.resolveConsent(consent.id, "approved"); - storage.logAudit("GRANT", "success", { - agentName: consent.agent_name, - scope: consent.scope, - operation: "telegram_remote_grant", - details: JSON.stringify({ command_id: command.id, consent_mode: "once" }) - }); - return "success"; - } - if (command.action === "deny") { - storage.resolveConsent(consent.id, "denied"); - storage.logAudit("DENY", "denied", { - agentName: consent.agent_name, - scope: consent.scope, - operation: consent.action, - details: JSON.stringify({ command_id: command.id, source: "telegram_remote" }) - }); - return "success"; - } - return `unknown action: ${command.action}`; -} -async function acknowledgeRemoteApproval(commandId, result) { - const response = await fetchWithTimeout(`${TELEGRAM_CLOUD_URL}/api/approvals/processed`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ command_id: commandId, result }) - }); - if (!response.ok) { - const body = await response.text(); - throw new Error(`Failed to acknowledge remote approval: ${response.status} ${body}`); - } -} -async function pollRemoteApprovals() { - const telegramConfig = storage.getTelegramConfig(); - if (!telegramConfig || !telegramConfig.enabled || !telegramConfig.notify_consent) { - return; - } - const identity = await ensureRelayIdentity(); - const vaultId = identity.vaultId; - const response = await fetchWithTimeout(`${TELEGRAM_CLOUD_URL}/api/approvals/${vaultId}`); - if (response.status === 404 || response.status === 403) { - return; - } - if (!response.ok) { - const body = await response.text(); - throw new Error(`Failed to fetch remote approvals: ${response.status} ${body}`); - } - const payload = await response.json(); - const commands = payload.commands || []; - if (commands.length > 0) { - console.log(`[TG-APPROVAL] Fetched ${commands.length} remote command(s) for vault ${vaultId}: ${commands.map((command) => command.id).join(", ")}`); - } - for (const command of commands) { - let result = "success"; - try { - result = processRemoteApprovalCommand(command); - } catch (err) { - result = err instanceof Error ? err.message : "unknown processing error"; - } - try { - await acknowledgeRemoteApproval(command.id, result); - console.log(`[TG-APPROVAL] Processed remote command ${command.id} (${command.action}) for consent ${command.consent_id}: ${result}`); - } catch (err) { - console.log("[TG-APPROVAL] Ack error:", err); - } - } -} -function startRemoteApprovalWatcher() { - console.log("[TG-APPROVAL] Starting remote approval watcher..."); - const poll = async () => { - try { - await pollRemoteApprovals(); - } catch (err) { - console.log("[TG-APPROVAL] Poll error:", err); - } finally { - setTimeout(poll, REMOTE_APPROVAL_POLL_INTERVAL_MS); - } - }; - poll(); -} -function verifyEd25519Signature(message, signature2, publicKey2) { - try { - return import_tweetnacl.default.sign.detached.verify(message, signature2, publicKey2); - } catch { - return false; - } -} -function generateChallenge() { - return crypto5.randomBytes(32).toString("base64"); -} -function generateOwnerToken() { - return crypto5.randomBytes(48).toString("base64url"); -} -function isOwnerRequest(request) { - const token = request.headers["x-dcp-owner-token"]; - if (!token) - return false; - const ownerToken = ownerTokens.get(token); - if (!ownerToken) - return false; - const now = Date.now(); - if (now - ownerToken.created_at > OWNER_TOKEN_MAX_AGE_MS) { - ownerTokens.delete(token); - return false; - } - if (now - ownerToken.last_used_at > OWNER_TOKEN_IDLE_TIMEOUT_MS) { - ownerTokens.delete(token); - return false; - } - ownerToken.last_used_at = now; - return true; -} -function requireOwnerToken(request) { - if (!isOwnerRequest(request)) { - throw new import_core.VaultError("UNAUTHORIZED", "Valid owner token required"); - } -} -function cleanupOwnerState() { - const now = Date.now(); - for (const [token, data] of ownerTokens.entries()) { - if (now - data.created_at > OWNER_TOKEN_MAX_AGE_MS || now - data.last_used_at > OWNER_TOKEN_IDLE_TIMEOUT_MS) { - ownerTokens.delete(token); - } - } - for (const [desktopId, challenge] of pendingChallenges.entries()) { - if (now > challenge.expires_at) { - pendingChallenges.delete(desktopId); - } - } -} -async function buildServer() { - const isDev = process.env.NODE_ENV !== "production" && !process.env.DCP_BUNDLED; - const loggerConfig = isDev ? { - level: "info", - transport: { - target: "pino-pretty", - options: { - translateTime: "HH:MM:ss", - ignore: "pid,hostname" - } - } - } : { level: "info" }; - const server = (0, import_fastify.default)({ - logger: loggerConfig - }); - const allowedOrigins = /* @__PURE__ */ new Set([ - "tauri://localhost", - "https://tauri.localhost", - "http://localhost:1420", - "http://127.0.0.1:1420" - ]); - await server.register(import_cors.default, { - origin: (origin, cb) => { - if (!origin) - return cb(null, true); - if (allowedOrigins.has(origin)) - return cb(null, true); - try { - const url = new URL(origin); - if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { - return cb(null, true); - } - } catch { - } - return cb(new Error("Not allowed by CORS"), false); - }, - methods: ["GET", "POST", "DELETE", "PATCH"] - }); - const vaultDir = process.env.VAULT_DIR; - storage = (0, import_core.getStorage)(vaultDir); - storage.initializeSchema(); - budget = (0, import_core.getBudgetEngine)(storage, vaultDir); - server.setErrorHandler((error, request, reply) => { - if (error instanceof import_core.VaultError) { - reply.status(400).send(error.toJSON()); - } else { - server.log.error(error); - reply.status(500).send({ - error: { - code: "INTERNAL_ERROR", - message: error.message - } - }); - } - }); - server.get("/health", async () => { - const initialized = await storage.isProvisioned(); - return { - status: "ok", - initialized, - unlocked: storage.isUnlocked(), - version: PACKAGE_VERSION - }; - }); - server.get("/", async (_request, reply) => { - reply.header("Cache-Control", "no-store").type("text/html").send(` - - - - - DCP Vault Approval - - - -
-
-
-
-
DCP Vault Approval
-
Local only \u2014 http://127.0.0.1:8420
-
-
- -
checking...
-
-
-
-
MCP: unknown
-
- - -
-
-
-
- -
-
-
-
Unlock Vault
-
Required once per server process. Passphrase never leaves your machine.
-
-
-
- - -
-
-
- -
-
-
-
Vault Locked
-
Unlock to view or approve requests.
-
-
locked
-
-
- -
-
-
-
Pending Requests
-
Approve or deny agent requests. Auto-refreshes every 5s.
-
- -
-
-
-
-
- - - -`); - }); - server.post("/v1/vault/unlock", async (request, reply) => { - const rateLimitKey = getUnlockRateLimitKey(request); - const rateCheck = checkUnlockRateLimit(rateLimitKey); - if (!rateCheck.allowed) { - reply.code(429); - return { - error: { - code: "RATE_LIMITED", - message: `Too many failed unlock attempts. Try again in ${rateCheck.retry_after_seconds} seconds.`, - retry_after_seconds: rateCheck.retry_after_seconds - } - }; - } - const body = request.body; - if (!body || typeof body.passphrase !== "string" || body.passphrase.length === 0) { - throw new import_core.VaultError("INTERNAL_ERROR", "passphrase is required"); - } - try { - await storage.unlock(body.passphrase); - clearUnlockRateLimit(rateLimitKey); - if (!relayConnected && await storage.isProvisioned()) { - startRelayClient(server).catch((err) => { - server.log.error(err, "Relay client failed to start after unlock"); - }); - } - return { unlocked: true }; - } catch (err) { - if (err instanceof import_core.VaultError && err.message.includes("Wrong passphrase")) { - const lockResult = recordUnlockFailure(rateLimitKey); - if (lockResult.locked) { - reply.code(429); - return { - error: { - code: "RATE_LIMITED", - message: `Too many failed unlock attempts. Account locked for ${lockResult.retry_after_seconds} seconds.`, - retry_after_seconds: lockResult.retry_after_seconds - } - }; - } - throw new import_core.VaultError("INTERNAL_ERROR", "Wrong passphrase"); - } - throw err; - } - }); - server.post("/v1/vault/unlock-mcp", async (request) => { - const body = request.body; - if (!body || typeof body.passphrase !== "string" || body.passphrase.length === 0) { - throw new import_core.VaultError("INTERNAL_ERROR", "passphrase is required"); - } - try { - const expiresAt = new Date(Date.now() + MCP_UNLOCK_SESSION_MINUTES * 60 * 1e3).toISOString(); - await import_keytar.default.setPassword(MCP_UNLOCK_KEYCHAIN_SERVICE, MCP_UNLOCK_KEYCHAIN_ACCOUNT, body.passphrase); - await import_keytar.default.setPassword(MCP_UNLOCK_KEYCHAIN_SERVICE, MCP_UNLOCK_META_ACCOUNT, JSON.stringify({ expires_at: expiresAt })); - } catch { - throw new import_core.VaultError("INTERNAL_ERROR", "Keychain unavailable. Use CLI unlock or vault_unlock instead."); - } - const dir = vaultDir || path.join(os.homedir(), ".dcp"); - const unlockPath = path.join(dir, "mcp.unlock"); - const payload = JSON.stringify({ created_at: (/* @__PURE__ */ new Date()).toISOString() }); - fs.writeFileSync(unlockPath, payload, { mode: 384 }); - return { queued: true }; - }); - server.get("/v1/vault/mcp-status", async () => { - try { - const dir = vaultDir || path.join(os.homedir(), ".dcp"); - const statusPath = path.join(dir, "mcp.status"); - if (!fs.existsSync(statusPath)) { - return { running: false, unlocked: false }; - } - const raw = fs.readFileSync(statusPath, "utf8"); - const data = JSON.parse(raw); - if (data.pid) { - try { - process.kill(data.pid, 0); - } catch { - return { running: false, unlocked: false }; - } - } - return { - running: true, - unlocked: Boolean(data.unlocked), - updated_at: data.updated_at, - pid: data.pid - }; - } catch { - return { running: false, unlocked: false }; - } - }); - server.post("/v1/vault/setup-local-mcp", async (request) => { - requireOwnerToken(request); - const body = request.body || {}; - const agentType = body.agent_type || "claude-desktop"; - const agentTypeMapping = { - "claude-desktop": { id: "agent_claude_desktop", name: "Claude Desktop" }, - "cursor": { id: "agent_cursor", name: "Cursor" }, - "vscode": { id: "agent_vscode", name: "VS Code" }, - "openclaw": { id: "agent_openclaw_local", name: "OpenClaw" }, - "other": { id: "agent_local_mcp", name: body.custom_name || "Local MCP" } - }; - const { id: LOCAL_MCP_AGENT_ID, name: LOCAL_MCP_AGENT_NAME } = agentTypeMapping[agentType] || agentTypeMapping["claude-desktop"]; - const existingConnection = storage.getAgentConnection(LOCAL_MCP_AGENT_ID); - if (existingConnection?.status === "active") { - const agentConfigDir2 = path.join(os.homedir(), ".dcp", "agents"); - const configPath2 = path.join(agentConfigDir2, `${LOCAL_MCP_AGENT_ID}.json`); - if (fs.existsSync(configPath2)) { - try { - const configData = JSON.parse(fs.readFileSync(configPath2, "utf-8")); - const configPublicKey = configData.service_keypair?.public; - const storedPublicKey = existingConnection.service_public_key; - if (configPublicKey && storedPublicKey && configPublicKey === storedPublicKey) { - return { - success: true, - agent_id: LOCAL_MCP_AGENT_ID, - agent_name: LOCAL_MCP_AGENT_NAME, - already_configured: true, - message: "Local MCP agent already configured" - }; - } - console.log("[LOCAL_MCP] Public key mismatch, regenerating..."); - } catch { - console.log("[LOCAL_MCP] Config file corrupted, regenerating..."); - } - } - } - const identity = await ensureRelayIdentity(); - const permissionScopes = []; - const keypair = (0, import_relay_client.generateSigningKeyPair)(); - const servicePublicKey = keypair.publicKey.toString("base64"); - const servicePrivateKey = keypair.privateKey.toString("base64"); - const sessionToken = crypto5.randomBytes(32).toString("base64url"); - const sessionTokenHash = crypto5.createHash("sha256").update(sessionToken).digest("hex"); - if (!existingConnection) { - storage.createAgentConnection({ - agent_id: LOCAL_MCP_AGENT_ID, - name: LOCAL_MCP_AGENT_NAME, - mode: "mcp", - permission_scopes: permissionScopes, - budget: { daily: 0, currency: "USD", auto_approve_under: 0 }, - tier: "local" - }); - } - storage.markAgentPaired(LOCAL_MCP_AGENT_ID, sessionTokenHash, servicePublicKey); - const agentConfig = { - agent_id: LOCAL_MCP_AGENT_ID, - agent_name: LOCAL_MCP_AGENT_NAME, - vault_id: identity.vaultId, - mode: "mcp", - vault_hpke_public_key: identity.hpkeKeyPair.publicKey.toString("base64"), - vault_signing_public_key: identity.signingKeyPair.publicKey.toString("base64"), - permission_scopes: permissionScopes, - budget: { daily: 0, currency: "USD", auto_approve_under: 0 }, - tier: "local", - relay_url: identity.relayUrl || DEFAULT_RELAY_URL || import_core.DEFAULT_RELAY_URL, - service_keypair: { - public: servicePublicKey, - private: servicePrivateKey - }, - session_token: sessionToken, - paired_at: (/* @__PURE__ */ new Date()).toISOString() - }; - const agentConfigDir = path.join(os.homedir(), ".dcp", "agents"); - if (!fs.existsSync(agentConfigDir)) { - fs.mkdirSync(agentConfigDir, { recursive: true, mode: 448 }); - } - const configPath = path.join(agentConfigDir, `${LOCAL_MCP_AGENT_ID}.json`); - fs.writeFileSync(configPath, JSON.stringify(agentConfig, null, 2), { mode: 384 }); - storage.logAudit("CONFIG", "success", { - operation: "local_mcp_setup", - details: JSON.stringify({ - agent_id: LOCAL_MCP_AGENT_ID, - agent_name: LOCAL_MCP_AGENT_NAME - }) - }); - return { - success: true, - agent_id: LOCAL_MCP_AGENT_ID, - agent_name: LOCAL_MCP_AGENT_NAME, - already_configured: false, - message: "Local MCP agent configured successfully" - }; - }); - server.get("/v1/vault/local-mcp-status", async (request) => { - const agentType = request.query.agent_type; - const agentConfigDir = path.join(os.homedir(), ".dcp", "agents"); - const knownLocalAgents = [ - "agent_claude_desktop", - "agent_cursor", - "agent_vscode", - "agent_openclaw_local", - "agent_local_mcp" - ]; - if (agentType) { - const agentIdMap = { - "claude-desktop": "agent_claude_desktop", - "cursor": "agent_cursor", - "vscode": "agent_vscode", - "openclaw": "agent_openclaw_local", - "other": "agent_local_mcp" - }; - const agentId = agentIdMap[agentType]; - if (agentId) { - const configPath = path.join(agentConfigDir, `${agentId}.json`); - const configExists = fs.existsSync(configPath); - const connection = storage.getAgentConnection(agentId); - const hasConnection = connection !== void 0; - return { - configured: configExists && hasConnection, - config_exists: configExists, - connection_status: connection?.status || "none", - agent_id: agentId - }; - } - } - const localAgents = []; - if (fs.existsSync(agentConfigDir)) { - const files = fs.readdirSync(agentConfigDir); - for (const file of files) { - if (file.endsWith(".json")) { - const agentId = file.replace(".json", ""); - const connection = storage.getAgentConnection(agentId); - if (connection && connection.mode === "mcp") { - localAgents.push({ - agent_id: agentId, - name: connection.name, - configured: true, - status: connection.status - }); - } - } - } - } - const hasAnyConfigured = localAgents.length > 0; - const firstAgent = localAgents[0]; - return { - configured: hasAnyConfigured, - config_exists: hasAnyConfigured, - connection_status: firstAgent?.status || "none", - agent_id: firstAgent?.agent_id || "", - local_agents: localAgents - }; - }); - server.post("/v1/desktop/register", async (request) => { - const { desktop_id, public_key } = request.body; - if (!desktop_id || !public_key) { - throw new import_core.VaultError("INTERNAL_ERROR", "desktop_id and public_key are required"); - } - try { - const keyBytes = Buffer.from(public_key, "base64"); - if (keyBytes.length !== 32) { - throw new import_core.VaultError("INTERNAL_ERROR", "Invalid public key length. Expected 32 bytes."); - } - } catch { - throw new import_core.VaultError("INTERNAL_ERROR", "Invalid public key format"); - } - budget.setConfig("desktop_owner", { - desktop_id, - public_key, - registered_at: (/* @__PURE__ */ new Date()).toISOString() - }); - storage.logAudit("CONFIG", "success", { - operation: "desktop_register", - details: JSON.stringify({ desktop_id }) - }); - return { registered: true }; - }); - server.get("/v1/desktop/challenge", async (request) => { - const { desktop_id } = request.query; - if (!desktop_id) { - throw new import_core.VaultError("INTERNAL_ERROR", "desktop_id is required"); - } - const config = budget.getConfig(); - if (!config.desktop_owner || config.desktop_owner.desktop_id !== desktop_id) { - throw new import_core.VaultError("INTERNAL_ERROR", "Desktop not registered"); - } - cleanupOwnerState(); - const nonce = generateChallenge(); - const expires_at = Date.now() + CHALLENGE_TIMEOUT_MS; - pendingChallenges.set(desktop_id, { - nonce, - desktop_id, - expires_at - }); - return { - desktop_id, - nonce, - expires_at: new Date(expires_at).toISOString() - }; - }); - server.post("/v1/desktop/verify", async (request) => { - const { desktop_id, nonce, signature: signature2 } = request.body; - if (!desktop_id || !nonce || !signature2) { - throw new import_core.VaultError("INTERNAL_ERROR", "desktop_id, nonce, and signature are required"); - } - cleanupOwnerState(); - const challenge = pendingChallenges.get(desktop_id); - if (!challenge) { - throw new import_core.VaultError("INTERNAL_ERROR", "No pending challenge for this desktop"); - } - if (Date.now() > challenge.expires_at) { - pendingChallenges.delete(desktop_id); - throw new import_core.VaultError("CONSENT_TIMEOUT", "Challenge expired"); - } - if (challenge.nonce !== nonce) { - throw new import_core.VaultError("INTERNAL_ERROR", "Invalid nonce"); - } - const config = budget.getConfig(); - if (!config.desktop_owner || config.desktop_owner.desktop_id !== desktop_id) { - throw new import_core.VaultError("INTERNAL_ERROR", "Desktop not registered"); - } - const publicKeyBytes = Buffer.from(config.desktop_owner.public_key, "base64"); - const nonceBytes = Buffer.from(nonce, "base64"); - const signatureBytes = Buffer.from(signature2, "base64"); - const valid = verifyEd25519Signature(new Uint8Array(nonceBytes), new Uint8Array(signatureBytes), new Uint8Array(publicKeyBytes)); - if (!valid) { - storage.logAudit("DENY", "denied", { - operation: "desktop_verify", - details: JSON.stringify({ desktop_id, reason: "invalid_signature" }) - }); - throw new import_core.VaultError("INTERNAL_ERROR", "Invalid signature"); - } - pendingChallenges.delete(desktop_id); - const token = generateOwnerToken(); - const now = Date.now(); - ownerTokens.set(token, { - token, - desktop_id, - created_at: now, - last_used_at: now - }); - storage.logAudit("GRANT", "success", { - operation: "desktop_verify", - details: JSON.stringify({ desktop_id }) - }); - return { - verified: true, - token, - expires_at: new Date(now + OWNER_TOKEN_MAX_AGE_MS).toISOString(), - idle_timeout_minutes: OWNER_TOKEN_IDLE_TIMEOUT_MS / 6e4 - }; - }); - server.get("/v1/relay/info", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const identity = await ensureRelayIdentity(); - return { - vault_id: identity.vaultId, - relay_url: identity.relayUrl, - hpke_public_key: identity.hpkeKeyPair.publicKey.toString("base64"), - pairing_token: identity.pairingToken || null, - relay_connected: relayConnected - }; - }); - server.post("/v1/relay/config", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const { relay_url, pairing_token } = request.body || {}; - if (relay_url !== void 0) { - budget.setConfig("relay_url", relay_url); - } - if (pairing_token !== void 0) { - budget.setConfig("relay_pairing_token", pairing_token); - } - try { - await startRelayClient(server); - } catch (err) { - return reply.status(500).send({ - error: { - code: "RELAY_START_FAILED", - message: err instanceof Error ? err.message : "Failed to start relay client" - } - }); - } - return { - updated: true - }; - }); - server.post("/v1/pairing/start", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const body = request.body || {}; - if (!body.service_id || !body.scopes || body.scopes.length === 0) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: "service_id and at least one scope are required" - } - }); - } - const budgetConfig = normalizeBudget(body.budget); - const { token, expires_at } = storage.createPairingToken({ - service_id: body.service_id, - scopes: body.scopes, - budget: budgetConfig, - ttl_seconds: body.ttl_seconds - }); - return { - token, - expires_at, - service_id: body.service_id, - scopes: body.scopes, - budget: budgetConfig - }; - }); - server.post("/v1/pairing-grants", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const body = request.body || {}; - if (!body.agent_name || !body.mode || !body.permission_scopes || body.permission_scopes.length === 0) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: "agent_name, mode, and at least one permission_scope are required" - } - }); - } - const validModes = ["proxy", "mcp", "sdk"]; - if (!validModes.includes(body.mode)) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: `mode must be one of: ${validModes.join(", ")}` - } - }); - } - const identity = await ensureRelayIdentity(); - const budgetConfig = normalizeBudget(body.budget); - const agentId = `agent_${crypto5.randomBytes(12).toString("hex")}`; - const token = (0, import_core.createSignedPairingGrant)({ - vault_id: identity.vaultId, - agent_id: agentId, - agent_name: body.agent_name.trim(), - mode: body.mode, - vault_hpke_public_key: identity.hpkeKeyPair.publicKey.toString("base64"), - vault_signing_public_key: identity.signingKeyPair.publicKey.toString("base64"), - relay_url: identity.relayUrl || DEFAULT_RELAY_URL || import_core.DEFAULT_RELAY_URL, - ttl_ms: body.ttl_ms - // NOTE: permission_scopes, budget, tier are NOT included in the grant - // They are stored ONLY in the vault policy DB - }, identity.signingKeyPair.privateKey); - storage.createAgentConnection({ - agent_id: agentId, - name: body.agent_name.trim(), - mode: body.mode, - permission_scopes: body.permission_scopes, - budget: budgetConfig, - tier: body.tier || "free" - }); - storage.logAudit("CONFIG", "success", { - operation: "pairing_grant_created", - details: JSON.stringify({ - agent_id: agentId, - agent_name: body.agent_name, - mode: body.mode, - scopes: body.permission_scopes - }) - }); - return { - token, - agent_id: agentId, - agent_name: body.agent_name.trim(), - mode: body.mode, - permission_scopes: body.permission_scopes, - budget: budgetConfig, - tier: body.tier || "free" - }; - }); - server.post("/v1/pairing-grants/exchange", async (request, reply) => { - const body = request.body || {}; - if (!body.pairing_grant || !body.service_public_key) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: "pairing_grant and service_public_key are required" - } - }); - } - const identity = await ensureRelayIdentity(); - const decoded = (0, import_core.decodePairingGrant)(body.pairing_grant); - if (!decoded) { - return reply.status(400).send({ - error: { - code: "INVALID_GRANT", - message: "Invalid pairing grant format" - } - }); - } - const verified = (0, import_core.verifyPairingGrantWithKey)(body.pairing_grant, identity.signingKeyPair.publicKey); - if (!verified) { - return reply.status(400).send({ - error: { - code: "INVALID_GRANT", - message: "Pairing grant signature invalid or expired" - } - }); - } - if (verified.vault_id !== identity.vaultId) { - return reply.status(400).send({ - error: { - code: "INVALID_GRANT", - message: "Pairing grant is for a different vault" - } - }); - } - const connection = storage.getAgentConnection(verified.agent_id); - if (!connection) { - return reply.status(404).send({ - error: { - code: "AGENT_NOT_FOUND", - message: "Agent connection not found" - } - }); - } - if (connection.status === "revoked") { - return reply.status(403).send({ - error: { - code: "AGENT_REVOKED", - message: "Agent connection has been revoked" - } - }); - } - if (connection.status === "active") { - return reply.status(400).send({ - error: { - code: "ALREADY_PAIRED", - message: "Agent is already paired" - } - }); - } - const sessionToken = crypto5.randomBytes(32).toString("base64url"); - const sessionTokenHash = crypto5.createHash("sha256").update(sessionToken).digest("hex"); - storage.markAgentPaired(verified.agent_id, sessionTokenHash, body.service_public_key); - storage.logAudit("CONFIG", "success", { - operation: "pairing_grant_exchanged", - details: JSON.stringify({ - agent_id: verified.agent_id, - agent_name: verified.agent_name, - mode: verified.mode, - has_service_public_key: !!body.service_public_key - }) - }); - return { - version: 1, - vault_id: verified.vault_id, - agent_id: verified.agent_id, - agent_name: verified.agent_name, - mode: verified.mode, - vault_hpke_public_key: verified.vault_hpke_public_key, - vault_signing_public_key: verified.vault_signing_public_key, - session_token: sessionToken, - permission_scopes: verified.permission_scopes, - budget: verified.budget, - tier: verified.tier, - relay_url: verified.relay_url, - paired_at: (/* @__PURE__ */ new Date()).toISOString() - }; - }); - server.post("/v1/vault/lock", async () => { - storage.lock(); - return { locked: true }; - }); - server.get("/scopes", async () => { - const records = storage.listRecords(); - return { - scopes: records.map((r) => { - let formattedScope; - if (r.item_type === "WALLET_KEY" && r.chain) { - formattedScope = `sign:${r.chain}`; - } else { - formattedScope = `read:${r.scope}`; - } - return { - scope: formattedScope, - type: r.item_type, - sensitivity: r.sensitivity, - chain: r.chain, - public_address: r.public_address - }; - }) - }; - }); - function getWalletAddress(chain) { - const records = storage.listRecords(); - const wallet = records.find((r) => r.item_type === "WALLET_KEY" && r.chain === chain); - if (!wallet || !wallet.public_address) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No wallet found for chain: ${chain}`); - } - return { - chain, - address: wallet.public_address - }; - } - server.get("/address/:chain", async (request) => { - return getWalletAddress(request.params.chain); - }); - server.get("/v1/address/:chain", async (request) => { - return getWalletAddress(request.params.chain); - }); - server.get("/budget/check", async (request) => { - const amount = parseFloat(request.query.amount); - const currency = request.query.currency; - const chainParam = request.query.chain; - if (isNaN(amount) || !currency) { - throw new import_core.VaultError("INTERNAL_ERROR", "amount and currency are required"); - } - const limits = budget.getLimits(currency); - const chain = getChainForCurrency(currency, chainParam); - const result = budget.checkBudget(amount, currency, chain); - return { - allowed: result.allowed, - limits: { - per_tx: limits.tx_limit, - daily: limits.daily_budget, - approval_threshold: limits.approval_threshold - }, - remaining: { - daily: result.remaining_daily, - per_tx: result.remaining_tx - }, - requires_approval: result.requires_approval, - reason: result.reason - }; - }); - server.get("/v1/vault/budgets", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const config = budget.getConfig(); - return { - daily_budget: config.daily_budget, - tx_limit: config.tx_limit, - approval_threshold: config.approval_threshold - }; - }); - server.post("/v1/vault/budgets", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const { daily_budget, tx_limit, approval_threshold } = request.body || {}; - if (daily_budget) { - for (const [currency, amount] of Object.entries(daily_budget)) { - budget.setLimit("daily_budget", currency, Number(amount)); - } - } - if (tx_limit) { - for (const [currency, amount] of Object.entries(tx_limit)) { - budget.setLimit("tx_limit", currency, Number(amount)); - } - } - if (approval_threshold) { - for (const [currency, amount] of Object.entries(approval_threshold)) { - budget.setLimit("approval_threshold", currency, Number(amount)); - } - } - const config = budget.getConfig(); - return { - updated: true, - daily_budget: config.daily_budget, - tx_limit: config.tx_limit, - approval_threshold: config.approval_threshold - }; - }); - server.get("/v1/vault/currencies", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - return budget.getAllCurrencies(); - }); - server.post("/v1/vault/currencies", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const { action, code } = request.body || {}; - if (!action || !code) { - return reply.status(400).send({ - error: { - code: "VALIDATION_ERROR", - message: "action and code are required" - } - }); - } - try { - if (action === "add") { - budget.addCustomCurrency(code); - } else if (action === "remove") { - budget.removeCustomCurrency(code); - } else { - return reply.status(400).send({ - error: { - code: "VALIDATION_ERROR", - message: 'action must be "add" or "remove"' - } - }); - } - return { - success: true, - ...budget.getAllCurrencies() - }; - } catch (err) { - const error = err; - return reply.status(400).send({ - error: { - code: "VALIDATION_ERROR", - message: error.message - } - }); - } - }); - server.get("/agents", async () => { - const sessions = storage.listActiveSessions(); - return { - agents: sessions.map((s) => ({ - id: s.id, - agent_name: s.agent_name, - granted_scopes: s.granted_scopes, - consent_mode: s.consent_mode, - expires_at: s.expires_at, - created_at: s.created_at, - last_used_at: s.last_used_at - })) - }; - }); - server.get("/v1/agent-connections", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const agents = storage.listAgentConnections().map((agent2) => ({ - ...agent2, - permission_scopes: normalizePermissionScopes(agent2.permission_scopes || []) - })); - return { agents }; - }); - server.post("/v1/agent-connections/:id/revoke", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const revoked = storage.revokeAgentConnection(request.params.id); - return { revoked }; - }); - server.delete("/v1/agent-connections/:id", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const agentId = request.params.id; - const deleted = storage.deleteAgentConnection(agentId); - if (deleted) { - const agentConfigPath = path.join(os.homedir(), ".dcp", "agents", `${agentId}.json`); - if (fs.existsSync(agentConfigPath)) { - try { - fs.unlinkSync(agentConfigPath); - } catch (err) { - console.error(`Failed to delete agent config file: ${agentConfigPath}`, err); - } - } - } - return { deleted }; - }); - server.patch("/v1/agent-connections/:id", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const agentId = request.params.id; - const body = request.body || {}; - const agent2 = storage.getAgentConnection(agentId); - if (!agent2) { - return reply.status(404).send({ - error: { - code: "AGENT_NOT_FOUND", - message: "Agent connection not found" - } - }); - } - if (agent2.status === "revoked") { - return reply.status(400).send({ - error: { - code: "AGENT_REVOKED", - message: "Cannot update a revoked agent" - } - }); - } - if (body.permission_scopes !== void 0) { - if (!Array.isArray(body.permission_scopes)) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: "permission_scopes must be an array" - } - }); - } - for (const scope of body.permission_scopes) { - if (typeof scope !== "string" || scope.trim().length === 0) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: "Each permission scope must be a non-empty string" - } - }); - } - } - } - const updates = {}; - if (body.permission_scopes !== void 0) { - updates.permission_scopes = normalizePermissionScopes(body.permission_scopes.map((s) => s.trim())); - } - if (body.budget?.daily !== void 0) { - updates.budget_daily = body.budget.daily; - } - if (body.budget?.currency !== void 0) { - updates.budget_currency = body.budget.currency.toUpperCase(); - } - if (body.budget?.auto_approve_under !== void 0) { - updates.budget_auto_approve_under = body.budget.auto_approve_under; - } - const updated = storage.updateAgentConnection(agentId, updates); - if (!updated) { - return reply.status(500).send({ - error: { - code: "UPDATE_FAILED", - message: "Failed to update agent connection" - } - }); - } - const updatedAgent = storage.getAgentConnection(agentId); - return { - updated: true, - agent: updatedAgent ? { - ...updatedAgent, - permission_scopes: normalizePermissionScopes(updatedAgent.permission_scopes || []) - } : null - }; - }); - server.post("/v1/heartbeat", async (request, reply) => { - const body = request.body || {}; - const agentId = body.agent_id?.trim(); - if (!agentId) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: "agent_id is required" - } - }); - } - const ok = storage.recordAgentHeartbeat(agentId); - if (!ok) { - return reply.status(404).send({ - error: { - code: "AGENT_NOT_FOUND", - message: "Agent connection not found or revoked" - } - }); - } - return { - ok: true, - agent_id: agentId, - last_seen_at: storage.getAgentConnection(agentId)?.last_seen_at - }; - }); - server.post("/v1/pairing-invites", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const { agent_name, ttl_ms } = request.body || {}; - if (!agent_name || typeof agent_name !== "string" || !agent_name.trim()) { - return reply.status(400).send({ - error: { - code: "INVALID_REQUEST", - message: "agent_name is required" - } - }); - } - const identity = await ensureRelayIdentity(); - const relayUrl = identity.relayUrl || DEFAULT_RELAY_URL || import_core.DEFAULT_RELAY_URL || ""; - if (!identity.vaultId || !relayUrl) { - return reply.status(400).send({ - error: { - code: "NOT_CONFIGURED", - message: "Vault relay identity not configured. Ensure vault is initialized." - } - }); - } - const inviteToken = (0, import_core.createVpsPairingInvite)( - identity.vaultId, - relayUrl, - identity.hpkeKeyPair.publicKey.toString("base64"), - identity.signingKeyPair.publicKey.toString("base64"), - ttl_ms || 36e5 - // Default 1 hour - ); - const parsedInvite = (0, import_core.parseVpsPairingInvite)(inviteToken); - if (!parsedInvite) { - return reply.status(500).send({ - error: { - code: "INTERNAL_ERROR", - message: "Failed to create VPS pairing invite" - } - }); - } - try { - await registerVpsInviteWithRelay(relayUrl, parsedInvite.invite_id, identity.vaultId); - pendingVpsInviteNames.set(parsedInvite.invite_id, { - agentName: agent_name.trim(), - expiresAt: parsedInvite.expires_at - }); - } catch (err) { - return reply.status(502).send({ - error: { - code: "RELAY_UNAVAILABLE", - message: err instanceof Error ? err.message : "Failed to register invite with relay" - } - }); - } - return { - token: inviteToken, - agent_name: agent_name.trim(), - vault_id: identity.vaultId, - relay_url: relayUrl, - expires_at: new Date(Date.now() + (ttl_ms || 36e5)).toISOString() - }; - }); - server.get("/v1/pairing-claims", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const claims = Array.from(pendingPairingClaims.values()).filter((claim) => claim.status === "pending"); - return { claims }; - }); - server.get("/v1/pairing-claims/:id", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const claim = pendingPairingClaims.get(request.params.id); - if (!claim) { - return reply.status(404).send({ - error: { - code: "CLAIM_NOT_FOUND", - message: "Pairing claim not found" - } - }); - } - return { claim }; - }); - server.post("/v1/pairing-claims/:id/approve", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const claim = pendingPairingClaims.get(request.params.id); - if (!claim) { - return reply.status(404).send({ - error: { - code: "CLAIM_NOT_FOUND", - message: "Pairing claim not found" - } - }); - } - if (claim.status !== "pending") { - return reply.status(400).send({ - error: { - code: "CLAIM_ALREADY_RESOLVED", - message: `Claim already ${claim.status}` - } - }); - } - const agentId = `vps_${crypto5.randomUUID().slice(0, 8)}`; - const inviteName = pendingVpsInviteNames.get(claim.claim.invite_id); - const agentName = request.body?.agent_name || inviteName?.agentName || claim.claim.agent_hostname || "VPS Agent"; - const permissionScopes = request.body?.permission_scopes || []; - const vaultConfig = budget.getConfig(); - storage.createAgentConnection({ - agent_id: agentId, - name: agentName, - mode: "mcp", - tier: "free", - permission_scopes: permissionScopes, - budget: { daily: 0, currency: "USD", auto_approve_under: 0 } - }); - storage.markAgentPaired(agentId, void 0, claim.claim.agent_public_key); - claim.status = "approved"; - claim.agent_id = agentId; - claim.vault_id = vaultConfig.vault_id || ""; - claim.resolved_at = Date.now(); - if (relayClient) { - relayClient.sendPairingResult(claim.claim_id, true, agentId); - } - setTimeout(() => { - pendingPairingClaims.delete(claim.claim_id); - pendingVpsInviteNames.delete(claim.claim.invite_id); - }, 6e4); - return { - approved: true, - agent_id: agentId, - agent_name: agentName - }; - }); - server.post("/v1/pairing-claims/:id/deny", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const claim = pendingPairingClaims.get(request.params.id); - if (!claim) { - return reply.status(404).send({ - error: { - code: "CLAIM_NOT_FOUND", - message: "Pairing claim not found" - } - }); - } - if (claim.status !== "pending") { - return reply.status(400).send({ - error: { - code: "CLAIM_ALREADY_RESOLVED", - message: `Claim already ${claim.status}` - } - }); - } - claim.status = "denied"; - claim.resolved_at = Date.now(); - if (relayClient) { - relayClient.sendPairingResult(claim.claim_id, false); - } - setTimeout(() => { - pendingPairingClaims.delete(claim.claim_id); - pendingVpsInviteNames.delete(claim.claim.invite_id); - }, 6e4); - return { denied: true }; - }); - server.get("/v1/services", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const services = storage.listTrustedServices(); - return { services }; - }); - server.get("/v1/services/known", async () => { - return { services: (0, import_core.listKnownServices)() }; - }); - server.post("/v1/services", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const body = request.body || {}; - const serviceId = body.service_id?.trim(); - if (!serviceId) { - throw new import_core.VaultError("INTERNAL_ERROR", "service_id is required"); - } - const publicKey2 = body.public_key?.trim(); - if (!publicKey2 || !(0, import_core.isValidPublicKey)(publicKey2)) { - throw new import_core.VaultError("INTERNAL_ERROR", "Valid public_key is required"); - } - const scopes = normalizeScopes(body.scopes); - if (scopes.length === 0) { - throw new import_core.VaultError("INTERNAL_ERROR", "At least one scope is required"); - } - const budget2 = normalizeBudget(body.budget); - const enabled = body.enabled !== void 0 ? Boolean(body.enabled) : true; - storage.addTrustedService({ - service_id: serviceId, - name: body.name?.trim() || serviceId, - public_key: publicKey2, - scopes, - budget: budget2, - verified: body.verified ?? false - }); - if (!enabled) { - storage.updateTrustedService(serviceId, { enabled: false }); - } - return { created: true, service: storage.getTrustedService(serviceId) }; - }); - server.patch("/v1/services/:id", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const serviceId = request.params.id; - const body = request.body || {}; - const updates = {}; - if (body.name !== void 0) { - updates.name = body.name.trim(); - } - if (body.public_key !== void 0) { - const key = body.public_key.trim(); - if (!(0, import_core.isValidPublicKey)(key)) { - throw new import_core.VaultError("INTERNAL_ERROR", "Invalid public_key"); - } - updates.public_key = key; - } - if (body.scopes !== void 0) { - const scopes = normalizeScopes(body.scopes); - if (scopes.length === 0) { - throw new import_core.VaultError("INTERNAL_ERROR", "At least one scope is required"); - } - updates.scopes = scopes; - } - if (body.budget !== void 0) { - updates.budget = normalizeBudget(body.budget); - } - if (body.enabled !== void 0) { - updates.enabled = Boolean(body.enabled); - } - if (body.verified !== void 0) { - updates.verified = Boolean(body.verified); - } - storage.updateTrustedService(serviceId, updates); - return { updated: true, service: storage.getTrustedService(serviceId) }; - }); - server.delete("/v1/services/:id", async (request, reply) => { - if (!isOwnerRequest(request)) { - return reply.status(403).send({ - error: { - code: "OWNER_AUTH_REQUIRED", - message: "Owner authentication required" - } - }); - } - const serviceId = request.params.id; - storage.revokeTrustedService(serviceId); - return { revoked: true }; - }); - server.get("/consent", async () => { - const pending = storage.getPendingConsents(); - return { - pending: pending.map((c) => { - let details = {}; - try { - if (c.details) { - details = JSON.parse(c.details); - } - } catch { - } - return { - id: c.id, - agent_name: c.agent_name, - action: c.action, - scope: c.scope, - details, - status: c.status, - created_at: c.created_at, - expires_at: c.expires_at - }; - }) - }; - }); - server.post("/consent/:id/approve", async (request) => { - requireOwnerToken(request); - const { id } = request.params; - const body = request.body || {}; - const createSession = Boolean(body.session || body.mode === "session"); - const consent = storage.getPendingConsent(id); - if (!consent) { - throw new import_core.VaultError("CONSENT_NOT_FOUND", `Consent not found: ${id}`); - } - if (consent.status !== "pending") { - throw new import_core.VaultError("INTERNAL_ERROR", `Consent already ${consent.status}`); - } - if (new Date(consent.expires_at) < /* @__PURE__ */ new Date()) { - storage.resolveConsent(id, "expired"); - throw new import_core.VaultError("CONSENT_TIMEOUT", "Consent has expired"); - } - let sessionId; - if (createSession) { - const expiresAt = new Date(Date.now() + 4 * 60 * 60 * 1e3); - const newSession = storage.createSession(consent.agent_name, [consent.scope], "session", expiresAt); - sessionId = newSession.id; - } - storage.resolveConsent(id, "approved", sessionId); - storage.logAudit("GRANT", "success", { - agentName: consent.agent_name, - scope: consent.scope, - operation: createSession ? "session_grant" : "once_grant", - details: sessionId ? JSON.stringify({ session_id: sessionId }) : void 0 - }); - return { - approved: true, - session_id: sessionId - }; - }); - server.post("/consent/:id/deny", async (request) => { - requireOwnerToken(request); - const { id } = request.params; - const consent = storage.getPendingConsent(id); - if (!consent) { - throw new import_core.VaultError("CONSENT_NOT_FOUND", `Consent not found: ${id}`); - } - if (consent.status !== "pending") { - throw new import_core.VaultError("INTERNAL_ERROR", `Consent already ${consent.status}`); - } - storage.resolveConsent(id, "denied"); - storage.logAudit("DENY", "denied", { - agentName: consent.agent_name, - scope: consent.scope, - operation: consent.action, - details: "Denied via REST API" - }); - return { - denied: true - }; - }); - server.get("/consent/:id/status", async (request) => { - const { id } = request.params; - const consent = storage.getPendingConsent(id); - if (!consent) { - return { - id, - status: "not_found" - }; - } - if (consent.status === "pending" && new Date(consent.expires_at) < /* @__PURE__ */ new Date()) { - storage.resolveConsent(id, "expired"); - return { - id, - status: "expired" - }; - } - return { - id, - status: consent.status, - session_id: consent.session_id - }; - }); - server.post("/revoke/:agent", async (request) => { - const { agent: agent2 } = request.params; - const count = storage.revokeAgentSessions(agent2); - if (count > 0) { - storage.logAudit("REVOKE", "success", { - agentName: agent2, - operation: "revoke_agent", - details: JSON.stringify({ sessions_revoked: count }) - }); - } - return { - revoked: count - }; - }); - server.post("/v1/vault/read", async (request) => { - const { scope, agent_name, session_id, description } = request.body; - let effectiveSessionId = session_id; - if (!scope || !agent_name) { - throw new import_core.VaultError("INTERNAL_ERROR", "scope and agent_name are required"); - } - if (!storage.isUnlocked()) { - throw new import_core.VaultError("VAULT_LOCKED", "Vault is locked. Please unlock first."); - } - const requestedScope = `read:${scope}`; - const agentAuth = verifyLocalAgentRequest(request.body, requestedScope); - if (!agentAuth.authorized && agentAuth.skipConsentFlow) { - throw new import_core.VaultError("SERVICE_SCOPE_VIOLATION", agentAuth.reason || "Scope not permitted for this agent"); - } - const ownerMode = isOwnerRequest(request); - if (!effectiveSessionId && !ownerMode) { - const existing = findActiveSessionForScope(agent_name, scope); - if (existing) { - effectiveSessionId = existing; - } - } - let hasSession = ownerMode || agentAuth.preAuthorized === true; - if (!hasSession && effectiveSessionId) { - const session = storage.getSession(effectiveSessionId); - if (session && !session.revoked_at && new Date(session.expires_at) > /* @__PURE__ */ new Date()) { - if (session.granted_scopes.includes(scope) || session.granted_scopes.some((s) => scope.startsWith(s.replace(".*", "")))) { - hasSession = true; - storage.touchSession(effectiveSessionId); - } - } - } - if (!hasSession) { - const consumedConsent = storage.consumeApprovedConsent(agent_name, "read", scope); - if (consumedConsent) { - hasSession = true; - storage.logAudit("READ", "success", { - agentName: agent_name, - scope, - operation: "consume_approval", - details: JSON.stringify({ consent_id: consumedConsent.id }) - }); - } else { - const { consent, isNew } = storage.createPendingConsent(agent_name, "read", scope, consentDetailsWithDisplayName(request.body, agent_name, description ? { description } : void 0)); - console.log("[CONSENT] Created consent:", consent.id, "for agent:", agent_name, "isNew:", isNew); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } - } - const record2 = storage.getRecord(scope); - if (!record2) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No record found for scope: ${scope}`); - } - if (record2.sensitivity === "critical") { - storage.logAudit("READ", "success", { - agentName: agent_name, - scope, - operation: "read_reference" - }); - return { - scope, - type: record2.item_type, - sensitivity: record2.sensitivity, - note: "Critical data cannot be read directly. Use vault_sign_tx for signing operations." - }; - } - const masterKey = storage.getMasterKey(); - const payload = storage.getEncryptedPayload(scope); - if (!payload) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No encrypted data for scope: ${scope}`); - } - const decrypted = (0, import_core.envelopeDecrypt)(payload, masterKey); - const data = JSON.parse(decrypted.toString("utf-8")); - storage.logAudit("READ", "success", { - agentName: agent_name, - scope, - operation: "read_data" - }); - return { - scope, - data, - session_id: effectiveSessionId - }; - }); - server.post("/v1/vault/write", async (request) => { - const { scope, data, agent_name, session_id } = request.body; - let effectiveSessionId = session_id; - if (!scope || !data || !agent_name) { - throw new import_core.VaultError("INTERNAL_ERROR", "scope, data, and agent_name are required"); - } - if (!storage.isUnlocked()) { - throw new import_core.VaultError("VAULT_LOCKED", "Vault is locked. Please unlock first."); - } - const requestedScope = `write:${scope}`; - const agentAuth = verifyLocalAgentRequest(request.body, requestedScope); - if (!agentAuth.authorized && agentAuth.skipConsentFlow) { - throw new import_core.VaultError("SERVICE_SCOPE_VIOLATION", agentAuth.reason || "Scope not permitted for this agent"); - } - const ownerMode = isOwnerRequest(request); - if (!ownerMode && !isWriteAllowed(agent_name, scope)) { - throw new import_core.VaultError("SCOPE_VIOLATION", `Agent ${agent_name} not authorized to write scope: ${scope}`); - } - if (!effectiveSessionId && !ownerMode) { - const existing2 = findActiveSessionForScope(agent_name, scope); - if (existing2) { - effectiveSessionId = existing2; - } - } - let hasSession = ownerMode; - if (!hasSession && effectiveSessionId) { - const session = storage.getSession(effectiveSessionId); - if (session && !session.revoked_at && new Date(session.expires_at) > /* @__PURE__ */ new Date()) { - if (session.granted_scopes.includes(scope) || session.granted_scopes.some((s) => scope.startsWith(s.replace(".*", "")))) { - hasSession = true; - storage.touchSession(effectiveSessionId); - } - } - } - if (!hasSession) { - const consumedConsent = storage.consumeApprovedConsent(agent_name, "write", scope); - if (consumedConsent) { - hasSession = true; - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope, - operation: "consume_approval", - details: JSON.stringify({ consent_id: consumedConsent.id }) - }); - } else { - const { consent, isNew } = storage.createPendingConsent(agent_name, "write", scope, consentDetailsWithDisplayName(request.body, agent_name)); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } - } - const masterKey = storage.getMasterKey(); - const existing = storage.getRecord(scope); - const payloadData = normalizeWriteData(scope, data); - if (existing) { - storage.updateRecord(existing.id, payloadData, masterKey); - } else { - storage.createRecord({ - scope, - item_type: inferItemType(scope), - sensitivity: inferSensitivity(scope), - data: payloadData - }); - } - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope, - operation: "write" - }); - return { - scope, - created: !existing, - updated: !!existing, - sensitivity: existing?.sensitivity || inferSensitivity(scope), - session_id: effectiveSessionId - }; - }); - server.post("/v1/vault/delete", async (request) => { - const { scope, agent_name, session_id, description } = request.body; - let effectiveSessionId = session_id; - if (!scope || !agent_name) { - throw new import_core.VaultError("INTERNAL_ERROR", "scope and agent_name are required"); - } - if (!storage.isUnlocked()) { - throw new import_core.VaultError("VAULT_LOCKED", "Vault is locked. Please unlock first."); - } - const ownerMode = isOwnerRequest(request); - if (!ownerMode && !isWriteAllowed(agent_name, scope)) { - throw new import_core.VaultError("SCOPE_VIOLATION", `Agent ${agent_name} not authorized to delete scope: ${scope}`); - } - if (!effectiveSessionId && !ownerMode) { - const existing2 = findActiveSessionForScope(agent_name, scope); - if (existing2) { - effectiveSessionId = existing2; - } - } - let hasSession = ownerMode; - if (!hasSession && effectiveSessionId) { - const session = storage.getSession(effectiveSessionId); - if (session && !session.revoked_at && new Date(session.expires_at) > /* @__PURE__ */ new Date()) { - if (session.granted_scopes.includes(scope) || session.granted_scopes.some((s) => scope.startsWith(s.replace(".*", "")))) { - hasSession = true; - storage.touchSession(effectiveSessionId); - } - } - } - if (!hasSession) { - const { consent, isNew } = storage.createPendingConsent(agent_name, "delete", scope, consentDetailsWithDisplayName(request.body, agent_name, { description })); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } - const existing = storage.listRecords().find((r) => r.scope === scope); - if (!existing) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No record found for scope: ${scope}`); - } - const deleted = storage.deleteRecord(scope); - if (deleted) { - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope, - operation: "delete" - }); - } - return { - scope, - deleted - }; - }); - server.post("/v1/vault/sign", async (request) => { - const { chain, unsigned_tx, amount, currency, agent_name, session_id, description, idempotency_key } = request.body; - let effectiveSessionId = session_id; - if (!chain || !unsigned_tx || !agent_name) { - throw new import_core.VaultError("INTERNAL_ERROR", "chain, unsigned_tx, and agent_name are required"); - } - if (!storage.isUnlocked()) { - throw new import_core.VaultError("VAULT_LOCKED", "Vault is locked. Please unlock first."); - } - const requestedScope = `sign:${chain}`; - const agentAuth = verifyLocalAgentRequest(request.body, requestedScope); - if (!agentAuth.authorized && agentAuth.skipConsentFlow) { - throw new import_core.VaultError("SERVICE_SCOPE_VIOLATION", agentAuth.reason || "Scope not permitted for this agent"); - } - const txCurrency = currency || "SOL"; - let budgetAutoApproved = false; - if (amount !== void 0 && amount > 0) { - const budgetResult = budget.checkBudget(amount, txCurrency, chain); - if (!budgetResult.allowed) { - storage.logAudit("EXECUTE", "denied", { - agentName: agent_name, - scope: `crypto.wallet.${chain}`, - operation: "sign_tx", - details: JSON.stringify({ reason: budgetResult.reason, amount, currency: txCurrency }) - }); - const errorCode = budgetResult.reason?.includes("BUDGET_EXCEEDED_TX") ? "BUDGET_EXCEEDED_TX" : "BUDGET_EXCEEDED_DAILY"; - const limits = budget.getLimits(txCurrency); - dispatchBudgetExceededNotification({ - agent_name, - amount, - currency: txCurrency, - chain, - error_code: errorCode, - remaining_daily: budgetResult.remaining_daily, - remaining_tx: budgetResult.remaining_tx, - limit_daily: limits.daily_budget, - limit_tx: limits.tx_limit - }).catch((err) => console.log("[TG] Budget notification failed:", err)); - throw new import_core.VaultError(errorCode, budgetResult.reason || "Budget exceeded", { - remaining_daily: budgetResult.remaining_daily, - remaining_tx: budgetResult.remaining_tx - }); - } - if (budgetResult.requires_approval) { - const walletScope2 = `crypto.wallet.${chain}`; - const consumedConsent = storage.consumeApprovedConsent(agent_name, "sign_tx", walletScope2); - if (consumedConsent) { - budgetAutoApproved = true; - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope: walletScope2, - operation: "consume_approval", - details: JSON.stringify({ consent_id: consumedConsent.id, amount, currency: txCurrency }) - }); - } else { - const { consent, isNew } = storage.createPendingConsent(agent_name, "sign_tx", walletScope2, consentDetailsWithDisplayName(request.body, agent_name, { - description, - amount, - currency: txCurrency, - chain - })); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - reason: "Amount exceeds approval threshold", - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } - } else { - budgetAutoApproved = true; - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope: `crypto.wallet.${chain}`, - operation: "budget_auto_approve", - details: JSON.stringify({ amount, currency: txCurrency, chain, threshold: budget.getLimits(txCurrency).approval_threshold }) - }); - } - } - const walletScope = `crypto.wallet.${chain}`; - if (!effectiveSessionId) { - const existing = findActiveSessionForScope(agent_name, walletScope); - if (existing) { - effectiveSessionId = existing; - } - } - let hasSession = false; - if (effectiveSessionId) { - const session = storage.getSession(effectiveSessionId); - if (session && !session.revoked_at && new Date(session.expires_at) > /* @__PURE__ */ new Date()) { - if (session.granted_scopes.includes(walletScope)) { - hasSession = true; - storage.touchSession(effectiveSessionId); - } - } - } - if (!hasSession && !budgetAutoApproved) { - const consumedConsent = storage.consumeApprovedConsent(agent_name, "sign_tx", walletScope); - if (!consumedConsent) { - const { consent, isNew } = storage.createPendingConsent(agent_name, "sign_tx", walletScope, consentDetailsWithDisplayName(request.body, agent_name, { - description, - amount, - currency: txCurrency, - chain - })); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope: walletScope, - operation: "consume_approval", - details: JSON.stringify({ consent_id: consumedConsent.id }) - }); - } - const masterKey = storage.getMasterKey(); - const payload = storage.getEncryptedPayload(walletScope); - if (!payload) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No wallet found for chain: ${chain}`); - } - const signResult = await (0, import_core.signTransaction)(payload, masterKey, chain, unsigned_tx); - if (amount !== void 0 && amount > 0 && effectiveSessionId) { - storage.recordSpend(effectiveSessionId, amount, txCurrency, chain, "sign_tx", "committed", { - idempotencyKey: idempotency_key - }); - } - const budgetInfo = budget.checkBudget(0, txCurrency, chain); - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope: walletScope, - operation: "sign_tx", - details: JSON.stringify({ chain, amount, currency: txCurrency }) - }); - return { - signed_tx: signResult.signed_tx, - signature: signResult.signature, - chain, - remaining_daily: budgetInfo.remaining_daily, - session_id: effectiveSessionId - }; - }); - const handleSignMessage = async (body) => { - const { chain, message, encoding, agent_name, session_id, description } = body; - let effectiveSessionId = session_id; - if (!chain || !message || !agent_name) { - throw new import_core.VaultError("INTERNAL_ERROR", "chain, message, and agent_name are required"); - } - if (!storage.isUnlocked()) { - throw new import_core.VaultError("VAULT_LOCKED", "Vault is locked. Please unlock first."); - } - const walletScope = `crypto.wallet.${chain}`; - if (!effectiveSessionId) { - const existing = findActiveSessionForScope(agent_name, walletScope); - if (existing) { - effectiveSessionId = existing; - } - } - let hasSession = false; - if (effectiveSessionId) { - const session = storage.getSession(effectiveSessionId); - if (session && !session.revoked_at && new Date(session.expires_at) > /* @__PURE__ */ new Date()) { - if (session.granted_scopes.includes(walletScope)) { - hasSession = true; - storage.touchSession(effectiveSessionId); - } - } - } - if (!hasSession) { - const { consent, isNew } = storage.createPendingConsent(agent_name, "sign_message", walletScope, consentDetailsWithDisplayName(body, agent_name, { - description, - chain, - message_length: message.length, - encoding: encoding || "utf8" - })); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } - const records = storage.listRecords(); - const walletRecord = records.find((r) => r.item_type === "WALLET_KEY" && r.chain === chain); - if (!walletRecord || !walletRecord.public_address) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No wallet found for chain: ${chain}`); - } - const masterKey = storage.getMasterKey(); - const payload = storage.getEncryptedPayload(walletScope); - if (!payload) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No wallet found for chain: ${chain}`); - } - const resolvedEncoding = encoding || "utf8"; - const signature2 = (0, import_core.signSolanaMessage)(payload, masterKey, message, resolvedEncoding); - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope: walletScope, - operation: "sign_message", - details: JSON.stringify({ chain }) - }); - return { - signature: signature2, - public_key: walletRecord.public_address, - chain, - session_id: effectiveSessionId - }; - }; - server.post("/v1/vault/sign-message", async (request) => { - return handleSignMessage(request.body); - }); - server.post("/v1/vault/sign_message", async (request) => { - return handleSignMessage(request.body); - }); - server.post("/v1/vault/sign_x402", async (request) => { - const { network, payload, amount, currency, recipient, purpose, agent_name, session_id } = request.body; - let effectiveSessionId = session_id; - if (!network || !payload || !agent_name) { - throw new import_core.VaultError("INTERNAL_ERROR", "network, payload, and agent_name are required"); - } - if (network !== "solana") { - throw new import_core.VaultError("INVALID_CHAIN", "Only solana network is supported"); - } - if (!storage.isUnlocked()) { - throw new import_core.VaultError("VAULT_LOCKED", "Vault is locked. Please unlock first."); - } - const chain = "solana"; - const walletScope = `crypto.wallet.${chain}`; - if (!effectiveSessionId) { - const existing = findActiveSessionForScope(agent_name, walletScope); - if (existing) { - effectiveSessionId = existing; - } - } - let hasSession = false; - if (effectiveSessionId) { - const session = storage.getSession(effectiveSessionId); - if (session && !session.revoked_at && new Date(session.expires_at) > /* @__PURE__ */ new Date()) { - if (session.granted_scopes.includes(walletScope)) { - hasSession = true; - storage.touchSession(effectiveSessionId); - } - } - } - const parsedAmount = normalizeAmount(amount); - if (parsedAmount !== void 0 && !currency) { - throw new import_core.VaultError("INTERNAL_ERROR", "currency is required when amount is provided"); - } - let budgetAutoApproved = false; - if (parsedAmount !== void 0 && currency) { - const budgetResult = budget.checkBudget(parsedAmount, currency, chain); - if (!budgetResult.allowed) { - const errorCode = budgetResult.reason?.includes("BUDGET_EXCEEDED_TX") ? "BUDGET_EXCEEDED_TX" : "BUDGET_EXCEEDED_DAILY"; - const limits = budget.getLimits(currency); - dispatchBudgetExceededNotification({ - agent_name, - amount: parsedAmount, - currency, - chain, - error_code: errorCode, - remaining_daily: budgetResult.remaining_daily, - remaining_tx: budgetResult.remaining_tx, - limit_daily: limits.daily_budget, - limit_tx: limits.tx_limit - }).catch((err) => console.log("[TG] Budget notification failed:", err)); - throw new import_core.VaultError(errorCode, budgetResult.reason || "Budget exceeded", { - remaining_daily: budgetResult.remaining_daily, - remaining_tx: budgetResult.remaining_tx - }); - } - if (budgetResult.requires_approval) { - const { consent, isNew } = storage.createPendingConsent(agent_name, "sign_x402", walletScope, consentDetailsWithDisplayName(request.body, agent_name, { - amount: parsedAmount, - currency, - network, - recipient, - purpose - })); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - reason: "Amount exceeds approval threshold", - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } else { - budgetAutoApproved = true; - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope: walletScope, - operation: "budget_auto_approve", - details: JSON.stringify({ amount: parsedAmount, currency, chain, threshold: budget.getLimits(currency).approval_threshold }) - }); - } - } - if (!hasSession && !budgetAutoApproved) { - const { consent, isNew } = storage.createPendingConsent(agent_name, "sign_x402", walletScope, consentDetailsWithDisplayName(request.body, agent_name, { - amount: parsedAmount, - currency, - network, - recipient, - purpose - })); - return { - requires_consent: true, - consent_id: consent.id, - expires_at: consent.expires_at, - message: `Consent required. Approve with: POST /consent/${consent.id}/approve` - }; - } - const records = storage.listRecords(); - const walletRecord = records.find((r) => r.item_type === "WALLET_KEY" && r.chain === chain); - if (!walletRecord || !walletRecord.public_address) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No wallet found for chain: ${chain}`); - } - const masterKey = storage.getMasterKey(); - const encryptedKey = storage.getEncryptedPayload(walletScope); - if (!encryptedKey) { - throw new import_core.VaultError("RECORD_NOT_FOUND", `No wallet found for chain: ${chain}`); - } - const signature2 = (0, import_core.signSolanaMessage)(encryptedKey, masterKey, payload, "base64"); - if (parsedAmount !== void 0 && currency && effectiveSessionId) { - storage.recordSpend(effectiveSessionId, parsedAmount, currency, chain, "sign_x402", "committed", { - destination: recipient - }); - } - storage.logAudit("EXECUTE", "success", { - agentName: agent_name, - scope: walletScope, - operation: "sign_x402", - details: JSON.stringify({ - amount: parsedAmount, - currency, - network, - recipient, - purpose - }) - }); - return { - signature: signature2, - public_key: walletRecord.public_address, - chain, - session_id: effectiveSessionId - }; - }); - server.get("/v1/vault/activity", async (request) => { - const limit = parseInt(request.query.limit || "100", 10); - const agentName = request.query.agent; - const eventType = request.query.type?.toUpperCase(); - const since = request.query.since ? new Date(request.query.since) : void 0; - if (eventType && !["GRANT", "DENY", "EXECUTE", "READ", "REVOKE", "CONFIG", "EXPIRE"].includes(eventType)) { - throw new import_core.VaultError("INTERNAL_ERROR", `Invalid event type: ${request.query.type}`); - } - const events = storage.getAuditEvents(limit, { - eventType, - agentName, - since - }); - return { - events: events.map((e) => ({ - id: e.id, - event_type: e.event_type, - agent_name: e.agent_name, - scope: e.scope, - operation: e.operation, - outcome: e.outcome, - created_at: e.created_at, - details: e.details ? (() => { - try { - return JSON.parse(e.details); - } catch { - return e.details; - } - })() : void 0 - })), - count: events.length - }; - }); - server.post("/v1/vault/agents/:id/revoke", async (request) => { - const { id } = request.params; - const session = storage.getSession(id); - if (!session) { - throw new import_core.VaultError("INTERNAL_ERROR", `Session not found: ${id}`); - } - const success = storage.revokeSession(id); - if (success) { - storage.logAudit("REVOKE", "success", { - agentName: session.agent_name, - operation: "revoke_session", - details: JSON.stringify({ session_id: id }) - }); - } - return { - revoked: success, - session_id: id, - agent_name: session.agent_name - }; - }); - server.post("/v1/telegram/pair/start", async (request, reply) => { - requireOwnerToken(request); - const identity = await ensureRelayIdentity(); - const vaultId = identity.vaultId; - try { - const publicKeyBase64 = identity.signingKeyPair.publicKey.toString("base64"); - const regResponse = await fetch(`${TELEGRAM_CLOUD_URL}/register`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - vault_id: vaultId, - public_key: publicKeyBase64 - }) - }); - if (!regResponse.ok) { - const error = await regResponse.json(); - console.error("[TG] Failed to register vault key:", error); - } - const timestamp = (/* @__PURE__ */ new Date()).toISOString(); - const nonce = crypto5.randomBytes(16).toString("base64"); - const payloadWithoutSig = { vault_id: vaultId, timestamp, nonce }; - const message = Buffer.from((0, import_core.canonicalJson)(payloadWithoutSig), "utf8"); - const signatureBytes = import_tweetnacl.default.sign.detached(new Uint8Array(message), new Uint8Array(identity.signingKeyPair.privateKey)); - const signature2 = Buffer.from(signatureBytes).toString("base64"); - const response = await fetch(`${TELEGRAM_CLOUD_URL}/api/pair/start`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ ...payloadWithoutSig, signature: signature2 }) - }); - if (!response.ok) { - const error = await response.json(); - throw new import_core.VaultError("INTERNAL_ERROR", error.message || "Failed to start pairing"); - } - const data = await response.json(); - const existingConfig = storage.getTelegramConfig(); - if (!existingConfig) { - storage.createTelegramConfig({ - chat_id: "pending", - bot_token: "cloud", - // Indicates cloud mode - enabled: false, - // Will be enabled when pairing completes - notify_consent: true - }); - } - return { - code: data.code, - expires_at: data.expires_at, - message: `Send /pair ${data.code} to the DCP Telegram bot` - }; - } catch (err) { - if (err instanceof import_core.VaultError) - throw err; - console.error("[TG] Cloud pairing start failed:", err); - throw new import_core.VaultError("INTERNAL_ERROR", "Failed to connect to Telegram service"); - } - }); - server.get("/v1/telegram/pair/status", async (request, reply) => { - requireOwnerToken(request); - const identity = await ensureRelayIdentity(); - const vaultId = identity.vaultId; - try { - const response = await fetch(`${TELEGRAM_CLOUD_URL}/api/pair/status/${vaultId}`); - const data = await response.json(); - if (data.paired) { - const config = storage.getTelegramConfig(); - if (config && (!config.enabled || !config.paired_at)) { - const updates = { - chat_id: data.chat_id || config.chat_id, - enabled: true, - paired_at: data.paired_at || (/* @__PURE__ */ new Date()).toISOString() - }; - storage.updateTelegramConfig(updates); - } - } - return data; - } catch (err) { - console.error("[TG] Cloud pairing status check failed:", err); - return { paired: false, error: "Failed to check pairing status" }; - } - }); - server.get("/v1/telegram/config", async (request, reply) => { - requireOwnerToken(request); - const config = storage.getTelegramConfig(); - if (!config) { - return { configured: false }; - } - return { - configured: true, - chat_id: config.chat_id, - enabled: config.enabled, - notify_consent: config.notify_consent, - rate_limit_per_hour: config.rate_limit_per_hour, - notifications_this_hour: config.notifications_this_hour, - last_notification_at: config.last_notification_at, - muted_until: config.muted_until, - paired_at: config.paired_at - }; - }); - server.post("/v1/telegram/config", async (request, reply) => { - requireOwnerToken(request); - const config = storage.getTelegramConfig(); - if (!config) { - throw new import_core.VaultError("INTERNAL_ERROR", "Telegram not configured"); - } - const { enabled, notify_consent, rate_limit_per_hour, muted_until } = request.body; - const success = storage.updateTelegramConfig({ - enabled, - notify_consent, - rate_limit_per_hour, - muted_until - }); - return { success }; - }); - server.delete("/v1/telegram/config", async (request, reply) => { - requireOwnerToken(request); - const identity = await ensureRelayIdentity(); - const vaultId = identity.vaultId; - try { - await fetch(`${TELEGRAM_CLOUD_URL}/api/pair/${vaultId}`, { - method: "DELETE" - }); - } catch (err) { - console.error("[TELEGRAM] Failed to notify cloud of unlink:", err); - } - const success = storage.deleteTelegramConfig(); - return { success }; - }); - server.post("/v1/telegram/test", async (request, reply) => { - requireOwnerToken(request); - const config = storage.getTelegramConfig(); - if (!config) { - throw new import_core.VaultError("INTERNAL_ERROR", "Telegram not configured"); - } - if (!config.enabled) { - throw new import_core.VaultError("INTERNAL_ERROR", "Telegram notifications are disabled"); - } - if (storage.checkTelegramRateLimit()) { - throw new import_core.VaultError("RATE_LIMITED", "Telegram notification rate limit exceeded"); - } - const webhookUrl = `${TELEGRAM_CLOUD_URL}/webhook/consent`; - const identity = await ensureRelayIdentity(); - const vaultId = identity.vaultId; - const publicKeyBase64 = identity.signingKeyPair.publicKey.toString("base64"); - try { - await fetch(`${TELEGRAM_CLOUD_URL}/register`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ vault_id: vaultId, public_key: publicKeyBase64 }) - }); - } catch { - } - const nonce = crypto5.randomBytes(16).toString("base64"); - const payloadWithoutSig = { - vault_id: vaultId, - event: "test", - data: { consent_id: "test", agent_name: "test", action: "test", scope: "test" }, - timestamp: (/* @__PURE__ */ new Date()).toISOString(), - nonce - }; - const message = Buffer.from((0, import_core.canonicalJson)(payloadWithoutSig), "utf8"); - const signatureBytes = import_tweetnacl.default.sign.detached(new Uint8Array(message), new Uint8Array(identity.signingKeyPair.privateKey)); - const signature2 = Buffer.from(signatureBytes).toString("base64"); - const payload = { - ...payloadWithoutSig, - signature: signature2 - }; - try { - const response = await fetch(webhookUrl, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(payload) - }); - if (!response.ok) { - const errorText = await response.text(); - throw new Error(errorText || response.statusText); - } - const result = await response.json(); - if (!result.sent) { - throw new Error(result.error || "Cloud service failed to send"); - } - storage.recordTelegramNotification(); - storage.logTelegramNotification({ - chat_id: config.chat_id, - notification_type: "test" - }); - return { success: true, message: "Test notification sent" }; - } catch (err) { - const errorMessage = err instanceof Error ? err.message : "Unknown error"; - storage.logTelegramNotification({ - chat_id: config.chat_id, - notification_type: "test", - error: errorMessage - }); - throw new import_core.VaultError("INTERNAL_ERROR", `Failed to send test notification: ${errorMessage}`); - } - }); - server.get("/v1/telegram/logs", async (request, reply) => { - requireOwnerToken(request); - const limit = parseInt(request.query.limit || "50", 10); - const logs = storage.getTelegramNotificationLogs(limit); - return { logs, count: logs.length }; - }); - return server; -} -function getChainForCurrency(currency, chain) { - if (chain) - return chain; - switch (currency.toUpperCase()) { - case "SOL": - return "solana"; - case "USDC": - case "USDT": - throw new import_core.VaultError("INTERNAL_ERROR", `chain is required for ${currency}`); - default: - throw new import_core.VaultError("INTERNAL_ERROR", `Unknown currency: ${currency}`); - } -} -function verifyServiceSignature(payload, serviceId, signature2, publicKey2) { - let keyData; - if (publicKey2.startsWith("ed25519:")) { - keyData = publicKey2.slice(8); - } else { - keyData = publicKey2; - } - const publicKeyBytes = Buffer.from(keyData, "base64"); - if (publicKeyBytes.length !== 32) { - return false; - } - const payloadWithoutSig = { ...payload }; - delete payloadWithoutSig.service_signature; - const message = Buffer.from((0, import_core.canonicalJson)(payloadWithoutSig), "utf8"); - const signatureBytes = Buffer.from(signature2, "base64"); - const canonicalOk = import_tweetnacl.default.sign.detached.verify(new Uint8Array(message), new Uint8Array(signatureBytes), new Uint8Array(publicKeyBytes)); - if (canonicalOk) - return true; - const legacyMessage = Buffer.from(JSON.stringify(payloadWithoutSig), "utf8"); - return import_tweetnacl.default.sign.detached.verify(new Uint8Array(legacyMessage), new Uint8Array(signatureBytes), new Uint8Array(publicKeyBytes)); -} -function normalizeScopes(scopes) { - if (!scopes) - return []; - if (Array.isArray(scopes)) { - return scopes.map((s) => s.trim()).filter((s) => s.length > 0); - } - return scopes.split(",").map((s) => s.trim()).filter((s) => s.length > 0); -} -function normalizeBudget(input) { - const daily = typeof input?.daily === "number" && !Number.isNaN(input.daily) ? input.daily : 10; - const currency = (input?.currency || "USDC").toUpperCase(); - const autoApprove = typeof input?.auto_approve_under === "number" && !Number.isNaN(input.auto_approve_under) ? input.auto_approve_under : 0; - return { - daily, - currency, - auto_approve_under: autoApprove - }; -} -function verifyServiceAuthorization(serviceId, signature2, payload, requestedScope) { - if (!serviceId) { - return { authorized: true }; - } - let service = storage.getTrustedService(serviceId); - let isAgent = false; - if (!service && (serviceId.startsWith("agent_") || serviceId.startsWith("vps_"))) { - const agent2 = storage.getAgentConnection(serviceId); - if (agent2 && agent2.status === "active" && agent2.service_public_key) { - service = { - service_id: agent2.agent_id, - name: agent2.name, - public_key: agent2.service_public_key, - scopes: agent2.permission_scopes, - budget: agent2.budget, - verified: true, - trusted_at: agent2.paired_at || agent2.created_at, - enabled: true - }; - isAgent = true; - } - } - if (!service) { - storage.logAudit("DENY", "denied", { - operation: "relay_request", - details: JSON.stringify({ service_id: serviceId, reason: "service_not_trusted" }) - }); - return { authorized: false, reason: `Service '${serviceId}' is not trusted` }; - } - if (!service.enabled) { - storage.logAudit("DENY", "denied", { - operation: "relay_request", - details: JSON.stringify({ service_id: serviceId, reason: "service_disabled" }) - }); - return { authorized: false, reason: `Service '${serviceId}' is disabled` }; - } - if (!signature2) { - storage.logAudit("DENY", "denied", { - operation: "relay_request", - details: JSON.stringify({ service_id: serviceId, reason: "missing_signature" }) - }); - return { authorized: false, reason: "Service signature required" }; - } - const signatureValid = verifyServiceSignature(payload, serviceId, signature2, service.public_key); - if (!signatureValid) { - storage.logAudit("DENY", "denied", { - operation: "relay_request", - details: JSON.stringify({ service_id: serviceId, reason: "invalid_signature" }) - }); - return { authorized: false, reason: "Invalid service signature" }; - } - if (isAgent) { - if (service.scopes.length === 0) { - storage.recordAgentRequest(serviceId); - return { authorized: true, service }; - } - const hasScope = service.scopes.some((s) => { - if (s === "*") - return true; - if (s === requestedScope) - return true; - if (s.endsWith(".*")) { - const prefix = s.slice(0, -1); - return requestedScope.startsWith(prefix); - } - if (s.endsWith(":*")) { - const prefix = s.slice(0, -1); - return requestedScope.startsWith(prefix); - } - return false; - }); - if (!hasScope) { - storage.logAudit("DENY", "denied", { - operation: "relay_request", - details: JSON.stringify({ service_id: serviceId, scope: requestedScope, reason: "scope_not_permitted" }) - }); - return { authorized: false, service, reason: `Scope '${requestedScope}' not permitted for this agent` }; - } - storage.recordAgentRequest(serviceId); - return { authorized: true, service }; - } - const scopeResult = storage.isServiceAuthorized(serviceId, requestedScope); - if (!scopeResult.authorized) { - storage.logAudit("DENY", "denied", { - operation: "relay_request", - details: JSON.stringify({ service_id: serviceId, scope: requestedScope, reason: scopeResult.reason }) - }); - return { authorized: false, service, reason: scopeResult.reason }; - } - return { authorized: true, service }; -} -function verifyRelayServiceIdentity(serviceId, signature2, payload) { - if (!serviceId) { - return { authorized: false, reason: "service_id is required for relay requests" }; - } - let service = storage.getTrustedService(serviceId); - if (!service && (serviceId.startsWith("agent_") || serviceId.startsWith("vps_"))) { - const agent2 = storage.getAgentConnection(serviceId); - if (agent2 && agent2.status === "active" && agent2.service_public_key) { - service = { - service_id: agent2.agent_id, - name: agent2.name, - public_key: agent2.service_public_key, - scopes: agent2.permission_scopes, - budget: agent2.budget, - verified: true, - trusted_at: agent2.paired_at || agent2.created_at, - enabled: true - }; - } - } - if (!service) { - return { authorized: false, reason: `Service '${serviceId}' is not trusted` }; - } - if (!service.enabled) { - return { authorized: false, service, reason: `Service '${serviceId}' is disabled` }; - } - if (!signature2) { - return { authorized: false, service, reason: "Service signature required" }; - } - if (!verifyServiceSignature(payload, serviceId, signature2, service.public_key)) { - return { authorized: false, service, reason: "Invalid service signature" }; - } - return { authorized: true, service }; -} -function verifyLocalAgentRequest(body, requestedScope) { - const serviceId = body.service_id; - const serviceSignature = body.service_signature; - const timestamp = body.timestamp; - if (!serviceId) { - return { authorized: true }; - } - if (!serviceId.startsWith("agent_") && !serviceId.startsWith("vps_")) { - return { authorized: true }; - } - const agent2 = storage.getAgentConnection(serviceId); - if (!agent2) { - storage.logAudit("DENY", "denied", { - operation: "local_agent_request", - details: JSON.stringify({ service_id: serviceId, reason: "agent_not_found" }) - }); - return { authorized: false, reason: `Agent '${serviceId}' not found`, skipConsentFlow: true }; - } - if (agent2.status !== "active") { - storage.logAudit("DENY", "denied", { - operation: "local_agent_request", - details: JSON.stringify({ service_id: serviceId, reason: "agent_not_active", status: agent2.status }) - }); - return { authorized: false, reason: `Agent '${serviceId}' is not active (status: ${agent2.status})`, skipConsentFlow: true }; - } - if (!agent2.service_public_key) { - storage.logAudit("DENY", "denied", { - operation: "local_agent_request", - details: JSON.stringify({ service_id: serviceId, reason: "no_public_key" }) - }); - return { authorized: false, reason: `Agent '${serviceId}' has no registered public key`, skipConsentFlow: true }; - } - if (serviceSignature) { - const { service_signature: _, ...payloadWithoutSig } = body; - const signatureValid = verifyServiceSignature(payloadWithoutSig, serviceId, serviceSignature, agent2.service_public_key); - if (!signatureValid) { - storage.logAudit("DENY", "denied", { - operation: "local_agent_request", - details: JSON.stringify({ service_id: serviceId, reason: "invalid_signature" }) - }); - return { authorized: false, reason: "Invalid agent signature", skipConsentFlow: true }; - } - if (timestamp) { - const requestTime = new Date(timestamp).getTime(); - const now = Date.now(); - const fiveMinutes = 5 * 60 * 1e3; - if (Math.abs(now - requestTime) > fiveMinutes) { - storage.logAudit("DENY", "denied", { - operation: "local_agent_request", - details: JSON.stringify({ service_id: serviceId, reason: "timestamp_expired" }) - }); - return { authorized: false, reason: "Request timestamp expired", skipConsentFlow: true }; - } - } - } - const normalizedScopes = normalizePermissionScopes(agent2.permission_scopes || []); - if (normalizedScopes.length === 0) { - storage.recordAgentRequest(serviceId); - return { authorized: true, agent: agent2, preAuthorized: false }; - } - const hasScope = normalizedScopes.some((s) => { - if (s === "*") - return true; - if (s === requestedScope) - return true; - if (s.endsWith(".*")) { - const prefix = s.slice(0, -1); - return requestedScope.startsWith(prefix); - } - if (s.endsWith(":*")) { - const prefix = s.slice(0, -1); - return requestedScope.startsWith(prefix); - } - return false; - }); - if (!hasScope) { - storage.logAudit("DENY", "denied", { - operation: "local_agent_request", - details: JSON.stringify({ - service_id: serviceId, - scope: requestedScope, - permitted_scopes: normalizedScopes, - reason: "scope_not_permitted" - }) - }); - return { - authorized: false, - agent: agent2, - reason: `Scope '${requestedScope}' is not permitted for agent '${agent2.name}'. Permitted scopes: ${normalizedScopes.join(", ")}`, - skipConsentFlow: true - }; - } - storage.recordAgentRequest(serviceId); - return { authorized: true, agent: agent2, preAuthorized: true }; -} -function getScopeForRelayMethod(method, params) { - switch (method) { - case "get_address": - case "vault_get_address": - return `sign:${params.chain || "solana"}`; - case "vault_read": - return `read:${params.scope || ""}`; - case "vault_write": - return `write:${params.scope || ""}`; - case "vault_sign": - return `sign:${params.chain || "solana"}`; - case "vault_sign_message": - return `sign:${params.chain || "solana"}`; - case "vault_sign_x402": - return `sign:${params.network || "solana"}`; - case "vault_pair": - return "config:pair"; - case "consent_status": - return "consent:status"; - case "budget_check": - return `budget:check`; - default: - return ""; - } -} -function decodeKey(base64, expectedLength) { - if (!base64) - return null; - try { - const buf = Buffer.from(base64, "base64"); - if (buf.length !== expectedLength) - return null; - return buf; - } catch { - return null; - } -} -function relayHttpUrl(relayUrl) { - let url = relayUrl.trim(); - if (url.startsWith("wss://")) { - url = `https://${url.slice("wss://".length)}`; - } else if (url.startsWith("ws://")) { - url = `http://${url.slice("ws://".length)}`; - } - return url.replace(/\/ws\/?$/, "").replace(/\/$/, ""); -} -async function registerVpsInviteWithRelay(relayUrl, inviteId, vaultId) { - const response = await fetch(`${relayHttpUrl(relayUrl)}/v1/invites/register`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ invite_id: inviteId, vault_id: vaultId }) - }); - if (!response.ok) { - const body = await response.text().catch(() => ""); - throw new Error(`Relay invite registration failed: ${response.status}${body ? ` ${body}` : ""}`); - } -} -async function ensureRelayIdentity() { - const config = budget.getConfig(); - let vaultId = config.vault_id; - if (!vaultId) { - vaultId = `vault_${crypto5.randomUUID()}`; - budget.setConfig("vault_id", vaultId); - } - const effectiveDefault = DEFAULT_RELAY_URL || import_core.DEFAULT_RELAY_URL; - let relayUrl = config.relay_url || ""; - if (!relayUrl && effectiveDefault) { - relayUrl = effectiveDefault; - budget.setConfig("relay_url", relayUrl); - } else if (DEFAULT_RELAY_URL && DEFAULT_RELAY_URL !== relayUrl) { - relayUrl = DEFAULT_RELAY_URL; - budget.setConfig("relay_url", relayUrl); - } - let hpkePublic = decodeKey(config.relay_hpke_public_key, 32); - let hpkePrivate = decodeKey(config.relay_hpke_private_key, 32); - if (!hpkePublic || !hpkePrivate) { - const keyPair = await (0, import_relay_client.generateKeyPair)(); - hpkePublic = keyPair.publicKey; - hpkePrivate = keyPair.privateKey; - budget.setConfig("relay_hpke_public_key", hpkePublic.toString("base64")); - budget.setConfig("relay_hpke_private_key", hpkePrivate.toString("base64")); - } - let signingPublic = decodeKey(config.relay_signing_public_key, 32); - let signingPrivate = decodeKey(config.relay_signing_private_key, 64); - if (!signingPublic || !signingPrivate) { - const signing = (0, import_relay_client.generateSigningKeyPair)(); - signingPublic = signing.publicKey; - signingPrivate = signing.privateKey; - budget.setConfig("relay_signing_public_key", signingPublic.toString("base64")); - budget.setConfig("relay_signing_private_key", signingPrivate.toString("base64")); - } - return { - vaultId, - relayUrl, - hpkeKeyPair: { publicKey: hpkePublic, privateKey: hpkePrivate }, - signingKeyPair: { publicKey: signingPublic, privateKey: signingPrivate }, - pairingToken: config.relay_pairing_token - }; -} -async function handleRelayRequest(server, decryptedPayload, meta) { - let parsed; - try { - parsed = JSON.parse(decryptedPayload.toString()); - } catch { - throw new Error("Invalid relay payload: not JSON"); - } - if (!parsed.reply_public_key) { - throw new Error("Invalid relay payload: missing reply_public_key"); - } - const replyPublicKey = Buffer.from(parsed.reply_public_key, "base64"); - const method = parsed.method; - if (!method) { - throw new Error("Invalid relay payload: missing method"); - } - if (method === "vault_pair") { - const params = parsed.params || {}; - const pairingToken = params.pairing_token; - const serviceId = parsed.service_id; - const servicePublicKey = params.service_public_key; - if (!pairingToken || !serviceId || !servicePublicKey) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "PAIRING_INVALID", - message: "pairing_token, service_id, and service_public_key are required" - } - }); - return { response: errorResponse, replyPublicKey }; - } - const tokenRecord = storage.getPairingToken(pairingToken); - if (!tokenRecord) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "PAIRING_INVALID", - message: "Pairing token is invalid or expired" - } - }); - return { response: errorResponse, replyPublicKey }; - } - if (tokenRecord.service_id !== serviceId) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "PAIRING_INVALID", - message: "Pairing token does not match service_id" - } - }); - return { response: errorResponse, replyPublicKey }; - } - if (!parsed.service_signature) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "PAIRING_INVALID", - message: "service_signature is required for pairing" - } - }); - return { response: errorResponse, replyPublicKey }; - } - const signatureValid = verifyServiceSignature(parsed, serviceId, parsed.service_signature, servicePublicKey); - if (!signatureValid) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "PAIRING_INVALID", - message: "Invalid service signature" - } - }); - return { response: errorResponse, replyPublicKey }; - } - const serviceName = params.service_name || serviceId; - const existing = storage.getTrustedService(serviceId); - if (existing) { - storage.updateTrustedService(serviceId, { - name: serviceName, - public_key: servicePublicKey, - scopes: tokenRecord.scopes, - budget: tokenRecord.budget, - enabled: true - }); - } else { - storage.addTrustedService({ - service_id: serviceId, - name: serviceName, - public_key: servicePublicKey, - scopes: tokenRecord.scopes, - budget: tokenRecord.budget, - verified: false - }); - } - storage.markServiceConnected(serviceId); - storage.markPairingTokenUsed(pairingToken); - const okResponse = JSON.stringify({ - ok: true, - service_id: serviceId - }); - return { response: okResponse, replyPublicKey }; - } - if (method === "consent_status") { - const params = parsed.params || {}; - const consentId = params.consent_id; - const identityResult = verifyRelayServiceIdentity(parsed.service_id, parsed.service_signature, parsed); - if (!identityResult.authorized) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "VAULT_UNTRUSTED_SERVICE", - message: identityResult.reason || "Service is not authorized", - action: "trust_service" - } - }); - return { response: errorResponse, replyPublicKey }; - } - if (!consentId) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "INVALID_REQUEST", - message: "consent_id is required" - } - }); - return { response: errorResponse, replyPublicKey }; - } - const consent = storage.getPendingConsent(consentId); - if (!consent) { - return { response: JSON.stringify({ status: "not_found" }), replyPublicKey }; - } - if (parsed.agent_name && consent.agent_name !== parsed.agent_name) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "CONSENT_NOT_FOUND", - message: "Consent does not belong to this agent" - } - }); - return { response: errorResponse, replyPublicKey }; - } - if (consent.status === "pending" && new Date(consent.expires_at) < /* @__PURE__ */ new Date()) { - storage.resolveConsent(consent.id, "expired"); - consent.status = "expired"; - } - const statusResponse = JSON.stringify({ - status: consent.status, - session_id: consent.session_id, - expires_at: consent.expires_at - }); - return { response: statusResponse, replyPublicKey }; - } - const requestedScope = getScopeForRelayMethod(method, parsed.params || {}); - if (!parsed.service_id) { - storage.logAudit("DENY", "denied", { - operation: "relay_request", - details: JSON.stringify({ reason: "missing_service_id", method }) - }); - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "VAULT_UNTRUSTED_SERVICE", - message: "service_id is required for relay requests", - action: "trust_service" - } - }); - return { response: errorResponse, replyPublicKey }; - } - const authResult = verifyServiceAuthorization(parsed.service_id, parsed.service_signature, parsed, requestedScope); - if (!authResult.authorized) { - const errorResponse = JSON.stringify({ - ok: false, - error: { - code: "VAULT_UNTRUSTED_SERVICE", - message: authResult.reason || "Service not authorized", - action: "trust_service" - } - }); - return { response: errorResponse, replyPublicKey }; - } - storage.logAudit("EXECUTE", "success", { - operation: "service_verify", - details: JSON.stringify({ - service_id: parsed.service_id, - method, - scope: requestedScope - }) - }); - const body = { - ...parsed.params || {} - }; - if (parsed.agent_name) - body.agent_name = parsed.agent_name; - if (parsed.session_id) - body.session_id = parsed.session_id; - let url = ""; - let httpMethod = "POST"; - switch (method) { - case "get_address": - case "vault_get_address": { - const chain = body.chain || "solana"; - httpMethod = "GET"; - url = `/address/${chain}`; - break; - } - case "vault_read": - url = "/v1/vault/read"; - break; - case "vault_write": - url = "/v1/vault/write"; - break; - case "vault_sign": - url = "/v1/vault/sign"; - break; - case "vault_sign_message": - url = "/v1/vault/sign_message"; - break; - case "vault_sign_x402": - url = "/v1/vault/sign_x402"; - break; - case "budget_check": - httpMethod = "GET"; - url = `/budget/check?amount=${body.amount ?? ""}¤cy=${body.currency ?? ""}&chain=${body.chain ?? ""}`; - break; - default: - throw new Error(`Unknown relay method: ${method}`); - } - console.log("[RELAY] Calling endpoint:", httpMethod, url, "body:", JSON.stringify(body).substring(0, 200)); - const response = await server.inject({ - method: httpMethod, - url, - payload: httpMethod === "POST" ? JSON.stringify(body) : void 0, - headers: { "content-type": "application/json" } - }); - console.log("[RELAY] Response:", response.statusCode, response.payload?.substring(0, 200)); - return { response: response.payload || "", replyPublicKey }; -} -async function startRelayClient(server) { - const identity = await ensureRelayIdentity(); - if (!identity.relayUrl) { - return; - } - if (relayClient) { - relayClient.destroy(); - relayClient = null; - relayConnected = false; - } - relayClient = new import_relay_client.RelayClient({ - relayUrl: identity.relayUrl, - vaultId: identity.vaultId, - keyPair: identity.hpkeKeyPair, - signingKeyPair: identity.signingKeyPair, - pairingToken: identity.pairingToken, - autoReconnect: true, - debug: false - }); - relayClient.on("connected", () => { - relayConnected = true; - }); - relayClient.on("disconnected", () => { - relayConnected = false; - }); - relayClient.on("error", () => { - relayConnected = relayClient?.isConnected() ?? false; - }); - relayClient.on("pairingClaim", (rawClaim) => { - const claim = rawClaim; - console.log(`[Vault] Received pairing claim: ${claim.claim_id} from ${claim.claim.agent_hostname}`); - console.log(`[Vault] Verification phrase: ${claim.verification_phrase}`); - pendingPairingClaims.set(claim.claim_id, claim); - }); - let pendingEnvelope = null; - relayClient.on("request", (rawEnvelope) => { - const envelope = rawEnvelope; - pendingEnvelope = { - request_id: envelope.request_id, - action_type: envelope.action_type, - vault_id: envelope.vault_id, - version: envelope.version - }; - }); - relayClient.setRequestHandler(async (action, decryptedPayload) => { - const meta = pendingEnvelope || { - request_id: "", - action_type: action, - vault_id: identity.vaultId, - version: "1" - }; - pendingEnvelope = null; - const { response, replyPublicKey } = await handleRelayRequest(server, decryptedPayload, { - request_id: meta.request_id, - action_type: meta.action_type || action, - vault_id: meta.vault_id || identity.vaultId, - version: meta.version || "1" - }); - return { payload: Buffer.from(response), recipientPublicKey: replyPublicKey }; - }); - await relayClient.connect(); -} -async function main() { - const port = parseInt(process.env.VAULT_PORT || String(DEFAULT_PORT), 10); - const server = await buildServer(); - try { - await server.listen({ port, host: HOST }); - server.log.info(`DCP Vault REST Server running at http://${HOST}:${port}`); - server.log.info("SECURITY: Bound to localhost only"); - if (await storage.isProvisioned()) { - try { - await startRelayClient(server); - if (relayConnected) { - server.log.info("Relay client connected"); - } else { - server.log.info("Relay client not connected (no relay_url configured)"); - } - } catch (err) { - server.log.error(err); - server.log.error("Relay client failed to start"); - } - } else { - server.log.info("Vault not initialized - relay client will start after vault setup"); - } - startConsentWatcher(); - server.log.info("Consent watcher started for Telegram notifications"); - startRemoteApprovalWatcher(); - server.log.info("Remote Telegram approval watcher started"); - } catch (err) { - server.log.error(err); - process.exit(1); - } -} -process.on("SIGINT", () => { - process.stderr.write("Shutting down...\n"); - process.exit(0); -}); -process.on("SIGTERM", () => { - process.stderr.write("Shutting down...\n"); - process.exit(0); -}); -if (process.env.VITEST !== "true" && process.env.NODE_ENV !== "test") { - main(); -} -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - buildServer -}); -/*! Bundled license information: - -@fastify/proxy-addr/index.js: - (*! - * proxy-addr - * Copyright(c) 2021 Fastify collaborators - * Copyright(c) 2014-2016 Douglas Christopher Wilson - * MIT Licensed - *) - -toad-cache/dist/toad-cache.cjs: - (** - * toad-cache - * - * @copyright 2024 Igor Savin - * @license MIT - * @version 3.7.0 - *) - -light-my-request/lib/form-data.js: - (*! formdata-polyfill. MIT License. Jimmy Wärting *) - -@noble/hashes/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/hashes/esm/utils.js: - (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -safe-buffer/index.js: - (*! safe-buffer. MIT License. Feross Aboukhadijeh *) - -@solana/buffer-layout/lib/Layout.js: - (** - * Support for translating between Uint8Array instances and JavaScript - * native types. - * - * {@link module:Layout~Layout|Layout} is the basis of a class - * hierarchy that associates property names with sequences of encoded - * bytes. - * - * Layouts are supported for these scalar (numeric) types: - * * {@link module:Layout~UInt|Unsigned integers in little-endian - * format} with {@link module:Layout.u8|8-bit}, {@link - * module:Layout.u16|16-bit}, {@link module:Layout.u24|24-bit}, - * {@link module:Layout.u32|32-bit}, {@link - * module:Layout.u40|40-bit}, and {@link module:Layout.u48|48-bit} - * representation ranges; - * * {@link module:Layout~UIntBE|Unsigned integers in big-endian - * format} with {@link module:Layout.u16be|16-bit}, {@link - * module:Layout.u24be|24-bit}, {@link module:Layout.u32be|32-bit}, - * {@link module:Layout.u40be|40-bit}, and {@link - * module:Layout.u48be|48-bit} representation ranges; - * * {@link module:Layout~Int|Signed integers in little-endian - * format} with {@link module:Layout.s8|8-bit}, {@link - * module:Layout.s16|16-bit}, {@link module:Layout.s24|24-bit}, - * {@link module:Layout.s32|32-bit}, {@link - * module:Layout.s40|40-bit}, and {@link module:Layout.s48|48-bit} - * representation ranges; - * * {@link module:Layout~IntBE|Signed integers in big-endian format} - * with {@link module:Layout.s16be|16-bit}, {@link - * module:Layout.s24be|24-bit}, {@link module:Layout.s32be|32-bit}, - * {@link module:Layout.s40be|40-bit}, and {@link - * module:Layout.s48be|48-bit} representation ranges; - * * 64-bit integral values that decode to an exact (if magnitude is - * less than 2^53) or nearby integral Number in {@link - * module:Layout.nu64|unsigned little-endian}, {@link - * module:Layout.nu64be|unsigned big-endian}, {@link - * module:Layout.ns64|signed little-endian}, and {@link - * module:Layout.ns64be|unsigned big-endian} encodings; - * * 32-bit floating point values with {@link - * module:Layout.f32|little-endian} and {@link - * module:Layout.f32be|big-endian} representations; - * * 64-bit floating point values with {@link - * module:Layout.f64|little-endian} and {@link - * module:Layout.f64be|big-endian} representations; - * * {@link module:Layout.const|Constants} that take no space in the - * encoded expression. - * - * and for these aggregate types: - * * {@link module:Layout.seq|Sequence}s of instances of a {@link - * module:Layout~Layout|Layout}, with JavaScript representation as - * an Array and constant or data-dependent {@link - * module:Layout~Sequence#count|length}; - * * {@link module:Layout.struct|Structure}s that aggregate a - * heterogeneous sequence of {@link module:Layout~Layout|Layout} - * instances, with JavaScript representation as an Object; - * * {@link module:Layout.union|Union}s that support multiple {@link - * module:Layout~VariantLayout|variant layouts} over a fixed - * (padded) or variable (not padded) span of bytes, using an - * unsigned integer at the start of the data or a separate {@link - * module:Layout.unionLayoutDiscriminator|layout element} to - * determine which layout to use when interpreting the buffer - * contents; - * * {@link module:Layout.bits|BitStructure}s that contain a sequence - * of individual {@link - * module:Layout~BitStructure#addField|BitField}s packed into an 8, - * 16, 24, or 32-bit unsigned integer starting at the least- or - * most-significant bit; - * * {@link module:Layout.cstr|C strings} of varying length; - * * {@link module:Layout.blob|Blobs} of fixed- or variable-{@link - * module:Layout~Blob#length|length} raw data. - * - * All {@link module:Layout~Layout|Layout} instances are immutable - * after construction, to prevent internal state from becoming - * inconsistent. - * - * @local Layout - * @local ExternalLayout - * @local GreedyCount - * @local OffsetLayout - * @local UInt - * @local UIntBE - * @local Int - * @local IntBE - * @local NearUInt64 - * @local NearUInt64BE - * @local NearInt64 - * @local NearInt64BE - * @local Float - * @local FloatBE - * @local Double - * @local DoubleBE - * @local Sequence - * @local Structure - * @local UnionDiscriminator - * @local UnionLayoutDiscriminator - * @local Union - * @local VariantLayout - * @local BitStructure - * @local BitField - * @local Boolean - * @local Blob - * @local CString - * @local Constant - * @local bindConstructorLayout - * @module Layout - * @license MIT - * @author Peter A. Bigot - * @see {@link https://github.com/pabigot/buffer-layout|buffer-layout on GitHub} - *) - -@noble/curves/esm/abstract/weierstrass.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/_shortw_utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/esm/secp256k1.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@solana/web3.js/lib/index.esm.js: - (*! - * humanize-ms - index.js - * Copyright(c) 2014 dead_horse - * MIT Licensed - *) - -@noble/curves/utils.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/abstract/modular.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/abstract/curve.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/abstract/edwards.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/abstract/montgomery.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) - -@noble/curves/ed25519.js: - (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *) -*/ diff --git a/packages/dcp-desktop/src-tauri/src/lib.rs b/packages/dcp-desktop/src-tauri/src/lib.rs deleted file mode 100644 index 238a5b8..0000000 --- a/packages/dcp-desktop/src-tauri/src/lib.rs +++ /dev/null @@ -1,1188 +0,0 @@ -use base64::{engine::general_purpose::STANDARD as BASE64, Engine}; -use ed25519_dalek::{Signer, SigningKey, VerifyingKey}; -use rand::rngs::OsRng; -use serde::{Deserialize, Serialize}; -use serde_json::json; -use std::fs; -use std::io::Write; -use std::process::{Child, Command}; -use std::sync::{Mutex, OnceLock}; -use tauri::{ - menu::{Menu, MenuItem}, - tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent}, - AppHandle, Manager, RunEvent, State, WindowEvent, -}; -use uuid::Uuid; - -#[cfg(not(target_os = "macos"))] -use keyring::Entry; - -// Constants -const KEYCHAIN_SERVICE: &str = "dcp-vault-desktop"; -const KEYCHAIN_PRIVATE_KEY: &str = "private-key"; -const KEYCHAIN_DESKTOP_ID: &str = "desktop-id"; -const SERVER_URL: &str = "http://127.0.0.1:8421"; - -static RESOURCE_DIR: OnceLock = OnceLock::new(); - -// Server process manager state -struct ServerState { - process: Mutex>, -} - -impl Drop for ServerState { - fn drop(&mut self) { - // Ensure server is killed when ServerState is dropped (app exit) - if let Ok(mut process_guard) = self.process.lock() { - if let Some(ref mut child) = *process_guard { - let _ = child.kill(); - let _ = child.wait(); - } - } - } -} - -// Owner authentication state -struct OwnerState { - token: Mutex>, -} - -#[derive(Debug, Serialize, Deserialize)] -struct InitVaultResult { - recovery_phrase: Vec, -} - -#[derive(Debug, Serialize, Deserialize)] -struct WalletInfo { - chain: String, - address: String, -} - -#[derive(Debug, Serialize, Deserialize)] -struct CreateWalletsResult { - wallets: Vec, -} - -#[derive(Debug, Serialize, Deserialize)] -struct ExportWalletResult { - chain: String, - address: String, - private_key: String, -} - -#[derive(Debug, Serialize, Deserialize)] -struct ReplaceWalletResult { - chain: String, - old_address: Option, - new_address: String, -} - -#[derive(Debug, Serialize, Deserialize)] -struct HealthResponse { - status: String, - initialized: bool, - unlocked: bool, - version: String, -} - -#[derive(Debug, Serialize, Deserialize)] -struct DesktopCredentials { - desktop_id: String, - public_key: String, - is_new: bool, -} - -#[derive(Debug, Serialize, Deserialize)] -struct ChallengeResponse { - desktop_id: String, - nonce: String, - expires_at: String, -} - -#[derive(Debug, Serialize, Deserialize)] -struct VerifyResponse { - verified: bool, - token: String, - expires_at: String, - idle_timeout_minutes: u32, -} - -#[derive(Debug, Serialize, Deserialize)] -struct RegisterRequest { - desktop_id: String, - public_key: String, -} - -#[derive(Debug, Serialize, Deserialize)] -struct VerifyRequest { - desktop_id: String, - nonce: String, - signature: String, -} - -// ============================================================================ -// Owner Trust Model Commands -// ============================================================================ - -// ============================================================================ -// Keychain helpers -// - Default path: keyring crate (production + signed apps) -// - macOS dev fallback: security CLI without passing secrets in argv -// ============================================================================ - -#[cfg(target_os = "macos")] -fn keychain_get_macos_cli(service: &str, account: &str) -> Option { - let output = Command::new("security") - .args(["find-generic-password", "-s", service, "-a", account, "-w"]) - .output() - .ok()?; - - if output.status.success() { - String::from_utf8(output.stdout) - .ok() - .map(|s| s.trim().to_string()) - } else { - None - } -} - -#[cfg(target_os = "macos")] -fn keychain_set_macos_cli(service: &str, account: &str, password: &str) -> Result<(), String> { - // Best-effort delete existing item (ignore errors) - let _ = Command::new("security") - .args(["delete-generic-password", "-s", service, "-a", account]) - .output(); - - // Add password - in dev mode we pass via argument (visible in ps but acceptable for dev) - // In production, signed apps use the keyring crate instead - let output = Command::new("security") - .args([ - "add-generic-password", - "-s", - service, - "-a", - account, - "-w", - password, - "-U", - ]) - .output() - .map_err(|e| format!("Failed to execute security command: {}", e))?; - - if output.status.success() { - Ok(()) - } else { - let stderr = String::from_utf8_lossy(&output.stderr); - Err(format!("Keychain write failed: {}", stderr)) - } -} - -fn keychain_get(service: &str, account: &str) -> Option { - // Always use CLI on macOS - keyring crate has issues with ad-hoc signed apps - #[cfg(target_os = "macos")] - { - return keychain_get_macos_cli(service, account); - } - - #[cfg(not(target_os = "macos"))] - { - let entry = Entry::new(service, account).ok()?; - entry.get_password().ok() - } -} - -fn keychain_set(service: &str, account: &str, password: &str) -> Result<(), String> { - // Always use CLI on macOS - keyring crate has issues with ad-hoc signed apps - #[cfg(target_os = "macos")] - { - return keychain_set_macos_cli(service, account, password); - } - - #[cfg(not(target_os = "macos"))] - { - let entry = Entry::new(service, account).map_err(|e| format!("Keychain error: {}", e))?; - entry - .set_password(password) - .map_err(|e| format!("Failed to store key: {}", e))?; - Ok(()) - } -} - -// ============================================================================ -// Node runtime resolution (bundled or system) -// ============================================================================ - -fn bundled_node_path() -> Option { - if let Some(dir) = RESOURCE_DIR.get() { - let candidate = dir.join("bin").join(if cfg!(windows) { "node.exe" } else { "node" }); - if candidate.exists() { - return Some(candidate); - } - } - - // Dev fallback: src-tauri/bin/node relative to current dir - let dev_candidate = std::env::current_dir() - .ok() - .map(|d| d.join("src-tauri").join("bin").join(if cfg!(windows) { "node.exe" } else { "node" })); - if let Some(path) = dev_candidate { - if path.exists() { - return Some(path); - } - } - - None -} - -fn resolve_node_binary() -> Result { - if let Some(path) = bundled_node_path() { - return Ok(path.to_string_lossy().to_string()); - } - - // Check system Node availability - if Command::new("node").arg("-v").output().is_ok() { - return Ok("node".to_string()); - } - - Err("Node.js runtime not found. Install Node 22 LTS or run `npm run bundle:node` before building the desktop app.".to_string()) -} - -// ============================================================================ -// Node helper for vault init + wallet creation (uses bundled @dcprotocol/core) -// ============================================================================ - -fn get_bundled_helper_path() -> Option { - // First try: bundled in app resources (production) - if let Some(dir) = RESOURCE_DIR.get() { - let candidate = dir.join("resources").join("dcp-helper-bundle.cjs"); - if candidate.exists() { - return Some(candidate); - } - // Also try directly in resources dir - let candidate = dir.join("dcp-helper-bundle.cjs"); - if candidate.exists() { - return Some(candidate); - } - } - - // Dev fallback: src-tauri/resources/dcp-helper-bundle.cjs - let dev_candidate = std::env::current_dir() - .ok() - .map(|d| d.join("src-tauri").join("resources").join("dcp-helper-bundle.cjs")); - if let Some(path) = dev_candidate { - if path.exists() { - return Some(path); - } - } - - // Dev fallback 2: relative to current dir - let dev_candidate2 = std::env::current_dir() - .ok() - .map(|d| d.join("resources").join("dcp-helper-bundle.cjs")); - if let Some(path) = dev_candidate2 { - if path.exists() { - return Some(path); - } - } - - None -} - -fn run_node_helper(payload: serde_json::Value) -> Result { - // Get the bundled helper path (production or dev) - let helper_path = get_bundled_helper_path() - .ok_or_else(|| "DCP helper bundle not found. Run 'npm run bundle:helper' first.".to_string())?; - - let node_bin = resolve_node_binary()?; - let mut cmd = Command::new(node_bin); - cmd.arg("--no-deprecation") - .arg(&helper_path) - .stdin(std::process::Stdio::piped()) - .stdout(std::process::Stdio::piped()) - .stderr(std::process::Stdio::piped()); - - // Set working directory and NODE_PATH for native module resolution - if let Some(parent) = helper_path.parent() { - cmd.current_dir(parent); - - // Set NODE_PATH so native modules can be found in resources/node_modules - let node_modules_path = parent.join("node_modules"); - if node_modules_path.exists() { - cmd.env("NODE_PATH", &node_modules_path); - } - - // Also try monorepo node_modules for dev mode - if let Some(root) = find_node_root() { - let monorepo_node_modules = root.join("node_modules"); - if monorepo_node_modules.exists() { - // Combine both paths - let combined = if node_modules_path.exists() { - format!("{}:{}", node_modules_path.display(), monorepo_node_modules.display()) - } else { - monorepo_node_modules.to_string_lossy().to_string() - }; - cmd.env("NODE_PATH", combined); - } - } - } - - let mut child = cmd.spawn().map_err(|e| format!("Failed to start node: {}", e))?; - - if let Some(stdin) = child.stdin.as_mut() { - let input = serde_json::to_vec(&payload).map_err(|e| format!("JSON encode failed: {}", e))?; - stdin - .write_all(&input) - .and_then(|_| stdin.write_all(b"\n")) - .map_err(|e| format!("Failed to write to node stdin: {}", e))?; - } - - let output = child - .wait_with_output() - .map_err(|e| format!("Failed to wait for node: {}", e))?; - - let stdout = String::from_utf8(output.stdout).map_err(|e| format!("Invalid stdout: {}", e))?; - - if !output.status.success() { - if let Ok(parsed) = serde_json::from_str::(stdout.trim()) { - if let Some(msg) = parsed.get("error").and_then(|v| v.as_str()) { - return Err(friendly_helper_error(msg)); - } - } - - let stderr = String::from_utf8_lossy(&output.stderr); - return Err(if stderr.trim().is_empty() { - "Node helper failed".to_string() - } else { - friendly_helper_error(stderr.trim()) - }); - } - - let parsed: serde_json::Value = - serde_json::from_str(stdout.trim()).map_err(|e| format!("Invalid JSON output: {}", e))?; - - if parsed.get("ok").and_then(|v| v.as_bool()) != Some(true) { - let msg = parsed - .get("error") - .and_then(|v| v.as_str()) - .unwrap_or("Node helper error"); - return Err(friendly_helper_error(msg)); - } - - Ok(parsed) -} - -fn friendly_helper_error(message: &str) -> String { - if message.contains("Wrong passphrase") - || message.contains("Decryption failed") - || message.contains("invalid tag") - || message.contains("authentication") - { - return "Wrong passphrase. Please try again.".to_string(); - } - - message.to_string() -} - -fn find_node_root() -> Option { - let mut dir = std::env::current_dir().ok()?; - loop { - let core_path = dir.join("node_modules").join("@dcprotocol").join("core"); - if core_path.exists() { - return Some(dir); - } - if !dir.pop() { - break; - } - } - None -} - -fn find_monorepo_root() -> Option { - let mut dir = std::env::current_dir().ok()?; - loop { - // Check for packages/dcp-vault directory (monorepo structure) - let server_path = dir.join("packages").join("dcp-vault"); - if server_path.exists() { - return Some(dir); - } - // Also check for root package.json with workspaces - let pkg_json = dir.join("package.json"); - if pkg_json.exists() { - if let Ok(content) = fs::read_to_string(&pkg_json) { - if content.contains("\"workspaces\"") { - return Some(dir); - } - } - } - if !dir.pop() { - break; - } - } - None -} - -/// Get or create desktop credentials (keypair + desktop_id) -/// Returns the public key and desktop_id, stored in OS keychain -#[tauri::command] -async fn get_or_create_desktop_credentials() -> Result { - // Try to load existing credentials from keychain using security CLI - if let Some(pk_b64) = keychain_get(KEYCHAIN_SERVICE, KEYCHAIN_PRIVATE_KEY) { - if let Some(desktop_id) = keychain_get(KEYCHAIN_SERVICE, KEYCHAIN_DESKTOP_ID) { - // Decode and derive public key - let pk_bytes = BASE64 - .decode(&pk_b64) - .map_err(|e| format!("Invalid key: {}", e))?; - let pk_array: [u8; 32] = pk_bytes - .try_into() - .map_err(|_| "Invalid key length".to_string())?; - let signing_key = SigningKey::from_bytes(&pk_array); - let verifying_key: VerifyingKey = (&signing_key).into(); - let public_key = BASE64.encode(verifying_key.as_bytes()); - - return Ok(DesktopCredentials { - desktop_id, - public_key, - is_new: false, - }); - } - } - - // Generate new keypair - let signing_key = SigningKey::generate(&mut OsRng); - let verifying_key: VerifyingKey = (&signing_key).into(); - let private_key_b64 = BASE64.encode(signing_key.to_bytes()); - let public_key = BASE64.encode(verifying_key.as_bytes()); - let desktop_id = Uuid::new_v4().to_string(); - - // Store in keychain using security CLI - keychain_set(KEYCHAIN_SERVICE, KEYCHAIN_PRIVATE_KEY, &private_key_b64)?; - keychain_set(KEYCHAIN_SERVICE, KEYCHAIN_DESKTOP_ID, &desktop_id)?; - - // Verify both writes worked - if keychain_get(KEYCHAIN_SERVICE, KEYCHAIN_PRIVATE_KEY).is_none() { - return Err("Keychain write verification failed - private-key not persisted".to_string()); - } - if keychain_get(KEYCHAIN_SERVICE, KEYCHAIN_DESKTOP_ID).is_none() { - return Err("Keychain write verification failed - desktop_id not persisted".to_string()); - } - - Ok(DesktopCredentials { - desktop_id, - public_key, - is_new: true, - }) -} - -/// Register desktop with server (first time setup) -#[tauri::command] -async fn register_desktop(desktop_id: String, public_key: String) -> Result { - let client = reqwest::Client::new(); - let req = RegisterRequest { - desktop_id: desktop_id.clone(), - public_key: public_key.clone(), - }; - - let response = client - .post(format!("{}/v1/desktop/register", SERVER_URL)) - .json(&req) - .send() - .await - .map_err(|e| format!("Server error: {}", e))?; - - if !response.status().is_success() { - let text = response.text().await.unwrap_or_default(); - return Err(format!("Registration failed: {}", text)); - } - - Ok(true) -} - -/// Authenticate with server using challenge-response -#[tauri::command] -async fn authenticate_owner(state: State<'_, OwnerState>) -> Result { - // Get credentials from keychain using security CLI - let pk_b64 = keychain_get(KEYCHAIN_SERVICE, KEYCHAIN_PRIVATE_KEY) - .ok_or_else(|| "No credentials found. Call get_or_create_desktop_credentials first.".to_string())?; - let desktop_id = keychain_get(KEYCHAIN_SERVICE, KEYCHAIN_DESKTOP_ID) - .ok_or_else(|| "No desktop ID found.".to_string())?; - - // Decode private key - let pk_bytes = BASE64 - .decode(&pk_b64) - .map_err(|e| format!("Invalid key: {}", e))?; - let pk_array: [u8; 32] = pk_bytes - .try_into() - .map_err(|_| "Invalid key length".to_string())?; - let signing_key = SigningKey::from_bytes(&pk_array); - - let client = reqwest::Client::new(); - - // Step 1: Get challenge - let challenge_response = client - .get(format!( - "{}/v1/desktop/challenge?desktop_id={}", - SERVER_URL, desktop_id - )) - .send() - .await - .map_err(|e| format!("Server error: {}", e))?; - - if !challenge_response.status().is_success() { - let text = challenge_response.text().await.unwrap_or_default(); - return Err(format!("Challenge failed: {}", text)); - } - - let challenge: ChallengeResponse = challenge_response - .json() - .await - .map_err(|e| format!("Invalid challenge: {}", e))?; - - // Step 2: Sign the nonce - let nonce_bytes = BASE64 - .decode(&challenge.nonce) - .map_err(|e| format!("Invalid nonce: {}", e))?; - let signature = signing_key.sign(&nonce_bytes); - let signature_b64 = BASE64.encode(signature.to_bytes()); - - // Step 3: Verify signature and get token - let verify_req = VerifyRequest { - desktop_id: desktop_id.clone(), - nonce: challenge.nonce, - signature: signature_b64, - }; - - let verify_response = client - .post(format!("{}/v1/desktop/verify", SERVER_URL)) - .json(&verify_req) - .send() - .await - .map_err(|e| format!("Server error: {}", e))?; - - if !verify_response.status().is_success() { - let text = verify_response.text().await.unwrap_or_default(); - return Err(format!("Verification failed: {}", text)); - } - - let verify: VerifyResponse = verify_response - .json() - .await - .map_err(|e| format!("Invalid response: {}", e))?; - - // Store token in state - let mut token_guard = state.token.lock().map_err(|e| e.to_string())?; - *token_guard = Some(verify.token.clone()); - - Ok(verify.token) -} - -/// Get the current owner token (for API calls) -#[tauri::command] -async fn get_owner_token(state: State<'_, OwnerState>) -> Result, String> { - let token_guard = state.token.lock().map_err(|e| e.to_string())?; - Ok(token_guard.clone()) -} - -/// Clear the owner token (on logout/lock) -#[tauri::command] -async fn clear_owner_token(state: State<'_, OwnerState>) -> Result<(), String> { - let mut token_guard = state.token.lock().map_err(|e| e.to_string())?; - *token_guard = None; - Ok(()) -} - -// ============================================================================ -// Server Management Commands -// ============================================================================ - -// Start the DCP server process -#[tauri::command] -async fn start_server(state: State<'_, ServerState>, app: AppHandle) -> Result<(), String> { - let mut process_guard = state.process.lock().map_err(|e| e.to_string())?; - - // Check if already running - if let Some(ref mut child) = *process_guard { - match child.try_wait() { - Ok(Some(_)) => { - // Process exited, clear it - *process_guard = None; - } - Ok(None) => { - // Still running - return Ok(()); - } - Err(_) => { - *process_guard = None; - } - } - } - - // Find the server binary - let resource_dir = app.path().resource_dir().map_err(|e| e.to_string())?; - let bin_path = resource_dir.join("bin").join(if cfg!(windows) { - "dcp-vault.exe" - } else { - "dcp-vault" - }); - - let runtime_server = resource_dir - .join("resources") - .join("dcp-vault-runtime") - .join("node_modules") - .join("@dcprotocol") - .join("vault") - .join("dist") - .join("server") - .join("index.js"); - let bundled_server = resource_dir.join("resources").join("dcp-vault-bundle.cjs"); - let res_js_path = resource_dir.join("dcp-vault").join("dist").join("server").join("index.js"); - let res_js_alt = resource_dir.join("dcp-vault").join("index.js"); - // Tauri bundles ../../path as _up_/_up_/path - let res_js_up = resource_dir.join("_up_").join("_up_").join("dcp-vault").join("dist").join("server").join("index.js"); - - // Local dev paths - try multiple approaches for monorepo - let cwd = std::env::current_dir().unwrap_or_default(); - - // Candidates for dev mode - let dev_candidates: Vec = vec![ - // From src-tauri: ../../dcp-vault/dist/server/index.js - cwd.join("../../dcp-vault/dist/server/index.js"), - // From dcp-desktop: ../dcp-vault/dist/server/index.js - cwd.join("../dcp-vault/dist/server/index.js"), - // From monorepo root - cwd.join("packages/dcp-vault/dist/server/index.js"), - // Walk up to find monorepo root - find_monorepo_root().map(|r| r.join("packages/dcp-vault/dist/server/index.js")).unwrap_or_default(), - ]; - - let dev_js_root_path = find_node_root() - .map(|root| root.join("packages").join("dcp-vault").join("dist").join("server").join("index.js")); - - // Debug: print all candidate paths - eprintln!("[DCP] Looking for server binary..."); - eprintln!("[DCP] cwd: {:?}", std::env::current_dir()); - eprintln!("[DCP] bin_path: {:?} exists={}", bin_path, bin_path.exists()); - eprintln!("[DCP] runtime_server: {:?} exists={}", runtime_server, runtime_server.exists()); - eprintln!("[DCP] res_js_path: {:?} exists={}", res_js_path, res_js_path.exists()); - for (i, p) in dev_candidates.iter().enumerate() { - eprintln!("[DCP] dev_candidates[{}]: {:?} exists={}", i, p, p.exists()); - } - if let Some(ref p) = dev_js_root_path { - eprintln!("[DCP] dev_js_root_path: {:?} exists={}", p, p.exists()); - } - - // In dev mode, prefer dev_candidates first (direct paths work better with node_modules) - let server_path = if let Some(dev_path) = dev_candidates.iter().find(|p| p.exists()) { - eprintln!("[DCP] Using dev_candidates path"); - dev_path.clone() - } else if dev_js_root_path.as_ref().is_some_and(|p| p.exists()) { - eprintln!("[DCP] Using dev_js_root_path"); - dev_js_root_path.unwrap() - } else if bin_path.exists() { - bin_path - } else if runtime_server.exists() { - runtime_server - } else if bundled_server.exists() { - bundled_server - } else if res_js_path.exists() { - res_js_path - } else if res_js_alt.exists() { - res_js_alt - } else if res_js_up.exists() { - res_js_up - } else { - eprintln!("[DCP] ERROR: No server binary found!"); - return Err("DCP server binary not found".to_string()); - }; - eprintln!("[DCP] Using server_path: {:?}", server_path); - - // Start the server - let child = if matches!( - server_path.extension().and_then(|e| e.to_str()), - Some("js" | "cjs" | "mjs") - ) { - let node_bin = resolve_node_binary()?; - let mut cmd = Command::new(node_bin); - cmd.arg(&server_path); - - // Build NODE_PATH for bundled or dev node_modules. - let mut node_paths: Vec = Vec::new(); - let helper_node_modules = resource_dir.join("resources").join("node_modules"); - let runtime_node_modules = resource_dir - .join("resources") - .join("dcp-vault-runtime") - .join("node_modules"); - let res_node_modules = resource_dir.join("dcp-vault").join("node_modules"); - let res_node_modules_up = resource_dir.join("_up_").join("_up_").join("dcp-vault").join("node_modules"); - if helper_node_modules.exists() { - node_paths.push(helper_node_modules); - } - if runtime_node_modules.exists() { - node_paths.push(runtime_node_modules); - } - if res_node_modules.exists() { - node_paths.push(res_node_modules); - } - if res_node_modules_up.exists() { - node_paths.push(res_node_modules_up); - } - - let dev_node_modules = std::env::current_dir() - .unwrap_or_default() - .join("../dcp-vault/node_modules"); - if dev_node_modules.exists() { - node_paths.push(dev_node_modules); - } - - if let Some(root) = find_node_root() { - let monorepo_node_modules = root.join("node_modules"); - if monorepo_node_modules.exists() { - node_paths.push(monorepo_node_modules); - } - } - - if let Ok(existing) = std::env::var("NODE_PATH") { - for entry in std::env::split_paths(&existing) { - if !entry.as_os_str().is_empty() { - node_paths.push(entry); - } - } - } - - node_paths.sort(); - node_paths.dedup(); - - if !node_paths.is_empty() { - let joined = std::env::join_paths(node_paths) - .map_err(|e| format!("Failed to build NODE_PATH: {}", e))?; - cmd.env("NODE_PATH", joined); - } - - cmd.current_dir( - server_path - .parent() - .unwrap_or_else(|| std::path::Path::new(".")), - ); - - // Desktop app uses port 8421 (CLI uses 8420) - cmd.env("VAULT_PORT", "8421"); - // Mark as bundled to disable pino-pretty (requires worker threads) - cmd.env("DCP_BUNDLED", "1"); - - cmd.spawn() - .map_err(|e| format!("Failed to start server: {}", e))? - } else { - let mut cmd = Command::new(&server_path); - // Desktop app uses port 8421 (CLI uses 8420) - cmd.env("VAULT_PORT", "8421"); - // Mark as bundled to disable pino-pretty (requires worker threads) - cmd.env("DCP_BUNDLED", "1"); - cmd.spawn() - .map_err(|e| format!("Failed to start server: {}", e))? - }; - - *process_guard = Some(child); - Ok(()) -} - -// Stop the DCP server process -#[tauri::command] -async fn stop_server(state: State<'_, ServerState>) -> Result<(), String> { - let mut process_guard = state.process.lock().map_err(|e| e.to_string())?; - - if let Some(ref mut child) = *process_guard { - child - .kill() - .map_err(|e| format!("Failed to kill server: {}", e))?; - child.wait().ok(); - } - - *process_guard = None; - Ok(()) -} - -// Reset vault (delete local vault data and restart server) -#[tauri::command] -async fn reset_vault(state: State<'_, ServerState>, app: AppHandle) -> Result<(), String> { - stop_server(state.clone()).await?; - - let home_dir = dirs::home_dir().ok_or_else(|| "Unable to determine home directory".to_string())?; - let default_dir = home_dir.join(".dcp"); - - let vault_dir = std::env::var("VAULT_DIR") - .ok() - .unwrap_or_else(|| default_dir.to_string_lossy().to_string()); - - let vault_path = std::path::PathBuf::from(&vault_dir); - let vault_canon = vault_path.canonicalize().unwrap_or_else(|_| vault_path.clone()); - let default_canon = default_dir.canonicalize().unwrap_or(default_dir.clone()); - - if vault_canon != default_canon { - return Err("Refusing to reset non-default vault directory".to_string()); - } - - if vault_path.exists() { - fs::remove_dir_all(&vault_path) - .map_err(|e| format!("Failed to remove vault directory: {}", e))?; - } - if vault_path.exists() { - return Err("Vault directory still exists after reset".to_string()); - } - - start_server(state, app).await?; - Ok(()) -} - -// Check server health -#[tauri::command] -async fn check_health() -> Result { - let client = reqwest::Client::new(); - let response = client - .get(format!("{}/health", SERVER_URL)) - .send() - .await - .map_err(|e| format!("Server not responding: {}", e))?; - - let health: HealthResponse = response - .json() - .await - .map_err(|e| format!("Invalid response: {}", e))?; - - Ok(health) -} - -async fn lock_vault_request() -> Result<(), String> { - let client = reqwest::Client::new(); - client - .post(format!("{}/v1/vault/lock", SERVER_URL)) - .send() - .await - .map_err(|e| format!("Failed to lock vault: {}", e))?; - Ok(()) -} - -// Initialize vault with passphrase -#[tauri::command] -async fn init_vault(passphrase: String) -> Result { - let payload = json!({ - "action": "init", - "passphrase": passphrase, - "vault_dir": std::env::var("VAULT_DIR").ok() - }); - let result = run_node_helper(payload)?; - let words = result - .get("recovery_phrase") - .and_then(|v| v.as_array()) - .ok_or_else(|| "Invalid init response".to_string())? - .iter() - .filter_map(|v| v.as_str().map(|s| s.to_string())) - .collect::>(); - - Ok(InitVaultResult { recovery_phrase: words }) -} - -// Create wallets after vault init -#[tauri::command] -async fn create_wallets(passphrase: String) -> Result { - let payload = json!({ - "action": "create_wallets", - "passphrase": passphrase, - "chains": ["solana"], - "vault_dir": std::env::var("VAULT_DIR").ok() - }); - let result = run_node_helper(payload)?; - let wallets = result - .get("wallets") - .and_then(|v| v.as_array()) - .ok_or_else(|| "Invalid wallets response".to_string())? - .iter() - .filter_map(|w| { - let chain = w.get("chain")?.as_str()?.to_string(); - let address = w.get("address")?.as_str()?.to_string(); - Some(WalletInfo { chain, address }) - }) - .collect::>(); - - Ok(CreateWalletsResult { wallets }) -} - -// Export the local Solana wallet private key. Desktop-only owner action. -#[tauri::command] -async fn export_wallet_private_key( - passphrase: String, - confirmation: String, -) -> Result { - if confirmation != "EXPORT" { - return Err("Type EXPORT to confirm".to_string()); - } - - let payload = json!({ - "action": "export_wallet_private_key", - "passphrase": passphrase, - "confirmation": confirmation, - "chain": "solana", - "vault_dir": std::env::var("VAULT_DIR").ok() - }); - let result = run_node_helper(payload)?; - - Ok(ExportWalletResult { - chain: result - .get("chain") - .and_then(|v| v.as_str()) - .unwrap_or("solana") - .to_string(), - address: result - .get("address") - .and_then(|v| v.as_str()) - .ok_or_else(|| "Invalid export response".to_string())? - .to_string(), - private_key: result - .get("private_key") - .and_then(|v| v.as_str()) - .ok_or_else(|| "Invalid export response".to_string())? - .to_string(), - }) -} - -// Replace the local Solana wallet with a newly generated wallet. Funds are not moved. -#[tauri::command] -async fn replace_wallet( - passphrase: String, - confirmation: String, -) -> Result { - if confirmation != "REPLACE" { - return Err("Type REPLACE to confirm".to_string()); - } - - let payload = json!({ - "action": "replace_wallet", - "passphrase": passphrase, - "confirmation": confirmation, - "chain": "solana", - "vault_dir": std::env::var("VAULT_DIR").ok() - }); - let result = run_node_helper(payload)?; - - Ok(ReplaceWalletResult { - chain: result - .get("chain") - .and_then(|v| v.as_str()) - .unwrap_or("solana") - .to_string(), - old_address: result - .get("old_address") - .and_then(|v| v.as_str()) - .map(|s| s.to_string()), - new_address: result - .get("new_address") - .and_then(|v| v.as_str()) - .ok_or_else(|| "Invalid replace response".to_string())? - .to_string(), - }) -} - -// Show notification -#[tauri::command] -async fn show_notification(app: AppHandle, title: String, body: String) -> Result<(), String> { - use tauri_plugin_notification::NotificationExt; - - app.notification() - .builder() - .title(&title) - .body(&body) - .show() - .map_err(|e| e.to_string()) -} - -#[cfg_attr(mobile, tauri::mobile_entry_point)] -pub fn run() { - tauri::Builder::default() - .plugin(tauri_plugin_notification::init()) - .plugin(tauri_plugin_autostart::init( - tauri_plugin_autostart::MacosLauncher::LaunchAgent, - None, - )) - .plugin(tauri_plugin_shell::init()) - .manage(ServerState { - process: Mutex::new(None), - }) - .manage(OwnerState { - token: Mutex::new(None), - }) - // Hide to tray on close (Tauri 2 pattern from official docs) - // macOS fullscreen fix: exit fullscreen first, wait for animation, then hide - // See: https://github.com/tauri-apps/tauri/issues/10580 - .on_window_event(|window, event| { - if let WindowEvent::CloseRequested { api, .. } = event { - api.prevent_close(); - #[cfg(target_os = "macos")] - { - match window.is_fullscreen() { - Ok(true) => { - let app_handle = window.app_handle().clone(); - let window_label = window.label().to_string(); - let _ = window.set_fullscreen(false); - tauri::async_runtime::spawn(async move { - tokio::time::sleep(std::time::Duration::from_millis(700)).await; - if let Some(win) = app_handle.get_webview_window(&window_label) { - let _ = win.hide(); - } - }); - } - _ => { - let _ = window.hide(); - } - } - } - #[cfg(not(target_os = "macos"))] - { - let _ = window.hide(); - } - } - }) - .setup(|app| { - if RESOURCE_DIR.get().is_none() { - if let Ok(dir) = app.path().resource_dir() { - let _ = RESOURCE_DIR.set(dir); - } - } - - // Kill any orphaned server from previous crashed session - // This ensures a clean state on startup - #[cfg(target_family = "unix")] - { - let _ = Command::new("sh") - .arg("-c") - .arg("lsof -ti:8421 | xargs kill -9 2>/dev/null || true") - .output(); - } - - #[cfg(target_os = "windows")] - { - // On Windows, try to kill any process using port 8421 - let _ = Command::new("cmd") - .args(["/C", "for /f \"tokens=5\" %a in ('netstat -aon ^| findstr :8421') do taskkill /F /PID %a >nul 2>&1"]) - .output(); - } - - // Brief delay to ensure port is free - std::thread::sleep(std::time::Duration::from_millis(500)); - - // Create tray menu - let quit = MenuItem::with_id(app, "quit", "Quit & Stop Server", true, None::<&str>)?; - let open = MenuItem::with_id(app, "open", "Open DCP", true, None::<&str>)?; - let lock = MenuItem::with_id(app, "lock", "Lock Vault", true, None::<&str>)?; - - let menu = Menu::with_items(app, &[&open, &lock, &quit])?; - - // Build tray icon - let _tray = TrayIconBuilder::new() - .icon(app.default_window_icon().unwrap().clone()) - .menu(&menu) - .show_menu_on_left_click(false) - .on_menu_event(|app, event| match event.id.as_ref() { - "quit" => { - // Stop server synchronously before exit - let state = app.state::(); - if let Ok(mut process_guard) = state.process.lock() { - if let Some(ref mut child) = *process_guard { - let _ = child.kill(); - let _ = child.wait(); - } - *process_guard = None; - } - app.exit(0); - } - "open" => { - if let Some(window) = app.get_webview_window("main") { - window.show().ok(); - window.unminimize().ok(); - window.set_focus().ok(); - } - } - "lock" => { - tauri::async_runtime::spawn(async move { - let _ = lock_vault_request().await; - }); - } - _ => {} - }) - .on_tray_icon_event(|tray, event| { - if let TrayIconEvent::Click { - button: MouseButton::Left, - button_state: MouseButtonState::Up, - .. - } = event - { - let app = tray.app_handle(); - if let Some(window) = app.get_webview_window("main") { - window.show().ok(); - window.unminimize().ok(); - window.set_focus().ok(); - } - } - }) - .build(app)?; - - // Start server on app launch - let app_handle = app.handle().clone(); - tauri::async_runtime::spawn(async move { - let state = app_handle.state::(); - if let Err(e) = start_server(state, app_handle.clone()).await { - eprintln!("Failed to start server: {}", e); - } - }); - - Ok(()) - }) - .invoke_handler(tauri::generate_handler![ - // Server management - start_server, - stop_server, - reset_vault, - check_health, - // Vault operations - init_vault, - create_wallets, - export_wallet_private_key, - replace_wallet, - show_notification, - // Owner trust model - get_or_create_desktop_credentials, - register_desktop, - authenticate_owner, - get_owner_token, - clear_owner_token, - ]) - .build(tauri::generate_context!()) - .expect("error while building tauri application") - .run(|app_handle, event| { - match event { - #[cfg(target_os = "macos")] - RunEvent::Reopen { .. } => { - // Handle dock icon click on macOS - if let Some(window) = app_handle.get_webview_window("main") { - window.show().ok(); - window.unminimize().ok(); - window.set_focus().ok(); - } - } - RunEvent::ExitRequested { api, code, .. } => { - // Prevent default exit to ensure cleanup completes - api.prevent_exit(); - - // Stop server synchronously using blocking task - let state = app_handle.state::(); - if let Ok(mut process_guard) = state.process.lock() { - if let Some(ref mut child) = *process_guard { - let _ = child.kill(); - let _ = child.wait(); - } - *process_guard = None; - } - - // Exit with the requested code - app_handle.exit(code.unwrap_or(0)); - } - _ => {} - } - }); -} diff --git a/packages/dcp-desktop/src-tauri/src/main.rs b/packages/dcp-desktop/src-tauri/src/main.rs deleted file mode 100644 index 37c4d2d..0000000 --- a/packages/dcp-desktop/src-tauri/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -// Prevents additional console window on Windows in release, DO NOT REMOVE!! -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] - -fn main() { - dcp_lib::run() -} diff --git a/packages/dcp-desktop/src-tauri/tauri.conf.json b/packages/dcp-desktop/src-tauri/tauri.conf.json deleted file mode 100644 index b20da88..0000000 --- a/packages/dcp-desktop/src-tauri/tauri.conf.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "$schema": "https://schema.tauri.app/config/2", - "productName": "DCP", - "version": "2.0.4", - "identifier": "rg.dcp.vault", - "build": { - "beforeDevCommand": "corepack pnpm -r --filter @dcprotocol/core --filter @dcprotocol/client --filter @dcprotocol/relay --filter @dcprotocol/relay-client --filter @dcprotocol/vault run build && corepack pnpm --filter @dcprotocol/desktop run bundle:helper && corepack pnpm --filter @dcprotocol/desktop run dev", - "devUrl": "http://localhost:1420", - "beforeBuildCommand": "corepack pnpm -r --filter @dcprotocol/core --filter @dcprotocol/client --filter @dcprotocol/relay --filter @dcprotocol/relay-client --filter @dcprotocol/vault run build && corepack pnpm --filter @dcprotocol/desktop run bundle:node && corepack pnpm --filter @dcprotocol/desktop run bundle:helper && corepack pnpm --filter @dcprotocol/desktop run build", - "frontendDist": "../dist" - }, - "app": { - "withGlobalTauri": true, - "windows": [ - { - "title": "DCP", - "width": 900, - "height": 700, - "minWidth": 600, - "minHeight": 500, - "resizable": true, - "center": true, - "decorations": true, - "transparent": false - } - ], - "trayIcon": { - "iconPath": "icons/icon.png", - "iconAsTemplate": true - }, - "security": { - "csp": "default-src 'self'; img-src 'self' asset: data:; style-src 'self' 'unsafe-inline'; script-src 'self'; connect-src 'self' http://127.0.0.1:8421 http://localhost:8421 http://localhost:1420 ws://localhost:1420 http://127.0.0.1:1420 ws://127.0.0.1:1420; object-src 'none'; base-uri 'self'; frame-ancestors 'none'" - } - }, - "bundle": { - "active": true, - "targets": ["deb", "rpm", "dmg", "app", "msi", "nsis"], - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ], - "resources": [ - "../../dcp-vault/dist", - "../../dcp-vault/package.json", - "bin", - "resources" - ], - "category": "Utility", - "shortDescription": "DCP Desktop", - "longDescription": "Cross-platform desktop app for DCP - manage your personal data securely with AI agents", - "copyright": "Copyright 2024 DCP Protocol", - "macOS": { - "entitlements": null, - "exceptionDomain": "", - "frameworks": [], - "minimumSystemVersion": "10.15" - }, - "linux": { - "appimage": { - "bundleMediaFramework": true - }, - "deb": { - "depends": [] - } - }, - "windows": { - "certificateThumbprint": null, - "digestAlgorithm": "sha256", - "timestampUrl": "" - } - }, - "plugins": { - "shell": { - "open": "(https?://.*|mailto:.*|tel:.*|cursor://.*|vscode:.*)" - } - } -} diff --git a/packages/dcp-desktop/src/App.tsx b/packages/dcp-desktop/src/App.tsx deleted file mode 100644 index a28d872..0000000 --- a/packages/dcp-desktop/src/App.tsx +++ /dev/null @@ -1,415 +0,0 @@ -import { useEffect, useState, useCallback, useRef } from 'react'; -import { Routes, Route, NavLink, useNavigate } from 'react-router-dom'; -import { invoke } from '@tauri-apps/api/core'; -import { getCurrentWindow } from '@tauri-apps/api/window'; -import { isPermissionGranted, requestPermission } from '@tauri-apps/plugin-notification'; -import { api, type HealthResponse, type PendingConsent } from './api'; - -import Home from './pages/Home'; -import Connect from './pages/Connect'; -import Agents from './pages/Agents'; -import Data from './pages/Data'; -import Settings from './pages/Settings'; -import Activity from './pages/Activity'; -import Onboarding from './pages/Onboarding'; -import Unlock from './pages/Unlock'; - -type AppState = 'loading' | 'no-server' | 'no-vault' | 'locked' | 'unlocked'; - -interface DesktopCredentials { - desktop_id: string; - public_key: string; - is_new: boolean; -} - -export default function App() { - const [appState, setAppState] = useState('loading'); - const [_health, setHealth] = useState(null); - const [error, setError] = useState(null); - const [ownerAuthenticated, setOwnerAuthenticated] = useState(false); - const [onboardingActive, setOnboardingActive] = useState(false); - const [forceOnboarding, setForceOnboarding] = useState(false); - const navigate = useNavigate(); - const authAttempted = useRef(false); - const onboardingLock = useRef(false); - const knownConsents = useRef>(new Set()); - const [pendingCount, setPendingCount] = useState(0); - - const showConsentNotification = useCallback(async (consent: PendingConsent) => { - const details = consent.details || {}; - const amount = 'amount' in details && 'currency' in details - ? `${details.amount} ${details.currency}` - : undefined; - const title = 'DCP: Approval Required'; - const body = `${consent.agent_name} wants to ${consent.action}${amount ? ` (${amount})` : ''}`; - - try { - let permissionGranted = await isPermissionGranted(); - if (!permissionGranted) { - permissionGranted = (await requestPermission()) === 'granted'; - } - - if (permissionGranted && 'Notification' in window) { - const notification = new window.Notification(title, { - body, - tag: `dcp-consent-${consent.id}`, - data: { consentId: consent.id }, - requireInteraction: true, - }); - - notification.onclick = () => { - window.focus(); - const currentWindow = getCurrentWindow(); - void currentWindow.show(); - void currentWindow.setFocus(); - navigate('/', { state: { consentId: consent.id } }); - }; - return; - } - } catch (err) { - console.error('Desktop notification permission/send failed:', err); - } - - // Fallback for environments where the Web Notification API is unavailable. - invoke('show_notification', { title, body }).catch((err) => { - console.error('Native notification fallback failed:', err); - }); - }, [navigate]); - - // Authenticate as owner (challenge-response with Ed25519 keypair) - const authenticateOwner = useCallback(async () => { - if (authAttempted.current) { - return; - } - authAttempted.current = true; - let authenticated = false; - - try { - // Step 1: Get or create desktop credentials - const credentials = await invoke('get_or_create_desktop_credentials'); - - // Step 2: Register with server if new credentials - if (credentials.is_new) { - try { - await invoke('register_desktop', { - desktop_id: credentials.desktop_id, - public_key: credentials.public_key, - }); - } catch (err) { - console.error('Failed to register desktop:', err); - // Continue anyway - might already be registered - } - } - - // Step 3: Authenticate to get owner token - try { - const token = await invoke('authenticate_owner'); - api.setOwnerToken(token); - setOwnerAuthenticated(true); - authenticated = true; - } catch (err) { - console.error('Owner authentication failed:', err); - // Try to register and authenticate again - try { - await invoke('register_desktop', { - desktop_id: credentials.desktop_id, - public_key: credentials.public_key, - }); - const token = await invoke('authenticate_owner'); - api.setOwnerToken(token); - setOwnerAuthenticated(true); - authenticated = true; - } catch (retryErr) { - console.error('Owner auth retry failed:', retryErr); - // Continue without owner mode - will require consent - } - } - } catch (err) { - console.error('Failed to get desktop credentials:', err); - } - - if (!authenticated) { - // Allow future retries (e.g., if server was not ready yet) - authAttempted.current = false; - } - }, []); - - const checkServer = useCallback(async () => { - try { - const h = await api.health(); - setHealth(h); - setError(null); - - if (forceOnboarding || onboardingLock.current || onboardingActive || appState === 'no-vault') { - return; - } - - if (!h.initialized) { - setAppState('no-vault'); - api.setOwnerToken(null); - setOwnerAuthenticated(false); - authAttempted.current = false; - return; - } - - if (h.unlocked) { - setAppState('unlocked'); - // Authenticate as owner when vault is unlocked - if (!ownerAuthenticated) { - void authenticateOwner(); - } - } else { - setAppState('locked'); - // Clear owner token when locked - api.setOwnerToken(null); - setOwnerAuthenticated(false); - authAttempted.current = false; - } - } catch (err) { - // Server not running - try to start it - try { - await invoke('start_server'); - // Wait a bit and retry - setTimeout(checkServer, 1000); - } catch { - setAppState('no-server'); - setError('Could not start DCP server'); - } - } - }, [ownerAuthenticated, authenticateOwner]); - - useEffect(() => { - checkServer(); - // Poll health every 5 seconds - const interval = setInterval(checkServer, 5000); - return () => clearInterval(interval); - }, [checkServer]); - - // Global consent polling and notifications (runs on all pages) - useEffect(() => { - if (appState !== 'unlocked') return; - - const pollConsents = async () => { - try { - const { pending } = await api.getPendingConsents(); - setPendingCount(pending.length); - - // Send notification for new consents - pending.forEach((consent: PendingConsent) => { - if (!knownConsents.current.has(consent.id)) { - void showConsentNotification(consent); - } - }); - knownConsents.current = new Set(pending.map((c: PendingConsent) => c.id)); - } catch { - // Ignore errors - might be temporarily unavailable - } - }; - - pollConsents(); - const interval = setInterval(pollConsents, 3000); - return () => clearInterval(interval); - }, [appState, showConsentNotification]); - - useEffect(() => { - if (appState === 'no-vault') { - setOnboardingActive(true); - onboardingLock.current = true; - } - }, [appState]); - - const handleUnlock = async (passphrase: string) => { - try { - await api.unlock(passphrase); - await checkServer(); - navigate('/'); - } catch (err) { - throw err; - } - }; - - const handleLock = async () => { - try { - await api.lock(); - // Clear owner token on lock - api.setOwnerToken(null); - setOwnerAuthenticated(false); - authAttempted.current = false; - await invoke('clear_owner_token'); - await checkServer(); - } catch (err) { - console.error('Failed to lock vault:', err); - } - }; - - const handleResetVault = async () => { - try { - setOnboardingActive(true); - onboardingLock.current = true; - setForceOnboarding(true); - await invoke('reset_vault'); - api.setOwnerToken(null); - setOwnerAuthenticated(false); - authAttempted.current = false; - setAppState('no-vault'); - } catch (err) { - console.error('Failed to reset vault:', err); - setError('Failed to reset vault'); - setOnboardingActive(false); - setForceOnboarding(false); - } - }; - - const handleOnboardingComplete = () => { - setOnboardingActive(false); - onboardingLock.current = false; - setForceOnboarding(false); - checkServer(); - navigate('/'); - }; - - // Loading state - if (appState === 'loading') { - return ( -
-
-
-
-
- ); - } - - // Server not running - if (appState === 'no-server') { - return ( -
-
-
-

Starting DCP Server...

-

- {error || 'Please wait while the server starts.'} -

- -
-
-
- ); - } - - // No vault initialized - show onboarding - if (forceOnboarding || appState === 'no-vault') { - return ( - { - setOnboardingActive(true); - onboardingLock.current = true; - }} - onComplete={handleOnboardingComplete} - /> - ); - } - - // Vault is locked - if (appState === 'locked') { - return ; - } - - // Main app - vault is unlocked - return ( -
-
-
- - - - -

DCP

-
-
- - - Unlocked - - -
-
- -
- - } /> - } /> - } /> - } /> - } /> - } /> - -
- - -
- ); -} diff --git a/packages/dcp-desktop/src/api.ts b/packages/dcp-desktop/src/api.ts deleted file mode 100644 index fb606f8..0000000 --- a/packages/dcp-desktop/src/api.ts +++ /dev/null @@ -1,674 +0,0 @@ -/** - * DCP Server API Client - * Communicates with the local DCP server at http://127.0.0.1:8421 - * - * Owner Trust Model: - * - Desktop app uses challenge-response auth with Ed25519 keypair - * - Owner token is included in all requests to bypass consent for owner actions - */ - -import { invoke } from '@tauri-apps/api/core'; - -const API_BASE = 'http://127.0.0.1:8421'; - -export interface HealthResponse { - status: string; - initialized: boolean; - unlocked: boolean; - version: string; -} - -export interface Scope { - scope: string; - type: string; - sensitivity: string; - chain?: string; - public_address?: string; -} - -export interface Agent { - id: string; - agent_name: string; - granted_scopes: string[]; - consent_mode: string; - expires_at: string; - created_at: string; - last_used_at?: string; -} - -export interface PendingConsent { - id: string; - agent_name: string; - action: string; - scope: string; - details?: Record; - status: string; - created_at: string; - expires_at: string; -} - -export interface AuditEvent { - id: string; - event_type: string; - agent_name?: string; - scope?: string; - operation?: string; - outcome: string; - created_at: string; - details?: Record; -} - -export interface TrustedService { - service_id: string; - name: string; - public_key: string; - scopes: string[]; - budget: { - daily: number; - currency: string; - auto_approve_under: number; - }; - trusted_at: string; - connected_at?: string; - enabled: boolean; - verified: boolean; -} - -export interface BudgetCheck { - allowed: boolean; - limits: { - per_tx: number; - daily: number; - approval_threshold: number; - }; - remaining: { - daily: number; - per_tx: number; - }; - requires_approval: boolean; - reason?: string; -} - -export interface RelayInfo { - vault_id: string; - relay_url: string; - hpke_public_key: string; - pairing_token?: string | null; - relay_connected: boolean; -} - -export interface BudgetConfig { - daily_budget: Record; - tx_limit: Record; - approval_threshold: Record; -} - -export interface KnownService { - service_id: string; - name: string; - connect_url: string; - auth_url: string; - public_key: string; - default_scopes: string[]; - verified: boolean; - description?: string; - icon_url?: string; -} - -export interface PairingTokenResponse { - token: string; - expires_at: string; - service_id: string; - scopes: string[]; - budget: { daily: number; currency: string; auto_approve_under: number }; -} - -// Agent connection types for remote agents -export type AgentConnectionMode = 'mcp' | 'proxy' | 'sdk'; -export type AgentTier = 'free' | 'pro' | 'enterprise'; - -export interface AgentConnection { - agent_id: string; - agent_name: string; - name?: string; // Alias for agent_name - vault_id: string; - mode: AgentConnectionMode; - tier: AgentTier; - permission_scopes: string[]; - budget?: { - daily: number; - currency: string; - auto_approve_under: number; - }; - relay_url: string; - status: 'active' | 'revoked' | 'pending'; - paired_at: string; - last_seen_at?: string; - revoked_at?: string; - request_count?: number; -} - -export interface SignedPairingGrantResponse { - token: string; - agent_name: string; // Top level for convenience - grant: { - agent_name: string; - vault_id: string; - mode: AgentConnectionMode; - tier: AgentTier; - permission_scopes: string[]; - relay_url: string; - expires_at: string; - }; - signature: string; -} - -export interface VpsPairingInviteResponse { - token: string; - agent_name: string; - vault_id: string; - relay_url: string; - expires_at: string; -} - -// VPS Pairing Claim types -export interface PairingClaimData { - invite_id: string; - agent_public_key: string; - agent_hostname: string; - agent_version: string; - timestamp: number; - nonce: string; - signature: string; -} - -export interface StoredPairingClaim { - claim_id: string; - claim: PairingClaimData; - verification_phrase: string; - received_at: number; - status: 'pending' | 'approved' | 'denied' | 'expired'; - agent_id?: string; - vault_id?: string; - resolved_at?: number; -} - -class ApiClient { - private ownerToken: string | null = null; - private ownerAuthInFlight: Promise | null = null; - - /** - * Set the owner token for authenticated requests - * This bypasses consent for desktop app actions - */ - setOwnerToken(token: string | null): void { - this.ownerToken = token; - } - - /** - * Get the current owner token - */ - getOwnerToken(): string | null { - return this.ownerToken; - } - - /** - * Check if we have a valid owner token - */ - hasOwnerToken(): boolean { - return this.ownerToken !== null; - } - - private async request(path: string, options?: RequestInit, retry = false): Promise { - const headers: Record = { - ...(options?.body ? { 'Content-Type': 'application/json' } : {}), - ...(options?.headers as Record), - }; - - // Include owner token if available (bypasses consent for owner) - if (this.ownerToken) { - headers['X-DCP-OWNER-TOKEN'] = this.ownerToken; - } - - const res = await fetch(`${API_BASE}${path}`, { - ...options, - headers, - }); - - const data = await res.json(); - - if (!res.ok) { - const errorCode = data?.error?.code as string | undefined; - const errorMessage = data?.error?.message || 'Request failed'; - - if (!retry && errorCode === 'OWNER_AUTH_REQUIRED') { - const ok = await this.ensureOwnerAuth(); - if (ok) { - return this.request(path, options, true); - } - } - - console.error('API: Request failed:', path, data); - throw new Error(errorMessage); - } - - return data; - } - - private async ensureOwnerAuth(): Promise { - if (this.ownerAuthInFlight) { - return this.ownerAuthInFlight; - } - - this.ownerAuthInFlight = (async () => { - try { - const credentials = await invoke<{ - desktop_id: string; - public_key: string; - is_new: boolean; - }>('get_or_create_desktop_credentials'); - - if (credentials.is_new) { - try { - await invoke('register_desktop', { - desktopId: credentials.desktop_id, - publicKey: credentials.public_key, - }); - } catch (err) { - console.error('Failed to register desktop:', err); - } - } - - try { - const token = await invoke('authenticate_owner'); - this.setOwnerToken(token); - return true; - } catch (err) { - // Retry registration + auth in case registration was missed - try { - await invoke('register_desktop', { - desktopId: credentials.desktop_id, - publicKey: credentials.public_key, - }); - const token = await invoke('authenticate_owner'); - this.setOwnerToken(token); - return true; - } catch (retryErr) { - console.error('Owner auth retry failed:', retryErr); - return false; - } - } - } catch (err) { - console.error('Owner auth failed:', err); - return false; - } finally { - this.ownerAuthInFlight = null; - } - })(); - - return this.ownerAuthInFlight; - } - - async authenticateOwner(): Promise { - return this.ensureOwnerAuth(); - } - - async health(): Promise { - return this.request('/health'); - } - - async unlock(passphrase: string): Promise<{ unlocked: boolean }> { - return this.request('/v1/vault/unlock', { - method: 'POST', - body: JSON.stringify({ passphrase }), - }); - } - - async lock(): Promise<{ locked: boolean }> { - return this.request('/v1/vault/lock', { - method: 'POST', - body: JSON.stringify({}), - }); - } - - async getScopes(): Promise<{ scopes: Scope[] }> { - return this.request('/scopes'); - } - - async getAgents(): Promise<{ agents: Agent[] }> { - return this.request('/agents'); - } - - async getPendingConsents(): Promise<{ pending: PendingConsent[] }> { - return this.request('/consent'); - } - - async approveConsent(id: string, options: { session?: boolean; always?: boolean } = {}): Promise<{ approved: boolean; session_id?: string; policy_created?: boolean }> { - return this.request(`/consent/${id}/approve`, { - method: 'POST', - body: JSON.stringify(options), - }); - } - - async denyConsent(id: string): Promise<{ denied: boolean }> { - return this.request(`/consent/${id}/deny`, { - method: 'POST', - body: JSON.stringify({}), - }); - } - - async revokeAgent(agent: string): Promise<{ revoked: number }> { - return this.request(`/revoke/${agent}`, { - method: 'POST', - body: JSON.stringify({}), - }); - } - - async revokeSession(id: string): Promise<{ revoked: boolean }> { - return this.request(`/v1/vault/agents/${id}/revoke`, { - method: 'POST', - body: JSON.stringify({}), - }); - } - - async getActivity(limit: number = 100): Promise<{ events: AuditEvent[]; count: number }> { - return this.request(`/v1/vault/activity?limit=${limit}`); - } - - async getAddress(chain: string): Promise<{ chain: string; address: string }> { - return this.request(`/address/${chain}`); - } - - async checkBudget(amount: number, currency: string): Promise { - return this.request(`/budget/check?amount=${amount}¤cy=${currency}`); - } - - async getRelayInfo(): Promise { - return this.request('/v1/relay/info'); - } - - async getBudgetConfig(): Promise { - return this.request('/v1/vault/budgets'); - } - - async updateBudgetConfig(payload: BudgetConfig): Promise { - return this.request('/v1/vault/budgets', { - method: 'POST', - body: JSON.stringify(payload), - }); - } - - async getCurrencies(): Promise<{ default: string[]; custom: string[] }> { - return this.request('/v1/vault/currencies'); - } - - async addCurrency(code: string): Promise<{ success: boolean; default: string[]; custom: string[] }> { - return this.request('/v1/vault/currencies', { - method: 'POST', - body: JSON.stringify({ action: 'add', code }), - }); - } - - async removeCurrency(code: string): Promise<{ success: boolean; default: string[]; custom: string[] }> { - return this.request('/v1/vault/currencies', { - method: 'POST', - body: JSON.stringify({ action: 'remove', code }), - }); - } - - async getTrustedServices(): Promise<{ services: TrustedService[] }> { - return this.request('/v1/services'); - } - - async getKnownServices(): Promise<{ services: KnownService[] }> { - return this.request('/v1/services/known'); - } - - async addTrustedService(service: { - service_id: string; - name?: string; - public_key: string; - scopes: string[]; - budget: { daily: number; currency: string; auto_approve_under: number }; - enabled?: boolean; - verified?: boolean; - }): Promise<{ created: boolean; service: TrustedService }> { - return this.request('/v1/services', { - method: 'POST', - body: JSON.stringify(service), - }); - } - - async updateTrustedService( - serviceId: string, - updates: { - name?: string; - public_key?: string; - scopes?: string[]; - budget?: { daily: number; currency: string; auto_approve_under: number }; - enabled?: boolean; - verified?: boolean; - } - ): Promise<{ updated: boolean; service: TrustedService }> { - return this.request(`/v1/services/${encodeURIComponent(serviceId)}`, { - method: 'PATCH', - body: JSON.stringify(updates), - }); - } - - async revokeTrustedService(serviceId: string): Promise<{ revoked: boolean }> { - return this.request(`/v1/services/${encodeURIComponent(serviceId)}`, { - method: 'DELETE', - }); - } - - async updateRelayConfig(relayUrl: string, pairingToken?: string): Promise<{ updated: boolean }> { - return this.request('/v1/relay/config', { - method: 'POST', - body: JSON.stringify({ - relay_url: relayUrl, - pairing_token: pairingToken, - }), - }); - } - - async createPairingToken(payload: { - service_id: string; - scopes: string[]; - budget: { daily: number; currency: string; auto_approve_under: number }; - ttl_seconds?: number; - }): Promise { - return this.request('/v1/pairing/start', { - method: 'POST', - body: JSON.stringify(payload), - }); - } - - async readData(scope: string, agentName: string = 'desktop-ui'): Promise<{ scope: string; data?: Record }> { - return this.request('/v1/vault/read', { - method: 'POST', - body: JSON.stringify({ scope, agent_name: agentName }), - }); - } - - async writeData(scope: string, data: Record, agentName: string = 'desktop-ui'): Promise<{ scope: string; created: boolean; updated: boolean }> { - return this.request('/v1/vault/write', { - method: 'POST', - body: JSON.stringify({ scope, data, agent_name: agentName }), - }); - } - - async deleteData(scope: string, agentName: string = 'desktop-ui'): Promise<{ scope: string; deleted: boolean }> { - return this.request('/v1/vault/delete', { - method: 'POST', - body: JSON.stringify({ scope, agent_name: agentName }), - }); - } - - // Agent connection methods for remote agents - async getAgentConnections(): Promise<{ agents: AgentConnection[] }> { - return this.request('/v1/agent-connections'); - } - - async createSignedPairingGrant(payload: { - agent_name: string; - mode: AgentConnectionMode; - permission_scopes: string[]; - tier?: AgentTier; - budget?: { daily: number; currency: string; auto_approve_under: number }; - ttl_ms?: number; - }): Promise { - return this.request('/v1/pairing-grants', { - method: 'POST', - body: JSON.stringify(payload), - }); - } - - async createVpsPairingInvite(payload: { - agent_name: string; - ttl_ms?: number; - }): Promise { - return this.request('/v1/pairing-invites', { - method: 'POST', - body: JSON.stringify(payload), - }); - } - - async revokeAgentConnection(agentId: string): Promise<{ revoked: boolean }> { - return this.request(`/v1/agent-connections/${encodeURIComponent(agentId)}/revoke`, { - method: 'POST', - }); - } - - async deleteAgentConnection(agentId: string): Promise<{ deleted: boolean }> { - return this.request(`/v1/agent-connections/${encodeURIComponent(agentId)}`, { - method: 'DELETE', - }); - } - - async updateAgentConnection( - agentId: string, - updates: { - permission_scopes?: string[]; - budget?: { - daily?: number; - currency?: string; - auto_approve_under?: number; - }; - } - ): Promise<{ updated: boolean; agent: AgentConnection }> { - return this.request(`/v1/agent-connections/${encodeURIComponent(agentId)}`, { - method: 'PATCH', - body: JSON.stringify(updates), - }); - } - - // Telegram integration methods - async startTelegramPairing(): Promise<{ code: string; expires_at: string }> { - return this.request('/v1/telegram/pair/start', { - method: 'POST', - body: JSON.stringify({}), - }); - } - - async getTelegramPairingStatus(): Promise<{ paired: boolean; chat_id?: string }> { - return this.request('/v1/telegram/pair/status'); - } - - async getTelegramConfig(): Promise<{ - configured: boolean; - enabled?: boolean; - chat_id?: string; - paired_at?: string; - notify_consent?: boolean; - } | null> { - try { - return await this.request('/v1/telegram/config'); - } catch { - return null; - } - } - - async updateTelegramConfig(config: { enabled?: boolean; notify_consent?: boolean }): Promise<{ updated: boolean }> { - return this.request('/v1/telegram/config', { - method: 'POST', - body: JSON.stringify(config), - }); - } - - async sendTelegramTest(): Promise<{ sent: boolean }> { - return this.request('/v1/telegram/test', { - method: 'POST', - body: JSON.stringify({}), - }); - } - - async unlinkTelegram(): Promise<{ deleted: boolean }> { - return this.request('/v1/telegram/config', { - method: 'DELETE', - }); - } - - // MCP status methods - async getMcpStatus(): Promise<{ running: boolean; unlocked: boolean }> { - return this.request('/v1/vault/mcp-status'); - } - - async unlockMcp(passphrase: string): Promise<{ queued: boolean }> { - return this.request('/v1/vault/unlock-mcp', { - method: 'POST', - body: JSON.stringify({ passphrase }), - }); - } - - // Local MCP agent setup methods - async setupLocalMcp(agentType: 'claude-desktop' | 'cursor' | 'vscode' | 'openclaw' | 'hermes' | 'other' = 'claude-desktop', customName?: string): Promise<{ - success: boolean; - agent_id: string; - agent_name: string; - already_configured: boolean; - message: string; - }> { - return this.request('/v1/vault/setup-local-mcp', { - method: 'POST', - body: JSON.stringify({ agent_type: agentType, custom_name: customName }), - }); - } - - async getLocalMcpStatus(): Promise<{ - configured: boolean; - config_exists: boolean; - connection_status: string; - agent_id: string; - }> { - return this.request('/v1/vault/local-mcp-status'); - } - - // VPS Pairing Claims methods - async getPairingClaims(): Promise<{ claims: StoredPairingClaim[] }> { - return this.request('/v1/pairing-claims'); - } - - async getPairingClaim(claimId: string): Promise<{ claim: StoredPairingClaim }> { - return this.request(`/v1/pairing-claims/${encodeURIComponent(claimId)}`); - } - - async approvePairingClaim( - claimId: string, - options: { agent_name?: string; permission_scopes?: string[] } = {} - ): Promise<{ approved: boolean; agent_id: string; agent_name: string }> { - return this.request(`/v1/pairing-claims/${encodeURIComponent(claimId)}/approve`, { - method: 'POST', - body: JSON.stringify(options), - }); - } - - async denyPairingClaim(claimId: string): Promise<{ denied: boolean }> { - return this.request(`/v1/pairing-claims/${encodeURIComponent(claimId)}/deny`, { - method: 'POST', - body: JSON.stringify({}), - }); - } -} - -export const api = new ApiClient(); diff --git a/packages/dcp-desktop/src/main.tsx b/packages/dcp-desktop/src/main.tsx deleted file mode 100644 index cf4a0d3..0000000 --- a/packages/dcp-desktop/src/main.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import { BrowserRouter } from 'react-router-dom'; -import App from './App'; -import './styles.css'; - -ReactDOM.createRoot(document.getElementById('root')!).render( - - - - - -); diff --git a/packages/dcp-desktop/src/pages/Activity.tsx b/packages/dcp-desktop/src/pages/Activity.tsx deleted file mode 100644 index 80db776..0000000 --- a/packages/dcp-desktop/src/pages/Activity.tsx +++ /dev/null @@ -1,252 +0,0 @@ -import { useEffect, useState, useMemo } from 'react'; -import { api, type AuditEvent } from '../api'; - -const eventIcons: Record = { - GRANT: '✓', - DENY: '✗', - EXECUTE: '⚡', - READ: '📖', - REVOKE: '🚫', - CONFIG: '⚙️', - EXPIRE: '⏱️', - SIGN: '✍️', - UNLOCK: '🔓', - LOCK: '🔒', -}; - -const eventColors: Record = { - GRANT: 'var(--success)', - DENY: 'var(--danger)', - EXECUTE: 'var(--accent)', - READ: 'var(--text-secondary)', - REVOKE: 'var(--warning)', - CONFIG: 'var(--text-secondary)', - EXPIRE: 'var(--text-muted)', - SIGN: 'var(--accent)', - UNLOCK: 'var(--success)', - LOCK: 'var(--warning)', -}; - -export default function Activity() { - const [events, setEvents] = useState([]); - const [loading, setLoading] = useState(true); - const [typeFilter, setTypeFilter] = useState('all'); - const [agentFilter, setAgentFilter] = useState('all'); - const [surfaceFilter, setSurfaceFilter] = useState('all'); - - useEffect(() => { - loadActivity(); - }, []); - - const loadActivity = async () => { - setLoading(true); - try { - const res = await api.getActivity(100); - setEvents(res.events); - } catch (err) { - console.error('Failed to load activity:', err); - } finally { - setLoading(false); - } - }; - - // Get unique agents from events - const agents = useMemo(() => { - const agentNames = new Set(); - events.forEach(e => { - if (e.agent_name) agentNames.add(e.agent_name); - }); - return ['all', ...Array.from(agentNames).sort()]; - }, [events]); - - // Get unique surfaces from events (if available in details) - const surfaces = useMemo(() => { - const surfaceSet = new Set(); - events.forEach(e => { - const surface = e.details?.surface as string | undefined; - if (surface) surfaceSet.add(surface); - }); - return surfaceSet.size > 0 ? ['all', ...Array.from(surfaceSet).sort()] : []; - }, [events]); - - // Event types - const eventTypes = useMemo(() => { - return ['all', ...new Set(events.map(e => e.event_type))]; - }, [events]); - - // Filter events - const filteredEvents = useMemo(() => { - return events.filter(event => { - // Type filter - if (typeFilter !== 'all' && event.event_type !== typeFilter) return false; - // Agent filter - if (agentFilter !== 'all' && event.agent_name !== agentFilter) return false; - // Surface filter (if available in details) - if (surfaceFilter !== 'all') { - const surface = event.details?.surface as string | undefined; - if (surface !== surfaceFilter) return false; - } - return true; - }); - }, [events, typeFilter, agentFilter, surfaceFilter]); - - const clearFilters = () => { - setTypeFilter('all'); - setAgentFilter('all'); - setSurfaceFilter('all'); - }; - - const hasActiveFilters = typeFilter !== 'all' || agentFilter !== 'all' || surfaceFilter !== 'all'; - - if (loading) { - return ( -
-
-
- ); - } - - return ( -
-
-
-
-

Activity Log

-

- {filteredEvents.length} of {events.length} events - {hasActiveFilters && ' (filtered)'} -

-
-
- {hasActiveFilters && ( - - )} - -
-
- - {/* Filters */} -
- {/* Event Type Filter */} -
-
- Event Type -
-
- {eventTypes.map((type) => ( - - ))} -
-
- - {/* Agent Filter */} - {agents.length > 1 && ( -
-
- Agent -
-
- {agents.map((agent) => ( - - ))} -
-
- )} - - {/* Surface Filter (Desktop/Telegram) - only show if data has surface info */} - {surfaces.length > 0 && ( -
-
- Approval Surface -
-
- {surfaces.map((surface) => ( - - ))} -
-
- )} -
- - {/* Events List */} - {filteredEvents.length === 0 ? ( -
-

{hasActiveFilters ? 'No events match the current filters' : 'No activity recorded'}

-
- ) : ( -
- {filteredEvents.map((event) => ( -
-
- {eventIcons[event.event_type] || '•'} -
-
-
- - {event.event_type} - - {event.operation && ( - - {event.operation} - - )} - {typeof event.details?.surface === 'string' && ( - - {event.details.surface as string} - - )} -
-
- {event.agent_name && Agent: {event.agent_name}} - {event.scope && • Scope: {event.scope}} - {event.outcome && event.outcome !== 'success' && ( - • {event.outcome} - )} -
-
-
- {new Date(event.created_at).toLocaleString()} -
-
- ))} -
- )} -
-
- ); -} diff --git a/packages/dcp-desktop/src/pages/Agents.tsx b/packages/dcp-desktop/src/pages/Agents.tsx deleted file mode 100644 index cbf8d04..0000000 --- a/packages/dcp-desktop/src/pages/Agents.tsx +++ /dev/null @@ -1,1044 +0,0 @@ -import { useEffect, useState, useCallback } from 'react'; -import { api, type AgentConnection, type StoredPairingClaim, type Scope, type BudgetConfig } from '../api'; - -// Common scope categories for quick selection -// Scopes must include the operation prefix (read:/write:/sign:) to match authorization checks -const SCOPE_PRESETS = { - identity: ['read:identity.name', 'read:identity.email', 'read:identity.phone'], - signing: ['sign:solana'], - credentials: ['read:credentials.api.*'], -}; - -export default function Agents() { - const [agents, setAgents] = useState([]); - const [pendingClaims, setPendingClaims] = useState([]); - const [loading, setLoading] = useState(true); - const [actionLoading, setActionLoading] = useState(null); - const [selectedAgent, setSelectedAgent] = useState(null); - const [statusMessage, setStatusMessage] = useState(null); - const [filter, setFilter] = useState<'all' | 'active' | 'revoked'>('all'); - const [environmentFilter, setEnvironmentFilter] = useState<'all' | 'local' | 'vps'>('all'); - const [confirmDelete, setConfirmDelete] = useState(null); - - // Edit modal state - const [editAgent, setEditAgent] = useState(null); - const [editScopes, setEditScopes] = useState([]); - const [editBudgetDaily, setEditBudgetDaily] = useState(100); - const [editBudgetCurrency, setEditBudgetCurrency] = useState('USDC'); - const [editAutoApprove, setEditAutoApprove] = useState(5); - const [availableScopes, setAvailableScopes] = useState([]); - const [defaultBudget, setDefaultBudget] = useState(null); - const [editSaving, setEditSaving] = useState(false); - - const loadAgents = useCallback(async () => { - try { - const [agentsRes, claimsRes] = await Promise.all([ - api.getAgentConnections(), - api.getPairingClaims().catch(() => ({ claims: [] })), - ]); - setAgents(agentsRes.agents || []); - setPendingClaims(claimsRes.claims || []); - } catch (err) { - console.error('Failed to load agents:', err); - } finally { - setLoading(false); - } - }, []); - - useEffect(() => { - loadAgents(); - const interval = setInterval(loadAgents, 5000); - return () => clearInterval(interval); - }, [loadAgents]); - - // Load available scopes and default budget for edit modal - useEffect(() => { - const loadEditData = async () => { - try { - const [scopesRes, budgetRes] = await Promise.all([ - api.getScopes(), - api.getBudgetConfig().catch(() => null), - ]); - setAvailableScopes(scopesRes.scopes || []); - setDefaultBudget(budgetRes); - } catch (err) { - console.error('Failed to load edit data:', err); - } - }; - loadEditData(); - }, []); - - const handleEditAgent = (agent: AgentConnection) => { - setEditAgent(agent); - setEditScopes([...agent.permission_scopes]); - // Prefill budget from agent or use defaults from settings - // Use || instead of ?? so 0 falls back to defaults (0 usually means "not configured") - const agentBudget = agent.budget; - const currency = agentBudget?.currency || 'USDC'; - setEditBudgetDaily(agentBudget?.daily || defaultBudget?.daily_budget?.[currency] || 5); - setEditBudgetCurrency(currency); - setEditAutoApprove(agentBudget?.auto_approve_under || defaultBudget?.approval_threshold?.[currency] || 0.0001); - }; - - const handleSaveEdit = async () => { - if (!editAgent) return; - setEditSaving(true); - try { - await api.updateAgentConnection(editAgent.agent_id, { - permission_scopes: editScopes, - budget: { - daily: editBudgetDaily, - currency: editBudgetCurrency, - auto_approve_under: editAutoApprove, - }, - }); - setStatusMessage('Permissions updated successfully'); - setEditAgent(null); - await loadAgents(); - setTimeout(() => setStatusMessage(null), 3000); - } catch (err) { - setStatusMessage(err instanceof Error ? err.message : 'Failed to update permissions'); - } finally { - setEditSaving(false); - } - }; - - const toggleScope = (scope: string) => { - setEditScopes(prev => - prev.includes(scope) ? prev.filter(s => s !== scope) : [...prev, scope] - ); - }; - - const toggleScopePreset = (presetScopes: string[]) => { - const allIncluded = presetScopes.every(s => editScopes.includes(s)); - if (allIncluded) { - setEditScopes(prev => prev.filter(s => !presetScopes.includes(s))); - } else { - setEditScopes(prev => [...new Set([...prev, ...presetScopes])]); - } - }; - - const getAgentStatus = (agent: AgentConnection): { status: string; color: string; label: string } => { - if (agent.status === 'revoked' || agent.revoked_at) { - return { status: 'revoked', color: 'var(--danger)', label: 'Revoked' }; - } - if (!agent.last_seen_at) { - return { status: 'pending', color: 'var(--text-muted)', label: 'Pending' }; - } - const lastSeen = new Date(agent.last_seen_at).getTime(); - const diffSeconds = (Date.now() - lastSeen) / 1000; - if (diffSeconds < 60) return { status: 'active', color: 'var(--success)', label: 'Connected' }; - if (diffSeconds < 3600) return { status: 'stale', color: 'var(--warning)', label: 'Stale' }; - if (diffSeconds < 86400) return { status: 'idle', color: 'var(--text-secondary)', label: 'Idle' }; - return { status: 'inactive', color: 'var(--text-muted)', label: 'Inactive' }; - }; - - const getEnvironment = (agent: AgentConnection): { type: 'local' | 'vps' | 'sandbox'; icon: string; label: string } => { - if (agent.agent_id.startsWith('vps_')) { - return { type: 'vps', icon: '🌐', label: 'Remote' }; - } - if (agent.mode === 'mcp') { - return { type: 'local', icon: '💻', label: 'Local AI' }; - } - if (agent.tier === 'free') { - return { type: 'sandbox', icon: '🧪', label: 'Sandbox' }; - } - return { type: 'vps', icon: '🌐', label: 'VPS' }; - }; - - const handleRevoke = async (agentId: string) => { - setActionLoading(agentId); - try { - await api.revokeAgentConnection(agentId); - await loadAgents(); - setStatusMessage('Agent access revoked'); - setTimeout(() => setStatusMessage(null), 3000); - } catch (err) { - setStatusMessage(err instanceof Error ? err.message : 'Failed to revoke agent'); - } finally { - setActionLoading(null); - } - }; - - const handleDeleteClick = (agentId: string) => { - setConfirmDelete(agentId); - }; - - const handleDeleteConfirm = async () => { - if (!confirmDelete) return; - const agentId = confirmDelete; - setConfirmDelete(null); - setActionLoading(agentId); - try { - await api.deleteAgentConnection(agentId); - await loadAgents(); - setSelectedAgent(null); - setStatusMessage('Agent deleted'); - setTimeout(() => setStatusMessage(null), 3000); - } catch (err) { - setStatusMessage(err instanceof Error ? err.message : 'Failed to delete agent'); - } finally { - setActionLoading(null); - } - }; - - const handleApproveClaim = async (claimId: string) => { - setActionLoading(claimId); - try { - const result = await api.approvePairingClaim(claimId); - setStatusMessage(`Agent "${result.agent_name}" approved and connected`); - await loadAgents(); - setTimeout(() => setStatusMessage(null), 3000); - } catch (err) { - setStatusMessage(err instanceof Error ? err.message : 'Failed to approve claim'); - } finally { - setActionLoading(null); - } - }; - - const handleDenyClaim = async (claimId: string) => { - setActionLoading(claimId); - try { - await api.denyPairingClaim(claimId); - setStatusMessage('Pairing request denied'); - await loadAgents(); - setTimeout(() => setStatusMessage(null), 3000); - } catch (err) { - setStatusMessage(err instanceof Error ? err.message : 'Failed to deny claim'); - } finally { - setActionLoading(null); - } - }; - - const formatLastSeen = (dateStr?: string): string => { - if (!dateStr) return 'Never'; - const date = new Date(dateStr); - const diffMs = Date.now() - date.getTime(); - const diffSeconds = Math.floor(diffMs / 1000); - - if (diffSeconds < 60) return 'Just now'; - if (diffSeconds < 3600) return `${Math.floor(diffSeconds / 60)} min ago`; - if (diffSeconds < 86400) return `${Math.floor(diffSeconds / 3600)} hours ago`; - return date.toLocaleDateString(); - }; - - const filteredAgents = agents.filter(agent => { - const { status } = getAgentStatus(agent); - const env = getEnvironment(agent); - - // Status filter - if (filter === 'active' && status === 'revoked') return false; - if (filter === 'revoked' && status !== 'revoked') return false; - - // Environment filter - if (environmentFilter === 'local' && env.type !== 'local') return false; - if (environmentFilter === 'vps' && env.type !== 'vps' && env.type !== 'sandbox') return false; - - return true; - }); - - if (loading) { - return ( -
-
-
- ); - } - - const selectedAgentData = selectedAgent ? agents.find(a => a.agent_id === selectedAgent) : null; - - return ( -
-
-
-

Agents

-

Manage AI agents connected to your vault

-
- -
- - {/* Stats Bar */} -
-
-
- {agents.length} -
-
Total Agents
-
-
-
- {agents.filter(a => getAgentStatus(a).status === 'active').length} -
-
Active
-
-
-
- {agents.filter(a => getEnvironment(a).type === 'local').length} -
-
Local
-
-
-
- {agents.filter(a => getEnvironment(a).type !== 'local').length} -
-
Remote
-
-
- - {/* Pending Pairing Claims */} - {pendingClaims.length > 0 && ( -
-
- 🔔 -

- Pending VPS Agent Requests ({pendingClaims.length}) -

-
-

- A remote VPS agent is requesting to connect to your vault. Verify the hostname and verification phrase before approving. -

- -
- {pendingClaims.map((claim) => ( -
-
-
-
- 🌐 - - {claim.claim.agent_hostname} - - - Pending - -
- -
- {claim.verification_phrase} -
- -
- Version: {claim.claim.agent_version} • - Requested: {new Date(claim.received_at).toLocaleTimeString()} -
-
- -
- - -
-
-
- ))} -
-
- )} - - {/* Filters */} -
-
- Status: - {(['all', 'active', 'revoked'] as const).map((f) => ( - - ))} -
-
- Environment: - {(['all', 'local', 'vps'] as const).map((f) => ( - - ))} -
-
- - {/* Status Message */} - {statusMessage && ( -
- {statusMessage} -
- )} - -
- {/* Agent List */} -
-
-
-

Connected Agents

-

{filteredAgents.length} agents

-
-
- - {filteredAgents.length === 0 ? ( -
-

No agents match the current filters

-
- ) : ( -
- {filteredAgents.map((agent) => { - const { status, color, label } = getAgentStatus(agent); - const env = getEnvironment(agent); - const isSelected = selectedAgent === agent.agent_id; - - return ( -
setSelectedAgent(isSelected ? null : agent.agent_id)} - style={{ - padding: '16px', - background: isSelected ? 'var(--bg-secondary)' : 'var(--bg-tertiary)', - border: `1px solid ${isSelected ? 'var(--accent)' : 'var(--border)'}`, - borderRadius: '8px', - cursor: 'pointer', - transition: 'all 0.2s', - }} - > -
-
-
- {env.icon} - - {agent.name || agent.agent_name} - - - {label} - - - {env.label} - -
- -
- {agent.permission_scopes.slice(0, 4).map((scope) => ( - - {scope.replace(':', ': ')} - - ))} - {agent.permission_scopes.length > 4 && ( - - +{agent.permission_scopes.length - 4} more - - )} -
- -
- Last seen: {formatLastSeen(agent.last_seen_at)} - {(agent.request_count ?? 0) > 0 && ( - - {agent.request_count} requests - - )} -
-
- -
e.stopPropagation()}> - {status !== 'revoked' && ( - - )} - -
-
-
- ); - })} -
- )} -
- - {/* Agent Detail Panel */} - {selectedAgentData && ( -
-
-
-

{selectedAgentData.name || selectedAgentData.agent_name}

-

Agent Details

-
- -
- -
- {/* Status */} -
-
- Status -
-
- - - {getAgentStatus(selectedAgentData).label} - -
-
- - {/* Environment */} -
-
- Environment -
-
- {getEnvironment(selectedAgentData).icon} - {getEnvironment(selectedAgentData).label} - - {selectedAgentData.mode.toUpperCase()} - -
-
- - {/* Permissions */} -
-
- Permissions ({selectedAgentData.permission_scopes.length}) -
-
- {selectedAgentData.permission_scopes.map((scope) => ( - - {scope} - - ))} -
-
- - {/* Metadata */} -
-
- Activity -
-
-
- Paired - {new Date(selectedAgentData.paired_at).toLocaleDateString()} -
-
- Last Seen - {formatLastSeen(selectedAgentData.last_seen_at)} -
-
- Requests - {selectedAgentData.request_count ?? 0} -
-
- Tier - {selectedAgentData.tier} -
-
-
- - {/* Budget */} - {selectedAgentData.budget && ( -
-
- Budget -
-
-
- Daily limit - {selectedAgentData.budget.daily} {selectedAgentData.budget.currency} -
-
- Auto-approve under - {selectedAgentData.budget.auto_approve_under} {selectedAgentData.budget.currency} -
-
-
- )} - - {/* Agent ID */} -
-
- Agent ID -
- - {selectedAgentData.agent_id} - -
- - {/* Actions */} -
- {getAgentStatus(selectedAgentData).status !== 'revoked' && ( - - )} -
- {getAgentStatus(selectedAgentData).status !== 'revoked' && ( - - )} - -
-
-
-
- )} -
- - {/* Edit Permissions Modal */} - {editAgent && ( -
-
-
-

Edit Permissions

- -
- -
- {editAgent.name || editAgent.agent_name} -
- - {/* Quick Presets */} -
-
- Quick Presets -
-
- - - -
-
- - {/* Scopes */} -
-
- Allowed Scopes ({editScopes.length} selected) -
-
- {availableScopes.length === 0 ? ( -
- No scopes available. Add data to your vault first. -
- ) : ( -
- {availableScopes.map(scope => ( - - ))} -
- )} -
-
- - {/* Budget Settings */} -
-
- Budget Settings -
-
-
- - setEditBudgetDaily(Number(e.target.value))} - style={{ - width: '100px', - padding: '8px', - borderRadius: '6px', - border: '1px solid var(--border)', - background: 'var(--bg-secondary)', - color: 'var(--text-primary)', - textAlign: 'right', - }} - min={0} - /> - -
-
- - setEditAutoApprove(Number(e.target.value))} - style={{ - width: '100px', - padding: '8px', - borderRadius: '6px', - border: '1px solid var(--border)', - background: 'var(--bg-secondary)', - color: 'var(--text-primary)', - textAlign: 'right', - }} - min={0} - /> - - {editBudgetCurrency} - -
-
- Transactions under the auto-approve threshold will be approved automatically. -
-
-
- - {/* Actions */} -
- - -
-
-
- )} - - {/* Delete Confirmation Modal */} - {confirmDelete && ( -
-
-

Delete Agent?

-

- Are you sure you want to delete this agent? This action cannot be undone. -

-
- - -
-
-
- )} -
- ); -} diff --git a/packages/dcp-desktop/src/pages/Connect.tsx b/packages/dcp-desktop/src/pages/Connect.tsx deleted file mode 100644 index d99442f..0000000 --- a/packages/dcp-desktop/src/pages/Connect.tsx +++ /dev/null @@ -1,1161 +0,0 @@ -import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { open } from '@tauri-apps/plugin-shell'; -import { api, type AgentConnection, type RelayInfo, type VpsPairingInviteResponse } from '../api'; - -// MCP status interface -interface McpStatus { - running: boolean; - unlocked: boolean; -} - -// Local MCP agent status -interface LocalMcpStatus { - configured: boolean; - config_exists: boolean; - connection_status: string; - agent_id: string; -} - -type Tab = 'local' | 'remote' | 'telegram'; - -const TELEGRAM_BOT_USERNAME = 'dcpagentBot'; -const REMOTE_INVITE_STORAGE_KEY = 'dcp.latestRemoteInvite'; - -interface TelegramConfig { - configured: boolean; - enabled?: boolean; - chat_id?: string; - paired_at?: string; -} - -// Check if Telegram is fully paired (not just pending) -const isTelegramPaired = (config: TelegramConfig | null): boolean => { - return !!(config?.configured && config?.enabled && config?.paired_at); -}; - -// Local AI agent types with their config instructions -type LocalAgentType = 'claude-desktop' | 'cursor' | 'vscode' | 'openclaw' | 'hermes' | 'other'; -const LOCAL_AGENT_TYPES: { id: LocalAgentType; label: string; configPath: string }[] = [ - { id: 'claude-desktop', label: 'Claude Desktop', configPath: 'Settings → Developer → Add MCP Server' }, - { id: 'cursor', label: 'Cursor', configPath: 'Cursor Settings → MCP → Add new global MCP server' }, - { id: 'vscode', label: 'VS Code', configPath: 'Cmd+Shift+P → "MCP: Add Server"' }, - { id: 'openclaw', label: 'OpenClaw', configPath: '~/.openclaw/openclaw.json' }, - { id: 'hermes', label: 'Hermes', configPath: '~/.hermes/config.yaml → mcp_servers' }, - { id: 'other', label: 'Other MCP Client', configPath: 'Check your app documentation' }, -]; - -const isActiveInvite = (invite: VpsPairingInviteResponse | null): invite is VpsPairingInviteResponse => { - if (!invite?.token || !invite.expires_at) return false; - return new Date(invite.expires_at).getTime() > Date.now(); -}; - -const loadStoredRemoteInvite = (): VpsPairingInviteResponse | null => { - try { - const raw = window.localStorage.getItem(REMOTE_INVITE_STORAGE_KEY); - if (!raw) return null; - const invite = JSON.parse(raw) as VpsPairingInviteResponse; - if (!isActiveInvite(invite)) { - window.localStorage.removeItem(REMOTE_INVITE_STORAGE_KEY); - return null; - } - return invite; - } catch { - return null; - } -}; - -const saveStoredRemoteInvite = (invite: VpsPairingInviteResponse): void => { - try { - window.localStorage.setItem(REMOTE_INVITE_STORAGE_KEY, JSON.stringify(invite)); - } catch { - // If storage is unavailable, the current page state still works. - } -}; - -const clearStoredRemoteInvite = (): void => { - try { - window.localStorage.removeItem(REMOTE_INVITE_STORAGE_KEY); - } catch { - // Ignore storage failures. - } -}; - -export default function Connect() { - const [activeTab, setActiveTab] = useState('local'); - - // Relay state - const [relayInfo, setRelayInfo] = useState(null); - const [relayLoading, setRelayLoading] = useState(true); - - // Local AI / MCP state - const [selectedAgentType, setSelectedAgentType] = useState('claude-desktop'); - const [mcpConfigCopied, setMcpConfigCopied] = useState(false); - const [mcpStatus, setMcpStatus] = useState(null); - const [localMcpStatus, setLocalMcpStatus] = useState(null); - const [localMcpSetupLoading, setLocalMcpSetupLoading] = useState(false); - - // Remote Agent state - const [agentName, setAgentName] = useState(''); - const [pairResult, setPairResult] = useState(() => loadStoredRemoteInvite()); - const [pairingLoading, setPairingLoading] = useState(false); - const [status, setStatus] = useState(null); - - // Telegram state - const [telegramConfig, setTelegramConfig] = useState(null); - const [telegramLoading, setTelegramLoading] = useState(true); - const [telegramCode, setTelegramCode] = useState(null); - const [telegramCodeExpires, setTelegramCodeExpires] = useState(null); - const [telegramPairing, setTelegramPairing] = useState(false); - const [telegramTesting, setTelegramTesting] = useState(false); - const telegramCodeRef = useRef(null); - - // Connected agents state (for summary display) - const [agentConnections, setAgentConnections] = useState([]); - const [connectionsLoading, setConnectionsLoading] = useState(true); - - const getAgentDisplayStatus = (agent: AgentConnection): { status: string; color: string } => { - if (agent.status === 'revoked' || agent.revoked_at) { - return { status: 'revoked', color: 'var(--danger)' }; - } - if (!agent.last_seen_at) { - return { status: 'pending', color: 'var(--text-muted)' }; - } - const lastSeen = new Date(agent.last_seen_at).getTime(); - const diffSeconds = (Date.now() - lastSeen) / 1000; - if (diffSeconds < 60) return { status: 'active', color: 'var(--success)' }; - if (diffSeconds < 86400) return { status: 'stale', color: 'var(--warning)' }; - return { status: 'inactive', color: 'var(--text-muted)' }; - }; - - const loadRelayInfo = useCallback(async () => { - try { - const data = await api.getRelayInfo(); - setRelayInfo(data); - } catch (err) { - console.error('Failed to load relay info:', err); - } finally { - setRelayLoading(false); - } - }, []); - - const loadAgentConnections = useCallback(async () => { - try { - const res = await api.getAgentConnections(); - setAgentConnections(res.agents || []); - } catch (err) { - console.error('Failed to load agent connections:', err); - } finally { - setConnectionsLoading(false); - } - }, []); - - const loadTelegramConfig = useCallback(async () => { - try { - const config = await api.getTelegramConfig(); - setTelegramConfig(config); - } catch (err) { - console.error('Failed to load telegram config:', err); - } finally { - setTelegramLoading(false); - } - }, []); - - const loadMcpStatus = useCallback(async () => { - try { - // Check vault health - if vault is unlocked, MCP can work - const health = await api.health(); - // MCP is "running" if vault is initialized, "unlocked" if vault is unlocked - setMcpStatus({ - running: health.initialized, - unlocked: health.unlocked, - }); - } catch (err) { - console.error('Failed to load MCP status:', err); - setMcpStatus(null); - } - }, []); - - const loadLocalMcpStatus = useCallback(async () => { - try { - const status = await api.getLocalMcpStatus(); - setLocalMcpStatus(status); - } catch (err) { - console.error('Failed to load local MCP status:', err); - setLocalMcpStatus(null); - } - }, []); - - const setupLocalMcp = useCallback(async () => { - setLocalMcpSetupLoading(true); - try { - const result = await api.setupLocalMcp(selectedAgentType); - if (result.success) { - setStatus(`${result.agent_name} agent added successfully`); - await loadLocalMcpStatus(); - await loadAgentConnections(); - } - } catch (err) { - console.error('Failed to setup local MCP:', err); - setStatus(err instanceof Error ? err.message : 'Failed to setup local MCP'); - } finally { - setLocalMcpSetupLoading(false); - } - }, [loadLocalMcpStatus, loadAgentConnections, selectedAgentType]); - - // Separate function to check pairing status with cloud - const checkTelegramPairing = useCallback(async () => { - try { - const status = await api.getTelegramPairingStatus(); - if (status.paired) { - // Cloud confirmed pairing - now get updated local config - const config = await api.getTelegramConfig(); - setTelegramConfig(config); - setTelegramCode(null); - setTelegramCodeExpires(null); - return true; - } - return false; - } catch (err) { - console.error('Failed to check telegram pairing:', err); - return false; - } - }, []); - - useEffect(() => { - void loadRelayInfo(); - void loadAgentConnections(); - void loadTelegramConfig(); - void loadMcpStatus(); - void loadLocalMcpStatus(); - }, [loadAgentConnections, loadRelayInfo, loadTelegramConfig, loadMcpStatus, loadLocalMcpStatus]); - - // Removed auto-setup - user must explicitly click "Add Agent" button (per protocol spec Task 6.2) - - // Keep ref in sync with state - useEffect(() => { - telegramCodeRef.current = telegramCode; - }, [telegramCode]); - - // Separate polling effect - uses ref to avoid re-creating interval - useEffect(() => { - const interval = window.setInterval(() => { - if (!api.hasOwnerToken()) return; - void loadAgentConnections(); - void loadRelayInfo(); - void loadMcpStatus(); - void loadLocalMcpStatus(); - // Check telegram pairing status if code was generated - if (telegramCodeRef.current) { - void checkTelegramPairing(); - } - }, 5000); - return () => window.clearInterval(interval); - }, [loadAgentConnections, loadRelayInfo, loadMcpStatus, loadLocalMcpStatus, checkTelegramPairing]); - - const createVpsInvite = async () => { - const name = agentName.trim(); - if (!name) { - setStatus('Give your agent a name'); - return; - } - - setPairingLoading(true); - setStatus(null); - - try { - const res = await api.createVpsPairingInvite({ - agent_name: name, - ttl_ms: 3600000, // 1 hour - }); - setPairResult(res); - saveStoredRemoteInvite(res); - setStatus(`VPS invite generated for "${res.agent_name}"`); - } catch (err) { - setStatus(err instanceof Error ? err.message : 'Failed to create VPS invite'); - } finally { - setPairingLoading(false); - } - }; - - const remoteInstallCommand = useMemo(() => { - if (!pairResult?.token) return ''; - return `curl -fsSL https://dcpagent.com/install.sh | sudo bash -s -- '${pairResult.token}'`; - }, [pairResult]); - - const remoteNpxInstallCommand = useMemo(() => { - if (!pairResult?.token) return ''; - return `sudo npx --yes @dcprotocol/agent@latest install-service '${pairResult.token}'`; - }, [pairResult]); - - const openClawGatewayUserCommand = - 'sudo npx --yes @dcprotocol/agent@latest configure-openclaw --user openclaw'; - - const openClawManualCommand = - 'sudo npx --yes @dcprotocol/agent@latest configure-openclaw --manual'; - - const copyText = async (text: string, message: string) => { - try { - await navigator.clipboard.writeText(text); - setStatus(message); - } catch { - setStatus('Failed to copy'); - } - }; - - const copyToken = async () => { - if (!pairResult?.token) return; - await copyText(pairResult.token, 'Token copied!'); - }; - - useEffect(() => { - if (!pairResult) return; - if (!isActiveInvite(pairResult)) { - setPairResult(null); - clearStoredRemoteInvite(); - return; - } - - const expiresInMs = new Date(pairResult.expires_at).getTime() - Date.now(); - const timeout = window.setTimeout(() => { - setPairResult(null); - clearStoredRemoteInvite(); - setStatus('Remote invite expired. Create a new one to continue.'); - }, Math.max(0, expiresInMs)); - - return () => window.clearTimeout(timeout); - }, [pairResult]); - - // Agent ID mapping - const agentIdMap: Record = { - 'claude-desktop': 'agent_claude_desktop', - 'cursor': 'agent_cursor', - 'vscode': 'agent_vscode', - 'openclaw': 'agent_openclaw_local', - 'hermes': 'agent_hermes_local', - 'other': 'agent_local_mcp', - }; - - // MCP config for the selected agent type (uses npx for zero-install) - const mcpConfig = useMemo(() => { - const serverConfig = { - command: 'npx', - args: ['-y', '@dcprotocol/agent', 'run', '--mode', 'mcp', '--agent', agentIdMap[selectedAgentType]], - }; - - if (selectedAgentType === 'openclaw') { - return `openclaw mcp set dcp '${JSON.stringify(serverConfig)}'`; - } - - if (selectedAgentType === 'hermes') { - return [ - 'mcp_servers:', - ' dcp:', - ` command: "${serverConfig.command}"`, - ' args:', - ...serverConfig.args.map((arg) => ` - "${arg}"`), - ' tools:', - ' prompts: false', - ' resources: false', - ].join('\n'); - } - - return JSON.stringify({ - mcpServers: { - dcp: serverConfig, - }, - }, null, 2); - }, [selectedAgentType]); - - const copyMcpConfig = async () => { - try { - await navigator.clipboard.writeText(mcpConfig); - setMcpConfigCopied(true); - setTimeout(() => setMcpConfigCopied(false), 2000); - } catch { - setStatus('Failed to copy'); - } - }; - - // Generate one-click install deep link for Cursor/VS Code - const getInstallDeepLink = useMemo(() => { - const serverConfig = { - command: 'npx', - args: ['-y', '@dcprotocol/agent', 'run', '--mode', 'mcp', '--agent', agentIdMap[selectedAgentType]], - }; - - if (selectedAgentType === 'cursor') { - // Cursor: cursor://anysphere.cursor-deeplink/mcp/install?name=X&config=BASE64 - const configBase64 = btoa(JSON.stringify(serverConfig)); - return `cursor://anysphere.cursor-deeplink/mcp/install?name=dcp&config=${configBase64}`; - } - - if (selectedAgentType === 'vscode') { - // VS Code: vscode:mcp/install?URL_ENCODED_JSON - const configWithName = { name: 'dcp', ...serverConfig }; - return `vscode:mcp/install?${encodeURIComponent(JSON.stringify(configWithName))}`; - } - - return null; - }, [selectedAgentType]); - - // Telegram handlers - const startTelegramPairing = async (forceNew = false) => { - // If we have an active code that hasn't expired, reuse it - if (!forceNew && telegramCode && telegramCodeExpires) { - const expiresAt = new Date(telegramCodeExpires).getTime(); - if (expiresAt > Date.now()) { - // Code still valid, just show it again - return; - } - } - - setTelegramPairing(true); - try { - const res = await api.startTelegramPairing(); - setTelegramCode(res.code); - setTelegramCodeExpires(res.expires_at); - } catch (err) { - setStatus(err instanceof Error ? err.message : 'Failed to start pairing'); - } finally { - setTelegramPairing(false); - } - }; - - const sendTelegramTest = async () => { - setTelegramTesting(true); - try { - await api.sendTelegramTest(); - setStatus('Test notification sent!'); - } catch (err) { - setStatus(err instanceof Error ? err.message : 'Failed to send test'); - } finally { - setTelegramTesting(false); - } - }; - - const unlinkTelegram = async () => { - try { - await api.unlinkTelegram(); - setTelegramConfig(null); - setTelegramCode(null); - setStatus('Telegram unlinked'); - } catch (err) { - setStatus(err instanceof Error ? err.message : 'Failed to unlink'); - } - }; - - const tabs = [ - { id: 'local' as Tab, label: 'Local AI', icon: '💻' }, - { id: 'remote' as Tab, label: 'Remote Agent', icon: '🌐' }, - { id: 'telegram' as Tab, label: 'Telegram', icon: '📱' }, - ]; - - return ( -
-
-
-

Connect

-

Connect AI assistants to your vault

-
-
- {/* MCP Status Badge */} -
- - - {localMcpStatus?.configured && mcpStatus?.unlocked - ? 'MCP Ready' - : localMcpStatus?.configured - ? 'MCP Locked' - : mcpStatus?.running - ? 'MCP Setup Needed' - : 'MCP Offline'} - -
- {/* Relay Status Badge */} -
- - - {relayLoading ? 'Checking...' : relayInfo?.relay_connected ? 'Relay Connected' : 'Relay Offline'} - -
-
-
- - {/* Tab Selector */} -
- {tabs.map((tab) => ( - - ))} -
- - {/* Local AI Tab */} - {activeTab === 'local' && ( -
-
-
-

Local AI Agent

-

Connect a local AI assistant to your vault

-
-
- -
- {/* Status Section */} - {localMcpStatus?.configured && ( -
-
- -
-
- {mcpStatus?.unlocked ? 'Local Agent Ready' : 'Vault Locked'} -
-
- {mcpStatus?.unlocked - ? 'Your vault is unlocked and ready for AI access' - : 'Unlock your vault to allow AI access'} -
-
- {mcpStatus?.unlocked && } -
-
- )} - - {/* Step 1: Choose Agent Type */} -
-
- 1. Choose your AI assistant -
-
- {LOCAL_AGENT_TYPES.map((agent) => ( - - ))} -
-
- - {/* Step 2: Copy Config */} -
-
- 2. Add to your MCP config -
- - {/* One-click install for Cursor/VS Code */} - {getInstallDeepLink && ( -
- -
- or copy config manually below -
-
- )} - -
- {LOCAL_AGENT_TYPES.find(a => a.id === selectedAgentType)?.configPath} -
-
-                {mcpConfig}
-              
- -
- - {/* Step 3: Add Agent - always show so users can add multiple agents */} -
-
- 3. Register local agent -
- -
- -
- Important: Keep this DCP app open and unlocked while using your AI assistant. -
-
-
- )} - - {/* Remote Agent Tab */} - {activeTab === 'remote' && ( -
-
-
-

Remote Agent - VPS / OpenClaw / Hermes

-

Generate an invite token for remote VPS agents

-
-
- - {!pairResult ? ( -
-
- - setAgentName(e.target.value)} - placeholder="e.g., my-trading-bot" - /> -
- -
- How it works: Generate an invite token, run it on your VPS, then verify the pairing phrase displayed on both sides. - You'll set permissions when approving the connection. -
- - -
- ) : ( -
-
-
- VPS Invite Generated! -
-
- Agent: {pairResult.agent_name} -
-
- Expires: {new Date(pairResult.expires_at).toLocaleTimeString()} -
-
- This command stays available on this page until it expires. -
-
- -
-
- Run on your VPS: -
-
-{remoteInstallCommand}
-                
-
- Installs and pairs the DCP service, starts HTTP MCP, then tries to configure OpenClaw and Hermes automatically. -
-
- -
-
- npm fallback: -
-
-{remoteNpxInstallCommand}
-                
-
- Use this only if you prefer npm and the VPS already has a working Node/npm install. -
-
- -
-
- If OpenClaw is not detected: -
-
-{openClawGatewayUserCommand}
-                
-
- Use this after install if OpenClaw runs as the openclaw Linux user. It uses the DCP MCP URL saved by the installer. -
-
- -
-
- Hermes remote config: -
-
-{`mcp_servers:
-  dcp:
-    url: "http://127.0.0.1:8420/mcp"
-    tools:
-      prompts: false
-      resources: false`}
-                
-
- Add this to ~/.hermes/config.yaml on the VPS after install, then run /reload-mcp or restart Hermes. -
-
- -
-
- Manual MCP config: -
-
-{openClawManualCommand}
-                
-
- -
- ⏳ After running, a pairing request will appear on the Agents page. Verify the phrase matches before approving! -
- -
- After OpenClaw config changes, start a fresh OpenClaw chat so new DCP tools are loaded. -
- -
- - - - - - -
-
- )} -
- )} - - {/* Telegram Tab */} - {activeTab === 'telegram' && ( -
-
-
-

Telegram Notifications

-

Get notified when agents need approval

-
-
- - {telegramLoading ? ( -
-
-
- ) : isTelegramPaired(telegramConfig) ? ( - // Already paired -
-
- -
-
Telegram Connected
-
- Paired {telegramConfig?.paired_at ? new Date(telegramConfig.paired_at).toLocaleDateString() : 'recently'} -
-
-
- -
- - -
-
- ) : telegramCode ? ( - // Pairing in progress -
-
-
- Pair with Telegram: -
-
- {telegramCode} -
-
- Expires {telegramCodeExpires ? new Date(telegramCodeExpires).toLocaleTimeString() : 'soon'} -
-
- - - Open Telegram - - -
- Waiting for Telegram pairing. If Telegram does not complete it automatically, send /pair {telegramCode}. -
- -
- - -
- -
- ) : ( - // Not paired -
-
-
📱
-
- Connect Telegram to receive notifications when agents need approval. -
-
- Perfect for approving requests on the go. -
-
- - -
- )} -
- )} - - {/* Status Message */} - {status && ( -
- {status} -
- )} - - {/* Connected Agents Summary */} -
-
-
-
- - - - - - -
-
-
- {connectionsLoading ? '...' : agentConnections.length} Connected Agents -
-
- {connectionsLoading - ? 'Loading...' - : agentConnections.filter(a => getAgentDisplayStatus(a).status === 'active').length + ' active'} -
-
-
- { - e.preventDefault(); - window.location.href = '/agents'; - }} - className="btn btn-primary" - style={{ textDecoration: 'none' }} - > - Manage Agents - -
-
-
- ); -} diff --git a/packages/dcp-desktop/src/pages/Data.tsx b/packages/dcp-desktop/src/pages/Data.tsx deleted file mode 100644 index cc408f0..0000000 --- a/packages/dcp-desktop/src/pages/Data.tsx +++ /dev/null @@ -1,731 +0,0 @@ -import { useEffect, useState } from 'react'; -import { api, type Scope } from '../api'; - -// Field type definitions -interface BaseField { - key: string; - label: string; - placeholder?: string; -} - -interface TextField extends BaseField { - type: 'text' | 'email' | 'tel' | 'password' | 'date'; -} - -interface SelectField extends BaseField { - type: 'select'; - options: string[]; -} - -interface TagsField extends BaseField { - type: 'tags'; -} - -type FieldDef = TextField | SelectField | TagsField; - -interface DataTemplate { - label: string; - icon: string; - fields: FieldDef[]; -} - -// Data categories with user-friendly forms -const DATA_TEMPLATES: Record = { - 'identity.name': { - label: 'Your Name', - icon: '👤', - fields: [ - { key: 'first', label: 'First Name', type: 'text', placeholder: 'John' }, - { key: 'last', label: 'Last Name', type: 'text', placeholder: 'Doe' }, - { key: 'full', label: 'Full Name', type: 'text', placeholder: 'John Doe' }, - ] - }, - 'identity.email': { - label: 'Email Address', - icon: '📧', - fields: [ - { key: 'email', label: 'Email', type: 'email', placeholder: 'john@example.com' }, - ] - }, - 'identity.phone': { - label: 'Phone Number', - icon: '📱', - fields: [ - { key: 'country_code', label: 'Country Code', type: 'text', placeholder: '+1' }, - { key: 'number', label: 'Phone Number', type: 'tel', placeholder: '555-123-4567' }, - ] - }, - 'identity.birthday': { - label: 'Birthday', - icon: '🎂', - fields: [ - { key: 'date', label: 'Date of Birth', type: 'date', placeholder: '' }, - ] - }, - 'address.home': { - label: 'Home Address', - icon: '🏠', - fields: [ - { key: 'street', label: 'Street Address', type: 'text', placeholder: '123 Main St' }, - { key: 'city', label: 'City', type: 'text', placeholder: 'San Francisco' }, - { key: 'state', label: 'State/Province', type: 'text', placeholder: 'CA' }, - { key: 'zip', label: 'ZIP/Postal Code', type: 'text', placeholder: '94102' }, - { key: 'country', label: 'Country', type: 'text', placeholder: 'US' }, - ] - }, - 'address.work': { - label: 'Work Address', - icon: '🏢', - fields: [ - { key: 'street', label: 'Street Address', type: 'text', placeholder: '456 Business Ave' }, - { key: 'city', label: 'City', type: 'text', placeholder: 'New York' }, - { key: 'state', label: 'State/Province', type: 'text', placeholder: 'NY' }, - { key: 'zip', label: 'ZIP/Postal Code', type: 'text', placeholder: '10001' }, - { key: 'country', label: 'Country', type: 'text', placeholder: 'US' }, - ] - }, - 'preferences.sizes': { - label: 'Clothing Sizes', - icon: '👕', - fields: [ - { key: 'shirt', label: 'Shirt Size', type: 'select', options: ['XS', 'S', 'M', 'L', 'XL', 'XXL'] }, - { key: 'pants', label: 'Pants Size', type: 'text', placeholder: '32x32' }, - { key: 'shoe', label: 'Shoe Size', type: 'text', placeholder: '10' }, - ] - }, - 'preferences.diet': { - label: 'Dietary Preferences', - icon: '🥗', - fields: [ - { key: 'restrictions', label: 'Dietary Restrictions', type: 'tags', placeholder: 'vegetarian, gluten-free' }, - { key: 'allergies', label: 'Allergies', type: 'tags', placeholder: 'peanuts, shellfish' }, - { key: 'preferences', label: 'Food Preferences', type: 'tags', placeholder: 'spicy, organic' }, - ] - }, - 'preferences.brands': { - label: 'Brand Preferences', - icon: '🏷️', - fields: [ - { key: 'preferred', label: 'Favorite Brands', type: 'tags', placeholder: 'Nike, Apple' }, - { key: 'avoided', label: 'Brands to Avoid', type: 'tags', placeholder: '' }, - ] - }, - 'credentials.api': { - label: 'API Credential', - icon: '🔑', - fields: [ - { key: 'label', label: 'Label/Name', type: 'text', placeholder: 'My OpenAI Key' }, - { key: 'service', label: 'Service ID (for scoping)', type: 'text', placeholder: 'openai, claude, stripe, etc.' }, - { key: 'key', label: 'API Key', type: 'password', placeholder: 'sk-...' }, - { key: 'base_url', label: 'Base URL (optional)', type: 'text', placeholder: 'https://api.openai.com' }, - ] - }, -}; - -type TemplateKey = string; - -const normalizeVaultScope = (scopeKey: string) => - scopeKey.replace(/^(read|write|sign):/, ''); - -// Helper to get template for a scope (supports prefix matching for API credentials) -const getTemplateForScope = (scopeKey: string) => { - const normalizedScope = normalizeVaultScope(scopeKey); - // Direct match first - if (DATA_TEMPLATES[normalizedScope]) { - return DATA_TEMPLATES[normalizedScope]; - } - // Check if it's an API credential (credentials.api.*) - if (normalizedScope.startsWith('credentials.api.')) { - return DATA_TEMPLATES['credentials.api']; - } - return null; -}; - -// Modal overlay styles -const modalOverlayStyle: React.CSSProperties = { - position: 'fixed', - inset: 0, - background: 'rgba(0, 0, 0, 0.7)', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - zIndex: 1000, - padding: '20px', -}; - -const modalContentStyle: React.CSSProperties = { - background: 'var(--bg-secondary)', - borderRadius: '16px', - border: '1px solid var(--border)', - maxWidth: '500px', - width: '100%', - maxHeight: '90vh', - overflow: 'auto', - boxShadow: '0 25px 50px -12px rgba(0, 0, 0, 0.5)', -}; - -export default function Data() { - const [scopes, setScopes] = useState([]); - const [loading, setLoading] = useState(true); - const [showAddMenu, setShowAddMenu] = useState(false); - const [editingScope, setEditingScope] = useState(null); - const [formData, setFormData] = useState>({}); - const [saving, setSaving] = useState(false); - const [deleting, setDeleting] = useState(false); - const [visibleSecretFields, setVisibleSecretFields] = useState>({}); - const [error, setError] = useState(null); - const [success, setSuccess] = useState(null); - - useEffect(() => { - loadScopes(); - }, []); - - const loadScopes = async () => { - try { - const res = await api.getScopes(); - setScopes(res.scopes); - } catch (err) { - console.error('Failed to load scopes:', err); - } finally { - setLoading(false); - } - }; - - const openEditor = async (scopeKey: string) => { - const vaultScope = normalizeVaultScope(scopeKey); - try { - - // Set editing state FIRST to open modal immediately - setEditingScope(vaultScope); - setShowAddMenu(false); - setError(null); - setSuccess(null); - setFormData({}); // Start with empty form - - - // If scope exists, try to load its data (but modal is already open) - const existingScope = scopes.find(s => normalizeVaultScope(s.scope) === vaultScope); - if (existingScope) { - try { - const res = await api.readData(vaultScope); - if (res.data) { - const template = getTemplateForScope(vaultScope); - if (template) { - const newFormData: Record = {}; - template.fields.forEach(field => { - const value = res.data?.[field.key]; - if (Array.isArray(value)) { - newFormData[field.key] = value.join(', '); - } else { - newFormData[field.key] = value ? String(value) : ''; - } - }); - setFormData(newFormData); - } else { - setFormData({ _json: JSON.stringify(res.data, null, 2) }); - } - } - } catch (err) { - console.error('Failed to load data (modal still open):', err); - // Don't close modal on error - just show empty form - } - } - } catch (err) { - console.error('openEditor error:', err); - // Still try to open modal even on error - setEditingScope(vaultScope); - setFormData({}); - } - }; - - const closeEditor = () => { - setEditingScope(null); - setFormData({}); - setError(null); - setSuccess(null); - setDeleting(false); - setVisibleSecretFields({}); - }; - - const handleDelete = async () => { - if (!editingScope) return; - setDeleting(true); - setError(null); - setSuccess(null); - try { - await api.deleteData(editingScope); - setSuccess('Deleted successfully'); - await loadScopes(); - setTimeout(() => closeEditor(), 500); - } catch (err) { - const msg = err instanceof Error ? err.message : 'Failed to delete'; - setError(msg); - } finally { - setDeleting(false); - } - }; - - const handleSave = async () => { - if (!editingScope) return; - - setError(null); - setSuccess(null); - setSaving(true); - - try { - const template = getTemplateForScope(editingScope); - let data: Record; - let finalScope = editingScope; - - if (template) { - data = {}; - template.fields.forEach(field => { - const value = formData[field.key]?.trim(); - if (value) { - if (field.type === 'tags') { - data[field.key] = value.split(',').map(s => s.trim()).filter(Boolean); - } else { - data[field.key] = value; - } - } - }); - - // For new API credentials, use service name in scope if provided - if (editingScope.startsWith('credentials.api.') && !isExistingScope) { - const serviceName = formData['service']?.trim().toLowerCase().replace(/[^a-z0-9-]/g, ''); - if (serviceName) { - finalScope = `credentials.api.${serviceName}`; - } - } - } else { - data = JSON.parse(formData._json || '{}'); - } - - await api.writeData(finalScope, data); - setSuccess('Saved successfully!'); - await loadScopes(); - - // Close modal after success - setTimeout(() => { - closeEditor(); - }, 500); - } catch (err) { - const msg = err instanceof Error ? err.message : 'Failed to save'; - setError(msg); - } finally { - setSaving(false); - } - }; - - const handleFieldChange = (key: string, value: string) => { - setFormData(prev => ({ ...prev, [key]: value })); - }; - - const toggleSecretField = (key: string) => { - setVisibleSecretFields(prev => ({ ...prev, [key]: !prev[key] })); - }; - - if (loading) { - return ( -
-
-
- ); - } - - // Group by category with nice labels - const categoryLabels: Record = { - identity: '👤 Identity', - address: '📍 Addresses', - preferences: '⚙️ Preferences', - credentials: '🔑 Credentials', - crypto: '💰 Wallets', - health: '🏥 Health', - }; - - const groupedScopes = scopes.reduce((acc, scope) => { - const normalizedScope = normalizeVaultScope(scope.scope); - const category = normalizedScope.split('.')[0]; - if (!acc[category]) acc[category] = []; - acc[category].push(scope); - return acc; - }, {} as Record); - - const currentTemplate = editingScope ? getTemplateForScope(editingScope) : null; - const isExistingScope = editingScope ? scopes.some((s) => s.scope === editingScope) : false; - - - return ( -
- {/* Main Data List */} -
-
-
-

Your Data

-

Personal information stored in your vault

-
-
- - -
-
- - {/* Add Menu - Shows template options */} - {showAddMenu && ( -
-

- What would you like to add? -

-
- {Object.entries(DATA_TEMPLATES).map(([key, template]) => ( - - ))} -
- -
- )} - - {/* Existing Data List */} - {scopes.length === 0 && !showAddMenu ? ( -
-

📦

-

No data stored yet

-

- Click "+ Add Data" to store your first information -

-
- ) : ( - Object.entries(groupedScopes).map(([category, items]) => ( -
-

- {categoryLabels[category] || category} -

- {items.map((scope) => { - const templateKey = normalizeVaultScope(scope.scope) as TemplateKey; - const template = getTemplateForScope(templateKey); - const isWallet = scope.type === 'WALLET_KEY'; - const canEdit = !isWallet && scope.sensitivity !== 'critical'; - - return ( -
{ - if (canEdit) { - openEditor(scope.scope); - } - }} - style={{ - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - padding: '12px 16px', - background: 'transparent', - border: '1px solid var(--border)', - borderRadius: '8px', - marginBottom: '8px', - transition: 'all 0.15s ease', - cursor: canEdit ? 'pointer' : 'default', - }} - onMouseOver={(e) => { - if (canEdit) { - e.currentTarget.style.background = 'var(--bg-tertiary)'; - e.currentTarget.style.borderColor = 'var(--accent)'; - } - }} - onMouseOut={(e) => { - e.currentTarget.style.background = 'transparent'; - e.currentTarget.style.borderColor = 'var(--border)'; - }} - > -
- - {template?.icon || (isWallet ? '💰' : '📄')} - -
-
- {template?.label || templateKey} -
- {scope.public_address && ( -
- {scope.public_address.slice(0, 10)}...{scope.public_address.slice(-8)} -
- )} -
-
-
- {scope.sensitivity} - {canEdit && ( - - )} -
-
- ); - })} -
- )) - )} -
- - {/* Modal Editor */} - {editingScope && ( -
{ - if (e.target === e.currentTarget) closeEditor(); - }}> -
-
-
- {currentTemplate?.icon || '📄'} -
-

- {currentTemplate?.label || editingScope} -

-

- Fill in your information below -

-
-
- -
- -
- {error && ( -
- {error} -
- )} - - {success && ( -
- {success} -
- )} - - {currentTemplate ? ( - // Template-based form - currentTemplate.fields.map((field) => ( -
- - {field.type === 'select' ? ( - - ) : field.type === 'tags' ? ( - <> - handleFieldChange(field.key, e.target.value)} - /> -
- Separate multiple items with commas -
- - ) : field.type === 'password' ? ( -
- handleFieldChange(field.key, e.target.value)} - style={{ paddingRight: '42px' }} - /> - -
- ) : ( - handleFieldChange(field.key, e.target.value)} - /> - )} -
- )) - ) : ( - // JSON editor for custom scopes -
- -