From 3cfa011d0c51cb92a445149ad92f541975d7c01d Mon Sep 17 00:00:00 2001 From: iceBear67 Date: Sun, 9 Aug 2026 07:32:49 +0000 Subject: [PATCH] Ship prebuilt, so a git URL is the whole install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Grok Build loads plugins out of ~/.grok/plugins/ and clones marketplace sources straight from git; it never runs npm install or a build for you. So a plugin that ships TypeScript is a plugin you have to build by hand before it does anything, and the SessionStart hook's first act is to print "not built yet". dist/ is now committed, and the tree is arranged so that a bare clone can run: - The daemon is bundled to a single ESM file with rolldown, platform node. Its one runtime dependency (@simplewebauthn/server, plus the asn1/cbor tree under it) is inlined; the only imports left in the output are node: builtins. Not minified — a committed blob nobody can read is worse than no committed blob. - tsc no longer emits for the server, it only typechecks (noEmit). rolldown emits. - dist/web was already a self-contained static bundle. - The hook scripts under bin/ were stdlib-only from the start. .grok-plugin/marketplace.json makes the repo its own one-entry catalog with a local source of "./", so `grok plugin marketplace add ` followed by `grok plugin install grok-glance` works without pinning a SHA of itself. `npm run check:dist` rebuilds and fails if the committed output is stale — the one real hazard of checking in build output. Also drops the daemon's "non-default port, run `glance sync-hooks`" startup note, which the previous commit should have taken with the rest of that scheme; the hook scripts read config.json themselves, so a non-default port needs nothing. The e2e suite now takes GLANCE_ROOT and was run twice: once against the repo, once against a copy containing only tracked files plus dist/ and no node_modules — which is what actually demonstrates the claim, passkey registration and assertion included. 233 checks, both runs green. Co-Authored-By: Claude Opus 5 --- .gitignore | 1 - .grok-plugin/marketplace.json | 22 + README.md | 72 +- bin/glance | 6 +- bin/glance-up.mjs | 5 +- commands/glance.md | 5 +- dist/server/index.js | 23758 +++++++++++++++++++++++++++ dist/web/assets/index-BZSiLyex.css | 2 + dist/web/assets/index-D-dJ5pn0.js | 15 + dist/web/icon.svg | 6 + dist/web/index.html | 22 + dist/web/manifest.webmanifest | 19 + package-lock.json | 1 + package.json | 6 +- server/src/index.ts | 6 +- server/src/static.ts | 2 +- skills/glance/SKILL.md | 17 +- tsconfig.server.json | 6 +- 18 files changed, 23916 insertions(+), 55 deletions(-) create mode 100644 .grok-plugin/marketplace.json create mode 100644 dist/server/index.js create mode 100644 dist/web/assets/index-BZSiLyex.css create mode 100644 dist/web/assets/index-D-dJ5pn0.js create mode 100644 dist/web/icon.svg create mode 100644 dist/web/index.html create mode 100644 dist/web/manifest.webmanifest diff --git a/.gitignore b/.gitignore index dd6e803..3c45938 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules/ -dist/ *.log .DS_Store diff --git a/.grok-plugin/marketplace.json b/.grok-plugin/marketplace.json new file mode 100644 index 0000000..5e4ca68 --- /dev/null +++ b/.grok-plugin/marketplace.json @@ -0,0 +1,22 @@ +{ + "name": "grok-glance", + "description": "One-entry marketplace: this repo is both the catalog and the plugin, so `grok plugin marketplace add ` is enough to install it.", + "owner": { + "name": "grok-glance" + }, + "plugins": [ + { + "name": "grok-glance", + "description": "A passkey-guarded web dashboard that lets you glance at what Grok Build is doing from your phone, and approve or deny risky tool calls remotely.", + "category": "monitoring", + "keywords": [ + "grok-glance", + "glance dashboard", + "webauthn passkey", + "remote approval", + "session monitor" + ], + "source": { "type": "local", "path": "./" } + } + ] +} diff --git a/README.md b/README.md index 81801bb..9497b1b 100644 --- a/README.md +++ b/README.md @@ -37,49 +37,63 @@ or drive a session. ## Requirements -- Node.js 20 or newer, and npm. +- Node.js 20 or newer. **npm is only needed to develop it** — `dist/` is committed, and the + daemon bundle carries its one runtime dependency inside it, so an installed copy never runs + a build or an install step. - Grok Build. - For phone access: [Tailscale](https://tailscale.com/) on both the machine and the phone. See [Why Tailscale](#why-tailscale-and-not-just-the-lan-ip) — a LAN IP genuinely cannot work. ## Install +Grok Build loads plugins straight out of `~/.grok/plugins/`, so the shortest install is a clone: + ```sh -git clone grok-glance -cd grok-glance -npm install && npm run build +git clone ~/.grok/plugins/grok-glance ``` -The build produces `dist/server` (the daemon) and `dist/web` (the dashboard). Both are required; -the daemon serves the dashboard itself. `hooks/hooks.json` is checked in as-is — nothing about it -is generated or machine-specific. The shared secret the hook scripts authenticate with lives in -`~/.grok/glance/hook.secret` (mode 0600) and is created by the daemon on first start; it never -appears in `hooks.json`. +That is the whole thing — no `npm install`, no build. Open `/plugins` in Grok Build and enable +**grok-glance**. On the next session start its `SessionStart` hook boots the daemon in the +background, and the dashboard is on `http://127.0.0.1:8791`. -Then register the directory with Grok Build. Plugins are installed from a marketplace catalog, so -for a local checkout the shortest path is a one-entry catalog. Create -`.grok-plugin/marketplace.json` in a directory that contains your checkout: +### …or from a marketplace, by URL -```json -{ - "name": "local", - "description": "Local plugins", - "owner": { "name": "me" }, - "plugins": [ - { - "name": "grok-glance", - "description": "Passkey-guarded phone dashboard for Grok Build.", - "category": "monitoring", - "source": { "type": "local", "path": "./grok-glance" } - } - ] -} +If you would rather install it the way marketplace plugins are installed — or share it with other +machines — this repo is also its own one-entry marketplace (`.grok-plugin/marketplace.json`). Add +it as a marketplace source and install from it: + +```sh +grok plugin marketplace add https://your-git-host/you/grok-glance.git +grok plugin install grok-glance --trust ``` -…then add that marketplace and install `grok-glance` from Grok Build's `/plugin` interface. +Marketplace sources also live in `~/.grok/config.toml` under `[[marketplace.sources]]` and in +`~/.grok/plugins/known_marketplaces.json`, if you prefer to write them there directly. The TUI's +Marketplace tab reads the same list. -Once installed, the daemon starts by itself: the `SessionStart` hook boots it in the background on -the first session after installation. +### Why there is no build step + +`dist/` is checked in: + +- `dist/server/index.js` — the daemon, bundled to a single dependency-free ESM file. Its only + runtime dependency, `@simplewebauthn/server`, is inlined; everything else it uses is the Node + standard library. It is *not* minified, so what ships is what you can read. +- `dist/web/` — the dashboard, already a static bundle, which the daemon serves itself. + +The hook scripts under `bin/` were stdlib-only from the start. So a clone has nothing to resolve +and nothing to compile, which is what makes a bare git URL enough. + +Working on it instead? Then you do need the toolchain: + +```sh +npm install +npm run build # tsc typechecks, rolldown bundles the server, vite builds the web app +npm run check:dist # rebuilds and fails if the committed dist/ is stale +``` + +`hooks/hooks.json` is checked in as-is — nothing about it is generated or machine-specific. The +shared secret the hook scripts authenticate with lives in `~/.grok/glance/hook.secret` (mode 0600) +and is created by the daemon on first start; it never appears in `hooks.json`. ## Get it onto your phone diff --git a/bin/glance b/bin/glance index 8a5471e..0a8eca6 100755 --- a/bin/glance +++ b/bin/glance @@ -77,7 +77,11 @@ function sessionBreakdown(states) { function requireBuild() { if (!fs.existsSync(SERVER_ENTRY)) { - console.error(`grok-glance is not built yet.\n\n cd ${PLUGIN_ROOT}\n npm install && npm run build\n`); + console.error( + `grok-glance: ${SERVER_ENTRY} is missing.\n\n` + + `dist/ ships with the plugin, so this checkout is incomplete. Rebuild it:\n\n` + + ` cd ${PLUGIN_ROOT}\n npm install && npm run build\n`, + ); process.exit(1); } } diff --git a/bin/glance-up.mjs b/bin/glance-up.mjs index 357f287..cb733b2 100755 --- a/bin/glance-up.mjs +++ b/bin/glance-up.mjs @@ -28,9 +28,10 @@ async function ensureDaemon(cfg) { if (await isDaemonUp(cfg)) return true; if (!fs.existsSync(SERVER_ENTRY)) { - // Not built yet. Say so once, on stderr, where it is recorded but harmless. + // dist/ ships with the plugin, so this means an incomplete checkout. Say so once, on + // stderr, where it is recorded but harmless — a hook must never fail a session. process.stderr.write( - `[grok-glance] not built yet - run \`npm install && npm run build\` in ${PLUGIN_ROOT}\n`, + `[grok-glance] dist/ is missing - run \`npm install && npm run build\` in ${PLUGIN_ROOT}\n`, ); return false; } diff --git a/commands/glance.md b/commands/glance.md index 6ee5d55..3f4b550 100644 --- a/commands/glance.md +++ b/commands/glance.md @@ -12,8 +12,9 @@ If no argument was given, treat it as `status`. Then: 1. Run `node "$GROK_PLUGIN_ROOT/bin/glance" $ARGUMENTS`. -2. If it says the plugin is not built, run `npm install && npm run build` in `$GROK_PLUGIN_ROOT` - (this takes a minute or two) and try again. +2. The plugin ships prebuilt, so this should just work. If it does say the plugin is not built, + `dist/` is missing from the checkout: run `npm install && npm run build` in + `$GROK_PLUGIN_ROOT` (a minute or two) and try again. 3. Report what came back. For `enroll`, show the URL and the code verbatim — the user needs to type them on their phone, so do not paraphrase or reformat them. 4. If the output mentions that no public origin is configured, explain the Tailscale Serve setup: diff --git a/dist/server/index.js b/dist/server/index.js new file mode 100644 index 0000000..c87790c --- /dev/null +++ b/dist/server/index.js @@ -0,0 +1,23758 @@ +import http from "node:http"; +import crypto$1 from "node:crypto"; +import { URL as URL$1, fileURLToPath } from "node:url"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; +//#region \0rolldown/runtime.js +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 __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res); +var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); +var __exportAll = (all, no_symbols) => { + let target = {}; + for (var name in all) __defProp(target, name, { + get: all[name], + enumerable: true + }); + if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" }); + return target; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); +var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod); +//#endregion +//#region server/src/config.ts +const VERSION = "0.1.0"; +const DEFAULT_PORT = 8791; +function glanceHome() { + if (process.env.GLANCE_HOME) return path.resolve(process.env.GLANCE_HOME); + return path.join(os.homedir(), ".grok", "glance"); +} +const paths = { + get home() { + return glanceHome(); + }, + get config() { + return path.join(glanceHome(), "config.json"); + }, + get credentials() { + return path.join(glanceHome(), "credentials.json"); + }, + get authSessions() { + return path.join(glanceHome(), "auth-sessions.json"); + }, + get secret() { + return path.join(glanceHome(), "secret.key"); + }, + get adminToken() { + return path.join(glanceHome(), "admin.token"); + }, + get hookSecret() { + return path.join(glanceHome(), "hook.secret"); + }, + get events() { + return path.join(glanceHome(), "events.jsonl"); + }, + get sessions() { + return path.join(glanceHome(), "sessions.json"); + } +}; +const DEFAULTS = { + port: DEFAULT_PORT, + host: "127.0.0.1", + rpName: "grok-glance", + approval: { + mode: "off", + riskyPattern: "^(Bash|Write|Edit|MultiEdit|NotebookEdit)$", + timeoutMs: 9e4, + requireWatcher: true, + onTimeout: "allow" + }, + retainEvents: 400 +}; +function ensureHome() { + fs.mkdirSync(glanceHome(), { + recursive: true, + mode: 448 + }); + try { + fs.chmodSync(glanceHome(), 448); + } catch {} +} +/** +* The longest the daemon may hold a tool call waiting for a tap. +* +* hooks/hooks.json gives the approval hook a fixed 125s timeout, and glance-approve.mjs keeps +* 10s of that for itself. Waiting longer than this would get the script killed mid-wait, and a +* killed script never runs its fail-open path — so a hand-edited config.json is clamped rather +* than believed. +*/ +const APPROVAL_MAX_WAIT_MS = 9e4; +function clampApprovalWait(ms) { + if (!Number.isFinite(ms) || ms <= 0) return DEFAULTS.approval.timeoutMs; + return Math.min(ms, APPROVAL_MAX_WAIT_MS); +} +function loadConfig() { + ensureHome(); + let stored = {}; + try { + stored = JSON.parse(fs.readFileSync(paths.config, "utf8")); + } catch {} + const merged = { + ...DEFAULTS, + ...stored, + approval: { + ...DEFAULTS.approval, + ...stored.approval ?? {} + } + }; + merged.approval.timeoutMs = clampApprovalWait(merged.approval.timeoutMs); + if (process.env.GLANCE_PORT) { + const p = Number(process.env.GLANCE_PORT); + if (Number.isFinite(p)) merged.port = p; + } + if (process.env.GLANCE_ORIGIN) merged.origin = process.env.GLANCE_ORIGIN; + merged.rpId = merged.rpId ?? deriveRpId(merged.origin); + return merged; +} +function saveConfig(cfg) { + ensureHome(); + fs.writeFileSync(paths.config, JSON.stringify(cfg, null, 2) + "\n", { mode: 384 }); +} +/** +* The RP ID is the origin's hostname. Note that a bare IP address is not a valid RP ID, +* so a LAN address like 192.168.1.20 can never work — that is a WebAuthn rule, not ours. +*/ +function deriveRpId(origin) { + if (!origin) return void 0; + try { + const host = new URL(origin).hostname; + if (isIpAddress(host)) return void 0; + return host; + } catch { + return; + } +} +function isIpAddress(host) { + if (/^\d{1,3}(\.\d{1,3}){3}$/.test(host)) return true; + if (host.includes(":")) return true; + return false; +} +/** +* Origins we will accept assertions from. The configured public origin, plus localhost so +* that you can enrol and test on the machine itself before setting up a tunnel. +*/ +function expectedOrigins(cfg) { + const list = [`http://localhost:${cfg.port}`, `http://127.0.0.1:${cfg.port}`]; + if (cfg.origin) list.unshift(cfg.origin.replace(/\/$/, "")); + return list; +} +function expectedRpIds(cfg) { + const ids = new Set(["localhost"]); + if (cfg.rpId) ids.add(cfg.rpId); + return [...ids]; +} +//#endregion +//#region server/src/auth.ts +const SESSION_COOKIE = "glance_session"; +const CSRF_HEADER = "x-glance-csrf"; +/** Shared-secret header presented by the hook scripts on /hook/*. */ +const HOOK_HEADER = "x-glance-hook"; +function parseCookies(header) { + const out = {}; + if (!header) return out; + for (const part of header.split(";")) { + const idx = part.indexOf("="); + if (idx < 0) continue; + const key = part.slice(0, idx).trim(); + const value = part.slice(idx + 1).trim(); + if (key) out[key] = decodeURIComponent(value); + } + return out; +} +/** token.hmac(token) — lets us reject forged cookies without touching disk. */ +function signToken(token, secret) { + return `${token}.${crypto$1.createHmac("sha256", secret).update(token).digest("base64url")}`; +} +function unsignToken(signed, secret) { + if (!signed) return null; + const idx = signed.lastIndexOf("."); + if (idx <= 0) return null; + const token = signed.slice(0, idx); + const mac = signed.slice(idx + 1); + const expected = crypto$1.createHmac("sha256", secret).update(token).digest("base64url"); + const a = Buffer.from(mac); + const b = Buffer.from(expected); + if (a.length !== b.length || !crypto$1.timingSafeEqual(a, b)) return null; + return token; +} +/** +* The daemon always listens on plain http (a tunnel terminates TLS), so whether the cookie +* may carry the Secure flag depends on how the *browser* reached us. Setting Secure on a +* genuinely-http localhost connection would make the browser throw the cookie away. +*/ +function requestIsHttps(req) { + const proto = header(req, "x-forwarded-proto"); + if (proto) return proto.split(",")[0].trim() === "https"; + return false; +} +function buildSessionCookie(value, opts) { + const parts = [ + `${SESSION_COOKIE}=${encodeURIComponent(value)}`, + "Path=/", + "HttpOnly", + "SameSite=Strict", + `Max-Age=${opts.maxAgeSec}` + ]; + if (opts.secure) parts.push("Secure"); + return parts.join("; "); +} +function clearSessionCookie(secure) { + const parts = [ + `${SESSION_COOKIE}=`, + "Path=/", + "HttpOnly", + "SameSite=Strict", + "Max-Age=0" + ]; + if (secure) parts.push("Secure"); + return parts.join("; "); +} +function header(req, name) { + const value = req.headers[name]; + if (Array.isArray(value)) return value[0]; + return value; +} +/** +* Fixed-window counter. Keyed globally rather than per-IP on purpose: behind a tunnel every +* request arrives from 127.0.0.1, so per-IP buckets would be a single bucket wearing a hat. +*/ +var RateLimiter = class { + limit; + windowMs; + hits = /* @__PURE__ */ new Map(); + constructor(limit, windowMs) { + this.limit = limit; + this.windowMs = windowMs; + } + /** Returns true when the caller is still within budget. */ + allow(key) { + const now = Date.now(); + const entry = this.hits.get(key); + if (!entry || entry.resetAt <= now) { + this.hits.set(key, { + count: 1, + resetAt: now + this.windowMs + }); + return true; + } + entry.count += 1; + return entry.count <= this.limit; + } + reset(key) { + this.hits.delete(key); + } +}; +const CODE_ALPHABET = "23456789ABCDEFGHJKMNPQRSTUVWXYZ"; +const CODE_LENGTH = 8; +const CODE_TTL_MS = 10 * 6e4; +const MAX_CODE_ATTEMPTS = 5; +var EnrollmentCodes = class { + current = null; + mint() { + const bytes = crypto$1.randomBytes(CODE_LENGTH); + let code = ""; + for (let i = 0; i < CODE_LENGTH; i++) code += CODE_ALPHABET[bytes[i] % 31]; + this.current = { + code, + expiresAt: Date.now() + CODE_TTL_MS, + attempts: 0 + }; + return { + code, + expiresInMs: CODE_TTL_MS + }; + } + /** Constant-time compare. Counts the attempt, and burns the code after too many misses. */ + check(candidate) { + const entry = this.current; + if (!entry) return false; + if (entry.expiresAt <= Date.now()) { + this.current = null; + return false; + } + entry.attempts += 1; + if (entry.attempts > MAX_CODE_ATTEMPTS) { + this.current = null; + return false; + } + const a = Buffer.from(normalize(candidate)); + const b = Buffer.from(entry.code); + return a.length === b.length && crypto$1.timingSafeEqual(a, b); + } + /** + * Single use. Registration checks the code twice — once to hand out options, once to accept + * the attestation — so only the second call consumes it, otherwise a failed prompt on the + * phone would force you back to the terminal for a fresh code. + */ + consume(candidate) { + if (!this.check(candidate)) return false; + this.current = null; + return true; + } + get active() { + return !!this.current && this.current.expiresAt > Date.now(); + } +}; +function normalize(code) { + return code.trim().toUpperCase().replace(/[\s-]/g, ""); +} +//#endregion +//#region server/src/http.ts +const MAX_BODY_BYTES = 256 * 1024; +/** Headers applied to every response. The UI is entirely self-hosted, so the CSP can be strict. */ +const SECURITY_HEADERS = { + "x-content-type-options": "nosniff", + "referrer-policy": "no-referrer", + "x-frame-options": "DENY", + "cross-origin-opener-policy": "same-origin", + "content-security-policy": [ + "default-src 'self'", + "script-src 'self'", + "style-src 'self' 'unsafe-inline'", + "img-src 'self' data:", + "font-src 'self' data:", + "connect-src 'self'", + "frame-ancestors 'none'", + "base-uri 'none'", + "form-action 'none'" + ].join("; ") +}; +function responder(res) { + const send = (status, body, headers = {}) => { + if (res.headersSent) return; + res.writeHead(status, { + ...SECURITY_HEADERS, + ...headers + }); + res.end(body ?? void 0); + }; + return { + json(status, body, headers = {}) { + send(status, JSON.stringify(body), { + "content-type": "application/json; charset=utf-8", + "cache-control": "no-store", + ...headers + }); + }, + text(status, body, headers = {}) { + send(status, body, { + "content-type": "text/plain; charset=utf-8", + "cache-control": "no-store", + ...headers + }); + }, + empty(status, headers = {}) { + send(status, null, headers); + } + }; +} +async function readBody(req) { + return new Promise((resolve, reject) => { + let size = 0; + const chunks = []; + req.on("data", (chunk) => { + size += chunk.length; + if (size > MAX_BODY_BYTES) { + reject(/* @__PURE__ */ new Error("body too large")); + req.destroy(); + return; + } + chunks.push(chunk); + }); + req.on("end", () => resolve(Buffer.concat(chunks).toString("utf8"))); + req.on("error", reject); + }); +} +async function readJson(req) { + const raw = await readBody(req); + if (!raw.trim()) return null; + try { + return JSON.parse(raw); + } catch { + return null; + } +} +//#endregion +//#region server/src/static.ts +const here = path.dirname(fileURLToPath(import.meta.url)); +/** dist/server/* and dist/web/* are siblings after a build. */ +const WEB_ROOT = path.resolve(here, "..", "web"); +const TYPES = { + ".html": "text/html; charset=utf-8", + ".js": "text/javascript; charset=utf-8", + ".mjs": "text/javascript; charset=utf-8", + ".css": "text/css; charset=utf-8", + ".json": "application/json; charset=utf-8", + ".webmanifest": "application/manifest+json; charset=utf-8", + ".svg": "image/svg+xml", + ".png": "image/png", + ".ico": "image/x-icon", + ".woff2": "font/woff2" +}; +function webBuildExists() { + return fs.existsSync(path.join(WEB_ROOT, "index.html")); +} +/** +* Serve the built app. Vite fingerprints everything under /assets, so those can be cached hard +* while index.html must not be — otherwise a phone keeps a stale shell after an upgrade. +*/ +function serveStatic(urlPath, res) { + if (!webBuildExists()) { + res.writeHead(503, { + ...SECURITY_HEADERS, + "content-type": "text/plain; charset=utf-8" + }); + res.end("grok-glance: dist/web is missing. Run `npm install && npm run build`.\n"); + return; + } + const clean = decodeURIComponent(urlPath.split("?")[0]); + const candidate = path.resolve(WEB_ROOT, "." + path.posix.normalize(clean)); + let file = (candidate === WEB_ROOT || candidate.startsWith(WEB_ROOT + path.sep)) && isFile(candidate) ? candidate : ""; + if (!file) file = path.join(WEB_ROOT, "index.html"); + const ext = path.extname(file).toLowerCase(); + const isHashed = file.includes(`${path.sep}assets${path.sep}`); + try { + const body = fs.readFileSync(file); + res.writeHead(200, { + ...SECURITY_HEADERS, + "content-type": TYPES[ext] ?? "application/octet-stream", + "cache-control": isHashed ? "public, max-age=31536000, immutable" : "no-cache" + }); + res.end(body); + } catch { + res.writeHead(404, { + ...SECURITY_HEADERS, + "content-type": "text/plain; charset=utf-8" + }); + res.end("not found\n"); + } +} +function isFile(p) { + try { + return fs.statSync(p).isFile(); + } catch { + return false; + } +} +//#endregion +//#region server/src/sse.ts +/** Coalesce bursts — a single tool call can fire several hooks in a few milliseconds. */ +const THROTTLE_MS = 250; +/** +* Snapshots are whole state, so they grow with the number of agents being watched, while the +* push rate grows with it too. Past this size, slow down rather than push a phone the same +* 60 KB four times a second: nobody reads a dashboard at 4 Hz. +*/ +const LARGE_SNAPSHOT_BYTES = 24 * 1024; +const SLOW_THROTTLE_MS = 1e3; +/** Proxies and phone radios drop idle connections; a comment frame keeps them honest. */ +const HEARTBEAT_MS = 25e3; +var SseHub = class { + snapshot; + clients = /* @__PURE__ */ new Map(); + nextId = 1; + pending = false; + lastSentAt = 0; + throttleMs = THROTTLE_MS; + timer = null; + heartbeat = null; + constructor(snapshot) { + this.snapshot = snapshot; + } + /** True when at least one browser is listening — the approval broker asks before gating. */ + hasWatcher() { + return this.clients.size > 0; + } + get count() { + return this.clients.size; + } + add(res) { + res.writeHead(200, { + ...SECURITY_HEADERS, + "content-type": "text/event-stream", + "cache-control": "no-store, no-transform", + connection: "keep-alive", + "x-accel-buffering": "no" + }); + res.write(": connected\n\n"); + const client = { + id: this.nextId++, + res + }; + this.clients.set(client.id, client); + const drop = () => { + this.clients.delete(client.id); + if (this.clients.size === 0) this.stopHeartbeat(); + }; + res.on("close", drop); + res.on("error", drop); + this.send(client, "snapshot", this.snapshot()); + this.startHeartbeat(); + } + startHeartbeat() { + if (this.heartbeat) return; + this.heartbeat = setInterval(() => { + for (const client of this.clients.values()) try { + client.res.write(": ping\n\n"); + } catch { + this.clients.delete(client.id); + } + }, HEARTBEAT_MS); + this.heartbeat.unref?.(); + } + stopHeartbeat() { + if (!this.heartbeat) return; + clearInterval(this.heartbeat); + this.heartbeat = null; + } + send(client, event, data) { + this.write(client, event, JSON.stringify(data)); + } + /** Serialise once, write to every client — the payload is identical for all of them. */ + write(client, event, json) { + try { + client.res.write(`event: ${event}\ndata: ${json}\n\n`); + } catch { + this.clients.delete(client.id); + } + } + /** + * Push a fresh full snapshot, throttled. Sending the whole state rather than deltas keeps + * the client dumb: a phone that slept through twenty events still lands on the truth. + */ + publish() { + if (this.clients.size === 0) return; + if (this.pending) return; + const wait = Math.max(0, this.throttleMs - (Date.now() - this.lastSentAt)); + this.pending = true; + this.timer = setTimeout(() => { + this.pending = false; + this.lastSentAt = Date.now(); + const json = JSON.stringify(this.snapshot()); + this.throttleMs = json.length > LARGE_SNAPSHOT_BYTES ? SLOW_THROTTLE_MS : THROTTLE_MS; + for (const client of [...this.clients.values()]) this.write(client, "snapshot", json); + }, wait); + this.timer.unref?.(); + } + closeAll() { + if (this.timer) clearTimeout(this.timer); + this.stopHeartbeat(); + for (const client of this.clients.values()) try { + client.res.write("event: bye\ndata: {}\n\n"); + client.res.end(); + } catch {} + this.clients.clear(); + } +}; +//#endregion +//#region server/src/store.ts +function readJsonFile(file, fallback) { + try { + return JSON.parse(fs.readFileSync(file, "utf8")); + } catch { + return fallback; + } +} +function writeJsonFile(file, value) { + ensureHome(); + const tmp = `${file}.tmp`; + fs.writeFileSync(tmp, JSON.stringify(value, null, 2) + "\n", { mode: 384 }); + fs.renameSync(tmp, file); +} +/** HMAC key used to sign session cookies. Created once, 0600. */ +function sessionSecret() { + ensureHome(); + try { + const existing = fs.readFileSync(paths.secret); + if (existing.length >= 32) return existing; + } catch {} + const key = crypto$1.randomBytes(32); + fs.writeFileSync(paths.secret, key, { mode: 384 }); + return key; +} +/** +* Token that authorises privileged local operations (enrol, revoke, shutdown). +* Rotated on every daemon start so a leaked token dies with the process. +*/ +function rotateAdminToken() { + ensureHome(); + const token = crypto$1.randomBytes(24).toString("base64url"); + fs.writeFileSync(paths.adminToken, token + "\n", { mode: 384 }); + return token; +} +/** +* Token the hook scripts present on /hook/*. Unlike `admin.token` this is *not* rotated on +* every start: hook scripts are separate short-lived processes that read the file per +* invocation, and a rotation mid-session would 403 whatever was already in flight. +* +* It exists because `tailscale serve` proxies tailnet traffic to 127.0.0.1, so "the request +* came from loopback" says nothing about who sent it. Without this, anyone on the tailnet +* could forge timeline events and answer approval prompts. +* +* Created exclusively (`wx`) so two hooks racing on a fresh home cannot end up with +* different values — the loser re-reads the winner's file. +*/ +function hookSecret() { + ensureHome(); + for (let attempt = 0; attempt < 2; attempt++) { + try { + const existing = fs.readFileSync(paths.hookSecret, "utf8").trim(); + if (existing) return existing; + } catch {} + const token = crypto$1.randomBytes(32).toString("base64url"); + try { + fs.writeFileSync(paths.hookSecret, token + "\n", { + mode: 384, + flag: "wx" + }); + return token; + } catch {} + } + return fs.readFileSync(paths.hookSecret, "utf8").trim(); +} +/** Whatever is on disk right now, for diagnostics. Never creates the file. */ +function readHookSecretFromDisk() { + try { + return fs.readFileSync(paths.hookSecret, "utf8").trim() || null; + } catch { + return null; + } +} +function listCredentials() { + return readJsonFile(paths.credentials, []); +} +function saveCredentials(creds) { + writeJsonFile(paths.credentials, creds); +} +function addCredential(cred) { + const all = listCredentials().filter((c) => c.id !== cred.id); + all.push(cred); + saveCredentials(all); +} +function findCredential(id) { + return listCredentials().find((c) => c.id === id); +} +function touchCredential(id, counter) { + const all = listCredentials(); + const cred = all.find((c) => c.id === id); + if (!cred) return; + cred.counter = counter; + cred.lastUsedAt = Date.now(); + saveCredentials(all); +} +function revokeCredentials(idPrefix) { + const all = listCredentials(); + const keep = all.filter((c) => !c.id.startsWith(idPrefix)); + saveCredentials(keep); + const removed = all.length - keep.length; + if (removed > 0) { + const sessions = listAuthSessions().filter((s) => !s.credentialId.startsWith(idPrefix)); + writeJsonFile(paths.authSessions, sessions); + } + return removed; +} +function deviceList() { + return listCredentials().map((c) => ({ + id: c.id, + label: c.label, + createdAt: c.createdAt, + lastUsedAt: c.lastUsedAt + })); +} +function listAuthSessions() { + const now = Date.now(); + return readJsonFile(paths.authSessions, []).filter((s) => s.expiresAt > now); +} +function hashToken(token) { + return crypto$1.createHash("sha256").update(token).digest("hex"); +} +function createAuthSession(credentialId, label, ttlMs) { + const token = crypto$1.randomBytes(32).toString("base64url"); + const expiresAt = Date.now() + ttlMs; + const sessions = listAuthSessions(); + sessions.push({ + tokenHash: hashToken(token), + credentialId, + label, + createdAt: Date.now(), + expiresAt + }); + writeJsonFile(paths.authSessions, sessions); + return { + token, + expiresAt + }; +} +function lookupAuthSession(token) { + const wanted = hashToken(token); + return listAuthSessions().find((s) => { + const a = Buffer.from(s.tokenHash, "hex"); + const b = Buffer.from(wanted, "hex"); + return a.length === b.length && crypto$1.timingSafeEqual(a, b); + }); +} +function destroyAuthSession(token) { + const wanted = hashToken(token); + writeJsonFile(paths.authSessions, listAuthSessions().filter((s) => s.tokenHash !== wanted)); +} +const MAX_LOG_BYTES = 5 * 1024 * 1024; +function appendEventLog(event) { + try { + ensureHome(); + let size = 0; + try { + size = fs.statSync(paths.events).size; + } catch {} + if (size > MAX_LOG_BYTES) fs.renameSync(paths.events, `${paths.events}.1`); + fs.appendFileSync(paths.events, JSON.stringify(event) + "\n", { mode: 384 }); + } catch {} +} +/** +* The overview itself, so restarting the daemon does not blank every agent you were +* watching until each one happens to fire its next hook. Replaying the event log is not +* enough: events carry no workspace root, and a truncated ring would under-count tools. +*/ +function readSessions() { + const raw = readJsonFile(paths.sessions, []); + return Array.isArray(raw) ? raw : []; +} +function writeSessions(sessions) { + try { + writeJsonFile(paths.sessions, sessions); + } catch {} +} +/** Read back the tail of the log so a restarted daemon still has recent history. */ +function readRecentEvents(limit) { + try { + const lines = fs.readFileSync(paths.events, "utf8").split("\n").filter(Boolean).slice(-limit); + const out = []; + for (const line of lines) try { + out.push(JSON.parse(line)); + } catch {} + return out; + } catch { + return []; + } +} +//#endregion +//#region server/src/summarize.ts +/** +* Turns a raw hook payload into something you can read on a phone screen. +* +* Two jobs: pick the one field that actually says what the tool is doing, and strip anything +* that looks like a credential before it leaves the machine. +*/ +const TITLE_MAX = 180; +const DETAIL_MAX = 400; +/** +* Conservative redaction: only well-known credential shapes and explicit key=value +* assignments. Deliberately not "redact any long string" — that would mangle ordinary +* paths and hashes and make the timeline useless. +*/ +const REDACTIONS = [ + [/\b(sk|rk|pk)-[A-Za-z0-9_-]{16,}/g, "$1-[redacted]"], + [/\bxai-[A-Za-z0-9_-]{16,}/g, "xai-[redacted]"], + [/\bgh[pousr]_[A-Za-z0-9_]{16,}/g, "gh?_[redacted]"], + [/\bxox[baprs]-[A-Za-z0-9-]{10,}/g, "xox?-[redacted]"], + [/\bAKIA[0-9A-Z]{16}\b/g, "AKIA[redacted]"], + [/\bey[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{6,}/g, "[jwt redacted]"], + [/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g, "[private key redacted]"], + [/\b(authorization|bearer)\s*[:=]?\s*[A-Za-z0-9._~+/-]{16,}=*/gi, "$1 [redacted]"], + [/\b([A-Za-z0-9_]*(?:password|passwd|secret|token|api[_-]?key|access[_-]?key)[A-Za-z0-9_]*)\s*[:=]\s*("[^"]*"|'[^']*'|\S+)/gi, "$1=[redacted]"] +]; +function redact(text) { + let out = text; + for (const [pattern, replacement] of REDACTIONS) out = out.replace(pattern, replacement); + return out; +} +function clean(value, max) { + if (value === void 0 || value === null) return ""; + const collapsed = redact(typeof value === "string" ? value : JSON.stringify(value)).replace(/\s+/g, " ").trim(); + return collapsed.length > max ? collapsed.slice(0, max - 1) + "…" : collapsed; +} +function basename(p) { + const parts = p.replace(/\/+$/, "").split("/"); + return parts[parts.length - 1] || p; +} +/** Shorten a path to something that fits a phone: keep the last two segments. */ +function shortPath(p) { + if (!p) return ""; + const parts = p.replace(/\/+$/, "").split("/").filter(Boolean); + if (parts.length <= 2) return p; + return `…/${parts.slice(-2).join("/")}`; +} +/** +* Grok maps Claude Code tool names onto its own, so the input keys follow the Claude +* shapes. Anything unrecognised falls back to a JSON preview. +*/ +function summarizeTool(toolName, input) { + const obj = typeof input === "object" && input !== null ? input : {}; + const pick = (...keys) => { + for (const key of keys) { + const value = obj[key]; + if (typeof value === "string" && value.trim()) return value; + } + }; + switch (toolName) { + case "Bash": + case "BashOutput": return { + title: clean(pick("command") ?? toolName, TITLE_MAX), + detail: clean(pick("description"), DETAIL_MAX) || void 0 + }; + case "Read": + case "Write": + case "Edit": + case "MultiEdit": + case "NotebookEdit": { + const file = pick("file_path", "notebook_path", "path"); + return { + title: file ? shortPath(clean(file, TITLE_MAX)) : toolName, + detail: file ? clean(file, DETAIL_MAX) : void 0 + }; + } + case "Glob": + case "Grep": { + const pattern = pick("pattern", "query"); + const where = pick("path", "glob"); + return { + title: clean(pattern ?? toolName, TITLE_MAX), + detail: where ? clean(where, DETAIL_MAX) : void 0 + }; + } + case "WebFetch": + case "WebSearch": return { title: clean(pick("url", "query") ?? toolName, TITLE_MAX) }; + case "Task": + case "Agent": return { + title: clean(pick("description", "prompt") ?? toolName, TITLE_MAX), + detail: clean(pick("subagent_type"), DETAIL_MAX) || void 0 + }; + default: { + const first = pick("command", "file_path", "path", "url", "query", "pattern", "description"); + if (first) return { title: clean(first, TITLE_MAX) }; + const keys = Object.keys(obj); + if (!keys.length) return { title: toolName }; + return { title: clean(obj[keys[0]], TITLE_MAX) || toolName }; + } + } +} +function summarizePrompt(payload) { + return clean(payload["prompt"] ?? payload["userPrompt"] ?? payload["message"] ?? payload["text"], TITLE_MAX) || "(prompt)"; +} +function summarizeNotification(payload) { + return clean(payload["message"] ?? payload["notification"] ?? payload["text"], TITLE_MAX) || "Notification"; +} +function labelForWorkspace(workspaceRoot, cwd) { + return basename(workspaceRoot || cwd || "") || "workspace"; +} +function truncateTitle(text) { + return clean(text, TITLE_MAX); +} +function truncateDetail(text) { + return clean(text, DETAIL_MAX); +} +//#endregion +//#region server/src/state.ts +/** A session that has said nothing for this long is treated as idle, not working. */ +const STALE_WORKING_MS = 10 * 6e4; +/** Sessions quieter than this are not restored on start — they are last week's agents. */ +const RESTORE_MAX_AGE_MS = 720 * 6e4; +/** +* A PreToolUse whose PostToolUse never arrives (crash, kill, timeout) would otherwise sit in +* the running list forever, so the list is bounded and the oldest entry falls off. +*/ +const MAX_RUNNING_PER_SESSION = 8; +/** Persisting the session map on every hook would mean a file write per tool call. */ +const PERSIST_DEBOUNCE_MS = 2e3; +/** +* Which agent you want to look at first. Sorting purely by recency — the obvious choice with +* one session — makes every row jump under your thumb once four agents are working at once. +*/ +const ATTENTION_RANK = { + waiting: 0, + error: 1, + working: 2, + idle: 3, + ended: 4 +}; +const EVENT_KIND_BY_HOOK = { + SessionStart: "session_start", + SessionEnd: "session_end", + UserPromptSubmit: "prompt", + PreToolUse: "tool_start", + PostToolUse: "tool_end", + PostToolUseFailure: "tool_fail", + PermissionDenied: "permission_denied", + Stop: "turn_end", + StopFailure: "turn_error", + Notification: "notification", + SubagentStart: "subagent_start", + SubagentStop: "subagent_end", + PreCompact: "compact", + PostCompact: "compact" +}; +var GlanceState = class { + cfg; + events = []; + sessions = /* @__PURE__ */ new Map(); + /** + * sessionId|toolName -> start timestamps, oldest first, so PostToolUse can report a + * duration. An array rather than a single stamp because an agent runs tools in parallel + * and the payload carries no call id: matching FIFO within a tool name is the closest + * thing to one we have. + */ + toolStarts = /* @__PURE__ */ new Map(); + nextId = 1; + nextBadge = 1; + persistTimer = null; + listeners = /* @__PURE__ */ new Set(); + constructor(cfg) { + this.cfg = cfg; + const recent = readRecentEvents(cfg.retainEvents); + this.events = recent; + this.nextId = recent.reduce((max, e) => Math.max(max, e.id), 0) + 1; + const cutoff = Date.now() - RESTORE_MAX_AGE_MS; + for (const stored of readSessions()) { + const session = restoreSession(stored); + if (!session || session.lastActivity < cutoff) continue; + this.sessions.set(session.id, session); + this.nextBadge = Math.max(this.nextBadge, session.badge + 1); + } + } + onChange(listener) { + this.listeners.add(listener); + return () => this.listeners.delete(listener); + } + notify() { + for (const listener of this.listeners) try { + listener(); + } catch {} + } + session(id, payload) { + let existing = this.sessions.get(id); + if (!existing) { + existing = { + id, + label: labelForWorkspace(payload.workspaceRoot, payload.cwd ?? ""), + badge: this.nextBadge++, + cwd: payload.workspaceRoot ?? payload.cwd ?? "", + state: "idle", + lastActivity: Date.now(), + running: [], + counts: { + tools: 0, + failures: 0, + denials: 0 + } + }; + this.sessions.set(id, existing); + } else if (payload.workspaceRoot || payload.cwd) { + existing.label = labelForWorkspace(payload.workspaceRoot, payload.cwd ?? existing.cwd); + existing.cwd = payload.workspaceRoot ?? payload.cwd ?? existing.cwd; + } + return existing; + } + push(event) { + this.events.push(event); + this.trim(); + appendEventLog(event); + } + /** + * Evict from whichever session is using most of the ring rather than simply dropping the + * oldest event. A single agent grinding through a build would otherwise push every other + * agent's history out, and the timeline would silently become a one-agent timeline. + */ + trim() { + while (this.events.length > this.cfg.retainEvents) { + const perSession = /* @__PURE__ */ new Map(); + for (const event of this.events) perSession.set(event.sessionId, (perSession.get(event.sessionId) ?? 0) + 1); + let greediest = this.events[0].sessionId; + let most = 0; + for (const [sessionId, count] of perSession) if (count > most) { + most = count; + greediest = sessionId; + } + const oldest = this.events.findIndex((e) => e.sessionId === greediest); + this.events.splice(oldest < 0 ? 0 : oldest, 1); + } + } + /** Forget what a session had in flight — nothing survives a turn ending or a crash. */ + clearRunning(sessionId, session) { + session.running = []; + for (const key of this.toolStarts.keys()) if (key.startsWith(`${sessionId}|`)) this.toolStarts.delete(key); + } + /** + * Write the session map out. Debounced, because the alternative is a file write per hook — + * and with several agents running that is several writes a second. + */ + schedulePersist() { + if (this.persistTimer) return; + this.persistTimer = setTimeout(() => { + this.persistTimer = null; + this.persist(); + }, PERSIST_DEBOUNCE_MS); + this.persistTimer.unref?.(); + } + /** Flush that write now — called on shutdown so the last few seconds are not lost. */ + flush() { + if (this.persistTimer) { + clearTimeout(this.persistTimer); + this.persistTimer = null; + } + this.persist(); + } + persist() { + writeSessions([...this.sessions.values()].map((s) => ({ + ...s, + running: [] + }))); + } + /** + * Make sure a session is known without recording anything for it. The approval gate and the + * recorder are two separate hooks on the same PreToolUse, so the gate can easily be the + * first to hear about an agent — and an approval card that cannot say which agent is asking + * is worthless when four of them are running. + */ + ensureSession(sessionId, payload = {}) { + return this.session(sessionId, payload); + } + /** Record a raw hook payload. Returns the event it produced, if any. */ + ingest(payload) { + const hookName = payload.hookEventName ?? ""; + const kind = EVENT_KIND_BY_HOOK[hookName]; + if (!kind) return null; + const sessionId = payload.sessionId ?? "unknown"; + const session = this.session(sessionId, payload); + const now = Date.now(); + session.lastActivity = now; + const tool = typeof payload.toolName === "string" ? payload.toolName : void 0; + let title = hookName; + let detail; + let durationMs; + switch (kind) { + case "session_start": + session.state = "idle"; + title = `Session started in ${session.label}`; + detail = session.cwd || void 0; + break; + case "session_end": + session.state = "ended"; + this.clearRunning(sessionId, session); + title = "Session ended"; + break; + case "prompt": + session.state = "working"; + session.lastPrompt = summarizePrompt(payload); + title = session.lastPrompt; + break; + case "tool_start": { + const name = tool ?? "tool"; + const summary = summarizeTool(name, payload.toolInput); + session.state = "working"; + session.running.push({ + name, + title: summary.title, + startedAt: now + }); + if (session.running.length > MAX_RUNNING_PER_SESSION) session.running.shift(); + const starts = this.toolStarts.get(`${sessionId}|${name}`) ?? []; + starts.push(now); + if (starts.length > MAX_RUNNING_PER_SESSION) starts.shift(); + this.toolStarts.set(`${sessionId}|${name}`, starts); + title = summary.title; + detail = summary.detail; + break; + } + case "tool_end": + case "tool_fail": { + const name = tool ?? "tool"; + const summary = summarizeTool(name, payload.toolInput); + const key = `${sessionId}|${name}`; + const starts = this.toolStarts.get(key); + if (starts?.length) { + durationMs = now - starts.shift(); + if (!starts.length) this.toolStarts.delete(key); + } + const running = session.running.findIndex((t) => t.name === name); + if (running >= 0) session.running.splice(running, 1); + session.state = "working"; + title = summary.title; + detail = summary.detail; + if (kind === "tool_end") session.counts.tools += 1; + else { + session.counts.failures += 1; + detail = truncateDetail(String(payload["error"] ?? payload["message"] ?? "")) || detail; + } + break; + } + case "permission_denied": + session.counts.denials += 1; + title = tool ? `Permission denied: ${tool}` : "Permission denied"; + detail = summarizeTool(tool ?? "tool", payload.toolInput).title; + break; + case "turn_end": + session.state = "idle"; + this.clearRunning(sessionId, session); + title = "Turn finished"; + break; + case "turn_error": + session.state = "error"; + this.clearRunning(sessionId, session); + title = "Turn failed"; + detail = truncateDetail(String(payload["error"] ?? payload["message"] ?? "")) || void 0; + break; + case "notification": + title = summarizeNotification(payload); + break; + case "subagent_start": + title = "Subagent started"; + detail = truncateDetail(String(payload["description"] ?? payload["subagentType"] ?? "")) || void 0; + break; + case "subagent_end": + title = "Subagent finished"; + break; + case "compact": + title = hookName === "PreCompact" ? "Compacting conversation" : "Compaction done"; + break; + default: break; + } + const event = { + id: this.nextId++, + ts: now, + sessionId, + kind, + tool, + title: truncateTitle(title), + detail, + durationMs + }; + this.push(event); + this.schedulePersist(); + this.notify(); + return event; + } + /** Record something the daemon itself decided, e.g. an approval outcome. */ + record(sessionId, kind, title, opts = {}) { + const now = Date.now(); + const session = this.sessions.get(sessionId); + if (session) { + session.lastActivity = now; + if (kind === "approval_request") session.state = "waiting"; + else if (kind === "approval_allowed" || kind === "approval_denied") session.state = "working"; + } + const event = { + id: this.nextId++, + ts: now, + sessionId, + kind, + tool: opts.tool, + title: truncateTitle(title), + detail: opts.detail + }; + this.push(event); + this.schedulePersist(); + this.notify(); + return event; + } + effectiveState(session, now) { + if (session.state === "working" && now - session.lastActivity > STALE_WORKING_MS) return "idle"; + return session.state; + } + snapshot(pending) { + const now = Date.now(); + const waiting = new Set(pending.map((p) => p.sessionId)); + return { + version: VERSION, + sessions: [...this.sessions.values()].map((s) => ({ + ...s, + state: waiting.has(s.id) ? "waiting" : this.effectiveState(s, now), + running: s.running.filter((t) => now - t.startedAt < STALE_WORKING_MS) + })).sort((a, b) => ATTENTION_RANK[a.state] - ATTENTION_RANK[b.state] || a.badge - b.badge), + events: [...this.events].sort((a, b) => b.ts - a.ts || b.id - a.id), + pending, + approval: this.cfg.approval + }; + } + sessionLabel(sessionId) { + return this.sessions.get(sessionId)?.label ?? "workspace"; + } + sessionBadge(sessionId) { + return this.sessions.get(sessionId)?.badge ?? 0; + } + /** How many agents are in each state — what `glance status` prints from the terminal. */ + stateSummary(pending = []) { + const now = Date.now(); + const waiting = new Set(pending.map((p) => p.sessionId)); + const counts = { + working: 0, + idle: 0, + waiting: 0, + error: 0, + ended: 0 + }; + for (const session of this.sessions.values()) { + const state = waiting.has(session.id) ? "waiting" : this.effectiveState(session, now); + counts[state] += 1; + } + return counts; + } + get sessionCount() { + return this.sessions.size; + } + get eventCount() { + return this.events.length; + } +}; +/** +* Accept a session read back from disk, or reject it. Written by a previous version, edited +* by hand, truncated by a full disk — none of that may take the daemon down, and a session +* with a broken shape is better dropped than rendered as `undefined` on a phone. +*/ +function restoreSession(raw) { + if (typeof raw !== "object" || raw === null) return null; + const s = raw; + if (typeof s.id !== "string" || !s.id) return null; + if (typeof s.badge !== "number" || !Number.isFinite(s.badge)) return null; + const counts = s.counts ?? { + tools: 0, + failures: 0, + denials: 0 + }; + return { + id: s.id, + label: typeof s.label === "string" && s.label ? s.label : "workspace", + badge: Math.max(1, Math.floor(s.badge)), + cwd: typeof s.cwd === "string" ? s.cwd : "", + state: s.state && s.state in ATTENTION_RANK ? s.state : "idle", + lastActivity: typeof s.lastActivity === "number" ? s.lastActivity : 0, + lastPrompt: typeof s.lastPrompt === "string" ? s.lastPrompt : void 0, + running: [], + counts: { + tools: Number(counts.tools) || 0, + failures: Number(counts.failures) || 0, + denials: Number(counts.denials) || 0 + } + }; +} +//#endregion +//#region server/src/approvals.ts +/** +* Holds a PreToolUse hook open while your phone decides. +* +* Every path that is not an explicit tap is designed to get out of the way: approval off, +* tool not risky, nobody watching, or the request timing out all resolve immediately so a +* dashboard can never become the reason your agent stalls. +*/ +var ApprovalBroker = class { + cfg; + state; + hasWatcher; + waiters = /* @__PURE__ */ new Map(); + constructor(cfg, state, hasWatcher) { + this.cfg = cfg; + this.state = state; + this.hasWatcher = hasWatcher; + } + gates(toolName) { + const { mode, riskyPattern } = this.cfg.approval; + if (mode === "off") return false; + if (mode === "all") return true; + try { + return new RegExp(riskyPattern).test(toolName); + } catch { + return false; + } + } + /** + * Soonest to expire first. With one agent that is the same as oldest-first; with four it is + * the difference between answering the call that is about to time out and answering the one + * that happened to ask first. + */ + pending() { + return [...this.waiters.values()].map((w) => w.approval).sort((a, b) => a.expiresAt - b.expiresAt || a.createdAt - b.createdAt); + } + async request(payload) { + const tool = typeof payload.toolName === "string" ? payload.toolName : "tool"; + if (!this.gates(tool)) return { decision: "allow" }; + if (this.cfg.approval.requireWatcher && !this.hasWatcher()) return { decision: "allow" }; + const sessionId = payload.sessionId ?? "unknown"; + const session = this.state.ensureSession(sessionId, payload); + const summary = summarizeTool(tool, payload.toolInput); + const now = Date.now(); + const approval = { + id: crypto$1.randomBytes(9).toString("base64url"), + sessionId, + sessionLabel: session.label, + sessionBadge: session.badge, + tool, + title: summary.title, + detail: summary.detail, + createdAt: now, + expiresAt: now + this.cfg.approval.timeoutMs + }; + this.state.record(sessionId, "approval_request", `Waiting on you: ${tool}`, { + tool, + detail: summary.title + }); + return new Promise((resolve) => { + const timer = setTimeout(() => { + this.waiters.delete(approval.id); + const onTimeout = this.cfg.approval.onTimeout; + this.state.record(sessionId, "approval_expired", onTimeout === "deny" ? `No answer in time - denied ${tool}` : `No answer in time - allowed ${tool}`, { + tool, + detail: summary.title + }); + resolve(onTimeout === "deny" ? { + decision: "deny", + reason: "grok-glance: no answer from your device in time" + } : { decision: "allow" }); + }, this.cfg.approval.timeoutMs); + timer.unref?.(); + this.waiters.set(approval.id, { + approval, + timer, + settle: (decision) => resolve(decision) + }); + }); + } + /** Called by the API when you tap Approve or Deny. */ + resolve(id, decision, by) { + const waiter = this.waiters.get(id); + if (!waiter) return false; + clearTimeout(waiter.timer); + this.waiters.delete(id); + const { approval } = waiter; + this.state.record(approval.sessionId, decision === "allow" ? "approval_allowed" : "approval_denied", decision === "allow" ? `Approved ${approval.tool} from ${by}` : `Denied ${approval.tool} from ${by}`, { + tool: approval.tool, + detail: approval.title + }); + waiter.settle(decision === "allow" ? { decision: "allow" } : { + decision: "deny", + reason: `Denied from grok-glance (${by})` + }); + return true; + } + /** Resolve everything as allow — used on shutdown so no hook is left hanging. */ + drain() { + for (const [id, waiter] of this.waiters) { + clearTimeout(waiter.timer); + this.waiters.delete(id); + waiter.settle({ decision: "allow" }); + } + } +}; +//#endregion +//#region node_modules/@hexagon/base64/src/base64.js +const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", charsUrl = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", genLookup = (target) => { + const lookupTemp = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); + const len = 64; + for (let i = 0; i < len; i++) lookupTemp[target.charCodeAt(i)] = i; + return lookupTemp; +}, lookup = genLookup(chars), lookupUrl = genLookup(charsUrl); +/** +* Pre-calculated regexes for validating base64 and base64url +*/ +const base64UrlPattern = /^[-A-Za-z0-9\-_]*$/; +const base64Pattern = /^[-A-Za-z0-9+/]*={0,3}$/; +/** +* @namespace base64 +*/ +const base64 = {}; +/** +* Convenience function for converting a base64 encoded string to an ArrayBuffer instance +* @public +* +* @param {string} data - Base64 representation of data +* @param {boolean} [urlMode] - If set to true, URL mode string will be expected +* @returns {ArrayBuffer} - Decoded data +*/ +base64.toArrayBuffer = (data, urlMode) => { + const len = data.length; + let bufferLength = data.length * .75, i, p = 0, encoded1, encoded2, encoded3, encoded4; + if (data[data.length - 1] === "=") { + bufferLength--; + if (data[data.length - 2] === "=") bufferLength--; + } + const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer), target = urlMode ? lookupUrl : lookup; + for (i = 0; i < len; i += 4) { + encoded1 = target[data.charCodeAt(i)]; + encoded2 = target[data.charCodeAt(i + 1)]; + encoded3 = target[data.charCodeAt(i + 2)]; + encoded4 = target[data.charCodeAt(i + 3)]; + bytes[p++] = encoded1 << 2 | encoded2 >> 4; + bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; + bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; + } + return arraybuffer; +}; +/** +* Convenience function for creating a base64 encoded string from an ArrayBuffer instance +* @public +* +* @param {ArrayBuffer} arrBuf - ArrayBuffer to be encoded +* @param {boolean} [urlMode] - If set to true, URL mode string will be returned +* @returns {string} - Base64 representation of data +*/ +base64.fromArrayBuffer = (arrBuf, urlMode) => { + const bytes = new Uint8Array(arrBuf); + let i, result = ""; + const len = bytes.length, target = urlMode ? charsUrl : chars; + for (i = 0; i < len; i += 3) { + result += target[bytes[i] >> 2]; + result += target[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4]; + result += target[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6]; + result += target[bytes[i + 2] & 63]; + } + const remainder = len % 3; + if (remainder === 2) result = result.substring(0, result.length - 1) + (urlMode ? "" : "="); + else if (remainder === 1) result = result.substring(0, result.length - 2) + (urlMode ? "" : "=="); + return result; +}; +/** +* Convenience function for converting base64 to string +* @public +* +* @param {string} str - Base64 encoded string to be decoded +* @param {boolean} [urlMode] - If set to true, URL mode string will be expected +* @returns {string} - Decoded string +*/ +base64.toString = (str, urlMode) => { + return new TextDecoder().decode(base64.toArrayBuffer(str, urlMode)); +}; +/** +* Convenience function for converting a javascript string to base64 +* @public +* +* @param {string} str - String to be converted to base64 +* @param {boolean} [urlMode] - If set to true, URL mode string will be returned +* @returns {string} - Base64 encoded string +*/ +base64.fromString = (str, urlMode) => { + return base64.fromArrayBuffer(new TextEncoder().encode(str), urlMode); +}; +/** +* Function to validate base64 +* @public +* @param {string} encoded - Base64 or Base64url encoded data +* @param {boolean} [urlMode] - If set to true, base64url will be expected +* @returns {boolean} - Valid base64/base64url? +*/ +base64.validate = (encoded, urlMode) => { + if (!(typeof encoded === "string" || encoded instanceof String)) return false; + try { + return urlMode ? base64UrlPattern.test(encoded) : base64Pattern.test(encoded); + } catch (_e) { + return false; + } +}; +base64.base64 = base64; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoBase64URL.js +/** +* A runtime-agnostic collection of methods for working with Base64URL encoding +* @module +*/ +/** +* Decode from a Base64URL-encoded string to an ArrayBuffer. Best used when converting a +* credential ID from a JSON string to an ArrayBuffer, like in allowCredentials or +* excludeCredentials. +* +* @param buffer Value to decode from base64 +* @param to (optional) The decoding to use, in case it's desirable to decode from base64 instead +*/ +function toBuffer(base64urlString, from = "base64url") { + const _buffer = base64.toArrayBuffer(base64urlString, from === "base64url"); + return new Uint8Array(_buffer); +} +/** +* Encode the given array buffer into a Base64URL-encoded string. Ideal for converting various +* credential response ArrayBuffers to string for sending back to the server as JSON. +* +* @param buffer Value to encode to base64 +* @param to (optional) The encoding to use, in case it's desirable to encode to base64 instead +*/ +function fromBuffer(buffer, to = "base64url") { + /** + * Gracefully handle Uint8Array subclass types, like Node's Buffer, that can have a large + * ArrayBuffer backing it. + */ + const _normalized = new Uint8Array(buffer); + return base64.fromArrayBuffer(_normalized.buffer, to === "base64url"); +} +/** +* Convert a base64url string into base64 +*/ +function toBase64(base64urlString) { + const fromBase64Url = base64.toArrayBuffer(base64urlString, true); + return base64.fromArrayBuffer(fromBase64Url); +} +/** +* Decode a base64url string into its original UTF-8 string +*/ +function toUTF8String$1(base64urlString) { + return base64.toString(base64urlString, true); +} +/** +* Confirm that the string is encoded into base64 +*/ +function isBase64(input) { + return base64.validate(input, false); +} +/** +* Confirm that the string is encoded into base64url, with support for optional padding +*/ +function isBase64URL(input) { + input = trimPadding(input); + return base64.validate(input, true); +} +/** +* Remove optional padding from a base64url-encoded string +*/ +function trimPadding(input) { + return input.replace(/=/g, ""); +} +//#endregion +//#region node_modules/@levischuck/tiny-cbor/esm/cbor/cbor_internal.js +function decodeLength(data, argument, index) { + if (argument < 24) return [argument, 1]; + const remainingDataLength = data.byteLength - index - 1; + const view = new DataView(data.buffer, index + 1); + let output; + let bytes = 0; + switch (argument) { + case 24: + if (remainingDataLength > 0) { + output = view.getUint8(0); + bytes = 2; + } + break; + case 25: + if (remainingDataLength > 1) { + output = view.getUint16(0, false); + bytes = 3; + } + break; + case 26: + if (remainingDataLength > 3) { + output = view.getUint32(0, false); + bytes = 5; + } + break; + case 27: + if (remainingDataLength > 7) { + const bigOutput = view.getBigUint64(0, false); + if (bigOutput >= 24n && bigOutput <= Number.MAX_SAFE_INTEGER) return [Number(bigOutput), 9]; + } + break; + } + if (output && output >= 24) return [output, bytes]; + throw new Error("Length not supported or not well formed"); +} +function encodeLength(major, argument) { + const majorEncoded = major << 5; + if (argument < 0) throw new Error("CBOR Data Item argument must not be negative"); + let bigintArgument; + if (typeof argument == "number") { + if (!Number.isInteger(argument)) throw new Error("CBOR Data Item argument must be an integer"); + bigintArgument = BigInt(argument); + } else bigintArgument = argument; + if (major == 1) { + if (bigintArgument == 0n) throw new Error("CBOR Data Item argument cannot be zero when negative"); + bigintArgument = bigintArgument - 1n; + } + if (bigintArgument > 18446744073709551615n) throw new Error("CBOR number out of range"); + const buffer = new Uint8Array(8); + new DataView(buffer.buffer).setBigUint64(0, bigintArgument, false); + if (bigintArgument <= 23) return [majorEncoded | buffer[7]]; + else if (bigintArgument <= 255) return [majorEncoded | 24, buffer[7]]; + else if (bigintArgument <= 65535) return [majorEncoded | 25, ...buffer.slice(6)]; + else if (bigintArgument <= 4294967295) return [majorEncoded | 26, ...buffer.slice(4)]; + else return [majorEncoded | 27, ...buffer]; +} +//#endregion +//#region node_modules/@levischuck/tiny-cbor/esm/cbor/cbor.js +/** +* A value which is wrapped with a CBOR Tag. +* Several tags are registered with defined meanings like 0 for a date string. +* These meanings are **not interpreted** when decoded or encoded. +* +* This class is an immutable record. +* If the tag number or value needs to change, then construct a new tag +*/ +var CBORTag = class { + /** + * Wrap a value with a tag number. + * When encoded, this tag will be attached to the value. + * + * @param tag Tag number + * @param value Wrapped value + */ + constructor(tag, value) { + Object.defineProperty(this, "tagId", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "tagValue", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.tagId = tag; + this.tagValue = value; + } + /** + * Read the tag number + */ + get tag() { + return this.tagId; + } + /** + * Read the value + */ + get value() { + return this.tagValue; + } +}; +function decodeUnsignedInteger(data, argument, index) { + return decodeLength(data, argument, index); +} +function decodeNegativeInteger(data, argument, index) { + const [value, length] = decodeUnsignedInteger(data, argument, index); + return [-value - 1, length]; +} +function decodeByteString(data, argument, index) { + const [lengthValue, lengthConsumed] = decodeLength(data, argument, index); + const dataStartIndex = index + lengthConsumed; + return [new Uint8Array(data.buffer.slice(dataStartIndex, dataStartIndex + lengthValue)), lengthConsumed + lengthValue]; +} +const TEXT_DECODER = new TextDecoder(); +function decodeString(data, argument, index) { + const [value, length] = decodeByteString(data, argument, index); + return [TEXT_DECODER.decode(value), length]; +} +function decodeArray(data, argument, index) { + if (argument === 0) return [[], 1]; + const [length, lengthConsumed] = decodeLength(data, argument, index); + let consumedLength = lengthConsumed; + const value = []; + for (let i = 0; i < length; i++) { + if (data.byteLength - index - consumedLength <= 0) throw new Error("array is not supported or well formed"); + const [decodedValue, consumed] = decodeNext(data, index + consumedLength); + value.push(decodedValue); + consumedLength += consumed; + } + return [value, consumedLength]; +} +const MAP_ERROR = "Map is not supported or well formed"; +function decodeMap(data, argument, index) { + if (argument === 0) return [/* @__PURE__ */ new Map(), 1]; + const [length, lengthConsumed] = decodeLength(data, argument, index); + let consumedLength = lengthConsumed; + const result = /* @__PURE__ */ new Map(); + for (let i = 0; i < length; i++) { + let remainingDataLength = data.byteLength - index - consumedLength; + if (remainingDataLength <= 0) throw new Error(MAP_ERROR); + const [key, keyConsumed] = decodeNext(data, index + consumedLength); + consumedLength += keyConsumed; + remainingDataLength -= keyConsumed; + if (remainingDataLength <= 0) throw new Error(MAP_ERROR); + if (typeof key !== "string" && typeof key !== "number") throw new Error(MAP_ERROR); + if (result.has(key)) throw new Error(MAP_ERROR); + const [value, valueConsumed] = decodeNext(data, index + consumedLength); + consumedLength += valueConsumed; + result.set(key, value); + } + return [result, consumedLength]; +} +function decodeFloat16(data, index) { + if (index + 3 > data.byteLength) throw new Error("CBOR stream ended before end of Float 16"); + const result = data.getUint16(index + 1, false); + if (result == 31744) return [Infinity, 3]; + else if (result == 32256) return [NaN, 3]; + else if (result == 64512) return [-Infinity, 3]; + throw new Error("Float16 data is unsupported"); +} +function decodeFloat32(data, index) { + if (index + 5 > data.byteLength) throw new Error("CBOR stream ended before end of Float 32"); + return [data.getFloat32(index + 1, false), 5]; +} +function decodeFloat64(data, index) { + if (index + 9 > data.byteLength) throw new Error("CBOR stream ended before end of Float 64"); + return [data.getFloat64(index + 1, false), 9]; +} +function decodeTag(data, argument, index) { + const [tag, tagBytes] = decodeLength(data, argument, index); + const [value, valueBytes] = decodeNext(data, index + tagBytes); + return [new CBORTag(tag, value), tagBytes + valueBytes]; +} +function decodeNext(data, index) { + if (index >= data.byteLength) throw new Error("CBOR stream ended before tag value"); + const byte = data.getUint8(index); + const majorType = byte >> 5; + const argument = byte & 31; + switch (majorType) { + case 0: return decodeUnsignedInteger(data, argument, index); + case 1: return decodeNegativeInteger(data, argument, index); + case 2: return decodeByteString(data, argument, index); + case 3: return decodeString(data, argument, index); + case 4: return decodeArray(data, argument, index); + case 5: return decodeMap(data, argument, index); + case 6: return decodeTag(data, argument, index); + case 7: switch (argument) { + case 20: return [false, 1]; + case 21: return [true, 1]; + case 22: return [null, 1]; + case 23: return [void 0, 1]; + case 25: return decodeFloat16(data, index); + case 26: return decodeFloat32(data, index); + case 27: return decodeFloat64(data, index); + } + } + throw new Error(`Unsupported or not well formed at ${index}`); +} +function encodeSimple(data) { + if (data === true) return 245; + else if (data === false) return 244; + else if (data === null) return 246; + return 247; +} +function encodeFloat(data) { + if (Math.fround(data) == data || !Number.isFinite(data) || Number.isNaN(data)) { + const output = new Uint8Array(5); + output[0] = 250; + new DataView(output.buffer).setFloat32(1, data, false); + return output; + } else { + const output = new Uint8Array(9); + output[0] = 251; + new DataView(output.buffer).setFloat64(1, data, false); + return output; + } +} +function encodeNumber(data) { + if (typeof data == "number") { + if (Number.isSafeInteger(data)) if (data < 0) return encodeLength(1, Math.abs(data)); + else return encodeLength(0, data); + return [encodeFloat(data)]; + } else if (data < 0n) return encodeLength(1, data * -1n); + else return encodeLength(0, data); +} +const ENCODER = new TextEncoder(); +function encodeString(data, output) { + output.push(...encodeLength(3, data.length)); + output.push(ENCODER.encode(data)); +} +function encodeBytes(data, output) { + output.push(...encodeLength(2, data.length)); + output.push(data); +} +function encodeArray(data, output) { + output.push(...encodeLength(4, data.length)); + for (const element of data) encodePartialCBOR(element, output); +} +function encodeMap(data, output) { + output.push(new Uint8Array(encodeLength(5, data.size))); + for (const [key, value] of data.entries()) { + encodePartialCBOR(key, output); + encodePartialCBOR(value, output); + } +} +function encodeTag(tag, output) { + output.push(...encodeLength(6, tag.tag)); + encodePartialCBOR(tag.value, output); +} +function encodePartialCBOR(data, output) { + if (typeof data == "boolean" || data === null || data == void 0) { + output.push(encodeSimple(data)); + return; + } + if (typeof data == "number" || typeof data == "bigint") { + output.push(...encodeNumber(data)); + return; + } + if (typeof data == "string") { + encodeString(data, output); + return; + } + if (data instanceof Uint8Array) { + encodeBytes(data, output); + return; + } + if (Array.isArray(data)) { + encodeArray(data, output); + return; + } + if (data instanceof Map) { + encodeMap(data, output); + return; + } + if (data instanceof CBORTag) { + encodeTag(data, output); + return; + } + throw new Error("Not implemented"); +} +/** +* Like {decodeCBOR}, but the length of the data is unknown and there is likely +* more -- possibly unrelated non-CBOR -- data afterwards. +* +* Examples: +* +* ```ts +* import {decodePartialCBOR} from './cbor.ts' +* decodePartialCBOR(new Uint8Array([1, 2, 245, 3, 4]), 2) +* // returns [true, 1] +* // It did not decode the leading [1, 2] or trailing [3, 4] +* ``` +* +* @param data a data stream to read data from +* @param index where to start reading in the data stream +* @returns a tuple of the value followed by bytes read. +* @throws {Error} +* When the data stream ends early or the CBOR data is not well formed +*/ +function decodePartialCBOR(data, index) { + if (data.byteLength === 0 || data.byteLength <= index || index < 0) throw new Error("No data"); + if (data instanceof Uint8Array) return decodeNext(new DataView(data.buffer), index); + else if (data instanceof ArrayBuffer) return decodeNext(new DataView(data), index); + return decodeNext(data, index); +} +/** +* Encode a supported structure to a CBOR byte string. +* +* Example: +* +* ```ts +* import {encodeCBOR, CBORType, CBORTag} from './cbor.ts' +* encodeCBOR(new Map([ +* ["key", "value"], +* [1, "another value"] +* ])); +* // returns new Uint8Array([162, 99, 107, 101, 121, 101, 118, 97, 108, 117, 101, 1, 109, 97, 110, 111, 116, 104, 101, 114, 32 118, 97, 108, 117, 101]) +* +* encodeCBOR(new CBORTag(1234, "hello")) +* // returns new UInt8Array([217, 4, 210, 101, 104, 101, 108, 108, 111]) +* ``` +* +* @param data Data to encode +* @returns A byte string as a Uint8Array +* @throws Error +* if unsupported data is found during encoding +*/ +function encodeCBOR(data) { + const results = []; + encodePartialCBOR(data, results); + let length = 0; + for (const result of results) if (typeof result == "number") length += 1; + else length += result.length; + const output = new Uint8Array(length); + let index = 0; + for (const result of results) if (typeof result == "number") { + output[index] = result; + index += 1; + } else { + output.set(result, index); + index += result.length; + } + return output; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCBOR.js +/** +* A runtime-agnostic collection of methods for working with CBOR encoding +* @module +*/ +/** +* Whatever CBOR encoder is used should keep CBOR data the same length when data is re-encoded +* +* MOST CRITICALLY, this means the following needs to be true of whatever CBOR library we use: +* - CBOR Map type values MUST decode to JavaScript Maps +* - CBOR tag 64 (uint8 Typed Array) MUST NOT be used when encoding Uint8Arrays back to CBOR +* +* So long as these requirements are maintained, then CBOR sequences can be encoded and decoded +* freely while maintaining their lengths for the most accurate pointer movement across them. +*/ +/** +* Decode and return the first item in a sequence of CBOR-encoded values +* +* @param input The CBOR data to decode +* @param asObject (optional) Whether to convert any CBOR Maps into JavaScript Objects. Defaults to +* `false` +*/ +function decodeFirst(input) { + const [first] = decodePartialCBOR(new Uint8Array(input), 0); + return first; +} +/** +* Encode data to CBOR +*/ +function encode$1(input) { + return encodeCBOR(input); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/cose.js +/** +* A type guard for determining if a COSE public key is an OKP key pair +*/ +function isCOSEPublicKeyOKP(cosePublicKey) { + const kty = cosePublicKey.get(COSEKEYS.kty); + return isCOSEKty(kty) && kty === COSEKTY.OKP; +} +/** +* A type guard for determining if a COSE public key is an EC2 key pair +*/ +function isCOSEPublicKeyEC2(cosePublicKey) { + const kty = cosePublicKey.get(COSEKEYS.kty); + return isCOSEKty(kty) && kty === COSEKTY.EC2; +} +/** +* A type guard for determining if a COSE public key is an RSA key pair +*/ +function isCOSEPublicKeyRSA(cosePublicKey) { + const kty = cosePublicKey.get(COSEKEYS.kty); + return isCOSEKty(kty) && kty === COSEKTY.RSA; +} +/** +* COSE Keys +* +* https://www.iana.org/assignments/cose/cose.xhtml#key-common-parameters +* https://www.iana.org/assignments/cose/cose.xhtml#key-type-parameters +*/ +var COSEKEYS; +(function(COSEKEYS) { + COSEKEYS[COSEKEYS["kty"] = 1] = "kty"; + COSEKEYS[COSEKEYS["alg"] = 3] = "alg"; + COSEKEYS[COSEKEYS["crv"] = -1] = "crv"; + COSEKEYS[COSEKEYS["x"] = -2] = "x"; + COSEKEYS[COSEKEYS["y"] = -3] = "y"; + COSEKEYS[COSEKEYS["n"] = -1] = "n"; + COSEKEYS[COSEKEYS["e"] = -2] = "e"; +})(COSEKEYS || (COSEKEYS = {})); +/** +* COSE Key Types +* +* https://www.iana.org/assignments/cose/cose.xhtml#key-type +*/ +var COSEKTY; +(function(COSEKTY) { + COSEKTY[COSEKTY["OKP"] = 1] = "OKP"; + COSEKTY[COSEKTY["EC2"] = 2] = "EC2"; + COSEKTY[COSEKTY["RSA"] = 3] = "RSA"; +})(COSEKTY || (COSEKTY = {})); +function isCOSEKty(kty) { + return Object.values(COSEKTY).indexOf(kty) >= 0; +} +/** +* COSE Curves +* +* https://www.iana.org/assignments/cose/cose.xhtml#elliptic-curves +*/ +var COSECRV; +(function(COSECRV) { + COSECRV[COSECRV["P256"] = 1] = "P256"; + COSECRV[COSECRV["P384"] = 2] = "P384"; + COSECRV[COSECRV["P521"] = 3] = "P521"; + COSECRV[COSECRV["ED25519"] = 6] = "ED25519"; + COSECRV[COSECRV["SECP256K1"] = 8] = "SECP256K1"; +})(COSECRV || (COSECRV = {})); +function isCOSECrv(crv) { + return Object.values(COSECRV).indexOf(crv) >= 0; +} +/** +* COSE Algorithms +* +* https://www.iana.org/assignments/cose/cose.xhtml#algorithms +*/ +var COSEALG; +(function(COSEALG) { + COSEALG[COSEALG["ES256"] = -7] = "ES256"; + COSEALG[COSEALG["EdDSA"] = -8] = "EdDSA"; + COSEALG[COSEALG["ES384"] = -35] = "ES384"; + COSEALG[COSEALG["ES512"] = -36] = "ES512"; + COSEALG[COSEALG["PS256"] = -37] = "PS256"; + COSEALG[COSEALG["PS384"] = -38] = "PS384"; + COSEALG[COSEALG["PS512"] = -39] = "PS512"; + COSEALG[COSEALG["ES256K"] = -47] = "ES256K"; + COSEALG[COSEALG["RS256"] = -257] = "RS256"; + COSEALG[COSEALG["RS384"] = -258] = "RS384"; + COSEALG[COSEALG["RS512"] = -259] = "RS512"; + COSEALG[COSEALG["RS1"] = -65535] = "RS1"; +})(COSEALG || (COSEALG = {})); +function isCOSEAlg(alg) { + return Object.values(COSEALG).indexOf(alg) >= 0; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoAlg.js +/** +* Convert a COSE alg ID into a corresponding string value that WebCrypto APIs expect +*/ +function mapCoseAlgToWebCryptoAlg(alg) { + if ([COSEALG.RS1].indexOf(alg) >= 0) return "SHA-1"; + else if ([ + COSEALG.ES256, + COSEALG.PS256, + COSEALG.RS256 + ].indexOf(alg) >= 0) return "SHA-256"; + else if ([ + COSEALG.ES384, + COSEALG.PS384, + COSEALG.RS384 + ].indexOf(alg) >= 0) return "SHA-384"; + else if ([ + COSEALG.ES512, + COSEALG.PS512, + COSEALG.RS512, + COSEALG.EdDSA + ].indexOf(alg) >= 0) return "SHA-512"; + throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto alg`); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getWebCrypto.js +let webCrypto = void 0; +/** +* Try to get an instance of the Crypto API from the current runtime. Should support Node, +* as well as others, like Deno, that implement Web APIs. +*/ +function getWebCrypto() { + return new Promise((resolve, reject) => { + if (webCrypto) return resolve(webCrypto); + /** + * Naively attempt to access Crypto as a global object, which popular ESM-centric run-times + * support (and Node v20+) + */ + const _globalThisCrypto = _getWebCryptoInternals.stubThisGlobalThisCrypto(); + if (_globalThisCrypto) { + webCrypto = _globalThisCrypto; + return resolve(webCrypto); + } + return reject(new MissingWebCrypto()); + }); +} +var MissingWebCrypto = class extends Error { + constructor() { + super("An instance of the Crypto API could not be located"); + this.name = "MissingWebCrypto"; + } +}; +const _getWebCryptoInternals = { + stubThisGlobalThisCrypto: () => globalThis.crypto, + setCachedCrypto: (newCrypto) => { + webCrypto = newCrypto; + } +}; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/digest.js +/** +* Generate a digest of the provided data. +* +* @param data The data to generate a digest of +* @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm +*/ +async function digest(data, algorithm) { + const WebCrypto = await getWebCrypto(); + const subtleAlgorithm = mapCoseAlgToWebCryptoAlg(algorithm); + const hashed = await WebCrypto.subtle.digest(subtleAlgorithm, data); + return new Uint8Array(hashed); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/getRandomValues.js +/** +* Fill up the provided bytes array with random bytes equal to its length. +* +* @returns the same bytes array passed into the method +*/ +async function getRandomValues(array) { + (await getWebCrypto()).getRandomValues(array); + return array; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/importKey.js +async function importKey(opts) { + const WebCrypto = await getWebCrypto(); + const { keyData, algorithm } = opts; + return WebCrypto.subtle.importKey("jwk", keyData, algorithm, false, ["verify"]); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyEC2.js +/** +* Verify a signature using an EC2 public key +*/ +async function verifyEC2(opts) { + const { cosePublicKey, signature, data, shaHashOverride } = opts; + const WebCrypto = await getWebCrypto(); + const alg = cosePublicKey.get(COSEKEYS.alg); + const crv = cosePublicKey.get(COSEKEYS.crv); + const x = cosePublicKey.get(COSEKEYS.x); + const y = cosePublicKey.get(COSEKEYS.y); + if (!alg) throw new Error("Public key was missing alg (EC2)"); + if (!crv) throw new Error("Public key was missing crv (EC2)"); + if (!x) throw new Error("Public key was missing x (EC2)"); + if (!y) throw new Error("Public key was missing y (EC2)"); + let _crv; + if (crv === COSECRV.P256) _crv = "P-256"; + else if (crv === COSECRV.P384) _crv = "P-384"; + else if (crv === COSECRV.P521) _crv = "P-521"; + else throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`); + const key = await importKey({ + keyData: { + kty: "EC", + crv: _crv, + x: fromBuffer(x), + y: fromBuffer(y), + ext: false + }, + algorithm: { + /** + * Note to future self: you can't use `mapCoseAlgToWebCryptoKeyAlgName()` here because some + * leaf certs from actual devices specified an RSA SHA value for `alg` (e.g. `-257`) which + * would then map here to `'RSASSA-PKCS1-v1_5'`. We always want `'ECDSA'` here so we'll + * hard-code this. + */ + name: "ECDSA", + namedCurve: _crv + } + }); + let subtleAlg = mapCoseAlgToWebCryptoAlg(alg); + if (shaHashOverride) subtleAlg = mapCoseAlgToWebCryptoAlg(shaHashOverride); + const verifyAlgorithm = { + name: "ECDSA", + hash: { name: subtleAlg } + }; + return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/mapCoseAlgToWebCryptoKeyAlgName.js +/** +* Convert a COSE alg ID into a corresponding key algorithm string value that WebCrypto APIs expect +*/ +function mapCoseAlgToWebCryptoKeyAlgName(alg) { + if ([COSEALG.EdDSA].indexOf(alg) >= 0) return "Ed25519"; + else if ([ + COSEALG.ES256, + COSEALG.ES384, + COSEALG.ES512, + COSEALG.ES256K + ].indexOf(alg) >= 0) return "ECDSA"; + else if ([ + COSEALG.RS256, + COSEALG.RS384, + COSEALG.RS512, + COSEALG.RS1 + ].indexOf(alg) >= 0) return "RSASSA-PKCS1-v1_5"; + else if ([ + COSEALG.PS256, + COSEALG.PS384, + COSEALG.PS512 + ].indexOf(alg) >= 0) return "RSA-PSS"; + throw new Error(`Could not map COSE alg value of ${alg} to a WebCrypto key alg name`); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyRSA.js +/** +* Verify a signature using an RSA public key +*/ +async function verifyRSA(opts) { + const { cosePublicKey, signature, data, shaHashOverride } = opts; + const WebCrypto = await getWebCrypto(); + const alg = cosePublicKey.get(COSEKEYS.alg); + const n = cosePublicKey.get(COSEKEYS.n); + const e = cosePublicKey.get(COSEKEYS.e); + if (!alg) throw new Error("Public key was missing alg (RSA)"); + if (!isCOSEAlg(alg)) throw new Error(`Public key had invalid alg ${alg} (RSA)`); + if (!n) throw new Error("Public key was missing n (RSA)"); + if (!e) throw new Error("Public key was missing e (RSA)"); + const keyData = { + kty: "RSA", + alg: "", + n: fromBuffer(n), + e: fromBuffer(e), + ext: false + }; + const keyAlgorithm = { + name: mapCoseAlgToWebCryptoKeyAlgName(alg), + hash: { name: mapCoseAlgToWebCryptoAlg(alg) } + }; + const verifyAlgorithm = { name: mapCoseAlgToWebCryptoKeyAlgName(alg) }; + if (shaHashOverride) keyAlgorithm.hash.name = mapCoseAlgToWebCryptoAlg(shaHashOverride); + if (keyAlgorithm.name === "RSASSA-PKCS1-v1_5") { + if (keyAlgorithm.hash.name === "SHA-256") keyData.alg = "RS256"; + else if (keyAlgorithm.hash.name === "SHA-384") keyData.alg = "RS384"; + else if (keyAlgorithm.hash.name === "SHA-512") keyData.alg = "RS512"; + else if (keyAlgorithm.hash.name === "SHA-1") keyData.alg = "RS1"; + } else if (keyAlgorithm.name === "RSA-PSS") { + /** + * salt length. The default value is 20 but the convention is to use hLen, the length of the + * output of the hash function in bytes. A salt length of zero is permitted and will result in + * a deterministic signature value. The actual salt length used can be determined from the + * signature value. + * + * From https://www.cryptosys.net/pki/manpki/pki_rsaschemes.html + */ + let saltLength = 0; + if (keyAlgorithm.hash.name === "SHA-256") { + keyData.alg = "PS256"; + saltLength = 32; + } else if (keyAlgorithm.hash.name === "SHA-384") { + keyData.alg = "PS384"; + saltLength = 48; + } else if (keyAlgorithm.hash.name === "SHA-512") { + keyData.alg = "PS512"; + saltLength = 64; + } + verifyAlgorithm.saltLength = saltLength; + } else throw new Error(`Unexpected RSA key algorithm ${alg} (${keyAlgorithm.name})`); + const key = await importKey({ + keyData, + algorithm: keyAlgorithm + }); + return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/convertAAGUIDToString.js +/** +* Convert the aaguid buffer in authData into a UUID string +*/ +function convertAAGUIDToString(aaguid) { + const hex = toHex(aaguid); + return [ + hex.slice(0, 8), + hex.slice(8, 12), + hex.slice(12, 16), + hex.slice(16, 20), + hex.slice(20, 32) + ].join("-"); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/convertCertBufferToPEM.js +/** +* Convert buffer to an OpenSSL-compatible PEM text format. +*/ +function convertCertBufferToPEM(certBuffer) { + let b64cert; + /** + * Get certBuffer to a base64 representation + */ + if (typeof certBuffer === "string") if (isBase64URL(certBuffer)) b64cert = toBase64(certBuffer); + else if (isBase64(certBuffer)) b64cert = certBuffer; + else throw new Error("Certificate is not a valid base64 or base64url string"); + else b64cert = fromBuffer(certBuffer, "base64"); + let PEMKey = ""; + for (let i = 0; i < Math.ceil(b64cert.length / 64); i += 1) { + const start = 64 * i; + PEMKey += `${b64cert.substr(start, 64)}\n`; + } + PEMKey = `-----BEGIN CERTIFICATE-----\n${PEMKey}-----END CERTIFICATE-----\n`; + return PEMKey; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/convertCOSEtoPKCS.js +/** +* Takes COSE-encoded public key and converts it to PKCS key +*/ +function convertCOSEtoPKCS(cosePublicKey) { + const struct = decodeFirst(cosePublicKey); + const tag = Uint8Array.from([4]); + const x = struct.get(COSEKEYS.x); + const y = struct.get(COSEKEYS.y); + if (!x) throw new Error("COSE public key was missing x"); + if (y) return concat([ + tag, + x, + y + ]); + return concat([tag, x]); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/decodeAttestationObject.js +/** +* Convert an AttestationObject buffer to a proper object +* +* @param base64AttestationObject Attestation Object buffer +*/ +function decodeAttestationObject(attestationObject) { + return _decodeAttestationObjectInternals.stubThis(decodeFirst(attestationObject)); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _decodeAttestationObjectInternals = { stubThis: (value) => value }; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/decodeClientDataJSON.js +/** +* Decode an authenticator's base64url-encoded clientDataJSON to JSON +*/ +function decodeClientDataJSON(data) { + const toString = toUTF8String$1(data); + const clientData = JSON.parse(toString); + return _decodeClientDataJSONInternals.stubThis(clientData); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _decodeClientDataJSONInternals = { stubThis: (value) => value }; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/decodeCredentialPublicKey.js +function decodeCredentialPublicKey(publicKey) { + return _decodeCredentialPublicKeyInternals.stubThis(decodeFirst(publicKey)); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _decodeCredentialPublicKeyInternals = { stubThis: (value) => value }; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/generateUserID.js +/** +* Generate a suitably random value to be used as user ID +*/ +async function generateUserID() { + /** + * WebAuthn spec says user.id has a max length of 64 bytes. I prefer how 32 random bytes look + * after they're base64url-encoded so I'm choosing to go with that here. + */ + const newUserID = new Uint8Array(32); + await getRandomValues(newUserID); + return _generateUserIDInternals.stubThis(newUserID); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _generateUserIDInternals = { stubThis: (value) => value }; +//#endregion +//#region node_modules/pvtsutils/build/index.js +/*! +* MIT License +* +* Copyright (c) 2017-2024 Peculiar Ventures, LLC +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +*/ +var require_build$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + const ARRAY_BUFFER_NAME = "[object ArrayBuffer]"; + var BufferSourceConverter = class BufferSourceConverter { + static isArrayBuffer(data) { + return Object.prototype.toString.call(data) === ARRAY_BUFFER_NAME; + } + static toArrayBuffer(data) { + if (this.isArrayBuffer(data)) return data; + if (data.byteLength === data.buffer.byteLength) return data.buffer; + if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) return data.buffer; + return this.toUint8Array(data.buffer).slice(data.byteOffset, data.byteOffset + data.byteLength).buffer; + } + static toUint8Array(data) { + return this.toView(data, Uint8Array); + } + static toView(data, type) { + if (data.constructor === type) return data; + if (this.isArrayBuffer(data)) return new type(data); + if (this.isArrayBufferView(data)) return new type(data.buffer, data.byteOffset, data.byteLength); + throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'"); + } + static isBufferSource(data) { + return this.isArrayBufferView(data) || this.isArrayBuffer(data); + } + static isArrayBufferView(data) { + return ArrayBuffer.isView(data) || data && this.isArrayBuffer(data.buffer); + } + static isEqual(a, b) { + const aView = BufferSourceConverter.toUint8Array(a); + const bView = BufferSourceConverter.toUint8Array(b); + if (aView.length !== bView.byteLength) return false; + for (let i = 0; i < aView.length; i++) if (aView[i] !== bView[i]) return false; + return true; + } + static concat(...args) { + let buffers; + if (Array.isArray(args[0]) && !(args[1] instanceof Function)) buffers = args[0]; + else if (Array.isArray(args[0]) && args[1] instanceof Function) buffers = args[0]; + else if (args[args.length - 1] instanceof Function) buffers = args.slice(0, args.length - 1); + else buffers = args; + let size = 0; + for (const buffer of buffers) size += buffer.byteLength; + const res = new Uint8Array(size); + let offset = 0; + for (const buffer of buffers) { + const view = this.toUint8Array(buffer); + res.set(view, offset); + offset += view.length; + } + if (args[args.length - 1] instanceof Function) return this.toView(res, args[args.length - 1]); + return res.buffer; + } + }; + const STRING_TYPE = "string"; + const HEX_REGEX = /^[0-9a-f\s]+$/i; + const BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; + const BASE64URL_REGEX = /^[a-zA-Z0-9-_]+$/; + var Utf8Converter = class { + static fromString(text) { + const s = unescape(encodeURIComponent(text)); + const uintArray = new Uint8Array(s.length); + for (let i = 0; i < s.length; i++) uintArray[i] = s.charCodeAt(i); + return uintArray.buffer; + } + static toString(buffer) { + const buf = BufferSourceConverter.toUint8Array(buffer); + let encodedString = ""; + for (let i = 0; i < buf.length; i++) encodedString += String.fromCharCode(buf[i]); + return decodeURIComponent(escape(encodedString)); + } + }; + var Utf16Converter = class { + static toString(buffer, littleEndian = false) { + const arrayBuffer = BufferSourceConverter.toArrayBuffer(buffer); + const dataView = new DataView(arrayBuffer); + let res = ""; + for (let i = 0; i < arrayBuffer.byteLength; i += 2) { + const code = dataView.getUint16(i, littleEndian); + res += String.fromCharCode(code); + } + return res; + } + static fromString(text, littleEndian = false) { + const res = /* @__PURE__ */ new ArrayBuffer(text.length * 2); + const dataView = new DataView(res); + for (let i = 0; i < text.length; i++) dataView.setUint16(i * 2, text.charCodeAt(i), littleEndian); + return res; + } + }; + var Convert = class Convert { + static isHex(data) { + return typeof data === STRING_TYPE && HEX_REGEX.test(data); + } + static isBase64(data) { + return typeof data === STRING_TYPE && BASE64_REGEX.test(data); + } + static isBase64Url(data) { + return typeof data === STRING_TYPE && BASE64URL_REGEX.test(data); + } + static ToString(buffer, enc = "utf8") { + const buf = BufferSourceConverter.toUint8Array(buffer); + switch (enc.toLowerCase()) { + case "utf8": return this.ToUtf8String(buf); + case "binary": return this.ToBinary(buf); + case "hex": return this.ToHex(buf); + case "base64": return this.ToBase64(buf); + case "base64url": return this.ToBase64Url(buf); + case "utf16le": return Utf16Converter.toString(buf, true); + case "utf16": + case "utf16be": return Utf16Converter.toString(buf); + default: throw new Error(`Unknown type of encoding '${enc}'`); + } + } + static FromString(str, enc = "utf8") { + if (!str) return /* @__PURE__ */ new ArrayBuffer(0); + switch (enc.toLowerCase()) { + case "utf8": return this.FromUtf8String(str); + case "binary": return this.FromBinary(str); + case "hex": return this.FromHex(str); + case "base64": return this.FromBase64(str); + case "base64url": return this.FromBase64Url(str); + case "utf16le": return Utf16Converter.fromString(str, true); + case "utf16": + case "utf16be": return Utf16Converter.fromString(str); + default: throw new Error(`Unknown type of encoding '${enc}'`); + } + } + static ToBase64(buffer) { + const buf = BufferSourceConverter.toUint8Array(buffer); + if (typeof btoa !== "undefined") { + const binary = this.ToString(buf, "binary"); + return btoa(binary); + } else return Buffer.from(buf).toString("base64"); + } + static FromBase64(base64) { + const formatted = this.formatString(base64); + if (!formatted) return /* @__PURE__ */ new ArrayBuffer(0); + if (!Convert.isBase64(formatted)) throw new TypeError("Argument 'base64Text' is not Base64 encoded"); + if (typeof atob !== "undefined") return this.FromBinary(atob(formatted)); + else return new Uint8Array(Buffer.from(formatted, "base64")).buffer; + } + static FromBase64Url(base64url) { + const formatted = this.formatString(base64url); + if (!formatted) return /* @__PURE__ */ new ArrayBuffer(0); + if (!Convert.isBase64Url(formatted)) throw new TypeError("Argument 'base64url' is not Base64Url encoded"); + return this.FromBase64(this.Base64Padding(formatted.replace(/\-/g, "+").replace(/\_/g, "/"))); + } + static ToBase64Url(data) { + return this.ToBase64(data).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, ""); + } + static FromUtf8String(text, encoding = Convert.DEFAULT_UTF8_ENCODING) { + switch (encoding) { + case "ascii": return this.FromBinary(text); + case "utf8": return Utf8Converter.fromString(text); + case "utf16": + case "utf16be": return Utf16Converter.fromString(text); + case "utf16le": + case "usc2": return Utf16Converter.fromString(text, true); + default: throw new Error(`Unknown type of encoding '${encoding}'`); + } + } + static ToUtf8String(buffer, encoding = Convert.DEFAULT_UTF8_ENCODING) { + switch (encoding) { + case "ascii": return this.ToBinary(buffer); + case "utf8": return Utf8Converter.toString(buffer); + case "utf16": + case "utf16be": return Utf16Converter.toString(buffer); + case "utf16le": + case "usc2": return Utf16Converter.toString(buffer, true); + default: throw new Error(`Unknown type of encoding '${encoding}'`); + } + } + static FromBinary(text) { + const stringLength = text.length; + const resultView = new Uint8Array(stringLength); + for (let i = 0; i < stringLength; i++) resultView[i] = text.charCodeAt(i); + return resultView.buffer; + } + static ToBinary(buffer) { + const buf = BufferSourceConverter.toUint8Array(buffer); + let res = ""; + for (let i = 0; i < buf.length; i++) res += String.fromCharCode(buf[i]); + return res; + } + static ToHex(buffer) { + const buf = BufferSourceConverter.toUint8Array(buffer); + let result = ""; + const len = buf.length; + for (let i = 0; i < len; i++) { + const byte = buf[i]; + if (byte < 16) result += "0"; + result += byte.toString(16); + } + return result; + } + static FromHex(hexString) { + let formatted = this.formatString(hexString); + if (!formatted) return /* @__PURE__ */ new ArrayBuffer(0); + if (!Convert.isHex(formatted)) throw new TypeError("Argument 'hexString' is not HEX encoded"); + if (formatted.length % 2) formatted = `0${formatted}`; + const res = new Uint8Array(formatted.length / 2); + for (let i = 0; i < formatted.length; i = i + 2) { + const c = formatted.slice(i, i + 2); + res[i / 2] = parseInt(c, 16); + } + return res.buffer; + } + static ToUtf16String(buffer, littleEndian = false) { + return Utf16Converter.toString(buffer, littleEndian); + } + static FromUtf16String(text, littleEndian = false) { + return Utf16Converter.fromString(text, littleEndian); + } + static Base64Padding(base64) { + const padCount = 4 - base64.length % 4; + if (padCount < 4) for (let i = 0; i < padCount; i++) base64 += "="; + return base64; + } + static formatString(data) { + return (data === null || data === void 0 ? void 0 : data.replace(/[\n\r\t ]/g, "")) || ""; + } + }; + Convert.DEFAULT_UTF8_ENCODING = "utf8"; + function assign(target, ...sources) { + const res = arguments[0]; + for (let i = 1; i < arguments.length; i++) { + const obj = arguments[i]; + for (const prop in obj) res[prop] = obj[prop]; + } + return res; + } + function combine(...buf) { + const totalByteLength = buf.map((item) => item.byteLength).reduce((prev, cur) => prev + cur); + const res = new Uint8Array(totalByteLength); + let currentPos = 0; + buf.map((item) => new Uint8Array(item)).forEach((arr) => { + for (const item2 of arr) res[currentPos++] = item2; + }); + return res.buffer; + } + function isEqual(bytes1, bytes2) { + if (!(bytes1 && bytes2)) return false; + if (bytes1.byteLength !== bytes2.byteLength) return false; + const b1 = new Uint8Array(bytes1); + const b2 = new Uint8Array(bytes2); + for (let i = 0; i < bytes1.byteLength; i++) if (b1[i] !== b2[i]) return false; + return true; + } + exports.BufferSourceConverter = BufferSourceConverter; + exports.Convert = Convert; + exports.assign = assign; + exports.combine = combine; + exports.isEqual = isEqual; +})); +//#endregion +//#region node_modules/pvutils/build/utils.js +/*! +Copyright (c) Peculiar Ventures, LLC +*/ +var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + function getUTCDate(date) { + return new Date(date.getTime() + date.getTimezoneOffset() * 6e4); + } + function getParametersValue(parameters, name, defaultValue) { + var _a; + if (parameters instanceof Object === false) return defaultValue; + return (_a = parameters[name]) !== null && _a !== void 0 ? _a : defaultValue; + } + function bufferToHexCodes(inputBuffer, inputOffset = 0, inputLength = inputBuffer.byteLength - inputOffset, insertSpace = false) { + let result = ""; + for (const item of new Uint8Array(inputBuffer, inputOffset, inputLength)) { + const str = item.toString(16).toUpperCase(); + if (str.length === 1) result += "0"; + result += str; + if (insertSpace) result += " "; + } + return result.trim(); + } + function checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) { + if (!(inputBuffer instanceof ArrayBuffer)) { + baseBlock.error = "Wrong parameter: inputBuffer must be \"ArrayBuffer\""; + return false; + } + if (!inputBuffer.byteLength) { + baseBlock.error = "Wrong parameter: inputBuffer has zero length"; + return false; + } + if (inputOffset < 0) { + baseBlock.error = "Wrong parameter: inputOffset less than zero"; + return false; + } + if (inputLength < 0) { + baseBlock.error = "Wrong parameter: inputLength less than zero"; + return false; + } + if (inputBuffer.byteLength - inputOffset - inputLength < 0) { + baseBlock.error = "End of input reached before message was fully decoded (inconsistent offset and length values)"; + return false; + } + return true; + } + function utilFromBase(inputBuffer, inputBase) { + let result = 0; + if (inputBuffer.length === 1) return inputBuffer[0]; + for (let i = inputBuffer.length - 1; i >= 0; i--) result += inputBuffer[inputBuffer.length - 1 - i] * Math.pow(2, inputBase * i); + return result; + } + function utilToBase(value, base, reserved = -1) { + const internalReserved = reserved; + let internalValue = value; + let result = 0; + let biggest = Math.pow(2, base); + for (let i = 1; i < 8; i++) { + if (value < biggest) { + let retBuf; + if (internalReserved < 0) { + retBuf = new ArrayBuffer(i); + result = i; + } else { + if (internalReserved < i) return /* @__PURE__ */ new ArrayBuffer(0); + retBuf = new ArrayBuffer(internalReserved); + result = internalReserved; + } + const retView = new Uint8Array(retBuf); + for (let j = i - 1; j >= 0; j--) { + const basis = Math.pow(2, j * base); + retView[result - j - 1] = Math.floor(internalValue / basis); + internalValue -= retView[result - j - 1] * basis; + } + return retBuf; + } + biggest *= Math.pow(2, base); + } + return /* @__PURE__ */ new ArrayBuffer(0); + } + function utilConcatBuf(...buffers) { + let outputLength = 0; + let prevLength = 0; + for (const buffer of buffers) outputLength += buffer.byteLength; + const retBuf = new ArrayBuffer(outputLength); + const retView = new Uint8Array(retBuf); + for (const buffer of buffers) { + retView.set(new Uint8Array(buffer), prevLength); + prevLength += buffer.byteLength; + } + return retBuf; + } + function utilConcatView(...views) { + let outputLength = 0; + let prevLength = 0; + for (const view of views) outputLength += view.length; + const retBuf = new ArrayBuffer(outputLength); + const retView = new Uint8Array(retBuf); + for (const view of views) { + retView.set(view, prevLength); + prevLength += view.length; + } + return retView; + } + function utilDecodeTC() { + const buf = new Uint8Array(this.valueHex); + if (this.valueHex.byteLength >= 2) { + const condition1 = buf[0] === 255 && buf[1] & 128; + const condition2 = buf[0] === 0 && (buf[1] & 128) === 0; + if (condition1 || condition2) this.warnings.push("Needlessly long format"); + } + const bigIntBuffer = new ArrayBuffer(this.valueHex.byteLength); + const bigIntView = new Uint8Array(bigIntBuffer); + for (let i = 0; i < this.valueHex.byteLength; i++) bigIntView[i] = 0; + bigIntView[0] = buf[0] & 128; + const bigInt = utilFromBase(bigIntView, 8); + const smallIntBuffer = new ArrayBuffer(this.valueHex.byteLength); + const smallIntView = new Uint8Array(smallIntBuffer); + for (let j = 0; j < this.valueHex.byteLength; j++) smallIntView[j] = buf[j]; + smallIntView[0] &= 127; + return utilFromBase(smallIntView, 8) - bigInt; + } + function utilEncodeTC(value) { + const modValue = value < 0 ? value * -1 : value; + let bigInt = 128; + for (let i = 1; i < 8; i++) { + if (modValue <= bigInt) { + if (value < 0) { + const retBuf = utilToBase(bigInt - modValue, 8, i); + const retView = new Uint8Array(retBuf); + retView[0] |= 128; + return retBuf; + } + let retBuf = utilToBase(modValue, 8, i); + let retView = new Uint8Array(retBuf); + if (retView[0] & 128) { + const tempBuf = retBuf.slice(0); + const tempView = new Uint8Array(tempBuf); + retBuf = new ArrayBuffer(retBuf.byteLength + 1); + retView = new Uint8Array(retBuf); + for (let k = 0; k < tempBuf.byteLength; k++) retView[k + 1] = tempView[k]; + retView[0] = 0; + } + return retBuf; + } + bigInt *= Math.pow(2, 8); + } + return /* @__PURE__ */ new ArrayBuffer(0); + } + function isEqualBuffer(inputBuffer1, inputBuffer2) { + if (inputBuffer1.byteLength !== inputBuffer2.byteLength) return false; + const view1 = new Uint8Array(inputBuffer1); + const view2 = new Uint8Array(inputBuffer2); + for (let i = 0; i < view1.length; i++) if (view1[i] !== view2[i]) return false; + return true; + } + function padNumber(inputNumber, fullLength) { + const str = inputNumber.toString(10); + if (fullLength < str.length) return ""; + const dif = fullLength - str.length; + const padding = Array.from({ length: dif }); + for (let i = 0; i < dif; i++) padding[i] = "0"; + return padding.join("").concat(str); + } + const base64Template = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + const base64UrlTemplate = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="; + function toBase64(input, useUrlTemplate = false, skipPadding = false, skipLeadingZeros = false) { + let i = 0; + let flag1 = 0; + let flag2 = 0; + let output = ""; + const template = useUrlTemplate ? base64UrlTemplate : base64Template; + if (skipLeadingZeros) { + let nonZeroPosition = 0; + for (let i = 0; i < input.length; i++) if (input.charCodeAt(i) !== 0) { + nonZeroPosition = i; + break; + } + input = input.slice(nonZeroPosition); + } + while (i < input.length) { + const chr1 = input.charCodeAt(i++); + if (i >= input.length) flag1 = 1; + const chr2 = input.charCodeAt(i++); + if (i >= input.length) flag2 = 1; + const chr3 = input.charCodeAt(i++); + const enc1 = chr1 >> 2; + const enc2 = (chr1 & 3) << 4 | chr2 >> 4; + let enc3 = (chr2 & 15) << 2 | chr3 >> 6; + let enc4 = chr3 & 63; + if (flag1 === 1) enc3 = enc4 = 64; + else if (flag2 === 1) enc4 = 64; + if (skipPadding) if (enc3 === 64) output += `${template.charAt(enc1)}${template.charAt(enc2)}`; + else if (enc4 === 64) output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}`; + else output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}${template.charAt(enc4)}`; + else output += `${template.charAt(enc1)}${template.charAt(enc2)}${template.charAt(enc3)}${template.charAt(enc4)}`; + } + return output; + } + function fromBase64(input, useUrlTemplate = false, cutTailZeros = false) { + const template = useUrlTemplate ? base64UrlTemplate : base64Template; + function indexOf(toSearch) { + for (let i = 0; i < 64; i++) if (template.charAt(i) === toSearch) return i; + return 64; + } + function test(incoming) { + return incoming === 64 ? 0 : incoming; + } + let i = 0; + let output = ""; + while (i < input.length) { + const enc1 = indexOf(input.charAt(i++)); + const enc2 = i >= input.length ? 0 : indexOf(input.charAt(i++)); + const enc3 = i >= input.length ? 0 : indexOf(input.charAt(i++)); + const enc4 = i >= input.length ? 0 : indexOf(input.charAt(i++)); + const chr1 = test(enc1) << 2 | test(enc2) >> 4; + const chr2 = (test(enc2) & 15) << 4 | test(enc3) >> 2; + const chr3 = (test(enc3) & 3) << 6 | test(enc4); + output += String.fromCharCode(chr1); + if (enc3 !== 64) output += String.fromCharCode(chr2); + if (enc4 !== 64) output += String.fromCharCode(chr3); + } + if (cutTailZeros) { + const outputLength = output.length; + let nonZeroStart = -1; + for (let i = outputLength - 1; i >= 0; i--) if (output.charCodeAt(i) !== 0) { + nonZeroStart = i; + break; + } + if (nonZeroStart !== -1) output = output.slice(0, nonZeroStart + 1); + else output = ""; + } + return output; + } + function arrayBufferToString(buffer) { + let resultString = ""; + const view = new Uint8Array(buffer); + for (const element of view) resultString += String.fromCharCode(element); + return resultString; + } + function stringToArrayBuffer(str) { + const stringLength = str.length; + const resultBuffer = new ArrayBuffer(stringLength); + const resultView = new Uint8Array(resultBuffer); + for (let i = 0; i < stringLength; i++) resultView[i] = str.charCodeAt(i); + return resultBuffer; + } + const log2 = Math.log(2); + function nearestPowerOf2(length) { + const base = Math.log(length) / log2; + const floor = Math.floor(base); + const round = Math.round(base); + return floor === round ? floor : round; + } + function clearProps(object, propsArray) { + for (const prop of propsArray) delete object[prop]; + } + exports.arrayBufferToString = arrayBufferToString; + exports.bufferToHexCodes = bufferToHexCodes; + exports.checkBufferParams = checkBufferParams; + exports.clearProps = clearProps; + exports.fromBase64 = fromBase64; + exports.getParametersValue = getParametersValue; + exports.getUTCDate = getUTCDate; + exports.isEqualBuffer = isEqualBuffer; + exports.nearestPowerOf2 = nearestPowerOf2; + exports.padNumber = padNumber; + exports.stringToArrayBuffer = stringToArrayBuffer; + exports.toBase64 = toBase64; + exports.utilConcatBuf = utilConcatBuf; + exports.utilConcatView = utilConcatView; + exports.utilDecodeTC = utilDecodeTC; + exports.utilEncodeTC = utilEncodeTC; + exports.utilFromBase = utilFromBase; + exports.utilToBase = utilToBase; +})); +//#endregion +//#region node_modules/asn1js/build/index.js +/*! +* Copyright (c) 2014, GMO GlobalSign +* Copyright (c) 2015-2022, Peculiar Ventures +* All rights reserved. +* +* Author 2014-2019, Yury Strozhevsky +* +* Redistribution and use in source and binary forms, with or without modification, +* are permitted provided that the following conditions are met: +* +* * Redistributions of source code must retain the above copyright notice, this +* list of conditions and the following disclaimer. +* +* * Redistributions in binary form must reproduce the above copyright notice, this +* list of conditions and the following disclaimer in the documentation and/or +* other materials provided with the distribution. +* +* * Neither the name of the copyright holder nor the names of its +* contributors may be used to endorse or promote products derived from +* this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +var require_build = /* @__PURE__ */ __commonJSMin(((exports) => { + var pvtsutils = require_build$1(); + var pvutils = require_utils(); + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) Object.keys(e).forEach(function(k) { + if (k !== "default") { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function() { + return e[k]; + } + }); + } + }); + n.default = e; + return Object.freeze(n); + } + var pvtsutils__namespace = /*#__PURE__*/ _interopNamespaceDefault(pvtsutils); + var pvutils__namespace = /*#__PURE__*/ _interopNamespaceDefault(pvutils); + function assertBigInt() { + if (typeof BigInt === "undefined") throw new Error("BigInt is not defined. Your environment doesn't implement BigInt."); + } + function concat(buffers) { + let outputLength = 0; + let prevLength = 0; + for (let i = 0; i < buffers.length; i++) { + const buffer = buffers[i]; + outputLength += buffer.byteLength; + } + const retView = new Uint8Array(outputLength); + for (let i = 0; i < buffers.length; i++) { + const buffer = buffers[i]; + retView.set(new Uint8Array(buffer), prevLength); + prevLength += buffer.byteLength; + } + return retView.buffer; + } + function checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) { + if (!(inputBuffer instanceof Uint8Array)) { + baseBlock.error = "Wrong parameter: inputBuffer must be 'Uint8Array'"; + return false; + } + if (!inputBuffer.byteLength) { + baseBlock.error = "Wrong parameter: inputBuffer has zero length"; + return false; + } + if (inputOffset < 0) { + baseBlock.error = "Wrong parameter: inputOffset less than zero"; + return false; + } + if (inputLength < 0) { + baseBlock.error = "Wrong parameter: inputLength less than zero"; + return false; + } + if (inputBuffer.byteLength - inputOffset - inputLength < 0) { + baseBlock.error = "End of input reached before message was fully decoded (inconsistent offset and length values)"; + return false; + } + return true; + } + var ViewWriter = class { + constructor() { + this.items = []; + } + write(buf) { + this.items.push(buf); + } + final() { + return concat(this.items); + } + }; + const powers2 = [new Uint8Array([1])]; + const digitsString = "0123456789"; + const NAME = "name"; + const VALUE_HEX_VIEW = "valueHexView"; + const IS_HEX_ONLY = "isHexOnly"; + const ID_BLOCK = "idBlock"; + const TAG_CLASS = "tagClass"; + const TAG_NUMBER = "tagNumber"; + const IS_CONSTRUCTED = "isConstructed"; + const FROM_BER = "fromBER"; + const TO_BER = "toBER"; + const LOCAL = "local"; + const EMPTY_STRING = ""; + const EMPTY_BUFFER = /* @__PURE__ */ new ArrayBuffer(0); + const EMPTY_VIEW = new Uint8Array(0); + const END_OF_CONTENT_NAME = "EndOfContent"; + const OCTET_STRING_NAME = "OCTET STRING"; + const BIT_STRING_NAME = "BIT STRING"; + function HexBlock(BaseClass) { + var _a; + return _a = class Some extends BaseClass { + get valueHex() { + return this.valueHexView.slice().buffer; + } + set valueHex(value) { + this.valueHexView = new Uint8Array(value); + } + constructor(...args) { + var _b; + super(...args); + const params = args[0] || {}; + this.isHexOnly = (_b = params.isHexOnly) !== null && _b !== void 0 ? _b : false; + this.valueHexView = params.valueHex ? pvtsutils__namespace.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW; + } + fromBER(inputBuffer, inputOffset, inputLength, _context) { + const view = inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer; + if (!checkBufferParams(this, view, inputOffset, inputLength)) return -1; + const endLength = inputOffset + inputLength; + this.valueHexView = view.subarray(inputOffset, endLength); + if (!this.valueHexView.length) { + this.warnings.push("Zero buffer length"); + return inputOffset; + } + this.blockLength = inputLength; + return endLength; + } + toBER(sizeOnly = false) { + if (!this.isHexOnly) { + this.error = "Flag 'isHexOnly' is not set, abort"; + return EMPTY_BUFFER; + } + if (sizeOnly) return new ArrayBuffer(this.valueHexView.byteLength); + return this.valueHexView.byteLength === this.valueHexView.buffer.byteLength ? this.valueHexView.buffer : this.valueHexView.slice().buffer; + } + toJSON() { + return { + ...super.toJSON(), + isHexOnly: this.isHexOnly, + valueHex: pvtsutils__namespace.Convert.ToHex(this.valueHexView) + }; + } + }, _a.NAME = "hexBlock", _a; + } + var LocalBaseBlock = class { + static blockName() { + return this.NAME; + } + get valueBeforeDecode() { + return this.valueBeforeDecodeView.slice().buffer; + } + set valueBeforeDecode(value) { + this.valueBeforeDecodeView = new Uint8Array(value); + } + constructor({ blockLength = 0, error = EMPTY_STRING, warnings = [], valueBeforeDecode = EMPTY_VIEW } = {}) { + this.blockLength = blockLength; + this.error = error; + this.warnings = warnings; + this.valueBeforeDecodeView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(valueBeforeDecode); + } + toJSON() { + return { + blockName: this.constructor.NAME, + blockLength: this.blockLength, + error: this.error, + warnings: this.warnings, + valueBeforeDecode: pvtsutils__namespace.Convert.ToHex(this.valueBeforeDecodeView) + }; + } + }; + LocalBaseBlock.NAME = "baseBlock"; + var ValueBlock = class extends LocalBaseBlock { + fromBER(_inputBuffer, _inputOffset, _inputLength, _context) { + throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'"); + } + toBER(_sizeOnly, _writer) { + throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'"); + } + }; + ValueBlock.NAME = "valueBlock"; + var LocalIdentificationBlock = class extends HexBlock(LocalBaseBlock) { + constructor({ idBlock = {} } = {}) { + var _a, _b, _c, _d; + super(); + if (idBlock) { + this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false; + this.valueHexView = idBlock.valueHex ? pvtsutils__namespace.BufferSourceConverter.toUint8Array(idBlock.valueHex) : EMPTY_VIEW; + this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1; + this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1; + this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false; + } else { + this.tagClass = -1; + this.tagNumber = -1; + this.isConstructed = false; + } + } + toBER(sizeOnly = false) { + let firstOctet = 0; + switch (this.tagClass) { + case 1: + firstOctet |= 0; + break; + case 2: + firstOctet |= 64; + break; + case 3: + firstOctet |= 128; + break; + case 4: + firstOctet |= 192; + break; + default: + this.error = "Unknown tag class"; + return EMPTY_BUFFER; + } + if (this.isConstructed) firstOctet |= 32; + if (this.tagNumber < 31 && !this.isHexOnly) { + const retView = new Uint8Array(1); + if (!sizeOnly) { + let number = this.tagNumber; + number &= 31; + firstOctet |= number; + retView[0] = firstOctet; + } + return retView.buffer; + } + if (!this.isHexOnly) { + const encodedBuf = pvutils__namespace.utilToBase(this.tagNumber, 7); + const encodedView = new Uint8Array(encodedBuf); + const size = encodedBuf.byteLength; + const retView = new Uint8Array(size + 1); + retView[0] = firstOctet | 31; + if (!sizeOnly) { + for (let i = 0; i < size - 1; i++) retView[i + 1] = encodedView[i] | 128; + retView[size] = encodedView[size - 1]; + } + return retView.buffer; + } + const retView = new Uint8Array(this.valueHexView.byteLength + 1); + retView[0] = firstOctet | 31; + if (!sizeOnly) { + const curView = this.valueHexView; + for (let i = 0; i < curView.length - 1; i++) retView[i + 1] = curView[i] | 128; + retView[this.valueHexView.byteLength] = curView[curView.length - 1]; + } + return retView.buffer; + } + fromBER(inputBuffer, inputOffset, inputLength) { + const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + if (!checkBufferParams(this, inputView, inputOffset, inputLength)) return -1; + const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength); + if (intBuffer.length === 0) { + this.error = "Zero buffer length"; + return -1; + } + switch (intBuffer[0] & 192) { + case 0: + this.tagClass = 1; + break; + case 64: + this.tagClass = 2; + break; + case 128: + this.tagClass = 3; + break; + case 192: + this.tagClass = 4; + break; + default: + this.error = "Unknown tag class"; + return -1; + } + this.isConstructed = (intBuffer[0] & 32) === 32; + this.isHexOnly = false; + const tagNumberMask = intBuffer[0] & 31; + if (tagNumberMask !== 31) { + this.tagNumber = tagNumberMask; + this.blockLength = 1; + } else { + let count = 0; + while (true) { + const tagByteIndex = count + 1; + if (tagByteIndex >= intBuffer.length) { + this.error = "End of input reached before message was fully decoded"; + return -1; + } + count++; + if ((intBuffer[tagByteIndex] & 128) === 0) break; + } + this.blockLength = count + 1; + const intTagNumberBuffer = this.valueHexView = new Uint8Array(count); + for (let i = 0; i < count; i++) intTagNumberBuffer[i] = intBuffer[i + 1] & 127; + if (this.blockLength <= 9) this.tagNumber = pvutils__namespace.utilFromBase(intTagNumberBuffer, 7); + else { + this.isHexOnly = true; + this.warnings.push("Tag too long, represented as hex-coded"); + } + } + if (this.tagClass === 1 && this.isConstructed) switch (this.tagNumber) { + case 1: + case 2: + case 5: + case 6: + case 9: + case 13: + case 14: + case 23: + case 24: + case 31: + case 32: + case 33: + case 34: + this.error = "Constructed encoding used for primitive type"; + return -1; + } + return inputOffset + this.blockLength; + } + toJSON() { + return { + ...super.toJSON(), + tagClass: this.tagClass, + tagNumber: this.tagNumber, + isConstructed: this.isConstructed + }; + } + }; + LocalIdentificationBlock.NAME = "identificationBlock"; + var LocalLengthBlock = class extends LocalBaseBlock { + constructor({ lenBlock = {} } = {}) { + var _a, _b, _c; + super(); + this.isIndefiniteForm = (_a = lenBlock.isIndefiniteForm) !== null && _a !== void 0 ? _a : false; + this.longFormUsed = (_b = lenBlock.longFormUsed) !== null && _b !== void 0 ? _b : false; + this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0; + } + fromBER(inputBuffer, inputOffset, inputLength) { + const view = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + if (!checkBufferParams(this, view, inputOffset, inputLength)) return -1; + const intBuffer = view.subarray(inputOffset, inputOffset + inputLength); + if (intBuffer.length === 0) { + this.error = "Zero buffer length"; + return -1; + } + if (intBuffer[0] === 255) { + this.error = "Length block 0xFF is reserved by standard"; + return -1; + } + this.isIndefiniteForm = intBuffer[0] === 128; + if (this.isIndefiniteForm) { + this.blockLength = 1; + return inputOffset + this.blockLength; + } + this.longFormUsed = !!(intBuffer[0] & 128); + if (this.longFormUsed === false) { + this.length = intBuffer[0]; + this.blockLength = 1; + return inputOffset + this.blockLength; + } + const count = intBuffer[0] & 127; + if (count > 8) { + this.error = "Too big integer"; + return -1; + } + if (count + 1 > intBuffer.length) { + this.error = "End of input reached before message was fully decoded"; + return -1; + } + const lenOffset = inputOffset + 1; + const lengthBufferView = view.subarray(lenOffset, lenOffset + count); + if (lengthBufferView[count - 1] === 0) this.warnings.push("Needlessly long encoded length"); + this.length = pvutils__namespace.utilFromBase(lengthBufferView, 8); + if (this.longFormUsed && this.length <= 127) this.warnings.push("Unnecessary usage of long length form"); + this.blockLength = count + 1; + return inputOffset + this.blockLength; + } + toBER(sizeOnly = false) { + let retBuf; + let retView; + if (this.length > 127) this.longFormUsed = true; + if (this.isIndefiniteForm) { + retBuf = /* @__PURE__ */ new ArrayBuffer(1); + if (sizeOnly === false) { + retView = new Uint8Array(retBuf); + retView[0] = 128; + } + return retBuf; + } + if (this.longFormUsed) { + const encodedBuf = pvutils__namespace.utilToBase(this.length, 8); + if (encodedBuf.byteLength > 127) { + this.error = "Too big length"; + return EMPTY_BUFFER; + } + retBuf = new ArrayBuffer(encodedBuf.byteLength + 1); + if (sizeOnly) return retBuf; + const encodedView = new Uint8Array(encodedBuf); + retView = new Uint8Array(retBuf); + retView[0] = encodedBuf.byteLength | 128; + for (let i = 0; i < encodedBuf.byteLength; i++) retView[i + 1] = encodedView[i]; + return retBuf; + } + retBuf = /* @__PURE__ */ new ArrayBuffer(1); + if (sizeOnly === false) { + retView = new Uint8Array(retBuf); + retView[0] = this.length; + } + return retBuf; + } + toJSON() { + return { + ...super.toJSON(), + isIndefiniteForm: this.isIndefiniteForm, + longFormUsed: this.longFormUsed, + length: this.length + }; + } + }; + LocalLengthBlock.NAME = "lengthBlock"; + const typeStore = {}; + var BaseBlock = class extends LocalBaseBlock { + constructor({ name = EMPTY_STRING, optional = false, primitiveSchema, ...parameters } = {}, valueBlockType) { + super(parameters); + this.name = name; + this.optional = optional; + if (primitiveSchema) this.primitiveSchema = primitiveSchema; + this.idBlock = new LocalIdentificationBlock(parameters); + this.lenBlock = new LocalLengthBlock(parameters); + this.valueBlock = valueBlockType ? new valueBlockType(parameters) : new ValueBlock(parameters); + } + fromBER(inputBuffer, inputOffset, inputLength, context) { + const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, this.lenBlock.isIndefiniteForm ? inputLength : this.lenBlock.length, context); + if (resultOffset === -1) { + this.error = this.valueBlock.error; + return resultOffset; + } + if (!this.idBlock.error.length) this.blockLength += this.idBlock.blockLength; + if (!this.lenBlock.error.length) this.blockLength += this.lenBlock.blockLength; + if (!this.valueBlock.error.length) this.blockLength += this.valueBlock.blockLength; + return resultOffset; + } + toBER(sizeOnly, writer) { + const _writer = writer || new ViewWriter(); + if (!writer) prepareIndefiniteForm(this); + const idBlockBuf = this.idBlock.toBER(sizeOnly); + _writer.write(idBlockBuf); + if (this.lenBlock.isIndefiniteForm) { + _writer.write(new Uint8Array([128]).buffer); + this.valueBlock.toBER(sizeOnly, _writer); + _writer.write(/* @__PURE__ */ new ArrayBuffer(2)); + } else { + const valueBlockBuf = this.valueBlock.toBER(sizeOnly); + this.lenBlock.length = valueBlockBuf.byteLength; + const lenBlockBuf = this.lenBlock.toBER(sizeOnly); + _writer.write(lenBlockBuf); + _writer.write(valueBlockBuf); + } + if (!writer) return _writer.final(); + return EMPTY_BUFFER; + } + toJSON() { + const object = { + ...super.toJSON(), + idBlock: this.idBlock.toJSON(), + lenBlock: this.lenBlock.toJSON(), + valueBlock: this.valueBlock.toJSON(), + name: this.name, + optional: this.optional + }; + if (this.primitiveSchema) object.primitiveSchema = this.primitiveSchema.toJSON(); + return object; + } + toString(encoding = "ascii") { + if (encoding === "ascii") return this.onAsciiEncoding(); + return pvtsutils__namespace.Convert.ToHex(this.toBER()); + } + onAsciiEncoding() { + return `${this.constructor.NAME} : ${pvtsutils__namespace.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`; + } + isEqual(other) { + if (this === other) return true; + if (!(other instanceof this.constructor)) return false; + const thisRaw = this.toBER(); + const otherRaw = other.toBER(); + return pvutils__namespace.isEqualBuffer(thisRaw, otherRaw); + } + }; + BaseBlock.NAME = "BaseBlock"; + function prepareIndefiniteForm(baseBlock) { + var _a; + if (baseBlock instanceof typeStore.Constructed) { + for (const value of baseBlock.valueBlock.value) if (prepareIndefiniteForm(value)) baseBlock.lenBlock.isIndefiniteForm = true; + } + return !!((_a = baseBlock.lenBlock) === null || _a === void 0 ? void 0 : _a.isIndefiniteForm); + } + var BaseStringBlock = class extends BaseBlock { + getValue() { + return this.valueBlock.value; + } + setValue(value) { + this.valueBlock.value = value; + } + constructor({ value = EMPTY_STRING, ...parameters } = {}, stringValueBlockType) { + super(parameters, stringValueBlockType); + if (value) this.fromString(value); + } + fromBER(inputBuffer, inputOffset, inputLength) { + const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, this.lenBlock.isIndefiniteForm ? inputLength : this.lenBlock.length); + if (resultOffset === -1) { + this.error = this.valueBlock.error; + return resultOffset; + } + this.fromBuffer(this.valueBlock.valueHexView); + if (!this.idBlock.error.length) this.blockLength += this.idBlock.blockLength; + if (!this.lenBlock.error.length) this.blockLength += this.lenBlock.blockLength; + if (!this.valueBlock.error.length) this.blockLength += this.valueBlock.blockLength; + return resultOffset; + } + onAsciiEncoding() { + return `${this.constructor.NAME} : '${this.valueBlock.value}'`; + } + }; + BaseStringBlock.NAME = "BaseStringBlock"; + var LocalPrimitiveValueBlock = class extends HexBlock(ValueBlock) { + constructor({ isHexOnly = true, ...parameters } = {}) { + super(parameters); + this.isHexOnly = isHexOnly; + } + }; + LocalPrimitiveValueBlock.NAME = "PrimitiveValueBlock"; + var _a$w; + var Primitive = class extends BaseBlock { + constructor(parameters = {}) { + super(parameters, LocalPrimitiveValueBlock); + this.idBlock.isConstructed = false; + } + }; + _a$w = Primitive; + (() => { + typeStore.Primitive = _a$w; + })(); + Primitive.NAME = "PRIMITIVE"; + const DEFAULT_MAX_DEPTH = 100; + const DEFAULT_MAX_NODES = 1e4; + const DEFAULT_MAX_CONTENT_LENGTH = 16 * 1024 * 1024; + const MAX_DEPTH_EXCEEDED_ERROR = "Maximum ASN.1 nesting depth exceeded"; + const MAX_NODES_EXCEEDED_ERROR = "Maximum ASN.1 node count exceeded"; + const MAX_CONTENT_LENGTH_EXCEEDED_ERROR = "Maximum ASN.1 content length exceeded"; + function createFromBerContext(options = {}) { + var _a, _b, _c; + return { + depth: 0, + maxDepth: (_a = options.maxDepth) !== null && _a !== void 0 ? _a : DEFAULT_MAX_DEPTH, + nodesCount: 0, + maxNodes: (_b = options.maxNodes) !== null && _b !== void 0 ? _b : DEFAULT_MAX_NODES, + maxContentLength: (_c = options.maxContentLength) !== null && _c !== void 0 ? _c : DEFAULT_MAX_CONTENT_LENGTH + }; + } + function createErrorResult(error) { + const result = new BaseBlock({}, ValueBlock); + result.error = error; + return { + offset: -1, + result + }; + } + function checkNodesLimit(context) { + context.nodesCount += 1; + if (context.nodesCount > context.maxNodes) return MAX_NODES_EXCEEDED_ERROR; + } + function checkContentLengthLimit(inputLength, context) { + if (inputLength > context.maxContentLength) return MAX_CONTENT_LENGTH_EXCEEDED_ERROR; + } + function localFromBERWithChildContext(inputBuffer, inputOffset, inputLength, context) { + const childDepth = context.depth + 1; + if (childDepth > context.maxDepth) return createErrorResult(MAX_DEPTH_EXCEEDED_ERROR); + context.depth = childDepth; + try { + return localFromBER(inputBuffer, inputOffset, inputLength, context); + } finally { + context.depth -= 1; + } + } + function localChangeType(inputObject, newType) { + if (inputObject instanceof newType) return inputObject; + const newObject = new newType(); + newObject.idBlock = inputObject.idBlock; + newObject.lenBlock = inputObject.lenBlock; + newObject.warnings = inputObject.warnings; + newObject.valueBeforeDecodeView = inputObject.valueBeforeDecodeView; + return newObject; + } + function localFromBER(inputBuffer, inputOffset = 0, inputLength = inputBuffer.length, context = createFromBerContext()) { + const incomingOffset = inputOffset; + let returnObject = new BaseBlock({}, ValueBlock); + const baseBlock = new LocalBaseBlock(); + if (!checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength)) { + returnObject.error = baseBlock.error; + return { + offset: -1, + result: returnObject + }; + } + if (!inputBuffer.subarray(inputOffset, inputOffset + inputLength).length) { + returnObject.error = "Zero buffer length"; + return { + offset: -1, + result: returnObject + }; + } + const nodesLimitError = checkNodesLimit(context); + if (nodesLimitError) { + returnObject.error = nodesLimitError; + return { + offset: -1, + result: returnObject + }; + } + let resultOffset = returnObject.idBlock.fromBER(inputBuffer, inputOffset, inputLength); + if (returnObject.idBlock.warnings.length) returnObject.warnings.concat(returnObject.idBlock.warnings); + if (resultOffset === -1) { + returnObject.error = returnObject.idBlock.error; + return { + offset: -1, + result: returnObject + }; + } + inputOffset = resultOffset; + inputLength -= returnObject.idBlock.blockLength; + resultOffset = returnObject.lenBlock.fromBER(inputBuffer, inputOffset, inputLength); + if (returnObject.lenBlock.warnings.length) returnObject.warnings.concat(returnObject.lenBlock.warnings); + if (resultOffset === -1) { + returnObject.error = returnObject.lenBlock.error; + return { + offset: -1, + result: returnObject + }; + } + inputOffset = resultOffset; + inputLength -= returnObject.lenBlock.blockLength; + const valueLength = returnObject.lenBlock.isIndefiniteForm ? inputLength : returnObject.lenBlock.length; + const contentLengthError = checkContentLengthLimit(valueLength, context); + if (contentLengthError) { + returnObject.error = contentLengthError; + return { + offset: -1, + result: returnObject + }; + } + if (!returnObject.idBlock.isConstructed && returnObject.lenBlock.isIndefiniteForm) { + returnObject.error = "Indefinite length form used for primitive encoding form"; + return { + offset: -1, + result: returnObject + }; + } + let newASN1Type = BaseBlock; + switch (returnObject.idBlock.tagClass) { + case 1: + if (returnObject.idBlock.tagNumber >= 37 && returnObject.idBlock.isHexOnly === false) { + returnObject.error = "UNIVERSAL 37 and upper tags are reserved by ASN.1 standard"; + return { + offset: -1, + result: returnObject + }; + } + switch (returnObject.idBlock.tagNumber) { + case 0: + if (returnObject.idBlock.isConstructed && returnObject.lenBlock.length > 0) { + returnObject.error = "Type [UNIVERSAL 0] is reserved"; + return { + offset: -1, + result: returnObject + }; + } + newASN1Type = typeStore.EndOfContent; + break; + case 1: + newASN1Type = typeStore.Boolean; + break; + case 2: + newASN1Type = typeStore.Integer; + break; + case 3: + newASN1Type = typeStore.BitString; + break; + case 4: + newASN1Type = typeStore.OctetString; + break; + case 5: + newASN1Type = typeStore.Null; + break; + case 6: + newASN1Type = typeStore.ObjectIdentifier; + break; + case 10: + newASN1Type = typeStore.Enumerated; + break; + case 12: + newASN1Type = typeStore.Utf8String; + break; + case 13: + newASN1Type = typeStore.RelativeObjectIdentifier; + break; + case 14: + newASN1Type = typeStore.TIME; + break; + case 15: + returnObject.error = "[UNIVERSAL 15] is reserved by ASN.1 standard"; + return { + offset: -1, + result: returnObject + }; + case 16: + newASN1Type = typeStore.Sequence; + break; + case 17: + newASN1Type = typeStore.Set; + break; + case 18: + newASN1Type = typeStore.NumericString; + break; + case 19: + newASN1Type = typeStore.PrintableString; + break; + case 20: + newASN1Type = typeStore.TeletexString; + break; + case 21: + newASN1Type = typeStore.VideotexString; + break; + case 22: + newASN1Type = typeStore.IA5String; + break; + case 23: + newASN1Type = typeStore.UTCTime; + break; + case 24: + newASN1Type = typeStore.GeneralizedTime; + break; + case 25: + newASN1Type = typeStore.GraphicString; + break; + case 26: + newASN1Type = typeStore.VisibleString; + break; + case 27: + newASN1Type = typeStore.GeneralString; + break; + case 28: + newASN1Type = typeStore.UniversalString; + break; + case 29: + newASN1Type = typeStore.CharacterString; + break; + case 30: + newASN1Type = typeStore.BmpString; + break; + case 31: + newASN1Type = typeStore.DATE; + break; + case 32: + newASN1Type = typeStore.TimeOfDay; + break; + case 33: + newASN1Type = typeStore.DateTime; + break; + case 34: + newASN1Type = typeStore.Duration; + break; + default: { + const newObject = returnObject.idBlock.isConstructed ? new typeStore.Constructed() : new typeStore.Primitive(); + newObject.idBlock = returnObject.idBlock; + newObject.lenBlock = returnObject.lenBlock; + newObject.warnings = returnObject.warnings; + returnObject = newObject; + } + } + break; + default: newASN1Type = returnObject.idBlock.isConstructed ? typeStore.Constructed : typeStore.Primitive; + } + returnObject = localChangeType(returnObject, newASN1Type); + resultOffset = returnObject.fromBER(inputBuffer, inputOffset, valueLength, context); + returnObject.valueBeforeDecodeView = inputBuffer.subarray(incomingOffset, incomingOffset + returnObject.blockLength); + return { + offset: resultOffset, + result: returnObject + }; + } + function fromBER(inputBuffer, options = {}) { + if (!inputBuffer.byteLength) { + const result = new BaseBlock({}, ValueBlock); + result.error = "Input buffer has zero length"; + return { + offset: -1, + result + }; + } + return localFromBER(pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength, createFromBerContext(options)); + } + function checkLen(indefiniteLength, length) { + if (indefiniteLength) return 1; + return length; + } + var LocalConstructedValueBlock = class extends ValueBlock { + constructor({ value = [], isIndefiniteForm = false, ...parameters } = {}) { + super(parameters); + this.value = value; + this.isIndefiniteForm = isIndefiniteForm; + } + fromBER(inputBuffer, inputOffset, inputLength, context) { + const view = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + const parseContext = context !== null && context !== void 0 ? context : createFromBerContext(); + if (!checkBufferParams(this, view, inputOffset, inputLength)) return -1; + this.valueBeforeDecodeView = view.subarray(inputOffset, inputOffset + inputLength); + if (this.valueBeforeDecodeView.length === 0) { + this.warnings.push("Zero buffer length"); + return inputOffset; + } + let currentOffset = inputOffset; + while (checkLen(this.isIndefiniteForm, inputLength) > 0) { + const returnObject = localFromBERWithChildContext(view, currentOffset, inputLength, parseContext); + if (returnObject.offset === -1) { + this.error = returnObject.result.error; + this.warnings.concat(returnObject.result.warnings); + return -1; + } + currentOffset = returnObject.offset; + this.blockLength += returnObject.result.blockLength; + inputLength -= returnObject.result.blockLength; + this.value.push(returnObject.result); + if (this.isIndefiniteForm && returnObject.result.constructor.NAME === END_OF_CONTENT_NAME) break; + } + if (this.isIndefiniteForm) if (this.value[this.value.length - 1].constructor.NAME === END_OF_CONTENT_NAME) this.value.pop(); + else this.warnings.push("No EndOfContent block encoded"); + return currentOffset; + } + toBER(sizeOnly, writer) { + const _writer = writer || new ViewWriter(); + for (let i = 0; i < this.value.length; i++) this.value[i].toBER(sizeOnly, _writer); + if (!writer) return _writer.final(); + return EMPTY_BUFFER; + } + toJSON() { + const object = { + ...super.toJSON(), + isIndefiniteForm: this.isIndefiniteForm, + value: [] + }; + for (const value of this.value) object.value.push(value.toJSON()); + return object; + } + }; + LocalConstructedValueBlock.NAME = "ConstructedValueBlock"; + var _a$v; + var Constructed = class extends BaseBlock { + constructor(parameters = {}) { + super(parameters, LocalConstructedValueBlock); + this.idBlock.isConstructed = true; + } + fromBER(inputBuffer, inputOffset, inputLength, context) { + this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm; + const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, this.lenBlock.isIndefiniteForm ? inputLength : this.lenBlock.length, context); + if (resultOffset === -1) { + this.error = this.valueBlock.error; + return resultOffset; + } + if (!this.idBlock.error.length) this.blockLength += this.idBlock.blockLength; + if (!this.lenBlock.error.length) this.blockLength += this.lenBlock.blockLength; + if (!this.valueBlock.error.length) this.blockLength += this.valueBlock.blockLength; + return resultOffset; + } + onAsciiEncoding() { + const values = []; + for (const value of this.valueBlock.value) values.push(value.toString("ascii").split("\n").map((o) => ` ${o}`).join("\n")); + const blockName = this.idBlock.tagClass === 3 ? `[${this.idBlock.tagNumber}]` : this.constructor.NAME; + return values.length ? `${blockName} :\n${values.join("\n")}` : `${blockName} :`; + } + }; + _a$v = Constructed; + (() => { + typeStore.Constructed = _a$v; + })(); + Constructed.NAME = "CONSTRUCTED"; + var LocalEndOfContentValueBlock = class extends ValueBlock { + fromBER(inputBuffer, inputOffset, _inputLength) { + return inputOffset; + } + toBER(_sizeOnly) { + return EMPTY_BUFFER; + } + }; + LocalEndOfContentValueBlock.override = "EndOfContentValueBlock"; + var _a$u; + var EndOfContent = class extends BaseBlock { + constructor(parameters = {}) { + super(parameters, LocalEndOfContentValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 0; + } + }; + _a$u = EndOfContent; + (() => { + typeStore.EndOfContent = _a$u; + })(); + EndOfContent.NAME = END_OF_CONTENT_NAME; + var _a$t; + var Null = class extends BaseBlock { + constructor(parameters = {}) { + super(parameters, ValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 5; + } + fromBER(inputBuffer, inputOffset, inputLength) { + if (this.lenBlock.length > 0) this.warnings.push("Non-zero length of value block for Null type"); + if (!this.idBlock.error.length) this.blockLength += this.idBlock.blockLength; + if (!this.lenBlock.error.length) this.blockLength += this.lenBlock.blockLength; + this.blockLength += inputLength; + if (inputOffset + inputLength > inputBuffer.byteLength) { + this.error = "End of input reached before message was fully decoded (inconsistent offset and length values)"; + return -1; + } + return inputOffset + inputLength; + } + toBER(sizeOnly, writer) { + const retBuf = /* @__PURE__ */ new ArrayBuffer(2); + if (!sizeOnly) { + const retView = new Uint8Array(retBuf); + retView[0] = 5; + retView[1] = 0; + } + if (writer) writer.write(retBuf); + return retBuf; + } + onAsciiEncoding() { + return `${this.constructor.NAME}`; + } + }; + _a$t = Null; + (() => { + typeStore.Null = _a$t; + })(); + Null.NAME = "NULL"; + var LocalBooleanValueBlock = class extends HexBlock(ValueBlock) { + get value() { + for (const octet of this.valueHexView) if (octet > 0) return true; + return false; + } + set value(value) { + this.valueHexView[0] = value ? 255 : 0; + } + constructor({ value, ...parameters } = {}) { + super(parameters); + if (parameters.valueHex) this.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(parameters.valueHex); + else this.valueHexView = new Uint8Array(1); + if (value) this.value = value; + } + fromBER(inputBuffer, inputOffset, inputLength) { + const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + if (!checkBufferParams(this, inputView, inputOffset, inputLength)) return -1; + this.valueHexView = inputView.subarray(inputOffset, inputOffset + inputLength); + if (inputLength > 1) this.warnings.push("Boolean value encoded in more then 1 octet"); + this.isHexOnly = true; + pvutils__namespace.utilDecodeTC.call(this); + this.blockLength = inputLength; + return inputOffset + inputLength; + } + toBER() { + return this.valueHexView.slice(); + } + toJSON() { + return { + ...super.toJSON(), + value: this.value + }; + } + }; + LocalBooleanValueBlock.NAME = "BooleanValueBlock"; + var _a$s; + var Boolean = class extends BaseBlock { + getValue() { + return this.valueBlock.value; + } + setValue(value) { + this.valueBlock.value = value; + } + constructor(parameters = {}) { + super(parameters, LocalBooleanValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 1; + } + onAsciiEncoding() { + return `${this.constructor.NAME} : ${this.getValue}`; + } + }; + _a$s = Boolean; + (() => { + typeStore.Boolean = _a$s; + })(); + Boolean.NAME = "BOOLEAN"; + var LocalOctetStringValueBlock = class extends HexBlock(LocalConstructedValueBlock) { + constructor({ isConstructed = false, ...parameters } = {}) { + super(parameters); + this.isConstructed = isConstructed; + } + fromBER(inputBuffer, inputOffset, inputLength, context) { + let resultOffset = 0; + if (this.isConstructed) { + this.isHexOnly = false; + resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context); + if (resultOffset === -1) return resultOffset; + for (let i = 0; i < this.value.length; i++) { + const currentBlockName = this.value[i].constructor.NAME; + if (currentBlockName === END_OF_CONTENT_NAME) if (this.isIndefiniteForm) break; + else { + this.error = "EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only"; + return -1; + } + if (currentBlockName !== OCTET_STRING_NAME) { + this.error = "OCTET STRING may consists of OCTET STRINGs only"; + return -1; + } + } + } else { + this.isHexOnly = true; + resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength); + this.blockLength = inputLength; + } + return resultOffset; + } + toBER(sizeOnly, writer) { + if (this.isConstructed) return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer); + return sizeOnly ? new ArrayBuffer(this.valueHexView.byteLength) : this.valueHexView.slice().buffer; + } + toJSON() { + return { + ...super.toJSON(), + isConstructed: this.isConstructed + }; + } + }; + LocalOctetStringValueBlock.NAME = "OctetStringValueBlock"; + var _a$r; + var OctetString = class extends BaseBlock { + constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) { + var _b, _c; + (_b = parameters.isConstructed) !== null && _b !== void 0 || (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length)); + super({ + idBlock: { + isConstructed: parameters.isConstructed, + ...idBlock + }, + lenBlock: { + ...lenBlock, + isIndefiniteForm: !!parameters.isIndefiniteForm + }, + ...parameters + }, LocalOctetStringValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 4; + } + fromBER(inputBuffer, inputOffset, inputLength, context) { + this.valueBlock.isConstructed = this.idBlock.isConstructed; + this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm; + if (inputLength === 0) { + if (this.idBlock.error.length === 0) this.blockLength += this.idBlock.blockLength; + if (this.lenBlock.error.length === 0) this.blockLength += this.lenBlock.blockLength; + return inputOffset; + } + if (!this.valueBlock.isConstructed) { + const buf = (inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer).subarray(inputOffset, inputOffset + inputLength); + try { + if (buf.byteLength) { + const parseContext = context !== null && context !== void 0 ? context : createFromBerContext(); + const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext); + if (asn.offset !== -1 && asn.offset === inputLength) this.valueBlock.value = [asn.result]; + } + } catch {} + } + return super.fromBER(inputBuffer, inputOffset, inputLength, context); + } + onAsciiEncoding() { + if (this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length) return Constructed.prototype.onAsciiEncoding.call(this); + return `${this.constructor.NAME} : ${pvtsutils__namespace.Convert.ToHex(this.valueBlock.valueHexView)}`; + } + getValue() { + if (!this.idBlock.isConstructed) return this.valueBlock.valueHexView.slice().buffer; + const array = []; + for (const content of this.valueBlock.value) if (content instanceof _a$r) array.push(content.valueBlock.valueHexView); + return pvtsutils__namespace.BufferSourceConverter.concat(array); + } + }; + _a$r = OctetString; + (() => { + typeStore.OctetString = _a$r; + })(); + OctetString.NAME = OCTET_STRING_NAME; + var LocalBitStringValueBlock = class extends HexBlock(LocalConstructedValueBlock) { + constructor({ unusedBits = 0, isConstructed = false, ...parameters } = {}) { + super(parameters); + this.unusedBits = unusedBits; + this.isConstructed = isConstructed; + this.blockLength = this.valueHexView.byteLength; + } + fromBER(inputBuffer, inputOffset, inputLength, context) { + if (!inputLength) return inputOffset; + let resultOffset = -1; + if (this.isConstructed) { + resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context); + if (resultOffset === -1) return resultOffset; + for (const value of this.value) { + const currentBlockName = value.constructor.NAME; + if (currentBlockName === END_OF_CONTENT_NAME) if (this.isIndefiniteForm) break; + else { + this.error = "EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only"; + return -1; + } + if (currentBlockName !== BIT_STRING_NAME) { + this.error = "BIT STRING may consists of BIT STRINGs only"; + return -1; + } + const valueBlock = value.valueBlock; + if (this.unusedBits > 0 && valueBlock.unusedBits > 0) { + this.error = "Using of \"unused bits\" inside constructive BIT STRING allowed for least one only"; + return -1; + } + this.unusedBits = valueBlock.unusedBits; + } + return resultOffset; + } + const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + if (!checkBufferParams(this, inputView, inputOffset, inputLength)) return -1; + const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength); + this.unusedBits = intBuffer[0]; + if (this.unusedBits > 7) { + this.error = "Unused bits for BitString must be in range 0-7"; + return -1; + } + if (!this.unusedBits) { + const buf = intBuffer.subarray(1); + try { + if (buf.byteLength) { + const parseContext = context !== null && context !== void 0 ? context : createFromBerContext(); + const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext); + if (asn.offset !== -1 && asn.offset === inputLength - 1) this.value = [asn.result]; + } + } catch {} + } + this.valueHexView = intBuffer.subarray(1); + this.blockLength = intBuffer.length; + return inputOffset + inputLength; + } + toBER(sizeOnly, writer) { + if (this.isConstructed) return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer); + if (sizeOnly) return new ArrayBuffer(this.valueHexView.byteLength + 1); + if (!this.valueHexView.byteLength) { + const empty = new Uint8Array(1); + empty[0] = 0; + return empty.buffer; + } + const retView = new Uint8Array(this.valueHexView.length + 1); + retView[0] = this.unusedBits; + retView.set(this.valueHexView, 1); + return retView.buffer; + } + toJSON() { + return { + ...super.toJSON(), + unusedBits: this.unusedBits, + isConstructed: this.isConstructed + }; + } + }; + LocalBitStringValueBlock.NAME = "BitStringValueBlock"; + var _a$q; + var BitString = class extends BaseBlock { + constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) { + var _b, _c; + (_b = parameters.isConstructed) !== null && _b !== void 0 || (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length)); + super({ + idBlock: { + isConstructed: parameters.isConstructed, + ...idBlock + }, + lenBlock: { + ...lenBlock, + isIndefiniteForm: !!parameters.isIndefiniteForm + }, + ...parameters + }, LocalBitStringValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 3; + } + fromBER(inputBuffer, inputOffset, inputLength, context) { + this.valueBlock.isConstructed = this.idBlock.isConstructed; + this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm; + return super.fromBER(inputBuffer, inputOffset, inputLength, context); + } + onAsciiEncoding() { + if (this.valueBlock.isConstructed || this.valueBlock.value && this.valueBlock.value.length) return Constructed.prototype.onAsciiEncoding.call(this); + else { + const bits = []; + const valueHex = this.valueBlock.valueHexView; + for (const byte of valueHex) bits.push(byte.toString(2).padStart(8, "0")); + const bitsStr = bits.join(""); + return `${this.constructor.NAME} : ${bitsStr.substring(0, bitsStr.length - this.valueBlock.unusedBits)}`; + } + } + }; + _a$q = BitString; + (() => { + typeStore.BitString = _a$q; + })(); + BitString.NAME = BIT_STRING_NAME; + var _a$p; + function viewAdd(first, second) { + const c = new Uint8Array([0]); + const firstView = new Uint8Array(first); + const secondView = new Uint8Array(second); + let firstViewCopy = firstView.slice(0); + const firstViewCopyLength = firstViewCopy.length - 1; + const secondViewCopy = secondView.slice(0); + const secondViewCopyLength = secondViewCopy.length - 1; + let value = 0; + const max = secondViewCopyLength < firstViewCopyLength ? firstViewCopyLength : secondViewCopyLength; + let counter = 0; + for (let i = max; i >= 0; i--, counter++) { + switch (true) { + case counter < secondViewCopy.length: + value = firstViewCopy[firstViewCopyLength - counter] + secondViewCopy[secondViewCopyLength - counter] + c[0]; + break; + default: value = firstViewCopy[firstViewCopyLength - counter] + c[0]; + } + c[0] = value / 10; + switch (true) { + case counter >= firstViewCopy.length: + firstViewCopy = pvutils__namespace.utilConcatView(new Uint8Array([value % 10]), firstViewCopy); + break; + default: firstViewCopy[firstViewCopyLength - counter] = value % 10; + } + } + if (c[0] > 0) firstViewCopy = pvutils__namespace.utilConcatView(c, firstViewCopy); + return firstViewCopy; + } + function power2(n) { + if (n >= powers2.length) for (let p = powers2.length; p <= n; p++) { + const c = new Uint8Array([0]); + let digits = powers2[p - 1].slice(0); + for (let i = digits.length - 1; i >= 0; i--) { + const newValue = new Uint8Array([(digits[i] << 1) + c[0]]); + c[0] = newValue[0] / 10; + digits[i] = newValue[0] % 10; + } + if (c[0] > 0) digits = pvutils__namespace.utilConcatView(c, digits); + powers2.push(digits); + } + return powers2[n]; + } + function viewSub(first, second) { + let b = 0; + const firstView = new Uint8Array(first); + const secondView = new Uint8Array(second); + const firstViewCopy = firstView.slice(0); + const firstViewCopyLength = firstViewCopy.length - 1; + const secondViewCopy = secondView.slice(0); + const secondViewCopyLength = secondViewCopy.length - 1; + let value; + let counter = 0; + for (let i = secondViewCopyLength; i >= 0; i--, counter++) { + value = firstViewCopy[firstViewCopyLength - counter] - secondViewCopy[secondViewCopyLength - counter] - b; + switch (true) { + case value < 0: + b = 1; + firstViewCopy[firstViewCopyLength - counter] = value + 10; + break; + default: + b = 0; + firstViewCopy[firstViewCopyLength - counter] = value; + } + } + if (b > 0) for (let i = firstViewCopyLength - secondViewCopyLength + 1; i >= 0; i--, counter++) { + value = firstViewCopy[firstViewCopyLength - counter] - b; + if (value < 0) { + b = 1; + firstViewCopy[firstViewCopyLength - counter] = value + 10; + } else { + b = 0; + firstViewCopy[firstViewCopyLength - counter] = value; + break; + } + } + return firstViewCopy.slice(); + } + var LocalIntegerValueBlock = class extends HexBlock(ValueBlock) { + setValueHex() { + if (this.valueHexView.length >= 4) { + this.warnings.push("Too big Integer for decoding, hex only"); + this.isHexOnly = true; + this._valueDec = 0; + } else { + this.isHexOnly = false; + if (this.valueHexView.length > 0) this._valueDec = pvutils__namespace.utilDecodeTC.call(this); + } + } + constructor({ value, ...parameters } = {}) { + super(parameters); + this._valueDec = 0; + if (parameters.valueHex) this.setValueHex(); + if (value !== void 0) this.valueDec = value; + } + set valueDec(v) { + this._valueDec = v; + this.isHexOnly = false; + this.valueHexView = new Uint8Array(pvutils__namespace.utilEncodeTC(v)); + } + get valueDec() { + return this._valueDec; + } + fromDER(inputBuffer, inputOffset, inputLength, expectedLength = 0) { + const offset = this.fromBER(inputBuffer, inputOffset, inputLength); + if (offset === -1) return offset; + const view = this.valueHexView; + if (view[0] === 0 && (view[1] & 128) !== 0) this.valueHexView = view.subarray(1); + else if (expectedLength !== 0) { + if (view.length < expectedLength) { + if (expectedLength - view.length > 1) expectedLength = view.length + 1; + this.valueHexView = view.subarray(expectedLength - view.length); + } + } + return offset; + } + toDER(sizeOnly = false) { + const view = this.valueHexView; + switch (true) { + case (view[0] & 128) !== 0: + { + const updatedView = new Uint8Array(this.valueHexView.length + 1); + updatedView[0] = 0; + updatedView.set(view, 1); + this.valueHexView = updatedView; + } + break; + case view[0] === 0 && (view[1] & 128) === 0: + this.valueHexView = this.valueHexView.subarray(1); + break; + } + return this.toBER(sizeOnly); + } + fromBER(inputBuffer, inputOffset, inputLength) { + const resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength); + if (resultOffset === -1) return resultOffset; + this.setValueHex(); + return resultOffset; + } + toBER(sizeOnly) { + return sizeOnly ? new ArrayBuffer(this.valueHexView.length) : this.valueHexView.slice().buffer; + } + toJSON() { + return { + ...super.toJSON(), + valueDec: this.valueDec + }; + } + toString() { + const firstBit = this.valueHexView.length * 8 - 1; + let digits = new Uint8Array(this.valueHexView.length * 8 / 3); + let bitNumber = 0; + let currentByte; + const asn1View = this.valueHexView; + let result = ""; + let flag = false; + for (let byteNumber = asn1View.byteLength - 1; byteNumber >= 0; byteNumber--) { + currentByte = asn1View[byteNumber]; + for (let i = 0; i < 8; i++) { + if ((currentByte & 1) === 1) switch (bitNumber) { + case firstBit: + digits = viewSub(power2(bitNumber), digits); + result = "-"; + break; + default: digits = viewAdd(digits, power2(bitNumber)); + } + bitNumber++; + currentByte >>= 1; + } + } + for (let i = 0; i < digits.length; i++) { + if (digits[i]) flag = true; + if (flag) result += digitsString.charAt(digits[i]); + } + if (flag === false) result += digitsString.charAt(0); + return result; + } + }; + _a$p = LocalIntegerValueBlock; + LocalIntegerValueBlock.NAME = "IntegerValueBlock"; + (() => { + Object.defineProperty(_a$p.prototype, "valueHex", { + set: function(v) { + this.valueHexView = new Uint8Array(v); + this.setValueHex(); + }, + get: function() { + return this.valueHexView.slice().buffer; + } + }); + })(); + var _a$o; + var Integer = class extends BaseBlock { + constructor(parameters = {}) { + super(parameters, LocalIntegerValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 2; + } + toBigInt() { + assertBigInt(); + return BigInt(this.valueBlock.toString()); + } + static fromBigInt(value) { + assertBigInt(); + const bigIntValue = BigInt(value); + const writer = new ViewWriter(); + const hex = bigIntValue.toString(16).replace(/^-/, ""); + const view = new Uint8Array(pvtsutils__namespace.Convert.FromHex(hex)); + if (bigIntValue < 0) { + const first = new Uint8Array(view.length + (view[0] & 128 ? 1 : 0)); + first[0] |= 128; + const secondInt = BigInt(`0x${pvtsutils__namespace.Convert.ToHex(first)}`) + bigIntValue; + const second = pvtsutils__namespace.BufferSourceConverter.toUint8Array(pvtsutils__namespace.Convert.FromHex(secondInt.toString(16))); + second[0] |= 128; + writer.write(second); + } else { + if (view[0] & 128) writer.write(new Uint8Array([0])); + writer.write(view); + } + return new _a$o({ valueHex: writer.final() }); + } + convertToDER() { + const integer = new _a$o({ valueHex: this.valueBlock.valueHexView }); + integer.valueBlock.toDER(); + return integer; + } + convertFromDER() { + return new _a$o({ valueHex: this.valueBlock.valueHexView[0] === 0 ? this.valueBlock.valueHexView.subarray(1) : this.valueBlock.valueHexView }); + } + onAsciiEncoding() { + return `${this.constructor.NAME} : ${this.valueBlock.toString()}`; + } + }; + _a$o = Integer; + (() => { + typeStore.Integer = _a$o; + })(); + Integer.NAME = "INTEGER"; + var _a$n; + var Enumerated = class extends Integer { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 10; + } + }; + _a$n = Enumerated; + (() => { + typeStore.Enumerated = _a$n; + })(); + Enumerated.NAME = "ENUMERATED"; + var LocalSidValueBlock = class extends HexBlock(ValueBlock) { + constructor({ valueDec = -1, isFirstSid = false, ...parameters } = {}) { + super(parameters); + this.valueDec = valueDec; + this.isFirstSid = isFirstSid; + } + fromBER(inputBuffer, inputOffset, inputLength) { + if (!inputLength) return inputOffset; + const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + if (!checkBufferParams(this, inputView, inputOffset, inputLength)) return -1; + const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength); + this.valueHexView = new Uint8Array(inputLength); + for (let i = 0; i < inputLength; i++) { + this.valueHexView[i] = intBuffer[i] & 127; + this.blockLength++; + if ((intBuffer[i] & 128) === 0) break; + } + const tempView = new Uint8Array(this.blockLength); + for (let i = 0; i < this.blockLength; i++) tempView[i] = this.valueHexView[i]; + this.valueHexView = tempView; + if ((intBuffer[this.blockLength - 1] & 128) !== 0) { + this.error = "End of input reached before message was fully decoded"; + return -1; + } + if (this.valueHexView[0] === 0) this.warnings.push("Needlessly long format of SID encoding"); + if (this.blockLength <= 8) this.valueDec = pvutils__namespace.utilFromBase(this.valueHexView, 7); + else { + this.isHexOnly = true; + this.warnings.push("Too big SID for decoding, hex only"); + } + return inputOffset + this.blockLength; + } + set valueBigInt(value) { + assertBigInt(); + let bits = BigInt(value).toString(2); + while (bits.length % 7) bits = "0" + bits; + const bytes = new Uint8Array(bits.length / 7); + for (let i = 0; i < bytes.length; i++) bytes[i] = parseInt(bits.slice(i * 7, i * 7 + 7), 2) + (i + 1 < bytes.length ? 128 : 0); + this.fromBER(bytes.buffer, 0, bytes.length); + } + toBER(sizeOnly) { + if (this.isHexOnly) { + if (sizeOnly) return new ArrayBuffer(this.valueHexView.byteLength); + const curView = this.valueHexView; + const retView = new Uint8Array(this.blockLength); + for (let i = 0; i < this.blockLength - 1; i++) retView[i] = curView[i] | 128; + retView[this.blockLength - 1] = curView[this.blockLength - 1]; + return retView.buffer; + } + const encodedBuf = pvutils__namespace.utilToBase(this.valueDec, 7); + if (encodedBuf.byteLength === 0) { + this.error = "Error during encoding SID value"; + return EMPTY_BUFFER; + } + const retView = new Uint8Array(encodedBuf.byteLength); + if (!sizeOnly) { + const encodedView = new Uint8Array(encodedBuf); + const len = encodedBuf.byteLength - 1; + for (let i = 0; i < len; i++) retView[i] = encodedView[i] | 128; + retView[len] = encodedView[len]; + } + return retView; + } + toString() { + let result = ""; + if (this.isHexOnly) result = pvtsutils__namespace.Convert.ToHex(this.valueHexView); + else if (this.isFirstSid) { + let sidValue = this.valueDec; + if (this.valueDec <= 39) result = "0."; + else if (this.valueDec <= 79) { + result = "1."; + sidValue -= 40; + } else { + result = "2."; + sidValue -= 80; + } + result += sidValue.toString(); + } else result = this.valueDec.toString(); + return result; + } + toJSON() { + return { + ...super.toJSON(), + valueDec: this.valueDec, + isFirstSid: this.isFirstSid + }; + } + }; + LocalSidValueBlock.NAME = "sidBlock"; + var LocalObjectIdentifierValueBlock = class extends ValueBlock { + constructor({ value = EMPTY_STRING, ...parameters } = {}) { + super(parameters); + this.value = []; + if (value) this.fromString(value); + } + fromBER(inputBuffer, inputOffset, inputLength) { + let resultOffset = inputOffset; + while (inputLength > 0) { + const sidBlock = new LocalSidValueBlock(); + resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength); + if (resultOffset === -1) { + this.blockLength = 0; + this.error = sidBlock.error; + return resultOffset; + } + if (this.value.length === 0) sidBlock.isFirstSid = true; + this.blockLength += sidBlock.blockLength; + inputLength -= sidBlock.blockLength; + this.value.push(sidBlock); + } + return resultOffset; + } + toBER(sizeOnly) { + const retBuffers = []; + for (let i = 0; i < this.value.length; i++) { + const valueBuf = this.value[i].toBER(sizeOnly); + if (valueBuf.byteLength === 0) { + this.error = this.value[i].error; + return EMPTY_BUFFER; + } + retBuffers.push(valueBuf); + } + return concat(retBuffers); + } + fromString(string) { + this.value = []; + let pos1 = 0; + let pos2 = 0; + let sid = ""; + let flag = false; + do { + pos2 = string.indexOf(".", pos1); + if (pos2 === -1) sid = string.substring(pos1); + else sid = string.substring(pos1, pos2); + pos1 = pos2 + 1; + if (flag) { + const sidBlock = this.value[0]; + let plus = 0; + switch (sidBlock.valueDec) { + case 0: break; + case 1: + plus = 40; + break; + case 2: + plus = 80; + break; + default: + this.value = []; + return; + } + const parsedSID = parseInt(sid, 10); + if (isNaN(parsedSID)) return; + sidBlock.valueDec = parsedSID + plus; + flag = false; + } else { + const sidBlock = new LocalSidValueBlock(); + if (sid > Number.MAX_SAFE_INTEGER) { + assertBigInt(); + sidBlock.valueBigInt = BigInt(sid); + } else { + sidBlock.valueDec = parseInt(sid, 10); + if (isNaN(sidBlock.valueDec)) return; + } + if (!this.value.length) { + sidBlock.isFirstSid = true; + flag = true; + } + this.value.push(sidBlock); + } + } while (pos2 !== -1); + } + toString() { + let result = ""; + let isHexOnly = false; + for (let i = 0; i < this.value.length; i++) { + isHexOnly = this.value[i].isHexOnly; + let sidStr = this.value[i].toString(); + if (i !== 0) result = `${result}.`; + if (isHexOnly) { + sidStr = `{${sidStr}}`; + if (this.value[i].isFirstSid) result = `2.{${sidStr} - 80}`; + else result += sidStr; + } else result += sidStr; + } + return result; + } + toJSON() { + const object = { + ...super.toJSON(), + value: this.toString(), + sidArray: [] + }; + for (let i = 0; i < this.value.length; i++) object.sidArray.push(this.value[i].toJSON()); + return object; + } + }; + LocalObjectIdentifierValueBlock.NAME = "ObjectIdentifierValueBlock"; + var _a$m; + var ObjectIdentifier = class extends BaseBlock { + getValue() { + return this.valueBlock.toString(); + } + setValue(value) { + this.valueBlock.fromString(value); + } + constructor(parameters = {}) { + super(parameters, LocalObjectIdentifierValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 6; + } + onAsciiEncoding() { + return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`; + } + toJSON() { + return { + ...super.toJSON(), + value: this.getValue() + }; + } + }; + _a$m = ObjectIdentifier; + (() => { + typeStore.ObjectIdentifier = _a$m; + })(); + ObjectIdentifier.NAME = "OBJECT IDENTIFIER"; + var LocalRelativeSidValueBlock = class extends HexBlock(LocalBaseBlock) { + constructor({ valueDec = 0, ...parameters } = {}) { + super(parameters); + this.valueDec = valueDec; + } + fromBER(inputBuffer, inputOffset, inputLength) { + if (inputLength === 0) return inputOffset; + const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + if (!checkBufferParams(this, inputView, inputOffset, inputLength)) return -1; + const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength); + this.valueHexView = new Uint8Array(inputLength); + for (let i = 0; i < inputLength; i++) { + this.valueHexView[i] = intBuffer[i] & 127; + this.blockLength++; + if ((intBuffer[i] & 128) === 0) break; + } + const tempView = new Uint8Array(this.blockLength); + for (let i = 0; i < this.blockLength; i++) tempView[i] = this.valueHexView[i]; + this.valueHexView = tempView; + if ((intBuffer[this.blockLength - 1] & 128) !== 0) { + this.error = "End of input reached before message was fully decoded"; + return -1; + } + if (this.valueHexView[0] === 0) this.warnings.push("Needlessly long format of SID encoding"); + if (this.blockLength <= 8) this.valueDec = pvutils__namespace.utilFromBase(this.valueHexView, 7); + else { + this.isHexOnly = true; + this.warnings.push("Too big SID for decoding, hex only"); + } + return inputOffset + this.blockLength; + } + toBER(sizeOnly) { + if (this.isHexOnly) { + if (sizeOnly) return new ArrayBuffer(this.valueHexView.byteLength); + const curView = this.valueHexView; + const retView = new Uint8Array(this.blockLength); + for (let i = 0; i < this.blockLength - 1; i++) retView[i] = curView[i] | 128; + retView[this.blockLength - 1] = curView[this.blockLength - 1]; + return retView.buffer; + } + const encodedBuf = pvutils__namespace.utilToBase(this.valueDec, 7); + if (encodedBuf.byteLength === 0) { + this.error = "Error during encoding SID value"; + return EMPTY_BUFFER; + } + const retView = new Uint8Array(encodedBuf.byteLength); + if (!sizeOnly) { + const encodedView = new Uint8Array(encodedBuf); + const len = encodedBuf.byteLength - 1; + for (let i = 0; i < len; i++) retView[i] = encodedView[i] | 128; + retView[len] = encodedView[len]; + } + return retView.buffer; + } + toString() { + let result = ""; + if (this.isHexOnly) result = pvtsutils__namespace.Convert.ToHex(this.valueHexView); + else result = this.valueDec.toString(); + return result; + } + toJSON() { + return { + ...super.toJSON(), + valueDec: this.valueDec + }; + } + }; + LocalRelativeSidValueBlock.NAME = "relativeSidBlock"; + var LocalRelativeObjectIdentifierValueBlock = class extends ValueBlock { + constructor({ value = EMPTY_STRING, ...parameters } = {}) { + super(parameters); + this.value = []; + if (value) this.fromString(value); + } + fromBER(inputBuffer, inputOffset, inputLength) { + let resultOffset = inputOffset; + while (inputLength > 0) { + const sidBlock = new LocalRelativeSidValueBlock(); + resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength); + if (resultOffset === -1) { + this.blockLength = 0; + this.error = sidBlock.error; + return resultOffset; + } + this.blockLength += sidBlock.blockLength; + inputLength -= sidBlock.blockLength; + this.value.push(sidBlock); + } + return resultOffset; + } + toBER(sizeOnly, _writer) { + const retBuffers = []; + for (let i = 0; i < this.value.length; i++) { + const valueBuf = this.value[i].toBER(sizeOnly); + if (valueBuf.byteLength === 0) { + this.error = this.value[i].error; + return EMPTY_BUFFER; + } + retBuffers.push(valueBuf); + } + return concat(retBuffers); + } + fromString(string) { + this.value = []; + let pos1 = 0; + let pos2 = 0; + let sid = ""; + do { + pos2 = string.indexOf(".", pos1); + if (pos2 === -1) sid = string.substring(pos1); + else sid = string.substring(pos1, pos2); + pos1 = pos2 + 1; + const sidBlock = new LocalRelativeSidValueBlock(); + sidBlock.valueDec = parseInt(sid, 10); + if (isNaN(sidBlock.valueDec)) return true; + this.value.push(sidBlock); + } while (pos2 !== -1); + return true; + } + toString() { + let result = ""; + let isHexOnly = false; + for (let i = 0; i < this.value.length; i++) { + isHexOnly = this.value[i].isHexOnly; + let sidStr = this.value[i].toString(); + if (i !== 0) result = `${result}.`; + if (isHexOnly) { + sidStr = `{${sidStr}}`; + result += sidStr; + } else result += sidStr; + } + return result; + } + toJSON() { + const object = { + ...super.toJSON(), + value: this.toString(), + sidArray: [] + }; + for (let i = 0; i < this.value.length; i++) object.sidArray.push(this.value[i].toJSON()); + return object; + } + }; + LocalRelativeObjectIdentifierValueBlock.NAME = "RelativeObjectIdentifierValueBlock"; + var _a$l; + var RelativeObjectIdentifier = class extends BaseBlock { + getValue() { + return this.valueBlock.toString(); + } + setValue(value) { + this.valueBlock.fromString(value); + } + constructor(parameters = {}) { + super(parameters, LocalRelativeObjectIdentifierValueBlock); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 13; + } + onAsciiEncoding() { + return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`; + } + toJSON() { + return { + ...super.toJSON(), + value: this.getValue() + }; + } + }; + _a$l = RelativeObjectIdentifier; + (() => { + typeStore.RelativeObjectIdentifier = _a$l; + })(); + RelativeObjectIdentifier.NAME = "RelativeObjectIdentifier"; + var _a$k; + var Sequence = class extends Constructed { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 16; + } + }; + _a$k = Sequence; + (() => { + typeStore.Sequence = _a$k; + })(); + Sequence.NAME = "SEQUENCE"; + var _a$j; + var Set = class extends Constructed { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 17; + } + }; + _a$j = Set; + (() => { + typeStore.Set = _a$j; + })(); + Set.NAME = "SET"; + var LocalStringValueBlock = class extends HexBlock(ValueBlock) { + constructor({ ...parameters } = {}) { + super(parameters); + this.isHexOnly = true; + this.value = EMPTY_STRING; + } + toJSON() { + return { + ...super.toJSON(), + value: this.value + }; + } + }; + LocalStringValueBlock.NAME = "StringValueBlock"; + var LocalSimpleStringValueBlock = class extends LocalStringValueBlock {}; + LocalSimpleStringValueBlock.NAME = "SimpleStringValueBlock"; + var LocalSimpleStringBlock = class extends BaseStringBlock { + constructor({ ...parameters } = {}) { + super(parameters, LocalSimpleStringValueBlock); + } + fromBuffer(inputBuffer) { + this.valueBlock.value = String.fromCharCode.apply(null, pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer)); + } + fromString(inputString) { + const strLen = inputString.length; + const view = this.valueBlock.valueHexView = new Uint8Array(strLen); + for (let i = 0; i < strLen; i++) view[i] = inputString.charCodeAt(i); + this.valueBlock.value = inputString; + } + }; + LocalSimpleStringBlock.NAME = "SIMPLE STRING"; + var LocalUtf8StringValueBlock = class extends LocalSimpleStringBlock { + fromBuffer(inputBuffer) { + this.valueBlock.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + try { + this.valueBlock.value = pvtsutils__namespace.Convert.ToUtf8String(inputBuffer); + } catch (ex) { + this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`); + this.valueBlock.value = pvtsutils__namespace.Convert.ToBinary(inputBuffer); + } + } + fromString(inputString) { + this.valueBlock.valueHexView = new Uint8Array(pvtsutils__namespace.Convert.FromUtf8String(inputString)); + this.valueBlock.value = inputString; + } + }; + LocalUtf8StringValueBlock.NAME = "Utf8StringValueBlock"; + var _a$i; + var Utf8String = class extends LocalUtf8StringValueBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 12; + } + }; + _a$i = Utf8String; + (() => { + typeStore.Utf8String = _a$i; + })(); + Utf8String.NAME = "UTF8String"; + var LocalBmpStringValueBlock = class extends LocalSimpleStringBlock { + fromBuffer(inputBuffer) { + this.valueBlock.value = pvtsutils__namespace.Convert.ToUtf16String(inputBuffer); + this.valueBlock.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer); + } + fromString(inputString) { + this.valueBlock.value = inputString; + this.valueBlock.valueHexView = new Uint8Array(pvtsutils__namespace.Convert.FromUtf16String(inputString)); + } + }; + LocalBmpStringValueBlock.NAME = "BmpStringValueBlock"; + var _a$h; + var BmpString = class extends LocalBmpStringValueBlock { + constructor({ ...parameters } = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 30; + } + }; + _a$h = BmpString; + (() => { + typeStore.BmpString = _a$h; + })(); + BmpString.NAME = "BMPString"; + var LocalUniversalStringValueBlock = class extends LocalSimpleStringBlock { + fromBuffer(inputBuffer) { + const copyBuffer = ArrayBuffer.isView(inputBuffer) ? inputBuffer.slice().buffer : inputBuffer.slice(0); + const valueView = new Uint8Array(copyBuffer); + for (let i = 0; i < valueView.length; i += 4) { + valueView[i] = valueView[i + 3]; + valueView[i + 1] = valueView[i + 2]; + valueView[i + 2] = 0; + valueView[i + 3] = 0; + } + this.valueBlock.value = String.fromCharCode.apply(null, new Uint32Array(copyBuffer)); + } + fromString(inputString) { + const strLength = inputString.length; + const valueHexView = this.valueBlock.valueHexView = new Uint8Array(strLength * 4); + for (let i = 0; i < strLength; i++) { + const codeBuf = pvutils__namespace.utilToBase(inputString.charCodeAt(i), 8); + const codeView = new Uint8Array(codeBuf); + if (codeView.length > 4) continue; + const dif = 4 - codeView.length; + for (let j = codeView.length - 1; j >= 0; j--) valueHexView[i * 4 + j + dif] = codeView[j]; + } + this.valueBlock.value = inputString; + } + }; + LocalUniversalStringValueBlock.NAME = "UniversalStringValueBlock"; + var _a$g; + var UniversalString = class extends LocalUniversalStringValueBlock { + constructor({ ...parameters } = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 28; + } + }; + _a$g = UniversalString; + (() => { + typeStore.UniversalString = _a$g; + })(); + UniversalString.NAME = "UniversalString"; + var _a$f; + var NumericString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 18; + } + }; + _a$f = NumericString; + (() => { + typeStore.NumericString = _a$f; + })(); + NumericString.NAME = "NumericString"; + var _a$e; + var PrintableString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 19; + } + }; + _a$e = PrintableString; + (() => { + typeStore.PrintableString = _a$e; + })(); + PrintableString.NAME = "PrintableString"; + var _a$d; + var TeletexString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 20; + } + }; + _a$d = TeletexString; + (() => { + typeStore.TeletexString = _a$d; + })(); + TeletexString.NAME = "TeletexString"; + var _a$c; + var VideotexString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 21; + } + }; + _a$c = VideotexString; + (() => { + typeStore.VideotexString = _a$c; + })(); + VideotexString.NAME = "VideotexString"; + var _a$b; + var IA5String = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 22; + } + }; + _a$b = IA5String; + (() => { + typeStore.IA5String = _a$b; + })(); + IA5String.NAME = "IA5String"; + var _a$a; + var GraphicString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 25; + } + }; + _a$a = GraphicString; + (() => { + typeStore.GraphicString = _a$a; + })(); + GraphicString.NAME = "GraphicString"; + var _a$9; + var VisibleString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 26; + } + }; + _a$9 = VisibleString; + (() => { + typeStore.VisibleString = _a$9; + })(); + VisibleString.NAME = "VisibleString"; + var _a$8; + var GeneralString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 27; + } + }; + _a$8 = GeneralString; + (() => { + typeStore.GeneralString = _a$8; + })(); + GeneralString.NAME = "GeneralString"; + var _a$7; + var CharacterString = class extends LocalSimpleStringBlock { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 29; + } + }; + _a$7 = CharacterString; + (() => { + typeStore.CharacterString = _a$7; + })(); + CharacterString.NAME = "CharacterString"; + var _a$6; + var UTCTime = class extends VisibleString { + constructor({ value, valueDate, ...parameters } = {}) { + super(parameters); + this.year = 0; + this.month = 0; + this.day = 0; + this.hour = 0; + this.minute = 0; + this.second = 0; + if (value) { + this.fromString(value); + this.valueBlock.valueHexView = new Uint8Array(value.length); + for (let i = 0; i < value.length; i++) this.valueBlock.valueHexView[i] = value.charCodeAt(i); + } + if (valueDate) { + this.fromDate(valueDate); + this.valueBlock.valueHexView = new Uint8Array(this.toBuffer()); + } + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 23; + } + fromBuffer(inputBuffer) { + this.fromString(String.fromCharCode.apply(null, pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer))); + } + toBuffer() { + const str = this.toString(); + const buffer = new ArrayBuffer(str.length); + const view = new Uint8Array(buffer); + for (let i = 0; i < str.length; i++) view[i] = str.charCodeAt(i); + return buffer; + } + fromDate(inputDate) { + this.year = inputDate.getUTCFullYear(); + this.month = inputDate.getUTCMonth() + 1; + this.day = inputDate.getUTCDate(); + this.hour = inputDate.getUTCHours(); + this.minute = inputDate.getUTCMinutes(); + this.second = inputDate.getUTCSeconds(); + } + toDate() { + return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second)); + } + fromString(inputString) { + const parserArray = /(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi.exec(inputString); + if (parserArray === null) { + this.error = "Wrong input string for conversion"; + return; + } + const year = parseInt(parserArray[1], 10); + if (year >= 50) this.year = 1900 + year; + else this.year = 2e3 + year; + this.month = parseInt(parserArray[2], 10); + this.day = parseInt(parserArray[3], 10); + this.hour = parseInt(parserArray[4], 10); + this.minute = parseInt(parserArray[5], 10); + this.second = parseInt(parserArray[6], 10); + } + toString(encoding = "iso") { + if (encoding === "iso") { + const outputArray = new Array(7); + outputArray[0] = pvutils__namespace.padNumber(this.year < 2e3 ? this.year - 1900 : this.year - 2e3, 2); + outputArray[1] = pvutils__namespace.padNumber(this.month, 2); + outputArray[2] = pvutils__namespace.padNumber(this.day, 2); + outputArray[3] = pvutils__namespace.padNumber(this.hour, 2); + outputArray[4] = pvutils__namespace.padNumber(this.minute, 2); + outputArray[5] = pvutils__namespace.padNumber(this.second, 2); + outputArray[6] = "Z"; + return outputArray.join(""); + } + return super.toString(encoding); + } + onAsciiEncoding() { + return `${this.constructor.NAME} : ${this.toDate().toISOString()}`; + } + toJSON() { + return { + ...super.toJSON(), + year: this.year, + month: this.month, + day: this.day, + hour: this.hour, + minute: this.minute, + second: this.second + }; + } + }; + _a$6 = UTCTime; + (() => { + typeStore.UTCTime = _a$6; + })(); + UTCTime.NAME = "UTCTime"; + var _a$5; + var GeneralizedTime = class extends UTCTime { + constructor(parameters = {}) { + var _b; + super(parameters); + (_b = this.millisecond) !== null && _b !== void 0 || (this.millisecond = 0); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 24; + } + fromDate(inputDate) { + super.fromDate(inputDate); + this.millisecond = inputDate.getUTCMilliseconds(); + } + toDate() { + const utcDate = Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond); + return new Date(utcDate); + } + fromString(inputString) { + let isUTC = false; + let timeString = ""; + let dateTimeString = ""; + let fractionPart = 0; + let parser; + let hourDifference = 0; + let minuteDifference = 0; + if (inputString[inputString.length - 1] === "Z") { + timeString = inputString.substring(0, inputString.length - 1); + isUTC = true; + } else { + const number = new Number(inputString[inputString.length - 1]); + if (isNaN(number.valueOf())) throw new Error("Wrong input string for conversion"); + timeString = inputString; + } + if (isUTC) { + if (timeString.indexOf("+") !== -1) throw new Error("Wrong input string for conversion"); + if (timeString.indexOf("-") !== -1) throw new Error("Wrong input string for conversion"); + } else { + let multiplier = 1; + let differencePosition = timeString.indexOf("+"); + let differenceString = ""; + if (differencePosition === -1) { + differencePosition = timeString.indexOf("-"); + multiplier = -1; + } + if (differencePosition !== -1) { + differenceString = timeString.substring(differencePosition + 1); + timeString = timeString.substring(0, differencePosition); + if (differenceString.length !== 2 && differenceString.length !== 4) throw new Error("Wrong input string for conversion"); + let number = parseInt(differenceString.substring(0, 2), 10); + if (isNaN(number.valueOf())) throw new Error("Wrong input string for conversion"); + hourDifference = multiplier * number; + if (differenceString.length === 4) { + number = parseInt(differenceString.substring(2, 4), 10); + if (isNaN(number.valueOf())) throw new Error("Wrong input string for conversion"); + minuteDifference = multiplier * number; + } + } + } + let fractionPointPosition = timeString.indexOf("."); + if (fractionPointPosition === -1) fractionPointPosition = timeString.indexOf(","); + if (fractionPointPosition !== -1) { + const fractionPartCheck = /* @__PURE__ */ new Number(`0${timeString.substring(fractionPointPosition)}`); + if (isNaN(fractionPartCheck.valueOf())) throw new Error("Wrong input string for conversion"); + fractionPart = fractionPartCheck.valueOf(); + dateTimeString = timeString.substring(0, fractionPointPosition); + } else dateTimeString = timeString; + switch (true) { + case dateTimeString.length === 8: + parser = /(\d{4})(\d{2})(\d{2})/gi; + if (fractionPointPosition !== -1) throw new Error("Wrong input string for conversion"); + break; + case dateTimeString.length === 10: + parser = /(\d{4})(\d{2})(\d{2})(\d{2})/gi; + if (fractionPointPosition !== -1) { + let fractionResult = 60 * fractionPart; + this.minute = Math.floor(fractionResult); + fractionResult = 60 * (fractionResult - this.minute); + this.second = Math.floor(fractionResult); + fractionResult = 1e3 * (fractionResult - this.second); + this.millisecond = Math.floor(fractionResult); + } + break; + case dateTimeString.length === 12: + parser = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi; + if (fractionPointPosition !== -1) { + let fractionResult = 60 * fractionPart; + this.second = Math.floor(fractionResult); + fractionResult = 1e3 * (fractionResult - this.second); + this.millisecond = Math.floor(fractionResult); + } + break; + case dateTimeString.length === 14: + parser = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi; + if (fractionPointPosition !== -1) { + const fractionResult = 1e3 * fractionPart; + this.millisecond = Math.floor(fractionResult); + } + break; + default: throw new Error("Wrong input string for conversion"); + } + const parserArray = parser.exec(dateTimeString); + if (parserArray === null) throw new Error("Wrong input string for conversion"); + for (let j = 1; j < parserArray.length; j++) switch (j) { + case 1: + this.year = parseInt(parserArray[j], 10); + break; + case 2: + this.month = parseInt(parserArray[j], 10); + break; + case 3: + this.day = parseInt(parserArray[j], 10); + break; + case 4: + this.hour = parseInt(parserArray[j], 10) + hourDifference; + break; + case 5: + this.minute = parseInt(parserArray[j], 10) + minuteDifference; + break; + case 6: + this.second = parseInt(parserArray[j], 10); + break; + default: throw new Error("Wrong input string for conversion"); + } + if (isUTC === false) { + const tempDate = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond); + this.year = tempDate.getUTCFullYear(); + this.month = tempDate.getUTCMonth(); + this.day = tempDate.getUTCDay(); + this.hour = tempDate.getUTCHours(); + this.minute = tempDate.getUTCMinutes(); + this.second = tempDate.getUTCSeconds(); + this.millisecond = tempDate.getUTCMilliseconds(); + } + } + toString(encoding = "iso") { + if (encoding === "iso") { + const outputArray = []; + outputArray.push(pvutils__namespace.padNumber(this.year, 4)); + outputArray.push(pvutils__namespace.padNumber(this.month, 2)); + outputArray.push(pvutils__namespace.padNumber(this.day, 2)); + outputArray.push(pvutils__namespace.padNumber(this.hour, 2)); + outputArray.push(pvutils__namespace.padNumber(this.minute, 2)); + outputArray.push(pvutils__namespace.padNumber(this.second, 2)); + if (this.millisecond !== 0) { + outputArray.push("."); + outputArray.push(pvutils__namespace.padNumber(this.millisecond, 3)); + } + outputArray.push("Z"); + return outputArray.join(""); + } + return super.toString(encoding); + } + toJSON() { + return { + ...super.toJSON(), + millisecond: this.millisecond + }; + } + }; + _a$5 = GeneralizedTime; + (() => { + typeStore.GeneralizedTime = _a$5; + })(); + GeneralizedTime.NAME = "GeneralizedTime"; + var _a$4; + var DATE = class extends Utf8String { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 31; + } + }; + _a$4 = DATE; + (() => { + typeStore.DATE = _a$4; + })(); + DATE.NAME = "DATE"; + var _a$3; + var TimeOfDay = class extends Utf8String { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 32; + } + }; + _a$3 = TimeOfDay; + (() => { + typeStore.TimeOfDay = _a$3; + })(); + TimeOfDay.NAME = "TimeOfDay"; + var _a$2; + var DateTime = class extends Utf8String { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 33; + } + }; + _a$2 = DateTime; + (() => { + typeStore.DateTime = _a$2; + })(); + DateTime.NAME = "DateTime"; + var _a$1; + var Duration = class extends Utf8String { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 34; + } + }; + _a$1 = Duration; + (() => { + typeStore.Duration = _a$1; + })(); + Duration.NAME = "Duration"; + var _a; + var TIME = class extends Utf8String { + constructor(parameters = {}) { + super(parameters); + this.idBlock.tagClass = 1; + this.idBlock.tagNumber = 14; + } + }; + _a = TIME; + (() => { + typeStore.TIME = _a; + })(); + TIME.NAME = "TIME"; + var Any = class { + constructor({ name = EMPTY_STRING, optional = false } = {}) { + this.name = name; + this.optional = optional; + } + }; + var Choice = class extends Any { + constructor({ value = [], ...parameters } = {}) { + super(parameters); + this.value = value; + } + }; + var Repeated = class extends Any { + constructor({ value = new Any(), local = false, ...parameters } = {}) { + super(parameters); + this.value = value; + this.local = local; + } + }; + var RawData = class { + get data() { + return this.dataView.slice().buffer; + } + set data(value) { + this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(value); + } + constructor({ data = EMPTY_VIEW } = {}) { + this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(data); + } + fromBER(inputBuffer, inputOffset, inputLength) { + const endLength = inputOffset + inputLength; + this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength); + return endLength; + } + toBER(_sizeOnly) { + return this.dataView.slice().buffer; + } + }; + function compareSchema(root, inputData, inputSchema) { + if (inputSchema instanceof Choice) { + for (const element of inputSchema.value) if (compareSchema(root, inputData, element).verified) return { + verified: true, + result: root + }; + { + const _result = { + verified: false, + result: { error: "Wrong values for Choice type" } + }; + if (inputSchema.hasOwnProperty(NAME)) _result.name = inputSchema.name; + return _result; + } + } + if (inputSchema instanceof Any) { + if (inputSchema.hasOwnProperty(NAME)) root[inputSchema.name] = inputData; + return { + verified: true, + result: root + }; + } + if (root instanceof Object === false) return { + verified: false, + result: { error: "Wrong root object" } + }; + if (inputData instanceof Object === false) return { + verified: false, + result: { error: "Wrong ASN.1 data" } + }; + if (inputSchema instanceof Object === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + if (ID_BLOCK in inputSchema === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + if (FROM_BER in inputSchema.idBlock === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + if (TO_BER in inputSchema.idBlock === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + const encodedId = inputSchema.idBlock.toBER(false); + if (encodedId.byteLength === 0) return { + verified: false, + result: { error: "Error encoding idBlock for ASN.1 schema" } + }; + if (inputSchema.idBlock.fromBER(encodedId, 0, encodedId.byteLength) === -1) return { + verified: false, + result: { error: "Error decoding idBlock for ASN.1 schema" } + }; + if (inputSchema.idBlock.hasOwnProperty(TAG_CLASS) === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + if (inputSchema.idBlock.tagClass !== inputData.idBlock.tagClass) return { + verified: false, + result: root + }; + if (inputSchema.idBlock.hasOwnProperty(TAG_NUMBER) === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + if (inputSchema.idBlock.tagNumber !== inputData.idBlock.tagNumber) return { + verified: false, + result: root + }; + if (inputSchema.idBlock.hasOwnProperty(IS_CONSTRUCTED) === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + if (inputSchema.idBlock.isConstructed !== inputData.idBlock.isConstructed) return { + verified: false, + result: root + }; + if (!(IS_HEX_ONLY in inputSchema.idBlock)) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + if (inputSchema.idBlock.isHexOnly !== inputData.idBlock.isHexOnly) return { + verified: false, + result: root + }; + if (inputSchema.idBlock.isHexOnly) { + if (VALUE_HEX_VIEW in inputSchema.idBlock === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema" } + }; + const schemaView = inputSchema.idBlock.valueHexView; + const asn1View = inputData.idBlock.valueHexView; + if (schemaView.length !== asn1View.length) return { + verified: false, + result: root + }; + for (let i = 0; i < schemaView.length; i++) if (schemaView[i] !== asn1View[1]) return { + verified: false, + result: root + }; + } + if (inputSchema.name) { + inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING); + if (inputSchema.name) root[inputSchema.name] = inputData; + } + if (inputSchema instanceof typeStore.Constructed) { + let admission = 0; + let result = { + verified: false, + result: { error: "Unknown error" } + }; + let maxLength = inputSchema.valueBlock.value.length; + if (maxLength > 0) { + if (inputSchema.valueBlock.value[0] instanceof Repeated) maxLength = inputData.valueBlock.value.length; + } + if (maxLength === 0) return { + verified: true, + result: root + }; + if (inputData.valueBlock.value.length === 0 && inputSchema.valueBlock.value.length !== 0) { + let _optional = true; + for (let i = 0; i < inputSchema.valueBlock.value.length; i++) _optional = _optional && (inputSchema.valueBlock.value[i].optional || false); + if (_optional) return { + verified: true, + result: root + }; + if (inputSchema.name) { + inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING); + if (inputSchema.name) delete root[inputSchema.name]; + } + root.error = "Inconsistent object length"; + return { + verified: false, + result: root + }; + } + for (let i = 0; i < maxLength; i++) if (i - admission >= inputData.valueBlock.value.length) { + if (inputSchema.valueBlock.value[i].optional === false) { + const _result = { + verified: false, + result: root + }; + root.error = "Inconsistent length between ASN.1 data and schema"; + if (inputSchema.name) { + inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING); + if (inputSchema.name) { + delete root[inputSchema.name]; + _result.name = inputSchema.name; + } + } + return _result; + } + } else if (inputSchema.valueBlock.value[0] instanceof Repeated) { + result = compareSchema(root, inputData.valueBlock.value[i], inputSchema.valueBlock.value[0].value); + if (result.verified === false) if (inputSchema.valueBlock.value[0].optional) admission++; + else { + if (inputSchema.name) { + inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING); + if (inputSchema.name) delete root[inputSchema.name]; + } + return result; + } + if (NAME in inputSchema.valueBlock.value[0] && inputSchema.valueBlock.value[0].name.length > 0) { + let arrayRoot = {}; + if (LOCAL in inputSchema.valueBlock.value[0] && inputSchema.valueBlock.value[0].local) arrayRoot = inputData; + else arrayRoot = root; + if (typeof arrayRoot[inputSchema.valueBlock.value[0].name] === "undefined") arrayRoot[inputSchema.valueBlock.value[0].name] = []; + arrayRoot[inputSchema.valueBlock.value[0].name].push(inputData.valueBlock.value[i]); + } + } else { + result = compareSchema(root, inputData.valueBlock.value[i - admission], inputSchema.valueBlock.value[i]); + if (result.verified === false) if (inputSchema.valueBlock.value[i].optional) admission++; + else { + if (inputSchema.name) { + inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING); + if (inputSchema.name) delete root[inputSchema.name]; + } + return result; + } + } + if (result.verified === false) { + const _result = { + verified: false, + result: root + }; + if (inputSchema.name) { + inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING); + if (inputSchema.name) { + delete root[inputSchema.name]; + _result.name = inputSchema.name; + } + } + return _result; + } + return { + verified: true, + result: root + }; + } + if (inputSchema.primitiveSchema && VALUE_HEX_VIEW in inputData.valueBlock) { + const asn1 = localFromBER(inputData.valueBlock.valueHexView); + if (asn1.offset === -1) { + const _result = { + verified: false, + result: asn1.result + }; + if (inputSchema.name) { + inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING); + if (inputSchema.name) { + delete root[inputSchema.name]; + _result.name = inputSchema.name; + } + } + return _result; + } + return compareSchema(root, asn1.result, inputSchema.primitiveSchema); + } + return { + verified: true, + result: root + }; + } + function verifySchema(inputBuffer, inputSchema) { + if (inputSchema instanceof Object === false) return { + verified: false, + result: { error: "Wrong ASN.1 schema type" } + }; + const asn1 = localFromBER(pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer)); + if (asn1.offset === -1) return { + verified: false, + result: asn1.result + }; + return compareSchema(asn1.result, asn1.result, inputSchema); + } + exports.Any = Any; + exports.BaseBlock = BaseBlock; + exports.BaseStringBlock = BaseStringBlock; + exports.BitString = BitString; + exports.BmpString = BmpString; + exports.Boolean = Boolean; + exports.CharacterString = CharacterString; + exports.Choice = Choice; + exports.Constructed = Constructed; + exports.DATE = DATE; + exports.DEFAULT_MAX_CONTENT_LENGTH = DEFAULT_MAX_CONTENT_LENGTH; + exports.DEFAULT_MAX_DEPTH = DEFAULT_MAX_DEPTH; + exports.DEFAULT_MAX_NODES = DEFAULT_MAX_NODES; + exports.DateTime = DateTime; + exports.Duration = Duration; + exports.EndOfContent = EndOfContent; + exports.Enumerated = Enumerated; + exports.GeneralString = GeneralString; + exports.GeneralizedTime = GeneralizedTime; + exports.GraphicString = GraphicString; + exports.HexBlock = HexBlock; + exports.IA5String = IA5String; + exports.Integer = Integer; + exports.Null = Null; + exports.NumericString = NumericString; + exports.ObjectIdentifier = ObjectIdentifier; + exports.OctetString = OctetString; + exports.Primitive = Primitive; + exports.PrintableString = PrintableString; + exports.RawData = RawData; + exports.RelativeObjectIdentifier = RelativeObjectIdentifier; + exports.Repeated = Repeated; + exports.Sequence = Sequence; + exports.Set = Set; + exports.TIME = TIME; + exports.TeletexString = TeletexString; + exports.TimeOfDay = TimeOfDay; + exports.UTCTime = UTCTime; + exports.UniversalString = UniversalString; + exports.Utf8String = Utf8String; + exports.ValueBlock = ValueBlock; + exports.VideotexString = VideotexString; + exports.ViewWriter = ViewWriter; + exports.VisibleString = VisibleString; + exports.compareSchema = compareSchema; + exports.fromBER = fromBER; + exports.verifySchema = verifySchema; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/esm/bytes/buffer-source.js +const ARRAY_BUFFER_TAG = "[object ArrayBuffer]"; +const SHARED_ARRAY_BUFFER_TAG = "[object SharedArrayBuffer]"; +function tagOf(value) { + return Object.prototype.toString.call(value); +} +function isArrayBufferViewLike(value) { + if (ArrayBuffer.isView(value)) return true; + if (!value || typeof value !== "object") return false; + const view = value; + return typeof view.byteOffset === "number" && typeof view.byteLength === "number" && isArrayBufferLike(view.buffer); +} +function isArrayBuffer(value) { + return tagOf(value) === ARRAY_BUFFER_TAG; +} +function isSharedArrayBuffer(value) { + return typeof SharedArrayBuffer !== "undefined" && tagOf(value) === SHARED_ARRAY_BUFFER_TAG; +} +function isArrayBufferLike(value) { + return isArrayBuffer(value) || isSharedArrayBuffer(value); +} +function isArrayBufferView(value) { + return isArrayBufferViewLike(value); +} +function isBufferSource(value) { + return isArrayBufferLike(value) || isArrayBufferView(value); +} +function assertBufferSource(value) { + if (!isBufferSource(value)) throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView"); +} +function toUint8Array(data) { + assertBufferSource(data); + if (isArrayBufferLike(data)) return new Uint8Array(data); + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); +} +function toArrayBuffer(data) { + assertBufferSource(data); + if (isArrayBuffer(data)) return data; + const buffer = new ArrayBuffer(data.byteLength); + new Uint8Array(buffer).set(toUint8Array(data)); + return buffer; +} +//#endregion +//#region node_modules/@peculiar/utils/build/esm/bytes/equal.js +function equal(a, b, options = {}) { + const left = toUint8Array(a); + const right = toUint8Array(b); + if (!options.constantTime && left.byteLength !== right.byteLength) return false; + const length = Math.max(left.byteLength, right.byteLength); + let diff = left.byteLength ^ right.byteLength; + for (let i = 0; i < length; i++) diff |= (left[i] ?? 0) ^ (right[i] ?? 0); + return diff === 0; +} +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/enums.js +var import_build = /* @__PURE__ */ __toESM(require_build(), 1); +var AsnTypeTypes; +(function(AsnTypeTypes) { + AsnTypeTypes[AsnTypeTypes["Sequence"] = 0] = "Sequence"; + AsnTypeTypes[AsnTypeTypes["Set"] = 1] = "Set"; + AsnTypeTypes[AsnTypeTypes["Choice"] = 2] = "Choice"; +})(AsnTypeTypes || (AsnTypeTypes = {})); +var AsnPropTypes; +(function(AsnPropTypes) { + AsnPropTypes[AsnPropTypes["Any"] = 1] = "Any"; + AsnPropTypes[AsnPropTypes["Boolean"] = 2] = "Boolean"; + AsnPropTypes[AsnPropTypes["OctetString"] = 3] = "OctetString"; + AsnPropTypes[AsnPropTypes["BitString"] = 4] = "BitString"; + AsnPropTypes[AsnPropTypes["Integer"] = 5] = "Integer"; + AsnPropTypes[AsnPropTypes["Enumerated"] = 6] = "Enumerated"; + AsnPropTypes[AsnPropTypes["ObjectIdentifier"] = 7] = "ObjectIdentifier"; + AsnPropTypes[AsnPropTypes["Utf8String"] = 8] = "Utf8String"; + AsnPropTypes[AsnPropTypes["BmpString"] = 9] = "BmpString"; + AsnPropTypes[AsnPropTypes["UniversalString"] = 10] = "UniversalString"; + AsnPropTypes[AsnPropTypes["NumericString"] = 11] = "NumericString"; + AsnPropTypes[AsnPropTypes["PrintableString"] = 12] = "PrintableString"; + AsnPropTypes[AsnPropTypes["TeletexString"] = 13] = "TeletexString"; + AsnPropTypes[AsnPropTypes["VideotexString"] = 14] = "VideotexString"; + AsnPropTypes[AsnPropTypes["IA5String"] = 15] = "IA5String"; + AsnPropTypes[AsnPropTypes["GraphicString"] = 16] = "GraphicString"; + AsnPropTypes[AsnPropTypes["VisibleString"] = 17] = "VisibleString"; + AsnPropTypes[AsnPropTypes["GeneralString"] = 18] = "GeneralString"; + AsnPropTypes[AsnPropTypes["CharacterString"] = 19] = "CharacterString"; + AsnPropTypes[AsnPropTypes["UTCTime"] = 20] = "UTCTime"; + AsnPropTypes[AsnPropTypes["GeneralizedTime"] = 21] = "GeneralizedTime"; + AsnPropTypes[AsnPropTypes["DATE"] = 22] = "DATE"; + AsnPropTypes[AsnPropTypes["TimeOfDay"] = 23] = "TimeOfDay"; + AsnPropTypes[AsnPropTypes["DateTime"] = 24] = "DateTime"; + AsnPropTypes[AsnPropTypes["Duration"] = 25] = "Duration"; + AsnPropTypes[AsnPropTypes["TIME"] = 26] = "TIME"; + AsnPropTypes[AsnPropTypes["Null"] = 27] = "Null"; +})(AsnPropTypes || (AsnPropTypes = {})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/types/bit_string.js +var BitString = class { + unusedBits = 0; + value = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params, unusedBits = 0) { + if (params) if (typeof params === "number") this.fromNumber(params); + else if (isBufferSource(params)) { + this.unusedBits = unusedBits; + this.value = toArrayBuffer(params); + } else throw TypeError("Unsupported type of 'params' argument for BitString"); + } + fromASN(asn) { + if (!(asn instanceof import_build.BitString)) throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString"); + this.unusedBits = asn.valueBlock.unusedBits; + this.value = toArrayBuffer(asn.valueBlock.valueHex); + return this; + } + toASN() { + return new import_build.BitString({ + unusedBits: this.unusedBits, + valueHex: this.value + }); + } + toSchema(name) { + return new import_build.BitString({ name }); + } + toNumber() { + let res = ""; + const uintArray = new Uint8Array(this.value); + for (const octet of uintArray) res += octet.toString(2).padStart(8, "0"); + res = res.split("").reverse().join(""); + if (this.unusedBits) res = res.slice(this.unusedBits).padStart(this.unusedBits, "0"); + return parseInt(res, 2); + } + fromNumber(value) { + let bits = value.toString(2); + const octetSize = bits.length + 7 >> 3; + this.unusedBits = (octetSize << 3) - bits.length; + const octets = new Uint8Array(octetSize); + bits = bits.padStart(octetSize << 3, "0").split("").reverse().join(""); + let index = 0; + while (index < octetSize) { + octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2); + index++; + } + this.value = octets.buffer; + } +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/types/octet_string.js +var OctetString = class { + buffer; + get byteLength() { + return this.buffer.byteLength; + } + get byteOffset() { + return 0; + } + constructor(param) { + if (typeof param === "number") this.buffer = new ArrayBuffer(param); + else if (isBufferSource(param)) this.buffer = toArrayBuffer(param); + else if (Array.isArray(param)) this.buffer = new Uint8Array(param).buffer; + else this.buffer = /* @__PURE__ */ new ArrayBuffer(0); + } + fromASN(asn) { + if (!(asn instanceof import_build.OctetString)) throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString"); + this.buffer = toArrayBuffer(asn.valueBlock.valueHex); + return this; + } + toASN() { + return new import_build.OctetString({ valueHex: this.buffer }); + } + toSchema(name) { + return new import_build.OctetString({ name }); + } +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/converters.js +const AsnAnyConverter = { + fromASN: (value) => value instanceof import_build.Null ? null : toArrayBuffer(value.valueBeforeDecodeView), + toASN: (value) => { + if (value === null) return new import_build.Null(); + const schema = import_build.fromBER(value); + if (schema.result.error) throw new Error(schema.result.error); + return schema.result; + } +}; +const AsnIntegerConverter = { + fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4 ? value.valueBlock.toString() : value.valueBlock.valueDec, + toASN: (value) => new import_build.Integer({ value: +value }) +}; +const AsnEnumeratedConverter = { + fromASN: (value) => value.valueBlock.valueDec, + toASN: (value) => new import_build.Enumerated({ value }) +}; +const AsnIntegerArrayBufferConverter = { + fromASN: (value) => toArrayBuffer(value.valueBlock.valueHexView), + toASN: (value) => new import_build.Integer({ valueHex: value }) +}; +const AsnBitStringConverter = { + fromASN: (value) => toArrayBuffer(value.valueBlock.valueHexView), + toASN: (value) => new import_build.BitString({ valueHex: value }) +}; +const AsnObjectIdentifierConverter = { + fromASN: (value) => value.valueBlock.toString(), + toASN: (value) => new import_build.ObjectIdentifier({ value }) +}; +const AsnBooleanConverter = { + fromASN: (value) => value.valueBlock.value, + toASN: (value) => new import_build.Boolean({ value }) +}; +const AsnOctetStringConverter = { + fromASN: (value) => toArrayBuffer(value.valueBlock.valueHexView), + toASN: (value) => new import_build.OctetString({ valueHex: value }) +}; +function createStringConverter(Asn1Type) { + return { + fromASN: (value) => value.valueBlock.value, + toASN: (value) => new Asn1Type({ value }) + }; +} +const AsnUtf8StringConverter = createStringConverter(import_build.Utf8String); +const AsnBmpStringConverter = createStringConverter(import_build.BmpString); +const AsnUniversalStringConverter = createStringConverter(import_build.UniversalString); +const AsnNumericStringConverter = createStringConverter(import_build.NumericString); +const AsnPrintableStringConverter = createStringConverter(import_build.PrintableString); +const AsnTeletexStringConverter = createStringConverter(import_build.TeletexString); +const AsnVideotexStringConverter = createStringConverter(import_build.VideotexString); +const AsnIA5StringConverter = createStringConverter(import_build.IA5String); +const AsnGraphicStringConverter = createStringConverter(import_build.GraphicString); +const AsnVisibleStringConverter = createStringConverter(import_build.VisibleString); +const AsnGeneralStringConverter = createStringConverter(import_build.GeneralString); +const AsnCharacterStringConverter = createStringConverter(import_build.CharacterString); +const AsnUTCTimeConverter = { + fromASN: (value) => value.toDate(), + toASN: (value) => new import_build.UTCTime({ valueDate: value }) +}; +const AsnGeneralizedTimeConverter = { + fromASN: (value) => value.toDate(), + toASN: (value) => new import_build.GeneralizedTime({ valueDate: value }) +}; +const AsnNullConverter = { + fromASN: () => null, + toASN: () => { + return new import_build.Null(); + } +}; +function defaultConverter(type) { + switch (type) { + case AsnPropTypes.Any: return AsnAnyConverter; + case AsnPropTypes.BitString: return AsnBitStringConverter; + case AsnPropTypes.BmpString: return AsnBmpStringConverter; + case AsnPropTypes.Boolean: return AsnBooleanConverter; + case AsnPropTypes.CharacterString: return AsnCharacterStringConverter; + case AsnPropTypes.Enumerated: return AsnEnumeratedConverter; + case AsnPropTypes.GeneralString: return AsnGeneralStringConverter; + case AsnPropTypes.GeneralizedTime: return AsnGeneralizedTimeConverter; + case AsnPropTypes.GraphicString: return AsnGraphicStringConverter; + case AsnPropTypes.IA5String: return AsnIA5StringConverter; + case AsnPropTypes.Integer: return AsnIntegerConverter; + case AsnPropTypes.Null: return AsnNullConverter; + case AsnPropTypes.NumericString: return AsnNumericStringConverter; + case AsnPropTypes.ObjectIdentifier: return AsnObjectIdentifierConverter; + case AsnPropTypes.OctetString: return AsnOctetStringConverter; + case AsnPropTypes.PrintableString: return AsnPrintableStringConverter; + case AsnPropTypes.TeletexString: return AsnTeletexStringConverter; + case AsnPropTypes.UTCTime: return AsnUTCTimeConverter; + case AsnPropTypes.UniversalString: return AsnUniversalStringConverter; + case AsnPropTypes.Utf8String: return AsnUtf8StringConverter; + case AsnPropTypes.VideotexString: return AsnVideotexStringConverter; + case AsnPropTypes.VisibleString: return AsnVisibleStringConverter; + default: return null; + } +} +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/helper.js +function isConvertible(target) { + if (typeof target === "function" && target.prototype) if (target.prototype.toASN && target.prototype.fromASN) return true; + else return isConvertible(target.prototype); + else return !!(target && typeof target === "object" && "toASN" in target && "fromASN" in target); +} +function isTypeOfArray(target) { + if (target) { + const proto = Object.getPrototypeOf(target); + if (proto?.prototype?.constructor === Array) return true; + return isTypeOfArray(proto); + } + return false; +} +function isArrayEqual(bytes1, bytes2) { + if (!(bytes1 && bytes2)) return false; + if (bytes1.byteLength !== bytes2.byteLength) return false; + const b1 = new Uint8Array(bytes1); + const b2 = new Uint8Array(bytes2); + for (let i = 0; i < bytes1.byteLength; i++) if (b1[i] !== b2[i]) return false; + return true; +} +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/schema.js +var AsnSchemaStorage = class { + items = /* @__PURE__ */ new WeakMap(); + has(target) { + return this.items.has(target); + } + get(target, checkSchema = false) { + const schema = this.items.get(target); + if (!schema) throw new Error(`Cannot get schema for '${target.prototype.constructor.name}' target`); + if (checkSchema && !schema.schema) throw new Error(`Schema '${target.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`); + return schema; + } + cache(target) { + const schema = this.get(target); + if (!schema.schema) schema.schema = this.create(target, true); + } + createDefault(target) { + const schema = { + type: AsnTypeTypes.Sequence, + items: {} + }; + const parentSchema = this.findParentSchema(target); + if (parentSchema) { + Object.assign(schema, parentSchema); + schema.items = Object.assign({}, schema.items, parentSchema.items); + } + return schema; + } + create(target, useNames) { + const schema = this.items.get(target) || this.createDefault(target); + const asn1Value = []; + for (const key in schema.items) { + const item = schema.items[key]; + const name = useNames ? key : ""; + let asn1Item; + if (typeof item.type === "number") { + const Asn1TypeName = AsnPropTypes[item.type]; + const Asn1Type = import_build[Asn1TypeName]; + if (!Asn1Type) throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`); + asn1Item = new Asn1Type({ name }); + } else if (isConvertible(item.type)) asn1Item = new item.type().toSchema(name); + else if (item.optional) if (this.get(item.type).type === AsnTypeTypes.Choice) asn1Item = new import_build.Any({ name }); + else { + asn1Item = this.create(item.type, false); + asn1Item.name = name; + } + else asn1Item = new import_build.Any({ name }); + const optional = !!item.optional || item.defaultValue !== void 0; + if (item.repeated) { + asn1Item.name = ""; + asn1Item = new (item.repeated === "set" ? import_build.Set : import_build.Sequence)({ + name: "", + value: [new import_build.Repeated({ + name, + value: asn1Item + })] + }); + } + if (item.context !== null && item.context !== void 0) if (item.implicit) if (typeof item.type === "number" || isConvertible(item.type)) { + const Container = item.repeated ? import_build.Constructed : import_build.Primitive; + asn1Value.push(new Container({ + name, + optional, + idBlock: { + tagClass: 3, + tagNumber: item.context + } + })); + } else { + this.cache(item.type); + const isRepeated = !!item.repeated; + let value = !isRepeated ? this.get(item.type, true).schema : asn1Item; + value = "valueBlock" in value ? value.valueBlock.value : value.value; + asn1Value.push(new import_build.Constructed({ + name: !isRepeated ? name : "", + optional, + idBlock: { + tagClass: 3, + tagNumber: item.context + }, + value + })); + } + else asn1Value.push(new import_build.Constructed({ + optional, + idBlock: { + tagClass: 3, + tagNumber: item.context + }, + value: [asn1Item] + })); + else { + asn1Item.optional = optional; + asn1Value.push(asn1Item); + } + } + switch (schema.type) { + case AsnTypeTypes.Sequence: return new import_build.Sequence({ + value: asn1Value, + name: "" + }); + case AsnTypeTypes.Set: return new import_build.Set({ + value: asn1Value, + name: "" + }); + case AsnTypeTypes.Choice: return new import_build.Choice({ + value: asn1Value, + name: "" + }); + default: throw new Error("Unsupported ASN1 type in use"); + } + } + set(target, schema) { + this.items.set(target, schema); + return this; + } + findParentSchema(target) { + const parent = Object.getPrototypeOf(target); + if (parent) return this.items.get(parent) || this.findParentSchema(parent); + return null; + } +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/storage.js +const schemaStorage = new AsnSchemaStorage(); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/decorators.js +const AsnType = (options) => (target) => { + let schema; + if (!schemaStorage.has(target)) { + schema = schemaStorage.createDefault(target); + schemaStorage.set(target, schema); + } else schema = schemaStorage.get(target); + Object.assign(schema, options); +}; +const AsnProp = (options) => (target, propertyKey) => { + let schema; + if (!schemaStorage.has(target.constructor)) { + schema = schemaStorage.createDefault(target.constructor); + schemaStorage.set(target.constructor, schema); + } else schema = schemaStorage.get(target.constructor); + const copyOptions = Object.assign({}, options); + if (typeof copyOptions.type === "number" && !copyOptions.converter) { + const defaultConverter$1 = defaultConverter(options.type); + if (!defaultConverter$1) throw new Error(`Cannot get default converter for property '${propertyKey}' of ${target.constructor.name}`); + copyOptions.converter = defaultConverter$1; + } + copyOptions.raw = options.raw; + schema.items[propertyKey] = copyOptions; +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/errors/schema_validation.js +var AsnSchemaValidationError = class extends Error { + schemas = []; +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/parser.js +var AsnParser = class { + static parse(data, target, options) { + const asn1Parsed = import_build.fromBER(toArrayBuffer(data), options?.berOptions); + if (asn1Parsed.result.error) throw new Error(asn1Parsed.result.error); + return this.fromASN(asn1Parsed.result, target, options); + } + static fromASN(asn1Schema, target, options) { + try { + if (isConvertible(target)) return new target().fromASN(asn1Schema); + const schema = schemaStorage.get(target); + schemaStorage.cache(target); + let targetSchema = schema.schema; + const choiceResult = this.handleChoiceTypes(asn1Schema, schema, target, targetSchema, options); + if (choiceResult?.result) return choiceResult.result; + if (choiceResult?.targetSchema) targetSchema = choiceResult.targetSchema; + const sequenceResult = this.handleSequenceTypes(asn1Schema, schema, target, targetSchema); + const res = new target(); + if (isTypeOfArray(target)) return this.handleArrayTypes(asn1Schema, schema, target, options); + this.processSchemaItems(schema, sequenceResult, res, options); + return res; + } catch (error) { + if (error instanceof AsnSchemaValidationError) error.schemas.push(target.name); + throw error; + } + } + static handleChoiceTypes(asn1Schema, schema, target, targetSchema, options) { + if (asn1Schema.constructor === import_build.Constructed && schema.type === AsnTypeTypes.Choice && asn1Schema.idBlock.tagClass === 3) for (const key in schema.items) { + const schemaItem = schema.items[key]; + if (schemaItem.context === asn1Schema.idBlock.tagNumber && schemaItem.implicit) { + if (typeof schemaItem.type === "function" && schemaStorage.has(schemaItem.type)) { + const fieldSchema = schemaStorage.get(schemaItem.type); + if (fieldSchema && fieldSchema.type === AsnTypeTypes.Sequence) { + const newSeq = new import_build.Sequence(); + if ("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value) && "value" in newSeq.valueBlock) { + newSeq.valueBlock.value = asn1Schema.valueBlock.value; + const fieldValue = this.fromASN(newSeq, schemaItem.type, options); + const res = new target(); + res[key] = fieldValue; + return { result: res }; + } + } + } + } + } + else if (asn1Schema.constructor === import_build.Constructed && schema.type !== AsnTypeTypes.Choice) { + const newTargetSchema = new import_build.Constructed({ + idBlock: { + tagClass: 3, + tagNumber: asn1Schema.idBlock.tagNumber + }, + value: schema.schema.valueBlock.value + }); + for (const key in schema.items) delete asn1Schema[key]; + return { targetSchema: newTargetSchema }; + } + return null; + } + static handleSequenceTypes(asn1Schema, schema, target, targetSchema) { + if (schema.type === AsnTypeTypes.Sequence) { + const asn1ComparedSchema = import_build.compareSchema({}, asn1Schema, targetSchema); + if (!asn1ComparedSchema.verified) throw new AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : ""}`); + return asn1ComparedSchema; + } else { + const asn1ComparedSchema = import_build.compareSchema({}, asn1Schema, targetSchema); + if (!asn1ComparedSchema.verified) throw new AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : ""}`); + return asn1ComparedSchema; + } + } + static processRepeatedField(asn1Elements, asn1Index, schemaItem) { + let elementsToProcess = asn1Elements.slice(asn1Index); + if (elementsToProcess.length === 1 && elementsToProcess[0].constructor.name === "Sequence") { + const seq = elementsToProcess[0]; + if (seq.valueBlock && seq.valueBlock.value && Array.isArray(seq.valueBlock.value)) elementsToProcess = seq.valueBlock.value; + } + if (typeof schemaItem.type === "number") { + const converter = defaultConverter(schemaItem.type); + if (!converter) throw new Error(`No converter for ASN.1 type ${schemaItem.type}`); + return elementsToProcess.filter((el) => el && el.valueBlock).map((el) => { + try { + return converter.fromASN(el); + } catch { + return; + } + }).filter((v) => v !== void 0); + } else return elementsToProcess.filter((el) => el && el.valueBlock).map((el) => { + try { + return this.fromASN(el, schemaItem.type); + } catch { + return; + } + }).filter((v) => v !== void 0); + } + static processPrimitiveField(asn1Element, schemaItem) { + const converter = defaultConverter(schemaItem.type); + if (!converter) throw new Error(`No converter for ASN.1 type ${schemaItem.type}`); + return converter.fromASN(asn1Element); + } + static isOptionalChoiceField(schemaItem) { + return schemaItem.optional && typeof schemaItem.type === "function" && schemaStorage.has(schemaItem.type) && schemaStorage.get(schemaItem.type).type === AsnTypeTypes.Choice; + } + static processOptionalChoiceField(asn1Element, schemaItem) { + try { + return { + processed: true, + value: this.fromASN(asn1Element, schemaItem.type) + }; + } catch (err) { + if (err instanceof AsnSchemaValidationError && /Wrong values for Choice type/.test(err.message)) return { processed: false }; + throw err; + } + } + static handleArrayTypes(asn1Schema, schema, target, options) { + if (!("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value))) throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed."); + const itemType = schema.itemType; + if (typeof itemType === "number") { + const converter = defaultConverter(itemType); + if (!converter) throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`); + return target.from(asn1Schema.valueBlock.value, (element) => converter.fromASN(element)); + } else return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, itemType, options)); + } + static processSchemaItems(schema, asn1ComparedSchema, res, options) { + for (const key in schema.items) { + const asn1SchemaValue = asn1ComparedSchema.result[key]; + if (!asn1SchemaValue) continue; + const schemaItem = schema.items[key]; + const schemaItemType = schemaItem.type; + let parsedValue; + if (typeof schemaItemType === "number" || isConvertible(schemaItemType)) parsedValue = this.processPrimitiveSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options); + else parsedValue = this.processComplexSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options); + if (parsedValue && typeof parsedValue === "object" && "value" in parsedValue && "raw" in parsedValue) { + res[key] = parsedValue.value; + res[`${key}Raw`] = parsedValue.raw; + } else res[key] = parsedValue; + } + } + static processPrimitiveSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options) { + const converter = schemaItem.converter ?? (isConvertible(schemaItemType) ? new schemaItemType() : null); + if (!converter) throw new Error("Converter is empty"); + if (schemaItem.repeated) return this.processRepeatedPrimitiveItem(asn1SchemaValue, schemaItem, converter, options); + else return this.processSinglePrimitiveItem(asn1SchemaValue, schemaItem, schemaItemType, converter, options); + } + static processRepeatedPrimitiveItem(asn1SchemaValue, schemaItem, converter, options) { + if (schemaItem.implicit) { + const newItem = new (schemaItem.repeated === "sequence" ? import_build.Sequence : import_build.Set)(); + newItem.valueBlock = asn1SchemaValue.valueBlock; + const newItemAsn = import_build.fromBER(newItem.toBER(false), options?.berOptions); + if (newItemAsn.offset === -1) throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`); + if (!("value" in newItemAsn.result.valueBlock && Array.isArray(newItemAsn.result.valueBlock.value))) throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed."); + const value = newItemAsn.result.valueBlock.value; + return Array.from(value, (element) => converter.fromASN(element)); + } else return Array.from(asn1SchemaValue, (element) => converter.fromASN(element)); + } + static processSinglePrimitiveItem(asn1SchemaValue, schemaItem, schemaItemType, converter, options) { + let value = asn1SchemaValue; + if (schemaItem.implicit) { + let newItem; + if (isConvertible(schemaItemType)) newItem = new schemaItemType().toSchema(""); + else { + const Asn1TypeName = AsnPropTypes[schemaItemType]; + const Asn1Type = import_build[Asn1TypeName]; + if (!Asn1Type) throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`); + newItem = new Asn1Type(); + } + newItem.valueBlock = value.valueBlock; + value = import_build.fromBER(newItem.toBER(false), options?.berOptions).result; + } + return converter.fromASN(value); + } + static processComplexSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options) { + if (schemaItem.repeated) { + if (!Array.isArray(asn1SchemaValue)) throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable."); + return Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItemType, options)); + } else { + const valueToProcess = this.handleImplicitTagging(asn1SchemaValue, schemaItem, schemaItemType); + if (this.isOptionalChoiceField(schemaItem)) try { + return this.fromASN(valueToProcess, schemaItemType, options); + } catch (err) { + if (err instanceof AsnSchemaValidationError && /Wrong values for Choice type/.test(err.message)) return; + throw err; + } + else { + const parsedValue = this.fromASN(valueToProcess, schemaItemType, options); + if (schemaItem.raw) return { + value: parsedValue, + raw: asn1SchemaValue.valueBeforeDecodeView + }; + return parsedValue; + } + } + } + static handleImplicitTagging(asn1SchemaValue, schemaItem, schemaItemType) { + if (schemaItem.implicit && typeof schemaItem.context === "number") { + const schema = schemaStorage.get(schemaItemType); + if (schema.type === AsnTypeTypes.Sequence) { + const newSeq = new import_build.Sequence(); + if ("value" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && "value" in newSeq.valueBlock) { + newSeq.valueBlock.value = asn1SchemaValue.valueBlock.value; + return newSeq; + } + } else if (schema.type === AsnTypeTypes.Set) { + const newSet = new import_build.Set(); + if ("value" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && "value" in newSet.valueBlock) { + newSet.valueBlock.value = asn1SchemaValue.valueBlock.value; + return newSet; + } + } + } + return asn1SchemaValue; + } +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/serializer.js +var AsnSerializer = class AsnSerializer { + static serialize(obj) { + if (obj instanceof import_build.BaseBlock) return obj.toBER(false); + return this.toASN(obj).toBER(false); + } + static toASN(obj) { + if (obj && typeof obj === "object" && isConvertible(obj)) return obj.toASN(); + if (!(obj && typeof obj === "object")) throw new TypeError("Parameter 1 should be type of Object."); + const target = obj.constructor; + const schema = schemaStorage.get(target); + schemaStorage.cache(target); + let asn1Value = []; + if (schema.itemType) { + if (!Array.isArray(obj)) throw new TypeError("Parameter 1 should be type of Array."); + if (typeof schema.itemType === "number") { + const converter = defaultConverter(schema.itemType); + if (!converter) throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`); + asn1Value = obj.map((o) => converter.toASN(o)); + } else asn1Value = obj.map((o) => this.toAsnItem({ type: schema.itemType }, "[]", target, o)); + } else for (const key in schema.items) { + const schemaItem = schema.items[key]; + const objProp = obj[key]; + if (objProp === void 0 || schemaItem.defaultValue === objProp || typeof schemaItem.defaultValue === "object" && typeof objProp === "object" && isArrayEqual(this.serialize(schemaItem.defaultValue), this.serialize(objProp))) continue; + const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp); + if (typeof schemaItem.context === "number") if (schemaItem.implicit) if (!schemaItem.repeated && (typeof schemaItem.type === "number" || isConvertible(schemaItem.type))) { + const value = {}; + value.valueHex = asn1Item instanceof import_build.Null ? toArrayBuffer(asn1Item.valueBeforeDecodeView) : asn1Item.valueBlock.toBER(); + asn1Value.push(new import_build.Primitive({ + optional: schemaItem.optional, + idBlock: { + tagClass: 3, + tagNumber: schemaItem.context + }, + ...value + })); + } else asn1Value.push(new import_build.Constructed({ + optional: schemaItem.optional, + idBlock: { + tagClass: 3, + tagNumber: schemaItem.context + }, + value: asn1Item.valueBlock.value + })); + else asn1Value.push(new import_build.Constructed({ + optional: schemaItem.optional, + idBlock: { + tagClass: 3, + tagNumber: schemaItem.context + }, + value: [asn1Item] + })); + else if (schemaItem.repeated) asn1Value = asn1Value.concat(asn1Item); + else asn1Value.push(asn1Item); + } + let asnSchema; + switch (schema.type) { + case AsnTypeTypes.Sequence: + asnSchema = new import_build.Sequence({ value: asn1Value }); + break; + case AsnTypeTypes.Set: + asnSchema = new import_build.Set({ value: asn1Value }); + break; + case AsnTypeTypes.Choice: + if (!asn1Value[0]) throw new Error(`Schema '${target.name}' has wrong data. Choice cannot be empty.`); + asnSchema = asn1Value[0]; + break; + } + return asnSchema; + } + static toAsnItem(schemaItem, key, target, objProp) { + let asn1Item; + if (typeof schemaItem.type === "number") { + const converter = schemaItem.converter; + if (!converter) throw new Error(`Property '${key}' doesn't have converter for type ${AsnPropTypes[schemaItem.type]} in schema '${target.name}'`); + if (schemaItem.repeated) { + if (!Array.isArray(objProp)) throw new TypeError("Parameter 'objProp' should be type of Array."); + const items = Array.from(objProp, (element) => converter.toASN(element)); + asn1Item = new (schemaItem.repeated === "sequence" ? import_build.Sequence : import_build.Set)({ value: items }); + } else asn1Item = converter.toASN(objProp); + } else if (schemaItem.repeated) { + if (!Array.isArray(objProp)) throw new TypeError("Parameter 'objProp' should be type of Array."); + const items = Array.from(objProp, (element) => this.toASN(element)); + asn1Item = new (schemaItem.repeated === "sequence" ? import_build.Sequence : import_build.Set)({ value: items }); + } else asn1Item = this.toASN(objProp); + return asn1Item; + } +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/objects.js +var AsnArray = class extends Array { + constructor(items = []) { + if (typeof items === "number") super(items); + else { + super(); + for (const item of items) this.push(item); + } + } +}; +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/es2015/convert.js +var AsnConvert = class AsnConvert { + static serialize(obj) { + return AsnSerializer.serialize(obj); + } + static parse(data, target, options) { + return AsnParser.parse(data, target, options); + } + static toString(data, options) { + const buf = isBufferSource(data) ? toArrayBuffer(data) : AsnConvert.serialize(data); + const asn = import_build.fromBER(buf, options?.berOptions); + if (asn.offset === -1) throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`); + return asn.result.toString(); + } +}; +//#endregion +//#region node_modules/tslib/tslib.es6.mjs +var tslib_es6_exports$1 = /* @__PURE__ */ __exportAll({ + __addDisposableResource: () => __addDisposableResource, + __assign: () => __assign$1, + __asyncDelegator: () => __asyncDelegator$1, + __asyncGenerator: () => __asyncGenerator$1, + __asyncValues: () => __asyncValues$1, + __await: () => __await$1, + __awaiter: () => __awaiter$1, + __classPrivateFieldGet: () => __classPrivateFieldGet$1, + __classPrivateFieldIn: () => __classPrivateFieldIn, + __classPrivateFieldSet: () => __classPrivateFieldSet$1, + __createBinding: () => __createBinding$1, + __decorate: () => __decorate$1, + __disposeResources: () => __disposeResources, + __esDecorate: () => __esDecorate, + __exportStar: () => __exportStar$1, + __extends: () => __extends$1, + __generator: () => __generator$1, + __importDefault: () => __importDefault$1, + __importStar: () => __importStar$1, + __makeTemplateObject: () => __makeTemplateObject$1, + __metadata: () => __metadata$1, + __param: () => __param$1, + __propKey: () => __propKey, + __read: () => __read$1, + __rest: () => __rest$1, + __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension, + __runInitializers: () => __runInitializers, + __setFunctionName: () => __setFunctionName, + __spread: () => __spread$1, + __spreadArray: () => __spreadArray, + __spreadArrays: () => __spreadArrays$1, + __values: () => __values$1, + default: () => tslib_es6_default +}); +function __extends$1(d, b) { + if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics$1(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +function __rest$1(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") { + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +} +function __decorate$1(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; +} +function __param$1(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { + function accept(f) { + if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); + return f; + } + var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; + var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; + var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); + var _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context = {}; + for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context.access[p] = contextIn.access[p]; + context.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); + }; + var result = (0, decorators[i])(kind === "accessor" ? { + get: descriptor.get, + set: descriptor.set + } : descriptor[key], context); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + if (target) Object.defineProperty(target, contextIn.name, descriptor); + done = true; +} +function __runInitializers(thisArg, initializers, value) { + var useValue = arguments.length > 2; + for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); + return useValue ? value : void 0; +} +function __propKey(x) { + return typeof x === "symbol" ? x : "".concat(x); +} +function __setFunctionName(f, name, prefix) { + if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; + return Object.defineProperty(f, "name", { + configurable: true, + value: prefix ? "".concat(prefix, " ", name) : name + }); +} +function __metadata$1(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter$1(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator$1(thisArg, body) { + var _ = { + label: 0, + sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [] + }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); + return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { + value: op[1], + done: false + }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { + value: op[0] ? op[1] : void 0, + done: true + }; + } +} +function __exportStar$1(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding$1(o, m, p); +} +function __values$1(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { next: function() { + if (o && i >= o.length) o = void 0; + return { + value: o && o[i++], + done: !o + }; + } }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read$1(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } catch (error) { + e = { error }; + } finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } finally { + if (e) throw e.error; + } + } + return ar; +} +/** @deprecated */ +function __spread$1() { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$1(arguments[i])); + return ar; +} +/** @deprecated */ +function __spreadArrays$1() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; + return r; +} +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) { + for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} +function __await$1(v) { + return this instanceof __await$1 ? (this.v = v, this) : new __await$1(v); +} +function __asyncGenerator$1(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function awaitReturn(f) { + return function(v) { + return Promise.resolve(v).then(f, reject); + }; + } + function verb(n, f) { + if (g[n]) { + i[n] = function(v) { + return new Promise(function(a, b) { + q.push([ + n, + v, + a, + b + ]) > 1 || resume(n, v); + }); + }; + if (f) i[n] = f(i[n]); + } + } + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } + } + function step(r) { + r.value instanceof __await$1 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + } +} +function __asyncDelegator$1(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function(e) { + throw e; + }), verb("return"), i[Symbol.iterator] = function() { + return this; + }, i; + function verb(n, f) { + i[n] = o[n] ? function(v) { + return (p = !p) ? { + value: __await$1(o[n](v)), + done: false + } : f ? f(v) : v; + } : f; + } +} +function __asyncValues$1(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values$1 === "function" ? __values$1(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function(v) { + return new Promise(function(resolve, reject) { + v = o[n](v), settle(resolve, reject, v.done, v.value); + }); + }; + } + function settle(resolve, reject, d, v) { + Promise.resolve(v).then(function(v) { + resolve({ + value: v, + done: d + }); + }, reject); + } +} +function __makeTemplateObject$1(cooked, raw) { + if (Object.defineProperty) Object.defineProperty(cooked, "raw", { value: raw }); + else cooked.raw = raw; + return cooked; +} +function __importStar$1(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$1(result, mod, k[i]); + } + __setModuleDefault(result, mod); + return result; +} +function __importDefault$1(mod) { + return mod && mod.__esModule ? mod : { default: mod }; +} +function __classPrivateFieldGet$1(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} +function __classPrivateFieldSet$1(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; +} +function __classPrivateFieldIn(state, receiver) { + if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object"); + return typeof state === "function" ? receiver === state : state.has(receiver); +} +function __addDisposableResource(env, value, async) { + if (value !== null && value !== void 0) { + if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); + var dispose, inner; + if (async) { + if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); + dispose = value[Symbol.asyncDispose]; + } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; + } + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); + } + }; + env.stack.push({ + value, + dispose, + async + }); + } else if (async) env.stack.push({ async: true }); + return value; +} +function __disposeResources(env) { + function fail(e) { + env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; + env.hasError = true; + } + var r, s = 0; + function next() { + while (r = env.stack.pop()) try { + if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); + if (r.dispose) { + var result = r.dispose.call(r.value); + if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { + fail(e); + return next(); + }); + } else s |= 1; + } catch (e) { + fail(e); + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path, preserveJsx) { + if (typeof path === "string" && /^\.\.?\//.test(path)) return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + return path; +} +var extendStatics$1, __assign$1, __createBinding$1, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default; +var init_tslib_es6$1 = __esmMin((() => { + extendStatics$1 = function(d, b) { + extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { + d.__proto__ = b; + } || function(d, b) { + for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; + }; + return extendStatics$1(d, b); + }; + __assign$1 = function() { + __assign$1 = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign$1.apply(this, arguments); + }; + __createBinding$1 = Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = { + enumerable: true, + get: function() { + return m[k]; + } + }; + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + }); + __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); + }) : function(o, v) { + o["default"] = v; + }; + ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function(o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) { + var e = new Error(message); + return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; + }; + tslib_es6_default = { + __extends: __extends$1, + __assign: __assign$1, + __rest: __rest$1, + __decorate: __decorate$1, + __param: __param$1, + __esDecorate, + __runInitializers, + __propKey, + __setFunctionName, + __metadata: __metadata$1, + __awaiter: __awaiter$1, + __generator: __generator$1, + __createBinding: __createBinding$1, + __exportStar: __exportStar$1, + __values: __values$1, + __read: __read$1, + __spread: __spread$1, + __spreadArrays: __spreadArrays$1, + __spreadArray, + __await: __await$1, + __asyncGenerator: __asyncGenerator$1, + __asyncDelegator: __asyncDelegator$1, + __asyncValues: __asyncValues$1, + __makeTemplateObject: __makeTemplateObject$1, + __importStar: __importStar$1, + __importDefault: __importDefault$1, + __classPrivateFieldGet: __classPrivateFieldGet$1, + __classPrivateFieldSet: __classPrivateFieldSet$1, + __classPrivateFieldIn, + __addDisposableResource, + __disposeResources, + __rewriteRelativeImportExtension + }; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/esm/encoding/hex.js +init_tslib_es6$1(); +function groupPairs(pairs, group) { + if (!group) return pairs.join(""); + if (!Number.isInteger(group.size) || group.size < 1) throw new RangeError("Hex group size must be a positive integer"); + const chunks = []; + for (let index = 0; index < pairs.length; index += group.size) chunks.push(pairs.slice(index, index + group.size).join("")); + return chunks.join(group.separator); +} +function encode(data, options = {}) { + const bytes = toUint8Array(data); + const casing = options.case ?? "lower"; + const pairs = Array.from(bytes, (byte) => { + const text = byte.toString(16).padStart(2, "0"); + return casing === "upper" ? text.toUpperCase() : text; + }); + let body = ""; + if (options.line) { + const bytesPerLine = options.line.bytesPerLine; + if (!Number.isInteger(bytesPerLine) || bytesPerLine < 1) throw new RangeError("Hex bytesPerLine must be a positive integer"); + const separator = options.line.separator ?? "\n"; + const lines = []; + for (let index = 0; index < pairs.length; index += bytesPerLine) lines.push(groupPairs(pairs.slice(index, index + bytesPerLine), options.group)); + body = lines.join(separator); + } else body = groupPairs(pairs, options.group); + return `${options.prefix ?? ""}${body}`; +} +Object.freeze({}), Object.freeze({ case: "upper" }), Object.freeze({ group: { + size: 1, + separator: ":" +} }), Object.freeze({ + case: "upper", + group: { + size: 1, + separator: ":" + } +}), Object.freeze({ group: { + size: 4, + separator: " " +} }), Object.freeze({ prefix: "0x" }); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/ip_converter.js +var IpConverter = class { + static isIPv4(ip) { + return /^(\d{1,3}\.){3}\d{1,3}$/.test(ip); + } + static parseIPv4(ip) { + const parts = ip.split("."); + if (parts.length !== 4) throw new Error("Invalid IPv4 address"); + return parts.map((part) => { + const num = parseInt(part, 10); + if (isNaN(num) || num < 0 || num > 255) throw new Error("Invalid IPv4 address part"); + return num; + }); + } + static parseIPv6(ip) { + const parts = this.expandIPv6(ip).split(":"); + if (parts.length !== 8) throw new Error("Invalid IPv6 address"); + return parts.reduce((bytes, part) => { + const num = parseInt(part, 16); + if (isNaN(num) || num < 0 || num > 65535) throw new Error("Invalid IPv6 address part"); + bytes.push(num >> 8 & 255); + bytes.push(num & 255); + return bytes; + }, []); + } + static expandIPv6(ip) { + if (!ip.includes("::")) return ip; + const parts = ip.split("::"); + if (parts.length > 2) throw new Error("Invalid IPv6 address"); + const left = parts[0] ? parts[0].split(":") : []; + const right = parts[1] ? parts[1].split(":") : []; + const missing = 8 - (left.length + right.length); + if (missing < 0) throw new Error("Invalid IPv6 address"); + return [ + ...left, + ...Array(missing).fill("0"), + ...right + ].join(":"); + } + static formatIPv6(bytes) { + const parts = []; + for (let i = 0; i < 16; i += 2) parts.push((bytes[i] << 8 | bytes[i + 1]).toString(16)); + return this.compressIPv6(parts.join(":")); + } + static compressIPv6(ip) { + const parts = ip.split(":"); + let longestZeroStart = -1; + let longestZeroLength = 0; + let currentZeroStart = -1; + let currentZeroLength = 0; + for (let i = 0; i < parts.length; i++) if (parts[i] === "0") { + if (currentZeroStart === -1) currentZeroStart = i; + currentZeroLength++; + } else { + if (currentZeroLength > longestZeroLength) { + longestZeroStart = currentZeroStart; + longestZeroLength = currentZeroLength; + } + currentZeroStart = -1; + currentZeroLength = 0; + } + if (currentZeroLength > longestZeroLength) { + longestZeroStart = currentZeroStart; + longestZeroLength = currentZeroLength; + } + if (longestZeroLength > 1) return `${parts.slice(0, longestZeroStart).join(":")}::${parts.slice(longestZeroStart + longestZeroLength).join(":")}`; + return ip; + } + static parseCIDR(text) { + const [addr, prefixStr] = text.split("/"); + const prefix = parseInt(prefixStr, 10); + if (this.isIPv4(addr)) { + if (prefix < 0 || prefix > 32) throw new Error("Invalid IPv4 prefix length"); + return [this.parseIPv4(addr), prefix]; + } else { + if (prefix < 0 || prefix > 128) throw new Error("Invalid IPv6 prefix length"); + return [this.parseIPv6(addr), prefix]; + } + } + static decodeIP(value) { + if (value.length === 64 && parseInt(value, 16) === 0) return "::/0"; + if (value.length !== 16) return value; + const mask = parseInt(value.slice(8), 16).toString(2).split("").reduce((a, k) => a + +k, 0); + let ip = value.slice(0, 8).replace(/(.{2})/g, (match) => `${parseInt(match, 16)}.`); + ip = ip.slice(0, -1); + return `${ip}/${mask}`; + } + static toString(buf) { + const uint8 = new Uint8Array(buf); + if (uint8.length === 4) return Array.from(uint8).join("."); + if (uint8.length === 16) return this.formatIPv6(uint8); + if (uint8.length === 8 || uint8.length === 32) { + const half = uint8.length / 2; + const addrBytes = uint8.slice(0, half); + const maskBytes = uint8.slice(half); + if (uint8.every((byte) => byte === 0)) return uint8.length === 8 ? "0.0.0.0/0" : "::/0"; + const prefixLen = maskBytes.reduce((a, b) => a + (b.toString(2).match(/1/g) || []).length, 0); + if (uint8.length === 8) return `${Array.from(addrBytes).join(".")}/${prefixLen}`; + else return `${this.formatIPv6(addrBytes)}/${prefixLen}`; + } + return this.decodeIP(encode(buf)); + } + static fromString(text) { + if (text.includes("/")) { + const [addr, prefix] = this.parseCIDR(text); + const maskBytes = new Uint8Array(addr.length); + let bitsLeft = prefix; + for (let i = 0; i < maskBytes.length; i++) if (bitsLeft >= 8) { + maskBytes[i] = 255; + bitsLeft -= 8; + } else if (bitsLeft > 0) { + maskBytes[i] = 255 << 8 - bitsLeft; + bitsLeft = 0; + } + const out = new Uint8Array(addr.length * 2); + out.set(addr, 0); + out.set(maskBytes, addr.length); + return out.buffer; + } + const bytes = this.isIPv4(text) ? this.parseIPv4(text) : this.parseIPv6(text); + return new Uint8Array(bytes).buffer; + } +}; +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/name.js +var RelativeDistinguishedName_1, RDNSequence_1, Name_1; +let DirectoryString = class DirectoryString { + teletexString; + printableString; + universalString; + utf8String; + bmpString; + constructor(params = {}) { + Object.assign(this, params); + } + toString() { + return this.bmpString || this.printableString || this.teletexString || this.universalString || this.utf8String || ""; + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.TeletexString })], DirectoryString.prototype, "teletexString", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.PrintableString })], DirectoryString.prototype, "printableString", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.UniversalString })], DirectoryString.prototype, "universalString", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Utf8String })], DirectoryString.prototype, "utf8String", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.BmpString })], DirectoryString.prototype, "bmpString", void 0); +DirectoryString = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], DirectoryString); +let AttributeValue = class AttributeValue extends DirectoryString { + ia5String; + anyValue; + constructor(params = {}) { + super(params); + Object.assign(this, params); + } + toString() { + return this.ia5String || (this.anyValue ? encode(this.anyValue) : super.toString()); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.IA5String })], AttributeValue.prototype, "ia5String", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Any })], AttributeValue.prototype, "anyValue", void 0); +AttributeValue = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], AttributeValue); +var AttributeTypeAndValue = class { + type = ""; + value = new AttributeValue(); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], AttributeTypeAndValue.prototype, "type", void 0); +__decorate$1([AsnProp({ type: AttributeValue })], AttributeTypeAndValue.prototype, "value", void 0); +let RelativeDistinguishedName = RelativeDistinguishedName_1 = class RelativeDistinguishedName extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, RelativeDistinguishedName_1.prototype); + } +}; +RelativeDistinguishedName = RelativeDistinguishedName_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Set, + itemType: AttributeTypeAndValue +})], RelativeDistinguishedName); +let RDNSequence = RDNSequence_1 = class RDNSequence extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, RDNSequence_1.prototype); + } +}; +RDNSequence = RDNSequence_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: RelativeDistinguishedName +})], RDNSequence); +let Name = Name_1 = class Name extends RDNSequence { + constructor(items) { + super(items); + Object.setPrototypeOf(this, Name_1.prototype); + } +}; +Name = Name_1 = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], Name); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/general_name.js +init_tslib_es6$1(); +const AsnIpConverter = { + fromASN: (value) => IpConverter.toString(AsnOctetStringConverter.fromASN(value)), + toASN: (value) => AsnOctetStringConverter.toASN(IpConverter.fromString(value)) +}; +var OtherName = class { + typeId = ""; + value = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], OtherName.prototype, "typeId", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Any, + context: 0 +})], OtherName.prototype, "value", void 0); +var EDIPartyName = class { + nameAssigner; + partyName = new DirectoryString(); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: DirectoryString, + optional: true, + context: 0, + implicit: true +})], EDIPartyName.prototype, "nameAssigner", void 0); +__decorate$1([AsnProp({ + type: DirectoryString, + context: 1, + implicit: true +})], EDIPartyName.prototype, "partyName", void 0); +let GeneralName = class GeneralName { + otherName; + rfc822Name; + dNSName; + x400Address; + directoryName; + ediPartyName; + uniformResourceIdentifier; + iPAddress; + registeredID; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: OtherName, + context: 0, + implicit: true +})], GeneralName.prototype, "otherName", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.IA5String, + context: 1, + implicit: true +})], GeneralName.prototype, "rfc822Name", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.IA5String, + context: 2, + implicit: true +})], GeneralName.prototype, "dNSName", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Any, + context: 3, + implicit: true +})], GeneralName.prototype, "x400Address", void 0); +__decorate$1([AsnProp({ + type: Name, + context: 4, + implicit: false +})], GeneralName.prototype, "directoryName", void 0); +__decorate$1([AsnProp({ + type: EDIPartyName, + context: 5 +})], GeneralName.prototype, "ediPartyName", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.IA5String, + context: 6, + implicit: true +})], GeneralName.prototype, "uniformResourceIdentifier", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.OctetString, + context: 7, + implicit: true, + converter: AsnIpConverter +})], GeneralName.prototype, "iPAddress", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.ObjectIdentifier, + context: 8, + implicit: true +})], GeneralName.prototype, "registeredID", void 0); +GeneralName = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], GeneralName); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/object_identifiers.js +const id_pkix = "1.3.6.1.5.5.7"; +const id_pe = `${id_pkix}.1`; +const id_qt = `${id_pkix}.2`; +const id_kp = `${id_pkix}.3`; +const id_ad = `${id_pkix}.48`; +`${id_qt}`; +`${id_qt}`; +`${id_ad}`; +`${id_ad}`; +`${id_ad}`; +`${id_ad}`; +const id_ce = "2.5.29"; +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_information_access.js +init_tslib_es6$1(); +var AuthorityInfoAccessSyntax_1; +`${id_pe}`; +var AccessDescription = class { + accessMethod = ""; + accessLocation = new GeneralName(); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], AccessDescription.prototype, "accessMethod", void 0); +__decorate$1([AsnProp({ type: GeneralName })], AccessDescription.prototype, "accessLocation", void 0); +let AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax_1 = class AuthorityInfoAccessSyntax extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, AuthorityInfoAccessSyntax_1.prototype); + } +}; +AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: AccessDescription +})], AuthorityInfoAccessSyntax); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/authority_key_identifier.js +init_tslib_es6$1(); +var KeyIdentifier = class extends OctetString {}; +var AuthorityKeyIdentifier = class { + keyIdentifier; + authorityCertIssuer; + authorityCertSerialNumber; + constructor(params = {}) { + if (params) Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: KeyIdentifier, + context: 0, + optional: true, + implicit: true +})], AuthorityKeyIdentifier.prototype, "keyIdentifier", void 0); +__decorate$1([AsnProp({ + type: GeneralName, + context: 1, + optional: true, + implicit: true, + repeated: "sequence" +})], AuthorityKeyIdentifier.prototype, "authorityCertIssuer", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 2, + optional: true, + implicit: true, + converter: AsnIntegerArrayBufferConverter +})], AuthorityKeyIdentifier.prototype, "authorityCertSerialNumber", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/basic_constraints.js +init_tslib_es6$1(); +const id_ce_basicConstraints = `${id_ce}.19`; +var BasicConstraints = class { + cA = false; + pathLenConstraint; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Boolean, + defaultValue: false +})], BasicConstraints.prototype, "cA", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + optional: true +})], BasicConstraints.prototype, "pathLenConstraint", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/general_names.js +init_tslib_es6$1(); +var GeneralNames_1; +let GeneralNames = GeneralNames_1 = class GeneralNames extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, GeneralNames_1.prototype); + } +}; +GeneralNames = GeneralNames_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: GeneralName +})], GeneralNames); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_issuer.js +init_tslib_es6$1(); +var CertificateIssuer_1; +let CertificateIssuer = CertificateIssuer_1 = class CertificateIssuer extends GeneralNames { + constructor(items) { + super(items); + Object.setPrototypeOf(this, CertificateIssuer_1.prototype); + } +}; +CertificateIssuer = CertificateIssuer_1 = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], CertificateIssuer); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/certificate_policies.js +init_tslib_es6$1(); +var CertificatePolicies_1; +let DisplayText = class DisplayText { + ia5String; + visibleString; + bmpString; + utf8String; + constructor(params = {}) { + Object.assign(this, params); + } + toString() { + return this.ia5String || this.visibleString || this.bmpString || this.utf8String || ""; + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.IA5String })], DisplayText.prototype, "ia5String", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.VisibleString })], DisplayText.prototype, "visibleString", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.BmpString })], DisplayText.prototype, "bmpString", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Utf8String })], DisplayText.prototype, "utf8String", void 0); +DisplayText = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], DisplayText); +var NoticeReference = class { + organization = new DisplayText(); + noticeNumbers = []; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: DisplayText })], NoticeReference.prototype, "organization", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + repeated: "sequence" +})], NoticeReference.prototype, "noticeNumbers", void 0); +var UserNotice = class { + noticeRef; + explicitText; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: NoticeReference, + optional: true +})], UserNotice.prototype, "noticeRef", void 0); +__decorate$1([AsnProp({ + type: DisplayText, + optional: true +})], UserNotice.prototype, "explicitText", void 0); +let Qualifier = class Qualifier { + cPSuri; + userNotice; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.IA5String })], Qualifier.prototype, "cPSuri", void 0); +__decorate$1([AsnProp({ type: UserNotice })], Qualifier.prototype, "userNotice", void 0); +Qualifier = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], Qualifier); +var PolicyQualifierInfo = class { + policyQualifierId = ""; + qualifier = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], PolicyQualifierInfo.prototype, "policyQualifierId", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Any })], PolicyQualifierInfo.prototype, "qualifier", void 0); +var PolicyInformation = class { + policyIdentifier = ""; + policyQualifiers; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], PolicyInformation.prototype, "policyIdentifier", void 0); +__decorate$1([AsnProp({ + type: PolicyQualifierInfo, + repeated: "sequence", + optional: true +})], PolicyInformation.prototype, "policyQualifiers", void 0); +let CertificatePolicies = CertificatePolicies_1 = class CertificatePolicies extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, CertificatePolicies_1.prototype); + } +}; +CertificatePolicies = CertificatePolicies_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: PolicyInformation +})], CertificatePolicies); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_number.js +init_tslib_es6$1(); +let CRLNumber = class CRLNumber { + value; + constructor(value = 0) { + this.value = value; + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], CRLNumber.prototype, "value", void 0); +CRLNumber = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], CRLNumber); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_delta_indicator.js +init_tslib_es6$1(); +let BaseCRLNumber = class BaseCRLNumber extends CRLNumber {}; +BaseCRLNumber = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], BaseCRLNumber); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_distribution_points.js +init_tslib_es6$1(); +var CRLDistributionPoints_1; +var ReasonFlags; +(function(ReasonFlags) { + ReasonFlags[ReasonFlags["unused"] = 1] = "unused"; + ReasonFlags[ReasonFlags["keyCompromise"] = 2] = "keyCompromise"; + ReasonFlags[ReasonFlags["cACompromise"] = 4] = "cACompromise"; + ReasonFlags[ReasonFlags["affiliationChanged"] = 8] = "affiliationChanged"; + ReasonFlags[ReasonFlags["superseded"] = 16] = "superseded"; + ReasonFlags[ReasonFlags["cessationOfOperation"] = 32] = "cessationOfOperation"; + ReasonFlags[ReasonFlags["certificateHold"] = 64] = "certificateHold"; + ReasonFlags[ReasonFlags["privilegeWithdrawn"] = 128] = "privilegeWithdrawn"; + ReasonFlags[ReasonFlags["aACompromise"] = 256] = "aACompromise"; +})(ReasonFlags || (ReasonFlags = {})); +var Reason = class extends BitString { + toJSON() { + const res = []; + const flags = this.toNumber(); + if (flags & ReasonFlags.aACompromise) res.push("aACompromise"); + if (flags & ReasonFlags.affiliationChanged) res.push("affiliationChanged"); + if (flags & ReasonFlags.cACompromise) res.push("cACompromise"); + if (flags & ReasonFlags.certificateHold) res.push("certificateHold"); + if (flags & ReasonFlags.cessationOfOperation) res.push("cessationOfOperation"); + if (flags & ReasonFlags.keyCompromise) res.push("keyCompromise"); + if (flags & ReasonFlags.privilegeWithdrawn) res.push("privilegeWithdrawn"); + if (flags & ReasonFlags.superseded) res.push("superseded"); + if (flags & ReasonFlags.unused) res.push("unused"); + return res; + } + toString() { + return `[${this.toJSON().join(", ")}]`; + } +}; +let DistributionPointName = class DistributionPointName { + fullName; + nameRelativeToCRLIssuer; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: GeneralName, + context: 0, + repeated: "sequence", + implicit: true +})], DistributionPointName.prototype, "fullName", void 0); +__decorate$1([AsnProp({ + type: RelativeDistinguishedName, + context: 1, + implicit: true +})], DistributionPointName.prototype, "nameRelativeToCRLIssuer", void 0); +DistributionPointName = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], DistributionPointName); +var DistributionPoint = class { + distributionPoint; + reasons; + cRLIssuer; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: DistributionPointName, + context: 0, + optional: true +})], DistributionPoint.prototype, "distributionPoint", void 0); +__decorate$1([AsnProp({ + type: Reason, + context: 1, + optional: true, + implicit: true +})], DistributionPoint.prototype, "reasons", void 0); +__decorate$1([AsnProp({ + type: GeneralName, + context: 2, + optional: true, + repeated: "sequence", + implicit: true +})], DistributionPoint.prototype, "cRLIssuer", void 0); +let CRLDistributionPoints = CRLDistributionPoints_1 = class CRLDistributionPoints extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, CRLDistributionPoints_1.prototype); + } +}; +CRLDistributionPoints = CRLDistributionPoints_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: DistributionPoint +})], CRLDistributionPoints); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_freshest.js +init_tslib_es6$1(); +var FreshestCRL_1; +let FreshestCRL = FreshestCRL_1 = class FreshestCRL extends CRLDistributionPoints { + constructor(items) { + super(items); + Object.setPrototypeOf(this, FreshestCRL_1.prototype); + } +}; +FreshestCRL = FreshestCRL_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: DistributionPoint +})], FreshestCRL); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_issuing_distribution_point.js +init_tslib_es6$1(); +var IssuingDistributionPoint = class IssuingDistributionPoint { + static ONLY = false; + distributionPoint; + onlyContainsUserCerts = IssuingDistributionPoint.ONLY; + onlyContainsCACerts = IssuingDistributionPoint.ONLY; + onlySomeReasons; + indirectCRL = IssuingDistributionPoint.ONLY; + onlyContainsAttributeCerts = IssuingDistributionPoint.ONLY; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: DistributionPointName, + context: 0, + optional: true +})], IssuingDistributionPoint.prototype, "distributionPoint", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Boolean, + context: 1, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true +})], IssuingDistributionPoint.prototype, "onlyContainsUserCerts", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Boolean, + context: 2, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true +})], IssuingDistributionPoint.prototype, "onlyContainsCACerts", void 0); +__decorate$1([AsnProp({ + type: Reason, + context: 3, + optional: true, + implicit: true +})], IssuingDistributionPoint.prototype, "onlySomeReasons", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Boolean, + context: 4, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true +})], IssuingDistributionPoint.prototype, "indirectCRL", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Boolean, + context: 5, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true +})], IssuingDistributionPoint.prototype, "onlyContainsAttributeCerts", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/crl_reason.js +init_tslib_es6$1(); +var CRLReasons; +(function(CRLReasons) { + CRLReasons[CRLReasons["unspecified"] = 0] = "unspecified"; + CRLReasons[CRLReasons["keyCompromise"] = 1] = "keyCompromise"; + CRLReasons[CRLReasons["cACompromise"] = 2] = "cACompromise"; + CRLReasons[CRLReasons["affiliationChanged"] = 3] = "affiliationChanged"; + CRLReasons[CRLReasons["superseded"] = 4] = "superseded"; + CRLReasons[CRLReasons["cessationOfOperation"] = 5] = "cessationOfOperation"; + CRLReasons[CRLReasons["certificateHold"] = 6] = "certificateHold"; + CRLReasons[CRLReasons["removeFromCRL"] = 8] = "removeFromCRL"; + CRLReasons[CRLReasons["privilegeWithdrawn"] = 9] = "privilegeWithdrawn"; + CRLReasons[CRLReasons["aACompromise"] = 10] = "aACompromise"; +})(CRLReasons || (CRLReasons = {})); +let CRLReason = class CRLReason { + reason = CRLReasons.unspecified; + constructor(reason = CRLReasons.unspecified) { + this.reason = reason; + } + toJSON() { + return CRLReasons[this.reason]; + } + toString() { + return this.toJSON(); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], CRLReason.prototype, "reason", void 0); +CRLReason = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], CRLReason); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/extended_key_usage.js +init_tslib_es6$1(); +var ExtendedKeyUsage_1; +const id_ce_extKeyUsage = `${id_ce}.37`; +let ExtendedKeyUsage = ExtendedKeyUsage_1 = class ExtendedKeyUsage extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, ExtendedKeyUsage_1.prototype); + } +}; +ExtendedKeyUsage = ExtendedKeyUsage_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: AsnPropTypes.ObjectIdentifier +})], ExtendedKeyUsage); +`${id_ce_extKeyUsage}`; +`${id_kp}`; +`${id_kp}`; +`${id_kp}`; +`${id_kp}`; +`${id_kp}`; +`${id_kp}`; +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/inhibit_any_policy.js +init_tslib_es6$1(); +let InhibitAnyPolicy = class InhibitAnyPolicy { + value; + constructor(value = /* @__PURE__ */ new ArrayBuffer(0)) { + this.value = value; + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], InhibitAnyPolicy.prototype, "value", void 0); +InhibitAnyPolicy = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], InhibitAnyPolicy); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/invalidity_date.js +init_tslib_es6$1(); +let InvalidityDate = class InvalidityDate { + value = /* @__PURE__ */ new Date(); + constructor(value) { + if (value) this.value = value; + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.GeneralizedTime })], InvalidityDate.prototype, "value", void 0); +InvalidityDate = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], InvalidityDate); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/issuer_alternative_name.js +init_tslib_es6$1(); +var IssueAlternativeName_1; +let IssueAlternativeName = IssueAlternativeName_1 = class IssueAlternativeName extends GeneralNames { + constructor(items) { + super(items); + Object.setPrototypeOf(this, IssueAlternativeName_1.prototype); + } +}; +IssueAlternativeName = IssueAlternativeName_1 = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], IssueAlternativeName); +var KeyUsageFlags; +(function(KeyUsageFlags) { + KeyUsageFlags[KeyUsageFlags["digitalSignature"] = 1] = "digitalSignature"; + KeyUsageFlags[KeyUsageFlags["nonRepudiation"] = 2] = "nonRepudiation"; + KeyUsageFlags[KeyUsageFlags["keyEncipherment"] = 4] = "keyEncipherment"; + KeyUsageFlags[KeyUsageFlags["dataEncipherment"] = 8] = "dataEncipherment"; + KeyUsageFlags[KeyUsageFlags["keyAgreement"] = 16] = "keyAgreement"; + KeyUsageFlags[KeyUsageFlags["keyCertSign"] = 32] = "keyCertSign"; + KeyUsageFlags[KeyUsageFlags["cRLSign"] = 64] = "cRLSign"; + KeyUsageFlags[KeyUsageFlags["encipherOnly"] = 128] = "encipherOnly"; + KeyUsageFlags[KeyUsageFlags["decipherOnly"] = 256] = "decipherOnly"; +})(KeyUsageFlags || (KeyUsageFlags = {})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/name_constraints.js +init_tslib_es6$1(); +var GeneralSubtrees_1; +var GeneralSubtree = class { + base = new GeneralName(); + minimum = 0; + maximum; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: GeneralName })], GeneralSubtree.prototype, "base", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 0, + defaultValue: 0, + implicit: true +})], GeneralSubtree.prototype, "minimum", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 1, + optional: true, + implicit: true +})], GeneralSubtree.prototype, "maximum", void 0); +let GeneralSubtrees = GeneralSubtrees_1 = class GeneralSubtrees extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, GeneralSubtrees_1.prototype); + } +}; +GeneralSubtrees = GeneralSubtrees_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: GeneralSubtree +})], GeneralSubtrees); +var NameConstraints = class { + permittedSubtrees; + excludedSubtrees; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: GeneralSubtrees, + context: 0, + optional: true, + implicit: true +})], NameConstraints.prototype, "permittedSubtrees", void 0); +__decorate$1([AsnProp({ + type: GeneralSubtrees, + context: 1, + optional: true, + implicit: true +})], NameConstraints.prototype, "excludedSubtrees", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_constraints.js +init_tslib_es6$1(); +var PolicyConstraints = class { + requireExplicitPolicy; + inhibitPolicyMapping; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 0, + implicit: true, + optional: true, + converter: AsnIntegerArrayBufferConverter +})], PolicyConstraints.prototype, "requireExplicitPolicy", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 1, + implicit: true, + optional: true, + converter: AsnIntegerArrayBufferConverter +})], PolicyConstraints.prototype, "inhibitPolicyMapping", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/policy_mappings.js +init_tslib_es6$1(); +var PolicyMappings_1; +var PolicyMapping = class { + issuerDomainPolicy = ""; + subjectDomainPolicy = ""; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], PolicyMapping.prototype, "issuerDomainPolicy", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], PolicyMapping.prototype, "subjectDomainPolicy", void 0); +let PolicyMappings = PolicyMappings_1 = class PolicyMappings extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, PolicyMappings_1.prototype); + } +}; +PolicyMappings = PolicyMappings_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: PolicyMapping +})], PolicyMappings); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_alternative_name.js +init_tslib_es6$1(); +var SubjectAlternativeName_1; +const id_ce_subjectAltName = `${id_ce}.17`; +let SubjectAlternativeName = SubjectAlternativeName_1 = class SubjectAlternativeName extends GeneralNames { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SubjectAlternativeName_1.prototype); + } +}; +SubjectAlternativeName = SubjectAlternativeName_1 = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], SubjectAlternativeName); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/attribute.js +init_tslib_es6$1(); +var Attribute = class { + type = ""; + values = []; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], Attribute.prototype, "type", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Any, + repeated: "set" +})], Attribute.prototype, "values", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_directory_attributes.js +init_tslib_es6$1(); +var SubjectDirectoryAttributes_1; +let SubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = class SubjectDirectoryAttributes extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SubjectDirectoryAttributes_1.prototype); + } +}; +SubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: Attribute +})], SubjectDirectoryAttributes); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/private_key_usage_period.js +init_tslib_es6$1(); +var PrivateKeyUsagePeriod = class { + notBefore; + notAfter; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.GeneralizedTime, + context: 0, + implicit: true, + optional: true +})], PrivateKeyUsagePeriod.prototype, "notBefore", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.GeneralizedTime, + context: 1, + implicit: true, + optional: true +})], PrivateKeyUsagePeriod.prototype, "notAfter", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/entrust_version_info.js +init_tslib_es6$1(); +var EntrustInfoFlags; +(function(EntrustInfoFlags) { + EntrustInfoFlags[EntrustInfoFlags["keyUpdateAllowed"] = 1] = "keyUpdateAllowed"; + EntrustInfoFlags[EntrustInfoFlags["newExtensions"] = 2] = "newExtensions"; + EntrustInfoFlags[EntrustInfoFlags["pKIXCertificate"] = 4] = "pKIXCertificate"; +})(EntrustInfoFlags || (EntrustInfoFlags = {})); +var EntrustInfo = class extends BitString { + toJSON() { + const res = []; + const flags = this.toNumber(); + if (flags & EntrustInfoFlags.pKIXCertificate) res.push("pKIXCertificate"); + if (flags & EntrustInfoFlags.newExtensions) res.push("newExtensions"); + if (flags & EntrustInfoFlags.keyUpdateAllowed) res.push("keyUpdateAllowed"); + return res; + } + toString() { + return `[${this.toJSON().join(", ")}]`; + } +}; +var EntrustVersionInfo = class { + entrustVers = ""; + entrustInfoFlags = new EntrustInfo(); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.GeneralString })], EntrustVersionInfo.prototype, "entrustVers", void 0); +__decorate$1([AsnProp({ type: EntrustInfo })], EntrustVersionInfo.prototype, "entrustInfoFlags", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extensions/subject_info_access.js +init_tslib_es6$1(); +var SubjectInfoAccessSyntax_1; +`${id_pe}`; +let SubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = class SubjectInfoAccessSyntax extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SubjectInfoAccessSyntax_1.prototype); + } +}; +SubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: AccessDescription +})], SubjectInfoAccessSyntax); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/algorithm_identifier.js +init_tslib_es6$1(); +var AlgorithmIdentifier = class AlgorithmIdentifier { + algorithm = ""; + parameters; + constructor(params = {}) { + Object.assign(this, params); + } + isEqual(data) { + return data instanceof AlgorithmIdentifier && data.algorithm == this.algorithm && (data.parameters && this.parameters && equal(data.parameters, this.parameters) || data.parameters === this.parameters); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], AlgorithmIdentifier.prototype, "algorithm", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Any, + optional: true +})], AlgorithmIdentifier.prototype, "parameters", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/subject_public_key_info.js +init_tslib_es6$1(); +var SubjectPublicKeyInfo = class { + algorithm = new AlgorithmIdentifier(); + subjectPublicKey = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AlgorithmIdentifier })], SubjectPublicKeyInfo.prototype, "algorithm", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.BitString })], SubjectPublicKeyInfo.prototype, "subjectPublicKey", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/time.js +init_tslib_es6$1(); +let Time = class Time { + utcTime; + generalTime; + constructor(time) { + if (time) if (typeof time === "string" || typeof time === "number" || time instanceof Date) { + const date = new Date(time); + date.setMilliseconds(0); + if (date.getUTCFullYear() > 2049) this.generalTime = date; + else this.utcTime = date; + } else Object.assign(this, time); + } + getTime() { + const time = this.utcTime || this.generalTime; + if (!time) throw new Error("Cannot get time from CHOICE object"); + return time; + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.UTCTime })], Time.prototype, "utcTime", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.GeneralizedTime })], Time.prototype, "generalTime", void 0); +Time = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], Time); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/validity.js +init_tslib_es6$1(); +var Validity = class { + notBefore = new Time(/* @__PURE__ */ new Date()); + notAfter = new Time(/* @__PURE__ */ new Date()); + constructor(params) { + if (params) { + this.notBefore = new Time(params.notBefore); + this.notAfter = new Time(params.notAfter); + } + } +}; +__decorate$1([AsnProp({ type: Time })], Validity.prototype, "notBefore", void 0); +__decorate$1([AsnProp({ type: Time })], Validity.prototype, "notAfter", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/extension.js +init_tslib_es6$1(); +var Extensions_1; +var Extension = class Extension { + static CRITICAL = false; + extnID = ""; + critical = Extension.CRITICAL; + extnValue = new OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], Extension.prototype, "extnID", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Boolean, + defaultValue: Extension.CRITICAL +})], Extension.prototype, "critical", void 0); +__decorate$1([AsnProp({ type: OctetString })], Extension.prototype, "extnValue", void 0); +let Extensions = Extensions_1 = class Extensions extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, Extensions_1.prototype); + } +}; +Extensions = Extensions_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: Extension +})], Extensions); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/types.js +var Version$1; +(function(Version) { + Version[Version["v1"] = 0] = "v1"; + Version[Version["v2"] = 1] = "v2"; + Version[Version["v3"] = 2] = "v3"; +})(Version$1 || (Version$1 = {})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/tbs_certificate.js +init_tslib_es6$1(); +var TBSCertificate = class { + version = Version$1.v1; + serialNumber = /* @__PURE__ */ new ArrayBuffer(0); + signature = new AlgorithmIdentifier(); + issuer = new Name(); + validity = new Validity(); + subject = new Name(); + subjectPublicKeyInfo = new SubjectPublicKeyInfo(); + issuerUniqueID; + subjectUniqueID; + extensions; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 0, + defaultValue: Version$1.v1 +})], TBSCertificate.prototype, "version", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], TBSCertificate.prototype, "serialNumber", void 0); +__decorate$1([AsnProp({ type: AlgorithmIdentifier })], TBSCertificate.prototype, "signature", void 0); +__decorate$1([AsnProp({ type: Name })], TBSCertificate.prototype, "issuer", void 0); +__decorate$1([AsnProp({ type: Validity })], TBSCertificate.prototype, "validity", void 0); +__decorate$1([AsnProp({ type: Name })], TBSCertificate.prototype, "subject", void 0); +__decorate$1([AsnProp({ type: SubjectPublicKeyInfo })], TBSCertificate.prototype, "subjectPublicKeyInfo", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.BitString, + context: 1, + implicit: true, + optional: true +})], TBSCertificate.prototype, "issuerUniqueID", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.BitString, + context: 2, + implicit: true, + optional: true +})], TBSCertificate.prototype, "subjectUniqueID", void 0); +__decorate$1([AsnProp({ + type: Extensions, + context: 3, + optional: true +})], TBSCertificate.prototype, "extensions", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/certificate.js +init_tslib_es6$1(); +var Certificate = class { + tbsCertificate = new TBSCertificate(); + tbsCertificateRaw; + signatureAlgorithm = new AlgorithmIdentifier(); + signatureValue = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: TBSCertificate, + raw: true +})], Certificate.prototype, "tbsCertificate", void 0); +__decorate$1([AsnProp({ type: AlgorithmIdentifier })], Certificate.prototype, "signatureAlgorithm", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.BitString })], Certificate.prototype, "signatureValue", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/tbs_cert_list.js +init_tslib_es6$1(); +var RevokedCertificate = class { + userCertificate = /* @__PURE__ */ new ArrayBuffer(0); + revocationDate = new Time(); + crlEntryExtensions; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RevokedCertificate.prototype, "userCertificate", void 0); +__decorate$1([AsnProp({ type: Time })], RevokedCertificate.prototype, "revocationDate", void 0); +__decorate$1([AsnProp({ + type: Extension, + optional: true, + repeated: "sequence" +})], RevokedCertificate.prototype, "crlEntryExtensions", void 0); +var TBSCertList = class { + version; + signature = new AlgorithmIdentifier(); + issuer = new Name(); + thisUpdate = new Time(); + nextUpdate; + revokedCertificates; + crlExtensions; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + optional: true +})], TBSCertList.prototype, "version", void 0); +__decorate$1([AsnProp({ type: AlgorithmIdentifier })], TBSCertList.prototype, "signature", void 0); +__decorate$1([AsnProp({ type: Name })], TBSCertList.prototype, "issuer", void 0); +__decorate$1([AsnProp({ type: Time })], TBSCertList.prototype, "thisUpdate", void 0); +__decorate$1([AsnProp({ + type: Time, + optional: true +})], TBSCertList.prototype, "nextUpdate", void 0); +__decorate$1([AsnProp({ + type: RevokedCertificate, + repeated: "sequence", + optional: true +})], TBSCertList.prototype, "revokedCertificates", void 0); +__decorate$1([AsnProp({ + type: Extension, + optional: true, + context: 0, + repeated: "sequence" +})], TBSCertList.prototype, "crlExtensions", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/es2015/certificate_list.js +init_tslib_es6$1(); +var CertificateList = class { + tbsCertList = new TBSCertList(); + tbsCertListRaw; + signatureAlgorithm = new AlgorithmIdentifier(); + signature = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: TBSCertList, + raw: true +})], CertificateList.prototype, "tbsCertList", void 0); +__decorate$1([AsnProp({ type: AlgorithmIdentifier })], CertificateList.prototype, "signatureAlgorithm", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.BitString })], CertificateList.prototype, "signature", void 0); +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/getCertificateInfo.js +const issuerSubjectIDKey = { + "2.5.4.6": "C", + "2.5.4.10": "O", + "2.5.4.11": "OU", + "2.5.4.3": "CN" +}; +/** +* Extract PEM certificate info +* +* @param pemCertificate Result from call to `convertASN1toPEM(x5c[0])` +*/ +function getCertificateInfo(leafCertBuffer) { + const x509 = AsnParser.parse(leafCertBuffer, Certificate); + const parsedCert = x509.tbsCertificate; + const issuer = { combined: "" }; + parsedCert.issuer.forEach(([iss]) => { + const key = issuerSubjectIDKey[iss.type]; + if (key) issuer[key] = iss.value.toString(); + }); + issuer.combined = issuerSubjectToString(issuer); + const subject = { combined: "" }; + parsedCert.subject.forEach(([iss]) => { + const key = issuerSubjectIDKey[iss.type]; + if (key) subject[key] = iss.value.toString(); + }); + subject.combined = issuerSubjectToString(subject); + let basicConstraintsCA = false; + if (parsedCert.extensions) { + for (const ext of parsedCert.extensions) if (ext.extnID === id_ce_basicConstraints) basicConstraintsCA = AsnParser.parse(ext.extnValue, BasicConstraints).cA; + } + return { + issuer, + subject, + version: parsedCert.version, + basicConstraintsCA, + notBefore: parsedCert.validity.notBefore.getTime(), + notAfter: parsedCert.validity.notAfter.getTime(), + parsedCertificate: x509 + }; +} +/** +* Stringify the parts of Issuer or Subject info for easier comparison of subject issuers with +* issuer subjects. +* +* The order might seem arbitrary, because it is. It should be enough that the two are stringified +* in the same order. +*/ +function issuerSubjectToString(input) { + const parts = []; + if (input.C) parts.push(input.C); + if (input.O) parts.push(input.O); + if (input.OU) parts.push(input.OU); + if (input.CN) parts.push(input.CN); + return parts.join(" : "); +} +//#endregion +//#region node_modules/reflect-metadata/Reflect.js +var require_Reflect = /* @__PURE__ */ __commonJSMin((() => { + /*! ***************************************************************************** + Copyright (C) Microsoft. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + var Reflect; + (function(Reflect) { + (function(factory) { + var root = typeof globalThis === "object" ? globalThis : typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis(); + var exporter = makeExporter(Reflect); + if (typeof root.Reflect !== "undefined") exporter = makeExporter(root.Reflect, exporter); + factory(exporter, root); + if (typeof root.Reflect === "undefined") root.Reflect = Reflect; + function makeExporter(target, previous) { + return function(key, value) { + Object.defineProperty(target, key, { + configurable: true, + writable: true, + value + }); + if (previous) previous(key, value); + }; + } + function functionThis() { + try { + return Function("return this;")(); + } catch (_) {} + } + function indirectEvalThis() { + try { + return (0, eval)("(function() { return this; })()"); + } catch (_) {} + } + function sloppyModeThis() { + return functionThis() || indirectEvalThis(); + } + })(function(exporter, root) { + var hasOwn = Object.prototype.hasOwnProperty; + var supportsSymbol = typeof Symbol === "function"; + var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive"; + var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator"; + var supportsCreate = typeof Object.create === "function"; + var supportsProto = { __proto__: [] } instanceof Array; + var downLevel = !supportsCreate && !supportsProto; + var HashMap = { + create: supportsCreate ? function() { + return MakeDictionary(Object.create(null)); + } : supportsProto ? function() { + return MakeDictionary({ __proto__: null }); + } : function() { + return MakeDictionary({}); + }, + has: downLevel ? function(map, key) { + return hasOwn.call(map, key); + } : function(map, key) { + return key in map; + }, + get: downLevel ? function(map, key) { + return hasOwn.call(map, key) ? map[key] : void 0; + } : function(map, key) { + return map[key]; + } + }; + var functionPrototype = Object.getPrototypeOf(Function); + var _Map = typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill(); + var _Set = typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill(); + var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill(); + var registrySymbol = supportsSymbol ? Symbol.for("@reflect-metadata:registry") : void 0; + var metadataRegistry = GetOrCreateMetadataRegistry(); + var metadataProvider = CreateMetadataProvider(metadataRegistry); + /** + * Applies a set of decorators to a property of a target object. + * @param decorators An array of decorators. + * @param target The target object. + * @param propertyKey (Optional) The property key to decorate. + * @param attributes (Optional) The property descriptor for the target key. + * @remarks Decorators are applied in reverse order. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * Example = Reflect.decorate(decoratorsArray, Example); + * + * // property (on constructor) + * Reflect.decorate(decoratorsArray, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.decorate(decoratorsArray, Example.prototype, "property"); + * + * // method (on constructor) + * Object.defineProperty(Example, "staticMethod", + * Reflect.decorate(decoratorsArray, Example, "staticMethod", + * Object.getOwnPropertyDescriptor(Example, "staticMethod"))); + * + * // method (on prototype) + * Object.defineProperty(Example.prototype, "method", + * Reflect.decorate(decoratorsArray, Example.prototype, "method", + * Object.getOwnPropertyDescriptor(Example.prototype, "method"))); + * + */ + function decorate(decorators, target, propertyKey, attributes) { + if (!IsUndefined(propertyKey)) { + if (!IsArray(decorators)) throw new TypeError(); + if (!IsObject(target)) throw new TypeError(); + if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError(); + if (IsNull(attributes)) attributes = void 0; + propertyKey = ToPropertyKey(propertyKey); + return DecorateProperty(decorators, target, propertyKey, attributes); + } else { + if (!IsArray(decorators)) throw new TypeError(); + if (!IsConstructor(target)) throw new TypeError(); + return DecorateConstructor(decorators, target); + } + } + exporter("decorate", decorate); + /** + * A default metadata decorator factory that can be used on a class, class member, or parameter. + * @param metadataKey The key for the metadata entry. + * @param metadataValue The value for the metadata entry. + * @returns A decorator function. + * @remarks + * If `metadataKey` is already defined for the target and target key, the + * metadataValue for that key will be overwritten. + * @example + * + * // constructor + * @Reflect.metadata(key, value) + * class Example { + * } + * + * // property (on constructor, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * static staticProperty; + * } + * + * // property (on prototype, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * property; + * } + * + * // method (on constructor) + * class Example { + * @Reflect.metadata(key, value) + * static staticMethod() { } + * } + * + * // method (on prototype) + * class Example { + * @Reflect.metadata(key, value) + * method() { } + * } + * + */ + function metadata(metadataKey, metadataValue) { + function decorator(target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError(); + OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); + } + return decorator; + } + exporter("metadata", metadata); + /** + * Define a unique metadata entry on the target. + * @param metadataKey A key used to store and retrieve metadata. + * @param metadataValue A value that contains attached metadata. + * @param target The target object on which to define metadata. + * @param propertyKey (Optional) The property key for the target. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * Reflect.defineMetadata("custom:annotation", options, Example); + * + * // property (on constructor) + * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property"); + * + * // method (on constructor) + * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod"); + * + * // method (on prototype) + * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method"); + * + * // decorator factory as metadata-producing annotation. + * function MyAnnotation(options): Decorator { + * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey, metadataValue, target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); + } + exporter("defineMetadata", defineMetadata); + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + return OrdinaryHasMetadata(metadataKey, target, propertyKey); + } + exporter("hasMetadata", hasMetadata); + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey); + } + exporter("hasOwnMetadata", hasOwnMetadata); + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + return OrdinaryGetMetadata(metadataKey, target, propertyKey); + } + exporter("getMetadata", getMetadata); + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey); + } + exporter("getOwnMetadata", getOwnMetadata); + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getMetadataKeys(Example); + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "method"); + * + */ + function getMetadataKeys(target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + return OrdinaryMetadataKeys(target, propertyKey); + } + exporter("getMetadataKeys", getMetadataKeys); + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(Example); + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "method"); + * + */ + function getOwnMetadataKeys(target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + return OrdinaryOwnMetadataKeys(target, propertyKey); + } + exporter("getOwnMetadataKeys", getOwnMetadataKeys); + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey (Optional) The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * constructor(p) { } + * static staticMethod(p) { } + * method(p) { } + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", Example); + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function deleteMetadata(metadataKey, target, propertyKey) { + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + if (!IsObject(target)) throw new TypeError(); + if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); + var provider = GetMetadataProvider(target, propertyKey, false); + if (IsUndefined(provider)) return false; + return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey); + } + exporter("deleteMetadata", deleteMetadata); + function DecorateConstructor(decorators, target) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target); + if (!IsUndefined(decorated) && !IsNull(decorated)) { + if (!IsConstructor(decorated)) throw new TypeError(); + target = decorated; + } + } + return target; + } + function DecorateProperty(decorators, target, propertyKey, descriptor) { + for (var i = decorators.length - 1; i >= 0; --i) { + var decorator = decorators[i]; + var decorated = decorator(target, propertyKey, descriptor); + if (!IsUndefined(decorated) && !IsNull(decorated)) { + if (!IsObject(decorated)) throw new TypeError(); + descriptor = decorated; + } + } + return descriptor; + } + function OrdinaryHasMetadata(MetadataKey, O, P) { + if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return true; + var parent = OrdinaryGetPrototypeOf(O); + if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P); + return false; + } + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var provider = GetMetadataProvider(O, P, false); + if (IsUndefined(provider)) return false; + return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P)); + } + function OrdinaryGetMetadata(MetadataKey, O, P) { + if (OrdinaryHasOwnMetadata(MetadataKey, O, P)) return OrdinaryGetOwnMetadata(MetadataKey, O, P); + var parent = OrdinaryGetPrototypeOf(O); + if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P); + } + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var provider = GetMetadataProvider(O, P, false); + if (IsUndefined(provider)) return; + return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P); + } + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + GetMetadataProvider(O, P, true).OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P); + } + function OrdinaryMetadataKeys(O, P) { + var ownKeys = OrdinaryOwnMetadataKeys(O, P); + var parent = OrdinaryGetPrototypeOf(O); + if (parent === null) return ownKeys; + var parentKeys = OrdinaryMetadataKeys(parent, P); + if (parentKeys.length <= 0) return ownKeys; + if (ownKeys.length <= 0) return parentKeys; + var set = new _Set(); + var keys = []; + for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) { + var key = ownKeys_1[_i]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) { + var key = parentKeys_1[_a]; + var hasKey = set.has(key); + if (!hasKey) { + set.add(key); + keys.push(key); + } + } + return keys; + } + function OrdinaryOwnMetadataKeys(O, P) { + var provider = GetMetadataProvider(O, P, false); + if (!provider) return []; + return provider.OrdinaryOwnMetadataKeys(O, P); + } + function Type(x) { + if (x === null) return 1; + switch (typeof x) { + case "undefined": return 0; + case "boolean": return 2; + case "string": return 3; + case "symbol": return 4; + case "number": return 5; + case "object": return x === null ? 1 : 6; + default: return 6; + } + } + function IsUndefined(x) { + return x === void 0; + } + function IsNull(x) { + return x === null; + } + function IsSymbol(x) { + return typeof x === "symbol"; + } + function IsObject(x) { + return typeof x === "object" ? x !== null : typeof x === "function"; + } + function ToPrimitive(input, PreferredType) { + switch (Type(input)) { + case 0: return input; + case 1: return input; + case 2: return input; + case 3: return input; + case 4: return input; + case 5: return input; + } + var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default"; + var exoticToPrim = GetMethod(input, toPrimitiveSymbol); + if (exoticToPrim !== void 0) { + var result = exoticToPrim.call(input, hint); + if (IsObject(result)) throw new TypeError(); + return result; + } + return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint); + } + function OrdinaryToPrimitive(O, hint) { + if (hint === "string") { + var toString_1 = O.toString; + if (IsCallable(toString_1)) { + var result = toString_1.call(O); + if (!IsObject(result)) return result; + } + var valueOf = O.valueOf; + if (IsCallable(valueOf)) { + var result = valueOf.call(O); + if (!IsObject(result)) return result; + } + } else { + var valueOf = O.valueOf; + if (IsCallable(valueOf)) { + var result = valueOf.call(O); + if (!IsObject(result)) return result; + } + var toString_2 = O.toString; + if (IsCallable(toString_2)) { + var result = toString_2.call(O); + if (!IsObject(result)) return result; + } + } + throw new TypeError(); + } + function ToBoolean(argument) { + return !!argument; + } + function ToString(argument) { + return "" + argument; + } + function ToPropertyKey(argument) { + var key = ToPrimitive(argument, 3); + if (IsSymbol(key)) return key; + return ToString(key); + } + function IsArray(argument) { + return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]"; + } + function IsCallable(argument) { + return typeof argument === "function"; + } + function IsConstructor(argument) { + return typeof argument === "function"; + } + function IsPropertyKey(argument) { + switch (Type(argument)) { + case 3: return true; + case 4: return true; + default: return false; + } + } + function SameValueZero(x, y) { + return x === y || x !== x && y !== y; + } + function GetMethod(V, P) { + var func = V[P]; + if (func === void 0 || func === null) return void 0; + if (!IsCallable(func)) throw new TypeError(); + return func; + } + function GetIterator(obj) { + var method = GetMethod(obj, iteratorSymbol); + if (!IsCallable(method)) throw new TypeError(); + var iterator = method.call(obj); + if (!IsObject(iterator)) throw new TypeError(); + return iterator; + } + function IteratorValue(iterResult) { + return iterResult.value; + } + function IteratorStep(iterator) { + var result = iterator.next(); + return result.done ? false : result; + } + function IteratorClose(iterator) { + var f = iterator["return"]; + if (f) f.call(iterator); + } + function OrdinaryGetPrototypeOf(O) { + var proto = Object.getPrototypeOf(O); + if (typeof O !== "function" || O === functionPrototype) return proto; + if (proto !== functionPrototype) return proto; + var prototype = O.prototype; + var prototypeProto = prototype && Object.getPrototypeOf(prototype); + if (prototypeProto == null || prototypeProto === Object.prototype) return proto; + var constructor = prototypeProto.constructor; + if (typeof constructor !== "function") return proto; + if (constructor === O) return proto; + return constructor; + } + /** + * Creates a registry used to allow multiple `reflect-metadata` providers. + */ + function CreateMetadataRegistry() { + var fallback; + if (!IsUndefined(registrySymbol) && typeof root.Reflect !== "undefined" && !(registrySymbol in root.Reflect) && typeof root.Reflect.defineMetadata === "function") fallback = CreateFallbackProvider(root.Reflect); + var first; + var second; + var rest; + var targetProviderMap = new _WeakMap(); + var registry = { + registerProvider, + getProvider, + setProvider + }; + return registry; + function registerProvider(provider) { + if (!Object.isExtensible(registry)) throw new Error("Cannot add provider to a frozen registry."); + switch (true) { + case fallback === provider: break; + case IsUndefined(first): + first = provider; + break; + case first === provider: break; + case IsUndefined(second): + second = provider; + break; + case second === provider: break; + default: + if (rest === void 0) rest = new _Set(); + rest.add(provider); + break; + } + } + function getProviderNoCache(O, P) { + if (!IsUndefined(first)) { + if (first.isProviderFor(O, P)) return first; + if (!IsUndefined(second)) { + if (second.isProviderFor(O, P)) return first; + if (!IsUndefined(rest)) { + var iterator = GetIterator(rest); + while (true) { + var next = IteratorStep(iterator); + if (!next) return; + var provider = IteratorValue(next); + if (provider.isProviderFor(O, P)) { + IteratorClose(iterator); + return provider; + } + } + } + } + } + if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) return fallback; + } + function getProvider(O, P) { + var providerMap = targetProviderMap.get(O); + var provider; + if (!IsUndefined(providerMap)) provider = providerMap.get(P); + if (!IsUndefined(provider)) return provider; + provider = getProviderNoCache(O, P); + if (!IsUndefined(provider)) { + if (IsUndefined(providerMap)) { + providerMap = new _Map(); + targetProviderMap.set(O, providerMap); + } + providerMap.set(P, provider); + } + return provider; + } + function hasProvider(provider) { + if (IsUndefined(provider)) throw new TypeError(); + return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider); + } + function setProvider(O, P, provider) { + if (!hasProvider(provider)) throw new Error("Metadata provider not registered."); + var existingProvider = getProvider(O, P); + if (existingProvider !== provider) { + if (!IsUndefined(existingProvider)) return false; + var providerMap = targetProviderMap.get(O); + if (IsUndefined(providerMap)) { + providerMap = new _Map(); + targetProviderMap.set(O, providerMap); + } + providerMap.set(P, provider); + } + return true; + } + } + /** + * Gets or creates the shared registry of metadata providers. + */ + function GetOrCreateMetadataRegistry() { + var metadataRegistry; + if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) metadataRegistry = root.Reflect[registrySymbol]; + if (IsUndefined(metadataRegistry)) metadataRegistry = CreateMetadataRegistry(); + if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) Object.defineProperty(root.Reflect, registrySymbol, { + enumerable: false, + configurable: false, + writable: false, + value: metadataRegistry + }); + return metadataRegistry; + } + function CreateMetadataProvider(registry) { + var metadata = new _WeakMap(); + var provider = { + isProviderFor: function(O, P) { + var targetMetadata = metadata.get(O); + if (IsUndefined(targetMetadata)) return false; + return targetMetadata.has(P); + }, + OrdinaryDefineOwnMetadata, + OrdinaryHasOwnMetadata, + OrdinaryGetOwnMetadata, + OrdinaryOwnMetadataKeys, + OrdinaryDeleteMetadata + }; + metadataRegistry.registerProvider(provider); + return provider; + function GetOrCreateMetadataMap(O, P, Create) { + var targetMetadata = metadata.get(O); + var createdTargetMetadata = false; + if (IsUndefined(targetMetadata)) { + if (!Create) return void 0; + targetMetadata = new _Map(); + metadata.set(O, targetMetadata); + createdTargetMetadata = true; + } + var metadataMap = targetMetadata.get(P); + if (IsUndefined(metadataMap)) { + if (!Create) return void 0; + metadataMap = new _Map(); + targetMetadata.set(P, metadataMap); + if (!registry.setProvider(O, P, provider)) { + targetMetadata.delete(P); + if (createdTargetMetadata) metadata.delete(O); + throw new Error("Wrong provider for target."); + } + } + return metadataMap; + } + function OrdinaryHasOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (IsUndefined(metadataMap)) return false; + return ToBoolean(metadataMap.has(MetadataKey)); + } + function OrdinaryGetOwnMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (IsUndefined(metadataMap)) return void 0; + return metadataMap.get(MetadataKey); + } + function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { + GetOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); + } + function OrdinaryOwnMetadataKeys(O, P) { + var keys = []; + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (IsUndefined(metadataMap)) return keys; + var iterator = GetIterator(metadataMap.keys()); + var k = 0; + while (true) { + var next = IteratorStep(iterator); + if (!next) { + keys.length = k; + return keys; + } + var nextValue = IteratorValue(next); + try { + keys[k] = nextValue; + } catch (e) { + try { + IteratorClose(iterator); + } finally { + throw e; + } + } + k++; + } + } + function OrdinaryDeleteMetadata(MetadataKey, O, P) { + var metadataMap = GetOrCreateMetadataMap(O, P, false); + if (IsUndefined(metadataMap)) return false; + if (!metadataMap.delete(MetadataKey)) return false; + if (metadataMap.size === 0) { + var targetMetadata = metadata.get(O); + if (!IsUndefined(targetMetadata)) { + targetMetadata.delete(P); + if (targetMetadata.size === 0) metadata.delete(targetMetadata); + } + } + return true; + } + } + function CreateFallbackProvider(reflect) { + var defineMetadata = reflect.defineMetadata, hasOwnMetadata = reflect.hasOwnMetadata, getOwnMetadata = reflect.getOwnMetadata, getOwnMetadataKeys = reflect.getOwnMetadataKeys, deleteMetadata = reflect.deleteMetadata; + var metadataOwner = new _WeakMap(); + return { + isProviderFor: function(O, P) { + var metadataPropertySet = metadataOwner.get(O); + if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) return true; + if (getOwnMetadataKeys(O, P).length) { + if (IsUndefined(metadataPropertySet)) { + metadataPropertySet = new _Set(); + metadataOwner.set(O, metadataPropertySet); + } + metadataPropertySet.add(P); + return true; + } + return false; + }, + OrdinaryDefineOwnMetadata: defineMetadata, + OrdinaryHasOwnMetadata: hasOwnMetadata, + OrdinaryGetOwnMetadata: getOwnMetadata, + OrdinaryOwnMetadataKeys: getOwnMetadataKeys, + OrdinaryDeleteMetadata: deleteMetadata + }; + } + /** + * Gets the metadata provider for an object. If the object has no metadata provider and this is for a create operation, + * then this module's metadata provider is assigned to the object. + */ + function GetMetadataProvider(O, P, Create) { + var registeredProvider = metadataRegistry.getProvider(O, P); + if (!IsUndefined(registeredProvider)) return registeredProvider; + if (Create) { + if (metadataRegistry.setProvider(O, P, metadataProvider)) return metadataProvider; + throw new Error("Illegal state."); + } + } + function CreateMapPolyfill() { + var cacheSentinel = {}; + var arraySentinel = []; + var MapIterator = function() { + function MapIterator(keys, values, selector) { + this._index = 0; + this._keys = keys; + this._values = values; + this._selector = selector; + } + MapIterator.prototype["@@iterator"] = function() { + return this; + }; + MapIterator.prototype[iteratorSymbol] = function() { + return this; + }; + MapIterator.prototype.next = function() { + var index = this._index; + if (index >= 0 && index < this._keys.length) { + var result = this._selector(this._keys[index], this._values[index]); + if (index + 1 >= this._keys.length) { + this._index = -1; + this._keys = arraySentinel; + this._values = arraySentinel; + } else this._index++; + return { + value: result, + done: false + }; + } + return { + value: void 0, + done: true + }; + }; + MapIterator.prototype.throw = function(error) { + if (this._index >= 0) { + this._index = -1; + this._keys = arraySentinel; + this._values = arraySentinel; + } + throw error; + }; + MapIterator.prototype.return = function(value) { + if (this._index >= 0) { + this._index = -1; + this._keys = arraySentinel; + this._values = arraySentinel; + } + return { + value, + done: true + }; + }; + return MapIterator; + }(); + return function() { + function Map() { + this._keys = []; + this._values = []; + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + } + Object.defineProperty(Map.prototype, "size", { + get: function() { + return this._keys.length; + }, + enumerable: true, + configurable: true + }); + Map.prototype.has = function(key) { + return this._find(key, false) >= 0; + }; + Map.prototype.get = function(key) { + var index = this._find(key, false); + return index >= 0 ? this._values[index] : void 0; + }; + Map.prototype.set = function(key, value) { + var index = this._find(key, true); + this._values[index] = value; + return this; + }; + Map.prototype.delete = function(key) { + var index = this._find(key, false); + if (index >= 0) { + var size = this._keys.length; + for (var i = index + 1; i < size; i++) { + this._keys[i - 1] = this._keys[i]; + this._values[i - 1] = this._values[i]; + } + this._keys.length--; + this._values.length--; + if (SameValueZero(key, this._cacheKey)) { + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + } + return true; + } + return false; + }; + Map.prototype.clear = function() { + this._keys.length = 0; + this._values.length = 0; + this._cacheKey = cacheSentinel; + this._cacheIndex = -2; + }; + Map.prototype.keys = function() { + return new MapIterator(this._keys, this._values, getKey); + }; + Map.prototype.values = function() { + return new MapIterator(this._keys, this._values, getValue); + }; + Map.prototype.entries = function() { + return new MapIterator(this._keys, this._values, getEntry); + }; + Map.prototype["@@iterator"] = function() { + return this.entries(); + }; + Map.prototype[iteratorSymbol] = function() { + return this.entries(); + }; + Map.prototype._find = function(key, insert) { + if (!SameValueZero(this._cacheKey, key)) { + this._cacheIndex = -1; + for (var i = 0; i < this._keys.length; i++) if (SameValueZero(this._keys[i], key)) { + this._cacheIndex = i; + break; + } + } + if (this._cacheIndex < 0 && insert) { + this._cacheIndex = this._keys.length; + this._keys.push(key); + this._values.push(void 0); + } + return this._cacheIndex; + }; + return Map; + }(); + function getKey(key, _) { + return key; + } + function getValue(_, value) { + return value; + } + function getEntry(key, value) { + return [key, value]; + } + } + function CreateSetPolyfill() { + return function() { + function Set() { + this._map = new _Map(); + } + Object.defineProperty(Set.prototype, "size", { + get: function() { + return this._map.size; + }, + enumerable: true, + configurable: true + }); + Set.prototype.has = function(value) { + return this._map.has(value); + }; + Set.prototype.add = function(value) { + return this._map.set(value, value), this; + }; + Set.prototype.delete = function(value) { + return this._map.delete(value); + }; + Set.prototype.clear = function() { + this._map.clear(); + }; + Set.prototype.keys = function() { + return this._map.keys(); + }; + Set.prototype.values = function() { + return this._map.keys(); + }; + Set.prototype.entries = function() { + return this._map.entries(); + }; + Set.prototype["@@iterator"] = function() { + return this.keys(); + }; + Set.prototype[iteratorSymbol] = function() { + return this.keys(); + }; + return Set; + }(); + } + function CreateWeakMapPolyfill() { + var UUID_SIZE = 16; + var keys = HashMap.create(); + var rootKey = CreateUniqueKey(); + return function() { + function WeakMap() { + this._key = CreateUniqueKey(); + } + WeakMap.prototype.has = function(target) { + var table = GetOrCreateWeakMapTable(target, false); + return table !== void 0 ? HashMap.has(table, this._key) : false; + }; + WeakMap.prototype.get = function(target) { + var table = GetOrCreateWeakMapTable(target, false); + return table !== void 0 ? HashMap.get(table, this._key) : void 0; + }; + WeakMap.prototype.set = function(target, value) { + var table = GetOrCreateWeakMapTable(target, true); + table[this._key] = value; + return this; + }; + WeakMap.prototype.delete = function(target) { + var table = GetOrCreateWeakMapTable(target, false); + return table !== void 0 ? delete table[this._key] : false; + }; + WeakMap.prototype.clear = function() { + this._key = CreateUniqueKey(); + }; + return WeakMap; + }(); + function CreateUniqueKey() { + var key; + do + key = "@@WeakMap@@" + CreateUUID(); + while (HashMap.has(keys, key)); + keys[key] = true; + return key; + } + function GetOrCreateWeakMapTable(target, create) { + if (!hasOwn.call(target, rootKey)) { + if (!create) return void 0; + Object.defineProperty(target, rootKey, { value: HashMap.create() }); + } + return target[rootKey]; + } + function FillRandomBytes(buffer, size) { + for (var i = 0; i < size; ++i) buffer[i] = Math.random() * 255 | 0; + return buffer; + } + function GenRandomBytes(size) { + if (typeof Uint8Array === "function") { + var array = new Uint8Array(size); + if (typeof crypto !== "undefined") crypto.getRandomValues(array); + else if (typeof msCrypto !== "undefined") msCrypto.getRandomValues(array); + else FillRandomBytes(array, size); + return array; + } + return FillRandomBytes(new Array(size), size); + } + function CreateUUID() { + var data = GenRandomBytes(UUID_SIZE); + data[6] = data[6] & 79 | 64; + data[8] = data[8] & 191 | 128; + var result = ""; + for (var offset = 0; offset < UUID_SIZE; ++offset) { + var byte = data[offset]; + if (offset === 4 || offset === 6 || offset === 8) result += "-"; + if (byte < 16) result += "0"; + result += byte.toString(16).toLowerCase(); + } + return result; + } + } + function MakeDictionary(obj) { + obj.__ = void 0; + delete obj.__; + return obj; + } + }); + })(Reflect || (Reflect = {})); +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/bytes/buffer-source.js +var require_buffer_source = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isArrayBuffer = isArrayBuffer; + exports.isSharedArrayBuffer = isSharedArrayBuffer; + exports.isArrayBufferLike = isArrayBufferLike; + exports.isArrayBufferView = isArrayBufferView; + exports.isBufferSource = isBufferSource; + exports.assertBufferSource = assertBufferSource; + exports.toUint8Array = toUint8Array; + exports.toUint8ArrayCopy = toUint8ArrayCopy; + exports.toArrayBuffer = toArrayBuffer; + exports.toArrayBufferLike = toArrayBufferLike; + exports.toView = toView; + exports.toViewCopy = toViewCopy; + const ARRAY_BUFFER_TAG = "[object ArrayBuffer]"; + const SHARED_ARRAY_BUFFER_TAG = "[object SharedArrayBuffer]"; + function tagOf(value) { + return Object.prototype.toString.call(value); + } + function isDataViewConstructor(type) { + return type === DataView || type.prototype instanceof DataView; + } + function bytesPerElement(type) { + if (isDataViewConstructor(type)) return 1; + return type.BYTES_PER_ELEMENT ?? 1; + } + function isArrayBufferViewLike(value) { + if (ArrayBuffer.isView(value)) return true; + if (!value || typeof value !== "object") return false; + const view = value; + return typeof view.byteOffset === "number" && typeof view.byteLength === "number" && isArrayBufferLike(view.buffer); + } + function copyBytes(data) { + const view = toUint8Array(data); + const copy = new Uint8Array(view.byteLength); + copy.set(view); + return copy; + } + function isArrayBuffer(value) { + return tagOf(value) === ARRAY_BUFFER_TAG; + } + function isSharedArrayBuffer(value) { + return typeof SharedArrayBuffer !== "undefined" && tagOf(value) === SHARED_ARRAY_BUFFER_TAG; + } + function isArrayBufferLike(value) { + return isArrayBuffer(value) || isSharedArrayBuffer(value); + } + function isArrayBufferView(value) { + return isArrayBufferViewLike(value); + } + function isBufferSource(value) { + return isArrayBufferLike(value) || isArrayBufferView(value); + } + function assertBufferSource(value) { + if (!isBufferSource(value)) throw new TypeError("Expected ArrayBuffer, SharedArrayBuffer, or ArrayBufferView"); + } + function toUint8Array(data) { + assertBufferSource(data); + if (isArrayBufferLike(data)) return new Uint8Array(data); + return new Uint8Array(data.buffer, data.byteOffset, data.byteLength); + } + function toUint8ArrayCopy(data) { + return copyBytes(data); + } + function toArrayBuffer(data) { + assertBufferSource(data); + if (isArrayBuffer(data)) return data; + const buffer = new ArrayBuffer(data.byteLength); + new Uint8Array(buffer).set(toUint8Array(data)); + return buffer; + } + function toArrayBufferLike(data) { + assertBufferSource(data); + if (isArrayBufferLike(data)) return data; + if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) return data.buffer; + return copyBytes(data).buffer; + } + function toView(data, type) { + assertBufferSource(data); + if (ArrayBuffer.isView(data) && data.constructor === type) return data; + const view = toUint8Array(data); + const elementSize = bytesPerElement(type); + if (view.byteOffset % elementSize !== 0 || view.byteLength % elementSize !== 0) throw new RangeError(`Cannot create ${type.name} over unaligned byte range`); + if (isDataViewConstructor(type)) return new type(view.buffer, view.byteOffset, view.byteLength); + return new type(view.buffer, view.byteOffset, view.byteLength / elementSize); + } + function toViewCopy(data, type) { + return toView(toUint8ArrayCopy(data), type); + } +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/bytes/concat.js +var require_concat = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.concatToUint8Array = concatToUint8Array; + exports.concat = concat; + const buffer_source_js_1 = require_buffer_source(); + function concatToUint8Array(buffers) { + const views = []; + let length = 0; + for (const buffer of buffers) { + const view = (0, buffer_source_js_1.toUint8Array)(buffer); + views.push(view); + length += view.byteLength; + } + const result = new Uint8Array(length); + let offset = 0; + for (const view of views) { + result.set(view, offset); + offset += view.byteLength; + } + return result; + } + function concat(first, second, ...rest) { + let buffers; + let type; + if (typeof second === "function") { + buffers = Array.from(first); + type = second; + } else if ((0, buffer_source_js_1.isBufferSource)(first)) buffers = [ + first, + second, + ...rest + ].filter(buffer_source_js_1.isBufferSource); + else { + buffers = Array.from(first); + if (second) buffers.push(second); + buffers.push(...rest); + } + const bytes = concatToUint8Array(buffers); + return type ? (0, buffer_source_js_1.toView)(bytes, type) : bytes.buffer; + } +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/bytes/equal.js +var require_equal = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.equal = equal; + const buffer_source_js_1 = require_buffer_source(); + function equal(a, b, options = {}) { + const left = (0, buffer_source_js_1.toUint8Array)(a); + const right = (0, buffer_source_js_1.toUint8Array)(b); + if (!options.constantTime && left.byteLength !== right.byteLength) return false; + const length = Math.max(left.byteLength, right.byteLength); + let diff = left.byteLength ^ right.byteLength; + for (let i = 0; i < length; i++) diff |= (left[i] ?? 0) ^ (right[i] ?? 0); + return diff === 0; + } +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/bytes/sequence.js +var require_sequence = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.indexOf = indexOf; + exports.lastIndexOf = lastIndexOf; + exports.includes = includes; + exports.startsWith = startsWith; + exports.endsWith = endsWith; + exports.slice = slice; + exports.tail = tail; + exports.copy = copy; + exports.compare = compare; + const buffer_source_js_1 = require_buffer_source(); + function clampIndex(value, fallback, length) { + const normalized = Number.isFinite(value) ? Math.trunc(value) : fallback; + if (normalized <= 0) return 0; + if (normalized >= length) return length; + return normalized; + } + function normalizeForwardRange(length, options) { + const start = clampIndex(options?.start, 0, length); + const end = clampIndex(options?.end, length, length); + return end >= start ? [start, end] : [start, start]; + } + function normalizeReverseRange(length, options) { + const start = clampIndex(options?.start, length, length); + const end = clampIndex(options?.end, 0, length); + return start >= end ? [end, start] : [start, start]; + } + function normalizeSliceIndex(value, fallback, length) { + const normalized = Number.isFinite(value) ? Math.trunc(value) : fallback; + if (normalized < 0) return Math.max(length + normalized, 0); + if (normalized > length) return length; + return normalized; + } + function encodeAscii(text) { + const bytes = new Uint8Array(text.length); + for (let i = 0; i < text.length; i++) bytes[i] = text.charCodeAt(i) & 255; + return bytes; + } + function encodeUtf8(text) { + return new TextEncoder().encode(text); + } + function toPatternBytes(pattern, options) { + if (typeof pattern === "string") return options?.encoding === "utf8" ? encodeUtf8(pattern) : encodeAscii(pattern); + return (0, buffer_source_js_1.toUint8Array)(pattern); + } + function bytesEqualAt(data, pattern, offset) { + for (let index = 0; index < pattern.byteLength; index++) if (data[offset + index] !== pattern[index]) return false; + return true; + } + function indexOf(data, pattern, options) { + const bytes = (0, buffer_source_js_1.toUint8Array)(data); + const needle = toPatternBytes(pattern, options); + const [start, end] = normalizeForwardRange(bytes.byteLength, options); + if (needle.byteLength === 0) return start; + const lastOffset = end - needle.byteLength; + if (lastOffset < start) return -1; + for (let offset = start; offset <= lastOffset; offset++) if (bytesEqualAt(bytes, needle, offset)) return offset; + return -1; + } + function lastIndexOf(data, pattern, options) { + const bytes = (0, buffer_source_js_1.toUint8Array)(data); + const needle = toPatternBytes(pattern, options); + const [end, start] = normalizeReverseRange(bytes.byteLength, options); + if (needle.byteLength === 0) return start; + const firstOffset = start - needle.byteLength; + if (firstOffset < end) return -1; + for (let offset = firstOffset; offset >= end; offset--) if (bytesEqualAt(bytes, needle, offset)) return offset; + return -1; + } + function includes(data, pattern, options) { + return indexOf(data, pattern, options) !== -1; + } + function startsWith(data, pattern, options) { + const bytes = (0, buffer_source_js_1.toUint8Array)(data); + const needle = toPatternBytes(pattern, options); + if (needle.byteLength > bytes.byteLength) return false; + return bytesEqualAt(bytes, needle, 0); + } + function endsWith(data, pattern, options) { + const bytes = (0, buffer_source_js_1.toUint8Array)(data); + const needle = toPatternBytes(pattern, options); + if (needle.byteLength > bytes.byteLength) return false; + return bytesEqualAt(bytes, needle, bytes.byteLength - needle.byteLength); + } + function slice(data, start, end) { + const bytes = (0, buffer_source_js_1.toUint8Array)(data); + const normalizedStart = normalizeSliceIndex(start, 0, bytes.byteLength); + const normalizedEnd = normalizeSliceIndex(end, bytes.byteLength, bytes.byteLength); + if (normalizedEnd <= normalizedStart) return bytes.subarray(normalizedStart, normalizedStart); + return bytes.subarray(normalizedStart, normalizedEnd); + } + function tail(data, length) { + const bytes = (0, buffer_source_js_1.toUint8Array)(data); + const normalizedLength = Number.isFinite(length) ? Math.max(0, Math.trunc(length)) : 0; + if (normalizedLength >= bytes.byteLength) return bytes; + return bytes.subarray(bytes.byteLength - normalizedLength); + } + function copy(data) { + return (0, buffer_source_js_1.toUint8ArrayCopy)(data); + } + function compare(a, b) { + const left = (0, buffer_source_js_1.toUint8Array)(a); + const right = (0, buffer_source_js_1.toUint8Array)(b); + const limit = Math.min(left.byteLength, right.byteLength); + for (let index = 0; index < limit; index++) { + if (left[index] < right[index]) return -1; + if (left[index] > right[index]) return 1; + } + if (left.byteLength < right.byteLength) return -1; + if (left.byteLength > right.byteLength) return 1; + return 0; + } +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/bytes/index.js +var require_bytes = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.tail = exports.startsWith = exports.slice = exports.lastIndexOf = exports.indexOf = exports.includes = exports.endsWith = exports.copy = exports.compare = exports.equal = exports.concatToUint8Array = exports.concat = exports.toViewCopy = exports.toView = exports.toUint8ArrayCopy = exports.toUint8Array = exports.toArrayBufferLike = exports.toArrayBuffer = exports.isSharedArrayBuffer = exports.isBufferSource = exports.isArrayBufferView = exports.isArrayBufferLike = exports.isArrayBuffer = exports.assertBufferSource = void 0; + var buffer_source_js_1 = require_buffer_source(); + Object.defineProperty(exports, "assertBufferSource", { + enumerable: true, + get: function() { + return buffer_source_js_1.assertBufferSource; + } + }); + Object.defineProperty(exports, "isArrayBuffer", { + enumerable: true, + get: function() { + return buffer_source_js_1.isArrayBuffer; + } + }); + Object.defineProperty(exports, "isArrayBufferLike", { + enumerable: true, + get: function() { + return buffer_source_js_1.isArrayBufferLike; + } + }); + Object.defineProperty(exports, "isArrayBufferView", { + enumerable: true, + get: function() { + return buffer_source_js_1.isArrayBufferView; + } + }); + Object.defineProperty(exports, "isBufferSource", { + enumerable: true, + get: function() { + return buffer_source_js_1.isBufferSource; + } + }); + Object.defineProperty(exports, "isSharedArrayBuffer", { + enumerable: true, + get: function() { + return buffer_source_js_1.isSharedArrayBuffer; + } + }); + Object.defineProperty(exports, "toArrayBuffer", { + enumerable: true, + get: function() { + return buffer_source_js_1.toArrayBuffer; + } + }); + Object.defineProperty(exports, "toArrayBufferLike", { + enumerable: true, + get: function() { + return buffer_source_js_1.toArrayBufferLike; + } + }); + Object.defineProperty(exports, "toUint8Array", { + enumerable: true, + get: function() { + return buffer_source_js_1.toUint8Array; + } + }); + Object.defineProperty(exports, "toUint8ArrayCopy", { + enumerable: true, + get: function() { + return buffer_source_js_1.toUint8ArrayCopy; + } + }); + Object.defineProperty(exports, "toView", { + enumerable: true, + get: function() { + return buffer_source_js_1.toView; + } + }); + Object.defineProperty(exports, "toViewCopy", { + enumerable: true, + get: function() { + return buffer_source_js_1.toViewCopy; + } + }); + var concat_js_1 = require_concat(); + Object.defineProperty(exports, "concat", { + enumerable: true, + get: function() { + return concat_js_1.concat; + } + }); + Object.defineProperty(exports, "concatToUint8Array", { + enumerable: true, + get: function() { + return concat_js_1.concatToUint8Array; + } + }); + var equal_js_1 = require_equal(); + Object.defineProperty(exports, "equal", { + enumerable: true, + get: function() { + return equal_js_1.equal; + } + }); + var sequence_js_1 = require_sequence(); + Object.defineProperty(exports, "compare", { + enumerable: true, + get: function() { + return sequence_js_1.compare; + } + }); + Object.defineProperty(exports, "copy", { + enumerable: true, + get: function() { + return sequence_js_1.copy; + } + }); + Object.defineProperty(exports, "endsWith", { + enumerable: true, + get: function() { + return sequence_js_1.endsWith; + } + }); + Object.defineProperty(exports, "includes", { + enumerable: true, + get: function() { + return sequence_js_1.includes; + } + }); + Object.defineProperty(exports, "indexOf", { + enumerable: true, + get: function() { + return sequence_js_1.indexOf; + } + }); + Object.defineProperty(exports, "lastIndexOf", { + enumerable: true, + get: function() { + return sequence_js_1.lastIndexOf; + } + }); + Object.defineProperty(exports, "slice", { + enumerable: true, + get: function() { + return sequence_js_1.slice; + } + }); + Object.defineProperty(exports, "startsWith", { + enumerable: true, + get: function() { + return sequence_js_1.startsWith; + } + }); + Object.defineProperty(exports, "tail", { + enumerable: true, + get: function() { + return sequence_js_1.tail; + } + }); +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/enums.js +var require_enums = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnPropTypes = exports.AsnTypeTypes = void 0; + var AsnTypeTypes; + (function(AsnTypeTypes) { + AsnTypeTypes[AsnTypeTypes["Sequence"] = 0] = "Sequence"; + AsnTypeTypes[AsnTypeTypes["Set"] = 1] = "Set"; + AsnTypeTypes[AsnTypeTypes["Choice"] = 2] = "Choice"; + })(AsnTypeTypes || (exports.AsnTypeTypes = AsnTypeTypes = {})); + var AsnPropTypes; + (function(AsnPropTypes) { + AsnPropTypes[AsnPropTypes["Any"] = 1] = "Any"; + AsnPropTypes[AsnPropTypes["Boolean"] = 2] = "Boolean"; + AsnPropTypes[AsnPropTypes["OctetString"] = 3] = "OctetString"; + AsnPropTypes[AsnPropTypes["BitString"] = 4] = "BitString"; + AsnPropTypes[AsnPropTypes["Integer"] = 5] = "Integer"; + AsnPropTypes[AsnPropTypes["Enumerated"] = 6] = "Enumerated"; + AsnPropTypes[AsnPropTypes["ObjectIdentifier"] = 7] = "ObjectIdentifier"; + AsnPropTypes[AsnPropTypes["Utf8String"] = 8] = "Utf8String"; + AsnPropTypes[AsnPropTypes["BmpString"] = 9] = "BmpString"; + AsnPropTypes[AsnPropTypes["UniversalString"] = 10] = "UniversalString"; + AsnPropTypes[AsnPropTypes["NumericString"] = 11] = "NumericString"; + AsnPropTypes[AsnPropTypes["PrintableString"] = 12] = "PrintableString"; + AsnPropTypes[AsnPropTypes["TeletexString"] = 13] = "TeletexString"; + AsnPropTypes[AsnPropTypes["VideotexString"] = 14] = "VideotexString"; + AsnPropTypes[AsnPropTypes["IA5String"] = 15] = "IA5String"; + AsnPropTypes[AsnPropTypes["GraphicString"] = 16] = "GraphicString"; + AsnPropTypes[AsnPropTypes["VisibleString"] = 17] = "VisibleString"; + AsnPropTypes[AsnPropTypes["GeneralString"] = 18] = "GeneralString"; + AsnPropTypes[AsnPropTypes["CharacterString"] = 19] = "CharacterString"; + AsnPropTypes[AsnPropTypes["UTCTime"] = 20] = "UTCTime"; + AsnPropTypes[AsnPropTypes["GeneralizedTime"] = 21] = "GeneralizedTime"; + AsnPropTypes[AsnPropTypes["DATE"] = 22] = "DATE"; + AsnPropTypes[AsnPropTypes["TimeOfDay"] = 23] = "TimeOfDay"; + AsnPropTypes[AsnPropTypes["DateTime"] = 24] = "DateTime"; + AsnPropTypes[AsnPropTypes["Duration"] = 25] = "Duration"; + AsnPropTypes[AsnPropTypes["TIME"] = 26] = "TIME"; + AsnPropTypes[AsnPropTypes["Null"] = 27] = "Null"; + })(AsnPropTypes || (exports.AsnPropTypes = AsnPropTypes = {})); +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/types/bit_string.js +var require_bit_string = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BitString = void 0; + const asn1js = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)).__importStar(require_build()); + const bytes_1 = require_bytes(); + var BitString = class { + unusedBits = 0; + value = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params, unusedBits = 0) { + if (params) if (typeof params === "number") this.fromNumber(params); + else if ((0, bytes_1.isBufferSource)(params)) { + this.unusedBits = unusedBits; + this.value = (0, bytes_1.toArrayBuffer)(params); + } else throw TypeError("Unsupported type of 'params' argument for BitString"); + } + fromASN(asn) { + if (!(asn instanceof asn1js.BitString)) throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString"); + this.unusedBits = asn.valueBlock.unusedBits; + this.value = (0, bytes_1.toArrayBuffer)(asn.valueBlock.valueHex); + return this; + } + toASN() { + return new asn1js.BitString({ + unusedBits: this.unusedBits, + valueHex: this.value + }); + } + toSchema(name) { + return new asn1js.BitString({ name }); + } + toNumber() { + let res = ""; + const uintArray = new Uint8Array(this.value); + for (const octet of uintArray) res += octet.toString(2).padStart(8, "0"); + res = res.split("").reverse().join(""); + if (this.unusedBits) res = res.slice(this.unusedBits).padStart(this.unusedBits, "0"); + return parseInt(res, 2); + } + fromNumber(value) { + let bits = value.toString(2); + const octetSize = bits.length + 7 >> 3; + this.unusedBits = (octetSize << 3) - bits.length; + const octets = new Uint8Array(octetSize); + bits = bits.padStart(octetSize << 3, "0").split("").reverse().join(""); + let index = 0; + while (index < octetSize) { + octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2); + index++; + } + this.value = octets.buffer; + } + }; + exports.BitString = BitString; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/types/octet_string.js +var require_octet_string = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OctetString = void 0; + const asn1js = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)).__importStar(require_build()); + const bytes_1 = require_bytes(); + var OctetString = class { + buffer; + get byteLength() { + return this.buffer.byteLength; + } + get byteOffset() { + return 0; + } + constructor(param) { + if (typeof param === "number") this.buffer = new ArrayBuffer(param); + else if ((0, bytes_1.isBufferSource)(param)) this.buffer = (0, bytes_1.toArrayBuffer)(param); + else if (Array.isArray(param)) this.buffer = new Uint8Array(param).buffer; + else this.buffer = /* @__PURE__ */ new ArrayBuffer(0); + } + fromASN(asn) { + if (!(asn instanceof asn1js.OctetString)) throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString"); + this.buffer = (0, bytes_1.toArrayBuffer)(asn.valueBlock.valueHex); + return this; + } + toASN() { + return new asn1js.OctetString({ valueHex: this.buffer }); + } + toSchema(name) { + return new asn1js.OctetString({ name }); + } + }; + exports.OctetString = OctetString; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/types/index.js +var require_types$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_bit_string(), exports); + tslib_1.__exportStar(require_octet_string(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/converters.js +var require_converters = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnNullConverter = exports.AsnGeneralizedTimeConverter = exports.AsnUTCTimeConverter = exports.AsnCharacterStringConverter = exports.AsnGeneralStringConverter = exports.AsnVisibleStringConverter = exports.AsnGraphicStringConverter = exports.AsnIA5StringConverter = exports.AsnVideotexStringConverter = exports.AsnTeletexStringConverter = exports.AsnPrintableStringConverter = exports.AsnNumericStringConverter = exports.AsnUniversalStringConverter = exports.AsnBmpStringConverter = exports.AsnUtf8StringConverter = exports.AsnConstructedOctetStringConverter = exports.AsnOctetStringConverter = exports.AsnBooleanConverter = exports.AsnObjectIdentifierConverter = exports.AsnBitStringConverter = exports.AsnIntegerBigIntConverter = exports.AsnIntegerArrayBufferConverter = exports.AsnEnumeratedConverter = exports.AsnIntegerConverter = exports.AsnAnyConverter = void 0; + exports.defaultConverter = defaultConverter; + const asn1js = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)).__importStar(require_build()); + const bytes_1 = require_bytes(); + const enums_1 = require_enums(); + const index_1 = require_types$4(); + exports.AsnAnyConverter = { + fromASN: (value) => value instanceof asn1js.Null ? null : (0, bytes_1.toArrayBuffer)(value.valueBeforeDecodeView), + toASN: (value) => { + if (value === null) return new asn1js.Null(); + const schema = asn1js.fromBER(value); + if (schema.result.error) throw new Error(schema.result.error); + return schema.result; + } + }; + exports.AsnIntegerConverter = { + fromASN: (value) => value.valueBlock.valueHexView.byteLength >= 4 ? value.valueBlock.toString() : value.valueBlock.valueDec, + toASN: (value) => new asn1js.Integer({ value: +value }) + }; + exports.AsnEnumeratedConverter = { + fromASN: (value) => value.valueBlock.valueDec, + toASN: (value) => new asn1js.Enumerated({ value }) + }; + exports.AsnIntegerArrayBufferConverter = { + fromASN: (value) => (0, bytes_1.toArrayBuffer)(value.valueBlock.valueHexView), + toASN: (value) => new asn1js.Integer({ valueHex: value }) + }; + exports.AsnIntegerBigIntConverter = { + fromASN: (value) => value.toBigInt(), + toASN: (value) => asn1js.Integer.fromBigInt(value) + }; + exports.AsnBitStringConverter = { + fromASN: (value) => (0, bytes_1.toArrayBuffer)(value.valueBlock.valueHexView), + toASN: (value) => new asn1js.BitString({ valueHex: value }) + }; + exports.AsnObjectIdentifierConverter = { + fromASN: (value) => value.valueBlock.toString(), + toASN: (value) => new asn1js.ObjectIdentifier({ value }) + }; + exports.AsnBooleanConverter = { + fromASN: (value) => value.valueBlock.value, + toASN: (value) => new asn1js.Boolean({ value }) + }; + exports.AsnOctetStringConverter = { + fromASN: (value) => (0, bytes_1.toArrayBuffer)(value.valueBlock.valueHexView), + toASN: (value) => new asn1js.OctetString({ valueHex: value }) + }; + exports.AsnConstructedOctetStringConverter = { + fromASN: (value) => new index_1.OctetString(value.getValue()), + toASN: (value) => value.toASN() + }; + function createStringConverter(Asn1Type) { + return { + fromASN: (value) => value.valueBlock.value, + toASN: (value) => new Asn1Type({ value }) + }; + } + exports.AsnUtf8StringConverter = createStringConverter(asn1js.Utf8String); + exports.AsnBmpStringConverter = createStringConverter(asn1js.BmpString); + exports.AsnUniversalStringConverter = createStringConverter(asn1js.UniversalString); + exports.AsnNumericStringConverter = createStringConverter(asn1js.NumericString); + exports.AsnPrintableStringConverter = createStringConverter(asn1js.PrintableString); + exports.AsnTeletexStringConverter = createStringConverter(asn1js.TeletexString); + exports.AsnVideotexStringConverter = createStringConverter(asn1js.VideotexString); + exports.AsnIA5StringConverter = createStringConverter(asn1js.IA5String); + exports.AsnGraphicStringConverter = createStringConverter(asn1js.GraphicString); + exports.AsnVisibleStringConverter = createStringConverter(asn1js.VisibleString); + exports.AsnGeneralStringConverter = createStringConverter(asn1js.GeneralString); + exports.AsnCharacterStringConverter = createStringConverter(asn1js.CharacterString); + exports.AsnUTCTimeConverter = { + fromASN: (value) => value.toDate(), + toASN: (value) => new asn1js.UTCTime({ valueDate: value }) + }; + exports.AsnGeneralizedTimeConverter = { + fromASN: (value) => value.toDate(), + toASN: (value) => new asn1js.GeneralizedTime({ valueDate: value }) + }; + exports.AsnNullConverter = { + fromASN: () => null, + toASN: () => { + return new asn1js.Null(); + } + }; + function defaultConverter(type) { + switch (type) { + case enums_1.AsnPropTypes.Any: return exports.AsnAnyConverter; + case enums_1.AsnPropTypes.BitString: return exports.AsnBitStringConverter; + case enums_1.AsnPropTypes.BmpString: return exports.AsnBmpStringConverter; + case enums_1.AsnPropTypes.Boolean: return exports.AsnBooleanConverter; + case enums_1.AsnPropTypes.CharacterString: return exports.AsnCharacterStringConverter; + case enums_1.AsnPropTypes.Enumerated: return exports.AsnEnumeratedConverter; + case enums_1.AsnPropTypes.GeneralString: return exports.AsnGeneralStringConverter; + case enums_1.AsnPropTypes.GeneralizedTime: return exports.AsnGeneralizedTimeConverter; + case enums_1.AsnPropTypes.GraphicString: return exports.AsnGraphicStringConverter; + case enums_1.AsnPropTypes.IA5String: return exports.AsnIA5StringConverter; + case enums_1.AsnPropTypes.Integer: return exports.AsnIntegerConverter; + case enums_1.AsnPropTypes.Null: return exports.AsnNullConverter; + case enums_1.AsnPropTypes.NumericString: return exports.AsnNumericStringConverter; + case enums_1.AsnPropTypes.ObjectIdentifier: return exports.AsnObjectIdentifierConverter; + case enums_1.AsnPropTypes.OctetString: return exports.AsnOctetStringConverter; + case enums_1.AsnPropTypes.PrintableString: return exports.AsnPrintableStringConverter; + case enums_1.AsnPropTypes.TeletexString: return exports.AsnTeletexStringConverter; + case enums_1.AsnPropTypes.UTCTime: return exports.AsnUTCTimeConverter; + case enums_1.AsnPropTypes.UniversalString: return exports.AsnUniversalStringConverter; + case enums_1.AsnPropTypes.Utf8String: return exports.AsnUtf8StringConverter; + case enums_1.AsnPropTypes.VideotexString: return exports.AsnVideotexStringConverter; + case enums_1.AsnPropTypes.VisibleString: return exports.AsnVisibleStringConverter; + default: return null; + } + } +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/helper.js +var require_helper = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isConvertible = isConvertible; + exports.isTypeOfArray = isTypeOfArray; + exports.isArrayEqual = isArrayEqual; + function isConvertible(target) { + if (typeof target === "function" && target.prototype) if (target.prototype.toASN && target.prototype.fromASN) return true; + else return isConvertible(target.prototype); + else return !!(target && typeof target === "object" && "toASN" in target && "fromASN" in target); + } + function isTypeOfArray(target) { + if (target) { + const proto = Object.getPrototypeOf(target); + if (proto?.prototype?.constructor === Array) return true; + return isTypeOfArray(proto); + } + return false; + } + function isArrayEqual(bytes1, bytes2) { + if (!(bytes1 && bytes2)) return false; + if (bytes1.byteLength !== bytes2.byteLength) return false; + const b1 = new Uint8Array(bytes1); + const b2 = new Uint8Array(bytes2); + for (let i = 0; i < bytes1.byteLength; i++) if (b1[i] !== b2[i]) return false; + return true; + } +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/schema.js +var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnSchemaStorage = void 0; + const asn1js = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)).__importStar(require_build()); + const enums_1 = require_enums(); + const helper_1 = require_helper(); + var AsnSchemaStorage = class { + items = /* @__PURE__ */ new WeakMap(); + has(target) { + return this.items.has(target); + } + get(target, checkSchema = false) { + const schema = this.items.get(target); + if (!schema) throw new Error(`Cannot get schema for '${target.prototype.constructor.name}' target`); + if (checkSchema && !schema.schema) throw new Error(`Schema '${target.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`); + return schema; + } + cache(target) { + const schema = this.get(target); + if (!schema.schema) schema.schema = this.create(target, true); + } + createDefault(target) { + const schema = { + type: enums_1.AsnTypeTypes.Sequence, + items: {} + }; + const parentSchema = this.findParentSchema(target); + if (parentSchema) { + Object.assign(schema, parentSchema); + schema.items = Object.assign({}, schema.items, parentSchema.items); + } + return schema; + } + create(target, useNames) { + const schema = this.items.get(target) || this.createDefault(target); + const asn1Value = []; + for (const key in schema.items) { + const item = schema.items[key]; + const name = useNames ? key : ""; + let asn1Item; + if (typeof item.type === "number") { + const Asn1TypeName = enums_1.AsnPropTypes[item.type]; + const Asn1Type = asn1js[Asn1TypeName]; + if (!Asn1Type) throw new Error(`Cannot get ASN1 class by name '${Asn1TypeName}'`); + asn1Item = new Asn1Type({ name }); + } else if ((0, helper_1.isConvertible)(item.type)) asn1Item = new item.type().toSchema(name); + else if (item.optional) if (this.get(item.type).type === enums_1.AsnTypeTypes.Choice) asn1Item = new asn1js.Any({ name }); + else { + asn1Item = this.create(item.type, false); + asn1Item.name = name; + } + else asn1Item = new asn1js.Any({ name }); + const optional = !!item.optional || item.defaultValue !== void 0; + if (item.repeated) { + asn1Item.name = ""; + asn1Item = new (item.repeated === "set" ? asn1js.Set : asn1js.Sequence)({ + name: "", + value: [new asn1js.Repeated({ + name, + value: asn1Item + })] + }); + } + if (item.context !== null && item.context !== void 0) if (item.implicit) if (typeof item.type === "number" || (0, helper_1.isConvertible)(item.type)) { + const Container = item.repeated ? asn1js.Constructed : asn1js.Primitive; + asn1Value.push(new Container({ + name, + optional, + idBlock: { + tagClass: 3, + tagNumber: item.context + } + })); + } else { + this.cache(item.type); + const isRepeated = !!item.repeated; + let value = !isRepeated ? this.get(item.type, true).schema : asn1Item; + value = "valueBlock" in value ? value.valueBlock.value : value.value; + asn1Value.push(new asn1js.Constructed({ + name: !isRepeated ? name : "", + optional, + idBlock: { + tagClass: 3, + tagNumber: item.context + }, + value + })); + } + else asn1Value.push(new asn1js.Constructed({ + optional, + idBlock: { + tagClass: 3, + tagNumber: item.context + }, + value: [asn1Item] + })); + else { + asn1Item.optional = optional; + asn1Value.push(asn1Item); + } + } + switch (schema.type) { + case enums_1.AsnTypeTypes.Sequence: return new asn1js.Sequence({ + value: asn1Value, + name: "" + }); + case enums_1.AsnTypeTypes.Set: return new asn1js.Set({ + value: asn1Value, + name: "" + }); + case enums_1.AsnTypeTypes.Choice: return new asn1js.Choice({ + value: asn1Value, + name: "" + }); + default: throw new Error("Unsupported ASN1 type in use"); + } + } + set(target, schema) { + this.items.set(target, schema); + return this; + } + findParentSchema(target) { + const parent = Object.getPrototypeOf(target); + if (parent) return this.items.get(parent) || this.findParentSchema(parent); + return null; + } + }; + exports.AsnSchemaStorage = AsnSchemaStorage; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/storage.js +var require_storage = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.schemaStorage = void 0; + exports.schemaStorage = new (require_schema()).AsnSchemaStorage(); +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/decorators.js +var require_decorators$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnProp = exports.AsnSequenceType = exports.AsnSetType = exports.AsnChoiceType = exports.AsnType = void 0; + const converters = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)).__importStar(require_converters()); + const enums_1 = require_enums(); + const storage_1 = require_storage(); + const AsnType = (options) => (target) => { + let schema; + if (!storage_1.schemaStorage.has(target)) { + schema = storage_1.schemaStorage.createDefault(target); + storage_1.schemaStorage.set(target, schema); + } else schema = storage_1.schemaStorage.get(target); + Object.assign(schema, options); + }; + exports.AsnType = AsnType; + const AsnChoiceType = () => (0, exports.AsnType)({ type: enums_1.AsnTypeTypes.Choice }); + exports.AsnChoiceType = AsnChoiceType; + const AsnSetType = (options) => (0, exports.AsnType)({ + type: enums_1.AsnTypeTypes.Set, + ...options + }); + exports.AsnSetType = AsnSetType; + const AsnSequenceType = (options) => (0, exports.AsnType)({ + type: enums_1.AsnTypeTypes.Sequence, + ...options + }); + exports.AsnSequenceType = AsnSequenceType; + const AsnProp = (options) => (target, propertyKey) => { + let schema; + if (!storage_1.schemaStorage.has(target.constructor)) { + schema = storage_1.schemaStorage.createDefault(target.constructor); + storage_1.schemaStorage.set(target.constructor, schema); + } else schema = storage_1.schemaStorage.get(target.constructor); + const copyOptions = Object.assign({}, options); + if (typeof copyOptions.type === "number" && !copyOptions.converter) { + const defaultConverter = converters.defaultConverter(options.type); + if (!defaultConverter) throw new Error(`Cannot get default converter for property '${propertyKey}' of ${target.constructor.name}`); + copyOptions.converter = defaultConverter; + } + copyOptions.raw = options.raw; + schema.items[propertyKey] = copyOptions; + }; + exports.AsnProp = AsnProp; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/errors/schema_validation.js +var require_schema_validation = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnSchemaValidationError = void 0; + var AsnSchemaValidationError = class extends Error { + schemas = []; + }; + exports.AsnSchemaValidationError = AsnSchemaValidationError; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/errors/index.js +var require_errors = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)).__exportStar(require_schema_validation(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/parser.js +var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnParser = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1js = tslib_1.__importStar(require_build()); + const bytes_1 = require_bytes(); + const enums_1 = require_enums(); + const converters = tslib_1.__importStar(require_converters()); + const errors_1 = require_errors(); + const helper_1 = require_helper(); + const storage_1 = require_storage(); + var AsnParser = class { + static parse(data, target, options) { + const asn1Parsed = asn1js.fromBER((0, bytes_1.toArrayBuffer)(data), options?.berOptions); + if (asn1Parsed.result.error) throw new Error(asn1Parsed.result.error); + return this.fromASN(asn1Parsed.result, target, options); + } + static fromASN(asn1Schema, target, options) { + try { + if ((0, helper_1.isConvertible)(target)) return new target().fromASN(asn1Schema); + const schema = storage_1.schemaStorage.get(target); + storage_1.schemaStorage.cache(target); + let targetSchema = schema.schema; + const choiceResult = this.handleChoiceTypes(asn1Schema, schema, target, targetSchema, options); + if (choiceResult?.result) return choiceResult.result; + if (choiceResult?.targetSchema) targetSchema = choiceResult.targetSchema; + const sequenceResult = this.handleSequenceTypes(asn1Schema, schema, target, targetSchema); + const res = new target(); + if ((0, helper_1.isTypeOfArray)(target)) return this.handleArrayTypes(asn1Schema, schema, target, options); + this.processSchemaItems(schema, sequenceResult, res, options); + return res; + } catch (error) { + if (error instanceof errors_1.AsnSchemaValidationError) error.schemas.push(target.name); + throw error; + } + } + static handleChoiceTypes(asn1Schema, schema, target, targetSchema, options) { + if (asn1Schema.constructor === asn1js.Constructed && schema.type === enums_1.AsnTypeTypes.Choice && asn1Schema.idBlock.tagClass === 3) for (const key in schema.items) { + const schemaItem = schema.items[key]; + if (schemaItem.context === asn1Schema.idBlock.tagNumber && schemaItem.implicit) { + if (typeof schemaItem.type === "function" && storage_1.schemaStorage.has(schemaItem.type)) { + const fieldSchema = storage_1.schemaStorage.get(schemaItem.type); + if (fieldSchema && fieldSchema.type === enums_1.AsnTypeTypes.Sequence) { + const newSeq = new asn1js.Sequence(); + if ("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value) && "value" in newSeq.valueBlock) { + newSeq.valueBlock.value = asn1Schema.valueBlock.value; + const fieldValue = this.fromASN(newSeq, schemaItem.type, options); + const res = new target(); + res[key] = fieldValue; + return { result: res }; + } + } + } + } + } + else if (asn1Schema.constructor === asn1js.Constructed && schema.type !== enums_1.AsnTypeTypes.Choice) { + const newTargetSchema = new asn1js.Constructed({ + idBlock: { + tagClass: 3, + tagNumber: asn1Schema.idBlock.tagNumber + }, + value: schema.schema.valueBlock.value + }); + for (const key in schema.items) delete asn1Schema[key]; + return { targetSchema: newTargetSchema }; + } + return null; + } + static handleSequenceTypes(asn1Schema, schema, target, targetSchema) { + if (schema.type === enums_1.AsnTypeTypes.Sequence) { + const asn1ComparedSchema = asn1js.compareSchema({}, asn1Schema, targetSchema); + if (!asn1ComparedSchema.verified) throw new errors_1.AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : ""}`); + return asn1ComparedSchema; + } else { + const asn1ComparedSchema = asn1js.compareSchema({}, asn1Schema, targetSchema); + if (!asn1ComparedSchema.verified) throw new errors_1.AsnSchemaValidationError(`Data does not match to ${target.name} ASN1 schema.${asn1ComparedSchema.result.error ? ` ${asn1ComparedSchema.result.error}` : ""}`); + return asn1ComparedSchema; + } + } + static processRepeatedField(asn1Elements, asn1Index, schemaItem) { + let elementsToProcess = asn1Elements.slice(asn1Index); + if (elementsToProcess.length === 1 && elementsToProcess[0].constructor.name === "Sequence") { + const seq = elementsToProcess[0]; + if (seq.valueBlock && seq.valueBlock.value && Array.isArray(seq.valueBlock.value)) elementsToProcess = seq.valueBlock.value; + } + if (typeof schemaItem.type === "number") { + const converter = converters.defaultConverter(schemaItem.type); + if (!converter) throw new Error(`No converter for ASN.1 type ${schemaItem.type}`); + return elementsToProcess.filter((el) => el && el.valueBlock).map((el) => { + try { + return converter.fromASN(el); + } catch { + return; + } + }).filter((v) => v !== void 0); + } else return elementsToProcess.filter((el) => el && el.valueBlock).map((el) => { + try { + return this.fromASN(el, schemaItem.type); + } catch { + return; + } + }).filter((v) => v !== void 0); + } + static processPrimitiveField(asn1Element, schemaItem) { + const converter = converters.defaultConverter(schemaItem.type); + if (!converter) throw new Error(`No converter for ASN.1 type ${schemaItem.type}`); + return converter.fromASN(asn1Element); + } + static isOptionalChoiceField(schemaItem) { + return schemaItem.optional && typeof schemaItem.type === "function" && storage_1.schemaStorage.has(schemaItem.type) && storage_1.schemaStorage.get(schemaItem.type).type === enums_1.AsnTypeTypes.Choice; + } + static processOptionalChoiceField(asn1Element, schemaItem) { + try { + return { + processed: true, + value: this.fromASN(asn1Element, schemaItem.type) + }; + } catch (err) { + if (err instanceof errors_1.AsnSchemaValidationError && /Wrong values for Choice type/.test(err.message)) return { processed: false }; + throw err; + } + } + static handleArrayTypes(asn1Schema, schema, target, options) { + if (!("value" in asn1Schema.valueBlock && Array.isArray(asn1Schema.valueBlock.value))) throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed."); + const itemType = schema.itemType; + if (typeof itemType === "number") { + const converter = converters.defaultConverter(itemType); + if (!converter) throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`); + return target.from(asn1Schema.valueBlock.value, (element) => converter.fromASN(element)); + } else return target.from(asn1Schema.valueBlock.value, (element) => this.fromASN(element, itemType, options)); + } + static processSchemaItems(schema, asn1ComparedSchema, res, options) { + for (const key in schema.items) { + const asn1SchemaValue = asn1ComparedSchema.result[key]; + if (!asn1SchemaValue) continue; + const schemaItem = schema.items[key]; + const schemaItemType = schemaItem.type; + let parsedValue; + if (typeof schemaItemType === "number" || (0, helper_1.isConvertible)(schemaItemType)) parsedValue = this.processPrimitiveSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options); + else parsedValue = this.processComplexSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options); + if (parsedValue && typeof parsedValue === "object" && "value" in parsedValue && "raw" in parsedValue) { + res[key] = parsedValue.value; + res[`${key}Raw`] = parsedValue.raw; + } else res[key] = parsedValue; + } + } + static processPrimitiveSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options) { + const converter = schemaItem.converter ?? ((0, helper_1.isConvertible)(schemaItemType) ? new schemaItemType() : null); + if (!converter) throw new Error("Converter is empty"); + if (schemaItem.repeated) return this.processRepeatedPrimitiveItem(asn1SchemaValue, schemaItem, converter, options); + else return this.processSinglePrimitiveItem(asn1SchemaValue, schemaItem, schemaItemType, converter, options); + } + static processRepeatedPrimitiveItem(asn1SchemaValue, schemaItem, converter, options) { + if (schemaItem.implicit) { + const newItem = new (schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set)(); + newItem.valueBlock = asn1SchemaValue.valueBlock; + const newItemAsn = asn1js.fromBER(newItem.toBER(false), options?.berOptions); + if (newItemAsn.offset === -1) throw new Error(`Cannot parse the child item. ${newItemAsn.result.error}`); + if (!("value" in newItemAsn.result.valueBlock && Array.isArray(newItemAsn.result.valueBlock.value))) throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed."); + const value = newItemAsn.result.valueBlock.value; + return Array.from(value, (element) => converter.fromASN(element)); + } else return Array.from(asn1SchemaValue, (element) => converter.fromASN(element)); + } + static processSinglePrimitiveItem(asn1SchemaValue, schemaItem, schemaItemType, converter, options) { + let value = asn1SchemaValue; + if (schemaItem.implicit) { + let newItem; + if ((0, helper_1.isConvertible)(schemaItemType)) newItem = new schemaItemType().toSchema(""); + else { + const Asn1TypeName = enums_1.AsnPropTypes[schemaItemType]; + const Asn1Type = asn1js[Asn1TypeName]; + if (!Asn1Type) throw new Error(`Cannot get '${Asn1TypeName}' class from asn1js module`); + newItem = new Asn1Type(); + } + newItem.valueBlock = value.valueBlock; + value = asn1js.fromBER(newItem.toBER(false), options?.berOptions).result; + } + return converter.fromASN(value); + } + static processComplexSchemaItem(asn1SchemaValue, schemaItem, schemaItemType, options) { + if (schemaItem.repeated) { + if (!Array.isArray(asn1SchemaValue)) throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable."); + return Array.from(asn1SchemaValue, (element) => this.fromASN(element, schemaItemType, options)); + } else { + const valueToProcess = this.handleImplicitTagging(asn1SchemaValue, schemaItem, schemaItemType); + if (this.isOptionalChoiceField(schemaItem)) try { + return this.fromASN(valueToProcess, schemaItemType, options); + } catch (err) { + if (err instanceof errors_1.AsnSchemaValidationError && /Wrong values for Choice type/.test(err.message)) return; + throw err; + } + else { + const parsedValue = this.fromASN(valueToProcess, schemaItemType, options); + if (schemaItem.raw) return { + value: parsedValue, + raw: asn1SchemaValue.valueBeforeDecodeView + }; + return parsedValue; + } + } + } + static handleImplicitTagging(asn1SchemaValue, schemaItem, schemaItemType) { + if (schemaItem.implicit && typeof schemaItem.context === "number") { + const schema = storage_1.schemaStorage.get(schemaItemType); + if (schema.type === enums_1.AsnTypeTypes.Sequence) { + const newSeq = new asn1js.Sequence(); + if ("value" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && "value" in newSeq.valueBlock) { + newSeq.valueBlock.value = asn1SchemaValue.valueBlock.value; + return newSeq; + } + } else if (schema.type === enums_1.AsnTypeTypes.Set) { + const newSet = new asn1js.Set(); + if ("value" in asn1SchemaValue.valueBlock && Array.isArray(asn1SchemaValue.valueBlock.value) && "value" in newSet.valueBlock) { + newSet.valueBlock.value = asn1SchemaValue.valueBlock.value; + return newSet; + } + } + } + return asn1SchemaValue; + } + }; + exports.AsnParser = AsnParser; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/serializer.js +var require_serializer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnSerializer = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1js = tslib_1.__importStar(require_build()); + const bytes_1 = require_bytes(); + const converters = tslib_1.__importStar(require_converters()); + const enums_1 = require_enums(); + const helper_1 = require_helper(); + const storage_1 = require_storage(); + exports.AsnSerializer = class AsnSerializer { + static serialize(obj) { + if (obj instanceof asn1js.BaseBlock) return obj.toBER(false); + return this.toASN(obj).toBER(false); + } + static toASN(obj) { + if (obj && typeof obj === "object" && (0, helper_1.isConvertible)(obj)) return obj.toASN(); + if (!(obj && typeof obj === "object")) throw new TypeError("Parameter 1 should be type of Object."); + const target = obj.constructor; + const schema = storage_1.schemaStorage.get(target); + storage_1.schemaStorage.cache(target); + let asn1Value = []; + if (schema.itemType) { + if (!Array.isArray(obj)) throw new TypeError("Parameter 1 should be type of Array."); + if (typeof schema.itemType === "number") { + const converter = converters.defaultConverter(schema.itemType); + if (!converter) throw new Error(`Cannot get default converter for array item of ${target.name} ASN1 schema`); + asn1Value = obj.map((o) => converter.toASN(o)); + } else asn1Value = obj.map((o) => this.toAsnItem({ type: schema.itemType }, "[]", target, o)); + } else for (const key in schema.items) { + const schemaItem = schema.items[key]; + const objProp = obj[key]; + if (objProp === void 0 || schemaItem.defaultValue === objProp || typeof schemaItem.defaultValue === "object" && typeof objProp === "object" && (0, helper_1.isArrayEqual)(this.serialize(schemaItem.defaultValue), this.serialize(objProp))) continue; + const asn1Item = AsnSerializer.toAsnItem(schemaItem, key, target, objProp); + if (typeof schemaItem.context === "number") if (schemaItem.implicit) if (!schemaItem.repeated && (typeof schemaItem.type === "number" || (0, helper_1.isConvertible)(schemaItem.type))) { + const value = {}; + value.valueHex = asn1Item instanceof asn1js.Null ? (0, bytes_1.toArrayBuffer)(asn1Item.valueBeforeDecodeView) : asn1Item.valueBlock.toBER(); + asn1Value.push(new asn1js.Primitive({ + optional: schemaItem.optional, + idBlock: { + tagClass: 3, + tagNumber: schemaItem.context + }, + ...value + })); + } else asn1Value.push(new asn1js.Constructed({ + optional: schemaItem.optional, + idBlock: { + tagClass: 3, + tagNumber: schemaItem.context + }, + value: asn1Item.valueBlock.value + })); + else asn1Value.push(new asn1js.Constructed({ + optional: schemaItem.optional, + idBlock: { + tagClass: 3, + tagNumber: schemaItem.context + }, + value: [asn1Item] + })); + else if (schemaItem.repeated) asn1Value = asn1Value.concat(asn1Item); + else asn1Value.push(asn1Item); + } + let asnSchema; + switch (schema.type) { + case enums_1.AsnTypeTypes.Sequence: + asnSchema = new asn1js.Sequence({ value: asn1Value }); + break; + case enums_1.AsnTypeTypes.Set: + asnSchema = new asn1js.Set({ value: asn1Value }); + break; + case enums_1.AsnTypeTypes.Choice: + if (!asn1Value[0]) throw new Error(`Schema '${target.name}' has wrong data. Choice cannot be empty.`); + asnSchema = asn1Value[0]; + break; + } + return asnSchema; + } + static toAsnItem(schemaItem, key, target, objProp) { + let asn1Item; + if (typeof schemaItem.type === "number") { + const converter = schemaItem.converter; + if (!converter) throw new Error(`Property '${key}' doesn't have converter for type ${enums_1.AsnPropTypes[schemaItem.type]} in schema '${target.name}'`); + if (schemaItem.repeated) { + if (!Array.isArray(objProp)) throw new TypeError("Parameter 'objProp' should be type of Array."); + const items = Array.from(objProp, (element) => converter.toASN(element)); + asn1Item = new (schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set)({ value: items }); + } else asn1Item = converter.toASN(objProp); + } else if (schemaItem.repeated) { + if (!Array.isArray(objProp)) throw new TypeError("Parameter 'objProp' should be type of Array."); + const items = Array.from(objProp, (element) => this.toASN(element)); + asn1Item = new (schemaItem.repeated === "sequence" ? asn1js.Sequence : asn1js.Set)({ value: items }); + } else asn1Item = this.toASN(objProp); + return asn1Item; + } + }; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/objects.js +var require_objects = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnArray = void 0; + var AsnArray = class extends Array { + constructor(items = []) { + if (typeof items === "number") super(items); + else { + super(); + for (const item of items) this.push(item); + } + } + }; + exports.AsnArray = AsnArray; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/convert.js +var require_convert = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnConvert = void 0; + const asn1js = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)).__importStar(require_build()); + const bytes_1 = require_bytes(); + const parser_1 = require_parser(); + const serializer_1 = require_serializer(); + exports.AsnConvert = class AsnConvert { + static serialize(obj) { + return serializer_1.AsnSerializer.serialize(obj); + } + static parse(data, target, options) { + return parser_1.AsnParser.parse(data, target, options); + } + static toString(data, options) { + const buf = (0, bytes_1.isBufferSource)(data) ? (0, bytes_1.toArrayBuffer)(data) : AsnConvert.serialize(data); + const asn = asn1js.fromBER(buf, options?.berOptions); + if (asn.offset === -1) throw new Error(`Cannot decode ASN.1 data. ${asn.result.error}`); + return asn.result.toString(); + } + }; +})); +//#endregion +//#region node_modules/@peculiar/asn1-schema/build/cjs/index.js +var require_cjs$10 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AsnSerializer = exports.AsnParser = exports.AsnPropTypes = exports.AsnTypeTypes = exports.AsnSetType = exports.AsnSequenceType = exports.AsnChoiceType = exports.AsnType = exports.AsnProp = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_converters(), exports); + tslib_1.__exportStar(require_types$4(), exports); + var decorators_1 = require_decorators$1(); + Object.defineProperty(exports, "AsnProp", { + enumerable: true, + get: function() { + return decorators_1.AsnProp; + } + }); + Object.defineProperty(exports, "AsnType", { + enumerable: true, + get: function() { + return decorators_1.AsnType; + } + }); + Object.defineProperty(exports, "AsnChoiceType", { + enumerable: true, + get: function() { + return decorators_1.AsnChoiceType; + } + }); + Object.defineProperty(exports, "AsnSequenceType", { + enumerable: true, + get: function() { + return decorators_1.AsnSequenceType; + } + }); + Object.defineProperty(exports, "AsnSetType", { + enumerable: true, + get: function() { + return decorators_1.AsnSetType; + } + }); + var enums_1 = require_enums(); + Object.defineProperty(exports, "AsnTypeTypes", { + enumerable: true, + get: function() { + return enums_1.AsnTypeTypes; + } + }); + Object.defineProperty(exports, "AsnPropTypes", { + enumerable: true, + get: function() { + return enums_1.AsnPropTypes; + } + }); + var parser_1 = require_parser(); + Object.defineProperty(exports, "AsnParser", { + enumerable: true, + get: function() { + return parser_1.AsnParser; + } + }); + var serializer_1 = require_serializer(); + Object.defineProperty(exports, "AsnSerializer", { + enumerable: true, + get: function() { + return serializer_1.AsnSerializer; + } + }); + tslib_1.__exportStar(require_errors(), exports); + tslib_1.__exportStar(require_objects(), exports); + tslib_1.__exportStar(require_convert(), exports); +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/encoding/binary.js +var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.binary = void 0; + exports.encode = encode; + exports.decode = decode; + exports.is = is; + const index_js_1 = require_bytes(); + function encode(data) { + const bytes = (0, index_js_1.toUint8Array)(data); + let result = ""; + for (const byte of bytes) result += String.fromCharCode(byte); + return result; + } + function decode(text) { + const result = new Uint8Array(text.length); + for (let i = 0; i < text.length; i++) result[i] = text.charCodeAt(i) & 255; + return result; + } + function is(text) { + return typeof text === "string"; + } + exports.binary = { + encode, + decode, + is + }; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/encoding/hex.js +var require_hex = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.hex = exports.formats = void 0; + exports.normalize = normalize; + exports.is = is; + exports.encode = encode; + exports.decode = decode; + exports.parse = parse; + exports.format = format; + const index_js_1 = require_bytes(); + const HEX_CHARACTER_REGEX = /^[0-9a-f]$/i; + const COMMON_SEPARATORS = [ + " ", + " ", + "\n", + "\r", + ":", + "-", + "." + ]; + function resolveSeparators(options) { + if (options.separators === "none") return []; + if (!options.separators || options.separators === "common") return COMMON_SEPARATORS; + return options.separators; + } + function validateSeparator(separator) { + if (!separator) throw new TypeError("Hex separators must be non-empty strings"); + } + function matchSeparator(text, index, separators) { + for (const separator of separators) if (text.startsWith(separator, index)) return separator; + } + function detectCase(text) { + const hasUpper = /[A-F]/.test(text); + const hasLower = /[a-f]/.test(text); + return hasUpper && !hasLower ? "upper" : "lower"; + } + function detectLineSeparator(text) { + const match = /\r\n|\n/.exec(text); + if (!match) return; + return match[0] === "\r\n" ? "\r\n" : "\n"; + } + function compactForDetection(text) { + return text.replace(/[^0-9a-f]/gi, ""); + } + function detectGroup(text) { + const segments = text.match(/[0-9A-Fa-f]+|[^0-9A-Fa-f]+/g) ?? []; + if (segments.length < 3) return; + const hexSegments = segments.filter((_, index) => index % 2 === 0); + const separators = segments.filter((_, index) => index % 2 === 1); + const separator = separators[0]; + if (!separator || separators.some((item) => item !== separator)) return; + if (hexSegments.some((segment) => segment.length === 0 || segment.length % 2 !== 0)) return; + const firstLength = hexSegments[0]?.length ?? 0; + if (!firstLength) return; + if (hexSegments.slice(0, -1).some((segment) => segment.length !== firstLength)) return; + if ((hexSegments[hexSegments.length - 1]?.length ?? 0) > firstLength) return; + return { + size: firstLength / 2, + separator + }; + } + function detectFormat(text) { + const trimmed = text.trim(); + const prefix = /^0x/i.test(trimmed) ? "0x" : ""; + const body = prefix ? trimmed.slice(2) : trimmed; + const lineSeparator = detectLineSeparator(body); + const lines = body.split(/\r\n|\n/).filter((line) => line.length > 0); + const group = detectGroup(lines[0]?.trim() ?? ""); + const format = { + case: detectCase(trimmed), + prefix + }; + if (group) format.group = group; + if (lineSeparator && lines.length > 1) { + const firstLineBytes = compactForDetection(lines[0] ?? "").length / 2; + if (firstLineBytes > 0 && lines.slice(0, -1).every((line) => compactForDetection(line).length / 2 === firstLineBytes)) format.line = { + bytesPerLine: firstLineBytes, + separator: lineSeparator + }; + } + return format; + } + function normalizeText(text, options) { + const allowPrefix = options.allowPrefix ?? true; + const separators = [...resolveSeparators(options)].sort((left, right) => right.length - left.length); + for (const separator of separators) validateSeparator(separator); + let working = text.trim(); + if (/^0x/i.test(working)) { + if (!allowPrefix) throw new TypeError("Hexadecimal text must not include a 0x prefix"); + working = working.slice(2); + } + let normalized = ""; + let lastTokenWasSeparator = false; + for (let index = 0; index < working.length;) { + const character = working[index] ?? ""; + if (HEX_CHARACTER_REGEX.test(character)) { + normalized += character; + lastTokenWasSeparator = false; + index += 1; + continue; + } + const separator = matchSeparator(working, index, separators); + if (!separator) throw new TypeError("Input is not valid hexadecimal text"); + if (options.strict && (lastTokenWasSeparator || normalized.length === 0)) throw new TypeError("Hexadecimal text contains misplaced separators"); + lastTokenWasSeparator = true; + index += separator.length; + } + if (options.strict && lastTokenWasSeparator && normalized.length > 0) throw new TypeError("Hexadecimal text must not end with a separator"); + if (normalized.length % 2 !== 0) { + if (!options.allowOddLength) throw new TypeError("Hexadecimal text must contain an even number of characters"); + normalized = `0${normalized}`; + } + return normalized.toLowerCase(); + } + function groupPairs(pairs, group) { + if (!group) return pairs.join(""); + if (!Number.isInteger(group.size) || group.size < 1) throw new RangeError("Hex group size must be a positive integer"); + const chunks = []; + for (let index = 0; index < pairs.length; index += group.size) chunks.push(pairs.slice(index, index + group.size).join("")); + return chunks.join(group.separator); + } + function normalize(text, options = {}) { + return normalizeText(text, options); + } + function is(text, options = {}) { + if (typeof text !== "string") return false; + try { + normalize(text, options); + return true; + } catch { + return false; + } + } + function encode(data, options = {}) { + const bytes = (0, index_js_1.toUint8Array)(data); + const casing = options.case ?? "lower"; + const pairs = Array.from(bytes, (byte) => { + const text = byte.toString(16).padStart(2, "0"); + return casing === "upper" ? text.toUpperCase() : text; + }); + let body = ""; + if (options.line) { + const bytesPerLine = options.line.bytesPerLine; + if (!Number.isInteger(bytesPerLine) || bytesPerLine < 1) throw new RangeError("Hex bytesPerLine must be a positive integer"); + const separator = options.line.separator ?? "\n"; + const lines = []; + for (let index = 0; index < pairs.length; index += bytesPerLine) lines.push(groupPairs(pairs.slice(index, index + bytesPerLine), options.group)); + body = lines.join(separator); + } else body = groupPairs(pairs, options.group); + return `${options.prefix ?? ""}${body}`; + } + function decode(text, options = {}) { + const normalized = normalize(text, options); + const result = new Uint8Array(normalized.length / 2); + for (let i = 0; i < normalized.length; i += 2) result[i / 2] = Number.parseInt(normalized.slice(i, i + 2), 16); + return result; + } + function parse(text, options = {}) { + const normalized = normalize(text, options); + return { + bytes: decode(normalized), + format: detectFormat(text), + normalized + }; + } + function format(data, value) { + return encode(data, value); + } + exports.formats = { + compact: Object.freeze({}), + upper: Object.freeze({ case: "upper" }), + colon: Object.freeze({ group: { + size: 1, + separator: ":" + } }), + colonUpper: Object.freeze({ + case: "upper", + group: { + size: 1, + separator: ":" + } + }), + groupsOf4: Object.freeze({ group: { + size: 4, + separator: " " + } }), + prefixed: Object.freeze({ prefix: "0x" }) + }; + exports.hex = { + encode, + decode, + format, + formats: exports.formats, + is, + normalize, + parse + }; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/encoding/utf8.js +var require_utf8 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.utf8 = void 0; + exports.encode = encode; + exports.decode = decode; + const index_js_1 = require_bytes(); + function encode(text) { + return new TextEncoder().encode(text); + } + function decode(data) { + return new TextDecoder("utf-8", { fatal: false }).decode((0, index_js_1.toUint8Array)(data)); + } + exports.utf8 = { + encode, + decode + }; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/encoding/utf16.js +var require_utf16 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.utf16 = void 0; + exports.encode = encode; + exports.decode = decode; + const index_js_1 = require_bytes(); + function encode(text, options = {}) { + const result = /* @__PURE__ */ new ArrayBuffer(text.length * 2); + const view = new DataView(result); + for (let i = 0; i < text.length; i++) view.setUint16(i * 2, text.charCodeAt(i), options.littleEndian ?? false); + return new Uint8Array(result); + } + function decode(data, options = {}) { + const buffer = (0, index_js_1.toArrayBuffer)(data); + const view = new DataView(buffer); + let result = ""; + for (let i = 0; i < buffer.byteLength; i += 2) result += String.fromCharCode(view.getUint16(i, options.littleEndian ?? false)); + return result; + } + exports.utf16 = { + encode, + decode + }; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/encoding/base64.js +var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.base64 = void 0; + exports.normalize = normalize; + exports.pad = pad; + exports.is = is; + exports.encode = encode; + exports.decode = decode; + const index_js_1 = require_bytes(); + const binary_js_1 = require_binary(); + const BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; + function nodeBuffer() { + return globalThis.Buffer; + } + function normalize(text) { + return text.replace(/[\n\r\t ]/g, ""); + } + function pad(text) { + const remainder = text.length % 4; + return remainder ? text + "=".repeat(4 - remainder) : text; + } + function is(text) { + if (typeof text !== "string") return false; + const normalized = normalize(text); + return normalized === "" || BASE64_REGEX.test(normalized); + } + function encode(data, _options) { + const bytes = (0, index_js_1.toUint8Array)(data); + const buffer = nodeBuffer(); + if (buffer) return buffer.from(bytes).toString("base64"); + return btoa((0, binary_js_1.encode)(bytes)); + } + function decode(text, _options) { + const normalized = normalize(text); + if (!is(normalized)) throw new TypeError("Input is not valid Base64 text"); + const buffer = nodeBuffer(); + if (buffer) return new Uint8Array(buffer.from(normalized, "base64")); + return (0, binary_js_1.decode)(atob(normalized)); + } + exports.base64 = { + encode, + decode, + is, + normalize, + pad + }; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/encoding/base64url.js +var require_base64url = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.base64url = void 0; + exports.normalize = normalize; + exports.is = is; + exports.encode = encode; + exports.decode = decode; + const base64_js_1 = require_base64(); + const BASE64URL_REGEX = /^[A-Za-z0-9_-]*$/; + function normalize(text) { + return text.replace(/[\n\r\t ]/g, ""); + } + function is(text) { + return typeof text === "string" && BASE64URL_REGEX.test(normalize(text)); + } + function encode(data, _options) { + return base64_js_1.base64.encode(data).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, ""); + } + function decode(text, _options) { + const normalized = normalize(text); + if (!is(normalized)) throw new TypeError("Input is not valid Base64Url text"); + return base64_js_1.base64.decode(base64_js_1.base64.pad(normalized.replace(/-/g, "+").replace(/_/g, "/"))); + } + exports.base64url = { + encode, + decode, + is, + normalize + }; +})); +//#endregion +//#region node_modules/@peculiar/utils/build/cjs/encoding/index.js +var require_encoding = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.base64url = exports.base64 = exports.utf16 = exports.utf8 = exports.hex = exports.binary = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + exports.binary = tslib_1.__importStar(require_binary()); + exports.hex = tslib_1.__importStar(require_hex()); + exports.utf8 = tslib_1.__importStar(require_utf8()); + exports.utf16 = tslib_1.__importStar(require_utf16()); + exports.base64 = tslib_1.__importStar(require_base64()); + exports.base64url = tslib_1.__importStar(require_base64url()); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/ip_converter.js +var require_ip_converter = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IpConverter = void 0; + const encoding_1 = require_encoding(); + var IpConverter = class { + static isIPv4(ip) { + return /^(\d{1,3}\.){3}\d{1,3}$/.test(ip); + } + static parseIPv4(ip) { + const parts = ip.split("."); + if (parts.length !== 4) throw new Error("Invalid IPv4 address"); + return parts.map((part) => { + const num = parseInt(part, 10); + if (isNaN(num) || num < 0 || num > 255) throw new Error("Invalid IPv4 address part"); + return num; + }); + } + static parseIPv6(ip) { + const parts = this.expandIPv6(ip).split(":"); + if (parts.length !== 8) throw new Error("Invalid IPv6 address"); + return parts.reduce((bytes, part) => { + const num = parseInt(part, 16); + if (isNaN(num) || num < 0 || num > 65535) throw new Error("Invalid IPv6 address part"); + bytes.push(num >> 8 & 255); + bytes.push(num & 255); + return bytes; + }, []); + } + static expandIPv6(ip) { + if (!ip.includes("::")) return ip; + const parts = ip.split("::"); + if (parts.length > 2) throw new Error("Invalid IPv6 address"); + const left = parts[0] ? parts[0].split(":") : []; + const right = parts[1] ? parts[1].split(":") : []; + const missing = 8 - (left.length + right.length); + if (missing < 0) throw new Error("Invalid IPv6 address"); + return [ + ...left, + ...Array(missing).fill("0"), + ...right + ].join(":"); + } + static formatIPv6(bytes) { + const parts = []; + for (let i = 0; i < 16; i += 2) parts.push((bytes[i] << 8 | bytes[i + 1]).toString(16)); + return this.compressIPv6(parts.join(":")); + } + static compressIPv6(ip) { + const parts = ip.split(":"); + let longestZeroStart = -1; + let longestZeroLength = 0; + let currentZeroStart = -1; + let currentZeroLength = 0; + for (let i = 0; i < parts.length; i++) if (parts[i] === "0") { + if (currentZeroStart === -1) currentZeroStart = i; + currentZeroLength++; + } else { + if (currentZeroLength > longestZeroLength) { + longestZeroStart = currentZeroStart; + longestZeroLength = currentZeroLength; + } + currentZeroStart = -1; + currentZeroLength = 0; + } + if (currentZeroLength > longestZeroLength) { + longestZeroStart = currentZeroStart; + longestZeroLength = currentZeroLength; + } + if (longestZeroLength > 1) return `${parts.slice(0, longestZeroStart).join(":")}::${parts.slice(longestZeroStart + longestZeroLength).join(":")}`; + return ip; + } + static parseCIDR(text) { + const [addr, prefixStr] = text.split("/"); + const prefix = parseInt(prefixStr, 10); + if (this.isIPv4(addr)) { + if (prefix < 0 || prefix > 32) throw new Error("Invalid IPv4 prefix length"); + return [this.parseIPv4(addr), prefix]; + } else { + if (prefix < 0 || prefix > 128) throw new Error("Invalid IPv6 prefix length"); + return [this.parseIPv6(addr), prefix]; + } + } + static decodeIP(value) { + if (value.length === 64 && parseInt(value, 16) === 0) return "::/0"; + if (value.length !== 16) return value; + const mask = parseInt(value.slice(8), 16).toString(2).split("").reduce((a, k) => a + +k, 0); + let ip = value.slice(0, 8).replace(/(.{2})/g, (match) => `${parseInt(match, 16)}.`); + ip = ip.slice(0, -1); + return `${ip}/${mask}`; + } + static toString(buf) { + const uint8 = new Uint8Array(buf); + if (uint8.length === 4) return Array.from(uint8).join("."); + if (uint8.length === 16) return this.formatIPv6(uint8); + if (uint8.length === 8 || uint8.length === 32) { + const half = uint8.length / 2; + const addrBytes = uint8.slice(0, half); + const maskBytes = uint8.slice(half); + if (uint8.every((byte) => byte === 0)) return uint8.length === 8 ? "0.0.0.0/0" : "::/0"; + const prefixLen = maskBytes.reduce((a, b) => a + (b.toString(2).match(/1/g) || []).length, 0); + if (uint8.length === 8) return `${Array.from(addrBytes).join(".")}/${prefixLen}`; + else return `${this.formatIPv6(addrBytes)}/${prefixLen}`; + } + return this.decodeIP(encoding_1.hex.encode(buf)); + } + static fromString(text) { + if (text.includes("/")) { + const [addr, prefix] = this.parseCIDR(text); + const maskBytes = new Uint8Array(addr.length); + let bitsLeft = prefix; + for (let i = 0; i < maskBytes.length; i++) if (bitsLeft >= 8) { + maskBytes[i] = 255; + bitsLeft -= 8; + } else if (bitsLeft > 0) { + maskBytes[i] = 255 << 8 - bitsLeft; + bitsLeft = 0; + } + const out = new Uint8Array(addr.length * 2); + out.set(addr, 0); + out.set(maskBytes, addr.length); + return out.buffer; + } + const bytes = this.isIPv4(text) ? this.parseIPv4(text) : this.parseIPv6(text); + return new Uint8Array(bytes).buffer; + } + }; + exports.IpConverter = IpConverter; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/name.js +var require_name = /* @__PURE__ */ __commonJSMin(((exports) => { + var RelativeDistinguishedName_1, RDNSequence_1, Name_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Name = exports.RDNSequence = exports.RelativeDistinguishedName = exports.AttributeTypeAndValue = exports.AttributeValue = exports.DirectoryString = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const encoding_1 = require_encoding(); + let DirectoryString = class DirectoryString { + teletexString; + printableString; + universalString; + utf8String; + bmpString; + constructor(params = {}) { + Object.assign(this, params); + } + toString() { + return this.bmpString || this.printableString || this.teletexString || this.universalString || this.utf8String || ""; + } + }; + exports.DirectoryString = DirectoryString; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.TeletexString })], DirectoryString.prototype, "teletexString", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.PrintableString })], DirectoryString.prototype, "printableString", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.UniversalString })], DirectoryString.prototype, "universalString", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Utf8String })], DirectoryString.prototype, "utf8String", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BmpString })], DirectoryString.prototype, "bmpString", void 0); + exports.DirectoryString = DirectoryString = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], DirectoryString); + let AttributeValue = class AttributeValue extends DirectoryString { + ia5String; + anyValue; + constructor(params = {}) { + super(params); + Object.assign(this, params); + } + toString() { + return this.ia5String || (this.anyValue ? encoding_1.hex.encode(this.anyValue) : super.toString()); + } + }; + exports.AttributeValue = AttributeValue; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.IA5String })], AttributeValue.prototype, "ia5String", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })], AttributeValue.prototype, "anyValue", void 0); + exports.AttributeValue = AttributeValue = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], AttributeValue); + var AttributeTypeAndValue = class { + type = ""; + value = new AttributeValue(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.AttributeTypeAndValue = AttributeTypeAndValue; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], AttributeTypeAndValue.prototype, "type", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: AttributeValue })], AttributeTypeAndValue.prototype, "value", void 0); + let RelativeDistinguishedName = RelativeDistinguishedName_1 = class RelativeDistinguishedName extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, RelativeDistinguishedName_1.prototype); + } + }; + exports.RelativeDistinguishedName = RelativeDistinguishedName; + exports.RelativeDistinguishedName = RelativeDistinguishedName = RelativeDistinguishedName_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: AttributeTypeAndValue + })], RelativeDistinguishedName); + let RDNSequence = RDNSequence_1 = class RDNSequence extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, RDNSequence_1.prototype); + } + }; + exports.RDNSequence = RDNSequence; + exports.RDNSequence = RDNSequence = RDNSequence_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: RelativeDistinguishedName + })], RDNSequence); + let Name = Name_1 = class Name extends RDNSequence { + constructor(items) { + super(items); + Object.setPrototypeOf(this, Name_1.prototype); + } + }; + exports.Name = Name; + exports.Name = Name = Name_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], Name); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/general_name.js +var require_general_name = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.GeneralName = exports.EDIPartyName = exports.OtherName = exports.AsnIpConverter = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const ip_converter_1 = require_ip_converter(); + const name_1 = require_name(); + exports.AsnIpConverter = { + fromASN: (value) => ip_converter_1.IpConverter.toString(asn1_schema_1.AsnOctetStringConverter.fromASN(value)), + toASN: (value) => asn1_schema_1.AsnOctetStringConverter.toASN(ip_converter_1.IpConverter.fromString(value)) + }; + var OtherName = class { + typeId = ""; + value = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OtherName = OtherName; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], OtherName.prototype, "typeId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + context: 0 + })], OtherName.prototype, "value", void 0); + var EDIPartyName = class { + nameAssigner; + partyName = new name_1.DirectoryString(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EDIPartyName = EDIPartyName; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: name_1.DirectoryString, + optional: true, + context: 0, + implicit: true + })], EDIPartyName.prototype, "nameAssigner", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: name_1.DirectoryString, + context: 1, + implicit: true + })], EDIPartyName.prototype, "partyName", void 0); + let GeneralName = class GeneralName { + otherName; + rfc822Name; + dNSName; + x400Address; + directoryName; + ediPartyName; + uniformResourceIdentifier; + iPAddress; + registeredID; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.GeneralName = GeneralName; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: OtherName, + context: 0, + implicit: true + })], GeneralName.prototype, "otherName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.IA5String, + context: 1, + implicit: true + })], GeneralName.prototype, "rfc822Name", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.IA5String, + context: 2, + implicit: true + })], GeneralName.prototype, "dNSName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + context: 3, + implicit: true + })], GeneralName.prototype, "x400Address", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: name_1.Name, + context: 4, + implicit: false + })], GeneralName.prototype, "directoryName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: EDIPartyName, + context: 5 + })], GeneralName.prototype, "ediPartyName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.IA5String, + context: 6, + implicit: true + })], GeneralName.prototype, "uniformResourceIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.OctetString, + context: 7, + implicit: true, + converter: exports.AsnIpConverter + })], GeneralName.prototype, "iPAddress", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.ObjectIdentifier, + context: 8, + implicit: true + })], GeneralName.prototype, "registeredID", void 0); + exports.GeneralName = GeneralName = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], GeneralName); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/object_identifiers.js +var require_object_identifiers$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_ce = exports.id_ad_caRepository = exports.id_ad_timeStamping = exports.id_ad_caIssuers = exports.id_ad_ocsp = exports.id_qt_unotice = exports.id_qt_csp = exports.id_ad = exports.id_kp = exports.id_qt = exports.id_pe = exports.id_pkix = void 0; + exports.id_pkix = "1.3.6.1.5.5.7"; + exports.id_pe = `${exports.id_pkix}.1`; + exports.id_qt = `${exports.id_pkix}.2`; + exports.id_kp = `${exports.id_pkix}.3`; + exports.id_ad = `${exports.id_pkix}.48`; + exports.id_qt_csp = `${exports.id_qt}.1`; + exports.id_qt_unotice = `${exports.id_qt}.2`; + exports.id_ad_ocsp = `${exports.id_ad}.1`; + exports.id_ad_caIssuers = `${exports.id_ad}.2`; + exports.id_ad_timeStamping = `${exports.id_ad}.3`; + exports.id_ad_caRepository = `${exports.id_ad}.5`; + exports.id_ce = "2.5.29"; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/authority_information_access.js +var require_authority_information_access = /* @__PURE__ */ __commonJSMin(((exports) => { + var AuthorityInfoAccessSyntax_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AuthorityInfoAccessSyntax = exports.AccessDescription = exports.id_pe_authorityInfoAccess = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const general_name_1 = require_general_name(); + exports.id_pe_authorityInfoAccess = `${require_object_identifiers$5().id_pe}.1`; + var AccessDescription = class { + accessMethod = ""; + accessLocation = new general_name_1.GeneralName(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.AccessDescription = AccessDescription; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], AccessDescription.prototype, "accessMethod", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: general_name_1.GeneralName })], AccessDescription.prototype, "accessLocation", void 0); + let AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax_1 = class AuthorityInfoAccessSyntax extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, AuthorityInfoAccessSyntax_1.prototype); + } + }; + exports.AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax; + exports.AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax = AuthorityInfoAccessSyntax_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: AccessDescription + })], AuthorityInfoAccessSyntax); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/authority_key_identifier.js +var require_authority_key_identifier = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AuthorityKeyIdentifier = exports.KeyIdentifier = exports.id_ce_authorityKeyIdentifier = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const general_name_1 = require_general_name(); + exports.id_ce_authorityKeyIdentifier = `${require_object_identifiers$5().id_ce}.35`; + var KeyIdentifier = class extends asn1_schema_1.OctetString {}; + exports.KeyIdentifier = KeyIdentifier; + var AuthorityKeyIdentifier = class { + keyIdentifier; + authorityCertIssuer; + authorityCertSerialNumber; + constructor(params = {}) { + if (params) Object.assign(this, params); + } + }; + exports.AuthorityKeyIdentifier = AuthorityKeyIdentifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: KeyIdentifier, + context: 0, + optional: true, + implicit: true + })], AuthorityKeyIdentifier.prototype, "keyIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: general_name_1.GeneralName, + context: 1, + optional: true, + implicit: true, + repeated: "sequence" + })], AuthorityKeyIdentifier.prototype, "authorityCertIssuer", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 2, + optional: true, + implicit: true, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], AuthorityKeyIdentifier.prototype, "authorityCertSerialNumber", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/basic_constraints.js +var require_basic_constraints = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BasicConstraints = exports.id_ce_basicConstraints = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_basicConstraints = `${require_object_identifiers$5().id_ce}.19`; + var BasicConstraints = class { + cA = false; + pathLenConstraint; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.BasicConstraints = BasicConstraints; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Boolean, + defaultValue: false + })], BasicConstraints.prototype, "cA", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + optional: true + })], BasicConstraints.prototype, "pathLenConstraint", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/general_names.js +var require_general_names = /* @__PURE__ */ __commonJSMin(((exports) => { + var GeneralNames_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.GeneralNames = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const general_name_1 = require_general_name(); + let GeneralNames = GeneralNames_1 = class GeneralNames extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, GeneralNames_1.prototype); + } + }; + exports.GeneralNames = GeneralNames; + exports.GeneralNames = GeneralNames = GeneralNames_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: general_name_1.GeneralName + })], GeneralNames); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/certificate_issuer.js +var require_certificate_issuer = /* @__PURE__ */ __commonJSMin(((exports) => { + var CertificateIssuer_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CertificateIssuer = exports.id_ce_certificateIssuer = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const general_names_1 = require_general_names(); + exports.id_ce_certificateIssuer = `${require_object_identifiers$5().id_ce}.29`; + let CertificateIssuer = CertificateIssuer_1 = class CertificateIssuer extends general_names_1.GeneralNames { + constructor(items) { + super(items); + Object.setPrototypeOf(this, CertificateIssuer_1.prototype); + } + }; + exports.CertificateIssuer = CertificateIssuer; + exports.CertificateIssuer = CertificateIssuer = CertificateIssuer_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], CertificateIssuer); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/certificate_policies.js +var require_certificate_policies = /* @__PURE__ */ __commonJSMin(((exports) => { + var CertificatePolicies_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CertificatePolicies = exports.PolicyInformation = exports.PolicyQualifierInfo = exports.Qualifier = exports.UserNotice = exports.NoticeReference = exports.DisplayText = exports.id_ce_certificatePolicies_anyPolicy = exports.id_ce_certificatePolicies = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_certificatePolicies = `${require_object_identifiers$5().id_ce}.32`; + exports.id_ce_certificatePolicies_anyPolicy = `${exports.id_ce_certificatePolicies}.0`; + let DisplayText = class DisplayText { + ia5String; + visibleString; + bmpString; + utf8String; + constructor(params = {}) { + Object.assign(this, params); + } + toString() { + return this.ia5String || this.visibleString || this.bmpString || this.utf8String || ""; + } + }; + exports.DisplayText = DisplayText; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.IA5String })], DisplayText.prototype, "ia5String", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.VisibleString })], DisplayText.prototype, "visibleString", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BmpString })], DisplayText.prototype, "bmpString", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Utf8String })], DisplayText.prototype, "utf8String", void 0); + exports.DisplayText = DisplayText = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], DisplayText); + var NoticeReference = class { + organization = new DisplayText(); + noticeNumbers = []; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.NoticeReference = NoticeReference; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: DisplayText })], NoticeReference.prototype, "organization", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + repeated: "sequence" + })], NoticeReference.prototype, "noticeNumbers", void 0); + var UserNotice = class { + noticeRef; + explicitText; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.UserNotice = UserNotice; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: NoticeReference, + optional: true + })], UserNotice.prototype, "noticeRef", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: DisplayText, + optional: true + })], UserNotice.prototype, "explicitText", void 0); + let Qualifier = class Qualifier { + cPSuri; + userNotice; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Qualifier = Qualifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.IA5String })], Qualifier.prototype, "cPSuri", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: UserNotice })], Qualifier.prototype, "userNotice", void 0); + exports.Qualifier = Qualifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], Qualifier); + var PolicyQualifierInfo = class { + policyQualifierId = ""; + qualifier = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PolicyQualifierInfo = PolicyQualifierInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], PolicyQualifierInfo.prototype, "policyQualifierId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })], PolicyQualifierInfo.prototype, "qualifier", void 0); + var PolicyInformation = class { + policyIdentifier = ""; + policyQualifiers; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PolicyInformation = PolicyInformation; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], PolicyInformation.prototype, "policyIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: PolicyQualifierInfo, + repeated: "sequence", + optional: true + })], PolicyInformation.prototype, "policyQualifiers", void 0); + let CertificatePolicies = CertificatePolicies_1 = class CertificatePolicies extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, CertificatePolicies_1.prototype); + } + }; + exports.CertificatePolicies = CertificatePolicies; + exports.CertificatePolicies = CertificatePolicies = CertificatePolicies_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: PolicyInformation + })], CertificatePolicies); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_number.js +var require_crl_number = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CRLNumber = exports.id_ce_cRLNumber = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_cRLNumber = `${require_object_identifiers$5().id_ce}.20`; + let CRLNumber = class CRLNumber { + value; + constructor(value = 0) { + this.value = value; + } + }; + exports.CRLNumber = CRLNumber; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], CRLNumber.prototype, "value", void 0); + exports.CRLNumber = CRLNumber = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], CRLNumber); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_delta_indicator.js +var require_crl_delta_indicator = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BaseCRLNumber = exports.id_ce_deltaCRLIndicator = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const object_identifiers_1 = require_object_identifiers$5(); + const crl_number_1 = require_crl_number(); + exports.id_ce_deltaCRLIndicator = `${object_identifiers_1.id_ce}.27`; + let BaseCRLNumber = class BaseCRLNumber extends crl_number_1.CRLNumber {}; + exports.BaseCRLNumber = BaseCRLNumber; + exports.BaseCRLNumber = BaseCRLNumber = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], BaseCRLNumber); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_distribution_points.js +var require_crl_distribution_points = /* @__PURE__ */ __commonJSMin(((exports) => { + var CRLDistributionPoints_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CRLDistributionPoints = exports.DistributionPoint = exports.DistributionPointName = exports.Reason = exports.ReasonFlags = exports.id_ce_cRLDistributionPoints = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const name_1 = require_name(); + const general_name_1 = require_general_name(); + exports.id_ce_cRLDistributionPoints = `${require_object_identifiers$5().id_ce}.31`; + var ReasonFlags; + (function(ReasonFlags) { + ReasonFlags[ReasonFlags["unused"] = 1] = "unused"; + ReasonFlags[ReasonFlags["keyCompromise"] = 2] = "keyCompromise"; + ReasonFlags[ReasonFlags["cACompromise"] = 4] = "cACompromise"; + ReasonFlags[ReasonFlags["affiliationChanged"] = 8] = "affiliationChanged"; + ReasonFlags[ReasonFlags["superseded"] = 16] = "superseded"; + ReasonFlags[ReasonFlags["cessationOfOperation"] = 32] = "cessationOfOperation"; + ReasonFlags[ReasonFlags["certificateHold"] = 64] = "certificateHold"; + ReasonFlags[ReasonFlags["privilegeWithdrawn"] = 128] = "privilegeWithdrawn"; + ReasonFlags[ReasonFlags["aACompromise"] = 256] = "aACompromise"; + })(ReasonFlags || (exports.ReasonFlags = ReasonFlags = {})); + var Reason = class extends asn1_schema_1.BitString { + toJSON() { + const res = []; + const flags = this.toNumber(); + if (flags & ReasonFlags.aACompromise) res.push("aACompromise"); + if (flags & ReasonFlags.affiliationChanged) res.push("affiliationChanged"); + if (flags & ReasonFlags.cACompromise) res.push("cACompromise"); + if (flags & ReasonFlags.certificateHold) res.push("certificateHold"); + if (flags & ReasonFlags.cessationOfOperation) res.push("cessationOfOperation"); + if (flags & ReasonFlags.keyCompromise) res.push("keyCompromise"); + if (flags & ReasonFlags.privilegeWithdrawn) res.push("privilegeWithdrawn"); + if (flags & ReasonFlags.superseded) res.push("superseded"); + if (flags & ReasonFlags.unused) res.push("unused"); + return res; + } + toString() { + return `[${this.toJSON().join(", ")}]`; + } + }; + exports.Reason = Reason; + let DistributionPointName = class DistributionPointName { + fullName; + nameRelativeToCRLIssuer; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.DistributionPointName = DistributionPointName; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: general_name_1.GeneralName, + context: 0, + repeated: "sequence", + implicit: true + })], DistributionPointName.prototype, "fullName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: name_1.RelativeDistinguishedName, + context: 1, + implicit: true + })], DistributionPointName.prototype, "nameRelativeToCRLIssuer", void 0); + exports.DistributionPointName = DistributionPointName = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], DistributionPointName); + var DistributionPoint = class { + distributionPoint; + reasons; + cRLIssuer; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.DistributionPoint = DistributionPoint; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: DistributionPointName, + context: 0, + optional: true + })], DistributionPoint.prototype, "distributionPoint", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: Reason, + context: 1, + optional: true, + implicit: true + })], DistributionPoint.prototype, "reasons", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: general_name_1.GeneralName, + context: 2, + optional: true, + repeated: "sequence", + implicit: true + })], DistributionPoint.prototype, "cRLIssuer", void 0); + let CRLDistributionPoints = CRLDistributionPoints_1 = class CRLDistributionPoints extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, CRLDistributionPoints_1.prototype); + } + }; + exports.CRLDistributionPoints = CRLDistributionPoints; + exports.CRLDistributionPoints = CRLDistributionPoints = CRLDistributionPoints_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: DistributionPoint + })], CRLDistributionPoints); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_freshest.js +var require_crl_freshest = /* @__PURE__ */ __commonJSMin(((exports) => { + var FreshestCRL_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.FreshestCRL = exports.id_ce_freshestCRL = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const object_identifiers_1 = require_object_identifiers$5(); + const crl_distribution_points_1 = require_crl_distribution_points(); + exports.id_ce_freshestCRL = `${object_identifiers_1.id_ce}.46`; + let FreshestCRL = FreshestCRL_1 = class FreshestCRL extends crl_distribution_points_1.CRLDistributionPoints { + constructor(items) { + super(items); + Object.setPrototypeOf(this, FreshestCRL_1.prototype); + } + }; + exports.FreshestCRL = FreshestCRL; + exports.FreshestCRL = FreshestCRL = FreshestCRL_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: crl_distribution_points_1.DistributionPoint + })], FreshestCRL); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_issuing_distribution_point.js +var require_crl_issuing_distribution_point = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IssuingDistributionPoint = exports.id_ce_issuingDistributionPoint = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const object_identifiers_1 = require_object_identifiers$5(); + const crl_distribution_points_1 = require_crl_distribution_points(); + exports.id_ce_issuingDistributionPoint = `${object_identifiers_1.id_ce}.28`; + var IssuingDistributionPoint = class IssuingDistributionPoint { + static ONLY = false; + distributionPoint; + onlyContainsUserCerts = IssuingDistributionPoint.ONLY; + onlyContainsCACerts = IssuingDistributionPoint.ONLY; + onlySomeReasons; + indirectCRL = IssuingDistributionPoint.ONLY; + onlyContainsAttributeCerts = IssuingDistributionPoint.ONLY; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.IssuingDistributionPoint = IssuingDistributionPoint; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: crl_distribution_points_1.DistributionPointName, + context: 0, + optional: true + })], IssuingDistributionPoint.prototype, "distributionPoint", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Boolean, + context: 1, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true + })], IssuingDistributionPoint.prototype, "onlyContainsUserCerts", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Boolean, + context: 2, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true + })], IssuingDistributionPoint.prototype, "onlyContainsCACerts", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: crl_distribution_points_1.Reason, + context: 3, + optional: true, + implicit: true + })], IssuingDistributionPoint.prototype, "onlySomeReasons", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Boolean, + context: 4, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true + })], IssuingDistributionPoint.prototype, "indirectCRL", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Boolean, + context: 5, + defaultValue: IssuingDistributionPoint.ONLY, + implicit: true + })], IssuingDistributionPoint.prototype, "onlyContainsAttributeCerts", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/crl_reason.js +var require_crl_reason = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CRLReason = exports.CRLReasons = exports.id_ce_cRLReasons = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_cRLReasons = `${require_object_identifiers$5().id_ce}.21`; + var CRLReasons; + (function(CRLReasons) { + CRLReasons[CRLReasons["unspecified"] = 0] = "unspecified"; + CRLReasons[CRLReasons["keyCompromise"] = 1] = "keyCompromise"; + CRLReasons[CRLReasons["cACompromise"] = 2] = "cACompromise"; + CRLReasons[CRLReasons["affiliationChanged"] = 3] = "affiliationChanged"; + CRLReasons[CRLReasons["superseded"] = 4] = "superseded"; + CRLReasons[CRLReasons["cessationOfOperation"] = 5] = "cessationOfOperation"; + CRLReasons[CRLReasons["certificateHold"] = 6] = "certificateHold"; + CRLReasons[CRLReasons["removeFromCRL"] = 8] = "removeFromCRL"; + CRLReasons[CRLReasons["privilegeWithdrawn"] = 9] = "privilegeWithdrawn"; + CRLReasons[CRLReasons["aACompromise"] = 10] = "aACompromise"; + })(CRLReasons || (exports.CRLReasons = CRLReasons = {})); + let CRLReason = class CRLReason { + reason = CRLReasons.unspecified; + constructor(reason = CRLReasons.unspecified) { + this.reason = reason; + } + toJSON() { + return CRLReasons[this.reason]; + } + toString() { + return this.toJSON(); + } + }; + exports.CRLReason = CRLReason; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Enumerated })], CRLReason.prototype, "reason", void 0); + exports.CRLReason = CRLReason = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], CRLReason); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/extended_key_usage.js +var require_extended_key_usage = /* @__PURE__ */ __commonJSMin(((exports) => { + var ExtendedKeyUsage_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_kp_OCSPSigning = exports.id_kp_timeStamping = exports.id_kp_emailProtection = exports.id_kp_codeSigning = exports.id_kp_clientAuth = exports.id_kp_serverAuth = exports.anyExtendedKeyUsage = exports.ExtendedKeyUsage = exports.id_ce_extKeyUsage = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const object_identifiers_1 = require_object_identifiers$5(); + exports.id_ce_extKeyUsage = `${object_identifiers_1.id_ce}.37`; + let ExtendedKeyUsage = ExtendedKeyUsage_1 = class ExtendedKeyUsage extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, ExtendedKeyUsage_1.prototype); + } + }; + exports.ExtendedKeyUsage = ExtendedKeyUsage; + exports.ExtendedKeyUsage = ExtendedKeyUsage = ExtendedKeyUsage_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: asn1_schema_1.AsnPropTypes.ObjectIdentifier + })], ExtendedKeyUsage); + exports.anyExtendedKeyUsage = `${exports.id_ce_extKeyUsage}.0`; + exports.id_kp_serverAuth = `${object_identifiers_1.id_kp}.1`; + exports.id_kp_clientAuth = `${object_identifiers_1.id_kp}.2`; + exports.id_kp_codeSigning = `${object_identifiers_1.id_kp}.3`; + exports.id_kp_emailProtection = `${object_identifiers_1.id_kp}.4`; + exports.id_kp_timeStamping = `${object_identifiers_1.id_kp}.8`; + exports.id_kp_OCSPSigning = `${object_identifiers_1.id_kp}.9`; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/inhibit_any_policy.js +var require_inhibit_any_policy = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InhibitAnyPolicy = exports.id_ce_inhibitAnyPolicy = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_inhibitAnyPolicy = `${require_object_identifiers$5().id_ce}.54`; + let InhibitAnyPolicy = class InhibitAnyPolicy { + value; + constructor(value = /* @__PURE__ */ new ArrayBuffer(0)) { + this.value = value; + } + }; + exports.InhibitAnyPolicy = InhibitAnyPolicy; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], InhibitAnyPolicy.prototype, "value", void 0); + exports.InhibitAnyPolicy = InhibitAnyPolicy = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], InhibitAnyPolicy); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/invalidity_date.js +var require_invalidity_date = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.InvalidityDate = exports.id_ce_invalidityDate = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_invalidityDate = `${require_object_identifiers$5().id_ce}.24`; + let InvalidityDate = class InvalidityDate { + value = /* @__PURE__ */ new Date(); + constructor(value) { + if (value) this.value = value; + } + }; + exports.InvalidityDate = InvalidityDate; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.GeneralizedTime })], InvalidityDate.prototype, "value", void 0); + exports.InvalidityDate = InvalidityDate = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], InvalidityDate); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/issuer_alternative_name.js +var require_issuer_alternative_name = /* @__PURE__ */ __commonJSMin(((exports) => { + var IssueAlternativeName_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IssueAlternativeName = exports.id_ce_issuerAltName = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const general_names_1 = require_general_names(); + exports.id_ce_issuerAltName = `${require_object_identifiers$5().id_ce}.18`; + let IssueAlternativeName = IssueAlternativeName_1 = class IssueAlternativeName extends general_names_1.GeneralNames { + constructor(items) { + super(items); + Object.setPrototypeOf(this, IssueAlternativeName_1.prototype); + } + }; + exports.IssueAlternativeName = IssueAlternativeName; + exports.IssueAlternativeName = IssueAlternativeName = IssueAlternativeName_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], IssueAlternativeName); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/key_usage.js +var require_key_usage = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KeyUsage = exports.KeyUsageFlags = exports.id_ce_keyUsage = void 0; + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_keyUsage = `${require_object_identifiers$5().id_ce}.15`; + var KeyUsageFlags; + (function(KeyUsageFlags) { + KeyUsageFlags[KeyUsageFlags["digitalSignature"] = 1] = "digitalSignature"; + KeyUsageFlags[KeyUsageFlags["nonRepudiation"] = 2] = "nonRepudiation"; + KeyUsageFlags[KeyUsageFlags["keyEncipherment"] = 4] = "keyEncipherment"; + KeyUsageFlags[KeyUsageFlags["dataEncipherment"] = 8] = "dataEncipherment"; + KeyUsageFlags[KeyUsageFlags["keyAgreement"] = 16] = "keyAgreement"; + KeyUsageFlags[KeyUsageFlags["keyCertSign"] = 32] = "keyCertSign"; + KeyUsageFlags[KeyUsageFlags["cRLSign"] = 64] = "cRLSign"; + KeyUsageFlags[KeyUsageFlags["encipherOnly"] = 128] = "encipherOnly"; + KeyUsageFlags[KeyUsageFlags["decipherOnly"] = 256] = "decipherOnly"; + })(KeyUsageFlags || (exports.KeyUsageFlags = KeyUsageFlags = {})); + var KeyUsage = class extends asn1_schema_1.BitString { + toJSON() { + const flag = this.toNumber(); + const res = []; + if (flag & KeyUsageFlags.cRLSign) res.push("crlSign"); + if (flag & KeyUsageFlags.dataEncipherment) res.push("dataEncipherment"); + if (flag & KeyUsageFlags.decipherOnly) res.push("decipherOnly"); + if (flag & KeyUsageFlags.digitalSignature) res.push("digitalSignature"); + if (flag & KeyUsageFlags.encipherOnly) res.push("encipherOnly"); + if (flag & KeyUsageFlags.keyAgreement) res.push("keyAgreement"); + if (flag & KeyUsageFlags.keyCertSign) res.push("keyCertSign"); + if (flag & KeyUsageFlags.keyEncipherment) res.push("keyEncipherment"); + if (flag & KeyUsageFlags.nonRepudiation) res.push("nonRepudiation"); + return res; + } + toString() { + return `[${this.toJSON().join(", ")}]`; + } + }; + exports.KeyUsage = KeyUsage; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/name_constraints.js +var require_name_constraints = /* @__PURE__ */ __commonJSMin(((exports) => { + var GeneralSubtrees_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.NameConstraints = exports.GeneralSubtrees = exports.GeneralSubtree = exports.id_ce_nameConstraints = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const general_name_1 = require_general_name(); + exports.id_ce_nameConstraints = `${require_object_identifiers$5().id_ce}.30`; + var GeneralSubtree = class { + base = new general_name_1.GeneralName(); + minimum = 0; + maximum; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.GeneralSubtree = GeneralSubtree; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: general_name_1.GeneralName })], GeneralSubtree.prototype, "base", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 0, + defaultValue: 0, + implicit: true + })], GeneralSubtree.prototype, "minimum", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 1, + optional: true, + implicit: true + })], GeneralSubtree.prototype, "maximum", void 0); + let GeneralSubtrees = GeneralSubtrees_1 = class GeneralSubtrees extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, GeneralSubtrees_1.prototype); + } + }; + exports.GeneralSubtrees = GeneralSubtrees; + exports.GeneralSubtrees = GeneralSubtrees = GeneralSubtrees_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: GeneralSubtree + })], GeneralSubtrees); + var NameConstraints = class { + permittedSubtrees; + excludedSubtrees; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.NameConstraints = NameConstraints; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: GeneralSubtrees, + context: 0, + optional: true, + implicit: true + })], NameConstraints.prototype, "permittedSubtrees", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: GeneralSubtrees, + context: 1, + optional: true, + implicit: true + })], NameConstraints.prototype, "excludedSubtrees", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/policy_constraints.js +var require_policy_constraints = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PolicyConstraints = exports.id_ce_policyConstraints = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_policyConstraints = `${require_object_identifiers$5().id_ce}.36`; + var PolicyConstraints = class { + requireExplicitPolicy; + inhibitPolicyMapping; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PolicyConstraints = PolicyConstraints; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 0, + implicit: true, + optional: true, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], PolicyConstraints.prototype, "requireExplicitPolicy", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 1, + implicit: true, + optional: true, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], PolicyConstraints.prototype, "inhibitPolicyMapping", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/policy_mappings.js +var require_policy_mappings = /* @__PURE__ */ __commonJSMin(((exports) => { + var PolicyMappings_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PolicyMappings = exports.PolicyMapping = exports.id_ce_policyMappings = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_policyMappings = `${require_object_identifiers$5().id_ce}.33`; + var PolicyMapping = class { + issuerDomainPolicy = ""; + subjectDomainPolicy = ""; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PolicyMapping = PolicyMapping; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], PolicyMapping.prototype, "issuerDomainPolicy", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], PolicyMapping.prototype, "subjectDomainPolicy", void 0); + let PolicyMappings = PolicyMappings_1 = class PolicyMappings extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, PolicyMappings_1.prototype); + } + }; + exports.PolicyMappings = PolicyMappings; + exports.PolicyMappings = PolicyMappings = PolicyMappings_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: PolicyMapping + })], PolicyMappings); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_alternative_name.js +var require_subject_alternative_name = /* @__PURE__ */ __commonJSMin(((exports) => { + var SubjectAlternativeName_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SubjectAlternativeName = exports.id_ce_subjectAltName = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const general_names_1 = require_general_names(); + exports.id_ce_subjectAltName = `${require_object_identifiers$5().id_ce}.17`; + let SubjectAlternativeName = SubjectAlternativeName_1 = class SubjectAlternativeName extends general_names_1.GeneralNames { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SubjectAlternativeName_1.prototype); + } + }; + exports.SubjectAlternativeName = SubjectAlternativeName; + exports.SubjectAlternativeName = SubjectAlternativeName = SubjectAlternativeName_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], SubjectAlternativeName); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/attribute.js +var require_attribute$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Attribute = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var Attribute = class { + type = ""; + values = []; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Attribute = Attribute; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], Attribute.prototype, "type", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + repeated: "set" + })], Attribute.prototype, "values", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_directory_attributes.js +var require_subject_directory_attributes = /* @__PURE__ */ __commonJSMin(((exports) => { + var SubjectDirectoryAttributes_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SubjectDirectoryAttributes = exports.id_ce_subjectDirectoryAttributes = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const attribute_1 = require_attribute$2(); + exports.id_ce_subjectDirectoryAttributes = `${require_object_identifiers$5().id_ce}.9`; + let SubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = class SubjectDirectoryAttributes extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SubjectDirectoryAttributes_1.prototype); + } + }; + exports.SubjectDirectoryAttributes = SubjectDirectoryAttributes; + exports.SubjectDirectoryAttributes = SubjectDirectoryAttributes = SubjectDirectoryAttributes_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: attribute_1.Attribute + })], SubjectDirectoryAttributes); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_key_identifier.js +var require_subject_key_identifier = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SubjectKeyIdentifier = exports.id_ce_subjectKeyIdentifier = void 0; + const object_identifiers_1 = require_object_identifiers$5(); + const authority_key_identifier_1 = require_authority_key_identifier(); + exports.id_ce_subjectKeyIdentifier = `${object_identifiers_1.id_ce}.14`; + var SubjectKeyIdentifier = class extends authority_key_identifier_1.KeyIdentifier {}; + exports.SubjectKeyIdentifier = SubjectKeyIdentifier; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/private_key_usage_period.js +var require_private_key_usage_period = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PrivateKeyUsagePeriod = exports.id_ce_privateKeyUsagePeriod = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ce_privateKeyUsagePeriod = `${require_object_identifiers$5().id_ce}.16`; + var PrivateKeyUsagePeriod = class { + notBefore; + notAfter; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PrivateKeyUsagePeriod = PrivateKeyUsagePeriod; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.GeneralizedTime, + context: 0, + implicit: true, + optional: true + })], PrivateKeyUsagePeriod.prototype, "notBefore", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.GeneralizedTime, + context: 1, + implicit: true, + optional: true + })], PrivateKeyUsagePeriod.prototype, "notAfter", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/entrust_version_info.js +var require_entrust_version_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EntrustVersionInfo = exports.EntrustInfo = exports.EntrustInfoFlags = exports.id_entrust_entrustVersInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_entrust_entrustVersInfo = "1.2.840.113533.7.65.0"; + var EntrustInfoFlags; + (function(EntrustInfoFlags) { + EntrustInfoFlags[EntrustInfoFlags["keyUpdateAllowed"] = 1] = "keyUpdateAllowed"; + EntrustInfoFlags[EntrustInfoFlags["newExtensions"] = 2] = "newExtensions"; + EntrustInfoFlags[EntrustInfoFlags["pKIXCertificate"] = 4] = "pKIXCertificate"; + })(EntrustInfoFlags || (exports.EntrustInfoFlags = EntrustInfoFlags = {})); + var EntrustInfo = class extends asn1_schema_1.BitString { + toJSON() { + const res = []; + const flags = this.toNumber(); + if (flags & EntrustInfoFlags.pKIXCertificate) res.push("pKIXCertificate"); + if (flags & EntrustInfoFlags.newExtensions) res.push("newExtensions"); + if (flags & EntrustInfoFlags.keyUpdateAllowed) res.push("keyUpdateAllowed"); + return res; + } + toString() { + return `[${this.toJSON().join(", ")}]`; + } + }; + exports.EntrustInfo = EntrustInfo; + var EntrustVersionInfo = class { + entrustVers = ""; + entrustInfoFlags = new EntrustInfo(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EntrustVersionInfo = EntrustVersionInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.GeneralString })], EntrustVersionInfo.prototype, "entrustVers", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: EntrustInfo })], EntrustVersionInfo.prototype, "entrustInfoFlags", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/subject_info_access.js +var require_subject_info_access = /* @__PURE__ */ __commonJSMin(((exports) => { + var SubjectInfoAccessSyntax_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SubjectInfoAccessSyntax = exports.id_pe_subjectInfoAccess = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const object_identifiers_1 = require_object_identifiers$5(); + const authority_information_access_1 = require_authority_information_access(); + exports.id_pe_subjectInfoAccess = `${object_identifiers_1.id_pe}.11`; + let SubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = class SubjectInfoAccessSyntax extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SubjectInfoAccessSyntax_1.prototype); + } + }; + exports.SubjectInfoAccessSyntax = SubjectInfoAccessSyntax; + exports.SubjectInfoAccessSyntax = SubjectInfoAccessSyntax = SubjectInfoAccessSyntax_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: authority_information_access_1.AccessDescription + })], SubjectInfoAccessSyntax); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extensions/index.js +var require_extensions = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_authority_information_access(), exports); + tslib_1.__exportStar(require_authority_key_identifier(), exports); + tslib_1.__exportStar(require_basic_constraints(), exports); + tslib_1.__exportStar(require_certificate_issuer(), exports); + tslib_1.__exportStar(require_certificate_policies(), exports); + tslib_1.__exportStar(require_crl_delta_indicator(), exports); + tslib_1.__exportStar(require_crl_distribution_points(), exports); + tslib_1.__exportStar(require_crl_freshest(), exports); + tslib_1.__exportStar(require_crl_issuing_distribution_point(), exports); + tslib_1.__exportStar(require_crl_number(), exports); + tslib_1.__exportStar(require_crl_reason(), exports); + tslib_1.__exportStar(require_extended_key_usage(), exports); + tslib_1.__exportStar(require_inhibit_any_policy(), exports); + tslib_1.__exportStar(require_invalidity_date(), exports); + tslib_1.__exportStar(require_issuer_alternative_name(), exports); + tslib_1.__exportStar(require_key_usage(), exports); + tslib_1.__exportStar(require_name_constraints(), exports); + tslib_1.__exportStar(require_policy_constraints(), exports); + tslib_1.__exportStar(require_policy_mappings(), exports); + tslib_1.__exportStar(require_subject_alternative_name(), exports); + tslib_1.__exportStar(require_subject_directory_attributes(), exports); + tslib_1.__exportStar(require_subject_key_identifier(), exports); + tslib_1.__exportStar(require_private_key_usage_period(), exports); + tslib_1.__exportStar(require_entrust_version_info(), exports); + tslib_1.__exportStar(require_subject_info_access(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/algorithm_identifier.js +var require_algorithm_identifier = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AlgorithmIdentifier = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const bytes_1 = require_bytes(); + var AlgorithmIdentifier = class AlgorithmIdentifier { + algorithm = ""; + parameters; + constructor(params = {}) { + Object.assign(this, params); + } + isEqual(data) { + return data instanceof AlgorithmIdentifier && data.algorithm == this.algorithm && (data.parameters && this.parameters && (0, bytes_1.equal)(data.parameters, this.parameters) || data.parameters === this.parameters); + } + }; + exports.AlgorithmIdentifier = AlgorithmIdentifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], AlgorithmIdentifier.prototype, "algorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + optional: true + })], AlgorithmIdentifier.prototype, "parameters", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/subject_public_key_info.js +var require_subject_public_key_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SubjectPublicKeyInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const algorithm_identifier_1 = require_algorithm_identifier(); + var SubjectPublicKeyInfo = class { + algorithm = new algorithm_identifier_1.AlgorithmIdentifier(); + subjectPublicKey = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SubjectPublicKeyInfo = SubjectPublicKeyInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })], SubjectPublicKeyInfo.prototype, "algorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })], SubjectPublicKeyInfo.prototype, "subjectPublicKey", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/time.js +var require_time = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Time = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + let Time = class Time { + utcTime; + generalTime; + constructor(time) { + if (time) if (typeof time === "string" || typeof time === "number" || time instanceof Date) { + const date = new Date(time); + date.setMilliseconds(0); + if (date.getUTCFullYear() > 2049) this.generalTime = date; + else this.utcTime = date; + } else Object.assign(this, time); + } + getTime() { + const time = this.utcTime || this.generalTime; + if (!time) throw new Error("Cannot get time from CHOICE object"); + return time; + } + }; + exports.Time = Time; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.UTCTime })], Time.prototype, "utcTime", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.GeneralizedTime })], Time.prototype, "generalTime", void 0); + exports.Time = Time = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], Time); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/validity.js +var require_validity = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Validity = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const time_1 = require_time(); + var Validity = class { + notBefore = new time_1.Time(/* @__PURE__ */ new Date()); + notAfter = new time_1.Time(/* @__PURE__ */ new Date()); + constructor(params) { + if (params) { + this.notBefore = new time_1.Time(params.notBefore); + this.notAfter = new time_1.Time(params.notAfter); + } + } + }; + exports.Validity = Validity; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: time_1.Time })], Validity.prototype, "notBefore", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: time_1.Time })], Validity.prototype, "notAfter", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/extension.js +var require_extension = /* @__PURE__ */ __commonJSMin(((exports) => { + var Extensions_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Extensions = exports.Extension = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var Extension = class Extension { + static CRITICAL = false; + extnID = ""; + critical = Extension.CRITICAL; + extnValue = new asn1_schema_1.OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Extension = Extension; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], Extension.prototype, "extnID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Boolean, + defaultValue: Extension.CRITICAL + })], Extension.prototype, "critical", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], Extension.prototype, "extnValue", void 0); + let Extensions = Extensions_1 = class Extensions extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, Extensions_1.prototype); + } + }; + exports.Extensions = Extensions; + exports.Extensions = Extensions = Extensions_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: Extension + })], Extensions); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/types.js +var require_types$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Version = void 0; + var Version; + (function(Version) { + Version[Version["v1"] = 0] = "v1"; + Version[Version["v2"] = 1] = "v2"; + Version[Version["v3"] = 2] = "v3"; + })(Version || (exports.Version = Version = {})); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/tbs_certificate.js +var require_tbs_certificate = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TBSCertificate = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const algorithm_identifier_1 = require_algorithm_identifier(); + const name_1 = require_name(); + const subject_public_key_info_1 = require_subject_public_key_info(); + const validity_1 = require_validity(); + const extension_1 = require_extension(); + const types_1 = require_types$3(); + var TBSCertificate = class { + version = types_1.Version.v1; + serialNumber = /* @__PURE__ */ new ArrayBuffer(0); + signature = new algorithm_identifier_1.AlgorithmIdentifier(); + issuer = new name_1.Name(); + validity = new validity_1.Validity(); + subject = new name_1.Name(); + subjectPublicKeyInfo = new subject_public_key_info_1.SubjectPublicKeyInfo(); + issuerUniqueID; + subjectUniqueID; + extensions; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.TBSCertificate = TBSCertificate; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 0, + defaultValue: types_1.Version.v1 + })], TBSCertificate.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], TBSCertificate.prototype, "serialNumber", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })], TBSCertificate.prototype, "signature", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: name_1.Name })], TBSCertificate.prototype, "issuer", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: validity_1.Validity })], TBSCertificate.prototype, "validity", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: name_1.Name })], TBSCertificate.prototype, "subject", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: subject_public_key_info_1.SubjectPublicKeyInfo })], TBSCertificate.prototype, "subjectPublicKeyInfo", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.BitString, + context: 1, + implicit: true, + optional: true + })], TBSCertificate.prototype, "issuerUniqueID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.BitString, + context: 2, + implicit: true, + optional: true + })], TBSCertificate.prototype, "subjectUniqueID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: extension_1.Extensions, + context: 3, + optional: true + })], TBSCertificate.prototype, "extensions", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/certificate.js +var require_certificate = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Certificate = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const algorithm_identifier_1 = require_algorithm_identifier(); + const tbs_certificate_1 = require_tbs_certificate(); + var Certificate = class { + tbsCertificate = new tbs_certificate_1.TBSCertificate(); + tbsCertificateRaw; + signatureAlgorithm = new algorithm_identifier_1.AlgorithmIdentifier(); + signatureValue = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Certificate = Certificate; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: tbs_certificate_1.TBSCertificate, + raw: true + })], Certificate.prototype, "tbsCertificate", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })], Certificate.prototype, "signatureAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })], Certificate.prototype, "signatureValue", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/tbs_cert_list.js +var require_tbs_cert_list = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.TBSCertList = exports.RevokedCertificate = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const algorithm_identifier_1 = require_algorithm_identifier(); + const name_1 = require_name(); + const time_1 = require_time(); + const extension_1 = require_extension(); + var RevokedCertificate = class { + userCertificate = /* @__PURE__ */ new ArrayBuffer(0); + revocationDate = new time_1.Time(); + crlEntryExtensions; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RevokedCertificate = RevokedCertificate; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RevokedCertificate.prototype, "userCertificate", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: time_1.Time })], RevokedCertificate.prototype, "revocationDate", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: extension_1.Extension, + optional: true, + repeated: "sequence" + })], RevokedCertificate.prototype, "crlEntryExtensions", void 0); + var TBSCertList = class { + version; + signature = new algorithm_identifier_1.AlgorithmIdentifier(); + issuer = new name_1.Name(); + thisUpdate = new time_1.Time(); + nextUpdate; + revokedCertificates; + crlExtensions; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.TBSCertList = TBSCertList; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + optional: true + })], TBSCertList.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })], TBSCertList.prototype, "signature", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: name_1.Name })], TBSCertList.prototype, "issuer", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: time_1.Time })], TBSCertList.prototype, "thisUpdate", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: time_1.Time, + optional: true + })], TBSCertList.prototype, "nextUpdate", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: RevokedCertificate, + repeated: "sequence", + optional: true + })], TBSCertList.prototype, "revokedCertificates", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: extension_1.Extension, + optional: true, + context: 0, + repeated: "sequence" + })], TBSCertList.prototype, "crlExtensions", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/certificate_list.js +var require_certificate_list = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CertificateList = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const algorithm_identifier_1 = require_algorithm_identifier(); + const tbs_cert_list_1 = require_tbs_cert_list(); + var CertificateList = class { + tbsCertList = new tbs_cert_list_1.TBSCertList(); + tbsCertListRaw; + signatureAlgorithm = new algorithm_identifier_1.AlgorithmIdentifier(); + signature = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.CertificateList = CertificateList; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: tbs_cert_list_1.TBSCertList, + raw: true + })], CertificateList.prototype, "tbsCertList", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: algorithm_identifier_1.AlgorithmIdentifier })], CertificateList.prototype, "signatureAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })], CertificateList.prototype, "signature", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509/build/cjs/index.js +var require_cjs$9 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_extensions(), exports); + tslib_1.__exportStar(require_algorithm_identifier(), exports); + tslib_1.__exportStar(require_attribute$2(), exports); + tslib_1.__exportStar(require_certificate(), exports); + tslib_1.__exportStar(require_certificate_list(), exports); + tslib_1.__exportStar(require_extension(), exports); + tslib_1.__exportStar(require_general_name(), exports); + tslib_1.__exportStar(require_general_names(), exports); + tslib_1.__exportStar(require_name(), exports); + tslib_1.__exportStar(require_object_identifiers$5(), exports); + tslib_1.__exportStar(require_subject_public_key_info(), exports); + tslib_1.__exportStar(require_tbs_cert_list(), exports); + tslib_1.__exportStar(require_tbs_certificate(), exports); + tslib_1.__exportStar(require_time(), exports); + tslib_1.__exportStar(require_types$3(), exports); + tslib_1.__exportStar(require_validity(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/issuer_and_serial_number.js +var require_issuer_and_serial_number = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IssuerAndSerialNumber = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var IssuerAndSerialNumber = class { + issuer = new asn1_x509_1.Name(); + serialNumber = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.IssuerAndSerialNumber = IssuerAndSerialNumber; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.Name })], IssuerAndSerialNumber.prototype, "issuer", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], IssuerAndSerialNumber.prototype, "serialNumber", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/signer_identifier.js +var require_signer_identifier = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SignerIdentifier = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const issuer_and_serial_number_1 = require_issuer_and_serial_number(); + let SignerIdentifier = class SignerIdentifier { + subjectKeyIdentifier; + issuerAndSerialNumber; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SignerIdentifier = SignerIdentifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.SubjectKeyIdentifier, + context: 0, + implicit: true + })], SignerIdentifier.prototype, "subjectKeyIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: issuer_and_serial_number_1.IssuerAndSerialNumber })], SignerIdentifier.prototype, "issuerAndSerialNumber", void 0); + exports.SignerIdentifier = SignerIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], SignerIdentifier); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/types.js +var require_types$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KeyDerivationAlgorithmIdentifier = exports.MessageAuthenticationCodeAlgorithm = exports.ContentEncryptionAlgorithmIdentifier = exports.KeyEncryptionAlgorithmIdentifier = exports.SignatureAlgorithmIdentifier = exports.DigestAlgorithmIdentifier = exports.CMSVersion = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_x509_1 = require_cjs$9(); + const asn1_schema_1 = require_cjs$10(); + var CMSVersion; + (function(CMSVersion) { + CMSVersion[CMSVersion["v0"] = 0] = "v0"; + CMSVersion[CMSVersion["v1"] = 1] = "v1"; + CMSVersion[CMSVersion["v2"] = 2] = "v2"; + CMSVersion[CMSVersion["v3"] = 3] = "v3"; + CMSVersion[CMSVersion["v4"] = 4] = "v4"; + CMSVersion[CMSVersion["v5"] = 5] = "v5"; + })(CMSVersion || (exports.CMSVersion = CMSVersion = {})); + let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends asn1_x509_1.AlgorithmIdentifier {}; + exports.DigestAlgorithmIdentifier = DigestAlgorithmIdentifier; + exports.DigestAlgorithmIdentifier = DigestAlgorithmIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], DigestAlgorithmIdentifier); + let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends asn1_x509_1.AlgorithmIdentifier {}; + exports.SignatureAlgorithmIdentifier = SignatureAlgorithmIdentifier; + exports.SignatureAlgorithmIdentifier = SignatureAlgorithmIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], SignatureAlgorithmIdentifier); + let KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends asn1_x509_1.AlgorithmIdentifier {}; + exports.KeyEncryptionAlgorithmIdentifier = KeyEncryptionAlgorithmIdentifier; + exports.KeyEncryptionAlgorithmIdentifier = KeyEncryptionAlgorithmIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], KeyEncryptionAlgorithmIdentifier); + let ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends asn1_x509_1.AlgorithmIdentifier {}; + exports.ContentEncryptionAlgorithmIdentifier = ContentEncryptionAlgorithmIdentifier; + exports.ContentEncryptionAlgorithmIdentifier = ContentEncryptionAlgorithmIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], ContentEncryptionAlgorithmIdentifier); + let MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends asn1_x509_1.AlgorithmIdentifier {}; + exports.MessageAuthenticationCodeAlgorithm = MessageAuthenticationCodeAlgorithm; + exports.MessageAuthenticationCodeAlgorithm = MessageAuthenticationCodeAlgorithm = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], MessageAuthenticationCodeAlgorithm); + let KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends asn1_x509_1.AlgorithmIdentifier {}; + exports.KeyDerivationAlgorithmIdentifier = KeyDerivationAlgorithmIdentifier; + exports.KeyDerivationAlgorithmIdentifier = KeyDerivationAlgorithmIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], KeyDerivationAlgorithmIdentifier); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/attribute.js +var require_attribute$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Attribute = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var Attribute = class { + attrType = ""; + attrValues = []; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Attribute = Attribute; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], Attribute.prototype, "attrType", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + repeated: "set" + })], Attribute.prototype, "attrValues", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/signer_info.js +var require_signer_info = /* @__PURE__ */ __commonJSMin(((exports) => { + var SignerInfos_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SignerInfos = exports.SignerInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const signer_identifier_1 = require_signer_identifier(); + const types_1 = require_types$2(); + const attribute_1 = require_attribute$1(); + var SignerInfo = class { + version = types_1.CMSVersion.v0; + sid = new signer_identifier_1.SignerIdentifier(); + digestAlgorithm = new types_1.DigestAlgorithmIdentifier(); + signedAttrs; + signedAttrsRaw; + signatureAlgorithm = new types_1.SignatureAlgorithmIdentifier(); + signature = new asn1_schema_1.OctetString(); + unsignedAttrs; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SignerInfo = SignerInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], SignerInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: signer_identifier_1.SignerIdentifier })], SignerInfo.prototype, "sid", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: types_1.DigestAlgorithmIdentifier })], SignerInfo.prototype, "digestAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: attribute_1.Attribute, + repeated: "set", + context: 0, + implicit: true, + optional: true, + raw: true + })], SignerInfo.prototype, "signedAttrs", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: types_1.SignatureAlgorithmIdentifier })], SignerInfo.prototype, "signatureAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], SignerInfo.prototype, "signature", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: attribute_1.Attribute, + repeated: "set", + context: 1, + implicit: true, + optional: true + })], SignerInfo.prototype, "unsignedAttrs", void 0); + let SignerInfos = SignerInfos_1 = class SignerInfos extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SignerInfos_1.prototype); + } + }; + exports.SignerInfos = SignerInfos; + exports.SignerInfos = SignerInfos = SignerInfos_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: SignerInfo + })], SignerInfos); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/attributes/counter_signature.js +var require_counter_signature = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CounterSignature = exports.id_counterSignature = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const signer_info_1 = require_signer_info(); + exports.id_counterSignature = "1.2.840.113549.1.9.6"; + let CounterSignature = class CounterSignature extends signer_info_1.SignerInfo {}; + exports.CounterSignature = CounterSignature; + exports.CounterSignature = CounterSignature = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], CounterSignature); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/attributes/message_digest.js +var require_message_digest = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MessageDigest = exports.id_messageDigest = void 0; + const asn1_schema_1 = require_cjs$10(); + exports.id_messageDigest = "1.2.840.113549.1.9.4"; + var MessageDigest = class extends asn1_schema_1.OctetString {}; + exports.MessageDigest = MessageDigest; +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/attributes/signing_time.js +var require_signing_time = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SigningTime = exports.id_signingTime = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_x509_1 = require_cjs$9(); + const asn1_schema_1 = require_cjs$10(); + exports.id_signingTime = "1.2.840.113549.1.9.5"; + let SigningTime = class SigningTime extends asn1_x509_1.Time {}; + exports.SigningTime = SigningTime; + exports.SigningTime = SigningTime = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], SigningTime); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/attributes/index.js +var require_attributes$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_contentType = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_counter_signature(), exports); + tslib_1.__exportStar(require_message_digest(), exports); + tslib_1.__exportStar(require_signing_time(), exports); + exports.id_contentType = "1.2.840.113549.1.9.3"; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/aa_clear_attrs.js +var require_aa_clear_attrs = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ACClearAttrs = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var ACClearAttrs = class { + acIssuer = new asn1_x509_1.GeneralName(); + acSerial = 0; + attrs = []; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.ACClearAttrs = ACClearAttrs; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.GeneralName })], ACClearAttrs.prototype, "acIssuer", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], ACClearAttrs.prototype, "acSerial", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.Attribute, + repeated: "sequence" + })], ACClearAttrs.prototype, "attrs", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_spec.js +var require_attr_spec = /* @__PURE__ */ __commonJSMin(((exports) => { + var AttrSpec_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttrSpec = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + let AttrSpec = AttrSpec_1 = class AttrSpec extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, AttrSpec_1.prototype); + } + }; + exports.AttrSpec = AttrSpec; + exports.AttrSpec = AttrSpec = AttrSpec_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: asn1_schema_1.AsnPropTypes.ObjectIdentifier + })], AttrSpec); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/aa_controls.js +var require_aa_controls = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AAControls = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const attr_spec_1 = require_attr_spec(); + var AAControls = class { + pathLenConstraint; + permittedAttrs; + excludedAttrs; + permitUnSpecified = true; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.AAControls = AAControls; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + optional: true + })], AAControls.prototype, "pathLenConstraint", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: attr_spec_1.AttrSpec, + implicit: true, + context: 0, + optional: true + })], AAControls.prototype, "permittedAttrs", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: attr_spec_1.AttrSpec, + implicit: true, + context: 1, + optional: true + })], AAControls.prototype, "excludedAttrs", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Boolean, + defaultValue: true + })], AAControls.prototype, "permitUnSpecified", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/issuer_serial.js +var require_issuer_serial = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IssuerSerial = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var IssuerSerial = class { + issuer = new asn1_x509_1.GeneralNames(); + serial = /* @__PURE__ */ new ArrayBuffer(0); + issuerUID = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.IssuerSerial = IssuerSerial; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.GeneralNames })], IssuerSerial.prototype, "issuer", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], IssuerSerial.prototype, "serial", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.BitString, + optional: true + })], IssuerSerial.prototype, "issuerUID", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/object_digest_info.js +var require_object_digest_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ObjectDigestInfo = exports.DigestedObjectType = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var DigestedObjectType; + (function(DigestedObjectType) { + DigestedObjectType[DigestedObjectType["publicKey"] = 0] = "publicKey"; + DigestedObjectType[DigestedObjectType["publicKeyCert"] = 1] = "publicKeyCert"; + DigestedObjectType[DigestedObjectType["otherObjectTypes"] = 2] = "otherObjectTypes"; + })(DigestedObjectType || (exports.DigestedObjectType = DigestedObjectType = {})); + var ObjectDigestInfo = class { + digestedObjectType = DigestedObjectType.publicKey; + otherObjectTypeID; + digestAlgorithm = new asn1_x509_1.AlgorithmIdentifier(); + objectDigest = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.ObjectDigestInfo = ObjectDigestInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Enumerated })], ObjectDigestInfo.prototype, "digestedObjectType", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.ObjectIdentifier, + optional: true + })], ObjectDigestInfo.prototype, "otherObjectTypeID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], ObjectDigestInfo.prototype, "digestAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })], ObjectDigestInfo.prototype, "objectDigest", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/v2_form.js +var require_v2_form = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.V2Form = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const issuer_serial_1 = require_issuer_serial(); + const object_digest_info_1 = require_object_digest_info(); + var V2Form = class { + issuerName; + baseCertificateID; + objectDigestInfo; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.V2Form = V2Form; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralNames, + optional: true + })], V2Form.prototype, "issuerName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: issuer_serial_1.IssuerSerial, + context: 0, + implicit: true, + optional: true + })], V2Form.prototype, "baseCertificateID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: object_digest_info_1.ObjectDigestInfo, + context: 1, + implicit: true, + optional: true + })], V2Form.prototype, "objectDigestInfo", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_cert_issuer.js +var require_attr_cert_issuer = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttCertIssuer = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const v2_form_1 = require_v2_form(); + let AttCertIssuer = class AttCertIssuer { + v1Form; + v2Form; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.AttCertIssuer = AttCertIssuer; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralName, + repeated: "sequence" + })], AttCertIssuer.prototype, "v1Form", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: v2_form_1.V2Form, + context: 0, + implicit: true + })], AttCertIssuer.prototype, "v2Form", void 0); + exports.AttCertIssuer = AttCertIssuer = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], AttCertIssuer); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/attr_cert_validity_period.js +var require_attr_cert_validity_period = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttCertValidityPeriod = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var AttCertValidityPeriod = class { + notBeforeTime = /* @__PURE__ */ new Date(); + notAfterTime = /* @__PURE__ */ new Date(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.AttCertValidityPeriod = AttCertValidityPeriod; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.GeneralizedTime })], AttCertValidityPeriod.prototype, "notBeforeTime", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.GeneralizedTime })], AttCertValidityPeriod.prototype, "notAfterTime", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/holder.js +var require_holder = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Holder = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const issuer_serial_1 = require_issuer_serial(); + const object_digest_info_1 = require_object_digest_info(); + var Holder = class { + baseCertificateID; + entityName; + objectDigestInfo; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Holder = Holder; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: issuer_serial_1.IssuerSerial, + implicit: true, + context: 0, + optional: true + })], Holder.prototype, "baseCertificateID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralNames, + implicit: true, + context: 1, + optional: true + })], Holder.prototype, "entityName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: object_digest_info_1.ObjectDigestInfo, + implicit: true, + context: 2, + optional: true + })], Holder.prototype, "objectDigestInfo", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/attribute_certificate_info.js +var require_attribute_certificate_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttributeCertificateInfo = exports.AttCertVersion = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const holder_1 = require_holder(); + const attr_cert_issuer_1 = require_attr_cert_issuer(); + const attr_cert_validity_period_1 = require_attr_cert_validity_period(); + var AttCertVersion; + (function(AttCertVersion) { + AttCertVersion[AttCertVersion["v2"] = 1] = "v2"; + })(AttCertVersion || (exports.AttCertVersion = AttCertVersion = {})); + var AttributeCertificateInfo = class { + version = AttCertVersion.v2; + holder = new holder_1.Holder(); + issuer = new attr_cert_issuer_1.AttCertIssuer(); + signature = new asn1_x509_1.AlgorithmIdentifier(); + serialNumber = /* @__PURE__ */ new ArrayBuffer(0); + attrCertValidityPeriod = new attr_cert_validity_period_1.AttCertValidityPeriod(); + attributes = []; + issuerUniqueID; + extensions; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.AttributeCertificateInfo = AttributeCertificateInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], AttributeCertificateInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: holder_1.Holder })], AttributeCertificateInfo.prototype, "holder", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: attr_cert_issuer_1.AttCertIssuer })], AttributeCertificateInfo.prototype, "issuer", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], AttributeCertificateInfo.prototype, "signature", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], AttributeCertificateInfo.prototype, "serialNumber", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: attr_cert_validity_period_1.AttCertValidityPeriod })], AttributeCertificateInfo.prototype, "attrCertValidityPeriod", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.Attribute, + repeated: "sequence" + })], AttributeCertificateInfo.prototype, "attributes", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.BitString, + optional: true + })], AttributeCertificateInfo.prototype, "issuerUniqueID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.Extensions, + optional: true + })], AttributeCertificateInfo.prototype, "extensions", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/attribute_certificate.js +var require_attribute_certificate = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AttributeCertificate = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const attribute_certificate_info_1 = require_attribute_certificate_info(); + var AttributeCertificate = class { + acinfo = new attribute_certificate_info_1.AttributeCertificateInfo(); + signatureAlgorithm = new asn1_x509_1.AlgorithmIdentifier(); + signatureValue = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.AttributeCertificate = AttributeCertificate; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: attribute_certificate_info_1.AttributeCertificateInfo })], AttributeCertificate.prototype, "acinfo", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], AttributeCertificate.prototype, "signatureAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })], AttributeCertificate.prototype, "signatureValue", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/class_list.js +var require_class_list = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ClassList = exports.ClassListFlags = void 0; + const asn1_schema_1 = require_cjs$10(); + var ClassListFlags; + (function(ClassListFlags) { + ClassListFlags[ClassListFlags["unmarked"] = 1] = "unmarked"; + ClassListFlags[ClassListFlags["unclassified"] = 2] = "unclassified"; + ClassListFlags[ClassListFlags["restricted"] = 4] = "restricted"; + ClassListFlags[ClassListFlags["confidential"] = 8] = "confidential"; + ClassListFlags[ClassListFlags["secret"] = 16] = "secret"; + ClassListFlags[ClassListFlags["topSecret"] = 32] = "topSecret"; + })(ClassListFlags || (exports.ClassListFlags = ClassListFlags = {})); + var ClassList = class extends asn1_schema_1.BitString {}; + exports.ClassList = ClassList; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/security_category.js +var require_security_category = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SecurityCategory = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var SecurityCategory = class { + type = ""; + value = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SecurityCategory = SecurityCategory; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.ObjectIdentifier, + implicit: true, + context: 0 + })], SecurityCategory.prototype, "type", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + implicit: true, + context: 1 + })], SecurityCategory.prototype, "value", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/clearance.js +var require_clearance = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Clearance = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const class_list_1 = require_class_list(); + const security_category_1 = require_security_category(); + var Clearance = class { + policyId = ""; + classList = new class_list_1.ClassList(class_list_1.ClassListFlags.unclassified); + securityCategories; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Clearance = Clearance; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], Clearance.prototype, "policyId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: class_list_1.ClassList, + defaultValue: new class_list_1.ClassList(class_list_1.ClassListFlags.unclassified) + })], Clearance.prototype, "classList", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: security_category_1.SecurityCategory, + repeated: "set" + })], Clearance.prototype, "securityCategories", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/ietf_attr_syntax.js +var require_ietf_attr_syntax = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.IetfAttrSyntax = exports.IetfAttrSyntaxValueChoices = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var IetfAttrSyntaxValueChoices = class { + cotets; + oid; + string; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.IetfAttrSyntaxValueChoices = IetfAttrSyntaxValueChoices; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], IetfAttrSyntaxValueChoices.prototype, "cotets", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], IetfAttrSyntaxValueChoices.prototype, "oid", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Utf8String })], IetfAttrSyntaxValueChoices.prototype, "string", void 0); + var IetfAttrSyntax = class { + policyAuthority; + values = []; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.IetfAttrSyntax = IetfAttrSyntax; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralNames, + implicit: true, + context: 0, + optional: true + })], IetfAttrSyntax.prototype, "policyAuthority", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: IetfAttrSyntaxValueChoices, + repeated: "sequence" + })], IetfAttrSyntax.prototype, "values", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/object_identifiers.js +var require_object_identifiers$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_at_clearance = exports.id_at_role = exports.id_at = exports.id_aca_encAttrs = exports.id_aca_group = exports.id_aca_chargingIdentity = exports.id_aca_accessIdentity = exports.id_aca_authenticationInfo = exports.id_aca = exports.id_ce_targetInformation = exports.id_pe_ac_proxying = exports.id_pe_aaControls = exports.id_pe_ac_auditIdentity = void 0; + const asn1_x509_1 = require_cjs$9(); + exports.id_pe_ac_auditIdentity = `${asn1_x509_1.id_pe}.4`; + exports.id_pe_aaControls = `${asn1_x509_1.id_pe}.6`; + exports.id_pe_ac_proxying = `${asn1_x509_1.id_pe}.10`; + exports.id_ce_targetInformation = `${asn1_x509_1.id_ce}.55`; + exports.id_aca = `${asn1_x509_1.id_pkix}.10`; + exports.id_aca_authenticationInfo = `${exports.id_aca}.1`; + exports.id_aca_accessIdentity = `${exports.id_aca}.2`; + exports.id_aca_chargingIdentity = `${exports.id_aca}.3`; + exports.id_aca_group = `${exports.id_aca}.4`; + exports.id_aca_encAttrs = `${exports.id_aca}.6`; + exports.id_at = "2.5.4"; + exports.id_at_role = `${exports.id_at}.72`; + exports.id_at_clearance = "2.5.1.5.55"; +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/target.js +var require_target = /* @__PURE__ */ __commonJSMin(((exports) => { + var Targets_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Targets = exports.Target = exports.TargetCert = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const issuer_serial_1 = require_issuer_serial(); + const object_digest_info_1 = require_object_digest_info(); + var TargetCert = class { + targetCertificate = new issuer_serial_1.IssuerSerial(); + targetName; + certDigestInfo; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.TargetCert = TargetCert; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: issuer_serial_1.IssuerSerial })], TargetCert.prototype, "targetCertificate", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralName, + optional: true + })], TargetCert.prototype, "targetName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: object_digest_info_1.ObjectDigestInfo, + optional: true + })], TargetCert.prototype, "certDigestInfo", void 0); + let Target = class Target { + targetName; + targetGroup; + targetCert; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Target = Target; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralName, + context: 0, + implicit: true + })], Target.prototype, "targetName", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralName, + context: 1, + implicit: true + })], Target.prototype, "targetGroup", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: TargetCert, + context: 2, + implicit: true + })], Target.prototype, "targetCert", void 0); + exports.Target = Target = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], Target); + let Targets = Targets_1 = class Targets extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, Targets_1.prototype); + } + }; + exports.Targets = Targets; + exports.Targets = Targets = Targets_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: Target + })], Targets); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/proxy_info.js +var require_proxy_info = /* @__PURE__ */ __commonJSMin(((exports) => { + var ProxyInfo_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ProxyInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const target_1 = require_target(); + let ProxyInfo = ProxyInfo_1 = class ProxyInfo extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, ProxyInfo_1.prototype); + } + }; + exports.ProxyInfo = ProxyInfo; + exports.ProxyInfo = ProxyInfo = ProxyInfo_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: target_1.Targets + })], ProxyInfo); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/role_syntax.js +var require_role_syntax = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RoleSyntax = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var RoleSyntax = class { + roleAuthority; + roleName; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RoleSyntax = RoleSyntax; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralNames, + implicit: true, + context: 0, + optional: true + })], RoleSyntax.prototype, "roleAuthority", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.GeneralName, + implicit: true, + context: 1 + })], RoleSyntax.prototype, "roleName", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/svce_auth_info.js +var require_svce_auth_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SvceAuthInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var SvceAuthInfo = class { + service = new asn1_x509_1.GeneralName(); + ident = new asn1_x509_1.GeneralName(); + authInfo; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SvceAuthInfo = SvceAuthInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.GeneralName })], SvceAuthInfo.prototype, "service", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.GeneralName })], SvceAuthInfo.prototype, "ident", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.OctetString, + optional: true + })], SvceAuthInfo.prototype, "authInfo", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-x509-attr/build/cjs/index.js +var require_cjs$8 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_aa_clear_attrs(), exports); + tslib_1.__exportStar(require_aa_controls(), exports); + tslib_1.__exportStar(require_attr_cert_issuer(), exports); + tslib_1.__exportStar(require_attr_cert_validity_period(), exports); + tslib_1.__exportStar(require_attr_spec(), exports); + tslib_1.__exportStar(require_attribute_certificate(), exports); + tslib_1.__exportStar(require_attribute_certificate_info(), exports); + tslib_1.__exportStar(require_class_list(), exports); + tslib_1.__exportStar(require_clearance(), exports); + tslib_1.__exportStar(require_holder(), exports); + tslib_1.__exportStar(require_ietf_attr_syntax(), exports); + tslib_1.__exportStar(require_issuer_serial(), exports); + tslib_1.__exportStar(require_object_digest_info(), exports); + tslib_1.__exportStar(require_object_identifiers$4(), exports); + tslib_1.__exportStar(require_proxy_info(), exports); + tslib_1.__exportStar(require_role_syntax(), exports); + tslib_1.__exportStar(require_security_category(), exports); + tslib_1.__exportStar(require_svce_auth_info(), exports); + tslib_1.__exportStar(require_target(), exports); + tslib_1.__exportStar(require_v2_form(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/certificate_choices.js +var require_certificate_choices = /* @__PURE__ */ __commonJSMin(((exports) => { + var CertificateSet_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CertificateSet = exports.CertificateChoices = exports.OtherCertificateFormat = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const asn1_x509_attr_1 = require_cjs$8(); + var OtherCertificateFormat = class { + otherCertFormat = ""; + otherCert = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OtherCertificateFormat = OtherCertificateFormat; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], OtherCertificateFormat.prototype, "otherCertFormat", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })], OtherCertificateFormat.prototype, "otherCert", void 0); + let CertificateChoices = class CertificateChoices { + certificate; + v2AttrCert; + other; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.CertificateChoices = CertificateChoices; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.Certificate })], CertificateChoices.prototype, "certificate", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_attr_1.AttributeCertificate, + context: 2, + implicit: true + })], CertificateChoices.prototype, "v2AttrCert", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: OtherCertificateFormat, + context: 3, + implicit: true + })], CertificateChoices.prototype, "other", void 0); + exports.CertificateChoices = CertificateChoices = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], CertificateChoices); + let CertificateSet = CertificateSet_1 = class CertificateSet extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, CertificateSet_1.prototype); + } + }; + exports.CertificateSet = CertificateSet; + exports.CertificateSet = CertificateSet = CertificateSet_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: CertificateChoices + })], CertificateSet); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/content_info.js +var require_content_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ContentInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var ContentInfo = class { + contentType = ""; + content = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.ContentInfo = ContentInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], ContentInfo.prototype, "contentType", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + context: 0 + })], ContentInfo.prototype, "content", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/encapsulated_content_info.js +var require_encapsulated_content_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EncapsulatedContentInfo = exports.EncapsulatedContent = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + let EncapsulatedContent = class EncapsulatedContent { + single; + any; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EncapsulatedContent = EncapsulatedContent; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], EncapsulatedContent.prototype, "single", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })], EncapsulatedContent.prototype, "any", void 0); + exports.EncapsulatedContent = EncapsulatedContent = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], EncapsulatedContent); + var EncapsulatedContentInfo = class { + eContentType = ""; + eContent; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EncapsulatedContentInfo = EncapsulatedContentInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], EncapsulatedContentInfo.prototype, "eContentType", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: EncapsulatedContent, + context: 0, + optional: true + })], EncapsulatedContentInfo.prototype, "eContent", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/encrypted_content_info.js +var require_encrypted_content_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EncryptedContentInfo = exports.EncryptedContent = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const types_1 = require_types$2(); + let EncryptedContent = class EncryptedContent { + value; + constructedValue; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EncryptedContent = EncryptedContent; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.OctetString, + context: 0, + implicit: true, + optional: true + })], EncryptedContent.prototype, "value", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.OctetString, + converter: asn1_schema_1.AsnConstructedOctetStringConverter, + context: 0, + implicit: true, + optional: true, + repeated: "sequence" + })], EncryptedContent.prototype, "constructedValue", void 0); + exports.EncryptedContent = EncryptedContent = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], EncryptedContent); + var EncryptedContentInfo = class { + contentType = ""; + contentEncryptionAlgorithm = new types_1.ContentEncryptionAlgorithmIdentifier(); + encryptedContent; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EncryptedContentInfo = EncryptedContentInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], EncryptedContentInfo.prototype, "contentType", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: types_1.ContentEncryptionAlgorithmIdentifier })], EncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: EncryptedContent, + optional: true + })], EncryptedContentInfo.prototype, "encryptedContent", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/other_key_attribute.js +var require_other_key_attribute = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OtherKeyAttribute = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var OtherKeyAttribute = class { + keyAttrId = ""; + keyAttr; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OtherKeyAttribute = OtherKeyAttribute; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], OtherKeyAttribute.prototype, "keyAttrId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + optional: true + })], OtherKeyAttribute.prototype, "keyAttr", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/key_agree_recipient_info.js +var require_key_agree_recipient_info = /* @__PURE__ */ __commonJSMin(((exports) => { + var RecipientEncryptedKeys_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KeyAgreeRecipientInfo = exports.OriginatorIdentifierOrKey = exports.OriginatorPublicKey = exports.RecipientEncryptedKeys = exports.RecipientEncryptedKey = exports.KeyAgreeRecipientIdentifier = exports.RecipientKeyIdentifier = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const types_1 = require_types$2(); + const issuer_and_serial_number_1 = require_issuer_and_serial_number(); + const other_key_attribute_1 = require_other_key_attribute(); + var RecipientKeyIdentifier = class { + subjectKeyIdentifier = new asn1_x509_1.SubjectKeyIdentifier(); + date; + other; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RecipientKeyIdentifier = RecipientKeyIdentifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.SubjectKeyIdentifier })], RecipientKeyIdentifier.prototype, "subjectKeyIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.GeneralizedTime, + optional: true + })], RecipientKeyIdentifier.prototype, "date", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: other_key_attribute_1.OtherKeyAttribute, + optional: true + })], RecipientKeyIdentifier.prototype, "other", void 0); + let KeyAgreeRecipientIdentifier = class KeyAgreeRecipientIdentifier { + rKeyId; + issuerAndSerialNumber; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.KeyAgreeRecipientIdentifier = KeyAgreeRecipientIdentifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: RecipientKeyIdentifier, + context: 0, + implicit: true, + optional: true + })], KeyAgreeRecipientIdentifier.prototype, "rKeyId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: issuer_and_serial_number_1.IssuerAndSerialNumber, + optional: true + })], KeyAgreeRecipientIdentifier.prototype, "issuerAndSerialNumber", void 0); + exports.KeyAgreeRecipientIdentifier = KeyAgreeRecipientIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], KeyAgreeRecipientIdentifier); + var RecipientEncryptedKey = class { + rid = new KeyAgreeRecipientIdentifier(); + encryptedKey = new asn1_schema_1.OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RecipientEncryptedKey = RecipientEncryptedKey; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: KeyAgreeRecipientIdentifier })], RecipientEncryptedKey.prototype, "rid", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], RecipientEncryptedKey.prototype, "encryptedKey", void 0); + let RecipientEncryptedKeys = RecipientEncryptedKeys_1 = class RecipientEncryptedKeys extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, RecipientEncryptedKeys_1.prototype); + } + }; + exports.RecipientEncryptedKeys = RecipientEncryptedKeys; + exports.RecipientEncryptedKeys = RecipientEncryptedKeys = RecipientEncryptedKeys_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: RecipientEncryptedKey + })], RecipientEncryptedKeys); + var OriginatorPublicKey = class { + algorithm = new asn1_x509_1.AlgorithmIdentifier(); + publicKey = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OriginatorPublicKey = OriginatorPublicKey; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], OriginatorPublicKey.prototype, "algorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })], OriginatorPublicKey.prototype, "publicKey", void 0); + let OriginatorIdentifierOrKey = class OriginatorIdentifierOrKey { + subjectKeyIdentifier; + originatorKey; + issuerAndSerialNumber; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OriginatorIdentifierOrKey = OriginatorIdentifierOrKey; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.SubjectKeyIdentifier, + context: 0, + implicit: true, + optional: true + })], OriginatorIdentifierOrKey.prototype, "subjectKeyIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: OriginatorPublicKey, + context: 1, + implicit: true, + optional: true + })], OriginatorIdentifierOrKey.prototype, "originatorKey", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: issuer_and_serial_number_1.IssuerAndSerialNumber, + optional: true + })], OriginatorIdentifierOrKey.prototype, "issuerAndSerialNumber", void 0); + exports.OriginatorIdentifierOrKey = OriginatorIdentifierOrKey = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], OriginatorIdentifierOrKey); + var KeyAgreeRecipientInfo = class { + version = types_1.CMSVersion.v3; + originator = new OriginatorIdentifierOrKey(); + ukm; + keyEncryptionAlgorithm = new types_1.KeyEncryptionAlgorithmIdentifier(); + recipientEncryptedKeys = new RecipientEncryptedKeys(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.KeyAgreeRecipientInfo = KeyAgreeRecipientInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], KeyAgreeRecipientInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: OriginatorIdentifierOrKey, + context: 0 + })], KeyAgreeRecipientInfo.prototype, "originator", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.OctetString, + context: 1, + optional: true + })], KeyAgreeRecipientInfo.prototype, "ukm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: types_1.KeyEncryptionAlgorithmIdentifier })], KeyAgreeRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: RecipientEncryptedKeys })], KeyAgreeRecipientInfo.prototype, "recipientEncryptedKeys", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/key_trans_recipient_info.js +var require_key_trans_recipient_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KeyTransRecipientInfo = exports.RecipientIdentifier = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const types_1 = require_types$2(); + const issuer_and_serial_number_1 = require_issuer_and_serial_number(); + let RecipientIdentifier = class RecipientIdentifier { + subjectKeyIdentifier; + issuerAndSerialNumber; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RecipientIdentifier = RecipientIdentifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.SubjectKeyIdentifier, + context: 0, + implicit: true + })], RecipientIdentifier.prototype, "subjectKeyIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: issuer_and_serial_number_1.IssuerAndSerialNumber })], RecipientIdentifier.prototype, "issuerAndSerialNumber", void 0); + exports.RecipientIdentifier = RecipientIdentifier = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], RecipientIdentifier); + var KeyTransRecipientInfo = class { + version = types_1.CMSVersion.v0; + rid = new RecipientIdentifier(); + keyEncryptionAlgorithm = new types_1.KeyEncryptionAlgorithmIdentifier(); + encryptedKey = new asn1_schema_1.OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.KeyTransRecipientInfo = KeyTransRecipientInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], KeyTransRecipientInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: RecipientIdentifier })], KeyTransRecipientInfo.prototype, "rid", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: types_1.KeyEncryptionAlgorithmIdentifier })], KeyTransRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], KeyTransRecipientInfo.prototype, "encryptedKey", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/kek_recipient_info.js +var require_kek_recipient_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KEKRecipientInfo = exports.KEKIdentifier = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const other_key_attribute_1 = require_other_key_attribute(); + const types_1 = require_types$2(); + var KEKIdentifier = class { + keyIdentifier = new asn1_schema_1.OctetString(); + date; + other; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.KEKIdentifier = KEKIdentifier; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], KEKIdentifier.prototype, "keyIdentifier", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.GeneralizedTime, + optional: true + })], KEKIdentifier.prototype, "date", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: other_key_attribute_1.OtherKeyAttribute, + optional: true + })], KEKIdentifier.prototype, "other", void 0); + var KEKRecipientInfo = class { + version = types_1.CMSVersion.v4; + kekid = new KEKIdentifier(); + keyEncryptionAlgorithm = new types_1.KeyEncryptionAlgorithmIdentifier(); + encryptedKey = new asn1_schema_1.OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.KEKRecipientInfo = KEKRecipientInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], KEKRecipientInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: KEKIdentifier })], KEKRecipientInfo.prototype, "kekid", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: types_1.KeyEncryptionAlgorithmIdentifier })], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], KEKRecipientInfo.prototype, "encryptedKey", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/password_recipient_info.js +var require_password_recipient_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PasswordRecipientInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const types_1 = require_types$2(); + var PasswordRecipientInfo = class { + version = types_1.CMSVersion.v0; + keyDerivationAlgorithm; + keyEncryptionAlgorithm = new types_1.KeyEncryptionAlgorithmIdentifier(); + encryptedKey = new asn1_schema_1.OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PasswordRecipientInfo = PasswordRecipientInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], PasswordRecipientInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: types_1.KeyDerivationAlgorithmIdentifier, + context: 0, + optional: true + })], PasswordRecipientInfo.prototype, "keyDerivationAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: types_1.KeyEncryptionAlgorithmIdentifier })], PasswordRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], PasswordRecipientInfo.prototype, "encryptedKey", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/recipient_info.js +var require_recipient_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RecipientInfo = exports.OtherRecipientInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const key_agree_recipient_info_1 = require_key_agree_recipient_info(); + const key_trans_recipient_info_1 = require_key_trans_recipient_info(); + const kek_recipient_info_1 = require_kek_recipient_info(); + const password_recipient_info_1 = require_password_recipient_info(); + var OtherRecipientInfo = class { + oriType = ""; + oriValue = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OtherRecipientInfo = OtherRecipientInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], OtherRecipientInfo.prototype, "oriType", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })], OtherRecipientInfo.prototype, "oriValue", void 0); + let RecipientInfo = class RecipientInfo { + ktri; + kari; + kekri; + pwri; + ori; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RecipientInfo = RecipientInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: key_trans_recipient_info_1.KeyTransRecipientInfo, + optional: true + })], RecipientInfo.prototype, "ktri", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: key_agree_recipient_info_1.KeyAgreeRecipientInfo, + context: 1, + implicit: true, + optional: true + })], RecipientInfo.prototype, "kari", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: kek_recipient_info_1.KEKRecipientInfo, + context: 2, + implicit: true, + optional: true + })], RecipientInfo.prototype, "kekri", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: password_recipient_info_1.PasswordRecipientInfo, + context: 3, + implicit: true, + optional: true + })], RecipientInfo.prototype, "pwri", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: OtherRecipientInfo, + context: 4, + implicit: true, + optional: true + })], RecipientInfo.prototype, "ori", void 0); + exports.RecipientInfo = RecipientInfo = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], RecipientInfo); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/recipient_infos.js +var require_recipient_infos = /* @__PURE__ */ __commonJSMin(((exports) => { + var RecipientInfos_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RecipientInfos = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const recipient_info_1 = require_recipient_info(); + let RecipientInfos = RecipientInfos_1 = class RecipientInfos extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, RecipientInfos_1.prototype); + } + }; + exports.RecipientInfos = RecipientInfos; + exports.RecipientInfos = RecipientInfos = RecipientInfos_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: recipient_info_1.RecipientInfo + })], RecipientInfos); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/revocation_info_choice.js +var require_revocation_info_choice = /* @__PURE__ */ __commonJSMin(((exports) => { + var RevocationInfoChoices_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RevocationInfoChoices = exports.RevocationInfoChoice = exports.OtherRevocationInfoFormat = exports.id_ri_scvp = exports.id_ri_ocsp_response = exports.id_ri = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + exports.id_ri = `${require_cjs$9().id_pkix}.16`; + exports.id_ri_ocsp_response = `${exports.id_ri}.2`; + exports.id_ri_scvp = `${exports.id_ri}.4`; + var OtherRevocationInfoFormat = class { + otherRevInfoFormat = ""; + otherRevInfo = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OtherRevocationInfoFormat = OtherRevocationInfoFormat; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], OtherRevocationInfoFormat.prototype, "otherRevInfoFormat", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })], OtherRevocationInfoFormat.prototype, "otherRevInfo", void 0); + let RevocationInfoChoice = class RevocationInfoChoice { + other = new OtherRevocationInfoFormat(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RevocationInfoChoice = RevocationInfoChoice; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: OtherRevocationInfoFormat, + context: 1, + implicit: true + })], RevocationInfoChoice.prototype, "other", void 0); + exports.RevocationInfoChoice = RevocationInfoChoice = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], RevocationInfoChoice); + let RevocationInfoChoices = RevocationInfoChoices_1 = class RevocationInfoChoices extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, RevocationInfoChoices_1.prototype); + } + }; + exports.RevocationInfoChoices = RevocationInfoChoices; + exports.RevocationInfoChoices = RevocationInfoChoices = RevocationInfoChoices_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: RevocationInfoChoice + })], RevocationInfoChoices); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/originator_info.js +var require_originator_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OriginatorInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const certificate_choices_1 = require_certificate_choices(); + const revocation_info_choice_1 = require_revocation_info_choice(); + var OriginatorInfo = class { + certs; + crls; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OriginatorInfo = OriginatorInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: certificate_choices_1.CertificateSet, + context: 0, + implicit: true, + optional: true + })], OriginatorInfo.prototype, "certs", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: revocation_info_choice_1.RevocationInfoChoices, + context: 1, + implicit: true, + optional: true + })], OriginatorInfo.prototype, "crls", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/enveloped_data.js +var require_enveloped_data = /* @__PURE__ */ __commonJSMin(((exports) => { + var UnprotectedAttributes_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EnvelopedData = exports.UnprotectedAttributes = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const types_1 = require_types$2(); + const attribute_1 = require_attribute$1(); + const recipient_infos_1 = require_recipient_infos(); + const originator_info_1 = require_originator_info(); + const encrypted_content_info_1 = require_encrypted_content_info(); + let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype); + } + }; + exports.UnprotectedAttributes = UnprotectedAttributes; + exports.UnprotectedAttributes = UnprotectedAttributes = UnprotectedAttributes_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: attribute_1.Attribute + })], UnprotectedAttributes); + var EnvelopedData = class { + version = types_1.CMSVersion.v0; + originatorInfo; + recipientInfos = new recipient_infos_1.RecipientInfos(); + encryptedContentInfo = new encrypted_content_info_1.EncryptedContentInfo(); + unprotectedAttrs; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EnvelopedData = EnvelopedData; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], EnvelopedData.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: originator_info_1.OriginatorInfo, + context: 0, + implicit: true, + optional: true + })], EnvelopedData.prototype, "originatorInfo", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: recipient_infos_1.RecipientInfos })], EnvelopedData.prototype, "recipientInfos", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: encrypted_content_info_1.EncryptedContentInfo })], EnvelopedData.prototype, "encryptedContentInfo", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: UnprotectedAttributes, + context: 1, + implicit: true, + optional: true + })], EnvelopedData.prototype, "unprotectedAttrs", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/object_identifiers.js +var require_object_identifiers$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_authData = exports.id_encryptedData = exports.id_digestedData = exports.id_envelopedData = exports.id_signedData = exports.id_data = exports.id_ct_contentInfo = void 0; + exports.id_ct_contentInfo = "1.2.840.113549.1.9.16.1.6"; + exports.id_data = "1.2.840.113549.1.7.1"; + exports.id_signedData = "1.2.840.113549.1.7.2"; + exports.id_envelopedData = "1.2.840.113549.1.7.3"; + exports.id_digestedData = "1.2.840.113549.1.7.5"; + exports.id_encryptedData = "1.2.840.113549.1.7.6"; + exports.id_authData = "1.2.840.113549.1.9.16.1.2"; +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/signed_data.js +var require_signed_data = /* @__PURE__ */ __commonJSMin(((exports) => { + var DigestAlgorithmIdentifiers_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SignedData = exports.DigestAlgorithmIdentifiers = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const certificate_choices_1 = require_certificate_choices(); + const types_1 = require_types$2(); + const encapsulated_content_info_1 = require_encapsulated_content_info(); + const revocation_info_choice_1 = require_revocation_info_choice(); + const signer_info_1 = require_signer_info(); + let DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = class DigestAlgorithmIdentifiers extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, DigestAlgorithmIdentifiers_1.prototype); + } + }; + exports.DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers; + exports.DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: types_1.DigestAlgorithmIdentifier + })], DigestAlgorithmIdentifiers); + var SignedData = class { + version = types_1.CMSVersion.v0; + digestAlgorithms = new DigestAlgorithmIdentifiers(); + encapContentInfo = new encapsulated_content_info_1.EncapsulatedContentInfo(); + certificates; + crls; + signerInfos = new signer_info_1.SignerInfos(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SignedData = SignedData; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], SignedData.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: DigestAlgorithmIdentifiers })], SignedData.prototype, "digestAlgorithms", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: encapsulated_content_info_1.EncapsulatedContentInfo })], SignedData.prototype, "encapContentInfo", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: certificate_choices_1.CertificateSet, + context: 0, + implicit: true, + optional: true + })], SignedData.prototype, "certificates", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: revocation_info_choice_1.RevocationInfoChoices, + context: 1, + implicit: true, + optional: true + })], SignedData.prototype, "crls", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: signer_info_1.SignerInfos })], SignedData.prototype, "signerInfos", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-cms/build/cjs/index.js +var require_cjs$7 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_attributes$1(), exports); + tslib_1.__exportStar(require_attribute$1(), exports); + tslib_1.__exportStar(require_certificate_choices(), exports); + tslib_1.__exportStar(require_content_info(), exports); + tslib_1.__exportStar(require_encapsulated_content_info(), exports); + tslib_1.__exportStar(require_encrypted_content_info(), exports); + tslib_1.__exportStar(require_enveloped_data(), exports); + tslib_1.__exportStar(require_issuer_and_serial_number(), exports); + tslib_1.__exportStar(require_kek_recipient_info(), exports); + tslib_1.__exportStar(require_key_agree_recipient_info(), exports); + tslib_1.__exportStar(require_key_trans_recipient_info(), exports); + tslib_1.__exportStar(require_object_identifiers$3(), exports); + tslib_1.__exportStar(require_originator_info(), exports); + tslib_1.__exportStar(require_password_recipient_info(), exports); + tslib_1.__exportStar(require_recipient_info(), exports); + tslib_1.__exportStar(require_recipient_infos(), exports); + tslib_1.__exportStar(require_revocation_info_choice(), exports); + tslib_1.__exportStar(require_signed_data(), exports); + tslib_1.__exportStar(require_signer_identifier(), exports); + tslib_1.__exportStar(require_signer_info(), exports); + tslib_1.__exportStar(require_types$2(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/cjs/object_identifiers.js +var require_object_identifiers$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_sect571r1 = exports.id_sect571k1 = exports.id_secp521r1 = exports.id_sect409r1 = exports.id_sect409k1 = exports.id_secp384r1 = exports.id_sect283r1 = exports.id_sect283k1 = exports.id_secp256r1 = exports.id_sect233r1 = exports.id_sect233k1 = exports.id_secp224r1 = exports.id_sect163r2 = exports.id_sect163k1 = exports.id_secp192r1 = exports.id_ecdsaWithSHA512 = exports.id_ecdsaWithSHA384 = exports.id_ecdsaWithSHA256 = exports.id_ecdsaWithSHA224 = exports.id_ecdsaWithSHA1 = exports.id_ecMQV = exports.id_ecDH = exports.id_ecPublicKey = void 0; + exports.id_ecPublicKey = "1.2.840.10045.2.1"; + exports.id_ecDH = "1.3.132.1.12"; + exports.id_ecMQV = "1.3.132.1.13"; + exports.id_ecdsaWithSHA1 = "1.2.840.10045.4.1"; + exports.id_ecdsaWithSHA224 = "1.2.840.10045.4.3.1"; + exports.id_ecdsaWithSHA256 = "1.2.840.10045.4.3.2"; + exports.id_ecdsaWithSHA384 = "1.2.840.10045.4.3.3"; + exports.id_ecdsaWithSHA512 = "1.2.840.10045.4.3.4"; + exports.id_secp192r1 = "1.2.840.10045.3.1.1"; + exports.id_sect163k1 = "1.3.132.0.1"; + exports.id_sect163r2 = "1.3.132.0.15"; + exports.id_secp224r1 = "1.3.132.0.33"; + exports.id_sect233k1 = "1.3.132.0.26"; + exports.id_sect233r1 = "1.3.132.0.27"; + exports.id_secp256r1 = "1.2.840.10045.3.1.7"; + exports.id_sect283k1 = "1.3.132.0.16"; + exports.id_sect283r1 = "1.3.132.0.17"; + exports.id_secp384r1 = "1.3.132.0.34"; + exports.id_sect409k1 = "1.3.132.0.36"; + exports.id_sect409r1 = "1.3.132.0.37"; + exports.id_secp521r1 = "1.3.132.0.35"; + exports.id_sect571k1 = "1.3.132.0.38"; + exports.id_sect571r1 = "1.3.132.0.39"; +})); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/cjs/algorithms.js +var require_algorithms$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ecdsaWithSHA512 = exports.ecdsaWithSHA384 = exports.ecdsaWithSHA256 = exports.ecdsaWithSHA224 = exports.ecdsaWithSHA1 = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_x509_1 = require_cjs$9(); + const oid = tslib_1.__importStar(require_object_identifiers$2()); + function create(algorithm) { + return new asn1_x509_1.AlgorithmIdentifier({ algorithm }); + } + exports.ecdsaWithSHA1 = create(oid.id_ecdsaWithSHA1); + exports.ecdsaWithSHA224 = create(oid.id_ecdsaWithSHA224); + exports.ecdsaWithSHA256 = create(oid.id_ecdsaWithSHA256); + exports.ecdsaWithSHA384 = create(oid.id_ecdsaWithSHA384); + exports.ecdsaWithSHA512 = create(oid.id_ecdsaWithSHA512); +})); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/cjs/rfc3279.js +var require_rfc3279 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SpecifiedECDomain = exports.ECPVer = exports.Curve = exports.FieldElement = exports.ECPoint = exports.FieldID = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + let FieldID = class FieldID { + fieldType; + parameters; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.FieldID = FieldID; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], FieldID.prototype, "fieldType", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any })], FieldID.prototype, "parameters", void 0); + exports.FieldID = FieldID = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], FieldID); + var ECPoint = class extends asn1_schema_1.OctetString {}; + exports.ECPoint = ECPoint; + var FieldElement = class extends asn1_schema_1.OctetString {}; + exports.FieldElement = FieldElement; + let Curve = class Curve { + a; + b; + seed; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.Curve = Curve; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.OctetString })], Curve.prototype, "a", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.OctetString })], Curve.prototype, "b", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.BitString, + optional: true + })], Curve.prototype, "seed", void 0); + exports.Curve = Curve = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], Curve); + var ECPVer; + (function(ECPVer) { + ECPVer[ECPVer["ecpVer1"] = 1] = "ecpVer1"; + })(ECPVer || (exports.ECPVer = ECPVer = {})); + let SpecifiedECDomain = class SpecifiedECDomain { + version = ECPVer.ecpVer1; + fieldID; + curve; + base; + order; + cofactor; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SpecifiedECDomain = SpecifiedECDomain; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], SpecifiedECDomain.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: FieldID })], SpecifiedECDomain.prototype, "fieldID", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: Curve })], SpecifiedECDomain.prototype, "curve", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: ECPoint })], SpecifiedECDomain.prototype, "base", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], SpecifiedECDomain.prototype, "order", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + optional: true + })], SpecifiedECDomain.prototype, "cofactor", void 0); + exports.SpecifiedECDomain = SpecifiedECDomain = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], SpecifiedECDomain); +})); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/cjs/ec_parameters.js +var require_ec_parameters = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ECParameters = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const rfc3279_1 = require_rfc3279(); + let ECParameters = class ECParameters { + namedCurve; + implicitCurve; + specifiedCurve; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.ECParameters = ECParameters; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], ECParameters.prototype, "namedCurve", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Null })], ECParameters.prototype, "implicitCurve", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: rfc3279_1.SpecifiedECDomain })], ECParameters.prototype, "specifiedCurve", void 0); + exports.ECParameters = ECParameters = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], ECParameters); +})); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/cjs/ec_private_key.js +var require_ec_private_key = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ECPrivateKey = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const ec_parameters_1 = require_ec_parameters(); + var ECPrivateKey = class { + version = 1; + privateKey = new asn1_schema_1.OctetString(); + parameters; + publicKey; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.ECPrivateKey = ECPrivateKey; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], ECPrivateKey.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], ECPrivateKey.prototype, "privateKey", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: ec_parameters_1.ECParameters, + context: 0, + optional: true + })], ECPrivateKey.prototype, "parameters", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.BitString, + context: 1, + optional: true + })], ECPrivateKey.prototype, "publicKey", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/cjs/ec_signature_value.js +var require_ec_signature_value = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.ECDSASigValue = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var ECDSASigValue = class { + r = /* @__PURE__ */ new ArrayBuffer(0); + s = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.ECDSASigValue = ECDSASigValue; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], ECDSASigValue.prototype, "r", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], ECDSASigValue.prototype, "s", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/cjs/index.js +var require_cjs$6 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_algorithms$1(), exports); + tslib_1.__exportStar(require_ec_parameters(), exports); + tslib_1.__exportStar(require_ec_private_key(), exports); + tslib_1.__exportStar(require_ec_signature_value(), exports); + tslib_1.__exportStar(require_object_identifiers$2(), exports); + tslib_1.__exportStar(require_rfc3279(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/object_identifiers.js +var require_object_identifiers$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_mgf1 = exports.id_md5 = exports.id_md2 = exports.id_sha512_256 = exports.id_sha512_224 = exports.id_sha512 = exports.id_sha384 = exports.id_sha256 = exports.id_sha224 = exports.id_sha1 = exports.id_sha512_256WithRSAEncryption = exports.id_sha512_224WithRSAEncryption = exports.id_sha512WithRSAEncryption = exports.id_sha384WithRSAEncryption = exports.id_sha256WithRSAEncryption = exports.id_ssha224WithRSAEncryption = exports.id_sha224WithRSAEncryption = exports.id_sha1WithRSAEncryption = exports.id_md5WithRSAEncryption = exports.id_md2WithRSAEncryption = exports.id_RSASSA_PSS = exports.id_pSpecified = exports.id_RSAES_OAEP = exports.id_rsaEncryption = exports.id_pkcs_1 = void 0; + exports.id_pkcs_1 = "1.2.840.113549.1.1"; + exports.id_rsaEncryption = `${exports.id_pkcs_1}.1`; + exports.id_RSAES_OAEP = `${exports.id_pkcs_1}.7`; + exports.id_pSpecified = `${exports.id_pkcs_1}.9`; + exports.id_RSASSA_PSS = `${exports.id_pkcs_1}.10`; + exports.id_md2WithRSAEncryption = `${exports.id_pkcs_1}.2`; + exports.id_md5WithRSAEncryption = `${exports.id_pkcs_1}.4`; + exports.id_sha1WithRSAEncryption = `${exports.id_pkcs_1}.5`; + exports.id_sha224WithRSAEncryption = `${exports.id_pkcs_1}.14`; + exports.id_ssha224WithRSAEncryption = exports.id_sha224WithRSAEncryption; + exports.id_sha256WithRSAEncryption = `${exports.id_pkcs_1}.11`; + exports.id_sha384WithRSAEncryption = `${exports.id_pkcs_1}.12`; + exports.id_sha512WithRSAEncryption = `${exports.id_pkcs_1}.13`; + exports.id_sha512_224WithRSAEncryption = `${exports.id_pkcs_1}.15`; + exports.id_sha512_256WithRSAEncryption = `${exports.id_pkcs_1}.16`; + exports.id_sha1 = "1.3.14.3.2.26"; + exports.id_sha224 = "2.16.840.1.101.3.4.2.4"; + exports.id_sha256 = "2.16.840.1.101.3.4.2.1"; + exports.id_sha384 = "2.16.840.1.101.3.4.2.2"; + exports.id_sha512 = "2.16.840.1.101.3.4.2.3"; + exports.id_sha512_224 = "2.16.840.1.101.3.4.2.5"; + exports.id_sha512_256 = "2.16.840.1.101.3.4.2.6"; + exports.id_md2 = "1.2.840.113549.2.2"; + exports.id_md5 = "1.2.840.113549.2.5"; + exports.id_mgf1 = `${exports.id_pkcs_1}.8`; +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/algorithms.js +var require_algorithms = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.sha512_256WithRSAEncryption = exports.sha512_224WithRSAEncryption = exports.sha512WithRSAEncryption = exports.sha384WithRSAEncryption = exports.sha256WithRSAEncryption = exports.sha224WithRSAEncryption = exports.sha1WithRSAEncryption = exports.md5WithRSAEncryption = exports.md2WithRSAEncryption = exports.rsaEncryption = exports.pSpecifiedEmpty = exports.mgf1SHA1 = exports.sha512_256 = exports.sha512_224 = exports.sha512 = exports.sha384 = exports.sha256 = exports.sha224 = exports.sha1 = exports.md4 = exports.md2 = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const oid = tslib_1.__importStar(require_object_identifiers$1()); + function create(algorithm) { + return new asn1_x509_1.AlgorithmIdentifier({ + algorithm, + parameters: null + }); + } + exports.md2 = create(oid.id_md2); + exports.md4 = create(oid.id_md5); + exports.sha1 = create(oid.id_sha1); + exports.sha224 = create(oid.id_sha224); + exports.sha256 = create(oid.id_sha256); + exports.sha384 = create(oid.id_sha384); + exports.sha512 = create(oid.id_sha512); + exports.sha512_224 = create(oid.id_sha512_224); + exports.sha512_256 = create(oid.id_sha512_256); + exports.mgf1SHA1 = new asn1_x509_1.AlgorithmIdentifier({ + algorithm: oid.id_mgf1, + parameters: asn1_schema_1.AsnConvert.serialize(exports.sha1) + }); + exports.pSpecifiedEmpty = new asn1_x509_1.AlgorithmIdentifier({ + algorithm: oid.id_pSpecified, + parameters: asn1_schema_1.AsnConvert.serialize(asn1_schema_1.AsnOctetStringConverter.toASN(new Uint8Array([ + 218, + 57, + 163, + 238, + 94, + 107, + 75, + 13, + 50, + 85, + 191, + 239, + 149, + 96, + 24, + 144, + 175, + 216, + 7, + 9 + ]).buffer)) + }); + exports.rsaEncryption = create(oid.id_rsaEncryption); + exports.md2WithRSAEncryption = create(oid.id_md2WithRSAEncryption); + exports.md5WithRSAEncryption = create(oid.id_md5WithRSAEncryption); + exports.sha1WithRSAEncryption = create(oid.id_sha1WithRSAEncryption); + exports.sha224WithRSAEncryption = create(oid.id_sha512_224WithRSAEncryption); + exports.sha256WithRSAEncryption = create(oid.id_sha512_256WithRSAEncryption); + exports.sha384WithRSAEncryption = create(oid.id_sha384WithRSAEncryption); + exports.sha512WithRSAEncryption = create(oid.id_sha512WithRSAEncryption); + exports.sha512_224WithRSAEncryption = create(oid.id_sha512_224WithRSAEncryption); + exports.sha512_256WithRSAEncryption = create(oid.id_sha512_256WithRSAEncryption); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsaes_oaep.js +var require_rsaes_oaep = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RSAES_OAEP = exports.RsaEsOaepParams = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const object_identifiers_1 = require_object_identifiers$1(); + const algorithms_1 = require_algorithms(); + var RsaEsOaepParams = class { + hashAlgorithm = new asn1_x509_1.AlgorithmIdentifier(algorithms_1.sha1); + maskGenAlgorithm = new asn1_x509_1.AlgorithmIdentifier({ + algorithm: object_identifiers_1.id_mgf1, + parameters: asn1_schema_1.AsnConvert.serialize(algorithms_1.sha1) + }); + pSourceAlgorithm = new asn1_x509_1.AlgorithmIdentifier(algorithms_1.pSpecifiedEmpty); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RsaEsOaepParams = RsaEsOaepParams; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.AlgorithmIdentifier, + context: 0, + defaultValue: algorithms_1.sha1 + })], RsaEsOaepParams.prototype, "hashAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.AlgorithmIdentifier, + context: 1, + defaultValue: algorithms_1.mgf1SHA1 + })], RsaEsOaepParams.prototype, "maskGenAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.AlgorithmIdentifier, + context: 2, + defaultValue: algorithms_1.pSpecifiedEmpty + })], RsaEsOaepParams.prototype, "pSourceAlgorithm", void 0); + exports.RSAES_OAEP = new asn1_x509_1.AlgorithmIdentifier({ + algorithm: object_identifiers_1.id_RSAES_OAEP, + parameters: asn1_schema_1.AsnConvert.serialize(new RsaEsOaepParams()) + }); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsassa_pss.js +var require_rsassa_pss = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RSASSA_PSS = exports.RsaSaPssParams = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const object_identifiers_1 = require_object_identifiers$1(); + const algorithms_1 = require_algorithms(); + var RsaSaPssParams = class { + hashAlgorithm = new asn1_x509_1.AlgorithmIdentifier(algorithms_1.sha1); + maskGenAlgorithm = new asn1_x509_1.AlgorithmIdentifier({ + algorithm: object_identifiers_1.id_mgf1, + parameters: asn1_schema_1.AsnConvert.serialize(algorithms_1.sha1) + }); + saltLength = 20; + trailerField = 1; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RsaSaPssParams = RsaSaPssParams; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.AlgorithmIdentifier, + context: 0, + defaultValue: algorithms_1.sha1 + })], RsaSaPssParams.prototype, "hashAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_x509_1.AlgorithmIdentifier, + context: 1, + defaultValue: algorithms_1.mgf1SHA1 + })], RsaSaPssParams.prototype, "maskGenAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 2, + defaultValue: 20 + })], RsaSaPssParams.prototype, "saltLength", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + context: 3, + defaultValue: 1 + })], RsaSaPssParams.prototype, "trailerField", void 0); + exports.RSASSA_PSS = new asn1_x509_1.AlgorithmIdentifier({ + algorithm: object_identifiers_1.id_RSASSA_PSS, + parameters: asn1_schema_1.AsnConvert.serialize(new RsaSaPssParams()) + }); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/parameters/rsassa_pkcs1_v1_5.js +var require_rsassa_pkcs1_v1_5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DigestInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_x509_1 = require_cjs$9(); + const asn1_schema_1 = require_cjs$10(); + var DigestInfo = class { + digestAlgorithm = new asn1_x509_1.AlgorithmIdentifier(); + digest = new asn1_schema_1.OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.DigestInfo = DigestInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], DigestInfo.prototype, "digestAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], DigestInfo.prototype, "digest", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/parameters/index.js +var require_parameters = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_rsaes_oaep(), exports); + tslib_1.__exportStar(require_rsassa_pss(), exports); + tslib_1.__exportStar(require_rsassa_pkcs1_v1_5(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/other_prime_info.js +var require_other_prime_info = /* @__PURE__ */ __commonJSMin(((exports) => { + var OtherPrimeInfos_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.OtherPrimeInfos = exports.OtherPrimeInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var OtherPrimeInfo = class { + prime = /* @__PURE__ */ new ArrayBuffer(0); + exponent = /* @__PURE__ */ new ArrayBuffer(0); + coefficient = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.OtherPrimeInfo = OtherPrimeInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], OtherPrimeInfo.prototype, "prime", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], OtherPrimeInfo.prototype, "exponent", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], OtherPrimeInfo.prototype, "coefficient", void 0); + let OtherPrimeInfos = OtherPrimeInfos_1 = class OtherPrimeInfos extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, OtherPrimeInfos_1.prototype); + } + }; + exports.OtherPrimeInfos = OtherPrimeInfos; + exports.OtherPrimeInfos = OtherPrimeInfos = OtherPrimeInfos_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: OtherPrimeInfo + })], OtherPrimeInfos); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/rsa_private_key.js +var require_rsa_private_key = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RSAPrivateKey = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const other_prime_info_1 = require_other_prime_info(); + var RSAPrivateKey = class { + version = 0; + modulus = /* @__PURE__ */ new ArrayBuffer(0); + publicExponent = /* @__PURE__ */ new ArrayBuffer(0); + privateExponent = /* @__PURE__ */ new ArrayBuffer(0); + prime1 = /* @__PURE__ */ new ArrayBuffer(0); + prime2 = /* @__PURE__ */ new ArrayBuffer(0); + exponent1 = /* @__PURE__ */ new ArrayBuffer(0); + exponent2 = /* @__PURE__ */ new ArrayBuffer(0); + coefficient = /* @__PURE__ */ new ArrayBuffer(0); + otherPrimeInfos; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RSAPrivateKey = RSAPrivateKey; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], RSAPrivateKey.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "modulus", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "publicExponent", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "privateExponent", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "prime1", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "prime2", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "exponent1", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "exponent2", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPrivateKey.prototype, "coefficient", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: other_prime_info_1.OtherPrimeInfos, + optional: true + })], RSAPrivateKey.prototype, "otherPrimeInfos", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/rsa_public_key.js +var require_rsa_public_key = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RSAPublicKey = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var RSAPublicKey = class { + modulus = /* @__PURE__ */ new ArrayBuffer(0); + publicExponent = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.RSAPublicKey = RSAPublicKey; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPublicKey.prototype, "modulus", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + converter: asn1_schema_1.AsnIntegerArrayBufferConverter + })], RSAPublicKey.prototype, "publicExponent", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/cjs/index.js +var require_cjs$5 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_parameters(), exports); + tslib_1.__exportStar(require_algorithms(), exports); + tslib_1.__exportStar(require_object_identifiers$1(), exports); + tslib_1.__exportStar(require_other_prime_info(), exports); + tslib_1.__exportStar(require_rsa_private_key(), exports); + tslib_1.__exportStar(require_rsa_public_key(), exports); +})); +//#endregion +//#region node_modules/tsyringe/node_modules/tslib/tslib.es6.js +var tslib_es6_exports = /* @__PURE__ */ __exportAll({ + __assign: () => __assign, + __asyncDelegator: () => __asyncDelegator, + __asyncGenerator: () => __asyncGenerator, + __asyncValues: () => __asyncValues, + __await: () => __await, + __awaiter: () => __awaiter, + __classPrivateFieldGet: () => __classPrivateFieldGet, + __classPrivateFieldSet: () => __classPrivateFieldSet, + __createBinding: () => __createBinding, + __decorate: () => __decorate, + __exportStar: () => __exportStar, + __extends: () => __extends, + __generator: () => __generator, + __importDefault: () => __importDefault, + __importStar: () => __importStar, + __makeTemplateObject: () => __makeTemplateObject, + __metadata: () => __metadata, + __param: () => __param, + __read: () => __read, + __rest: () => __rest, + __spread: () => __spread, + __spreadArrays: () => __spreadArrays, + __values: () => __values +}); +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +function __extends(d, b) { + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") { + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; + } + return t; +} +function __decorate(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; +} +function __param(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; +} +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { + label: 0, + sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [] + }, f, y, t, g; + return g = { + next: verb(0), + "throw": verb(1), + "return": verb(2) + }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { + value: op[1], + done: false + }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { + value: op[0] ? op[1] : void 0, + done: true + }; + } +} +function __createBinding(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; +} +function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { next: function() { + if (o && i >= o.length) o = void 0; + return { + value: o && o[i++], + done: !o + }; + } }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } catch (error) { + e = { error }; + } finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } finally { + if (e) throw e.error; + } + } + return ar; +} +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +} +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; + return r; +} +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([ + n, + v, + a, + b + ]) > 1 || resume(n, v); + }); + }; + } + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } + } + function step(r) { + r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + } + function fulfill(value) { + resume("next", value); + } + function reject(value) { + resume("throw", value); + } + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + } +} +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function(e) { + throw e; + }), verb("return"), i[Symbol.iterator] = function() { + return this; + }, i; + function verb(n, f) { + i[n] = o[n] ? function(v) { + return (p = !p) ? { + value: __await(o[n](v)), + done: n === "return" + } : f ? f(v) : v; + } : f; + } +} +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i); + function verb(n) { + i[n] = o[n] && function(v) { + return new Promise(function(resolve, reject) { + v = o[n](v), settle(resolve, reject, v.done, v.value); + }); + }; + } + function settle(resolve, reject, d, v) { + Promise.resolve(v).then(function(v) { + resolve({ + value: v, + done: d + }); + }, reject); + } +} +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) Object.defineProperty(cooked, "raw", { value: raw }); + else cooked.raw = raw; + return cooked; +} +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + } + result.default = mod; + return result; +} +function __importDefault(mod) { + return mod && mod.__esModule ? mod : { default: mod }; +} +function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) throw new TypeError("attempted to get private field on non-instance"); + return privateMap.get(receiver); +} +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) throw new TypeError("attempted to set private field on non-instance"); + privateMap.set(receiver, value); + return value; +} +var extendStatics, __assign; +var init_tslib_es6 = __esmMin((() => { + extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { + d.__proto__ = b; + } || function(d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + }; + return extendStatics(d, b); + }; + __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/types/lifecycle.js +var require_lifecycle = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var Lifecycle; + (function(Lifecycle) { + Lifecycle[Lifecycle["Transient"] = 0] = "Transient"; + Lifecycle[Lifecycle["Singleton"] = 1] = "Singleton"; + Lifecycle[Lifecycle["ResolutionScoped"] = 2] = "ResolutionScoped"; + Lifecycle[Lifecycle["ContainerScoped"] = 3] = "ContainerScoped"; + })(Lifecycle || (Lifecycle = {})); + exports.default = Lifecycle; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/types/index.js +var require_types$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var lifecycle_1 = require_lifecycle(); + Object.defineProperty(exports, "Lifecycle", { + enumerable: true, + get: function() { + return lifecycle_1.default; + } + }); +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/reflection-helpers.js +var require_reflection_helpers = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.defineInjectionTokenMetadata = exports.getParamInfo = exports.INJECTION_TOKEN_METADATA_KEY = void 0; + exports.INJECTION_TOKEN_METADATA_KEY = "injectionTokens"; + function getParamInfo(target) { + const params = Reflect.getMetadata("design:paramtypes", target) || []; + const injectionTokens = Reflect.getOwnMetadata(exports.INJECTION_TOKEN_METADATA_KEY, target) || {}; + Object.keys(injectionTokens).forEach((key) => { + params[+key] = injectionTokens[key]; + }); + return params; + } + exports.getParamInfo = getParamInfo; + function defineInjectionTokenMetadata(data, transform) { + return function(target, _propertyKey, parameterIndex) { + const descriptors = Reflect.getOwnMetadata(exports.INJECTION_TOKEN_METADATA_KEY, target) || {}; + descriptors[parameterIndex] = transform ? { + token: data, + transform: transform.transformToken, + transformArgs: transform.args || [] + } : data; + Reflect.defineMetadata(exports.INJECTION_TOKEN_METADATA_KEY, descriptors, target); + }; + } + exports.defineInjectionTokenMetadata = defineInjectionTokenMetadata; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/providers/class-provider.js +var require_class_provider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isClassProvider = void 0; + function isClassProvider(provider) { + return !!provider.useClass; + } + exports.isClassProvider = isClassProvider; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/providers/factory-provider.js +var require_factory_provider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isFactoryProvider = void 0; + function isFactoryProvider(provider) { + return !!provider.useFactory; + } + exports.isFactoryProvider = isFactoryProvider; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/lazy-helpers.js +var require_lazy_helpers = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.delay = exports.DelayedConstructor = void 0; + var DelayedConstructor = class { + constructor(wrap) { + this.wrap = wrap; + this.reflectMethods = [ + "get", + "getPrototypeOf", + "setPrototypeOf", + "getOwnPropertyDescriptor", + "defineProperty", + "has", + "set", + "deleteProperty", + "apply", + "construct", + "ownKeys" + ]; + } + createProxy(createObject) { + const target = {}; + let init = false; + let value; + const delayedObject = () => { + if (!init) { + value = createObject(this.wrap()); + init = true; + } + return value; + }; + return new Proxy(target, this.createHandler(delayedObject)); + } + createHandler(delayedObject) { + const handler = {}; + const install = (name) => { + handler[name] = (...args) => { + args[0] = delayedObject(); + const method = Reflect[name]; + return method(...args); + }; + }; + this.reflectMethods.forEach(install); + return handler; + } + }; + exports.DelayedConstructor = DelayedConstructor; + function delay(wrappedConstructor) { + if (typeof wrappedConstructor === "undefined") throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback"); + return new DelayedConstructor(wrappedConstructor); + } + exports.delay = delay; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/providers/injection-token.js +var require_injection_token = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isConstructorToken = exports.isTransformDescriptor = exports.isTokenDescriptor = exports.isNormalToken = void 0; + const lazy_helpers_1 = require_lazy_helpers(); + function isNormalToken(token) { + return typeof token === "string" || typeof token === "symbol"; + } + exports.isNormalToken = isNormalToken; + function isTokenDescriptor(descriptor) { + return typeof descriptor === "object" && "token" in descriptor && "multiple" in descriptor; + } + exports.isTokenDescriptor = isTokenDescriptor; + function isTransformDescriptor(descriptor) { + return typeof descriptor === "object" && "token" in descriptor && "transform" in descriptor; + } + exports.isTransformDescriptor = isTransformDescriptor; + function isConstructorToken(token) { + return typeof token === "function" || token instanceof lazy_helpers_1.DelayedConstructor; + } + exports.isConstructorToken = isConstructorToken; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/providers/token-provider.js +var require_token_provider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isTokenProvider = void 0; + function isTokenProvider(provider) { + return !!provider.useToken; + } + exports.isTokenProvider = isTokenProvider; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/providers/value-provider.js +var require_value_provider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isValueProvider = void 0; + function isValueProvider(provider) { + return provider.useValue != void 0; + } + exports.isValueProvider = isValueProvider; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/providers/index.js +var require_providers = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var class_provider_1 = require_class_provider(); + Object.defineProperty(exports, "isClassProvider", { + enumerable: true, + get: function() { + return class_provider_1.isClassProvider; + } + }); + var factory_provider_1 = require_factory_provider(); + Object.defineProperty(exports, "isFactoryProvider", { + enumerable: true, + get: function() { + return factory_provider_1.isFactoryProvider; + } + }); + var injection_token_1 = require_injection_token(); + Object.defineProperty(exports, "isNormalToken", { + enumerable: true, + get: function() { + return injection_token_1.isNormalToken; + } + }); + var token_provider_1 = require_token_provider(); + Object.defineProperty(exports, "isTokenProvider", { + enumerable: true, + get: function() { + return token_provider_1.isTokenProvider; + } + }); + var value_provider_1 = require_value_provider(); + Object.defineProperty(exports, "isValueProvider", { + enumerable: true, + get: function() { + return value_provider_1.isValueProvider; + } + }); +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/providers/provider.js +var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isProvider = void 0; + const class_provider_1 = require_class_provider(); + const value_provider_1 = require_value_provider(); + const token_provider_1 = require_token_provider(); + const factory_provider_1 = require_factory_provider(); + function isProvider(provider) { + return class_provider_1.isClassProvider(provider) || value_provider_1.isValueProvider(provider) || token_provider_1.isTokenProvider(provider) || factory_provider_1.isFactoryProvider(provider); + } + exports.isProvider = isProvider; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/registry-base.js +var require_registry_base = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var RegistryBase = class { + constructor() { + this._registryMap = /* @__PURE__ */ new Map(); + } + entries() { + return this._registryMap.entries(); + } + getAll(key) { + this.ensure(key); + return this._registryMap.get(key); + } + get(key) { + this.ensure(key); + const value = this._registryMap.get(key); + return value[value.length - 1] || null; + } + set(key, value) { + this.ensure(key); + this._registryMap.get(key).push(value); + } + setAll(key, value) { + this._registryMap.set(key, value); + } + has(key) { + this.ensure(key); + return this._registryMap.get(key).length > 0; + } + clear() { + this._registryMap.clear(); + } + ensure(key) { + if (!this._registryMap.has(key)) this._registryMap.set(key, []); + } + }; + exports.default = RegistryBase; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/registry.js +var require_registry$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const registry_base_1 = require_registry_base(); + var Registry = class extends registry_base_1.default {}; + exports.default = Registry; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/resolution-context.js +var require_resolution_context = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var ResolutionContext = class { + constructor() { + this.scopedResolutions = /* @__PURE__ */ new Map(); + } + }; + exports.default = ResolutionContext; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/error-helpers.js +var require_error_helpers = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.formatErrorCtor = void 0; + function formatDependency(params, idx) { + if (params === null) return `at position #${idx}`; + return `"${params.split(",")[idx].trim()}" at position #${idx}`; + } + function composeErrorMessage(msg, e, indent = " ") { + return [msg, ...e.message.split("\n").map((l) => indent + l)].join("\n"); + } + function formatErrorCtor(ctor, paramIdx, error) { + const [, params = null] = ctor.toString().match(/constructor\(([\w, ]+)\)/) || []; + return composeErrorMessage(`Cannot inject the dependency ${formatDependency(params, paramIdx)} of "${ctor.name}" constructor. Reason:`, error); + } + exports.formatErrorCtor = formatErrorCtor; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/types/disposable.js +var require_disposable = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.isDisposable = void 0; + function isDisposable(value) { + if (typeof value.dispose !== "function") return false; + if (value.dispose.length > 0) return false; + return true; + } + exports.isDisposable = isDisposable; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/interceptors.js +var require_interceptors = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PostResolutionInterceptors = exports.PreResolutionInterceptors = void 0; + const registry_base_1 = require_registry_base(); + var PreResolutionInterceptors = class extends registry_base_1.default {}; + exports.PreResolutionInterceptors = PreResolutionInterceptors; + var PostResolutionInterceptors = class extends registry_base_1.default {}; + exports.PostResolutionInterceptors = PostResolutionInterceptors; + var Interceptors = class { + constructor() { + this.preResolution = new PreResolutionInterceptors(); + this.postResolution = new PostResolutionInterceptors(); + } + }; + exports.default = Interceptors; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/dependency-container.js +var require_dependency_container = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.instance = exports.typeInfo = void 0; + const tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + const providers_1 = require_providers(); + const provider_1 = require_provider(); + const injection_token_1 = require_injection_token(); + const registry_1 = require_registry$1(); + const lifecycle_1 = require_lifecycle(); + const resolution_context_1 = require_resolution_context(); + const error_helpers_1 = require_error_helpers(); + const lazy_helpers_1 = require_lazy_helpers(); + const disposable_1 = require_disposable(); + const interceptors_1 = require_interceptors(); + exports.typeInfo = /* @__PURE__ */ new Map(); + exports.instance = new class InternalDependencyContainer { + constructor(parent) { + this.parent = parent; + this._registry = new registry_1.default(); + this.interceptors = new interceptors_1.default(); + this.disposed = false; + this.disposables = /* @__PURE__ */ new Set(); + } + register(token, providerOrConstructor, options = { lifecycle: lifecycle_1.default.Transient }) { + this.ensureNotDisposed(); + let provider; + if (!provider_1.isProvider(providerOrConstructor)) provider = { useClass: providerOrConstructor }; + else provider = providerOrConstructor; + if (providers_1.isTokenProvider(provider)) { + const path = [token]; + let tokenProvider = provider; + while (tokenProvider != null) { + const currentToken = tokenProvider.useToken; + if (path.includes(currentToken)) throw new Error(`Token registration cycle detected! ${[...path, currentToken].join(" -> ")}`); + path.push(currentToken); + const registration = this._registry.get(currentToken); + if (registration && providers_1.isTokenProvider(registration.provider)) tokenProvider = registration.provider; + else tokenProvider = null; + } + } + if (options.lifecycle === lifecycle_1.default.Singleton || options.lifecycle == lifecycle_1.default.ContainerScoped || options.lifecycle == lifecycle_1.default.ResolutionScoped) { + if (providers_1.isValueProvider(provider) || providers_1.isFactoryProvider(provider)) throw new Error(`Cannot use lifecycle "${lifecycle_1.default[options.lifecycle]}" with ValueProviders or FactoryProviders`); + } + this._registry.set(token, { + provider, + options + }); + return this; + } + registerType(from, to) { + this.ensureNotDisposed(); + if (providers_1.isNormalToken(to)) return this.register(from, { useToken: to }); + return this.register(from, { useClass: to }); + } + registerInstance(token, instance) { + this.ensureNotDisposed(); + return this.register(token, { useValue: instance }); + } + registerSingleton(from, to) { + this.ensureNotDisposed(); + if (providers_1.isNormalToken(from)) { + if (providers_1.isNormalToken(to)) return this.register(from, { useToken: to }, { lifecycle: lifecycle_1.default.Singleton }); + else if (to) return this.register(from, { useClass: to }, { lifecycle: lifecycle_1.default.Singleton }); + throw new Error("Cannot register a type name as a singleton without a \"to\" token"); + } + let useClass = from; + if (to && !providers_1.isNormalToken(to)) useClass = to; + return this.register(from, { useClass }, { lifecycle: lifecycle_1.default.Singleton }); + } + resolve(token, context = new resolution_context_1.default(), isOptional = false) { + this.ensureNotDisposed(); + const registration = this.getRegistration(token); + if (!registration && providers_1.isNormalToken(token)) { + if (isOptional) return; + throw new Error(`Attempted to resolve unregistered dependency token: "${token.toString()}"`); + } + this.executePreResolutionInterceptor(token, "Single"); + if (registration) { + const result = this.resolveRegistration(registration, context); + this.executePostResolutionInterceptor(token, result, "Single"); + return result; + } + if (injection_token_1.isConstructorToken(token)) { + const result = this.construct(token, context); + this.executePostResolutionInterceptor(token, result, "Single"); + return result; + } + throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function."); + } + executePreResolutionInterceptor(token, resolutionType) { + if (this.interceptors.preResolution.has(token)) { + const remainingInterceptors = []; + for (const interceptor of this.interceptors.preResolution.getAll(token)) { + if (interceptor.options.frequency != "Once") remainingInterceptors.push(interceptor); + interceptor.callback(token, resolutionType); + } + this.interceptors.preResolution.setAll(token, remainingInterceptors); + } + } + executePostResolutionInterceptor(token, result, resolutionType) { + if (this.interceptors.postResolution.has(token)) { + const remainingInterceptors = []; + for (const interceptor of this.interceptors.postResolution.getAll(token)) { + if (interceptor.options.frequency != "Once") remainingInterceptors.push(interceptor); + interceptor.callback(token, result, resolutionType); + } + this.interceptors.postResolution.setAll(token, remainingInterceptors); + } + } + resolveRegistration(registration, context) { + this.ensureNotDisposed(); + if (registration.options.lifecycle === lifecycle_1.default.ResolutionScoped && context.scopedResolutions.has(registration)) return context.scopedResolutions.get(registration); + const isSingleton = registration.options.lifecycle === lifecycle_1.default.Singleton; + const isContainerScoped = registration.options.lifecycle === lifecycle_1.default.ContainerScoped; + const returnInstance = isSingleton || isContainerScoped; + let resolved; + if (providers_1.isValueProvider(registration.provider)) resolved = registration.provider.useValue; + else if (providers_1.isTokenProvider(registration.provider)) resolved = returnInstance ? registration.instance || (registration.instance = this.resolve(registration.provider.useToken, context)) : this.resolve(registration.provider.useToken, context); + else if (providers_1.isClassProvider(registration.provider)) resolved = returnInstance ? registration.instance || (registration.instance = this.construct(registration.provider.useClass, context)) : this.construct(registration.provider.useClass, context); + else if (providers_1.isFactoryProvider(registration.provider)) resolved = registration.provider.useFactory(this); + else resolved = this.construct(registration.provider, context); + if (registration.options.lifecycle === lifecycle_1.default.ResolutionScoped) context.scopedResolutions.set(registration, resolved); + return resolved; + } + resolveAll(token, context = new resolution_context_1.default(), isOptional = false) { + this.ensureNotDisposed(); + const registrations = this.getAllRegistrations(token); + if (!registrations && providers_1.isNormalToken(token)) { + if (isOptional) return []; + throw new Error(`Attempted to resolve unregistered dependency token: "${token.toString()}"`); + } + this.executePreResolutionInterceptor(token, "All"); + if (registrations) { + const result = registrations.map((item) => this.resolveRegistration(item, context)); + this.executePostResolutionInterceptor(token, result, "All"); + return result; + } + const result = [this.construct(token, context)]; + this.executePostResolutionInterceptor(token, result, "All"); + return result; + } + isRegistered(token, recursive = false) { + this.ensureNotDisposed(); + return this._registry.has(token) || recursive && (this.parent || false) && this.parent.isRegistered(token, true); + } + reset() { + this.ensureNotDisposed(); + this._registry.clear(); + this.interceptors.preResolution.clear(); + this.interceptors.postResolution.clear(); + } + clearInstances() { + this.ensureNotDisposed(); + for (const [token, registrations] of this._registry.entries()) this._registry.setAll(token, registrations.filter((registration) => !providers_1.isValueProvider(registration.provider)).map((registration) => { + registration.instance = void 0; + return registration; + })); + } + createChildContainer() { + this.ensureNotDisposed(); + const childContainer = new InternalDependencyContainer(this); + for (const [token, registrations] of this._registry.entries()) if (registrations.some(({ options }) => options.lifecycle === lifecycle_1.default.ContainerScoped)) childContainer._registry.setAll(token, registrations.map((registration) => { + if (registration.options.lifecycle === lifecycle_1.default.ContainerScoped) return { + provider: registration.provider, + options: registration.options + }; + return registration; + })); + return childContainer; + } + beforeResolution(token, callback, options = { frequency: "Always" }) { + this.interceptors.preResolution.set(token, { + callback, + options + }); + } + afterResolution(token, callback, options = { frequency: "Always" }) { + this.interceptors.postResolution.set(token, { + callback, + options + }); + } + dispose() { + return tslib_1.__awaiter(this, void 0, void 0, function* () { + this.disposed = true; + const promises = []; + this.disposables.forEach((disposable) => { + const maybePromise = disposable.dispose(); + if (maybePromise) promises.push(maybePromise); + }); + yield Promise.all(promises); + }); + } + getRegistration(token) { + if (this.isRegistered(token)) return this._registry.get(token); + if (this.parent) return this.parent.getRegistration(token); + return null; + } + getAllRegistrations(token) { + if (this.isRegistered(token)) return this._registry.getAll(token); + if (this.parent) return this.parent.getAllRegistrations(token); + return null; + } + construct(ctor, context) { + if (ctor instanceof lazy_helpers_1.DelayedConstructor) return ctor.createProxy((target) => this.resolve(target, context)); + const instance = (() => { + const paramInfo = exports.typeInfo.get(ctor); + if (!paramInfo || paramInfo.length === 0) if (ctor.length === 0) return new ctor(); + else throw new Error(`TypeInfo not known for "${ctor.name}"`); + return new ctor(...paramInfo.map(this.resolveParams(context, ctor))); + })(); + if (disposable_1.isDisposable(instance)) this.disposables.add(instance); + return instance; + } + resolveParams(context, ctor) { + return (param, idx) => { + try { + if (injection_token_1.isTokenDescriptor(param)) if (injection_token_1.isTransformDescriptor(param)) return param.multiple ? this.resolve(param.transform).transform(this.resolveAll(param.token, new resolution_context_1.default(), param.isOptional), ...param.transformArgs) : this.resolve(param.transform).transform(this.resolve(param.token, context, param.isOptional), ...param.transformArgs); + else return param.multiple ? this.resolveAll(param.token, new resolution_context_1.default(), param.isOptional) : this.resolve(param.token, context, param.isOptional); + else if (injection_token_1.isTransformDescriptor(param)) return this.resolve(param.transform, context).transform(this.resolve(param.token, context), ...param.transformArgs); + return this.resolve(param, context); + } catch (e) { + throw new Error(error_helpers_1.formatErrorCtor(ctor, idx, e)); + } + }; + } + ensureNotDisposed() { + if (this.disposed) throw new Error("This container has been disposed, you cannot interact with a disposed container"); + } + }(); + exports.default = exports.instance; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/auto-injectable.js +var require_auto_injectable = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const reflection_helpers_1 = require_reflection_helpers(); + const dependency_container_1 = require_dependency_container(); + const injection_token_1 = require_injection_token(); + const error_helpers_1 = require_error_helpers(); + function autoInjectable() { + return function(target) { + const paramInfo = reflection_helpers_1.getParamInfo(target); + return class extends target { + constructor(...args) { + super(...args.concat(paramInfo.slice(args.length).map((type, index) => { + try { + if (injection_token_1.isTokenDescriptor(type)) if (injection_token_1.isTransformDescriptor(type)) return type.multiple ? dependency_container_1.instance.resolve(type.transform).transform(dependency_container_1.instance.resolveAll(type.token), ...type.transformArgs) : dependency_container_1.instance.resolve(type.transform).transform(dependency_container_1.instance.resolve(type.token), ...type.transformArgs); + else return type.multiple ? dependency_container_1.instance.resolveAll(type.token) : dependency_container_1.instance.resolve(type.token); + else if (injection_token_1.isTransformDescriptor(type)) return dependency_container_1.instance.resolve(type.transform).transform(dependency_container_1.instance.resolve(type.token), ...type.transformArgs); + return dependency_container_1.instance.resolve(type); + } catch (e) { + const argIndex = index + args.length; + throw new Error(error_helpers_1.formatErrorCtor(target, argIndex, e)); + } + }))); + } + }; + }; + } + exports.default = autoInjectable; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/inject.js +var require_inject = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const reflection_helpers_1 = require_reflection_helpers(); + function inject(token, options) { + const data = { + token, + multiple: false, + isOptional: options && options.isOptional + }; + return reflection_helpers_1.defineInjectionTokenMetadata(data); + } + exports.default = inject; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/injectable.js +var require_injectable = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const reflection_helpers_1 = require_reflection_helpers(); + const dependency_container_1 = require_dependency_container(); + const dependency_container_2 = require_dependency_container(); + function injectable(options) { + return function(target) { + dependency_container_1.typeInfo.set(target, reflection_helpers_1.getParamInfo(target)); + if (options && options.token) if (!Array.isArray(options.token)) dependency_container_2.instance.register(options.token, target); + else options.token.forEach((token) => { + dependency_container_2.instance.register(token, target); + }); + }; + } + exports.default = injectable; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/registry.js +var require_registry = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + const dependency_container_1 = require_dependency_container(); + function registry(registrations = []) { + return function(target) { + registrations.forEach((_a) => { + var { token, options } = _a, provider = tslib_1.__rest(_a, ["token", "options"]); + return dependency_container_1.instance.register(token, provider, options); + }); + return target; + }; + } + exports.default = registry; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/singleton.js +var require_singleton = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const injectable_1 = require_injectable(); + const dependency_container_1 = require_dependency_container(); + function singleton() { + return function(target) { + injectable_1.default()(target); + dependency_container_1.instance.registerSingleton(target); + }; + } + exports.default = singleton; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/inject-all.js +var require_inject_all = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const reflection_helpers_1 = require_reflection_helpers(); + function injectAll(token, options) { + const data = { + token, + multiple: true, + isOptional: options && options.isOptional + }; + return reflection_helpers_1.defineInjectionTokenMetadata(data); + } + exports.default = injectAll; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/inject-all-with-transform.js +var require_inject_all_with_transform = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const reflection_helpers_1 = require_reflection_helpers(); + function injectAllWithTransform(token, transformer, ...args) { + const data = { + token, + multiple: true, + transform: transformer, + transformArgs: args + }; + return reflection_helpers_1.defineInjectionTokenMetadata(data); + } + exports.default = injectAllWithTransform; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/inject-with-transform.js +var require_inject_with_transform = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const reflection_helpers_1 = require_reflection_helpers(); + function injectWithTransform(token, transformer, ...args) { + return reflection_helpers_1.defineInjectionTokenMetadata(token, { + transformToken: transformer, + args + }); + } + exports.default = injectWithTransform; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/scoped.js +var require_scoped = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const injectable_1 = require_injectable(); + const dependency_container_1 = require_dependency_container(); + function scoped(lifecycle, token) { + return function(target) { + injectable_1.default()(target); + dependency_container_1.instance.register(token || target, target, { lifecycle }); + }; + } + exports.default = scoped; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/decorators/index.js +var require_decorators = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var auto_injectable_1 = require_auto_injectable(); + Object.defineProperty(exports, "autoInjectable", { + enumerable: true, + get: function() { + return auto_injectable_1.default; + } + }); + var inject_1 = require_inject(); + Object.defineProperty(exports, "inject", { + enumerable: true, + get: function() { + return inject_1.default; + } + }); + var injectable_1 = require_injectable(); + Object.defineProperty(exports, "injectable", { + enumerable: true, + get: function() { + return injectable_1.default; + } + }); + var registry_1 = require_registry(); + Object.defineProperty(exports, "registry", { + enumerable: true, + get: function() { + return registry_1.default; + } + }); + var singleton_1 = require_singleton(); + Object.defineProperty(exports, "singleton", { + enumerable: true, + get: function() { + return singleton_1.default; + } + }); + var inject_all_1 = require_inject_all(); + Object.defineProperty(exports, "injectAll", { + enumerable: true, + get: function() { + return inject_all_1.default; + } + }); + var inject_all_with_transform_1 = require_inject_all_with_transform(); + Object.defineProperty(exports, "injectAllWithTransform", { + enumerable: true, + get: function() { + return inject_all_with_transform_1.default; + } + }); + var inject_with_transform_1 = require_inject_with_transform(); + Object.defineProperty(exports, "injectWithTransform", { + enumerable: true, + get: function() { + return inject_with_transform_1.default; + } + }); + var scoped_1 = require_scoped(); + Object.defineProperty(exports, "scoped", { + enumerable: true, + get: function() { + return scoped_1.default; + } + }); +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/factories/instance-caching-factory.js +var require_instance_caching_factory = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + function instanceCachingFactory(factoryFunc) { + let instance; + return (dependencyContainer) => { + if (instance == void 0) instance = factoryFunc(dependencyContainer); + return instance; + }; + } + exports.default = instanceCachingFactory; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/factories/instance-per-container-caching-factory.js +var require_instance_per_container_caching_factory = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + function instancePerContainerCachingFactory(factoryFunc) { + const cache = /* @__PURE__ */ new WeakMap(); + return (dependencyContainer) => { + let instance = cache.get(dependencyContainer); + if (instance == void 0) { + instance = factoryFunc(dependencyContainer); + cache.set(dependencyContainer, instance); + } + return instance; + }; + } + exports.default = instancePerContainerCachingFactory; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/factories/predicate-aware-class-factory.js +var require_predicate_aware_class_factory = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + function predicateAwareClassFactory(predicate, trueConstructor, falseConstructor, useCaching = true) { + let instance; + let previousPredicate; + return (dependencyContainer) => { + const currentPredicate = predicate(dependencyContainer); + if (!useCaching || previousPredicate !== currentPredicate) if (previousPredicate = currentPredicate) instance = dependencyContainer.resolve(trueConstructor); + else instance = dependencyContainer.resolve(falseConstructor); + return instance; + }; + } + exports.default = predicateAwareClassFactory; +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/factories/index.js +var require_factories = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + var instance_caching_factory_1 = require_instance_caching_factory(); + Object.defineProperty(exports, "instanceCachingFactory", { + enumerable: true, + get: function() { + return instance_caching_factory_1.default; + } + }); + var instance_per_container_caching_factory_1 = require_instance_per_container_caching_factory(); + Object.defineProperty(exports, "instancePerContainerCachingFactory", { + enumerable: true, + get: function() { + return instance_per_container_caching_factory_1.default; + } + }); + var predicate_aware_class_factory_1 = require_predicate_aware_class_factory(); + Object.defineProperty(exports, "predicateAwareClassFactory", { + enumerable: true, + get: function() { + return predicate_aware_class_factory_1.default; + } + }); +})); +//#endregion +//#region node_modules/tsyringe/dist/cjs/index.js +var require_cjs$4 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + if (typeof Reflect === "undefined" || !Reflect.getMetadata) throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`); + var types_1 = require_types$1(); + Object.defineProperty(exports, "Lifecycle", { + enumerable: true, + get: function() { + return types_1.Lifecycle; + } + }); + tslib_1.__exportStar(require_decorators(), exports); + tslib_1.__exportStar(require_factories(), exports); + tslib_1.__exportStar(require_providers(), exports); + var lazy_helpers_1 = require_lazy_helpers(); + Object.defineProperty(exports, "delay", { + enumerable: true, + get: function() { + return lazy_helpers_1.delay; + } + }); + var dependency_container_1 = require_dependency_container(); + Object.defineProperty(exports, "container", { + enumerable: true, + get: function() { + return dependency_container_1.instance; + } + }); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/attribute.js +var require_attribute = /* @__PURE__ */ __commonJSMin(((exports) => { + var PKCS12AttrSet_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PKCS12AttrSet = exports.PKCS12Attribute = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var PKCS12Attribute = class { + attrId = ""; + attrValues = []; + constructor(params = {}) { + Object.assign(params); + } + }; + exports.PKCS12Attribute = PKCS12Attribute; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], PKCS12Attribute.prototype, "attrId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + repeated: "set" + })], PKCS12Attribute.prototype, "attrValues", void 0); + let PKCS12AttrSet = PKCS12AttrSet_1 = class PKCS12AttrSet extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, PKCS12AttrSet_1.prototype); + } + }; + exports.PKCS12AttrSet = PKCS12AttrSet; + exports.PKCS12AttrSet = PKCS12AttrSet = PKCS12AttrSet_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: PKCS12Attribute + })], PKCS12AttrSet); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/authenticated_safe.js +var require_authenticated_safe = /* @__PURE__ */ __commonJSMin(((exports) => { + var AuthenticatedSafe_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.AuthenticatedSafe = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_cms_1 = require_cjs$7(); + let AuthenticatedSafe = AuthenticatedSafe_1 = class AuthenticatedSafe extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, AuthenticatedSafe_1.prototype); + } + }; + exports.AuthenticatedSafe = AuthenticatedSafe; + exports.AuthenticatedSafe = AuthenticatedSafe = AuthenticatedSafe_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: asn1_cms_1.ContentInfo + })], AuthenticatedSafe); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/object_identifiers.js +var require_object_identifiers = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_bagtypes = exports.id_pbewithSHAAnd40BitRC2_CBC = exports.id_pbeWithSHAAnd128BitRC2_CBC = exports.id_pbeWithSHAAnd2_KeyTripleDES_CBC = exports.id_pbeWithSHAAnd3_KeyTripleDES_CBC = exports.id_pbeWithSHAAnd40BitRC4 = exports.id_pbeWithSHAAnd128BitRC4 = exports.id_pkcs_12PbeIds = exports.id_pkcs_12 = exports.id_pkcs = exports.id_rsadsi = void 0; + exports.id_rsadsi = "1.2.840.113549"; + exports.id_pkcs = `${exports.id_rsadsi}.1`; + exports.id_pkcs_12 = `${exports.id_pkcs}.12`; + exports.id_pkcs_12PbeIds = `${exports.id_pkcs_12}.1`; + exports.id_pbeWithSHAAnd128BitRC4 = `${exports.id_pkcs_12PbeIds}.1`; + exports.id_pbeWithSHAAnd40BitRC4 = `${exports.id_pkcs_12PbeIds}.2`; + exports.id_pbeWithSHAAnd3_KeyTripleDES_CBC = `${exports.id_pkcs_12PbeIds}.3`; + exports.id_pbeWithSHAAnd2_KeyTripleDES_CBC = `${exports.id_pkcs_12PbeIds}.4`; + exports.id_pbeWithSHAAnd128BitRC2_CBC = `${exports.id_pkcs_12PbeIds}.5`; + exports.id_pbewithSHAAnd40BitRC2_CBC = `${exports.id_pkcs_12PbeIds}.6`; + exports.id_bagtypes = `${exports.id_pkcs_12}.10.1`; +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/bags/types.js +var require_types = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_pkcs_9 = exports.id_SafeContents = exports.id_SecretBag = exports.id_CRLBag = exports.id_certBag = exports.id_pkcs8ShroudedKeyBag = exports.id_keyBag = void 0; + const object_identifiers_1 = require_object_identifiers(); + exports.id_keyBag = `${object_identifiers_1.id_bagtypes}.1`; + exports.id_pkcs8ShroudedKeyBag = `${object_identifiers_1.id_bagtypes}.2`; + exports.id_certBag = `${object_identifiers_1.id_bagtypes}.3`; + exports.id_CRLBag = `${object_identifiers_1.id_bagtypes}.4`; + exports.id_SecretBag = `${object_identifiers_1.id_bagtypes}.5`; + exports.id_SafeContents = `${object_identifiers_1.id_bagtypes}.6`; + exports.id_pkcs_9 = "1.2.840.113549.1.9"; +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/bags/cert_bag.js +var require_cert_bag = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_sdsiCertificate = exports.id_x509Certificate = exports.id_certTypes = exports.CertBag = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const types_1 = require_types(); + var CertBag = class { + certId = ""; + certValue = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.CertBag = CertBag; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], CertBag.prototype, "certId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + context: 0 + })], CertBag.prototype, "certValue", void 0); + exports.id_certTypes = `${types_1.id_pkcs_9}.22`; + exports.id_x509Certificate = `${exports.id_certTypes}.1`; + exports.id_sdsiCertificate = `${exports.id_certTypes}.2`; +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/bags/crl_bag.js +var require_crl_bag = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.id_x509CRL = exports.id_crlTypes = exports.CRLBag = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const types_1 = require_types(); + var CRLBag = class { + crlId = ""; + crltValue = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.CRLBag = CRLBag; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], CRLBag.prototype, "crlId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + context: 0 + })], CRLBag.prototype, "crltValue", void 0); + exports.id_crlTypes = `${types_1.id_pkcs_9}.23`; + exports.id_x509CRL = `${exports.id_crlTypes}.1`; +})); +//#endregion +//#region node_modules/@peculiar/asn1-pkcs8/build/cjs/encrypted_private_key_info.js +var require_encrypted_private_key_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.EncryptedPrivateKeyInfo = exports.EncryptedData = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var EncryptedData = class extends asn1_schema_1.OctetString {}; + exports.EncryptedData = EncryptedData; + var EncryptedPrivateKeyInfo = class { + encryptionAlgorithm = new asn1_x509_1.AlgorithmIdentifier(); + encryptedData = new EncryptedData(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.EncryptedPrivateKeyInfo = EncryptedPrivateKeyInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], EncryptedPrivateKeyInfo.prototype, "encryptionAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: EncryptedData })], EncryptedPrivateKeyInfo.prototype, "encryptedData", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pkcs8/build/cjs/private_key_info.js +var require_private_key_info = /* @__PURE__ */ __commonJSMin(((exports) => { + var Attributes_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PrivateKeyInfo = exports.Attributes = exports.PrivateKey = exports.Version = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + var Version; + (function(Version) { + Version[Version["v1"] = 0] = "v1"; + })(Version || (exports.Version = Version = {})); + var PrivateKey = class extends asn1_schema_1.OctetString {}; + exports.PrivateKey = PrivateKey; + let Attributes = Attributes_1 = class Attributes extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, Attributes_1.prototype); + } + }; + exports.Attributes = Attributes; + exports.Attributes = Attributes = Attributes_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: asn1_x509_1.Attribute + })], Attributes); + var PrivateKeyInfo = class { + version = Version.v1; + privateKeyAlgorithm = new asn1_x509_1.AlgorithmIdentifier(); + privateKey = new PrivateKey(); + attributes; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PrivateKeyInfo = PrivateKeyInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], PrivateKeyInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], PrivateKeyInfo.prototype, "privateKeyAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: PrivateKey })], PrivateKeyInfo.prototype, "privateKey", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: Attributes, + implicit: true, + context: 0, + optional: true + })], PrivateKeyInfo.prototype, "attributes", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pkcs8/build/cjs/index.js +var require_cjs$3 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_encrypted_private_key_info(), exports); + tslib_1.__exportStar(require_private_key_info(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/bags/key_bag.js +var require_key_bag = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.KeyBag = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_pkcs8_1 = require_cjs$3(); + const asn1_schema_1 = require_cjs$10(); + let KeyBag = class KeyBag extends asn1_pkcs8_1.PrivateKeyInfo {}; + exports.KeyBag = KeyBag; + exports.KeyBag = KeyBag = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], KeyBag); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/bags/pkcs8_shrouded_key_bag.js +var require_pkcs8_shrouded_key_bag = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PKCS8ShroudedKeyBag = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_pkcs8_1 = require_cjs$3(); + const asn1_schema_1 = require_cjs$10(); + let PKCS8ShroudedKeyBag = class PKCS8ShroudedKeyBag extends asn1_pkcs8_1.EncryptedPrivateKeyInfo {}; + exports.PKCS8ShroudedKeyBag = PKCS8ShroudedKeyBag; + exports.PKCS8ShroudedKeyBag = PKCS8ShroudedKeyBag = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], PKCS8ShroudedKeyBag); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/bags/secret_bag.js +var require_secret_bag = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SecretBag = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + var SecretBag = class { + secretTypeId = ""; + secretValue = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SecretBag = SecretBag; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], SecretBag.prototype, "secretTypeId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + context: 0 + })], SecretBag.prototype, "secretValue", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/bags/index.js +var require_bags = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_cert_bag(), exports); + tslib_1.__exportStar(require_crl_bag(), exports); + tslib_1.__exportStar(require_key_bag(), exports); + tslib_1.__exportStar(require_pkcs8_shrouded_key_bag(), exports); + tslib_1.__exportStar(require_secret_bag(), exports); + tslib_1.__exportStar(require_types(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/mac_data.js +var require_mac_data = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.MacData = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_rsa_1 = require_cjs$5(); + const asn1_schema_1 = require_cjs$10(); + var MacData = class { + mac = new asn1_rsa_1.DigestInfo(); + macSalt = new asn1_schema_1.OctetString(); + iterations = 1; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.MacData = MacData; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_rsa_1.DigestInfo })], MacData.prototype, "mac", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })], MacData.prototype, "macSalt", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Integer, + defaultValue: 1 + })], MacData.prototype, "iterations", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/pfx.js +var require_pfx = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.PFX = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_cms_1 = require_cjs$7(); + const mac_data_1 = require_mac_data(); + var PFX = class { + version = 3; + authSafe = new asn1_cms_1.ContentInfo(); + macData = new mac_data_1.MacData(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.PFX = PFX; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], PFX.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_cms_1.ContentInfo })], PFX.prototype, "authSafe", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: mac_data_1.MacData, + optional: true + })], PFX.prototype, "macData", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/safe_bag.js +var require_safe_bag = /* @__PURE__ */ __commonJSMin(((exports) => { + var SafeContents_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.SafeContents = exports.SafeBag = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const attribute_1 = require_attribute(); + var SafeBag = class { + bagId = ""; + bagValue = /* @__PURE__ */ new ArrayBuffer(0); + bagAttributes; + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.SafeBag = SafeBag; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], SafeBag.prototype, "bagId", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: asn1_schema_1.AsnPropTypes.Any, + context: 0 + })], SafeBag.prototype, "bagValue", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: attribute_1.PKCS12Attribute, + repeated: "set", + optional: true + })], SafeBag.prototype, "bagAttributes", void 0); + let SafeContents = SafeContents_1 = class SafeContents extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SafeContents_1.prototype); + } + }; + exports.SafeContents = SafeContents; + exports.SafeContents = SafeContents = SafeContents_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: SafeBag + })], SafeContents); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pfx/build/cjs/index.js +var require_cjs$2 = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_attribute(), exports); + tslib_1.__exportStar(require_authenticated_safe(), exports); + tslib_1.__exportStar(require_bags(), exports); + tslib_1.__exportStar(require_mac_data(), exports); + tslib_1.__exportStar(require_object_identifiers(), exports); + tslib_1.__exportStar(require_pfx(), exports); + tslib_1.__exportStar(require_safe_bag(), exports); +})); +//#endregion +//#region node_modules/@peculiar/asn1-pkcs9/build/cjs/index.js +var require_cjs$1 = /* @__PURE__ */ __commonJSMin(((exports) => { + var ExtensionRequest_1, ExtendedCertificateAttributes_1, SMIMECapabilities_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.DateOfBirth = exports.UnstructuredAddress = exports.UnstructuredName = exports.EmailAddress = exports.EncryptedPrivateKeyInfo = exports.UserPKCS12 = exports.Pkcs7PDU = exports.PKCS9String = exports.id_at_pseudonym = exports.crlTypes = exports.id_certTypes = exports.id_smime = exports.id_pkcs9_mr_signingTimeMatch = exports.id_pkcs9_mr_caseIgnoreMatch = exports.id_pkcs9_sx_signingTime = exports.id_pkcs9_sx_pkcs9String = exports.id_pkcs9_at_countryOfResidence = exports.id_pkcs9_at_countryOfCitizenship = exports.id_pkcs9_at_gender = exports.id_pkcs9_at_placeOfBirth = exports.id_pkcs9_at_dateOfBirth = exports.id_ietf_at = exports.id_pkcs9_at_pkcs7PDU = exports.id_pkcs9_at_sequenceNumber = exports.id_pkcs9_at_randomNonce = exports.id_pkcs9_at_encryptedPrivateKeyInfo = exports.id_pkcs9_at_pkcs15Token = exports.id_pkcs9_at_userPKCS12 = exports.id_pkcs9_at_localKeyId = exports.id_pkcs9_at_friendlyName = exports.id_pkcs9_at_smimeCapabilities = exports.id_pkcs9_at_extensionRequest = exports.id_pkcs9_at_signingDescription = exports.id_pkcs9_at_extendedCertificateAttributes = exports.id_pkcs9_at_unstructuredAddress = exports.id_pkcs9_at_challengePassword = exports.id_pkcs9_at_counterSignature = exports.id_pkcs9_at_signingTime = exports.id_pkcs9_at_messageDigest = exports.id_pkcs9_at_contentType = exports.id_pkcs9_at_unstructuredName = exports.id_pkcs9_at_emailAddress = exports.id_pkcs9_oc_naturalPerson = exports.id_pkcs9_oc_pkcsEntity = exports.id_pkcs9_mr = exports.id_pkcs9_sx = exports.id_pkcs9_at = exports.id_pkcs9_oc = exports.id_pkcs9_mo = exports.id_pkcs9 = void 0; + exports.SMIMECapabilities = exports.SMIMECapability = exports.SigningDescription = exports.LocalKeyId = exports.FriendlyName = exports.ExtendedCertificateAttributes = exports.ExtensionRequest = exports.ChallengePassword = exports.CounterSignature = exports.SequenceNumber = exports.RandomNonce = exports.SigningTime = exports.MessageDigest = exports.ContentType = exports.Pseudonym = exports.CountryOfResidence = exports.CountryOfCitizenship = exports.Gender = exports.PlaceOfBirth = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const cms = tslib_1.__importStar(require_cjs$7()); + const pfx = tslib_1.__importStar(require_cjs$2()); + const pkcs8 = tslib_1.__importStar(require_cjs$3()); + const x509 = tslib_1.__importStar(require_cjs$9()); + const attr = tslib_1.__importStar(require_cjs$8()); + exports.id_pkcs9 = "1.2.840.113549.1.9"; + exports.id_pkcs9_mo = `${exports.id_pkcs9}.0`; + exports.id_pkcs9_oc = `${exports.id_pkcs9}.24`; + exports.id_pkcs9_at = `${exports.id_pkcs9}.25`; + exports.id_pkcs9_sx = `${exports.id_pkcs9}.26`; + exports.id_pkcs9_mr = `${exports.id_pkcs9}.27`; + exports.id_pkcs9_oc_pkcsEntity = `${exports.id_pkcs9_oc}.1`; + exports.id_pkcs9_oc_naturalPerson = `${exports.id_pkcs9_oc}.2`; + exports.id_pkcs9_at_emailAddress = `${exports.id_pkcs9}.1`; + exports.id_pkcs9_at_unstructuredName = `${exports.id_pkcs9}.2`; + exports.id_pkcs9_at_contentType = `${exports.id_pkcs9}.3`; + exports.id_pkcs9_at_messageDigest = `${exports.id_pkcs9}.4`; + exports.id_pkcs9_at_signingTime = `${exports.id_pkcs9}.5`; + exports.id_pkcs9_at_counterSignature = `${exports.id_pkcs9}.6`; + exports.id_pkcs9_at_challengePassword = `${exports.id_pkcs9}.7`; + exports.id_pkcs9_at_unstructuredAddress = `${exports.id_pkcs9}.8`; + exports.id_pkcs9_at_extendedCertificateAttributes = `${exports.id_pkcs9}.9`; + exports.id_pkcs9_at_signingDescription = `${exports.id_pkcs9}.13`; + exports.id_pkcs9_at_extensionRequest = `${exports.id_pkcs9}.14`; + exports.id_pkcs9_at_smimeCapabilities = `${exports.id_pkcs9}.15`; + exports.id_pkcs9_at_friendlyName = `${exports.id_pkcs9}.20`; + exports.id_pkcs9_at_localKeyId = `${exports.id_pkcs9}.21`; + exports.id_pkcs9_at_userPKCS12 = "2.16.840.1.113730.3.1.216"; + exports.id_pkcs9_at_pkcs15Token = `${exports.id_pkcs9_at}.1`; + exports.id_pkcs9_at_encryptedPrivateKeyInfo = `${exports.id_pkcs9_at}.2`; + exports.id_pkcs9_at_randomNonce = `${exports.id_pkcs9_at}.3`; + exports.id_pkcs9_at_sequenceNumber = `${exports.id_pkcs9_at}.4`; + exports.id_pkcs9_at_pkcs7PDU = `${exports.id_pkcs9_at}.5`; + exports.id_ietf_at = "1.3.6.1.5.5.7.9"; + exports.id_pkcs9_at_dateOfBirth = `${exports.id_ietf_at}.1`; + exports.id_pkcs9_at_placeOfBirth = `${exports.id_ietf_at}.2`; + exports.id_pkcs9_at_gender = `${exports.id_ietf_at}.3`; + exports.id_pkcs9_at_countryOfCitizenship = `${exports.id_ietf_at}.4`; + exports.id_pkcs9_at_countryOfResidence = `${exports.id_ietf_at}.5`; + exports.id_pkcs9_sx_pkcs9String = `${exports.id_pkcs9_sx}.1`; + exports.id_pkcs9_sx_signingTime = `${exports.id_pkcs9_sx}.2`; + exports.id_pkcs9_mr_caseIgnoreMatch = `${exports.id_pkcs9_mr}.1`; + exports.id_pkcs9_mr_signingTimeMatch = `${exports.id_pkcs9_mr}.2`; + exports.id_smime = `${exports.id_pkcs9}.16`; + exports.id_certTypes = `${exports.id_pkcs9}.22`; + exports.crlTypes = `${exports.id_pkcs9}.23`; + exports.id_at_pseudonym = `${attr.id_at}.65`; + let PKCS9String = class PKCS9String extends x509.DirectoryString { + ia5String; + constructor(params = {}) { + super(params); + } + toString() { + ({}).toString(); + return this.ia5String || super.toString(); + } + }; + exports.PKCS9String = PKCS9String; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.IA5String })], PKCS9String.prototype, "ia5String", void 0); + exports.PKCS9String = PKCS9String = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], PKCS9String); + let Pkcs7PDU = class Pkcs7PDU extends cms.ContentInfo {}; + exports.Pkcs7PDU = Pkcs7PDU; + exports.Pkcs7PDU = Pkcs7PDU = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], Pkcs7PDU); + let UserPKCS12 = class UserPKCS12 extends pfx.PFX {}; + exports.UserPKCS12 = UserPKCS12; + exports.UserPKCS12 = UserPKCS12 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], UserPKCS12); + let EncryptedPrivateKeyInfo = class EncryptedPrivateKeyInfo extends pkcs8.EncryptedPrivateKeyInfo {}; + exports.EncryptedPrivateKeyInfo = EncryptedPrivateKeyInfo; + exports.EncryptedPrivateKeyInfo = EncryptedPrivateKeyInfo = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], EncryptedPrivateKeyInfo); + let EmailAddress = class EmailAddress { + value; + constructor(value = "") { + this.value = value; + } + toString() { + return this.value; + } + }; + exports.EmailAddress = EmailAddress; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.IA5String })], EmailAddress.prototype, "value", void 0); + exports.EmailAddress = EmailAddress = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], EmailAddress); + let UnstructuredName = class UnstructuredName extends PKCS9String {}; + exports.UnstructuredName = UnstructuredName; + exports.UnstructuredName = UnstructuredName = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], UnstructuredName); + let UnstructuredAddress = class UnstructuredAddress extends x509.DirectoryString {}; + exports.UnstructuredAddress = UnstructuredAddress; + exports.UnstructuredAddress = UnstructuredAddress = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], UnstructuredAddress); + let DateOfBirth = class DateOfBirth { + value; + constructor(value = /* @__PURE__ */ new Date()) { + this.value = value; + } + }; + exports.DateOfBirth = DateOfBirth; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.GeneralizedTime })], DateOfBirth.prototype, "value", void 0); + exports.DateOfBirth = DateOfBirth = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], DateOfBirth); + let PlaceOfBirth = class PlaceOfBirth extends x509.DirectoryString {}; + exports.PlaceOfBirth = PlaceOfBirth; + exports.PlaceOfBirth = PlaceOfBirth = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], PlaceOfBirth); + let Gender = class Gender { + value; + constructor(value = "M") { + this.value = value; + } + toString() { + return this.value; + } + }; + exports.Gender = Gender; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.PrintableString })], Gender.prototype, "value", void 0); + exports.Gender = Gender = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], Gender); + let CountryOfCitizenship = class CountryOfCitizenship { + value; + constructor(value = "") { + this.value = value; + } + toString() { + return this.value; + } + }; + exports.CountryOfCitizenship = CountryOfCitizenship; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.PrintableString })], CountryOfCitizenship.prototype, "value", void 0); + exports.CountryOfCitizenship = CountryOfCitizenship = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], CountryOfCitizenship); + let CountryOfResidence = class CountryOfResidence extends CountryOfCitizenship {}; + exports.CountryOfResidence = CountryOfResidence; + exports.CountryOfResidence = CountryOfResidence = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], CountryOfResidence); + let Pseudonym = class Pseudonym extends x509.DirectoryString {}; + exports.Pseudonym = Pseudonym; + exports.Pseudonym = Pseudonym = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], Pseudonym); + let ContentType = class ContentType { + value; + constructor(value = "") { + this.value = value; + } + toString() { + return this.value; + } + }; + exports.ContentType = ContentType; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })], ContentType.prototype, "value", void 0); + exports.ContentType = ContentType = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], ContentType); + var MessageDigest = class extends asn1_schema_1.OctetString {}; + exports.MessageDigest = MessageDigest; + let SigningTime = class SigningTime extends x509.Time {}; + exports.SigningTime = SigningTime; + exports.SigningTime = SigningTime = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], SigningTime); + var RandomNonce = class extends asn1_schema_1.OctetString {}; + exports.RandomNonce = RandomNonce; + let SequenceNumber = class SequenceNumber { + value; + constructor(value = 0) { + this.value = value; + } + toString() { + return this.value.toString(); + } + }; + exports.SequenceNumber = SequenceNumber; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], SequenceNumber.prototype, "value", void 0); + exports.SequenceNumber = SequenceNumber = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], SequenceNumber); + let CounterSignature = class CounterSignature extends cms.SignerInfo {}; + exports.CounterSignature = CounterSignature; + exports.CounterSignature = CounterSignature = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], CounterSignature); + let ChallengePassword = class ChallengePassword extends x509.DirectoryString {}; + exports.ChallengePassword = ChallengePassword; + exports.ChallengePassword = ChallengePassword = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], ChallengePassword); + let ExtensionRequest = ExtensionRequest_1 = class ExtensionRequest extends x509.Extensions { + constructor(items) { + super(items); + Object.setPrototypeOf(this, ExtensionRequest_1.prototype); + } + }; + exports.ExtensionRequest = ExtensionRequest; + exports.ExtensionRequest = ExtensionRequest = ExtensionRequest_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], ExtensionRequest); + let ExtendedCertificateAttributes = ExtendedCertificateAttributes_1 = class ExtendedCertificateAttributes extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, ExtendedCertificateAttributes_1.prototype); + } + }; + exports.ExtendedCertificateAttributes = ExtendedCertificateAttributes; + exports.ExtendedCertificateAttributes = ExtendedCertificateAttributes = ExtendedCertificateAttributes_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Set, + itemType: cms.Attribute + })], ExtendedCertificateAttributes); + let FriendlyName = class FriendlyName { + value; + constructor(value = "") { + this.value = value; + } + toString() { + return this.value; + } + }; + exports.FriendlyName = FriendlyName; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BmpString })], FriendlyName.prototype, "value", void 0); + exports.FriendlyName = FriendlyName = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Choice })], FriendlyName); + var LocalKeyId = class extends asn1_schema_1.OctetString {}; + exports.LocalKeyId = LocalKeyId; + var SigningDescription = class extends x509.DirectoryString {}; + exports.SigningDescription = SigningDescription; + let SMIMECapability = class SMIMECapability extends x509.AlgorithmIdentifier {}; + exports.SMIMECapability = SMIMECapability; + exports.SMIMECapability = SMIMECapability = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })], SMIMECapability); + let SMIMECapabilities = SMIMECapabilities_1 = class SMIMECapabilities extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, SMIMECapabilities_1.prototype); + } + }; + exports.SMIMECapabilities = SMIMECapabilities; + exports.SMIMECapabilities = SMIMECapabilities = SMIMECapabilities_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: SMIMECapability + })], SMIMECapabilities); +})); +//#endregion +//#region node_modules/@peculiar/asn1-csr/build/cjs/attributes.js +var require_attributes = /* @__PURE__ */ __commonJSMin(((exports) => { + var Attributes_1; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.Attributes = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + let Attributes = Attributes_1 = class Attributes extends asn1_schema_1.AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, Attributes_1.prototype); + } + }; + exports.Attributes = Attributes; + exports.Attributes = Attributes = Attributes_1 = tslib_1.__decorate([(0, asn1_schema_1.AsnType)({ + type: asn1_schema_1.AsnTypeTypes.Sequence, + itemType: asn1_x509_1.Attribute + })], Attributes); +})); +//#endregion +//#region node_modules/@peculiar/asn1-csr/build/cjs/certification_request_info.js +var require_certification_request_info = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CertificationRequestInfo = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const attributes_1 = require_attributes(); + var CertificationRequestInfo = class { + version = 0; + subject = new asn1_x509_1.Name(); + subjectPKInfo = new asn1_x509_1.SubjectPublicKeyInfo(); + attributes = new attributes_1.Attributes(); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.CertificationRequestInfo = CertificationRequestInfo; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })], CertificationRequestInfo.prototype, "version", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.Name })], CertificationRequestInfo.prototype, "subject", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.SubjectPublicKeyInfo })], CertificationRequestInfo.prototype, "subjectPKInfo", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: attributes_1.Attributes, + implicit: true, + context: 0, + optional: true + })], CertificationRequestInfo.prototype, "attributes", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-csr/build/cjs/certification_request.js +var require_certification_request = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + exports.CertificationRequest = void 0; + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + const asn1_schema_1 = require_cjs$10(); + const asn1_x509_1 = require_cjs$9(); + const certification_request_info_1 = require_certification_request_info(); + var CertificationRequest = class { + certificationRequestInfo = new certification_request_info_1.CertificationRequestInfo(); + certificationRequestInfoRaw; + signatureAlgorithm = new asn1_x509_1.AlgorithmIdentifier(); + signature = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } + }; + exports.CertificationRequest = CertificationRequest; + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ + type: certification_request_info_1.CertificationRequestInfo, + raw: true + })], CertificationRequest.prototype, "certificationRequestInfo", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })], CertificationRequest.prototype, "signatureAlgorithm", void 0); + tslib_1.__decorate([(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.BitString })], CertificationRequest.prototype, "signature", void 0); +})); +//#endregion +//#region node_modules/@peculiar/asn1-csr/build/cjs/index.js +var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => { + Object.defineProperty(exports, "__esModule", { value: true }); + const tslib_1 = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + tslib_1.__exportStar(require_attributes(), exports); + tslib_1.__exportStar(require_certification_request(), exports); + tslib_1.__exportStar(require_certification_request_info(), exports); +})); +/*! +* MIT License +* +* Copyright (c) Peculiar Ventures. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +* +*/ +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/fetch.js +var import_x509_cjs = (/* @__PURE__ */ __commonJSMin(((exports) => { + require_Reflect(); + var asn1Schema = require_cjs$10(); + var asn1X509 = require_cjs$9(); + var pvtsutils = require_build$1(); + var tslib = (init_tslib_es6$1(), __toCommonJS(tslib_es6_exports$1)); + var asn1Cms = require_cjs$7(); + var asn1Ecc = require_cjs$6(); + var asn1Rsa = require_cjs$5(); + var tsyringe = require_cjs$4(); + var asnPkcs9 = require_cjs$1(); + var asn1Csr = require_cjs(); + function _interopNamespaceDefault(e) { + var n = Object.create(null); + if (e) Object.keys(e).forEach(function(k) { + if (k !== "default") { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function() { + return e[k]; + } + }); + } + }); + n.default = e; + return Object.freeze(n); + } + var asn1X509__namespace = /*#__PURE__*/ _interopNamespaceDefault(asn1X509); + var asn1Cms__namespace = /*#__PURE__*/ _interopNamespaceDefault(asn1Cms); + var asn1Ecc__namespace = /*#__PURE__*/ _interopNamespaceDefault(asn1Ecc); + var asn1Rsa__namespace = /*#__PURE__*/ _interopNamespaceDefault(asn1Rsa); + var asnPkcs9__namespace = /*#__PURE__*/ _interopNamespaceDefault(asnPkcs9); + const diAlgorithm = "crypto.algorithm"; + var AlgorithmProvider = class { + getAlgorithms() { + return tsyringe.container.resolveAll(diAlgorithm); + } + toAsnAlgorithm(alg) { + ({ ...alg }); + for (const algorithm of this.getAlgorithms()) { + const res = algorithm.toAsnAlgorithm(alg); + if (res) return res; + } + if (/^[0-9.]+$/.test(alg.name)) { + const res = new asn1X509.AlgorithmIdentifier({ algorithm: alg.name }); + if ("parameters" in alg) res.parameters = alg.parameters; + return res; + } + throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm"); + } + toWebAlgorithm(alg) { + for (const algorithm of this.getAlgorithms()) { + const res = algorithm.toWebAlgorithm(alg); + if (res) return res; + } + return { + name: alg.algorithm, + parameters: alg.parameters + }; + } + }; + const diAlgorithmProvider = "crypto.algorithmProvider"; + tsyringe.container.registerSingleton(diAlgorithmProvider, AlgorithmProvider); + var EcAlgorithm_1; + const idVersionOne = "1.3.36.3.3.2.8.1.1"; + const idBrainpoolP160r1 = `${idVersionOne}.1`; + const idBrainpoolP160t1 = `${idVersionOne}.2`; + const idBrainpoolP192r1 = `${idVersionOne}.3`; + const idBrainpoolP192t1 = `${idVersionOne}.4`; + const idBrainpoolP224r1 = `${idVersionOne}.5`; + const idBrainpoolP224t1 = `${idVersionOne}.6`; + const idBrainpoolP256r1 = `${idVersionOne}.7`; + const idBrainpoolP256t1 = `${idVersionOne}.8`; + const idBrainpoolP320r1 = `${idVersionOne}.9`; + const idBrainpoolP320t1 = `${idVersionOne}.10`; + const idBrainpoolP384r1 = `${idVersionOne}.11`; + const idBrainpoolP384t1 = `${idVersionOne}.12`; + const idBrainpoolP512r1 = `${idVersionOne}.13`; + const idBrainpoolP512t1 = `${idVersionOne}.14`; + const brainpoolP160r1 = "brainpoolP160r1"; + const brainpoolP160t1 = "brainpoolP160t1"; + const brainpoolP192r1 = "brainpoolP192r1"; + const brainpoolP192t1 = "brainpoolP192t1"; + const brainpoolP224r1 = "brainpoolP224r1"; + const brainpoolP224t1 = "brainpoolP224t1"; + const brainpoolP256r1 = "brainpoolP256r1"; + const brainpoolP256t1 = "brainpoolP256t1"; + const brainpoolP320r1 = "brainpoolP320r1"; + const brainpoolP320t1 = "brainpoolP320t1"; + const brainpoolP384r1 = "brainpoolP384r1"; + const brainpoolP384t1 = "brainpoolP384t1"; + const brainpoolP512r1 = "brainpoolP512r1"; + const brainpoolP512t1 = "brainpoolP512t1"; + const ECDSA = "ECDSA"; + exports.EcAlgorithm = EcAlgorithm_1 = class EcAlgorithm { + toAsnAlgorithm(alg) { + switch (alg.name.toLowerCase()) { + case ECDSA.toLowerCase(): if ("hash" in alg) switch ((typeof alg.hash === "string" ? alg.hash : alg.hash.name).toLowerCase()) { + case "sha-1": return asn1Ecc__namespace.ecdsaWithSHA1; + case "sha-256": return asn1Ecc__namespace.ecdsaWithSHA256; + case "sha-384": return asn1Ecc__namespace.ecdsaWithSHA384; + case "sha-512": return asn1Ecc__namespace.ecdsaWithSHA512; + } + else if ("namedCurve" in alg) { + let parameters = ""; + switch (alg.namedCurve) { + case "P-256": + parameters = asn1Ecc__namespace.id_secp256r1; + break; + case "K-256": + parameters = EcAlgorithm_1.SECP256K1; + break; + case "P-384": + parameters = asn1Ecc__namespace.id_secp384r1; + break; + case "P-521": + parameters = asn1Ecc__namespace.id_secp521r1; + break; + case brainpoolP160r1: + parameters = idBrainpoolP160r1; + break; + case brainpoolP160t1: + parameters = idBrainpoolP160t1; + break; + case brainpoolP192r1: + parameters = idBrainpoolP192r1; + break; + case brainpoolP192t1: + parameters = idBrainpoolP192t1; + break; + case brainpoolP224r1: + parameters = idBrainpoolP224r1; + break; + case brainpoolP224t1: + parameters = idBrainpoolP224t1; + break; + case brainpoolP256r1: + parameters = idBrainpoolP256r1; + break; + case brainpoolP256t1: + parameters = idBrainpoolP256t1; + break; + case brainpoolP320r1: + parameters = idBrainpoolP320r1; + break; + case brainpoolP320t1: + parameters = idBrainpoolP320t1; + break; + case brainpoolP384r1: + parameters = idBrainpoolP384r1; + break; + case brainpoolP384t1: + parameters = idBrainpoolP384t1; + break; + case brainpoolP512r1: + parameters = idBrainpoolP512r1; + break; + case brainpoolP512t1: + parameters = idBrainpoolP512t1; + break; + } + if (parameters) return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Ecc__namespace.id_ecPublicKey, + parameters: asn1Schema.AsnConvert.serialize(new asn1Ecc__namespace.ECParameters({ namedCurve: parameters })) + }); + } + } + return null; + } + toWebAlgorithm(alg) { + switch (alg.algorithm) { + case asn1Ecc__namespace.id_ecdsaWithSHA1: return { + name: ECDSA, + hash: { name: "SHA-1" } + }; + case asn1Ecc__namespace.id_ecdsaWithSHA256: return { + name: ECDSA, + hash: { name: "SHA-256" } + }; + case asn1Ecc__namespace.id_ecdsaWithSHA384: return { + name: ECDSA, + hash: { name: "SHA-384" } + }; + case asn1Ecc__namespace.id_ecdsaWithSHA512: return { + name: ECDSA, + hash: { name: "SHA-512" } + }; + case asn1Ecc__namespace.id_ecPublicKey: + if (!alg.parameters) throw new TypeError("Cannot get required parameters from EC algorithm"); + switch (asn1Schema.AsnConvert.parse(alg.parameters, asn1Ecc__namespace.ECParameters).namedCurve) { + case asn1Ecc__namespace.id_secp256r1: return { + name: ECDSA, + namedCurve: "P-256" + }; + case EcAlgorithm_1.SECP256K1: return { + name: ECDSA, + namedCurve: "K-256" + }; + case asn1Ecc__namespace.id_secp384r1: return { + name: ECDSA, + namedCurve: "P-384" + }; + case asn1Ecc__namespace.id_secp521r1: return { + name: ECDSA, + namedCurve: "P-521" + }; + case idBrainpoolP160r1: return { + name: ECDSA, + namedCurve: brainpoolP160r1 + }; + case idBrainpoolP160t1: return { + name: ECDSA, + namedCurve: brainpoolP160t1 + }; + case idBrainpoolP192r1: return { + name: ECDSA, + namedCurve: brainpoolP192r1 + }; + case idBrainpoolP192t1: return { + name: ECDSA, + namedCurve: brainpoolP192t1 + }; + case idBrainpoolP224r1: return { + name: ECDSA, + namedCurve: brainpoolP224r1 + }; + case idBrainpoolP224t1: return { + name: ECDSA, + namedCurve: brainpoolP224t1 + }; + case idBrainpoolP256r1: return { + name: ECDSA, + namedCurve: brainpoolP256r1 + }; + case idBrainpoolP256t1: return { + name: ECDSA, + namedCurve: brainpoolP256t1 + }; + case idBrainpoolP320r1: return { + name: ECDSA, + namedCurve: brainpoolP320r1 + }; + case idBrainpoolP320t1: return { + name: ECDSA, + namedCurve: brainpoolP320t1 + }; + case idBrainpoolP384r1: return { + name: ECDSA, + namedCurve: brainpoolP384r1 + }; + case idBrainpoolP384t1: return { + name: ECDSA, + namedCurve: brainpoolP384t1 + }; + case idBrainpoolP512r1: return { + name: ECDSA, + namedCurve: brainpoolP512r1 + }; + case idBrainpoolP512t1: return { + name: ECDSA, + namedCurve: brainpoolP512t1 + }; + } + } + return null; + } + }; + exports.EcAlgorithm.SECP256K1 = "1.3.132.0.10"; + exports.EcAlgorithm = EcAlgorithm_1 = tslib.__decorate([tsyringe.injectable()], exports.EcAlgorithm); + tsyringe.container.registerSingleton(diAlgorithm, exports.EcAlgorithm); + const NAME = Symbol("name"); + const VALUE = Symbol("value"); + var TextObject = class { + constructor(name, items = {}, value = "") { + this[NAME] = name; + this[VALUE] = value; + for (const key in items) this[key] = items[key]; + } + }; + TextObject.NAME = NAME; + TextObject.VALUE = VALUE; + var DefaultAlgorithmSerializer = class { + static toTextObject(alg) { + const obj = new TextObject("Algorithm Identifier", {}, OidSerializer.toString(alg.algorithm)); + if (alg.parameters) switch (alg.algorithm) { + case asn1Ecc__namespace.id_ecPublicKey: { + const ecAlg = new exports.EcAlgorithm().toWebAlgorithm(alg); + if (ecAlg && "namedCurve" in ecAlg) obj["Named Curve"] = ecAlg.namedCurve; + else obj["Parameters"] = alg.parameters; + break; + } + default: obj["Parameters"] = alg.parameters; + } + return obj; + } + }; + var OidSerializer = class { + static toString(oid) { + const name = this.items[oid]; + if (name) return name; + return oid; + } + }; + OidSerializer.items = { + [asn1Rsa__namespace.id_sha1]: "sha1", + [asn1Rsa__namespace.id_sha224]: "sha224", + [asn1Rsa__namespace.id_sha256]: "sha256", + [asn1Rsa__namespace.id_sha384]: "sha384", + [asn1Rsa__namespace.id_sha512]: "sha512", + [asn1Rsa__namespace.id_rsaEncryption]: "rsaEncryption", + [asn1Rsa__namespace.id_sha1WithRSAEncryption]: "sha1WithRSAEncryption", + [asn1Rsa__namespace.id_sha224WithRSAEncryption]: "sha224WithRSAEncryption", + [asn1Rsa__namespace.id_sha256WithRSAEncryption]: "sha256WithRSAEncryption", + [asn1Rsa__namespace.id_sha384WithRSAEncryption]: "sha384WithRSAEncryption", + [asn1Rsa__namespace.id_sha512WithRSAEncryption]: "sha512WithRSAEncryption", + [asn1Ecc__namespace.id_ecPublicKey]: "ecPublicKey", + [asn1Ecc__namespace.id_ecdsaWithSHA1]: "ecdsaWithSHA1", + [asn1Ecc__namespace.id_ecdsaWithSHA224]: "ecdsaWithSHA224", + [asn1Ecc__namespace.id_ecdsaWithSHA256]: "ecdsaWithSHA256", + [asn1Ecc__namespace.id_ecdsaWithSHA384]: "ecdsaWithSHA384", + [asn1Ecc__namespace.id_ecdsaWithSHA512]: "ecdsaWithSHA512", + [asn1X509__namespace.id_kp_serverAuth]: "TLS WWW server authentication", + [asn1X509__namespace.id_kp_clientAuth]: "TLS WWW client authentication", + [asn1X509__namespace.id_kp_codeSigning]: "Code Signing", + [asn1X509__namespace.id_kp_emailProtection]: "E-mail Protection", + [asn1X509__namespace.id_kp_timeStamping]: "Time Stamping", + [asn1X509__namespace.id_kp_OCSPSigning]: "OCSP Signing", + [asn1Cms__namespace.id_signedData]: "Signed Data" + }; + var TextConverter = class { + static serialize(obj) { + return this.serializeObj(obj).join("\n"); + } + static pad(deep = 0) { + return "".padStart(2 * deep, " "); + } + static serializeObj(obj, deep = 0) { + const res = []; + let pad = this.pad(deep++); + let value = ""; + const objValue = obj[TextObject.VALUE]; + if (objValue) value = ` ${objValue}`; + res.push(`${pad}${obj[TextObject.NAME]}:${value}`); + pad = this.pad(deep); + for (const key in obj) { + if (typeof key === "symbol") continue; + const value = obj[key]; + const keyValue = key ? `${key}: ` : ""; + if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") res.push(`${pad}${keyValue}${value}`); + else if (value instanceof Date) res.push(`${pad}${keyValue}${value.toUTCString()}`); + else if (Array.isArray(value)) for (const obj of value) { + obj[TextObject.NAME] = key; + res.push(...this.serializeObj(obj, deep)); + } + else if (value instanceof TextObject) { + value[TextObject.NAME] = key; + res.push(...this.serializeObj(value, deep)); + } else if (pvtsutils.BufferSourceConverter.isBufferSource(value)) if (key) { + res.push(`${pad}${keyValue}`); + res.push(...this.serializeBufferSource(value, deep + 1)); + } else res.push(...this.serializeBufferSource(value, deep)); + else if ("toTextObject" in value) { + const obj = value.toTextObject(); + obj[TextObject.NAME] = key; + res.push(...this.serializeObj(obj, deep)); + } else throw new TypeError("Cannot serialize data in text format. Unsupported type."); + } + return res; + } + static serializeBufferSource(buffer, deep = 0) { + const pad = this.pad(deep); + const view = pvtsutils.BufferSourceConverter.toUint8Array(buffer); + const res = []; + for (let i = 0; i < view.length;) { + const row = []; + for (let j = 0; j < 16 && i < view.length; j++) { + if (j === 8) row.push(""); + const hex = view[i++].toString(16).padStart(2, "0"); + row.push(hex); + } + res.push(`${pad}${row.join(" ")}`); + } + return res; + } + static serializeAlgorithm(alg) { + return this.algorithmSerializer.toTextObject(alg); + } + }; + TextConverter.oidSerializer = OidSerializer; + TextConverter.algorithmSerializer = DefaultAlgorithmSerializer; + var _AsnData_rawData; + var AsnData = class AsnData { + get rawData() { + if (!tslib.__classPrivateFieldGet(this, _AsnData_rawData, "f")) tslib.__classPrivateFieldSet(this, _AsnData_rawData, asn1Schema.AsnConvert.serialize(this.asn), "f"); + return tslib.__classPrivateFieldGet(this, _AsnData_rawData, "f"); + } + constructor(...args) { + _AsnData_rawData.set(this, void 0); + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) { + this.asn = asn1Schema.AsnConvert.parse(args[0], args[1]); + tslib.__classPrivateFieldSet(this, _AsnData_rawData, pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]), "f"); + this.onInit(this.asn); + } else { + this.asn = args[0]; + this.onInit(this.asn); + } + } + equal(data) { + if (data instanceof AsnData) return pvtsutils.isEqual(data.rawData, this.rawData); + return false; + } + toString(format = "text") { + switch (format) { + case "asn": return asn1Schema.AsnConvert.toString(this.rawData); + case "text": return TextConverter.serialize(this.toTextObject()); + case "hex": return pvtsutils.Convert.ToHex(this.rawData); + case "base64": return pvtsutils.Convert.ToBase64(this.rawData); + case "base64url": return pvtsutils.Convert.ToBase64Url(this.rawData); + default: throw TypeError("Argument 'format' is unsupported value"); + } + } + getTextName() { + return this.constructor.NAME; + } + toTextObject() { + const obj = this.toTextObjectEmpty(); + obj[""] = this.rawData; + return obj; + } + toTextObjectEmpty(value) { + return new TextObject(this.getTextName(), {}, value); + } + }; + _AsnData_rawData = /* @__PURE__ */ new WeakMap(); + AsnData.NAME = "ASN"; + var Extension = class Extension extends AsnData { + constructor(...args) { + let raw; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) raw = pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]); + else raw = asn1Schema.AsnConvert.serialize(new asn1X509.Extension({ + extnID: args[0], + critical: args[1], + extnValue: new asn1Schema.OctetString(pvtsutils.BufferSourceConverter.toArrayBuffer(args[2])) + })); + super(raw, asn1X509.Extension); + } + onInit(asn) { + this.type = asn.extnID; + this.critical = asn.critical; + this.value = asn.extnValue.buffer; + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj[""] = this.value; + return obj; + } + toTextObjectWithoutValue() { + const obj = this.toTextObjectEmpty(this.critical ? "critical" : void 0); + if (obj[TextObject.NAME] === Extension.NAME) obj[TextObject.NAME] = OidSerializer.toString(this.type); + return obj; + } + }; + var _a; + var CryptoProvider = class CryptoProvider { + static isCryptoKeyPair(data) { + return data && data.privateKey && data.publicKey; + } + static isCryptoKey(data) { + return data && data.usages && data.type && data.algorithm && data.extractable !== void 0; + } + constructor() { + this.items = /* @__PURE__ */ new Map(); + this[_a] = "CryptoProvider"; + if (typeof self !== "undefined" && typeof crypto !== "undefined") this.set(CryptoProvider.DEFAULT, crypto); + else if (typeof global !== "undefined" && global.crypto && global.crypto.subtle) this.set(CryptoProvider.DEFAULT, global.crypto); + } + clear() { + this.items.clear(); + } + delete(key) { + return this.items.delete(key); + } + forEach(callbackfn, thisArg) { + return this.items.forEach(callbackfn, thisArg); + } + has(key) { + return this.items.has(key); + } + get size() { + return this.items.size; + } + entries() { + return this.items.entries(); + } + keys() { + return this.items.keys(); + } + values() { + return this.items.values(); + } + [Symbol.iterator]() { + return this.items[Symbol.iterator](); + } + get(key = CryptoProvider.DEFAULT) { + const crypto = this.items.get(key.toLowerCase()); + if (!crypto) throw new Error(`Cannot get Crypto by name '${key}'`); + return crypto; + } + set(key, value) { + if (typeof key === "string") { + if (!value) throw new TypeError("Argument 'value' is required"); + this.items.set(key.toLowerCase(), value); + } else this.items.set(CryptoProvider.DEFAULT, key); + return this; + } + }; + _a = Symbol.toStringTag; + CryptoProvider.DEFAULT = "default"; + const cryptoProvider = new CryptoProvider(); + const OID_REGEX = /^[0-2](?:\.[1-9][0-9]*)+$/; + function isOID(id) { + return new RegExp(OID_REGEX).test(id); + } + var NameIdentifier = class { + constructor(names = {}) { + this.items = {}; + for (const id in names) this.register(id, names[id]); + } + get(idOrName) { + return this.items[idOrName] || null; + } + findId(idOrName) { + if (!isOID(idOrName)) return this.get(idOrName); + return idOrName; + } + register(id, name) { + this.items[id] = name; + this.items[name] = id; + } + }; + const names = new NameIdentifier(); + names.register("CN", "2.5.4.3"); + names.register("L", "2.5.4.7"); + names.register("ST", "2.5.4.8"); + names.register("O", "2.5.4.10"); + names.register("OU", "2.5.4.11"); + names.register("C", "2.5.4.6"); + names.register("DC", "0.9.2342.19200300.100.1.25"); + names.register("E", "1.2.840.113549.1.9.1"); + names.register("G", "2.5.4.42"); + names.register("I", "2.5.4.43"); + names.register("SN", "2.5.4.4"); + names.register("T", "2.5.4.12"); + function replaceUnknownCharacter(text, char) { + return `\\${pvtsutils.Convert.ToHex(pvtsutils.Convert.FromUtf8String(char)).toUpperCase()}`; + } + function escape(data) { + return data.replace(/([,+"\\<>;])/g, "\\$1").replace(/^([ #])/, "\\$1").replace(/([ ]$)/, "\\$1").replace(/([\r\n\t])/, replaceUnknownCharacter); + } + var Name = class Name { + static isASCII(text) { + for (let i = 0; i < text.length; i++) if (text.charCodeAt(i) > 255) return false; + return true; + } + static isPrintableString(text) { + return /^[A-Za-z0-9 '()+,-./:=?]*$/g.test(text); + } + constructor(data, extraNames = {}) { + this.extraNames = new NameIdentifier(); + this.asn = new asn1X509.Name(); + for (const key in extraNames) if (Object.prototype.hasOwnProperty.call(extraNames, key)) { + const value = extraNames[key]; + this.extraNames.register(key, value); + } + if (typeof data === "string") this.asn = this.fromString(data); + else if (data instanceof asn1X509.Name) this.asn = data; + else if (pvtsutils.BufferSourceConverter.isBufferSource(data)) this.asn = asn1Schema.AsnConvert.parse(data, asn1X509.Name); + else this.asn = this.fromJSON(data); + } + getField(idOrName) { + const id = this.extraNames.findId(idOrName) || names.findId(idOrName); + const res = []; + for (const name of this.asn) for (const rdn of name) if (rdn.type === id) res.push(rdn.value.toString()); + return res; + } + getName(idOrName) { + return this.extraNames.get(idOrName) || names.get(idOrName); + } + toString() { + return this.asn.map((rdn) => rdn.map((o) => { + return `${this.getName(o.type) || o.type}=${o.value.anyValue ? `#${pvtsutils.Convert.ToHex(o.value.anyValue)}` : escape(o.value.toString())}`; + }).join("+")).join(", "); + } + toJSON() { + var _a; + const json = []; + for (const rdn of this.asn) { + const jsonItem = {}; + for (const attr of rdn) { + const type = this.getName(attr.type) || attr.type; + (_a = jsonItem[type]) !== null && _a !== void 0 || (jsonItem[type] = []); + jsonItem[type].push(attr.value.anyValue ? `#${pvtsutils.Convert.ToHex(attr.value.anyValue)}` : attr.value.toString()); + } + json.push(jsonItem); + } + return json; + } + fromString(data) { + const asn = new asn1X509.Name(); + const regex = /(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g; + let matches = null; + let level = ","; + while (matches = regex.exec(`${data},`)) { + let [, type, value] = matches; + const lastChar = value[value.length - 1]; + if (lastChar === "," || lastChar === "+") { + value = value.slice(0, value.length - 1); + matches[3] = lastChar; + } + const next = matches[3]; + type = this.getTypeOid(type); + const attr = this.createAttribute(type, value); + if (level === "+") asn[asn.length - 1].push(attr); + else asn.push(new asn1X509.RelativeDistinguishedName([attr])); + level = next; + } + return asn; + } + fromJSON(data) { + const asn = new asn1X509.Name(); + for (const item of data) { + const asnRdn = new asn1X509.RelativeDistinguishedName(); + for (const type in item) { + const typeId = this.getTypeOid(type); + const values = item[type]; + for (const value of values) { + const asnAttr = this.createAttribute(typeId, value); + asnRdn.push(asnAttr); + } + } + asn.push(asnRdn); + } + return asn; + } + getTypeOid(type) { + if (!/[\d.]+/.test(type)) type = this.getName(type) || ""; + if (!type) throw new Error(`Cannot get OID for name type '${type}'`); + return type; + } + createAttribute(type, value) { + const attr = new asn1X509.AttributeTypeAndValue({ type }); + if (typeof value === "object") for (const key in value) switch (key) { + case "ia5String": + attr.value.ia5String = value[key]; + break; + case "utf8String": + attr.value.utf8String = value[key]; + break; + case "universalString": + attr.value.universalString = value[key]; + break; + case "bmpString": + attr.value.bmpString = value[key]; + break; + case "printableString": + attr.value.printableString = value[key]; + break; + } + else if (value[0] === "#") attr.value.anyValue = pvtsutils.Convert.FromHex(value.slice(1)); + else { + const processedValue = this.processStringValue(value); + if (type === this.getName("E") || type === this.getName("DC")) attr.value.ia5String = processedValue; + else if (Name.isPrintableString(processedValue)) attr.value.printableString = processedValue; + else attr.value.utf8String = processedValue; + } + return attr; + } + processStringValue(value) { + const quotedMatches = /"(.*?[^\\])?"/.exec(value); + if (quotedMatches) value = quotedMatches[1]; + return value.replace(/\\0a/gi, "\n").replace(/\\0d/gi, "\r").replace(/\\0g/gi, " ").replace(/\\(.)/g, "$1"); + } + toArrayBuffer() { + return asn1Schema.AsnConvert.serialize(this.asn); + } + async getThumbprint(...args) { + var _a; + let crypto; + let algorithm = "SHA-1"; + if (args.length >= 1 && !((_a = args[0]) === null || _a === void 0 ? void 0 : _a.subtle)) { + algorithm = args[0] || algorithm; + crypto = args[1] || cryptoProvider.get(); + } else crypto = args[0] || cryptoProvider.get(); + return await crypto.subtle.digest(algorithm, this.toArrayBuffer()); + } + }; + const ERR_GN_CONSTRUCTOR = "Cannot initialize GeneralName from ASN.1 data."; + const ERR_GN_STRING_FORMAT = `${ERR_GN_CONSTRUCTOR} Unsupported string format in use.`; + const ERR_GUID = `${ERR_GN_CONSTRUCTOR} Value doesn't match to GUID regular expression.`; + const GUID_REGEX = /^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i; + const id_GUID = "1.3.6.1.4.1.311.25.1"; + const id_UPN = "1.3.6.1.4.1.311.20.2.3"; + const DNS = "dns"; + const DN = "dn"; + const EMAIL = "email"; + const IP = "ip"; + const URL = "url"; + const GUID = "guid"; + const UPN = "upn"; + const REGISTERED_ID = "id"; + var GeneralName = class extends AsnData { + constructor(...args) { + let name; + if (args.length === 2) switch (args[0]) { + case DN: { + const derName = new Name(args[1]).toArrayBuffer(); + const asnName = asn1Schema.AsnConvert.parse(derName, asn1X509__namespace.Name); + name = new asn1X509__namespace.GeneralName({ directoryName: asnName }); + break; + } + case DNS: + name = new asn1X509__namespace.GeneralName({ dNSName: args[1] }); + break; + case EMAIL: + name = new asn1X509__namespace.GeneralName({ rfc822Name: args[1] }); + break; + case GUID: { + const matches = new RegExp(GUID_REGEX, "i").exec(args[1]); + if (!matches) throw new Error("Cannot parse GUID value. Value doesn't match to regular expression"); + const hex = matches.slice(1).map((o, i) => { + if (i < 3) return pvtsutils.Convert.ToHex(new Uint8Array(pvtsutils.Convert.FromHex(o)).reverse()); + return o; + }).join(""); + name = new asn1X509__namespace.GeneralName({ otherName: new asn1X509__namespace.OtherName({ + typeId: id_GUID, + value: asn1Schema.AsnConvert.serialize(new asn1Schema.OctetString(pvtsutils.Convert.FromHex(hex))) + }) }); + break; + } + case IP: + name = new asn1X509__namespace.GeneralName({ iPAddress: args[1] }); + break; + case REGISTERED_ID: + name = new asn1X509__namespace.GeneralName({ registeredID: args[1] }); + break; + case UPN: + name = new asn1X509__namespace.GeneralName({ otherName: new asn1X509__namespace.OtherName({ + typeId: id_UPN, + value: asn1Schema.AsnConvert.serialize(asn1Schema.AsnUtf8StringConverter.toASN(args[1])) + }) }); + break; + case URL: + name = new asn1X509__namespace.GeneralName({ uniformResourceIdentifier: args[1] }); + break; + default: throw new Error("Cannot create GeneralName. Unsupported type of the name"); + } + else if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) name = asn1Schema.AsnConvert.parse(args[0], asn1X509__namespace.GeneralName); + else name = args[0]; + super(name); + } + onInit(asn) { + if (asn.dNSName != void 0) { + this.type = DNS; + this.value = asn.dNSName; + } else if (asn.rfc822Name != void 0) { + this.type = EMAIL; + this.value = asn.rfc822Name; + } else if (asn.iPAddress != void 0) { + this.type = IP; + this.value = asn.iPAddress; + } else if (asn.uniformResourceIdentifier != void 0) { + this.type = URL; + this.value = asn.uniformResourceIdentifier; + } else if (asn.registeredID != void 0) { + this.type = REGISTERED_ID; + this.value = asn.registeredID; + } else if (asn.directoryName != void 0) { + this.type = DN; + this.value = new Name(asn.directoryName).toString(); + } else if (asn.otherName != void 0) if (asn.otherName.typeId === id_GUID) { + this.type = GUID; + const guid = asn1Schema.AsnConvert.parse(asn.otherName.value, asn1Schema.OctetString); + const matches = new RegExp(GUID_REGEX, "i").exec(pvtsutils.Convert.ToHex(guid)); + if (!matches) throw new Error(ERR_GUID); + this.value = matches.slice(1).map((o, i) => { + if (i < 3) return pvtsutils.Convert.ToHex(new Uint8Array(pvtsutils.Convert.FromHex(o)).reverse()); + return o; + }).join("-"); + } else if (asn.otherName.typeId === id_UPN) { + this.type = UPN; + this.value = asn1Schema.AsnConvert.parse(asn.otherName.value, asn1X509__namespace.DirectoryString).toString(); + } else throw new Error(ERR_GN_STRING_FORMAT); + else throw new Error(ERR_GN_STRING_FORMAT); + } + toJSON() { + return { + type: this.type, + value: this.value + }; + } + toTextObject() { + let type; + switch (this.type) { + case DN: + case DNS: + case GUID: + case IP: + case REGISTERED_ID: + case UPN: + case URL: + type = this.type.toUpperCase(); + break; + case EMAIL: + type = "Email"; + break; + default: throw new Error("Unsupported GeneralName type"); + } + let value = this.value; + if (this.type === REGISTERED_ID) value = OidSerializer.toString(value); + return new TextObject(type, void 0, value); + } + }; + var GeneralNames = class extends AsnData { + constructor(params) { + let names; + if (params instanceof asn1X509__namespace.GeneralNames) names = params; + else if (Array.isArray(params)) { + const items = []; + for (const name of params) if (name instanceof asn1X509__namespace.GeneralName) items.push(name); + else { + const asnName = asn1Schema.AsnConvert.parse(new GeneralName(name.type, name.value).rawData, asn1X509__namespace.GeneralName); + items.push(asnName); + } + names = new asn1X509__namespace.GeneralNames(items); + } else if (pvtsutils.BufferSourceConverter.isBufferSource(params)) names = asn1Schema.AsnConvert.parse(params, asn1X509__namespace.GeneralNames); + else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments"); + super(names); + } + onInit(asn) { + const items = []; + for (const asnName of asn) { + let name = null; + try { + name = new GeneralName(asnName); + } catch { + continue; + } + items.push(name); + } + this.items = items; + } + toJSON() { + return this.items.map((o) => o.toJSON()); + } + toTextObject() { + const res = super.toTextObjectEmpty(); + for (const name of this.items) { + const nameObj = name.toTextObject(); + let field = res[nameObj[TextObject.NAME]]; + if (!Array.isArray(field)) { + field = []; + res[nameObj[TextObject.NAME]] = field; + } + field.push(nameObj); + } + return res; + } + }; + GeneralNames.NAME = "GeneralNames"; + const rPaddingTag = "-{5}"; + const rEolChars = "\\n"; + const rBeginTag = `${rPaddingTag}BEGIN (${`[^${rEolChars}]+`}(?=${rPaddingTag}))${rPaddingTag}`; + const rEndTag = `${rPaddingTag}END \\1${rPaddingTag}`; + const rEolGroup = "\\n"; + const rPem = `${rBeginTag}${rEolGroup}(?:((?:${`[^:${rEolChars}]+`}: ${`(?:[^${rEolChars}]+${rEolGroup}(?: +[^${rEolChars}]+${rEolGroup})*)`})+))?${rEolGroup}?(${`(?:[a-zA-Z0-9=+/]+${rEolGroup})+`})${rEndTag}`; + var PemConverter = class { + static isPem(data) { + return typeof data === "string" && new RegExp(rPem, "g").test(data.replace(/\r/g, "")); + } + static decodeWithHeaders(pem) { + pem = pem.replace(/\r/g, ""); + const pattern = new RegExp(rPem, "g"); + const res = []; + let matches = null; + while (matches = pattern.exec(pem)) { + const base64 = matches[3].replace(new RegExp(`[${rEolChars}]+`, "g"), ""); + const pemStruct = { + type: matches[1], + headers: [], + rawData: pvtsutils.Convert.FromBase64(base64) + }; + const headersString = matches[2]; + if (headersString) { + const headers = headersString.split(new RegExp(rEolGroup, "g")); + let lastHeader = null; + for (const header of headers) { + const [key, value] = header.split(/:(.*)/); + if (value === void 0) { + if (!lastHeader) throw new Error("Cannot parse PEM string. Incorrect header value"); + lastHeader.value += key.trim(); + } else { + if (lastHeader) pemStruct.headers.push(lastHeader); + lastHeader = { + key, + value: value.trim() + }; + } + } + if (lastHeader) pemStruct.headers.push(lastHeader); + } + res.push(pemStruct); + } + return res; + } + static decode(pem) { + return this.decodeWithHeaders(pem).map((o) => o.rawData); + } + static decodeFirst(pem) { + const items = this.decode(pem); + if (!items.length) throw new RangeError("PEM string doesn't contain any objects"); + return items[0]; + } + static encode(rawData, tag) { + if (Array.isArray(rawData)) { + const raws = new Array(); + if (tag) rawData.forEach((element) => { + if (!pvtsutils.BufferSourceConverter.isBufferSource(element)) throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource"); + raws.push(this.encodeStruct({ + type: tag, + rawData: pvtsutils.BufferSourceConverter.toArrayBuffer(element) + })); + }); + else rawData.forEach((element) => { + if (!("type" in element)) throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut"); + raws.push(this.encodeStruct(element)); + }); + return raws.join("\n"); + } else { + if (!tag) throw new Error("Required argument 'tag' is missed"); + return this.encodeStruct({ + type: tag, + rawData: pvtsutils.BufferSourceConverter.toArrayBuffer(rawData) + }); + } + } + static encodeStruct(pem) { + var _a; + const upperCaseType = pem.type.toLocaleUpperCase(); + const res = []; + res.push(`-----BEGIN ${upperCaseType}-----`); + if ((_a = pem.headers) === null || _a === void 0 ? void 0 : _a.length) { + for (const header of pem.headers) res.push(`${header.key}: ${header.value}`); + res.push(""); + } + const base64 = pvtsutils.Convert.ToBase64(pem.rawData); + let sliced; + let offset = 0; + const rows = Array(); + while (offset < base64.length) { + if (base64.length - offset < 64) sliced = base64.substring(offset); + else { + sliced = base64.substring(offset, offset + 64); + offset += 64; + } + if (sliced.length !== 0) { + rows.push(sliced); + if (sliced.length < 64) break; + } else break; + } + res.push(...rows); + res.push(`-----END ${upperCaseType}-----`); + return res.join("\n"); + } + }; + PemConverter.CertificateTag = "CERTIFICATE"; + PemConverter.CrlTag = "CRL"; + PemConverter.CertificateRequestTag = "CERTIFICATE REQUEST"; + PemConverter.PublicKeyTag = "PUBLIC KEY"; + PemConverter.PrivateKeyTag = "PRIVATE KEY"; + var PemData = class PemData extends AsnData { + static isAsnEncoded(data) { + return pvtsutils.BufferSourceConverter.isBufferSource(data) || typeof data === "string"; + } + static toArrayBuffer(raw) { + if (typeof raw === "string") if (PemConverter.isPem(raw)) return PemConverter.decode(raw)[0]; + else if (pvtsutils.Convert.isHex(raw)) return pvtsutils.Convert.FromHex(raw); + else if (pvtsutils.Convert.isBase64(raw)) return pvtsutils.Convert.FromBase64(raw); + else if (pvtsutils.Convert.isBase64Url(raw)) return pvtsutils.Convert.FromBase64Url(raw); + else throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url"); + else { + const buffer = pvtsutils.BufferSourceConverter.toUint8Array(raw); + if (buffer.length > 0 && buffer[0] === 48) return pvtsutils.BufferSourceConverter.toArrayBuffer(raw); + const stringRaw = pvtsutils.Convert.ToBinary(raw); + if (PemConverter.isPem(stringRaw)) return PemConverter.decode(stringRaw)[0]; + else if (pvtsutils.Convert.isHex(stringRaw)) return pvtsutils.Convert.FromHex(stringRaw); + else if (pvtsutils.Convert.isBase64(stringRaw)) return pvtsutils.Convert.FromBase64(stringRaw); + else if (pvtsutils.Convert.isBase64Url(stringRaw)) return pvtsutils.Convert.FromBase64Url(stringRaw); + throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url"); + } + } + constructor(...args) { + if (PemData.isAsnEncoded(args[0])) super(PemData.toArrayBuffer(args[0]), args[1]); + else super(args[0]); + } + toString(format = "pem") { + switch (format) { + case "pem": return PemConverter.encode(this.rawData, this.tag); + default: return super.toString(format); + } + } + }; + var PublicKey = class PublicKey extends PemData { + static async create(data, crypto = cryptoProvider.get()) { + if (data instanceof PublicKey) return data; + else if (CryptoProvider.isCryptoKey(data)) { + if (data.type !== "public") throw new TypeError("Public key is required"); + return new PublicKey(await crypto.subtle.exportKey("spki", data)); + } else if (data.publicKey) return data.publicKey; + else if (pvtsutils.BufferSourceConverter.isBufferSource(data)) return new PublicKey(data); + else throw new TypeError("Unsupported PublicKeyType"); + } + constructor(param) { + if (PemData.isAsnEncoded(param)) super(param, asn1X509.SubjectPublicKeyInfo); + else super(param); + this.tag = PemConverter.PublicKeyTag; + } + async export(...args) { + let crypto; + let keyUsages = ["verify"]; + let algorithm = { + hash: "SHA-256", + ...this.algorithm + }; + if (args.length > 1) { + algorithm = args[0] || algorithm; + keyUsages = args[1] || keyUsages; + crypto = args[2] || cryptoProvider.get(); + } else crypto = args[0] || cryptoProvider.get(); + let raw = this.rawData; + const asnSpki = asn1Schema.AsnConvert.parse(this.rawData, asn1X509.SubjectPublicKeyInfo); + if (asnSpki.algorithm.algorithm === asn1Rsa.id_RSASSA_PSS) raw = convertSpkiToRsaPkcs1(asnSpki, raw); + return crypto.subtle.importKey("spki", raw, algorithm, true, keyUsages); + } + onInit(asn) { + const algProv = tsyringe.container.resolve(diAlgorithmProvider); + const algorithm = this.algorithm = algProv.toWebAlgorithm(asn.algorithm); + switch (asn.algorithm.algorithm) { + case asn1Rsa.id_rsaEncryption: { + const rsaPublicKey = asn1Schema.AsnConvert.parse(asn.subjectPublicKey, asn1Rsa.RSAPublicKey); + const modulus = pvtsutils.BufferSourceConverter.toUint8Array(rsaPublicKey.modulus); + algorithm.publicExponent = pvtsutils.BufferSourceConverter.toUint8Array(rsaPublicKey.publicExponent); + algorithm.modulusLength = (!modulus[0] ? modulus.slice(1) : modulus).byteLength << 3; + break; + } + } + } + async getThumbprint(...args) { + var _a; + let crypto; + let algorithm = "SHA-1"; + if (args.length >= 1 && !((_a = args[0]) === null || _a === void 0 ? void 0 : _a.subtle)) { + algorithm = args[0] || algorithm; + crypto = args[1] || cryptoProvider.get(); + } else crypto = args[0] || cryptoProvider.get(); + return await crypto.subtle.digest(algorithm, this.rawData); + } + async getKeyIdentifier(...args) { + let crypto; + let algorithm = "SHA-1"; + if (args.length === 1) if (typeof args[0] === "string") { + algorithm = args[0]; + crypto = cryptoProvider.get(); + } else crypto = args[0]; + else if (args.length === 2) { + algorithm = args[0]; + crypto = args[1]; + } else crypto = cryptoProvider.get(); + const asn = asn1Schema.AsnConvert.parse(this.rawData, asn1X509.SubjectPublicKeyInfo); + return await crypto.subtle.digest(algorithm, asn.subjectPublicKey); + } + toTextObject() { + const obj = this.toTextObjectEmpty(); + const asn = asn1Schema.AsnConvert.parse(this.rawData, asn1X509.SubjectPublicKeyInfo); + obj["Algorithm"] = TextConverter.serializeAlgorithm(asn.algorithm); + switch (asn.algorithm.algorithm) { + case asn1Ecc.id_ecPublicKey: + obj["EC Point"] = asn.subjectPublicKey; + break; + case asn1Rsa.id_rsaEncryption: + default: obj["Raw Data"] = asn.subjectPublicKey; + } + return obj; + } + }; + function convertSpkiToRsaPkcs1(asnSpki, raw) { + asnSpki.algorithm = new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa.id_rsaEncryption, + parameters: null + }); + raw = asn1Schema.AsnConvert.serialize(asnSpki); + return raw; + } + var AuthorityKeyIdentifierExtension = class AuthorityKeyIdentifierExtension extends Extension { + static async create(param, critical = false, crypto = cryptoProvider.get()) { + if ("name" in param && "serialNumber" in param) return new AuthorityKeyIdentifierExtension(param, critical); + const id = await (await PublicKey.create(param, crypto)).getKeyIdentifier(crypto); + return new AuthorityKeyIdentifierExtension(pvtsutils.Convert.ToHex(id), critical); + } + constructor(...args) { + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) super(args[0]); + else if (typeof args[0] === "string") { + const value = new asn1X509__namespace.AuthorityKeyIdentifier({ keyIdentifier: new asn1X509__namespace.KeyIdentifier(pvtsutils.Convert.FromHex(args[0])) }); + super(asn1X509__namespace.id_ce_authorityKeyIdentifier, args[1], asn1Schema.AsnConvert.serialize(value)); + } else { + const certId = args[0]; + const certIdName = certId.name instanceof GeneralNames ? asn1Schema.AsnConvert.parse(certId.name.rawData, asn1X509__namespace.GeneralNames) : certId.name; + const value = new asn1X509__namespace.AuthorityKeyIdentifier({ + authorityCertIssuer: certIdName, + authorityCertSerialNumber: pvtsutils.Convert.FromHex(certId.serialNumber) + }); + super(asn1X509__namespace.id_ce_authorityKeyIdentifier, args[1], asn1Schema.AsnConvert.serialize(value)); + } + } + onInit(asn) { + super.onInit(asn); + const aki = asn1Schema.AsnConvert.parse(asn.extnValue, asn1X509__namespace.AuthorityKeyIdentifier); + if (aki.keyIdentifier) this.keyId = pvtsutils.Convert.ToHex(aki.keyIdentifier); + if (aki.authorityCertIssuer || aki.authorityCertSerialNumber) this.certId = { + name: aki.authorityCertIssuer || [], + serialNumber: aki.authorityCertSerialNumber ? pvtsutils.Convert.ToHex(aki.authorityCertSerialNumber) : "" + }; + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + const asn = asn1Schema.AsnConvert.parse(this.value, asn1X509__namespace.AuthorityKeyIdentifier); + if (asn.authorityCertIssuer) obj["Authority Issuer"] = new GeneralNames(asn.authorityCertIssuer).toTextObject(); + if (asn.authorityCertSerialNumber) obj["Authority Serial Number"] = asn.authorityCertSerialNumber; + if (asn.keyIdentifier) obj[""] = asn.keyIdentifier; + return obj; + } + }; + AuthorityKeyIdentifierExtension.NAME = "Authority Key Identifier"; + var BasicConstraintsExtension = class extends Extension { + constructor(...args) { + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) { + super(args[0]); + const value = asn1Schema.AsnConvert.parse(this.value, asn1X509.BasicConstraints); + this.ca = value.cA; + this.pathLength = value.pathLenConstraint; + } else { + const value = new asn1X509.BasicConstraints({ + cA: args[0], + pathLenConstraint: args[1] + }); + super(asn1X509.id_ce_basicConstraints, args[2], asn1Schema.AsnConvert.serialize(value)); + this.ca = args[0]; + this.pathLength = args[1]; + } + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + if (this.ca) obj["CA"] = this.ca; + if (this.pathLength !== void 0) obj["Path Length"] = this.pathLength; + return obj; + } + }; + BasicConstraintsExtension.NAME = "Basic Constraints"; + exports.ExtendedKeyUsage = void 0; + (function(ExtendedKeyUsage) { + ExtendedKeyUsage["serverAuth"] = "1.3.6.1.5.5.7.3.1"; + ExtendedKeyUsage["clientAuth"] = "1.3.6.1.5.5.7.3.2"; + ExtendedKeyUsage["codeSigning"] = "1.3.6.1.5.5.7.3.3"; + ExtendedKeyUsage["emailProtection"] = "1.3.6.1.5.5.7.3.4"; + ExtendedKeyUsage["timeStamping"] = "1.3.6.1.5.5.7.3.8"; + ExtendedKeyUsage["ocspSigning"] = "1.3.6.1.5.5.7.3.9"; + })(exports.ExtendedKeyUsage || (exports.ExtendedKeyUsage = {})); + var ExtendedKeyUsageExtension = class extends Extension { + constructor(...args) { + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) { + super(args[0]); + const value = asn1Schema.AsnConvert.parse(this.value, asn1X509__namespace.ExtendedKeyUsage); + this.usages = value.map((o) => o); + } else { + const value = new asn1X509__namespace.ExtendedKeyUsage(args[0]); + super(asn1X509__namespace.id_ce_extKeyUsage, args[1], asn1Schema.AsnConvert.serialize(value)); + this.usages = args[0]; + } + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj[""] = this.usages.map((o) => OidSerializer.toString(o)).join(", "); + return obj; + } + }; + ExtendedKeyUsageExtension.NAME = "Extended Key Usages"; + exports.KeyUsageFlags = void 0; + (function(KeyUsageFlags) { + KeyUsageFlags[KeyUsageFlags["digitalSignature"] = 1] = "digitalSignature"; + KeyUsageFlags[KeyUsageFlags["nonRepudiation"] = 2] = "nonRepudiation"; + KeyUsageFlags[KeyUsageFlags["keyEncipherment"] = 4] = "keyEncipherment"; + KeyUsageFlags[KeyUsageFlags["dataEncipherment"] = 8] = "dataEncipherment"; + KeyUsageFlags[KeyUsageFlags["keyAgreement"] = 16] = "keyAgreement"; + KeyUsageFlags[KeyUsageFlags["keyCertSign"] = 32] = "keyCertSign"; + KeyUsageFlags[KeyUsageFlags["cRLSign"] = 64] = "cRLSign"; + KeyUsageFlags[KeyUsageFlags["encipherOnly"] = 128] = "encipherOnly"; + KeyUsageFlags[KeyUsageFlags["decipherOnly"] = 256] = "decipherOnly"; + })(exports.KeyUsageFlags || (exports.KeyUsageFlags = {})); + var KeyUsagesExtension = class extends Extension { + constructor(...args) { + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) { + super(args[0]); + const value = asn1Schema.AsnConvert.parse(this.value, asn1X509.KeyUsage); + this.usages = value.toNumber(); + } else { + const value = new asn1X509.KeyUsage(args[0]); + super(asn1X509.id_ce_keyUsage, args[1], asn1Schema.AsnConvert.serialize(value)); + this.usages = args[0]; + } + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj[""] = asn1Schema.AsnConvert.parse(this.value, asn1X509.KeyUsage).toJSON().join(", "); + return obj; + } + }; + KeyUsagesExtension.NAME = "Key Usages"; + var SubjectKeyIdentifierExtension = class SubjectKeyIdentifierExtension extends Extension { + static async create(publicKey, critical = false, crypto = cryptoProvider.get()) { + const id = await (await PublicKey.create(publicKey, crypto)).getKeyIdentifier(crypto); + return new SubjectKeyIdentifierExtension(pvtsutils.Convert.ToHex(id), critical); + } + constructor(...args) { + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) { + super(args[0]); + const value = asn1Schema.AsnConvert.parse(this.value, asn1X509__namespace.SubjectKeyIdentifier); + this.keyId = pvtsutils.Convert.ToHex(value); + } else { + const identifier = typeof args[0] === "string" ? pvtsutils.Convert.FromHex(args[0]) : args[0]; + const value = new asn1X509__namespace.SubjectKeyIdentifier(identifier); + super(asn1X509__namespace.id_ce_subjectKeyIdentifier, args[1], asn1Schema.AsnConvert.serialize(value)); + this.keyId = pvtsutils.Convert.ToHex(identifier); + } + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj[""] = asn1Schema.AsnConvert.parse(this.value, asn1X509__namespace.SubjectKeyIdentifier); + return obj; + } + }; + SubjectKeyIdentifierExtension.NAME = "Subject Key Identifier"; + var SubjectAlternativeNameExtension = class extends Extension { + constructor(...args) { + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) super(args[0]); + else super(asn1X509__namespace.id_ce_subjectAltName, args[1], new GeneralNames(args[0] || []).rawData); + } + onInit(asn) { + super.onInit(asn); + const value = asn1Schema.AsnConvert.parse(asn.extnValue, asn1X509__namespace.SubjectAlternativeName); + this.names = new GeneralNames(value); + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + const namesObj = this.names.toTextObject(); + for (const key in namesObj) obj[key] = namesObj[key]; + return obj; + } + }; + SubjectAlternativeNameExtension.NAME = "Subject Alternative Name"; + var ExtensionFactory = class { + static register(id, type) { + this.items.set(id, type); + } + static create(data) { + const extension = new Extension(data); + const Type = this.items.get(extension.type); + if (Type) return new Type(data); + return extension; + } + }; + ExtensionFactory.items = /* @__PURE__ */ new Map(); + var CertificatePolicyExtension = class extends Extension { + constructor(...args) { + var _a; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) { + super(args[0]); + const asnPolicies = asn1Schema.AsnConvert.parse(this.value, asn1X509__namespace.CertificatePolicies); + this.policies = asnPolicies.map((o) => o.policyIdentifier); + } else { + const policies = args[0]; + const critical = (_a = args[1]) !== null && _a !== void 0 ? _a : false; + const value = new asn1X509__namespace.CertificatePolicies(policies.map((o) => new asn1X509__namespace.PolicyInformation({ policyIdentifier: o }))); + super(asn1X509__namespace.id_ce_certificatePolicies, critical, asn1Schema.AsnConvert.serialize(value)); + this.policies = policies; + } + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj["Policy"] = this.policies.map((o) => new TextObject("", {}, OidSerializer.toString(o))); + return obj; + } + }; + CertificatePolicyExtension.NAME = "Certificate Policies"; + ExtensionFactory.register(asn1X509__namespace.id_ce_certificatePolicies, CertificatePolicyExtension); + var CRLDistributionPointsExtension = class extends Extension { + constructor(...args) { + var _a; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) super(args[0]); + else if (Array.isArray(args[0]) && typeof args[0][0] === "string") { + const dps = args[0].map((url) => { + return new asn1X509__namespace.DistributionPoint({ distributionPoint: new asn1X509__namespace.DistributionPointName({ fullName: [new asn1X509__namespace.GeneralName({ uniformResourceIdentifier: url })] }) }); + }); + const value = new asn1X509__namespace.CRLDistributionPoints(dps); + super(asn1X509__namespace.id_ce_cRLDistributionPoints, args[1], asn1Schema.AsnConvert.serialize(value)); + } else { + const value = new asn1X509__namespace.CRLDistributionPoints(args[0]); + super(asn1X509__namespace.id_ce_cRLDistributionPoints, args[1], asn1Schema.AsnConvert.serialize(value)); + } + (_a = this.distributionPoints) !== null && _a !== void 0 || (this.distributionPoints = []); + } + onInit(asn) { + super.onInit(asn); + const crlExt = asn1Schema.AsnConvert.parse(asn.extnValue, asn1X509__namespace.CRLDistributionPoints); + this.distributionPoints = crlExt; + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj["Distribution Point"] = this.distributionPoints.map((dp) => { + var _a; + const dpObj = {}; + if (dp.distributionPoint) dpObj[""] = (_a = dp.distributionPoint.fullName) === null || _a === void 0 ? void 0 : _a.map((name) => new GeneralName(name).toString()).join(", "); + if (dp.reasons) dpObj["Reasons"] = dp.reasons.toString(); + if (dp.cRLIssuer) dpObj["CRL Issuer"] = dp.cRLIssuer.map((issuer) => issuer.toString()).join(", "); + return dpObj; + }); + return obj; + } + }; + CRLDistributionPointsExtension.NAME = "CRL Distribution Points"; + var AuthorityInfoAccessExtension = class extends Extension { + constructor(...args) { + var _a, _b, _c, _d; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) super(args[0]); + else if (args[0] instanceof asn1X509__namespace.AuthorityInfoAccessSyntax) { + const value = new asn1X509__namespace.AuthorityInfoAccessSyntax(args[0]); + super(asn1X509__namespace.id_pe_authorityInfoAccess, args[1], asn1Schema.AsnConvert.serialize(value)); + } else { + const params = args[0]; + const value = new asn1X509__namespace.AuthorityInfoAccessSyntax(); + addAccessDescriptions(value, params, asn1X509__namespace.id_ad_ocsp, "ocsp"); + addAccessDescriptions(value, params, asn1X509__namespace.id_ad_caIssuers, "caIssuers"); + addAccessDescriptions(value, params, asn1X509__namespace.id_ad_timeStamping, "timeStamping"); + addAccessDescriptions(value, params, asn1X509__namespace.id_ad_caRepository, "caRepository"); + super(asn1X509__namespace.id_pe_authorityInfoAccess, args[1], asn1Schema.AsnConvert.serialize(value)); + } + (_a = this.ocsp) !== null && _a !== void 0 || (this.ocsp = []); + (_b = this.caIssuers) !== null && _b !== void 0 || (this.caIssuers = []); + (_c = this.timeStamping) !== null && _c !== void 0 || (this.timeStamping = []); + (_d = this.caRepository) !== null && _d !== void 0 || (this.caRepository = []); + } + onInit(asn) { + super.onInit(asn); + this.ocsp = []; + this.caIssuers = []; + this.timeStamping = []; + this.caRepository = []; + asn1Schema.AsnConvert.parse(asn.extnValue, asn1X509__namespace.AuthorityInfoAccessSyntax).forEach((accessDescription) => { + switch (accessDescription.accessMethod) { + case asn1X509__namespace.id_ad_ocsp: + this.ocsp.push(new GeneralName(accessDescription.accessLocation)); + break; + case asn1X509__namespace.id_ad_caIssuers: + this.caIssuers.push(new GeneralName(accessDescription.accessLocation)); + break; + case asn1X509__namespace.id_ad_timeStamping: + this.timeStamping.push(new GeneralName(accessDescription.accessLocation)); + break; + case asn1X509__namespace.id_ad_caRepository: + this.caRepository.push(new GeneralName(accessDescription.accessLocation)); + break; + } + }); + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + if (this.ocsp.length) addUrlsToObject(obj, "OCSP", this.ocsp); + if (this.caIssuers.length) addUrlsToObject(obj, "CA Issuers", this.caIssuers); + if (this.timeStamping.length) addUrlsToObject(obj, "Time Stamping", this.timeStamping); + if (this.caRepository.length) addUrlsToObject(obj, "CA Repository", this.caRepository); + return obj; + } + }; + AuthorityInfoAccessExtension.NAME = "Authority Info Access"; + function addUrlsToObject(obj, key, urls) { + if (urls.length === 1) obj[key] = urls[0].toTextObject(); + else { + const names = new TextObject(""); + urls.forEach((name, index) => { + const nameObj = name.toTextObject(); + const indexedKey = `${nameObj[TextObject.NAME]} ${index + 1}`; + let field = names[indexedKey]; + if (!Array.isArray(field)) { + field = []; + names[indexedKey] = field; + } + field.push(nameObj); + }); + obj[key] = names; + } + } + function addAccessDescriptions(value, params, method, key) { + const items = params[key]; + if (items) (Array.isArray(items) ? items : [items]).forEach((url) => { + if (typeof url === "string") url = new GeneralName("url", url); + value.push(new asn1X509__namespace.AccessDescription({ + accessMethod: method, + accessLocation: asn1Schema.AsnConvert.parse(url.rawData, asn1X509__namespace.GeneralName) + })); + }); + } + var IssuerAlternativeNameExtension = class extends Extension { + constructor(...args) { + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) super(args[0]); + else super(asn1X509__namespace.id_ce_issuerAltName, args[1], new GeneralNames(args[0] || []).rawData); + } + onInit(asn) { + super.onInit(asn); + const value = asn1Schema.AsnConvert.parse(asn.extnValue, asn1X509__namespace.GeneralNames); + this.names = new GeneralNames(value); + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + const namesObj = this.names.toTextObject(); + for (const key in namesObj) obj[key] = namesObj[key]; + return obj; + } + }; + IssuerAlternativeNameExtension.NAME = "Issuer Alternative Name"; + var Attribute = class Attribute extends AsnData { + constructor(...args) { + let raw; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) raw = pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]); + else { + const type = args[0]; + const values = Array.isArray(args[1]) ? args[1].map((o) => pvtsutils.BufferSourceConverter.toArrayBuffer(o)) : []; + raw = asn1Schema.AsnConvert.serialize(new asn1X509.Attribute({ + type, + values + })); + } + super(raw, asn1X509.Attribute); + } + onInit(asn) { + this.type = asn.type; + this.values = asn.values; + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj["Value"] = this.values.map((o) => new TextObject("", { "": o })); + return obj; + } + toTextObjectWithoutValue() { + const obj = this.toTextObjectEmpty(); + if (obj[TextObject.NAME] === Attribute.NAME) obj[TextObject.NAME] = OidSerializer.toString(this.type); + return obj; + } + }; + Attribute.NAME = "Attribute"; + var ChallengePasswordAttribute = class extends Attribute { + constructor(...args) { + var _a; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) super(args[0]); + else { + const value = new asnPkcs9__namespace.ChallengePassword({ printableString: args[0] }); + super(asnPkcs9__namespace.id_pkcs9_at_challengePassword, [asn1Schema.AsnConvert.serialize(value)]); + } + (_a = this.password) !== null && _a !== void 0 || (this.password = ""); + } + onInit(asn) { + super.onInit(asn); + if (this.values[0]) { + const value = asn1Schema.AsnConvert.parse(this.values[0], asnPkcs9__namespace.ChallengePassword); + this.password = value.toString(); + } + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + obj[TextObject.VALUE] = this.password; + return obj; + } + }; + ChallengePasswordAttribute.NAME = "Challenge Password"; + var ExtensionsAttribute = class extends Attribute { + constructor(...args) { + var _a; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) super(args[0]); + else { + const extensions = args[0]; + const value = new asn1X509__namespace.Extensions(); + for (const extension of extensions) value.push(asn1Schema.AsnConvert.parse(extension.rawData, asn1X509__namespace.Extension)); + super(asnPkcs9__namespace.id_pkcs9_at_extensionRequest, [asn1Schema.AsnConvert.serialize(value)]); + } + (_a = this.items) !== null && _a !== void 0 || (this.items = []); + } + onInit(asn) { + super.onInit(asn); + if (this.values[0]) { + const value = asn1Schema.AsnConvert.parse(this.values[0], asn1X509__namespace.Extensions); + this.items = value.map((o) => ExtensionFactory.create(asn1Schema.AsnConvert.serialize(o))); + } + } + toTextObject() { + const obj = this.toTextObjectWithoutValue(); + const extensions = this.items.map((o) => o.toTextObject()); + for (const extension of extensions) obj[extension[TextObject.NAME]] = extension; + return obj; + } + }; + ExtensionsAttribute.NAME = "Extensions"; + var AttributeFactory = class { + static register(id, type) { + this.items.set(id, type); + } + static create(data) { + const attribute = new Attribute(data); + const Type = this.items.get(attribute.type); + if (Type) return new Type(data); + return attribute; + } + }; + AttributeFactory.items = /* @__PURE__ */ new Map(); + const diAsnSignatureFormatter = "crypto.signatureFormatter"; + var AsnDefaultSignatureFormatter = class { + toAsnSignature(algorithm, signature) { + return pvtsutils.BufferSourceConverter.toArrayBuffer(signature); + } + toWebSignature(algorithm, signature) { + return pvtsutils.BufferSourceConverter.toArrayBuffer(signature); + } + }; + var RsaAlgorithm_1; + exports.RsaAlgorithm = RsaAlgorithm_1 = class RsaAlgorithm { + static createPssParams(hash, saltLength) { + const hashAlgorithm = RsaAlgorithm_1.getHashAlgorithm(hash); + if (!hashAlgorithm) return null; + return new asn1Rsa__namespace.RsaSaPssParams({ + hashAlgorithm, + maskGenAlgorithm: new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_mgf1, + parameters: asn1Schema.AsnConvert.serialize(hashAlgorithm) + }), + saltLength + }); + } + static getHashAlgorithm(alg) { + const algProv = tsyringe.container.resolve(diAlgorithmProvider); + if (typeof alg === "string") return algProv.toAsnAlgorithm({ name: alg }); + if (typeof alg === "object" && alg && "name" in alg) return algProv.toAsnAlgorithm(alg); + return null; + } + toAsnAlgorithm(alg) { + switch (alg.name.toLowerCase()) { + case "rsassa-pkcs1-v1_5": + if ("hash" in alg) { + let hash; + if (typeof alg.hash === "string") hash = alg.hash; + else if (alg.hash && typeof alg.hash === "object" && "name" in alg.hash && typeof alg.hash.name === "string") hash = alg.hash.name.toUpperCase(); + else throw new Error("Cannot get hash algorithm name"); + switch (hash.toLowerCase()) { + case "sha-1": return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_sha1WithRSAEncryption, + parameters: null + }); + case "sha-256": return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_sha256WithRSAEncryption, + parameters: null + }); + case "sha-384": return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_sha384WithRSAEncryption, + parameters: null + }); + case "sha-512": return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_sha512WithRSAEncryption, + parameters: null + }); + } + } else return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_rsaEncryption, + parameters: null + }); + break; + case "rsa-pss": if ("hash" in alg) { + if (!("saltLength" in alg && typeof alg.saltLength === "number")) throw new Error("Cannot get 'saltLength' from 'alg' argument"); + const pssParams = RsaAlgorithm_1.createPssParams(alg.hash, alg.saltLength); + if (!pssParams) throw new Error("Cannot create PSS parameters"); + return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_RSASSA_PSS, + parameters: asn1Schema.AsnConvert.serialize(pssParams) + }); + } else return new asn1X509.AlgorithmIdentifier({ + algorithm: asn1Rsa__namespace.id_RSASSA_PSS, + parameters: null + }); + } + return null; + } + toWebAlgorithm(alg) { + switch (alg.algorithm) { + case asn1Rsa__namespace.id_rsaEncryption: return { name: "RSASSA-PKCS1-v1_5" }; + case asn1Rsa__namespace.id_sha1WithRSAEncryption: return { + name: "RSASSA-PKCS1-v1_5", + hash: { name: "SHA-1" } + }; + case asn1Rsa__namespace.id_sha256WithRSAEncryption: return { + name: "RSASSA-PKCS1-v1_5", + hash: { name: "SHA-256" } + }; + case asn1Rsa__namespace.id_sha384WithRSAEncryption: return { + name: "RSASSA-PKCS1-v1_5", + hash: { name: "SHA-384" } + }; + case asn1Rsa__namespace.id_sha512WithRSAEncryption: return { + name: "RSASSA-PKCS1-v1_5", + hash: { name: "SHA-512" } + }; + case asn1Rsa__namespace.id_RSASSA_PSS: if (alg.parameters) { + const pssParams = asn1Schema.AsnConvert.parse(alg.parameters, asn1Rsa__namespace.RsaSaPssParams); + return { + name: "RSA-PSS", + hash: tsyringe.container.resolve(diAlgorithmProvider).toWebAlgorithm(pssParams.hashAlgorithm), + saltLength: pssParams.saltLength + }; + } else return { name: "RSA-PSS" }; + } + return null; + } + }; + exports.RsaAlgorithm = RsaAlgorithm_1 = tslib.__decorate([tsyringe.injectable()], exports.RsaAlgorithm); + tsyringe.container.registerSingleton(diAlgorithm, exports.RsaAlgorithm); + exports.ShaAlgorithm = class ShaAlgorithm { + toAsnAlgorithm(alg) { + switch (alg.name.toLowerCase()) { + case "sha-1": return new asn1X509.AlgorithmIdentifier({ algorithm: asn1Rsa.id_sha1 }); + case "sha-256": return new asn1X509.AlgorithmIdentifier({ algorithm: asn1Rsa.id_sha256 }); + case "sha-384": return new asn1X509.AlgorithmIdentifier({ algorithm: asn1Rsa.id_sha384 }); + case "sha-512": return new asn1X509.AlgorithmIdentifier({ algorithm: asn1Rsa.id_sha512 }); + } + return null; + } + toWebAlgorithm(alg) { + switch (alg.algorithm) { + case asn1Rsa.id_sha1: return { name: "SHA-1" }; + case asn1Rsa.id_sha256: return { name: "SHA-256" }; + case asn1Rsa.id_sha384: return { name: "SHA-384" }; + case asn1Rsa.id_sha512: return { name: "SHA-512" }; + } + return null; + } + }; + exports.ShaAlgorithm = tslib.__decorate([tsyringe.injectable()], exports.ShaAlgorithm); + tsyringe.container.registerSingleton(diAlgorithm, exports.ShaAlgorithm); + var AsnEcSignatureFormatter = class AsnEcSignatureFormatter { + addPadding(pointSize, data) { + const bytes = pvtsutils.BufferSourceConverter.toUint8Array(data); + const res = new Uint8Array(pointSize); + res.set(bytes, pointSize - bytes.length); + return res.buffer; + } + removePadding(data, positive = false) { + let bytes = pvtsutils.BufferSourceConverter.toUint8Array(data); + for (let i = 0; i < bytes.length; i++) { + if (!bytes[i]) continue; + bytes = bytes.slice(i); + break; + } + if (positive && bytes[0] > 127) { + const result = new Uint8Array(bytes.length + 1); + result.set(bytes, 1); + return result.buffer; + } + return bytes.buffer; + } + toAsnSignature(algorithm, signature) { + if (algorithm.name === "ECDSA") { + const namedCurve = algorithm.namedCurve; + const pointSize = AsnEcSignatureFormatter.namedCurveSize.get(namedCurve) || AsnEcSignatureFormatter.defaultNamedCurveSize; + const ecSignature = new asn1Ecc.ECDSASigValue(); + const uint8Signature = pvtsutils.BufferSourceConverter.toUint8Array(signature); + ecSignature.r = this.removePadding(uint8Signature.slice(0, pointSize), true); + ecSignature.s = this.removePadding(uint8Signature.slice(pointSize, pointSize + pointSize), true); + return asn1Schema.AsnConvert.serialize(ecSignature); + } + return null; + } + toWebSignature(algorithm, signature) { + if (algorithm.name === "ECDSA") { + const ecSigValue = asn1Schema.AsnConvert.parse(signature, asn1Ecc.ECDSASigValue); + const namedCurve = algorithm.namedCurve; + const pointSize = AsnEcSignatureFormatter.namedCurveSize.get(namedCurve) || AsnEcSignatureFormatter.defaultNamedCurveSize; + const r = this.addPadding(pointSize, this.removePadding(ecSigValue.r)); + const s = this.addPadding(pointSize, this.removePadding(ecSigValue.s)); + return pvtsutils.combine(r, s); + } + return null; + } + }; + AsnEcSignatureFormatter.namedCurveSize = /* @__PURE__ */ new Map(); + AsnEcSignatureFormatter.defaultNamedCurveSize = 32; + const idX25519 = "1.3.101.110"; + const idX448 = "1.3.101.111"; + const idEd25519 = "1.3.101.112"; + const idEd448 = "1.3.101.113"; + exports.EdAlgorithm = class EdAlgorithm { + toAsnAlgorithm(alg) { + let algorithm = null; + switch (alg.name.toLowerCase()) { + case "ed25519": + algorithm = idEd25519; + break; + case "x25519": + algorithm = idX25519; + break; + case "eddsa": + switch (alg.namedCurve.toLowerCase()) { + case "ed25519": + algorithm = idEd25519; + break; + case "ed448": + algorithm = idEd448; + break; + } + break; + case "ecdh-es": switch (alg.namedCurve.toLowerCase()) { + case "x25519": + algorithm = idX25519; + break; + case "x448": + algorithm = idX448; + break; + } + } + if (algorithm) return new asn1X509.AlgorithmIdentifier({ algorithm }); + return null; + } + toWebAlgorithm(alg) { + switch (alg.algorithm) { + case idEd25519: return { name: "Ed25519" }; + case idEd448: return { + name: "EdDSA", + namedCurve: "Ed448" + }; + case idX25519: return { name: "X25519" }; + case idX448: return { + name: "ECDH-ES", + namedCurve: "X448" + }; + } + return null; + } + }; + exports.EdAlgorithm = tslib.__decorate([tsyringe.injectable()], exports.EdAlgorithm); + tsyringe.container.registerSingleton(diAlgorithm, exports.EdAlgorithm); + var _Pkcs10CertificateRequest_tbs, _Pkcs10CertificateRequest_subjectName, _Pkcs10CertificateRequest_subject, _Pkcs10CertificateRequest_signatureAlgorithm, _Pkcs10CertificateRequest_signature, _Pkcs10CertificateRequest_publicKey, _Pkcs10CertificateRequest_attributes, _Pkcs10CertificateRequest_extensions; + var Pkcs10CertificateRequest = class extends PemData { + get subjectName() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subjectName, "f")) tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_subjectName, new Name(this.asn.certificationRequestInfo.subject), "f"); + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subjectName, "f"); + } + get subject() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subject, "f")) tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_subject, this.subjectName.toString(), "f"); + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_subject, "f"); + } + get signatureAlgorithm() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_signatureAlgorithm, "f")) { + const algProv = tsyringe.container.resolve(diAlgorithmProvider); + tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_signatureAlgorithm, algProv.toWebAlgorithm(this.asn.signatureAlgorithm), "f"); + } + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_signatureAlgorithm, "f"); + } + get signature() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_signature, "f")) tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_signature, this.asn.signature, "f"); + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_signature, "f"); + } + get publicKey() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_publicKey, "f")) tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_publicKey, new PublicKey(this.asn.certificationRequestInfo.subjectPKInfo), "f"); + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_publicKey, "f"); + } + get attributes() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_attributes, "f")) tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_attributes, this.asn.certificationRequestInfo.attributes.map((o) => AttributeFactory.create(asn1Schema.AsnConvert.serialize(o))), "f"); + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_attributes, "f"); + } + get extensions() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_extensions, "f")) { + tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_extensions, [], "f"); + const extensions = this.getAttribute(asnPkcs9.id_pkcs9_at_extensionRequest); + if (extensions instanceof ExtensionsAttribute) tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_extensions, extensions.items, "f"); + } + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_extensions, "f"); + } + get tbs() { + if (!tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_tbs, "f")) tslib.__classPrivateFieldSet(this, _Pkcs10CertificateRequest_tbs, this.asn.certificationRequestInfoRaw || asn1Schema.AsnConvert.serialize(this.asn.certificationRequestInfo), "f"); + return tslib.__classPrivateFieldGet(this, _Pkcs10CertificateRequest_tbs, "f"); + } + constructor(param) { + const args = PemData.isAsnEncoded(param) ? [param, asn1Csr.CertificationRequest] : [param]; + super(args[0], args[1]); + _Pkcs10CertificateRequest_tbs.set(this, void 0); + _Pkcs10CertificateRequest_subjectName.set(this, void 0); + _Pkcs10CertificateRequest_subject.set(this, void 0); + _Pkcs10CertificateRequest_signatureAlgorithm.set(this, void 0); + _Pkcs10CertificateRequest_signature.set(this, void 0); + _Pkcs10CertificateRequest_publicKey.set(this, void 0); + _Pkcs10CertificateRequest_attributes.set(this, void 0); + _Pkcs10CertificateRequest_extensions.set(this, void 0); + this.tag = PemConverter.CertificateRequestTag; + } + onInit(_asn) {} + getAttribute(type) { + for (const attr of this.attributes) if (attr.type === type) return attr; + return null; + } + getAttributes(type) { + return this.attributes.filter((o) => o.type === type); + } + getExtension(type) { + for (const ext of this.extensions) if (ext.type === type) return ext; + return null; + } + getExtensions(type) { + return this.extensions.filter((o) => o.type === type); + } + async verify(crypto = cryptoProvider.get()) { + const algorithm = { + ...this.publicKey.algorithm, + ...this.signatureAlgorithm + }; + const publicKey = await this.publicKey.export(algorithm, ["verify"], crypto); + const signatureFormatters = tsyringe.container.resolveAll(diAsnSignatureFormatter).reverse(); + let signature = null; + for (const signatureFormatter of signatureFormatters) { + signature = signatureFormatter.toWebSignature(algorithm, this.signature); + if (signature) break; + } + if (!signature) throw Error("Cannot convert WebCrypto signature value to ASN.1 format"); + return await crypto.subtle.verify(this.signatureAlgorithm, publicKey, signature, this.tbs); + } + toTextObject() { + const obj = this.toTextObjectEmpty(); + const req = asn1Schema.AsnConvert.parse(this.rawData, asn1Csr.CertificationRequest); + const tbs = req.certificationRequestInfo; + const data = new TextObject("", { + Version: `${asn1X509.Version[tbs.version]} (${tbs.version})`, + Subject: this.subject, + "Subject Public Key Info": this.publicKey + }); + if (this.attributes.length) { + const attrs = new TextObject(""); + for (const ext of this.attributes) { + const attrObj = ext.toTextObject(); + attrs[attrObj[TextObject.NAME]] = attrObj; + } + data["Attributes"] = attrs; + } + obj["Data"] = data; + obj["Signature"] = new TextObject("", { + Algorithm: TextConverter.serializeAlgorithm(req.signatureAlgorithm), + "": req.signature + }); + return obj; + } + }; + _Pkcs10CertificateRequest_tbs = /* @__PURE__ */ new WeakMap(), _Pkcs10CertificateRequest_subjectName = /* @__PURE__ */ new WeakMap(), _Pkcs10CertificateRequest_subject = /* @__PURE__ */ new WeakMap(), _Pkcs10CertificateRequest_signatureAlgorithm = /* @__PURE__ */ new WeakMap(), _Pkcs10CertificateRequest_signature = /* @__PURE__ */ new WeakMap(), _Pkcs10CertificateRequest_publicKey = /* @__PURE__ */ new WeakMap(), _Pkcs10CertificateRequest_attributes = /* @__PURE__ */ new WeakMap(), _Pkcs10CertificateRequest_extensions = /* @__PURE__ */ new WeakMap(); + Pkcs10CertificateRequest.NAME = "PKCS#10 Certificate Request"; + var Pkcs10CertificateRequestGenerator = class { + static async create(params, crypto = cryptoProvider.get()) { + if (!params.keys.privateKey) throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty"); + if (!params.keys.publicKey) throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty"); + const spki = await crypto.subtle.exportKey("spki", params.keys.publicKey); + const asnReq = new asn1Csr.CertificationRequest({ certificationRequestInfo: new asn1Csr.CertificationRequestInfo({ subjectPKInfo: asn1Schema.AsnConvert.parse(spki, asn1X509.SubjectPublicKeyInfo) }) }); + if (params.name) { + const name = params.name instanceof Name ? params.name : new Name(params.name); + asnReq.certificationRequestInfo.subject = asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509.Name); + } + if (params.attributes) for (const o of params.attributes) asnReq.certificationRequestInfo.attributes.push(asn1Schema.AsnConvert.parse(o.rawData, asn1X509.Attribute)); + if (params.extensions && params.extensions.length) { + const attr = new asn1X509.Attribute({ type: asnPkcs9.id_pkcs9_at_extensionRequest }); + const extensions = new asn1X509.Extensions(); + for (const o of params.extensions) extensions.push(asn1Schema.AsnConvert.parse(o.rawData, asn1X509.Extension)); + attr.values.push(asn1Schema.AsnConvert.serialize(extensions)); + asnReq.certificationRequestInfo.attributes.push(attr); + } + const signingAlgorithm = { + ...params.signingAlgorithm, + ...params.keys.privateKey.algorithm + }; + asnReq.signatureAlgorithm = tsyringe.container.resolve(diAlgorithmProvider).toAsnAlgorithm(signingAlgorithm); + const tbs = asn1Schema.AsnConvert.serialize(asnReq.certificationRequestInfo); + const signature = await crypto.subtle.sign(signingAlgorithm, params.keys.privateKey, tbs); + const signatureFormatters = tsyringe.container.resolveAll(diAsnSignatureFormatter).reverse(); + let asnSignature = null; + for (const signatureFormatter of signatureFormatters) { + asnSignature = signatureFormatter.toAsnSignature(signingAlgorithm, signature); + if (asnSignature) break; + } + if (!asnSignature) throw Error("Cannot convert WebCrypto signature value to ASN.1 format"); + asnReq.signature = asnSignature; + return new Pkcs10CertificateRequest(asn1Schema.AsnConvert.serialize(asnReq)); + } + }; + var _X509Certificate_tbs, _X509Certificate_serialNumber, _X509Certificate_subjectName, _X509Certificate_subject, _X509Certificate_issuerName, _X509Certificate_issuer, _X509Certificate_notBefore, _X509Certificate_notAfter, _X509Certificate_signatureAlgorithm, _X509Certificate_signature, _X509Certificate_extensions, _X509Certificate_publicKey; + var X509Certificate = class extends PemData { + get publicKey() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_publicKey, "f")) tslib.__classPrivateFieldSet(this, _X509Certificate_publicKey, new PublicKey(this.asn.tbsCertificate.subjectPublicKeyInfo), "f"); + return tslib.__classPrivateFieldGet(this, _X509Certificate_publicKey, "f"); + } + get serialNumber() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_serialNumber, "f")) { + const tbs = this.asn.tbsCertificate; + let serialNumberBytes = new Uint8Array(tbs.serialNumber); + if (serialNumberBytes.length > 1 && serialNumberBytes[0] === 0 && serialNumberBytes[1] > 127) serialNumberBytes = serialNumberBytes.slice(1); + tslib.__classPrivateFieldSet(this, _X509Certificate_serialNumber, pvtsutils.Convert.ToHex(serialNumberBytes), "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Certificate_serialNumber, "f"); + } + get subjectName() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_subjectName, "f")) tslib.__classPrivateFieldSet(this, _X509Certificate_subjectName, new Name(this.asn.tbsCertificate.subject), "f"); + return tslib.__classPrivateFieldGet(this, _X509Certificate_subjectName, "f"); + } + get subject() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_subject, "f")) tslib.__classPrivateFieldSet(this, _X509Certificate_subject, this.subjectName.toString(), "f"); + return tslib.__classPrivateFieldGet(this, _X509Certificate_subject, "f"); + } + get issuerName() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_issuerName, "f")) tslib.__classPrivateFieldSet(this, _X509Certificate_issuerName, new Name(this.asn.tbsCertificate.issuer), "f"); + return tslib.__classPrivateFieldGet(this, _X509Certificate_issuerName, "f"); + } + get issuer() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_issuer, "f")) tslib.__classPrivateFieldSet(this, _X509Certificate_issuer, this.issuerName.toString(), "f"); + return tslib.__classPrivateFieldGet(this, _X509Certificate_issuer, "f"); + } + get notBefore() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_notBefore, "f")) { + const notBefore = this.asn.tbsCertificate.validity.notBefore.utcTime || this.asn.tbsCertificate.validity.notBefore.generalTime; + if (!notBefore) throw new Error("Cannot get 'notBefore' value"); + tslib.__classPrivateFieldSet(this, _X509Certificate_notBefore, notBefore, "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Certificate_notBefore, "f"); + } + get notAfter() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_notAfter, "f")) { + const notAfter = this.asn.tbsCertificate.validity.notAfter.utcTime || this.asn.tbsCertificate.validity.notAfter.generalTime; + if (!notAfter) throw new Error("Cannot get 'notAfter' value"); + tslib.__classPrivateFieldSet(this, _X509Certificate_notAfter, notAfter, "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Certificate_notAfter, "f"); + } + get signatureAlgorithm() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_signatureAlgorithm, "f")) { + const algProv = tsyringe.container.resolve(diAlgorithmProvider); + tslib.__classPrivateFieldSet(this, _X509Certificate_signatureAlgorithm, algProv.toWebAlgorithm(this.asn.signatureAlgorithm), "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Certificate_signatureAlgorithm, "f"); + } + get signature() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_signature, "f")) tslib.__classPrivateFieldSet(this, _X509Certificate_signature, this.asn.signatureValue, "f"); + return tslib.__classPrivateFieldGet(this, _X509Certificate_signature, "f"); + } + get extensions() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_extensions, "f")) { + tslib.__classPrivateFieldSet(this, _X509Certificate_extensions, [], "f"); + if (this.asn.tbsCertificate.extensions) tslib.__classPrivateFieldSet(this, _X509Certificate_extensions, this.asn.tbsCertificate.extensions.map((o) => ExtensionFactory.create(asn1Schema.AsnConvert.serialize(o))), "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Certificate_extensions, "f"); + } + get tbs() { + if (!tslib.__classPrivateFieldGet(this, _X509Certificate_tbs, "f")) tslib.__classPrivateFieldSet(this, _X509Certificate_tbs, this.asn.tbsCertificateRaw || asn1Schema.AsnConvert.serialize(this.asn.tbsCertificate), "f"); + return tslib.__classPrivateFieldGet(this, _X509Certificate_tbs, "f"); + } + constructor(param) { + const args = PemData.isAsnEncoded(param) ? [param, asn1X509.Certificate] : [param]; + super(args[0], args[1]); + _X509Certificate_tbs.set(this, void 0); + _X509Certificate_serialNumber.set(this, void 0); + _X509Certificate_subjectName.set(this, void 0); + _X509Certificate_subject.set(this, void 0); + _X509Certificate_issuerName.set(this, void 0); + _X509Certificate_issuer.set(this, void 0); + _X509Certificate_notBefore.set(this, void 0); + _X509Certificate_notAfter.set(this, void 0); + _X509Certificate_signatureAlgorithm.set(this, void 0); + _X509Certificate_signature.set(this, void 0); + _X509Certificate_extensions.set(this, void 0); + _X509Certificate_publicKey.set(this, void 0); + this.tag = PemConverter.CertificateTag; + } + onInit(_asn) {} + getExtension(type) { + for (const ext of this.extensions) if (typeof type === "string") { + if (ext.type === type) return ext; + } else if (ext instanceof type) return ext; + return null; + } + getExtensions(type) { + return this.extensions.filter((o) => { + if (typeof type === "string") return o.type === type; + else return o instanceof type; + }); + } + async verify(params = {}, crypto = cryptoProvider.get()) { + let keyAlgorithm; + let publicKey; + const paramsKey = params.publicKey; + try { + if (!paramsKey) { + keyAlgorithm = { + ...this.publicKey.algorithm, + ...this.signatureAlgorithm + }; + publicKey = await this.publicKey.export(keyAlgorithm, ["verify"], crypto); + } else if ("publicKey" in paramsKey) { + keyAlgorithm = { + ...paramsKey.publicKey.algorithm, + ...this.signatureAlgorithm + }; + publicKey = await paramsKey.publicKey.export(keyAlgorithm, ["verify"], crypto); + } else if (paramsKey instanceof PublicKey) { + keyAlgorithm = { + ...paramsKey.algorithm, + ...this.signatureAlgorithm + }; + publicKey = await paramsKey.export(keyAlgorithm, ["verify"], crypto); + } else if (pvtsutils.BufferSourceConverter.isBufferSource(paramsKey)) { + const key = new PublicKey(paramsKey); + keyAlgorithm = { + ...key.algorithm, + ...this.signatureAlgorithm + }; + publicKey = await key.export(keyAlgorithm, ["verify"], crypto); + } else { + keyAlgorithm = { + ...paramsKey.algorithm, + ...this.signatureAlgorithm + }; + publicKey = paramsKey; + } + } catch { + return false; + } + const signatureFormatters = tsyringe.container.resolveAll(diAsnSignatureFormatter).reverse(); + let signature = null; + for (const signatureFormatter of signatureFormatters) { + signature = signatureFormatter.toWebSignature(keyAlgorithm, this.signature); + if (signature) break; + } + if (!signature) throw Error("Cannot convert ASN.1 signature value to WebCrypto format"); + const ok = await crypto.subtle.verify(this.signatureAlgorithm, publicKey, signature, this.tbs); + if (params.signatureOnly) return ok; + else { + const time = (params.date || /* @__PURE__ */ new Date()).getTime(); + return ok && this.notBefore.getTime() < time && time < this.notAfter.getTime(); + } + } + async getThumbprint(...args) { + let crypto; + let algorithm = "SHA-1"; + if (args[0]) if (!args[0].subtle) { + algorithm = args[0] || algorithm; + crypto = args[1]; + } else crypto = args[0]; + crypto !== null && crypto !== void 0 || (crypto = cryptoProvider.get()); + return await crypto.subtle.digest(algorithm, this.rawData); + } + async isSelfSigned(crypto = cryptoProvider.get()) { + return this.subject === this.issuer && await this.verify({ signatureOnly: true }, crypto); + } + toTextObject() { + const obj = this.toTextObjectEmpty(); + const cert = asn1Schema.AsnConvert.parse(this.rawData, asn1X509.Certificate); + const tbs = cert.tbsCertificate; + const data = new TextObject("", { + Version: `${asn1X509.Version[tbs.version]} (${tbs.version})`, + "Serial Number": tbs.serialNumber, + "Signature Algorithm": TextConverter.serializeAlgorithm(tbs.signature), + Issuer: this.issuer, + Validity: new TextObject("", { + "Not Before": tbs.validity.notBefore.getTime(), + "Not After": tbs.validity.notAfter.getTime() + }), + Subject: this.subject, + "Subject Public Key Info": this.publicKey + }); + if (tbs.issuerUniqueID) data["Issuer Unique ID"] = tbs.issuerUniqueID; + if (tbs.subjectUniqueID) data["Subject Unique ID"] = tbs.subjectUniqueID; + if (this.extensions.length) { + const extensions = new TextObject(""); + for (const ext of this.extensions) { + const extObj = ext.toTextObject(); + extensions[extObj[TextObject.NAME]] = extObj; + } + data["Extensions"] = extensions; + } + obj["Data"] = data; + obj["Signature"] = new TextObject("", { + Algorithm: TextConverter.serializeAlgorithm(cert.signatureAlgorithm), + "": cert.signatureValue + }); + return obj; + } + }; + _X509Certificate_tbs = /* @__PURE__ */ new WeakMap(), _X509Certificate_serialNumber = /* @__PURE__ */ new WeakMap(), _X509Certificate_subjectName = /* @__PURE__ */ new WeakMap(), _X509Certificate_subject = /* @__PURE__ */ new WeakMap(), _X509Certificate_issuerName = /* @__PURE__ */ new WeakMap(), _X509Certificate_issuer = /* @__PURE__ */ new WeakMap(), _X509Certificate_notBefore = /* @__PURE__ */ new WeakMap(), _X509Certificate_notAfter = /* @__PURE__ */ new WeakMap(), _X509Certificate_signatureAlgorithm = /* @__PURE__ */ new WeakMap(), _X509Certificate_signature = /* @__PURE__ */ new WeakMap(), _X509Certificate_extensions = /* @__PURE__ */ new WeakMap(), _X509Certificate_publicKey = /* @__PURE__ */ new WeakMap(); + X509Certificate.NAME = "Certificate"; + var X509Certificates = class extends Array { + constructor(param) { + super(); + if (PemData.isAsnEncoded(param)) this.import(param); + else if (param instanceof X509Certificate) this.push(param); + else if (Array.isArray(param)) for (const item of param) this.push(item); + } + export(format) { + const signedData = new asn1Cms__namespace.SignedData(); + signedData.version = 1; + signedData.encapContentInfo.eContentType = asn1Cms__namespace.id_data; + signedData.encapContentInfo.eContent = new asn1Cms__namespace.EncapsulatedContent({ single: new asn1Schema.OctetString() }); + signedData.certificates = new asn1Cms__namespace.CertificateSet(this.map((o) => new asn1Cms__namespace.CertificateChoices({ certificate: asn1Schema.AsnConvert.parse(o.rawData, asn1X509.Certificate) }))); + const cms = new asn1Cms__namespace.ContentInfo({ + contentType: asn1Cms__namespace.id_signedData, + content: asn1Schema.AsnConvert.serialize(signedData) + }); + const raw = asn1Schema.AsnConvert.serialize(cms); + if (format === "raw") return raw; + return this.toString(format); + } + import(data) { + const raw = PemData.toArrayBuffer(data); + const cms = asn1Schema.AsnConvert.parse(raw, asn1Cms__namespace.ContentInfo); + if (cms.contentType !== asn1Cms__namespace.id_signedData) throw new TypeError("Cannot parse CMS package. Incoming data is not a SignedData object."); + const signedData = asn1Schema.AsnConvert.parse(cms.content, asn1Cms__namespace.SignedData); + this.clear(); + for (const item of signedData.certificates || []) if (item.certificate) this.push(new X509Certificate(item.certificate)); + } + clear() { + while (this.pop()); + } + toString(format = "pem") { + const raw = this.export("raw"); + switch (format) { + case "pem": return PemConverter.encode(raw, "CMS"); + case "pem-chain": return this.map((o) => o.toString("pem")).join("\n"); + case "asn": return asn1Schema.AsnConvert.toString(raw); + case "hex": return pvtsutils.Convert.ToHex(raw); + case "base64": return pvtsutils.Convert.ToBase64(raw); + case "base64url": return pvtsutils.Convert.ToBase64Url(raw); + case "text": return TextConverter.serialize(this.toTextObject()); + default: throw TypeError("Argument 'format' is unsupported value"); + } + } + toTextObject() { + const contentInfo = asn1Schema.AsnConvert.parse(this.export("raw"), asn1Cms__namespace.ContentInfo); + const signedData = asn1Schema.AsnConvert.parse(contentInfo.content, asn1Cms__namespace.SignedData); + return new TextObject("X509Certificates", { + "Content Type": OidSerializer.toString(contentInfo.contentType), + Content: new TextObject("", { + Version: `${asn1Cms__namespace.CMSVersion[signedData.version]} (${signedData.version})`, + Certificates: new TextObject("", { Certificate: this.map((o) => o.toTextObject()) }) + }) + }); + } + }; + var X509ChainBuilder = class { + constructor(params = {}) { + this.certificates = []; + if (params.certificates) this.certificates = params.certificates; + } + async build(cert, crypto = cryptoProvider.get()) { + const chain = new X509Certificates(cert); + let current = cert; + while (current = await this.findIssuer(current, crypto)) { + const thumbprint = await current.getThumbprint(crypto); + for (const item of chain) { + const thumbprint2 = await item.getThumbprint(crypto); + if (pvtsutils.isEqual(thumbprint, thumbprint2)) throw new Error("Cannot build a certificate chain. Circular dependency."); + } + chain.push(current); + } + return chain; + } + async findIssuer(cert, crypto = cryptoProvider.get()) { + if (!await cert.isSelfSigned(crypto)) { + const akiExt = cert.getExtension(asn1X509__namespace.id_ce_authorityKeyIdentifier); + for (const item of this.certificates) { + if (item.subject !== cert.issuer) continue; + if (akiExt) { + if (akiExt.keyId) { + const skiExt = item.getExtension(asn1X509__namespace.id_ce_subjectKeyIdentifier); + if (skiExt && skiExt.keyId !== akiExt.keyId) continue; + } else if (akiExt.certId) { + const sanExt = item.getExtension(asn1X509__namespace.id_ce_subjectAltName); + if (sanExt && !(akiExt.certId.serialNumber === item.serialNumber && pvtsutils.isEqual(asn1Schema.AsnConvert.serialize(akiExt.certId.name), asn1Schema.AsnConvert.serialize(sanExt)))) continue; + } + } + try { + const algorithm = { + ...item.publicKey.algorithm, + ...cert.signatureAlgorithm + }; + const publicKey = await item.publicKey.export(algorithm, ["verify"], crypto); + if (!await cert.verify({ + publicKey, + signatureOnly: true + }, crypto)) continue; + } catch { + continue; + } + return item; + } + } + return null; + } + }; + function generateCertificateSerialNumber(input, crypto = cryptoProvider.get()) { + const inputView = pvtsutils.BufferSourceConverter.toUint8Array(pvtsutils.Convert.FromHex(input || "")); + let serialNumber = inputView && inputView.length && inputView.some((o) => o > 0) ? new Uint8Array(inputView) : void 0; + if (!serialNumber) serialNumber = crypto.getRandomValues(new Uint8Array(16)); + let firstNonZero = 0; + while (firstNonZero < serialNumber.length - 1 && serialNumber[firstNonZero] === 0) firstNonZero++; + serialNumber = serialNumber.slice(firstNonZero); + if (serialNumber[0] > 127) { + const newSerialNumber = new Uint8Array(serialNumber.length + 1); + newSerialNumber[0] = 0; + newSerialNumber.set(serialNumber, 1); + serialNumber = newSerialNumber; + } + return serialNumber.buffer; + } + var X509CertificateGenerator = class { + static async createSelfSigned(params, crypto = cryptoProvider.get()) { + if (!params.keys.privateKey) throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty"); + if (!params.keys.publicKey) throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty"); + return this.create({ + serialNumber: params.serialNumber, + subject: params.name, + issuer: params.name, + notBefore: params.notBefore, + notAfter: params.notAfter, + publicKey: params.keys.publicKey, + signingKey: params.keys.privateKey, + signingAlgorithm: params.signingAlgorithm, + extensions: params.extensions + }, crypto); + } + static async create(params, crypto = cryptoProvider.get()) { + var _a; + let spki; + if (params.publicKey instanceof PublicKey) spki = params.publicKey.rawData; + else if ("publicKey" in params.publicKey) spki = params.publicKey.publicKey.rawData; + else if (pvtsutils.BufferSourceConverter.isBufferSource(params.publicKey)) spki = params.publicKey; + else spki = await crypto.subtle.exportKey("spki", params.publicKey); + const serialNumber = generateCertificateSerialNumber(params.serialNumber, crypto); + const notBefore = params.notBefore || /* @__PURE__ */ new Date(); + const notAfter = params.notAfter || new Date(notBefore.getTime() + 31536e6); + const asnX509 = new asn1X509__namespace.Certificate({ tbsCertificate: new asn1X509__namespace.TBSCertificate({ + version: asn1X509__namespace.Version.v3, + serialNumber, + validity: new asn1X509__namespace.Validity({ + notBefore, + notAfter + }), + extensions: new asn1X509__namespace.Extensions(((_a = params.extensions) === null || _a === void 0 ? void 0 : _a.map((o) => asn1Schema.AsnConvert.parse(o.rawData, asn1X509__namespace.Extension))) || []), + subjectPublicKeyInfo: asn1Schema.AsnConvert.parse(spki, asn1X509__namespace.SubjectPublicKeyInfo) + }) }); + if (params.subject) { + const name = params.subject instanceof Name ? params.subject : new Name(params.subject); + asnX509.tbsCertificate.subject = asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509__namespace.Name); + } + if (params.issuer) { + const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer); + asnX509.tbsCertificate.issuer = asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509__namespace.Name); + } + const defaultSigningAlgorithm = { hash: "SHA-256" }; + const signatureAlgorithm = "signingKey" in params ? { + ...defaultSigningAlgorithm, + ...params.signingAlgorithm, + ...params.signingKey.algorithm + } : { + ...defaultSigningAlgorithm, + ...params.signingAlgorithm + }; + const algProv = tsyringe.container.resolve(diAlgorithmProvider); + asnX509.tbsCertificate.signature = asnX509.signatureAlgorithm = algProv.toAsnAlgorithm(signatureAlgorithm); + const tbs = asn1Schema.AsnConvert.serialize(asnX509.tbsCertificate); + const signatureValue = "signingKey" in params ? await crypto.subtle.sign(signatureAlgorithm, params.signingKey, tbs) : params.signature; + const signatureFormatters = tsyringe.container.resolveAll(diAsnSignatureFormatter).reverse(); + let asnSignature = null; + for (const signatureFormatter of signatureFormatters) { + asnSignature = signatureFormatter.toAsnSignature(signatureAlgorithm, signatureValue); + if (asnSignature) break; + } + if (!asnSignature) throw Error("Cannot convert ASN.1 signature value to WebCrypto format"); + asnX509.signatureValue = asnSignature; + return new X509Certificate(asn1Schema.AsnConvert.serialize(asnX509)); + } + }; + var _X509CrlEntry_serialNumber, _X509CrlEntry_revocationDate, _X509CrlEntry_reason, _X509CrlEntry_invalidity, _X509CrlEntry_extensions; + exports.X509CrlReason = void 0; + (function(X509CrlReason) { + X509CrlReason[X509CrlReason["unspecified"] = 0] = "unspecified"; + X509CrlReason[X509CrlReason["keyCompromise"] = 1] = "keyCompromise"; + X509CrlReason[X509CrlReason["cACompromise"] = 2] = "cACompromise"; + X509CrlReason[X509CrlReason["affiliationChanged"] = 3] = "affiliationChanged"; + X509CrlReason[X509CrlReason["superseded"] = 4] = "superseded"; + X509CrlReason[X509CrlReason["cessationOfOperation"] = 5] = "cessationOfOperation"; + X509CrlReason[X509CrlReason["certificateHold"] = 6] = "certificateHold"; + X509CrlReason[X509CrlReason["removeFromCRL"] = 8] = "removeFromCRL"; + X509CrlReason[X509CrlReason["privilegeWithdrawn"] = 9] = "privilegeWithdrawn"; + X509CrlReason[X509CrlReason["aACompromise"] = 10] = "aACompromise"; + })(exports.X509CrlReason || (exports.X509CrlReason = {})); + var X509CrlEntry = class extends AsnData { + get serialNumber() { + if (!tslib.__classPrivateFieldGet(this, _X509CrlEntry_serialNumber, "f")) tslib.__classPrivateFieldSet(this, _X509CrlEntry_serialNumber, pvtsutils.Convert.ToHex(this.asn.userCertificate), "f"); + return tslib.__classPrivateFieldGet(this, _X509CrlEntry_serialNumber, "f"); + } + get revocationDate() { + if (!tslib.__classPrivateFieldGet(this, _X509CrlEntry_revocationDate, "f")) tslib.__classPrivateFieldSet(this, _X509CrlEntry_revocationDate, this.asn.revocationDate.getTime(), "f"); + return tslib.__classPrivateFieldGet(this, _X509CrlEntry_revocationDate, "f"); + } + get reason() { + if (tslib.__classPrivateFieldGet(this, _X509CrlEntry_reason, "f") === void 0) this.extensions; + return tslib.__classPrivateFieldGet(this, _X509CrlEntry_reason, "f"); + } + get invalidity() { + if (tslib.__classPrivateFieldGet(this, _X509CrlEntry_invalidity, "f") === void 0) this.extensions; + return tslib.__classPrivateFieldGet(this, _X509CrlEntry_invalidity, "f"); + } + get extensions() { + if (!tslib.__classPrivateFieldGet(this, _X509CrlEntry_extensions, "f")) { + tslib.__classPrivateFieldSet(this, _X509CrlEntry_extensions, [], "f"); + if (this.asn.crlEntryExtensions) tslib.__classPrivateFieldSet(this, _X509CrlEntry_extensions, this.asn.crlEntryExtensions.map((o) => { + const extension = ExtensionFactory.create(asn1Schema.AsnConvert.serialize(o)); + switch (extension.type) { + case asn1X509.id_ce_cRLReasons: + if (tslib.__classPrivateFieldGet(this, _X509CrlEntry_reason, "f") === void 0) tslib.__classPrivateFieldSet(this, _X509CrlEntry_reason, asn1Schema.AsnConvert.parse(extension.value, asn1X509.CRLReason).reason, "f"); + break; + case asn1X509.id_ce_invalidityDate: + if (tslib.__classPrivateFieldGet(this, _X509CrlEntry_invalidity, "f") === void 0) tslib.__classPrivateFieldSet(this, _X509CrlEntry_invalidity, asn1Schema.AsnConvert.parse(extension.value, asn1X509.InvalidityDate).value, "f"); + break; + } + return extension; + }), "f"); + } + return tslib.__classPrivateFieldGet(this, _X509CrlEntry_extensions, "f"); + } + constructor(...args) { + let raw; + if (pvtsutils.BufferSourceConverter.isBufferSource(args[0])) raw = pvtsutils.BufferSourceConverter.toArrayBuffer(args[0]); + else if (typeof args[0] === "string") raw = asn1Schema.AsnConvert.serialize(new asn1X509.RevokedCertificate({ + userCertificate: generateCertificateSerialNumber(args[0]), + revocationDate: new asn1X509.Time(args[1]), + crlEntryExtensions: args[2] + })); + else if (args[0] instanceof asn1X509.RevokedCertificate) raw = args[0]; + if (!raw) throw new TypeError("Cannot create X509CrlEntry instance. Wrong constructor arguments."); + super(raw, asn1X509.RevokedCertificate); + _X509CrlEntry_serialNumber.set(this, void 0); + _X509CrlEntry_revocationDate.set(this, void 0); + _X509CrlEntry_reason.set(this, void 0); + _X509CrlEntry_invalidity.set(this, void 0); + _X509CrlEntry_extensions.set(this, void 0); + } + onInit(_asn) {} + }; + _X509CrlEntry_serialNumber = /* @__PURE__ */ new WeakMap(), _X509CrlEntry_revocationDate = /* @__PURE__ */ new WeakMap(), _X509CrlEntry_reason = /* @__PURE__ */ new WeakMap(), _X509CrlEntry_invalidity = /* @__PURE__ */ new WeakMap(), _X509CrlEntry_extensions = /* @__PURE__ */ new WeakMap(); + var _X509Crl_tbs, _X509Crl_signatureAlgorithm, _X509Crl_issuerName, _X509Crl_thisUpdate, _X509Crl_nextUpdate, _X509Crl_entries, _X509Crl_extensions; + var X509Crl = class extends PemData { + get version() { + return this.asn.tbsCertList.version; + } + get signatureAlgorithm() { + if (!tslib.__classPrivateFieldGet(this, _X509Crl_signatureAlgorithm, "f")) { + const algProv = tsyringe.container.resolve(diAlgorithmProvider); + tslib.__classPrivateFieldSet(this, _X509Crl_signatureAlgorithm, algProv.toWebAlgorithm(this.asn.signatureAlgorithm), "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Crl_signatureAlgorithm, "f"); + } + get signature() { + return this.asn.signature; + } + get issuer() { + return this.issuerName.toString(); + } + get issuerName() { + if (!tslib.__classPrivateFieldGet(this, _X509Crl_issuerName, "f")) tslib.__classPrivateFieldSet(this, _X509Crl_issuerName, new Name(this.asn.tbsCertList.issuer), "f"); + return tslib.__classPrivateFieldGet(this, _X509Crl_issuerName, "f"); + } + get thisUpdate() { + if (!tslib.__classPrivateFieldGet(this, _X509Crl_thisUpdate, "f")) { + const thisUpdate = this.asn.tbsCertList.thisUpdate.getTime(); + if (!thisUpdate) throw new Error("Cannot get 'thisUpdate' value"); + tslib.__classPrivateFieldSet(this, _X509Crl_thisUpdate, thisUpdate, "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Crl_thisUpdate, "f"); + } + get nextUpdate() { + var _a; + if (tslib.__classPrivateFieldGet(this, _X509Crl_nextUpdate, "f") === void 0) tslib.__classPrivateFieldSet(this, _X509Crl_nextUpdate, ((_a = this.asn.tbsCertList.nextUpdate) === null || _a === void 0 ? void 0 : _a.getTime()) || void 0, "f"); + return tslib.__classPrivateFieldGet(this, _X509Crl_nextUpdate, "f"); + } + get entries() { + var _a; + if (!tslib.__classPrivateFieldGet(this, _X509Crl_entries, "f")) tslib.__classPrivateFieldSet(this, _X509Crl_entries, ((_a = this.asn.tbsCertList.revokedCertificates) === null || _a === void 0 ? void 0 : _a.map((o) => new X509CrlEntry(o))) || [], "f"); + return tslib.__classPrivateFieldGet(this, _X509Crl_entries, "f"); + } + get extensions() { + if (!tslib.__classPrivateFieldGet(this, _X509Crl_extensions, "f")) { + tslib.__classPrivateFieldSet(this, _X509Crl_extensions, [], "f"); + if (this.asn.tbsCertList.crlExtensions) tslib.__classPrivateFieldSet(this, _X509Crl_extensions, this.asn.tbsCertList.crlExtensions.map((o) => ExtensionFactory.create(asn1Schema.AsnConvert.serialize(o))), "f"); + } + return tslib.__classPrivateFieldGet(this, _X509Crl_extensions, "f"); + } + get tbs() { + if (!tslib.__classPrivateFieldGet(this, _X509Crl_tbs, "f")) tslib.__classPrivateFieldSet(this, _X509Crl_tbs, this.asn.tbsCertListRaw || asn1Schema.AsnConvert.serialize(this.asn.tbsCertList), "f"); + return tslib.__classPrivateFieldGet(this, _X509Crl_tbs, "f"); + } + get tbsCertListSignatureAlgorithm() { + return this.asn.tbsCertList.signature; + } + get certListSignatureAlgorithm() { + return this.asn.signatureAlgorithm; + } + constructor(param) { + super(param, PemData.isAsnEncoded(param) ? asn1X509.CertificateList : void 0); + this.tag = PemConverter.CrlTag; + _X509Crl_tbs.set(this, void 0); + _X509Crl_signatureAlgorithm.set(this, void 0); + _X509Crl_issuerName.set(this, void 0); + _X509Crl_thisUpdate.set(this, void 0); + _X509Crl_nextUpdate.set(this, void 0); + _X509Crl_entries.set(this, void 0); + _X509Crl_extensions.set(this, void 0); + } + onInit(_asn) {} + getExtension(type) { + for (const ext of this.extensions) if (typeof type === "string") { + if (ext.type === type) return ext; + } else if (ext instanceof type) return ext; + return null; + } + getExtensions(type) { + return this.extensions.filter((o) => { + if (typeof type === "string") return o.type === type; + else return o instanceof type; + }); + } + async verify(params, crypto = cryptoProvider.get()) { + if (!this.certListSignatureAlgorithm.isEqual(this.tbsCertListSignatureAlgorithm)) throw new Error("algorithm identifier in the sequence tbsCertList and CertificateList mismatch"); + let keyAlgorithm; + let publicKey; + const paramsKey = params.publicKey; + try { + if (paramsKey instanceof X509Certificate) { + keyAlgorithm = { + ...paramsKey.publicKey.algorithm, + ...paramsKey.signatureAlgorithm + }; + publicKey = await paramsKey.publicKey.export(keyAlgorithm, ["verify"]); + } else if (paramsKey instanceof PublicKey) { + keyAlgorithm = { + ...paramsKey.algorithm, + ...this.signatureAlgorithm + }; + publicKey = await paramsKey.export(keyAlgorithm, ["verify"]); + } else { + keyAlgorithm = { + ...paramsKey.algorithm, + ...this.signatureAlgorithm + }; + publicKey = paramsKey; + } + } catch { + return false; + } + const signatureFormatters = tsyringe.container.resolveAll(diAsnSignatureFormatter).reverse(); + let signature = null; + for (const signatureFormatter of signatureFormatters) { + signature = signatureFormatter.toWebSignature(keyAlgorithm, this.signature); + if (signature) break; + } + if (!signature) throw Error("Cannot convert ASN.1 signature value to WebCrypto format"); + return await crypto.subtle.verify(this.signatureAlgorithm, publicKey, signature, this.tbs); + } + async getThumbprint(...args) { + let crypto; + let algorithm = "SHA-1"; + if (args[0]) if (!args[0].subtle) { + algorithm = args[0] || algorithm; + crypto = args[1]; + } else crypto = args[0]; + crypto !== null && crypto !== void 0 || (crypto = cryptoProvider.get()); + return await crypto.subtle.digest(algorithm, this.rawData); + } + findRevoked(certOrSerialNumber) { + const serialBuffer = generateCertificateSerialNumber(typeof certOrSerialNumber === "string" ? certOrSerialNumber : certOrSerialNumber.serialNumber); + for (const revoked of this.asn.tbsCertList.revokedCertificates || []) if (pvtsutils.BufferSourceConverter.isEqual(revoked.userCertificate, serialBuffer)) return new X509CrlEntry(asn1Schema.AsnConvert.serialize(revoked)); + return null; + } + }; + _X509Crl_tbs = /* @__PURE__ */ new WeakMap(), _X509Crl_signatureAlgorithm = /* @__PURE__ */ new WeakMap(), _X509Crl_issuerName = /* @__PURE__ */ new WeakMap(), _X509Crl_thisUpdate = /* @__PURE__ */ new WeakMap(), _X509Crl_nextUpdate = /* @__PURE__ */ new WeakMap(), _X509Crl_entries = /* @__PURE__ */ new WeakMap(), _X509Crl_extensions = /* @__PURE__ */ new WeakMap(); + var X509CrlGenerator = class { + static async create(params, crypto = cryptoProvider.get()) { + var _a; + const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer); + const asnX509Crl = new asn1X509__namespace.CertificateList({ tbsCertList: new asn1X509__namespace.TBSCertList({ + version: asn1X509__namespace.Version.v2, + issuer: asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509__namespace.Name), + thisUpdate: new asn1X509.Time(params.thisUpdate || /* @__PURE__ */ new Date()) + }) }); + if (params.nextUpdate) asnX509Crl.tbsCertList.nextUpdate = new asn1X509.Time(params.nextUpdate); + if (params.extensions && params.extensions.length) asnX509Crl.tbsCertList.crlExtensions = new asn1X509__namespace.Extensions(params.extensions.map((o) => asn1Schema.AsnConvert.parse(o.rawData, asn1X509__namespace.Extension)) || []); + if (params.entries && params.entries.length) { + asnX509Crl.tbsCertList.revokedCertificates = []; + for (const entry of params.entries) { + const userCertificate = PemData.toArrayBuffer(entry.serialNumber); + if (asnX509Crl.tbsCertList.revokedCertificates.findIndex((cert) => pvtsutils.isEqual(cert.userCertificate, userCertificate)) > -1) throw new Error(`Certificate serial number ${entry.serialNumber} already exists in tbsCertList`); + const revokedCert = new asn1X509.RevokedCertificate({ + userCertificate, + revocationDate: new asn1X509.Time(entry.revocationDate || /* @__PURE__ */ new Date()) + }); + if ("extensions" in entry && ((_a = entry.extensions) === null || _a === void 0 ? void 0 : _a.length)) revokedCert.crlEntryExtensions = entry.extensions.map((o) => asn1Schema.AsnConvert.parse(o.rawData, asn1X509__namespace.Extension)); + else revokedCert.crlEntryExtensions = []; + if (!(entry instanceof X509CrlEntry)) { + if (entry.reason) revokedCert.crlEntryExtensions.push(new asn1X509__namespace.Extension({ + extnID: asn1X509__namespace.id_ce_cRLReasons, + critical: false, + extnValue: new asn1Schema.OctetString(asn1Schema.AsnConvert.serialize(new asn1X509__namespace.CRLReason(entry.reason))) + })); + if (entry.invalidity) revokedCert.crlEntryExtensions.push(new asn1X509__namespace.Extension({ + extnID: asn1X509__namespace.id_ce_invalidityDate, + critical: false, + extnValue: new asn1Schema.OctetString(asn1Schema.AsnConvert.serialize(new asn1X509__namespace.InvalidityDate(entry.invalidity))) + })); + if (entry.issuer) { + const name = params.issuer instanceof Name ? params.issuer : new Name(params.issuer); + revokedCert.crlEntryExtensions.push(new asn1X509__namespace.Extension({ + extnID: asn1X509__namespace.id_ce_certificateIssuer, + critical: false, + extnValue: new asn1Schema.OctetString(asn1Schema.AsnConvert.serialize(asn1Schema.AsnConvert.parse(name.toArrayBuffer(), asn1X509__namespace.Name))) + })); + } + } + asnX509Crl.tbsCertList.revokedCertificates.push(revokedCert); + } + } + const signingAlgorithm = { + ...params.signingAlgorithm, + ...params.signingKey.algorithm + }; + const algProv = tsyringe.container.resolve(diAlgorithmProvider); + asnX509Crl.tbsCertList.signature = asnX509Crl.signatureAlgorithm = algProv.toAsnAlgorithm(signingAlgorithm); + const tbs = asn1Schema.AsnConvert.serialize(asnX509Crl.tbsCertList); + const signature = await crypto.subtle.sign(signingAlgorithm, params.signingKey, tbs); + const signatureFormatters = tsyringe.container.resolveAll(diAsnSignatureFormatter).reverse(); + let asnSignature = null; + for (const signatureFormatter of signatureFormatters) { + asnSignature = signatureFormatter.toAsnSignature(signingAlgorithm, signature); + if (asnSignature) break; + } + if (!asnSignature) throw Error("Cannot convert ASN.1 signature value to WebCrypto format"); + asnX509Crl.signature = asnSignature; + return new X509Crl(asn1Schema.AsnConvert.serialize(asnX509Crl)); + } + }; + ExtensionFactory.register(asn1X509__namespace.id_ce_basicConstraints, BasicConstraintsExtension); + ExtensionFactory.register(asn1X509__namespace.id_ce_extKeyUsage, ExtendedKeyUsageExtension); + ExtensionFactory.register(asn1X509__namespace.id_ce_keyUsage, KeyUsagesExtension); + ExtensionFactory.register(asn1X509__namespace.id_ce_subjectKeyIdentifier, SubjectKeyIdentifierExtension); + ExtensionFactory.register(asn1X509__namespace.id_ce_authorityKeyIdentifier, AuthorityKeyIdentifierExtension); + ExtensionFactory.register(asn1X509__namespace.id_ce_subjectAltName, SubjectAlternativeNameExtension); + ExtensionFactory.register(asn1X509__namespace.id_ce_cRLDistributionPoints, CRLDistributionPointsExtension); + ExtensionFactory.register(asn1X509__namespace.id_pe_authorityInfoAccess, AuthorityInfoAccessExtension); + ExtensionFactory.register(asn1X509__namespace.id_ce_issuerAltName, IssuerAlternativeNameExtension); + AttributeFactory.register(asnPkcs9__namespace.id_pkcs9_at_challengePassword, ChallengePasswordAttribute); + AttributeFactory.register(asnPkcs9__namespace.id_pkcs9_at_extensionRequest, ExtensionsAttribute); + tsyringe.container.registerSingleton(diAsnSignatureFormatter, AsnDefaultSignatureFormatter); + tsyringe.container.registerSingleton(diAsnSignatureFormatter, AsnEcSignatureFormatter); + AsnEcSignatureFormatter.namedCurveSize.set("P-256", 32); + AsnEcSignatureFormatter.namedCurveSize.set("K-256", 32); + AsnEcSignatureFormatter.namedCurveSize.set("P-384", 48); + AsnEcSignatureFormatter.namedCurveSize.set("P-521", 66); + exports.AlgorithmProvider = AlgorithmProvider; + exports.AsnData = AsnData; + exports.AsnDefaultSignatureFormatter = AsnDefaultSignatureFormatter; + exports.AsnEcSignatureFormatter = AsnEcSignatureFormatter; + exports.Attribute = Attribute; + exports.AttributeFactory = AttributeFactory; + exports.AuthorityInfoAccessExtension = AuthorityInfoAccessExtension; + exports.AuthorityKeyIdentifierExtension = AuthorityKeyIdentifierExtension; + exports.BasicConstraintsExtension = BasicConstraintsExtension; + exports.CRLDistributionPointsExtension = CRLDistributionPointsExtension; + exports.CertificatePolicyExtension = CertificatePolicyExtension; + exports.ChallengePasswordAttribute = ChallengePasswordAttribute; + exports.CryptoProvider = CryptoProvider; + exports.DN = DN; + exports.DNS = DNS; + exports.DefaultAlgorithmSerializer = DefaultAlgorithmSerializer; + exports.EMAIL = EMAIL; + exports.ExtendedKeyUsageExtension = ExtendedKeyUsageExtension; + exports.Extension = Extension; + exports.ExtensionFactory = ExtensionFactory; + exports.ExtensionsAttribute = ExtensionsAttribute; + exports.GUID = GUID; + exports.GeneralName = GeneralName; + exports.GeneralNames = GeneralNames; + exports.IP = IP; + exports.IssuerAlternativeNameExtension = IssuerAlternativeNameExtension; + exports.KeyUsagesExtension = KeyUsagesExtension; + exports.Name = Name; + exports.NameIdentifier = NameIdentifier; + exports.OidSerializer = OidSerializer; + exports.PemConverter = PemConverter; + exports.PemData = PemData; + exports.Pkcs10CertificateRequest = Pkcs10CertificateRequest; + exports.Pkcs10CertificateRequestGenerator = Pkcs10CertificateRequestGenerator; + exports.PublicKey = PublicKey; + exports.REGISTERED_ID = REGISTERED_ID; + exports.SubjectAlternativeNameExtension = SubjectAlternativeNameExtension; + exports.SubjectKeyIdentifierExtension = SubjectKeyIdentifierExtension; + exports.TextConverter = TextConverter; + exports.TextObject = TextObject; + exports.UPN = UPN; + exports.URL = URL; + exports.X509Certificate = X509Certificate; + exports.X509CertificateGenerator = X509CertificateGenerator; + exports.X509Certificates = X509Certificates; + exports.X509ChainBuilder = X509ChainBuilder; + exports.X509Crl = X509Crl; + exports.X509CrlEntry = X509CrlEntry; + exports.X509CrlGenerator = X509CrlGenerator; + exports.cryptoProvider = cryptoProvider; + exports.diAlgorithm = diAlgorithm; + exports.diAlgorithmProvider = diAlgorithmProvider; + exports.diAsnSignatureFormatter = diAsnSignatureFormatter; + exports.idEd25519 = idEd25519; + exports.idEd448 = idEd448; + exports.idX25519 = idX25519; + exports.idX448 = idX448; +})))(); +/** +* A simple method for requesting data via standard `fetch`. Should work +* across multiple runtimes. +*/ +function fetch(url) { + return _fetchInternals.stubThis(url); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _fetchInternals = { stubThis: (url) => globalThis.fetch(url) }; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/isCertRevoked.js +const cacheRevokedCerts = {}; +/** +* A method to pull a CRL from a certificate and compare its serial number to the list of revoked +* certificate serial numbers within the CRL. +* +* CRL certificate structure referenced from https://tools.ietf.org/html/rfc5280#page-117 +*/ +async function isCertRevoked(cert) { + const { extensions } = cert; + if (!extensions) return false; + let extAuthorityKeyID; + let extSubjectKeyID; + let extCRLDistributionPoints; + extensions.forEach((ext) => { + if (ext instanceof import_x509_cjs.AuthorityKeyIdentifierExtension) extAuthorityKeyID = ext; + else if (ext instanceof import_x509_cjs.SubjectKeyIdentifierExtension) extSubjectKeyID = ext; + else if (ext instanceof import_x509_cjs.CRLDistributionPointsExtension) extCRLDistributionPoints = ext; + }); + let keyIdentifier = void 0; + if (extAuthorityKeyID && extAuthorityKeyID.keyId) keyIdentifier = extAuthorityKeyID.keyId; + else if (extSubjectKeyID) + /** + * We might be dealing with a self-signed root certificate. Check the + * Subject key Identifier extension next. + */ + keyIdentifier = extSubjectKeyID.keyId; + if (keyIdentifier) { + const cached = cacheRevokedCerts[keyIdentifier]; + if (cached) { + const now = /* @__PURE__ */ new Date(); + if (!cached.nextUpdate || cached.nextUpdate > now) return cached.revokedCerts.indexOf(cert.serialNumber) >= 0; + } + } + const crlURL = extCRLDistributionPoints?.distributionPoints?.[0].distributionPoint?.fullName?.[0].uniformResourceIdentifier; + if (!crlURL) return false; + let certListBytes; + try { + certListBytes = await (await fetch(crlURL)).arrayBuffer(); + } catch (_err) { + return false; + } + let data; + try { + data = new import_x509_cjs.X509Crl(certListBytes); + } catch (_err) { + return false; + } + const newCached = { + revokedCerts: [], + nextUpdate: void 0 + }; + if (data.nextUpdate) newCached.nextUpdate = data.nextUpdate; + const revokedCerts = data.entries; + if (revokedCerts) { + for (const cert of revokedCerts) { + const revokedHex = cert.serialNumber; + newCached.revokedCerts.push(revokedHex); + } + if (keyIdentifier) cacheRevokedCerts[keyIdentifier] = newCached; + return newCached.revokedCerts.indexOf(cert.serialNumber) >= 0; + } + return false; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/decodeAuthenticatorExtensions.js +/** +* Convert authenticator extension data buffer to a proper object +* +* @param extensionData Authenticator Extension Data buffer +*/ +function decodeAuthenticatorExtensions(extensionData) { + let toCBOR; + try { + toCBOR = decodeFirst(extensionData); + } catch (err) { + throw new Error(`Error decoding authenticator extensions: ${err.message}`); + } + return convertMapToObjectDeep(toCBOR); +} +/** +* CBOR-encoded extensions can be deeply-nested Maps, which are too deep for a simple +* `Object.entries()`. This method will recursively make sure that all Maps are converted into +* basic objects. +*/ +function convertMapToObjectDeep(input) { + const mapped = {}; + for (const [key, value] of input) if (value instanceof Map) mapped[key] = convertMapToObjectDeep(value); + else mapped[key] = value; + return mapped; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/parseAuthenticatorData.js +/** +* Make sense of the authData buffer contained in an Attestation +*/ +function parseAuthenticatorData(authData) { + if (authData.byteLength < 37) throw new Error(`Authenticator data was ${authData.byteLength} bytes, expected at least 37 bytes`); + let pointer = 0; + const dataView = toDataView(authData); + const rpIdHash = authData.slice(pointer, pointer += 32); + const flagsBuf = authData.slice(pointer, pointer += 1); + const flagsInt = flagsBuf[0]; + const flags = { + up: !!(flagsInt & 1), + uv: !!(flagsInt & 4), + be: !!(flagsInt & 8), + bs: !!(flagsInt & 16), + at: !!(flagsInt & 64), + ed: !!(flagsInt & 128), + flagsInt + }; + const counterBuf = authData.slice(pointer, pointer + 4); + const counter = dataView.getUint32(pointer, false); + pointer += 4; + let aaguid = void 0; + let credentialID = void 0; + let credentialPublicKey = void 0; + if (flags.at) { + aaguid = authData.slice(pointer, pointer += 16); + const credIDLen = dataView.getUint16(pointer); + pointer += 2; + credentialID = authData.slice(pointer, pointer += credIDLen); + /** + * Firefox 117 incorrectly CBOR-encodes authData when EdDSA (-8) is used for the public key. + * A CBOR "Map of 3 items" (0xa3) should be "Map of 4 items" (0xa4), and if we manually adjust + * the single byte there's a good chance the authData can be correctly parsed. + * + * This browser release also incorrectly uses the string labels "OKP" and "Ed25519" instead of + * their integer representations for kty and crv respectively. That's why the COSE public key + * in the hex below looks so odd. + */ + const badEdDSACBOR = fromHex("a301634f4b500327206745643235353139"); + const bytesAtCurrentPosition = authData.slice(pointer, pointer + badEdDSACBOR.byteLength); + let foundBadCBOR = false; + if (areEqual(badEdDSACBOR, bytesAtCurrentPosition)) { + foundBadCBOR = true; + authData[pointer] = 164; + } + const firstDecoded = decodeFirst(authData.slice(pointer)); + const firstEncoded = Uint8Array.from( + /** + * Casting to `Map` via `as unknown` here because TS doesn't make it possible to define Maps + * with discrete keys and properties with known types per pair, and CBOR libs typically parse + * CBOR Major Type 5 to `Map` because you can have numbers for keys. A `COSEPublicKey` can be + * generalized as "a Map with numbers for keys and either numbers or bytes for values" though. + * If this presumption falls apart then other parts of verification later on will fail so we + * should be safe doing this here. + */ + encode$1(firstDecoded) + ); + if (foundBadCBOR) authData[pointer] = 163; + credentialPublicKey = firstEncoded; + pointer += firstEncoded.byteLength; + } + let extensionsData = void 0; + let extensionsDataBuffer = void 0; + if (flags.ed) { + const firstDecoded = decodeFirst(authData.slice(pointer)); + extensionsDataBuffer = Uint8Array.from(encode$1(firstDecoded)); + extensionsData = decodeAuthenticatorExtensions(extensionsDataBuffer); + pointer += extensionsDataBuffer.byteLength; + } + if (authData.byteLength > pointer) throw new Error("Leftover bytes detected while parsing authenticator data"); + return _parseAuthenticatorDataInternals.stubThis({ + rpIdHash, + flagsBuf, + flags, + counter, + counterBuf, + aaguid, + credentialID, + credentialPublicKey, + extensionsData, + extensionsDataBuffer + }); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _parseAuthenticatorDataInternals = { stubThis: (value) => value }; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/toHash.js +/** +* Returns hash digest of the given data, using the given algorithm when provided. Defaults to using +* SHA-256. +*/ +function toHash(data, algorithm = -7) { + if (typeof data === "string") data = fromUTF8String(data); + return digest(data, algorithm); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/validateCertificatePath.js +/** +* Traverse an array of PEM certificates and ensure they form a proper chain +* @param x5cCertsPEM Typically the result of `x5c.map(convertASN1toPEM)` +* @param trustAnchorsPEM PEM-formatted certs that an attestation statement x5c may chain back to +*/ +async function validateCertificatePath(x5cCertsPEM, trustAnchorsPEM = []) { + if (trustAnchorsPEM.length === 0) return true; + const x5cCertsParsed = x5cCertsPEM.map((certPEM) => new import_x509_cjs.X509Certificate(certPEM)); + for (let i = 0; i < x5cCertsParsed.length; i++) { + const cert = x5cCertsParsed[i]; + const certPEM = x5cCertsPEM[i]; + try { + await assertCertNotRevoked(cert); + } catch (_err) { + throw new Error(`Found revoked certificate in x5c:\n${certPEM}`); + } + try { + assertCertIsWithinValidTimeWindow(cert.notBefore, cert.notAfter); + } catch (_err) { + throw new Error(`Found certificate out of validity period in x5c:\n${certPEM}`); + } + } + const trustAnchorsParsed = trustAnchorsPEM.map((certPEM) => { + try { + return new import_x509_cjs.X509Certificate(certPEM); + } catch (err) { + const _err = err; + throw new Error(`Could not parse trust anchor certificate:\n${certPEM}`, { cause: _err }); + } + }); + const validTrustAnchors = []; + for (let i = 0; i < trustAnchorsParsed.length; i++) { + const cert = trustAnchorsParsed[i]; + try { + await assertCertNotRevoked(cert); + } catch (_err) { + continue; + } + try { + assertCertIsWithinValidTimeWindow(cert.notBefore, cert.notAfter); + } catch (_err) { + continue; + } + validTrustAnchors.push(cert); + } + if (validTrustAnchors.length === 0) throw new Error("No specified trust anchor was valid for verifying x5c"); + let invalidCertificateChain = true; + for (const anchor of validTrustAnchors) try { + const x5cWithTrustAnchor = x5cCertsParsed.concat([anchor]); + const numUniqueCerts = new Set(x5cWithTrustAnchor.map((cert) => cert.toString("pem"))).size; + if (numUniqueCerts !== x5cWithTrustAnchor.length) throw new Error("Invalid certificate path: found duplicate certificates"); + const x5cLeafCert = x5cCertsParsed[0]; + let x5cIntermediates = []; + if (x5cCertsParsed.length > 1) x5cIntermediates = x5cCertsParsed.slice(1); + const chain = await new import_x509_cjs.X509ChainBuilder({ certificates: [...x5cIntermediates, anchor] }).build(x5cLeafCert); + if (chain.length < numUniqueCerts) continue; + if (chain[chain.length - 1].subject !== anchor.subject) continue; + invalidCertificateChain = false; + break; + } catch (err) { + throw new Error("Unexpected error while validating certificate path", { cause: err }); + } + if (invalidCertificateChain) throw new InvalidCertificatePath(); + return true; +} +/** +* Check if the certificate is revoked or not. If it is, raise an error +*/ +async function assertCertNotRevoked(certificate) { + if (await isCertRevoked(certificate)) throw new Error("Found revoked certificate in certificate path"); +} +/** +* Require the cert to be within its notBefore and notAfter time window +*/ +function assertCertIsWithinValidTimeWindow(certNotBefore, certNotAfter) { + const now = new Date(Date.now()); + if (certNotBefore > now || certNotAfter < now) throw new Error("Certificate is not yet valid or expired"); +} +var InvalidCertificatePath = class extends Error { + constructor() { + super("x5c could not be chained to any specified trust anchor"); + this.name = "InvalidX5CChain"; + } +}; +const id_ecdsaWithSHA1 = "1.2.840.10045.4.1"; +const id_ecdsaWithSHA224 = "1.2.840.10045.4.3.1"; +const id_ecdsaWithSHA256 = "1.2.840.10045.4.3.2"; +const id_ecdsaWithSHA384 = "1.2.840.10045.4.3.3"; +const id_ecdsaWithSHA512 = "1.2.840.10045.4.3.4"; +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/es2015/algorithms.js +function create$1(algorithm) { + return new AlgorithmIdentifier({ algorithm }); +} +create$1(id_ecdsaWithSHA1); +create$1(id_ecdsaWithSHA224); +create$1(id_ecdsaWithSHA256); +create$1(id_ecdsaWithSHA384); +create$1(id_ecdsaWithSHA512); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/es2015/rfc3279.js +init_tslib_es6$1(); +let FieldID = class FieldID { + fieldType; + parameters; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], FieldID.prototype, "fieldType", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Any })], FieldID.prototype, "parameters", void 0); +FieldID = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], FieldID); +var ECPoint = class extends OctetString {}; +let Curve = class Curve { + a; + b; + seed; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.OctetString })], Curve.prototype, "a", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.OctetString })], Curve.prototype, "b", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.BitString, + optional: true +})], Curve.prototype, "seed", void 0); +Curve = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], Curve); +var ECPVer; +(function(ECPVer) { + ECPVer[ECPVer["ecpVer1"] = 1] = "ecpVer1"; +})(ECPVer || (ECPVer = {})); +let SpecifiedECDomain = class SpecifiedECDomain { + version = ECPVer.ecpVer1; + fieldID; + curve; + base; + order; + cofactor; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], SpecifiedECDomain.prototype, "version", void 0); +__decorate$1([AsnProp({ type: FieldID })], SpecifiedECDomain.prototype, "fieldID", void 0); +__decorate$1([AsnProp({ type: Curve })], SpecifiedECDomain.prototype, "curve", void 0); +__decorate$1([AsnProp({ type: ECPoint })], SpecifiedECDomain.prototype, "base", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], SpecifiedECDomain.prototype, "order", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + optional: true +})], SpecifiedECDomain.prototype, "cofactor", void 0); +SpecifiedECDomain = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], SpecifiedECDomain); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/es2015/ec_parameters.js +init_tslib_es6$1(); +let ECParameters = class ECParameters { + namedCurve; + implicitCurve; + specifiedCurve; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.ObjectIdentifier })], ECParameters.prototype, "namedCurve", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Null })], ECParameters.prototype, "implicitCurve", void 0); +__decorate$1([AsnProp({ type: SpecifiedECDomain })], ECParameters.prototype, "specifiedCurve", void 0); +ECParameters = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], ECParameters); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/es2015/ec_private_key.js +init_tslib_es6$1(); +var ECPrivateKey = class { + version = 1; + privateKey = new OctetString(); + parameters; + publicKey; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], ECPrivateKey.prototype, "version", void 0); +__decorate$1([AsnProp({ type: OctetString })], ECPrivateKey.prototype, "privateKey", void 0); +__decorate$1([AsnProp({ + type: ECParameters, + context: 0, + optional: true +})], ECPrivateKey.prototype, "parameters", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.BitString, + context: 1, + optional: true +})], ECPrivateKey.prototype, "publicKey", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-ecc/build/es2015/ec_signature_value.js +init_tslib_es6$1(); +var ECDSASigValue = class { + r = /* @__PURE__ */ new ArrayBuffer(0); + s = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], ECDSASigValue.prototype, "r", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], ECDSASigValue.prototype, "s", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/object_identifiers.js +const id_pkcs_1 = "1.2.840.113549.1.1"; +const id_rsaEncryption = `${id_pkcs_1}.1`; +const id_RSAES_OAEP = `${id_pkcs_1}.7`; +const id_pSpecified = `${id_pkcs_1}.9`; +const id_RSASSA_PSS = `${id_pkcs_1}.10`; +const id_md2WithRSAEncryption = `${id_pkcs_1}.2`; +const id_md5WithRSAEncryption = `${id_pkcs_1}.4`; +const id_sha1WithRSAEncryption = `${id_pkcs_1}.5`; +const id_sha384WithRSAEncryption = `${id_pkcs_1}.12`; +const id_sha512WithRSAEncryption = `${id_pkcs_1}.13`; +const id_sha512_224WithRSAEncryption = `${id_pkcs_1}.15`; +const id_sha512_256WithRSAEncryption = `${id_pkcs_1}.16`; +const id_sha1 = "1.3.14.3.2.26"; +const id_sha224 = "2.16.840.1.101.3.4.2.4"; +const id_sha256 = "2.16.840.1.101.3.4.2.1"; +const id_sha384 = "2.16.840.1.101.3.4.2.2"; +const id_sha512 = "2.16.840.1.101.3.4.2.3"; +const id_sha512_224 = "2.16.840.1.101.3.4.2.5"; +const id_sha512_256 = "2.16.840.1.101.3.4.2.6"; +const id_md2 = "1.2.840.113549.2.2"; +const id_md5 = "1.2.840.113549.2.5"; +const id_mgf1 = `${id_pkcs_1}.8`; +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/algorithms.js +function create(algorithm) { + return new AlgorithmIdentifier({ + algorithm, + parameters: null + }); +} +create(id_md2); +create(id_md5); +const sha1 = create(id_sha1); +create(id_sha224); +create(id_sha256); +create(id_sha384); +create(id_sha512); +create(id_sha512_224); +create(id_sha512_256); +const mgf1SHA1 = new AlgorithmIdentifier({ + algorithm: id_mgf1, + parameters: AsnConvert.serialize(sha1) +}); +const pSpecifiedEmpty = new AlgorithmIdentifier({ + algorithm: id_pSpecified, + parameters: AsnConvert.serialize(AsnOctetStringConverter.toASN(new Uint8Array([ + 218, + 57, + 163, + 238, + 94, + 107, + 75, + 13, + 50, + 85, + 191, + 239, + 149, + 96, + 24, + 144, + 175, + 216, + 7, + 9 + ]).buffer)) +}); +create(id_rsaEncryption); +create(id_md2WithRSAEncryption); +create(id_md5WithRSAEncryption); +create(id_sha1WithRSAEncryption); +create(id_sha512_224WithRSAEncryption); +create(id_sha512_256WithRSAEncryption); +create(id_sha384WithRSAEncryption); +create(id_sha512WithRSAEncryption); +create(id_sha512_224WithRSAEncryption); +create(id_sha512_256WithRSAEncryption); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsaes_oaep.js +init_tslib_es6$1(); +var RsaEsOaepParams = class { + hashAlgorithm = new AlgorithmIdentifier(sha1); + maskGenAlgorithm = new AlgorithmIdentifier({ + algorithm: id_mgf1, + parameters: AsnConvert.serialize(sha1) + }); + pSourceAlgorithm = new AlgorithmIdentifier(pSpecifiedEmpty); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AlgorithmIdentifier, + context: 0, + defaultValue: sha1 +})], RsaEsOaepParams.prototype, "hashAlgorithm", void 0); +__decorate$1([AsnProp({ + type: AlgorithmIdentifier, + context: 1, + defaultValue: mgf1SHA1 +})], RsaEsOaepParams.prototype, "maskGenAlgorithm", void 0); +__decorate$1([AsnProp({ + type: AlgorithmIdentifier, + context: 2, + defaultValue: pSpecifiedEmpty +})], RsaEsOaepParams.prototype, "pSourceAlgorithm", void 0); +new AlgorithmIdentifier({ + algorithm: id_RSAES_OAEP, + parameters: AsnConvert.serialize(new RsaEsOaepParams()) +}); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pss.js +init_tslib_es6$1(); +var RsaSaPssParams = class { + hashAlgorithm = new AlgorithmIdentifier(sha1); + maskGenAlgorithm = new AlgorithmIdentifier({ + algorithm: id_mgf1, + parameters: AsnConvert.serialize(sha1) + }); + saltLength = 20; + trailerField = 1; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AlgorithmIdentifier, + context: 0, + defaultValue: sha1 +})], RsaSaPssParams.prototype, "hashAlgorithm", void 0); +__decorate$1([AsnProp({ + type: AlgorithmIdentifier, + context: 1, + defaultValue: mgf1SHA1 +})], RsaSaPssParams.prototype, "maskGenAlgorithm", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 2, + defaultValue: 20 +})], RsaSaPssParams.prototype, "saltLength", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + context: 3, + defaultValue: 1 +})], RsaSaPssParams.prototype, "trailerField", void 0); +new AlgorithmIdentifier({ + algorithm: id_RSASSA_PSS, + parameters: AsnConvert.serialize(new RsaSaPssParams()) +}); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/parameters/rsassa_pkcs1_v1_5.js +init_tslib_es6$1(); +var DigestInfo = class { + digestAlgorithm = new AlgorithmIdentifier(); + digest = new OctetString(); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AlgorithmIdentifier })], DigestInfo.prototype, "digestAlgorithm", void 0); +__decorate$1([AsnProp({ type: OctetString })], DigestInfo.prototype, "digest", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/other_prime_info.js +init_tslib_es6$1(); +var OtherPrimeInfos_1; +var OtherPrimeInfo = class { + prime = /* @__PURE__ */ new ArrayBuffer(0); + exponent = /* @__PURE__ */ new ArrayBuffer(0); + coefficient = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], OtherPrimeInfo.prototype, "prime", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], OtherPrimeInfo.prototype, "exponent", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], OtherPrimeInfo.prototype, "coefficient", void 0); +let OtherPrimeInfos = OtherPrimeInfos_1 = class OtherPrimeInfos extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, OtherPrimeInfos_1.prototype); + } +}; +OtherPrimeInfos = OtherPrimeInfos_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: OtherPrimeInfo +})], OtherPrimeInfos); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/rsa_private_key.js +init_tslib_es6$1(); +var RSAPrivateKey = class { + version = 0; + modulus = /* @__PURE__ */ new ArrayBuffer(0); + publicExponent = /* @__PURE__ */ new ArrayBuffer(0); + privateExponent = /* @__PURE__ */ new ArrayBuffer(0); + prime1 = /* @__PURE__ */ new ArrayBuffer(0); + prime2 = /* @__PURE__ */ new ArrayBuffer(0); + exponent1 = /* @__PURE__ */ new ArrayBuffer(0); + exponent2 = /* @__PURE__ */ new ArrayBuffer(0); + coefficient = /* @__PURE__ */ new ArrayBuffer(0); + otherPrimeInfos; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], RSAPrivateKey.prototype, "version", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "modulus", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "publicExponent", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "privateExponent", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "prime1", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "prime2", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "exponent1", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "exponent2", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPrivateKey.prototype, "coefficient", void 0); +__decorate$1([AsnProp({ + type: OtherPrimeInfos, + optional: true +})], RSAPrivateKey.prototype, "otherPrimeInfos", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-rsa/build/es2015/rsa_public_key.js +init_tslib_es6$1(); +var RSAPublicKey = class { + modulus = /* @__PURE__ */ new ArrayBuffer(0); + publicExponent = /* @__PURE__ */ new ArrayBuffer(0); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPublicKey.prototype, "modulus", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.Integer, + converter: AsnIntegerArrayBufferConverter +})], RSAPublicKey.prototype, "publicExponent", void 0); +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/mapX509SignatureAlgToCOSEAlg.js +/** +* Map X.509 signature algorithm OIDs to COSE algorithm IDs +* +* - EC2 OIDs: https://oidref.com/1.2.840.10045.4.3 +* - RSA OIDs: https://oidref.com/1.2.840.113549.1.1 +*/ +function mapX509SignatureAlgToCOSEAlg(signatureAlgorithm) { + let alg; + if (signatureAlgorithm === "1.2.840.10045.4.3.2") alg = COSEALG.ES256; + else if (signatureAlgorithm === "1.2.840.10045.4.3.3") alg = COSEALG.ES384; + else if (signatureAlgorithm === "1.2.840.10045.4.3.4") alg = COSEALG.ES512; + else if (signatureAlgorithm === "1.2.840.113549.1.1.11") alg = COSEALG.RS256; + else if (signatureAlgorithm === "1.2.840.113549.1.1.12") alg = COSEALG.RS384; + else if (signatureAlgorithm === "1.2.840.113549.1.1.13") alg = COSEALG.RS512; + else if (signatureAlgorithm === "1.2.840.113549.1.1.5") alg = COSEALG.RS1; + else throw new Error(`Unable to map X.509 signature algorithm ${signatureAlgorithm} to a COSE algorithm`); + return alg; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/convertX509PublicKeyToCOSE.js +function convertX509PublicKeyToCOSE(x509Certificate) { + let cosePublicKey = /* @__PURE__ */ new Map(); + const { tbsCertificate } = AsnParser.parse(x509Certificate, Certificate); + const { subjectPublicKeyInfo, signature: _tbsSignature } = tbsCertificate; + const signatureAlgorithm = _tbsSignature.algorithm; + const publicKeyAlgorithmID = subjectPublicKeyInfo.algorithm.algorithm; + if (publicKeyAlgorithmID === "1.2.840.10045.2.1") { + /** + * EC2 Public Key + */ + if (!subjectPublicKeyInfo.algorithm.parameters) throw new Error("Certificate public key was missing parameters (EC2)"); + const ecParameters = AsnParser.parse(new Uint8Array(subjectPublicKeyInfo.algorithm.parameters), ECParameters); + let crv = -999; + const { namedCurve } = ecParameters; + if (namedCurve === "1.2.840.10045.3.1.7") crv = COSECRV.P256; + else if (namedCurve === "1.3.132.0.34") crv = COSECRV.P384; + else throw new Error(`Certificate public key contained unexpected namedCurve ${namedCurve} (EC2)`); + const subjectPublicKey = new Uint8Array(subjectPublicKeyInfo.subjectPublicKey); + let x; + let y; + if (subjectPublicKey[0] === 4) { + let pointer = 1; + const halfLength = (subjectPublicKey.length - 1) / 2; + x = subjectPublicKey.slice(pointer, pointer += halfLength); + y = subjectPublicKey.slice(pointer); + } else throw new Error("TODO: Figure out how to handle public keys in \"compressed form\""); + const coseEC2PubKey = /* @__PURE__ */ new Map(); + coseEC2PubKey.set(COSEKEYS.kty, COSEKTY.EC2); + coseEC2PubKey.set(COSEKEYS.alg, mapX509SignatureAlgToCOSEAlg(signatureAlgorithm)); + coseEC2PubKey.set(COSEKEYS.crv, crv); + coseEC2PubKey.set(COSEKEYS.x, x); + coseEC2PubKey.set(COSEKEYS.y, y); + cosePublicKey = coseEC2PubKey; + } else if (publicKeyAlgorithmID === id_rsaEncryption) { + /** + * RSA public key + */ + const rsaPublicKey = AsnParser.parse(subjectPublicKeyInfo.subjectPublicKey, RSAPublicKey); + const coseRSAPubKey = /* @__PURE__ */ new Map(); + coseRSAPubKey.set(COSEKEYS.kty, COSEKTY.RSA); + coseRSAPubKey.set(COSEKEYS.alg, mapX509SignatureAlgToCOSEAlg(signatureAlgorithm)); + coseRSAPubKey.set(COSEKEYS.n, new Uint8Array(rsaPublicKey.modulus)); + coseRSAPubKey.set(COSEKEYS.e, new Uint8Array(rsaPublicKey.publicExponent)); + cosePublicKey = coseRSAPubKey; + } else throw new Error(`Certificate public key contained unexpected algorithm ID ${publicKeyAlgorithmID}`); + return cosePublicKey; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/verifySignature.js +/** +* Verify an authenticator's signature +*/ +function verifySignature(opts) { + const { signature, data, credentialPublicKey, x509Certificate, hashAlgorithm } = opts; + if (!x509Certificate && !credentialPublicKey) throw new Error("Must declare either \"leafCert\" or \"credentialPublicKey\""); + if (x509Certificate && credentialPublicKey) throw new Error("Must not declare both \"leafCert\" and \"credentialPublicKey\""); + let cosePublicKey = /* @__PURE__ */ new Map(); + if (credentialPublicKey) cosePublicKey = decodeCredentialPublicKey(credentialPublicKey); + else if (x509Certificate) cosePublicKey = convertX509PublicKeyToCOSE(x509Certificate); + return _verifySignatureInternals.stubThis(verify({ + cosePublicKey, + signature, + data, + shaHashOverride: hashAlgorithm + })); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _verifySignatureInternals = { stubThis: (value) => value }; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/metadata/parseJWT.js +/** +* Process a JWT into Javascript-friendly data structures +*/ +function parseJWT(jwt) { + const parts = jwt.split("."); + return [ + JSON.parse(toUTF8String$1(parts[0])), + JSON.parse(toUTF8String$1(parts[1])), + parts[2] + ]; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/metadata/verifyJWT.js +/** +* Lightweight verification for FIDO MDS JWTs. Supports use of EC2 and RSA. +* +* If this ever needs to support more JWS algorithms, here's the list of them: +* +* https://www.rfc-editor.org/rfc/rfc7518.html#section-3.1 +* +* (Pulled from https://www.rfc-editor.org/rfc/rfc7515#section-4.1.1) +*/ +function verifyJWT(jwt, leafCert) { + const [header, payload, signature] = jwt.split("."); + const certCOSE = convertX509PublicKeyToCOSE(leafCert); + const data = fromUTF8String(`${header}.${payload}`); + const signatureBytes = toBuffer(signature); + if (isCOSEPublicKeyEC2(certCOSE)) return verifyEC2({ + data, + signature: signatureBytes, + cosePublicKey: certCOSE, + shaHashOverride: COSEALG.ES256 + }); + else if (isCOSEPublicKeyRSA(certCOSE)) return verifyRSA({ + data, + signature: signatureBytes, + cosePublicKey: certCOSE + }); + const kty = certCOSE.get(COSEKEYS.kty); + throw new Error(`JWT verification with public key of kty ${kty} is not supported by this method`); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/convertPEMToBytes.js +/** +* Take a certificate in PEM format and convert it to bytes +*/ +function convertPEMToBytes(pem) { + return toBuffer(pem.replace("-----BEGIN CERTIFICATE-----", "").replace("-----END CERTIFICATE-----", "").replace(/[\n ]/g, ""), "base64"); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-safetynet.js +/** +* GlobalSign Root CA +* +* Downloaded from https://pki.goog/roots.pem +* +* Valid until 2028-01-28 @ 04:00 PST +* +* SHA256 Fingerprint +* EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99 +*/ +const GlobalSign_Root_CA = `-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B +AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz +yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE +38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP +AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad +DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME +HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- +`; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/android-key.js +/** +* Google Hardware Attestation Root 1 +* +* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate +* (first entry) +* +* Valid until 2026-05-24 @ 09:28 PST +* +* SHA256 Fingerprint +* C1:98:4A:3E:F4:5C:1E:2A:91:85:51:DE:10:60:3C:86:F7:05:1B:22:49:C4:89:1C:AE:32:30:EA:BD:0C:97:D5 +*/ +const Google_Hardware_Attestation_Root_1 = `-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIJAOj6GWMU0voYMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV +BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTYwNTI2MTYyODUyWhcNMjYwNTI0MTYy +ODUyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS +Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 +tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj +nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq +C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ +oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O +JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg +sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi +igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M +RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E +aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um +AGMCAwEAAaOBpjCBozAdBgNVHQ4EFgQUNmHhAHyIBQlRi0RsR/8aTMnqTxIwHwYD +VR0jBBgwFoAUNmHhAHyIBQlRi0RsR/8aTMnqTxIwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAYYwQAYDVR0fBDkwNzA1oDOgMYYvaHR0cHM6Ly9hbmRyb2lk +Lmdvb2dsZWFwaXMuY29tL2F0dGVzdGF0aW9uL2NybC8wDQYJKoZIhvcNAQELBQAD +ggIBACDIw41L3KlXG0aMiS//cqrG+EShHUGo8HNsw30W1kJtjn6UBwRM6jnmiwfB +Pb8VA91chb2vssAtX2zbTvqBJ9+LBPGCdw/E53Rbf86qhxKaiAHOjpvAy5Y3m00m +qC0w/Zwvju1twb4vhLaJ5NkUJYsUS7rmJKHHBnETLi8GFqiEsqTWpG/6ibYCv7rY +DBJDcR9W62BW9jfIoBQcxUCUJouMPH25lLNcDc1ssqvC2v7iUgI9LeoM1sNovqPm +QUiG9rHli1vXxzCyaMTjwftkJLkf6724DFhuKug2jITV0QkXvaJWF4nUaHOTNA4u +JU9WDvZLI1j83A+/xnAJUucIv/zGJ1AMH2boHqF8CY16LpsYgBt6tKxxWH00XcyD +CdW2KlBCeqbQPcsFmWyWugxdcekhYsAWyoSf818NUsZdBWBaR/OukXrNLfkQ79Iy +ZohZbvabO/X+MVT3rriAoKc8oE2Uws6DF+60PV7/WIPjNvXySdqspImSN78mflxD +qwLqRBYkA3I75qppLGG9rp7UCdRjxMl8ZDBld+7yvHVgt1cVzJx9xnyGCC23Uaic +MDSXYrB4I4WHXPGjxhZuCuPBLTdOLU8YRvMYdEvYebWHMpvwGCF6bAx3JBpIeOQ1 +wDB5y0USicV3YgYGmi+NZfhA4URSh77Yd6uuJOJENRaNVTzk +-----END CERTIFICATE----- +`; +/** +* Google Hardware Attestation Root 2 +* +* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate +* (second entry) +* +* Valid until 2034-11-18 @ 12:37 PST +* +* SHA256 Fingerprint +* 1E:F1:A0:4B:8B:A5:8A:B9:45:89:AC:49:8C:89:82:A7:83:F2:4E:A7:30:7E:01:59:A0:C3:A7:3B:37:7D:87:CC +*/ +const Google_Hardware_Attestation_Root_2 = `-----BEGIN CERTIFICATE----- +MIIFHDCCAwSgAwIBAgIJANUP8luj8tazMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV +BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMTkxMTIyMjAzNzU4WhcNMzQxMTE4MjAz +NzU4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS +Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 +tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj +nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq +C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ +oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O +JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg +sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi +igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M +RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E +aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um +AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud +IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBOMaBc8oumXb2voc7XCWnu +XKhBBK3e2KMGz39t7lA3XXRe2ZLLAkLM5y3J7tURkf5a1SutfdOyXAmeE6SRo83U +h6WszodmMkxK5GM4JGrnt4pBisu5igXEydaW7qq2CdC6DOGjG+mEkN8/TA6p3cno +L/sPyz6evdjLlSeJ8rFBH6xWyIZCbrcpYEJzXaUOEaxxXxgYz5/cTiVKN2M1G2ok +QBUIYSY6bjEL4aUN5cfo7ogP3UvliEo3Eo0YgwuzR2v0KR6C1cZqZJSTnghIC/vA +D32KdNQ+c3N+vl2OTsUVMC1GiWkngNx1OO1+kXW+YTnnTUOtOIswUP/Vqd5SYgAI +mMAfY8U9/iIgkQj6T2W6FsScy94IN9fFhE1UtzmLoBIuUFsVXJMTz+Jucth+IqoW +Fua9v1R93/k98p41pjtFX+H8DslVgfP097vju4KDlqN64xV1grw3ZLl4CiOe/A91 +oeLm2UHOq6wn3esB4r2EIQKb6jTVGu5sYCcdWpXr0AUVqcABPdgL+H7qJguBw09o +jm6xNIrw2OocrDKsudk/okr/AwqEyPKw9WnMlQgLIKw1rODG2NvU9oR3GVGdMkUB +ZutL8VuFkERQGt6vQ2OCw0sV47VMkuYbacK/xyZFiRcrPJPb41zgbQj9XAEyLKCH +ex0SdDrx+tWUDqG8At2JHA== +-----END CERTIFICATE----- +`; +/** +* Google Hardware Attestation Root 3 +* +* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate +* (third entry) +* +* Valid until 2036-11-13 @ 15:10 PST +* +* SHA256 Fingerprint +* AB:66:41:17:8A:36:E1:79:AA:0C:1C:DD:DF:9A:16:EB:45:FA:20:94:3E:2B:8C:D7:C7:C0:5C:26:CF:8B:48:7A +*/ +const Google_Hardware_Attestation_Root_3 = ` +-----BEGIN CERTIFICATE----- +MIIFHDCCAwSgAwIBAgIJAMNrfES5rhgxMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV +BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjExMTE3MjMxMDQyWhcNMzYxMTEzMjMx +MDQyWjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS +Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 +tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj +nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq +C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ +oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O +JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg +sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi +igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M +RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E +aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um +AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud +IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQBTNNZe5cuf8oiq+jV0itTG +zWVhSTjOBEk2FQvh11J3o3lna0o7rd8RFHnN00q4hi6TapFhh4qaw/iG6Xg+xOan +63niLWIC5GOPFgPeYXM9+nBb3zZzC8ABypYuCusWCmt6Tn3+Pjbz3MTVhRGXuT/T +QH4KGFY4PhvzAyXwdjTOCXID+aHud4RLcSySr0Fq/L+R8TWalvM1wJJPhyRjqRCJ +erGtfBagiALzvhnmY7U1qFcS0NCnKjoO7oFedKdWlZz0YAfu3aGCJd4KHT0MsGiL +Zez9WP81xYSrKMNEsDK+zK5fVzw6jA7cxmpXcARTnmAuGUeI7VVDhDzKeVOctf3a +0qQLwC+d0+xrETZ4r2fRGNw2YEs2W8Qj6oDcfPvq9JySe7pJ6wcHnl5EZ0lwc4xH +7Y4Dx9RA1JlfooLMw3tOdJZH0enxPXaydfAD3YifeZpFaUzicHeLzVJLt9dvGB0b +HQLE4+EqKFgOZv2EoP686DQqbVS1u+9k0p2xbMA105TBIk7npraa8VM0fnrRKi7w +lZKwdH+aNAyhbXRW9xsnODJ+g8eF452zvbiKKngEKirK5LGieoXBX7tZ9D1GNBH2 +Ob3bKOwwIWdEFle/YF/h6zWgdeoaNGDqVBrLr2+0DtWoiB1aDEjLWl9FmyIUyUm7 +mD/vFDkzF+wm7cyWpQpCVQ== +-----END CERTIFICATE----- +`; +/** +* Google Hardware Attestation Root 4 +* +* Downloaded from https://developer.android.com/training/articles/security-key-attestation#root_certificate +* (fourth entry) +* +* Valid until 2042-03-15 @ 11:07 PDT +* +* SHA256 Fingerprint +* CE:DB:1C:B6:DC:89:6A:E5:EC:79:73:48:BC:E9:28:67:53:C2:B3:8E:E7:1C:E0:FB:E3:4A:9A:12:48:80:0D:FC +*/ +const Google_Hardware_Attestation_Root_4 = ` +-----BEGIN CERTIFICATE----- +MIIFHDCCAwSgAwIBAgIJAPHBcqaZ6vUdMA0GCSqGSIb3DQEBCwUAMBsxGTAXBgNV +BAUTEGY5MjAwOWU4NTNiNmIwNDUwHhcNMjIwMzIwMTgwNzQ4WhcNNDIwMzE1MTgw +NzQ4WjAbMRkwFwYDVQQFExBmOTIwMDllODUzYjZiMDQ1MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr7bHgiuxpwHsK7Qui8xUFmOr75gvMsd/dTEDDJdS +Sxtf6An7xyqpRR90PL2abxM1dEqlXnf2tqw1Ne4Xwl5jlRfdnJLmN0pTy/4lj4/7 +tv0Sk3iiKkypnEUtR6WfMgH0QZfKHM1+di+y9TFRtv6y//0rb+T+W8a9nsNL/ggj +nar86461qO0rOs2cXjp3kOG1FEJ5MVmFmBGtnrKpa73XpXyTqRxB/M0n1n/W9nGq +C4FSYa04T6N5RIZGBN2z2MT5IKGbFlbC8UrW0DxW7AYImQQcHtGl/m00QLVWutHQ +oVJYnFPlXTcHYvASLu+RhhsbDmxMgJJ0mcDpvsC4PjvB+TxywElgS70vE0XmLD+O +JtvsBslHZvPBKCOdT0MS+tgSOIfga+z1Z1g7+DVagf7quvmag8jfPioyKvxnK/Eg +sTUVi2ghzq8wm27ud/mIM7AY2qEORR8Go3TVB4HzWQgpZrt3i5MIlCaY504LzSRi +igHCzAPlHws+W0rB5N+er5/2pJKnfBSDiCiFAVtCLOZ7gLiMm0jhO2B6tUXHI/+M +RPjy02i59lINMRRev56GKtcd9qO/0kUJWdZTdA2XoS82ixPvZtXQpUpuL12ab+9E +aDK8Z4RHJYYfCT3Q5vNAXaiWQ+8PTWm2QgBR/bkwSWc+NpUFgNPN9PvQi8WEg5Um +AGMCAwEAAaNjMGEwHQYDVR0OBBYEFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMB8GA1Ud +IwQYMBaAFDZh4QB8iAUJUYtEbEf/GkzJ6k8SMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgIEMA0GCSqGSIb3DQEBCwUAA4ICAQB8cMqTllHc8U+qCrOlg3H7 +174lmaCsbo/bJ0C17JEgMLb4kvrqsXZs01U3mB/qABg/1t5Pd5AORHARs1hhqGIC +W/nKMav574f9rZN4PC2ZlufGXb7sIdJpGiO9ctRhiLuYuly10JccUZGEHpHSYM2G +tkgYbZba6lsCPYAAP83cyDV+1aOkTf1RCp/lM0PKvmxYN10RYsK631jrleGdcdkx +oSK//mSQbgcWnmAEZrzHoF1/0gso1HZgIn0YLzVhLSA/iXCX4QT2h3J5z3znluKG +1nv8NQdxei2DIIhASWfu804CA96cQKTTlaae2fweqXjdN1/v2nqOhngNyz1361mF +mr4XmaKH/ItTwOe72NI9ZcwS1lVaCvsIkTDCEXdm9rCNPAY10iTunIHFXRh+7KPz +lHGewCq/8TOohBRn0/NNfh7uRslOSZ/xKbN9tMBtw37Z8d2vvnXq/YWdsm1+JLVw +n6yYD/yacNJBlwpddla8eaVMjsF6nBnIgQOf9zKSe06nSTqvgwUHosgOECZJZ1Eu +zbH4yswbt02tKtKEFhx+v+OTge/06V+jGsqTWLsfrOCNLuA8H++z+pUENmpqnnHo +vaI47gC+TNpkgYGkkBT6B/m/U01BuOBBTzhIlMEZq9qkDWuM2cA5kW5V3FJUcfHn +w1IdYIg2Wxg7yHcQZemFQg== +-----END CERTIFICATE----- +`; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/apple.js +/** +* Apple WebAuthn Root CA +* +* Downloaded from https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem +* +* Valid until 2045-03-14 @ 17:00 PST +* +* SHA256 Fingerprint +* 09:15:DD:5C:07:A2:8D:B5:49:D1:F6:77:BB:5A:75:D4:BF:BE:95:61:A7:73:42:43:27:76:2E:9E:02:F9:BB:29 +*/ +const Apple_WebAuthn_Root_CA = `-----BEGIN CERTIFICATE----- +MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w +HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ +bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx +NTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEG +A1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49 +AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11k +xu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/ +pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk +2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cA +MGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3 +jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5RCmGQ21gpSAk9QZW4B +1bWeT0vT +-----END CERTIFICATE----- +`; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/services/defaultRootCerts/mds.js +/** +* GlobalSign Root CA - R3 +* +* Downloaded from https://valid.r3.roots.globalsign.com/ +* +* Valid until 2029-03-18 @ 00:00 PST +* +* SHA256 Fingerprint +* CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B +*/ +const GlobalSign_Root_CA_R3 = `-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 +MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 +RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT +gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm +KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd +QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ +XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o +LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU +RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp +jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK +6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX +mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs +Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH +WD9f +-----END CERTIFICATE----- + `; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/services/settingsService.js +var BaseSettingsService = class { + constructor() { + Object.defineProperty(this, "pemCertificates", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.pemCertificates = /* @__PURE__ */ new Map(); + } + setRootCertificates(opts) { + const { identifier, certificates } = opts; + const newCertificates = []; + for (const cert of certificates) if (cert instanceof Uint8Array) newCertificates.push(convertCertBufferToPEM(cert)); + else newCertificates.push(cert); + this.pemCertificates.set(identifier, newCertificates); + } + getRootCertificates(opts) { + const { identifier } = opts; + return this.pemCertificates.get(identifier) ?? []; + } +}; +/** +* A basic service for specifying acceptable root certificates for all supported attestation +* statement formats. +* +* In addition, default root certificates are included for the following statement formats: +* +* - `'android-key'` +* - `'android-safetynet'` +* - `'apple'` +* - `'android-mds'` +* +* These can be overwritten as needed by setting alternative root certificates for their format +* identifier using `setRootCertificates()`. +*/ +const SettingsService = new BaseSettingsService(); +SettingsService.setRootCertificates({ + identifier: "android-key", + certificates: [ + Google_Hardware_Attestation_Root_1, + Google_Hardware_Attestation_Root_2, + Google_Hardware_Attestation_Root_3, + Google_Hardware_Attestation_Root_4 + ] +}); +SettingsService.setRootCertificates({ + identifier: "android-safetynet", + certificates: [GlobalSign_Root_CA] +}); +SettingsService.setRootCertificates({ + identifier: "apple", + certificates: [Apple_WebAuthn_Root_CA] +}); +SettingsService.setRootCertificates({ + identifier: "mds", + certificates: [GlobalSign_Root_CA_R3] +}); +//#endregion +//#region node_modules/@simplewebauthn/server/esm/metadata/verifyMDSBlob.js +/** +* Perform authenticity and integrity verification of a +* [FIDO Metadata Service (MDS)](https://fidoalliance.org/metadata/)-compatible blob, and then +* extract the FIDO2 metadata statements included within. This method will make network requests +* for things like CRL checks. +* +* @param blob - A JWT downloaded from an MDS server (e.g. https://mds3.fidoalliance.org) +*/ +async function verifyMDSBlob(blob) { + const parsedJWT = parseJWT(blob); + const header = parsedJWT[0]; + const payload = parsedJWT[1]; + const headerCertsPEM = header.x5c.map(convertCertBufferToPEM); + try { + await validateCertificatePath(headerCertsPEM, SettingsService.getRootCertificates({ identifier: "mds" })); + } catch (error) { + throw new Error("BLOB certificate path could not be validated", { cause: error }); + } + const leafCert = headerCertsPEM[0]; + if (!await verifyJWT(blob, convertPEMToBytes(leafCert))) throw new Error("BLOB signature could not be verified"); + const statements = []; + for (const entry of payload.entries) if (entry.aaguid && entry.metadataStatement) statements.push(entry.metadataStatement); + const [year, month, day] = payload.nextUpdate.split("-"); + return { + statements, + parsedNextUpdate: new Date(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10)), + payload + }; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verifyOKP.js +async function verifyOKP(opts) { + const { cosePublicKey, signature, data } = opts; + const WebCrypto = await getWebCrypto(); + const alg = cosePublicKey.get(COSEKEYS.alg); + const crv = cosePublicKey.get(COSEKEYS.crv); + const x = cosePublicKey.get(COSEKEYS.x); + if (!alg) throw new Error("Public key was missing alg (OKP)"); + if (!isCOSEAlg(alg)) throw new Error(`Public key had invalid alg ${alg} (OKP)`); + if (!crv) throw new Error("Public key was missing crv (OKP)"); + if (!x) throw new Error("Public key was missing x (OKP)"); + let _crv; + if (crv === COSECRV.ED25519) _crv = "Ed25519"; + else throw new Error(`Unexpected COSE crv value of ${crv} (OKP)`); + const key = await importKey({ + keyData: { + kty: "OKP", + crv: _crv, + alg: "EdDSA", + x: fromBuffer(x), + ext: false + }, + algorithm: { + name: _crv, + namedCurve: _crv + } + }); + const verifyAlgorithm = { name: _crv }; + return WebCrypto.subtle.verify(verifyAlgorithm, key, signature, data); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/unwrapEC2Signature.js +/** +* In WebAuthn, EC2 signatures are wrapped in ASN.1 structure so we need to peel r and s apart. +* +* See https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types +*/ +function unwrapEC2Signature(signature, crv) { + const parsedSignature = AsnParser.parse(signature, ECDSASigValue); + const rBytes = new Uint8Array(parsedSignature.r); + const sBytes = new Uint8Array(parsedSignature.s); + const componentLength = getSignatureComponentLength(crv); + return concat([toNormalizedBytes(rBytes, componentLength), toNormalizedBytes(sBytes, componentLength)]); +} +/** +* The SubtleCrypto Web Crypto API expects ECDSA signatures with `r` and `s` values to be encoded +* to a specific length depending on the order of the curve. This function returns the expected +* byte-length for each of the `r` and `s` signature components. +* +* See +*/ +function getSignatureComponentLength(crv) { + switch (crv) { + case COSECRV.P256: return 32; + case COSECRV.P384: return 48; + case COSECRV.P521: return 66; + default: throw new Error(`Unexpected COSE crv value of ${crv} (EC2)`); + } +} +/** +* Converts the ASN.1 integer representation to bytes of a specific length `n`. +* +* DER encodes integers as big-endian byte arrays, with as small as possible representation and +* requires a leading `0` byte to disambiguate between negative and positive numbers. This means +* that `r` and `s` can potentially not be the expected byte-length that is needed by the +* SubtleCrypto Web Crypto API: if there are leading `0`s it can be shorter than expected, and if +* it has a leading `1` bit, it can be one byte longer. +* +* See +* See +*/ +function toNormalizedBytes(bytes, componentLength) { + let normalizedBytes; + if (bytes.length < componentLength) { + normalizedBytes = new Uint8Array(componentLength); + normalizedBytes.set(bytes, componentLength - bytes.length); + } else if (bytes.length === componentLength) normalizedBytes = bytes; + else if (bytes.length === componentLength + 1 && bytes[0] === 0 && (bytes[1] & 128) === 128) normalizedBytes = bytes.subarray(1); + else throw new Error(`Invalid signature component length ${bytes.length}, expected ${componentLength}`); + return normalizedBytes; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoCrypto/verify.js +/** +* Verify signatures with their public key. Supports EC2 and RSA public keys. +*/ +function verify(opts) { + const { cosePublicKey, signature, data, shaHashOverride } = opts; + if (isCOSEPublicKeyEC2(cosePublicKey)) { + const crv = cosePublicKey.get(COSEKEYS.crv); + if (!isCOSECrv(crv)) throw new Error(`unknown COSE curve ${crv}`); + return verifyEC2({ + cosePublicKey, + signature: unwrapEC2Signature(signature, crv), + data, + shaHashOverride + }); + } else if (isCOSEPublicKeyRSA(cosePublicKey)) return verifyRSA({ + cosePublicKey, + signature, + data, + shaHashOverride + }); + else if (isCOSEPublicKeyOKP(cosePublicKey)) return verifyOKP({ + cosePublicKey, + signature, + data + }); + const kty = cosePublicKey.get(COSEKEYS.kty); + throw new Error(`Signature verification with public key of kty ${kty} is not supported by this method`); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/iso/isoUint8Array.js +/** +* A runtime-agnostic collection of methods for working with Uint8Arrays +* @module +*/ +/** +* Make sure two Uint8Arrays are deeply equivalent +*/ +function areEqual(array1, array2) { + if (array1.length != array2.length) return false; + return array1.every((val, i) => val === array2[i]); +} +/** +* Convert a Uint8Array to Hexadecimal. +* +* A replacement for `Buffer.toString('hex')` +*/ +function toHex(array) { + return Array.from(array, (i) => i.toString(16).padStart(2, "0")).join(""); +} +/** +* Convert a hexadecimal string to isoUint8Array. +* +* A replacement for `Buffer.from('...', 'hex')` +*/ +function fromHex(hex) { + if (!hex) return Uint8Array.from([]); + if (!(hex.length !== 0 && hex.length % 2 === 0 && !/[^a-fA-F0-9]/u.test(hex))) throw new Error("Invalid hex string"); + const byteStrings = hex.match(/.{1,2}/g) ?? []; + return Uint8Array.from(byteStrings.map((byte) => parseInt(byte, 16))); +} +/** +* Combine multiple Uint8Arrays into a single Uint8Array +*/ +function concat(arrays) { + let pointer = 0; + const totalLength = arrays.reduce((prev, curr) => prev + curr.length, 0); + const toReturn = new Uint8Array(totalLength); + arrays.forEach((arr) => { + toReturn.set(arr, pointer); + pointer += arr.length; + }); + return toReturn; +} +/** +* Convert bytes into a UTF-8 string +*/ +function toUTF8String(array) { + return new globalThis.TextDecoder("utf-8").decode(array); +} +/** +* Convert a UTF-8 string back into bytes +*/ +function fromUTF8String(utf8String) { + return new globalThis.TextEncoder().encode(utf8String); +} +/** +* Convert an ASCII string to Uint8Array +*/ +function fromASCIIString(value) { + return Uint8Array.from(value.split("").map((x) => x.charCodeAt(0))); +} +/** +* Prepare a DataView we can slice our way around in as we parse the bytes in a Uint8Array +*/ +function toDataView(array) { + return new DataView(array.buffer, array.byteOffset, array.length); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/generateChallenge.js +/** +* Generate a suitably random value to be used as an attestation or assertion challenge +*/ +async function generateChallenge() { + /** + * WebAuthn spec says that 16 bytes is a good minimum: + * + * "In order to prevent replay attacks, the challenges MUST contain enough entropy to make + * guessing them infeasible. Challenges SHOULD therefore be at least 16 bytes long." + * + * Just in case, let's double it + */ + const challenge = new Uint8Array(32); + await getRandomValues(challenge); + return _generateChallengeInternals.stubThis(challenge); +} +/** +* Make it possible to stub the return value during testing +* @ignore Don't include this in docs output +*/ +const _generateChallengeInternals = { stubThis: (value) => value }; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/generateRegistrationOptions.js +/** +* Supported crypto algo identifiers +* See https://w3c.github.io/webauthn/#sctn-alg-identifier +* and https://www.iana.org/assignments/cose/cose.xhtml#algorithms +*/ +const supportedCOSEAlgorithmIdentifiers = [ + -8, + -7, + -36, + -37, + -38, + -39, + -257, + -258, + -259, + -65535 +]; +/** +* Set up some default authenticator selection options as per the latest spec: +* https://www.w3.org/TR/webauthn-2/#dictdef-authenticatorselectioncriteria +* +* Helps with some older platforms (e.g. Android 7.0 Nougat) that may not be aware of these +* defaults. +*/ +const defaultAuthenticatorSelection = { + residentKey: "preferred", + userVerification: "preferred" +}; +/** +* Use the most commonly-supported algorithms +* See the following: +* - https://www.iana.org/assignments/cose/cose.xhtml#algorithms +* - https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-pubkeycredparams +*/ +const defaultSupportedAlgorithmIDs = [ + -8, + -7, + -257 +]; +/** +* Prepare a value to pass into navigator.credentials.create(...) for authenticator registration +* +* **Options:** +* +* @param rpName - User-visible, "friendly" website/service name +* @param rpID - Valid domain name (after `https://`) +* @param userName - User's website-specific username (email, etc...) +* @param userID **(Optional)** - User's website-specific unique ID. Defaults to generating a random identifier +* @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back. Defaults to generating a random value +* @param userDisplayName **(Optional)** - User's actual name. Defaults to `""` +* @param timeout **(Optional)** - How long (in ms) the user can take to complete attestation. Defaults to `60000` +* @param attestationType **(Optional)** - Specific attestation statement. Defaults to `"none"` +* @param excludeCredentials **(Optional)** - Authenticators registered by the user so the user can't register the same credential multiple times. Defaults to `[]` +* @param authenticatorSelection **(Optional)** - Advanced criteria for restricting the types of authenticators that may be used. Defaults to `{ residentKey: 'preferred', userVerification: 'preferred' }` +* @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during attestation +* @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to `[-8, -7, -257]` +* @param preferredAuthenticatorType **(Optional)** - Encourage the browser to prompt the user to register a specific type of authenticator +*/ +async function generateRegistrationOptions(options) { + const { rpName, rpID, userName, userID, challenge = await generateChallenge(), userDisplayName = "", timeout = 6e4, attestationType = "none", excludeCredentials = [], authenticatorSelection = defaultAuthenticatorSelection, extensions, supportedAlgorithmIDs = defaultSupportedAlgorithmIDs, preferredAuthenticatorType } = options; + /** + * Prepare pubKeyCredParams from the array of algorithm ID's + */ + const pubKeyCredParams = supportedAlgorithmIDs.map((id) => ({ + alg: id, + type: "public-key" + })); + /** + * Capture some of the nuances of how `residentKey` and `requireResidentKey` how either is set + * depending on when either is defined in the options + */ + if (authenticatorSelection.residentKey === void 0) { + /** + * `residentKey`: "If no value is given then the effective value is `required` if + * requireResidentKey is true or `discouraged` if it is false or absent." + * + * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-residentkey + */ + if (authenticatorSelection.requireResidentKey) authenticatorSelection.residentKey = "required"; + } else + /** + * `requireResidentKey`: "Relying Parties SHOULD set it to true if, and only if, residentKey is + * set to "required"" + * + * Spec says this property defaults to `false` so we should still be okay to assign `false` too + * + * See https://www.w3.org/TR/webauthn-2/#dom-authenticatorselectioncriteria-requireresidentkey + */ + authenticatorSelection.requireResidentKey = authenticatorSelection.residentKey === "required"; + /** + * Preserve ability to specify `string` values for challenges + */ + let _challenge = challenge; + if (typeof _challenge === "string") _challenge = fromUTF8String(_challenge); + /** + * Explicitly disallow use of strings for userID anymore because `isoBase64URL.fromBuffer()` below + * will return an empty string if one gets through! + */ + if (typeof userID === "string") throw new Error(`String values for \`userID\` are no longer supported. See https://simplewebauthn.dev/docs/advanced/server/custom-user-ids`); + /** + * Generate a user ID if one is not provided + */ + let _userID = userID; + if (!_userID) _userID = await generateUserID(); + /** + * Map authenticator preference to hints. Map to authenticatorAttachment as well for + * backwards-compatibility. + */ + const hints = []; + if (preferredAuthenticatorType) { + if (preferredAuthenticatorType === "securityKey") { + hints.push("security-key"); + authenticatorSelection.authenticatorAttachment = "cross-platform"; + } else if (preferredAuthenticatorType === "localDevice") { + hints.push("client-device"); + authenticatorSelection.authenticatorAttachment = "platform"; + } else if (preferredAuthenticatorType === "remoteDevice") { + hints.push("hybrid"); + authenticatorSelection.authenticatorAttachment = "cross-platform"; + } + } + return { + challenge: fromBuffer(_challenge), + rp: { + name: rpName, + id: rpID + }, + user: { + id: fromBuffer(_userID), + name: userName, + displayName: userDisplayName + }, + pubKeyCredParams, + timeout, + attestation: attestationType, + excludeCredentials: excludeCredentials.map((cred) => { + if (!isBase64URL(cred.id)) throw new Error(`excludeCredential id "${cred.id}" is not a valid base64url string`); + return { + ...cred, + id: trimPadding(cred.id), + type: "public-key" + }; + }), + authenticatorSelection, + extensions: { + ...extensions, + credProps: true + }, + hints + }; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/parseBackupFlags.js +/** +* Make sense of Bits 3 and 4 in authenticator indicating: +* +* - Whether the credential can be used on multiple devices +* - Whether the credential is backed up or not +* +* Invalid configurations will raise an `Error` +*/ +function parseBackupFlags({ be, bs }) { + const credentialBackedUp = bs; + let credentialDeviceType = "singleDevice"; + if (be) credentialDeviceType = "multiDevice"; + if (credentialDeviceType === "singleDevice" && credentialBackedUp) throw new InvalidBackupFlags("Single-device credential indicated that it was backed up, which should be impossible."); + return { + credentialDeviceType, + credentialBackedUp + }; +} +var InvalidBackupFlags = class extends Error { + constructor(message) { + super(message); + this.name = "InvalidBackupFlags"; + } +}; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/matchExpectedRPID.js +/** +* Go through each expected RP ID and try to find one that matches. Returns the unhashed RP ID +* that matched the hash in the response. +* +* Raises an `UnexpectedRPIDHash` error if no match is found +*/ +async function matchExpectedRPID(rpIDHash, expectedRPIDs) { + try { + return await Promise.any(expectedRPIDs.map((expected) => { + return new Promise((resolve, reject) => { + toHash(fromASCIIString(expected)).then((expectedRPIDHash) => { + if (areEqual(rpIDHash, expectedRPIDHash)) resolve(expected); + else reject(); + }); + }); + })); + } catch (err) { + if (err.name === "AggregateError") throw new UnexpectedRPIDHash(); + throw err; + } +} +var UnexpectedRPIDHash = class extends Error { + constructor() { + super("Unexpected RP ID hash"); + this.name = "UnexpectedRPIDHash"; + } +}; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationFIDOU2F.js +/** +* Verify an attestation response with fmt 'fido-u2f' +*/ +async function verifyAttestationFIDOU2F(options) { + const { attStmt, clientDataHash, rpIdHash, credentialID, credentialPublicKey, aaguid, rootCertificates } = options; + const signatureBase = concat([ + Uint8Array.from([0]), + rpIdHash, + clientDataHash, + credentialID, + convertCOSEtoPKCS(credentialPublicKey) + ]); + const sig = attStmt.get("sig"); + const x5c = attStmt.get("x5c"); + if (!x5c) throw new Error("No attestation certificate provided in attestation statement (FIDOU2F)"); + if (!sig) throw new Error("No attestation signature provided in attestation statement (FIDOU2F)"); + const aaguidToHex = Number.parseInt(toHex(aaguid), 16); + if (aaguidToHex !== 0) throw new Error(`AAGUID "${aaguidToHex}" was not expected value`); + try { + await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates); + } catch (err) { + throw new Error(`${err.message} (FIDOU2F)`); + } + return verifySignature({ + signature: sig, + data: signatureBase, + x509Certificate: x5c[0], + hashAlgorithm: COSEALG.ES256 + }); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/validateExtFIDOGenCEAAGUID.js +/** +* Attestation Certificate Extension OID: `id-fido-gen-ce-aaguid` +* +* Sourced from https://fidoalliance.org/specs/fido-v2.0-ps-20150904/fido-key-attestation-v2.0-ps-20150904.html#verifying-an-attestation-statement +*/ +const id_fido_gen_ce_aaguid = "1.3.6.1.4.1.45724.1.1.4"; +/** +* Look for the id-fido-gen-ce-aaguid certificate extension. If it's present then check it against +* the attestation statement AAGUID. +*/ +function validateExtFIDOGenCEAAGUID(certExtensions, aaguid) { + if (!certExtensions) return true; + const extFIDOGenCEAAGUID = certExtensions.find((ext) => ext.extnID === id_fido_gen_ce_aaguid); + if (!extFIDOGenCEAAGUID) return true; + const parsedExtFIDOGenCEAAGUID = AsnParser.parse(extFIDOGenCEAAGUID.extnValue, OctetString); + const extValue = new Uint8Array(parsedExtFIDOGenCEAAGUID.buffer); + if (!areEqual(aaguid, extValue)) { + const _debugExtHex = toHex(extValue); + const _debugAAGUIDHex = toHex(aaguid); + throw new Error(`Certificate extension id-fido-gen-ce-aaguid (${id_fido_gen_ce_aaguid}) value of "${_debugExtHex}" was present but not equal to attestation statement AAGUID value of "${_debugAAGUIDHex}"`); + } + return true; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/helpers/logging.js +/** +* Generate an instance of a `debug` logger that extends off of the "simplewebauthn" namespace for +* consistent naming. +* +* See https://www.npmjs.com/package/debug for information on how to control logging output when +* using @simplewebauthn/server +* +* Example: +* +* ``` +* const log = getLogger('mds'); +* log('hello'); // simplewebauthn:mds hello +0ms +* ``` +*/ +function getLogger(_name) { + return (_message, ..._rest) => {}; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/services/metadataService.js +/** +* An instance of `CachedMDS` that will not trigger attempts to refresh the associated entry's blob +*/ +const NonRefreshingMDS = { + url: "", + no: 0, + nextUpdate: /* @__PURE__ */ new Date(0) +}; +const defaultURLMDS = "https://mds.fidoalliance.org/"; +var SERVICE_STATE; +(function(SERVICE_STATE) { + SERVICE_STATE[SERVICE_STATE["DISABLED"] = 0] = "DISABLED"; + SERVICE_STATE[SERVICE_STATE["REFRESHING"] = 1] = "REFRESHING"; + SERVICE_STATE[SERVICE_STATE["READY"] = 2] = "READY"; +})(SERVICE_STATE || (SERVICE_STATE = {})); +const log = getLogger("MetadataService"); +/** +* An implementation of `MetadataService` that can download and parse BLOBs, and support on-demand +* requesting and caching of individual metadata statements. +* +* https://fidoalliance.org/metadata/ +*/ +var BaseMetadataService = class { + constructor() { + Object.defineProperty(this, "mdsCache", { + enumerable: true, + configurable: true, + writable: true, + value: {} + }); + Object.defineProperty(this, "statementCache", { + enumerable: true, + configurable: true, + writable: true, + value: {} + }); + Object.defineProperty(this, "state", { + enumerable: true, + configurable: true, + writable: true, + value: SERVICE_STATE.DISABLED + }); + Object.defineProperty(this, "verificationMode", { + enumerable: true, + configurable: true, + writable: true, + value: "strict" + }); + } + async initialize(opts = {}) { + this.statementCache = {}; + const { mdsServers = [defaultURLMDS], statements, verificationMode } = opts; + this.setState(SERVICE_STATE.REFRESHING); + /** + * If metadata statements are provided, load them into the cache first. These statements will + * not be refreshed when a stale one is detected. + */ + if (statements?.length) { + let statementsAdded = 0; + statements.forEach((statement) => { + if (statement.aaguid) { + this.statementCache[statement.aaguid] = { + entry: { + metadataStatement: statement, + statusReports: [], + timeOfLastStatusChange: "1970-01-01" + }, + url: NonRefreshingMDS.url + }; + statementsAdded += 1; + } + }); + log(`Cached ${statementsAdded} local statements`); + } + /** + * If MDS servers are provided, then download blobs from them, verify them, and then add their + * entries to the cache. Blobs loaded in this way will be refreshed when a stale entry within is + * detected. + */ + if (mdsServers?.length) { + const currentCacheCount = Object.keys(this.statementCache).length; + let numServers = mdsServers.length; + for (const url of mdsServers) try { + const cachedMDS = { + url, + no: 0, + nextUpdate: /* @__PURE__ */ new Date(0) + }; + const blob = await this.downloadBlob(cachedMDS); + await this.verifyBlob(blob, cachedMDS); + } catch (err) { + log(`Could not download BLOB from ${url}:`, err); + numServers -= 1; + } + log(`Cached ${Object.keys(this.statementCache).length - currentCacheCount} statements from ${numServers} metadata server(s)`); + } + if (verificationMode) this.verificationMode = verificationMode; + this.setState(SERVICE_STATE.READY); + } + async getStatement(aaguid) { + if (this.state === SERVICE_STATE.DISABLED) return; + if (!aaguid) return; + if (aaguid instanceof Uint8Array) aaguid = convertAAGUIDToString(aaguid); + await this.pauseUntilReady(); + const cachedStatement = this.statementCache[aaguid]; + if (!cachedStatement) { + if (this.verificationMode === "strict") throw new Error(`No metadata statement found for aaguid "${aaguid}"`); + return; + } + if (cachedStatement.url) { + const mds = this.mdsCache[cachedStatement.url]; + if (/* @__PURE__ */ new Date() > mds.nextUpdate) try { + this.setState(SERVICE_STATE.REFRESHING); + const blob = await this.downloadBlob(mds); + await this.verifyBlob(blob, mds); + } finally { + this.setState(SERVICE_STATE.READY); + } + } + const { entry } = cachedStatement; + for (const report of entry.statusReports) { + const { status } = report; + if (status === "USER_VERIFICATION_BYPASS" || status === "ATTESTATION_KEY_COMPROMISE" || status === "USER_KEY_REMOTE_COMPROMISE" || status === "USER_KEY_PHYSICAL_COMPROMISE") throw new Error(`Detected compromised aaguid "${aaguid}"`); + } + return entry.metadataStatement; + } + /** + * Download and process the latest BLOB from MDS + */ + async downloadBlob(cachedMDS) { + const { url } = cachedMDS; + return await (await fetch(url)).text(); + } + /** + * Verify and process the MDS metadata blob + */ + async verifyBlob(blob, cachedMDS) { + const { url, no } = cachedMDS; + const { payload, parsedNextUpdate } = await verifyMDSBlob(blob); + if (payload.no <= no) throw new Error(`Latest BLOB no. ${payload.no} is not greater than previous no. ${no}`); + for (const entry of payload.entries) if (entry.aaguid) this.statementCache[entry.aaguid] = { + entry, + url + }; + if (url) this.mdsCache[url] = { + ...cachedMDS, + no: payload.no, + nextUpdate: parsedNextUpdate + }; + else if (parsedNextUpdate < /* @__PURE__ */ new Date()) log(`⚠️ This MDS blob (serial: ${payload.no}) contains stale data as of ${parsedNextUpdate.toISOString()}. Please consider re-initializing MetadataService with a newer MDS blob.`); + } + /** + * A helper method to pause execution until the service is ready + */ + pauseUntilReady() { + if (this.state === SERVICE_STATE.READY) return new Promise((resolve) => { + resolve(); + }); + return new Promise((resolve, reject) => { + const totalTimeoutMS = 7e4; + const intervalMS = 100; + let iterations = totalTimeoutMS / intervalMS; + const intervalID = globalThis.setInterval(() => { + if (iterations < 1) { + clearInterval(intervalID); + reject(`State did not become ready in ${totalTimeoutMS / 1e3} seconds`); + } else if (this.state === SERVICE_STATE.READY) { + clearInterval(intervalID); + resolve(); + } + iterations -= 1; + }, intervalMS); + }); + } + /** + * Report service status on change + */ + setState(newState) { + this.state = newState; + if (newState === SERVICE_STATE.DISABLED) log("MetadataService is DISABLED"); + else if (newState === SERVICE_STATE.REFRESHING) log("MetadataService is REFRESHING"); + else if (newState === SERVICE_STATE.READY) log("MetadataService is READY"); + } +}; +/** +* A basic service for coordinating interactions with the FIDO Metadata Service. This includes BLOB +* download and parsing, and on-demand requesting and caching of individual metadata statements. +* +* https://fidoalliance.org/metadata/ +*/ +const MetadataService = new BaseMetadataService(); +//#endregion +//#region node_modules/@simplewebauthn/server/esm/metadata/verifyAttestationWithMetadata.js +/** +* Match properties of the authenticator's attestation statement against expected values as +* registered with the FIDO Alliance Metadata Service +*/ +async function verifyAttestationWithMetadata({ statement, credentialPublicKey, x5c, attestationStatementAlg }) { + const { authenticationAlgorithms, authenticatorGetInfo, attestationRootCertificates } = statement; + const keypairCOSEAlgs = /* @__PURE__ */ new Set(); + authenticationAlgorithms.forEach((algSign) => { + const algSignCOSEINFO = algSignToCOSEInfoMap[algSign]; + if (algSignCOSEINFO) keypairCOSEAlgs.add(algSignCOSEINFO); + }); + const decodedPublicKey = decodeCredentialPublicKey(credentialPublicKey); + const kty = decodedPublicKey.get(COSEKEYS.kty); + const alg = decodedPublicKey.get(COSEKEYS.alg); + if (!kty) throw new Error("Credential public key was missing kty"); + if (!alg) throw new Error("Credential public key was missing alg"); + if (!kty) throw new Error("Credential public key was missing kty"); + const publicKeyCOSEInfo = { + kty, + alg + }; + if (isCOSEPublicKeyEC2(decodedPublicKey)) publicKeyCOSEInfo.crv = decodedPublicKey.get(COSEKEYS.crv); + /** + * Attempt to match the credential public key's algorithm to one specified in the device's + * metadata + */ + let foundMatch = false; + for (const keypairAlg of keypairCOSEAlgs) { + if (keypairAlg.alg === publicKeyCOSEInfo.alg && keypairAlg.kty === publicKeyCOSEInfo.kty) if ((keypairAlg.kty === COSEKTY.EC2 || keypairAlg.kty === COSEKTY.OKP) && keypairAlg.crv === publicKeyCOSEInfo.crv) foundMatch = true; + else foundMatch = true; + if (foundMatch) break; + } + if (!foundMatch) { + /** + * Craft some useful error output from the MDS algorithms + * + * Example: + * + * ``` + * [ + * 'rsassa_pss_sha256_raw' (COSE info: { kty: 3, alg: -37 }), + * 'secp256k1_ecdsa_sha256_raw' (COSE info: { kty: 2, alg: -47, crv: 8 }) + * ] + * ``` + */ + const debugMDSAlgs = authenticationAlgorithms.map((algSign) => `'${algSign}' (COSE info: ${stringifyCOSEInfo(algSignToCOSEInfoMap[algSign])})`); + const strMDSAlgs = JSON.stringify(debugMDSAlgs, null, 2).replace(/"/g, ""); + /** + * Construct useful error output about the public key + */ + const strPubKeyAlg = stringifyCOSEInfo(publicKeyCOSEInfo); + throw new Error(`Public key parameters ${strPubKeyAlg} did not match any of the following metadata algorithms:\n${strMDSAlgs}`); + } + /** + * Confirm the attestation statement's algorithm is one supported according to metadata + */ + if (attestationStatementAlg !== void 0 && authenticatorGetInfo?.algorithms !== void 0) { + const getInfoAlgs = authenticatorGetInfo.algorithms.map((_alg) => _alg.alg); + if (getInfoAlgs.indexOf(attestationStatementAlg) < 0) throw new Error(`Attestation statement alg ${attestationStatementAlg} did not match one of ${getInfoAlgs}`); + } + const authenticatorCerts = x5c.map(convertCertBufferToPEM); + const statementRootCerts = attestationRootCertificates.map(convertCertBufferToPEM); + /** + * If an authenticator returns exactly one certificate in its x5c, and that cert is found in the + * metadata statement then the authenticator is "self-referencing". In this case we forego + * certificate chain validation. + */ + let authenticatorIsSelfReferencing = false; + if (authenticatorCerts.length === 1 && statementRootCerts.indexOf(authenticatorCerts[0]) >= 0) authenticatorIsSelfReferencing = true; + if (!authenticatorIsSelfReferencing) try { + await validateCertificatePath(authenticatorCerts, statementRootCerts); + } catch (err) { + throw new Error(`Could not validate certificate path with any metadata root certificates: ${err.message}`); + } + return true; +} +/** +* Convert ALG_SIGN values to COSE info +* +* Values pulled from `ALG_KEY_COSE` definitions in the FIDO Registry of Predefined Values +* +* https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#authentication-algorithms +*/ +const algSignToCOSEInfoMap = { + secp256r1_ecdsa_sha256_raw: { + kty: 2, + alg: -7, + crv: 1 + }, + secp256r1_ecdsa_sha256_der: { + kty: 2, + alg: -7, + crv: 1 + }, + rsassa_pss_sha256_raw: { + kty: 3, + alg: -37 + }, + rsassa_pss_sha256_der: { + kty: 3, + alg: -37 + }, + secp256k1_ecdsa_sha256_raw: { + kty: 2, + alg: -47, + crv: 8 + }, + secp256k1_ecdsa_sha256_der: { + kty: 2, + alg: -47, + crv: 8 + }, + rsassa_pss_sha384_raw: { + kty: 3, + alg: -38 + }, + rsassa_pkcsv15_sha256_raw: { + kty: 3, + alg: -257 + }, + rsassa_pkcsv15_sha384_raw: { + kty: 3, + alg: -258 + }, + rsassa_pkcsv15_sha512_raw: { + kty: 3, + alg: -259 + }, + rsassa_pkcsv15_sha1_raw: { + kty: 3, + alg: -65535 + }, + secp384r1_ecdsa_sha384_raw: { + kty: 2, + alg: -35, + crv: 2 + }, + secp512r1_ecdsa_sha256_raw: { + kty: 2, + alg: -36, + crv: 3 + }, + ed25519_eddsa_sha512_raw: { + kty: 1, + alg: -8, + crv: 6 + } +}; +/** +* A helper to format COSEInfo a little nicer than we can achieve with JSON.stringify() +* +* Input: `{ "kty": 3, "alg": -257 }` +* +* Output: `"{ kty: 3, alg: -257 }"` +*/ +function stringifyCOSEInfo(info) { + const { kty, alg, crv } = info; + let toReturn = ""; + if (kty !== COSEKTY.RSA) toReturn = `{ kty: ${kty}, alg: ${alg}, crv: ${crv} }`; + else toReturn = `{ kty: ${kty}, alg: ${alg} }`; + return toReturn; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationPacked.js +/** +* Verify an attestation response with fmt 'packed' +*/ +async function verifyAttestationPacked(options) { + const { attStmt, clientDataHash, authData, credentialPublicKey, aaguid, rootCertificates } = options; + const sig = attStmt.get("sig"); + const x5c = attStmt.get("x5c"); + const alg = attStmt.get("alg"); + if (!sig) throw new Error("No attestation signature provided in attestation statement (Packed)"); + if (!alg) throw new Error("Attestation statement did not contain alg (Packed)"); + if (!isCOSEAlg(alg)) throw new Error(`Attestation statement contained invalid alg ${alg} (Packed)`); + const signatureBase = concat([authData, clientDataHash]); + let verified = false; + if (x5c) { + const { subject, basicConstraintsCA, version, notBefore, notAfter, parsedCertificate } = getCertificateInfo(x5c[0]); + const { OU, CN, O, C } = subject; + if (OU !== "Authenticator Attestation") throw new Error("Certificate OU was not \"Authenticator Attestation\" (Packed|Full)"); + if (!CN) throw new Error("Certificate CN was empty (Packed|Full)"); + if (!O) throw new Error("Certificate O was empty (Packed|Full)"); + if (!C || C.length !== 2) throw new Error("Certificate C was not two-character ISO 3166 code (Packed|Full)"); + if (basicConstraintsCA) throw new Error("Certificate basic constraints CA was not `false` (Packed|Full)"); + if (version !== 2) throw new Error("Certificate version was not `3` (ASN.1 value of 2) (Packed|Full)"); + let now = /* @__PURE__ */ new Date(); + if (notBefore > now) throw new Error(`Certificate not good before "${notBefore.toString()}" (Packed|Full)`); + now = /* @__PURE__ */ new Date(); + if (notAfter < now) throw new Error(`Certificate not good after "${notAfter.toString()}" (Packed|Full)`); + try { + await validateExtFIDOGenCEAAGUID(parsedCertificate.tbsCertificate.extensions, aaguid); + } catch (err) { + throw new Error(`${err.message} (Packed|Full)`); + } + const statement = await MetadataService.getStatement(aaguid); + if (statement) { + if (statement.attestationTypes.indexOf("basic_full") < 0) throw new Error("Metadata does not indicate support for full attestations (Packed|Full)"); + try { + await verifyAttestationWithMetadata({ + statement, + credentialPublicKey, + x5c, + attestationStatementAlg: alg + }); + } catch (err) { + throw new Error(`${err.message} (Packed|Full)`); + } + } else try { + await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates); + } catch (err) { + throw new Error(`${err.message} (Packed|Full)`); + } + verified = await verifySignature({ + signature: sig, + data: signatureBase, + x509Certificate: x5c[0], + hashAlgorithm: alg + }); + } else verified = await verifySignature({ + signature: sig, + data: signatureBase, + credentialPublicKey, + hashAlgorithm: alg + }); + return verified; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidSafetyNet.js +/** +* Verify an attestation response with fmt 'android-safetynet' +*/ +async function verifyAttestationAndroidSafetyNet(options) { + const { attStmt, clientDataHash, authData, aaguid, rootCertificates, verifyTimestampMS = true, credentialPublicKey, attestationSafetyNetEnforceCTSCheck } = options; + const alg = attStmt.get("alg"); + const response = attStmt.get("response"); + if (!attStmt.get("ver")) throw new Error("No ver value in attestation (SafetyNet)"); + if (!response) throw new Error("No response was included in attStmt by authenticator (SafetyNet)"); + const jwtParts = toUTF8String(response).split("."); + const HEADER = JSON.parse(toUTF8String$1(jwtParts[0])); + const PAYLOAD = JSON.parse(toUTF8String$1(jwtParts[1])); + const SIGNATURE = jwtParts[2]; + /** + * START Verify PAYLOAD + */ + const { nonce, ctsProfileMatch, timestampMs } = PAYLOAD; + if (verifyTimestampMS) { + let now = Date.now(); + if (timestampMs > Date.now()) throw new Error(`Payload timestamp "${timestampMs}" was later than "${now}" (SafetyNet)`); + const timestampPlusDelay = timestampMs + 60 * 1e3; + now = Date.now(); + if (timestampPlusDelay < now) throw new Error(`Payload timestamp "${timestampPlusDelay}" has expired (SafetyNet)`); + } + if (nonce !== fromBuffer(await toHash(concat([authData, clientDataHash])), "base64")) throw new Error("Could not verify payload nonce (SafetyNet)"); + if (attestationSafetyNetEnforceCTSCheck && !ctsProfileMatch) throw new Error("Could not verify device integrity (SafetyNet)"); + /** + * END Verify PAYLOAD + */ + /** + * START Verify Header + */ + const leafCertBuffer = toBuffer(HEADER.x5c[0], "base64"); + const { subject } = getCertificateInfo(leafCertBuffer); + if (subject.CN !== "attest.android.com") throw new Error("Certificate common name was not \"attest.android.com\" (SafetyNet)"); + const statement = await MetadataService.getStatement(aaguid); + if (statement) try { + await verifyAttestationWithMetadata({ + statement, + credentialPublicKey, + x5c: HEADER.x5c, + attestationStatementAlg: alg + }); + } catch (err) { + throw new Error(`${err.message} (SafetyNet)`); + } + else try { + await validateCertificatePath(HEADER.x5c.map(convertCertBufferToPEM), rootCertificates); + } catch (err) { + throw new Error(`${err.message} (SafetyNet)`); + } + /** + * END Verify Header + */ + /** + * START Verify Signature + */ + const signatureBaseBuffer = fromUTF8String(`${jwtParts[0]}.${jwtParts[1]}`); + /** + * END Verify Signature + */ + return await verifySignature({ + signature: toBuffer(SIGNATURE), + data: signatureBaseBuffer, + x509Certificate: leafCertBuffer, + hashAlgorithm: alg + }); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/constants.js +/** +* A whole lotta domain knowledge is captured here, with hazy connections to source +* documents. Good places to start searching for more info on these values are the +* following Trusted Computing Group TPM Library docs linked in the WebAuthn API: +* +* - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-1-Architecture-01.38.pdf +* - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf +* - https://www.trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-3-Commands-01.38.pdf +*/ +/** +* 6.9 TPM_ST (Structure Tags) +*/ +const TPM_ST = { + 196: "TPM_ST_RSP_COMMAND", + 32768: "TPM_ST_NULL", + 32769: "TPM_ST_NO_SESSIONS", + 32770: "TPM_ST_SESSIONS", + 32788: "TPM_ST_ATTEST_NV", + 32789: "TPM_ST_ATTEST_COMMAND_AUDIT", + 32790: "TPM_ST_ATTEST_SESSION_AUDIT", + 32791: "TPM_ST_ATTEST_CERTIFY", + 32792: "TPM_ST_ATTEST_QUOTE", + 32793: "TPM_ST_ATTEST_TIME", + 32794: "TPM_ST_ATTEST_CREATION", + 32801: "TPM_ST_CREATION", + 32802: "TPM_ST_VERIFIED", + 32803: "TPM_ST_AUTH_SECRET", + 32804: "TPM_ST_HASHCHECK", + 32805: "TPM_ST_AUTH_SIGNED", + 32809: "TPM_ST_FU_MANIFEST" +}; +/** +* 6.3 TPM_ALG_ID +*/ +const TPM_ALG = { + 0: "TPM_ALG_ERROR", + 1: "TPM_ALG_RSA", + 4: "TPM_ALG_SHA", + 4: "TPM_ALG_SHA1", + 5: "TPM_ALG_HMAC", + 6: "TPM_ALG_AES", + 7: "TPM_ALG_MGF1", + 8: "TPM_ALG_KEYEDHASH", + 10: "TPM_ALG_XOR", + 11: "TPM_ALG_SHA256", + 12: "TPM_ALG_SHA384", + 13: "TPM_ALG_SHA512", + 16: "TPM_ALG_NULL", + 18: "TPM_ALG_SM3_256", + 19: "TPM_ALG_SM4", + 20: "TPM_ALG_RSASSA", + 21: "TPM_ALG_RSAES", + 22: "TPM_ALG_RSAPSS", + 23: "TPM_ALG_OAEP", + 24: "TPM_ALG_ECDSA", + 25: "TPM_ALG_ECDH", + 26: "TPM_ALG_ECDAA", + 27: "TPM_ALG_SM2", + 28: "TPM_ALG_ECSCHNORR", + 29: "TPM_ALG_ECMQV", + 32: "TPM_ALG_KDF1_SP800_56A", + 33: "TPM_ALG_KDF2", + 34: "TPM_ALG_KDF1_SP800_108", + 35: "TPM_ALG_ECC", + 37: "TPM_ALG_SYMCIPHER", + 38: "TPM_ALG_CAMELLIA", + 64: "TPM_ALG_CTR", + 65: "TPM_ALG_OFB", + 66: "TPM_ALG_CBC", + 67: "TPM_ALG_CFB", + 68: "TPM_ALG_ECB" +}; +/** +* 6.4 TPM_ECC_CURVE +*/ +const TPM_ECC_CURVE = { + 0: "TPM_ECC_NONE", + 1: "TPM_ECC_NIST_P192", + 2: "TPM_ECC_NIST_P224", + 3: "TPM_ECC_NIST_P256", + 4: "TPM_ECC_NIST_P384", + 5: "TPM_ECC_NIST_P521", + 16: "TPM_ECC_BN_P256", + 17: "TPM_ECC_BN_P638", + 32: "TPM_ECC_SM2_P256" +}; +/** +* Sourced from https://trustedcomputinggroup.org/resource/vendor-id-registry/ +* +* Latest version: +* https://trustedcomputinggroup.org/wp-content/uploads/TCG-TPM-Vendor-ID-Registry-Version-1.02-Revision-1.00.pdf +*/ +const TPM_MANUFACTURERS = { + "id:414D4400": { + name: "AMD", + id: "AMD" + }, + "id:414E5400": { + name: "Ant Group", + id: "ANT" + }, + "id:41544D4C": { + name: "Atmel", + id: "ATML" + }, + "id:4252434D": { + name: "Broadcom", + id: "BRCM" + }, + "id:4353434F": { + name: "Cisco", + id: "CSCO" + }, + "id:464C5953": { + name: "Flyslice Technologies", + id: "FLYS" + }, + "id:524F4343": { + name: "Fuzhou Rockchip", + id: "ROCC" + }, + "id:474F4F47": { + name: "Google", + id: "GOOG" + }, + "id:48504900": { + name: "HPI", + id: "HPI" + }, + "id:48504500": { + name: "HPE", + id: "HPE" + }, + "id:48495349": { + name: "Huawei", + id: "HISI" + }, + "id:49424d00": { + name: "IBM", + id: "IBM" + }, + "id:49424D00": { + name: "IBM", + id: "IBM" + }, + "id:49465800": { + name: "Infineon", + id: "IFX" + }, + "id:494E5443": { + name: "Intel", + id: "INTC" + }, + "id:4C454E00": { + name: "Lenovo", + id: "LEN" + }, + "id:4D534654": { + name: "Microsoft", + id: "MSFT" + }, + "id:4E534D20": { + name: "National Semiconductor", + id: "NSM" + }, + "id:4E545A00": { + name: "Nationz", + id: "NTZ" + }, + "id:4E534700": { + name: "NSING", + id: "NSG" + }, + "id:4E544300": { + name: "Nuvoton Technology", + id: "NTC" + }, + "id:51434F4D": { + name: "Qualcomm", + id: "QCOM" + }, + "id:534D534E": { + name: "Samsung", + id: "SMSN" + }, + "id:53454345": { + name: "SecEdge", + id: "SECE" + }, + "id:534E5300": { + name: "Sinosun", + id: "SNS" + }, + "id:534D5343": { + name: "SMSC", + id: "SMSC" + }, + "id:53544D20": { + name: "STMicroelectronics", + id: "STM" + }, + "id:54584E00": { + name: "Texas Instruments", + id: "TXN" + }, + "id:57454300": { + name: "Winbond", + id: "WEC" + }, + "id:5345414C": { + name: "Wisekey", + id: "SEAL" + }, + "id:FFFFF1D0": { + name: "FIDO Alliance", + id: "FIDO" + } +}; +/** +* Match TPM public area curve ID's to `crv` numbers used in COSE public keys +*/ +const TPM_ECC_CURVE_COSE_CRV_MAP = { + TPM_ECC_NIST_P256: 1, + TPM_ECC_NIST_P384: 2, + TPM_ECC_NIST_P521: 3, + TPM_ECC_BN_P256: 1, + TPM_ECC_SM2_P256: 1 +}; +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parseCertInfo.js +/** +* Cut up a TPM attestation's certInfo into intelligible chunks +*/ +function parseCertInfo(certInfo) { + let pointer = 0; + const dataView = toDataView(certInfo); + const magic = dataView.getUint32(pointer); + pointer += 4; + const typeBuffer = dataView.getUint16(pointer); + pointer += 2; + const type = TPM_ST[typeBuffer]; + const qualifiedSignerLength = dataView.getUint16(pointer); + pointer += 2; + const qualifiedSigner = certInfo.slice(pointer, pointer += qualifiedSignerLength); + const extraDataLength = dataView.getUint16(pointer); + pointer += 2; + const extraData = certInfo.slice(pointer, pointer += extraDataLength); + const clock = certInfo.slice(pointer, pointer += 8); + const resetCount = dataView.getUint32(pointer); + pointer += 4; + const restartCount = dataView.getUint32(pointer); + pointer += 4; + const clockInfo = { + clock, + resetCount, + restartCount, + safe: !!certInfo.slice(pointer, pointer += 1) + }; + const firmwareVersion = certInfo.slice(pointer, pointer += 8); + const attestedNameLength = dataView.getUint16(pointer); + pointer += 2; + const attestedName = certInfo.slice(pointer, pointer += attestedNameLength); + const attestedNameDataView = toDataView(attestedName); + const qualifiedNameLength = dataView.getUint16(pointer); + pointer += 2; + const qualifiedName = certInfo.slice(pointer, pointer += qualifiedNameLength); + return { + magic, + type, + qualifiedSigner, + extraData, + clockInfo, + firmwareVersion, + attested: { + nameAlg: TPM_ALG[attestedNameDataView.getUint16(0)], + nameAlgBuffer: attestedName.slice(0, 2), + name: attestedName, + qualifiedName + } + }; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/parsePubArea.js +/** +* Break apart a TPM attestation's pubArea buffer +* +* See 12.2.4 TPMT_PUBLIC here: +* https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf +*/ +function parsePubArea(pubArea) { + let pointer = 0; + const dataView = toDataView(pubArea); + const type = TPM_ALG[dataView.getUint16(pointer)]; + pointer += 2; + const nameAlg = TPM_ALG[dataView.getUint16(pointer)]; + pointer += 2; + const objectAttributesInt = dataView.getUint32(pointer); + pointer += 4; + const objectAttributes = { + fixedTPM: !!(objectAttributesInt & 1), + stClear: !!(objectAttributesInt & 2), + fixedParent: !!(objectAttributesInt & 8), + sensitiveDataOrigin: !!(objectAttributesInt & 16), + userWithAuth: !!(objectAttributesInt & 32), + adminWithPolicy: !!(objectAttributesInt & 64), + noDA: !!(objectAttributesInt & 512), + encryptedDuplication: !!(objectAttributesInt & 1024), + restricted: !!(objectAttributesInt & 32768), + decrypt: !!(objectAttributesInt & 65536), + signOrEncrypt: !!(objectAttributesInt & 131072) + }; + const authPolicyLength = dataView.getUint16(pointer); + pointer += 2; + const authPolicy = pubArea.slice(pointer, pointer += authPolicyLength); + const parameters = {}; + let unique = Uint8Array.from([]); + if (type === "TPM_ALG_RSA") { + const symmetric = TPM_ALG[dataView.getUint16(pointer)]; + pointer += 2; + const scheme = TPM_ALG[dataView.getUint16(pointer)]; + pointer += 2; + const keyBits = dataView.getUint16(pointer); + pointer += 2; + const exponent = dataView.getUint32(pointer); + pointer += 4; + parameters.rsa = { + symmetric, + scheme, + keyBits, + exponent + }; + /** + * See 11.2.4.5 TPM2B_PUBLIC_KEY_RSA here: + * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf + */ + const uniqueLength = dataView.getUint16(pointer); + pointer += 2; + unique = pubArea.slice(pointer, pointer += uniqueLength); + } else if (type === "TPM_ALG_ECC") { + const symmetric = TPM_ALG[dataView.getUint16(pointer)]; + pointer += 2; + const scheme = TPM_ALG[dataView.getUint16(pointer)]; + pointer += 2; + const curveID = TPM_ECC_CURVE[dataView.getUint16(pointer)]; + pointer += 2; + const kdf = TPM_ALG[dataView.getUint16(pointer)]; + pointer += 2; + parameters.ecc = { + symmetric, + scheme, + curveID, + kdf + }; + /** + * See 11.2.5.1 TPM2B_ECC_PARAMETER here: + * https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-00.96-130315.pdf + */ + const uniqueXLength = dataView.getUint16(pointer); + pointer += 2; + const uniqueX = pubArea.slice(pointer, pointer += uniqueXLength); + const uniqueYLength = dataView.getUint16(pointer); + pointer += 2; + unique = concat([uniqueX, pubArea.slice(pointer, pointer += uniqueYLength)]); + } else throw new Error(`Unexpected type "${type}" (TPM)`); + return { + type, + nameAlg, + objectAttributes, + authPolicy, + parameters, + unique + }; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/tpm/verifyAttestationTPM.js +async function verifyAttestationTPM(options) { + const { aaguid, attStmt, authData, credentialPublicKey, clientDataHash, rootCertificates } = options; + const ver = attStmt.get("ver"); + const sig = attStmt.get("sig"); + const alg = attStmt.get("alg"); + const x5c = attStmt.get("x5c"); + const pubArea = attStmt.get("pubArea"); + const certInfo = attStmt.get("certInfo"); + /** + * Verify structures + */ + if (ver !== "2.0") throw new Error(`Unexpected ver "${ver}", expected "2.0" (TPM)`); + if (!sig) throw new Error("No attestation signature provided in attestation statement (TPM)"); + if (!alg) throw new Error(`Attestation statement did not contain alg (TPM)`); + if (!isCOSEAlg(alg)) throw new Error(`Attestation statement contained invalid alg ${alg} (TPM)`); + if (!x5c) throw new Error("No attestation certificate provided in attestation statement (TPM)"); + if (!pubArea) throw new Error("Attestation statement did not contain pubArea (TPM)"); + if (!certInfo) throw new Error("Attestation statement did not contain certInfo (TPM)"); + const { unique, type: pubType, parameters } = parsePubArea(pubArea); + const cosePublicKey = decodeCredentialPublicKey(credentialPublicKey); + if (pubType === "TPM_ALG_RSA") { + if (!isCOSEPublicKeyRSA(cosePublicKey)) throw new Error(`Credential public key with kty ${cosePublicKey.get(COSEKEYS.kty)} did not match ${pubType}`); + const n = cosePublicKey.get(COSEKEYS.n); + const e = cosePublicKey.get(COSEKEYS.e); + if (!n) throw new Error("COSE public key missing n (TPM|RSA)"); + if (!e) throw new Error("COSE public key missing e (TPM|RSA)"); + if (!areEqual(unique, n)) throw new Error("PubArea unique is not same as credentialPublicKey (TPM|RSA)"); + if (!parameters.rsa) throw new Error(`Parsed pubArea type is RSA, but missing parameters.rsa (TPM|RSA)`); + const eBuffer = e; + const pubAreaExponent = parameters.rsa.exponent || 65537; + const eSum = eBuffer[0] + (eBuffer[1] << 8) + (eBuffer[2] << 16); + if (pubAreaExponent !== eSum) throw new Error(`Unexpected public key exp ${eSum}, expected ${pubAreaExponent} (TPM|RSA)`); + } else if (pubType === "TPM_ALG_ECC") { + if (!isCOSEPublicKeyEC2(cosePublicKey)) throw new Error(`Credential public key with kty ${cosePublicKey.get(COSEKEYS.kty)} did not match ${pubType}`); + const crv = cosePublicKey.get(COSEKEYS.crv); + const x = cosePublicKey.get(COSEKEYS.x); + const y = cosePublicKey.get(COSEKEYS.y); + if (!crv) throw new Error("COSE public key missing crv (TPM|ECC)"); + if (!x) throw new Error("COSE public key missing x (TPM|ECC)"); + if (!y) throw new Error("COSE public key missing y (TPM|ECC)"); + if (!areEqual(unique, concat([x, y]))) throw new Error("PubArea unique is not same as public key x and y (TPM|ECC)"); + if (!parameters.ecc) throw new Error(`Parsed pubArea type is ECC, but missing parameters.ecc (TPM|ECC)`); + const pubAreaCurveID = parameters.ecc.curveID; + const pubAreaCurveIDMapToCOSECRV = TPM_ECC_CURVE_COSE_CRV_MAP[pubAreaCurveID]; + if (pubAreaCurveIDMapToCOSECRV !== crv) throw new Error(`Public area key curve ID "${pubAreaCurveID}" mapped to "${pubAreaCurveIDMapToCOSECRV}" which did not match public key crv of "${crv}" (TPM|ECC)`); + } else throw new Error(`Unsupported pubArea.type "${pubType}"`); + const { magic, type: certType, attested, extraData } = parseCertInfo(certInfo); + if (magic !== 4283712327) throw new Error(`Unexpected magic value "${magic}", expected "0xff544347" (TPM)`); + if (certType !== "TPM_ST_ATTEST_CERTIFY") throw new Error(`Unexpected type "${certType}", expected "TPM_ST_ATTEST_CERTIFY" (TPM)`); + const pubAreaHash = await toHash(pubArea, attestedNameAlgToCOSEAlg(attested.nameAlg)); + const attestedName = concat([attested.nameAlgBuffer, pubAreaHash]); + if (!areEqual(attested.name, attestedName)) throw new Error(`Attested name comparison failed (TPM)`); + if (!areEqual(extraData, await toHash(concat([authData, clientDataHash]), alg))) throw new Error("CertInfo extra data did not equal hashed attestation (TPM)"); + /** + * Verify signature + */ + if (x5c.length < 1) throw new Error("No certificates present in x5c array (TPM)"); + const { basicConstraintsCA, version, subject, notAfter, notBefore } = getCertificateInfo(x5c[0]); + if (basicConstraintsCA) throw new Error("Certificate basic constraints CA was not `false` (TPM)"); + if (version !== 2) throw new Error("Certificate version was not `3` (ASN.1 value of 2) (TPM)"); + if (subject.combined.length > 0) throw new Error("Certificate subject was not empty (TPM)"); + let now = /* @__PURE__ */ new Date(); + if (notBefore > now) throw new Error(`Certificate not good before "${notBefore.toString()}" (TPM)`); + now = /* @__PURE__ */ new Date(); + if (notAfter < now) throw new Error(`Certificate not good after "${notAfter.toString()}" (TPM)`); + /** + * Plumb the depths of the certificate's ASN.1-formatted data for some values we need to verify + */ + const parsedCert = AsnParser.parse(x5c[0], Certificate); + if (!parsedCert.tbsCertificate.extensions) throw new Error("Certificate was missing extensions (TPM)"); + let subjectAltNamePresent; + let extKeyUsage; + parsedCert.tbsCertificate.extensions.forEach((ext) => { + if (ext.extnID === id_ce_subjectAltName) subjectAltNamePresent = AsnParser.parse(ext.extnValue, SubjectAlternativeName); + else if (ext.extnID === id_ce_extKeyUsage) extKeyUsage = AsnParser.parse(ext.extnValue, ExtendedKeyUsage); + }); + if (!subjectAltNamePresent) throw new Error("Certificate did not contain subjectAltName extension (TPM)"); + if (!subjectAltNamePresent[0].directoryName?.[0].length) throw new Error("Certificate subjectAltName extension directoryName was empty (TPM)"); + const { tcgAtTpmManufacturer, tcgAtTpmModel, tcgAtTpmVersion } = getTcgAtTpmValues(subjectAltNamePresent[0].directoryName); + if (!tcgAtTpmManufacturer || !tcgAtTpmModel || !tcgAtTpmVersion) throw new Error("Certificate contained incomplete subjectAltName data (TPM)"); + if (!extKeyUsage) throw new Error("Certificate did not contain ExtendedKeyUsage extension (TPM)"); + if (!TPM_MANUFACTURERS[tcgAtTpmManufacturer]) throw new Error(`Could not match TPM manufacturer "${tcgAtTpmManufacturer}" (TPM)`); + if (extKeyUsage[0] !== "2.23.133.8.3") throw new Error(`Unexpected extKeyUsage "${extKeyUsage[0]}", expected "2.23.133.8.3" (TPM)`); + try { + await validateExtFIDOGenCEAAGUID(parsedCert.tbsCertificate.extensions, aaguid); + } catch (err) { + throw new Error(`${err.message} (TPM)`); + } + const statement = await MetadataService.getStatement(aaguid); + if (statement) try { + await verifyAttestationWithMetadata({ + statement, + credentialPublicKey, + x5c, + attestationStatementAlg: alg + }); + } catch (err) { + throw new Error(`${err.message} (TPM)`); + } + else try { + await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates); + } catch (err) { + throw new Error(`${err.message} (TPM)`); + } + return verifySignature({ + signature: sig, + data: certInfo, + x509Certificate: x5c[0], + hashAlgorithm: alg + }); +} +/** +* Contain logic for pulling TPM-specific values out of subjectAlternativeName extension +*/ +function getTcgAtTpmValues(root) { + const oidManufacturer = "2.23.133.2.1"; + const oidModel = "2.23.133.2.2"; + const oidVersion = "2.23.133.2.3"; + let tcgAtTpmManufacturer; + let tcgAtTpmModel; + let tcgAtTpmVersion; + /** + * Iterate through the following potential structures: + * + * (Good, follows the spec) + * https://trustedcomputinggroup.org/wp-content/uploads/TCG_IWG_EKCredentialProfile_v2p3_r2_pub.pdf (page 33) + * Name [ + * RelativeDistinguishedName [ + * AttributeTypeAndValue { type, value } + * ] + * RelativeDistinguishedName [ + * AttributeTypeAndValue { type, value } + * ] + * RelativeDistinguishedName [ + * AttributeTypeAndValue { type, value } + * ] + * ] + * + * (Bad, does not follow the spec) + * Name [ + * RelativeDistinguishedName [ + * AttributeTypeAndValue { type, value } + * AttributeTypeAndValue { type, value } + * AttributeTypeAndValue { type, value } + * ] + * ] + * + * Both structures have been seen in the wild and need to be supported + */ + root.forEach((relName) => { + relName.forEach((attr) => { + if (attr.type === oidManufacturer) tcgAtTpmManufacturer = attr.value.toString(); + else if (attr.type === oidModel) tcgAtTpmModel = attr.value.toString(); + else if (attr.type === oidVersion) tcgAtTpmVersion = attr.value.toString(); + }); + }); + return { + tcgAtTpmManufacturer, + tcgAtTpmModel, + tcgAtTpmVersion + }; +} +/** +* Convert TPM-specific SHA algorithm ID's with COSE-specific equivalents. Note that the choice to +* use ECDSA SHA IDs is arbitrary; any such COSEALG that would map to SHA-256 in +* `mapCoseAlgToWebCryptoAlg()` +* +* SHA IDs referenced from here: +* +* https://trustedcomputinggroup.org/wp-content/uploads/TCG_TPM2_r1p59_Part2_Structures_pub.pdf +*/ +function attestedNameAlgToCOSEAlg(alg) { + if (alg === "TPM_ALG_SHA256") return COSEALG.ES256; + else if (alg === "TPM_ALG_SHA384") return COSEALG.ES384; + else if (alg === "TPM_ALG_SHA512") return COSEALG.ES512; + throw new Error(`Unexpected TPM attested name alg ${alg}`); +} +//#endregion +//#region node_modules/@peculiar/asn1-android/build/es2015/key_description.js +init_tslib_es6$1(); +var IntegerSet_1; +const id_ce_keyDescription = "1.3.6.1.4.1.11129.2.1.17"; +var VerifiedBootState; +(function(VerifiedBootState) { + VerifiedBootState[VerifiedBootState["verified"] = 0] = "verified"; + VerifiedBootState[VerifiedBootState["selfSigned"] = 1] = "selfSigned"; + VerifiedBootState[VerifiedBootState["unverified"] = 2] = "unverified"; + VerifiedBootState[VerifiedBootState["failed"] = 3] = "failed"; +})(VerifiedBootState || (VerifiedBootState = {})); +var RootOfTrust = class { + verifiedBootKey = new OctetString(); + deviceLocked = false; + verifiedBootState = VerifiedBootState.verified; + verifiedBootHash; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: OctetString })], RootOfTrust.prototype, "verifiedBootKey", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Boolean })], RootOfTrust.prototype, "deviceLocked", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], RootOfTrust.prototype, "verifiedBootState", void 0); +__decorate$1([AsnProp({ + type: OctetString, + optional: true +})], RootOfTrust.prototype, "verifiedBootHash", void 0); +let IntegerSet = IntegerSet_1 = class IntegerSet extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, IntegerSet_1.prototype); + } +}; +IntegerSet = IntegerSet_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Set, + itemType: AsnPropTypes.Integer +})], IntegerSet); +var AuthorizationList = class { + purpose; + algorithm; + keySize; + digest; + padding; + ecCurve; + rsaPublicExponent; + mgfDigest; + rollbackResistance; + earlyBootOnly; + activeDateTime; + originationExpireDateTime; + usageExpireDateTime; + usageCountLimit; + noAuthRequired; + userAuthType; + authTimeout; + allowWhileOnBody; + trustedUserPresenceRequired; + trustedConfirmationRequired; + unlockedDeviceRequired; + allApplications; + applicationId; + creationDateTime; + origin; + rollbackResistant; + rootOfTrust; + osVersion; + osPatchLevel; + attestationApplicationId; + attestationIdBrand; + attestationIdDevice; + attestationIdProduct; + attestationIdSerial; + attestationIdImei; + attestationIdMeid; + attestationIdManufacturer; + attestationIdModel; + vendorPatchLevel; + bootPatchLevel; + deviceUniqueAttestation; + attestationIdSecondImei; + moduleHash; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + context: 1, + type: IntegerSet, + optional: true +})], AuthorizationList.prototype, "purpose", void 0); +__decorate$1([AsnProp({ + context: 2, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "algorithm", void 0); +__decorate$1([AsnProp({ + context: 3, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "keySize", void 0); +__decorate$1([AsnProp({ + context: 5, + type: IntegerSet, + optional: true +})], AuthorizationList.prototype, "digest", void 0); +__decorate$1([AsnProp({ + context: 6, + type: IntegerSet, + optional: true +})], AuthorizationList.prototype, "padding", void 0); +__decorate$1([AsnProp({ + context: 10, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "ecCurve", void 0); +__decorate$1([AsnProp({ + context: 200, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "rsaPublicExponent", void 0); +__decorate$1([AsnProp({ + context: 203, + type: IntegerSet, + optional: true +})], AuthorizationList.prototype, "mgfDigest", void 0); +__decorate$1([AsnProp({ + context: 303, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "rollbackResistance", void 0); +__decorate$1([AsnProp({ + context: 305, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "earlyBootOnly", void 0); +__decorate$1([AsnProp({ + context: 400, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "activeDateTime", void 0); +__decorate$1([AsnProp({ + context: 401, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "originationExpireDateTime", void 0); +__decorate$1([AsnProp({ + context: 402, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "usageExpireDateTime", void 0); +__decorate$1([AsnProp({ + context: 405, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "usageCountLimit", void 0); +__decorate$1([AsnProp({ + context: 503, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "noAuthRequired", void 0); +__decorate$1([AsnProp({ + context: 504, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "userAuthType", void 0); +__decorate$1([AsnProp({ + context: 505, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "authTimeout", void 0); +__decorate$1([AsnProp({ + context: 506, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "allowWhileOnBody", void 0); +__decorate$1([AsnProp({ + context: 507, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "trustedUserPresenceRequired", void 0); +__decorate$1([AsnProp({ + context: 508, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "trustedConfirmationRequired", void 0); +__decorate$1([AsnProp({ + context: 509, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "unlockedDeviceRequired", void 0); +__decorate$1([AsnProp({ + context: 600, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "allApplications", void 0); +__decorate$1([AsnProp({ + context: 601, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "applicationId", void 0); +__decorate$1([AsnProp({ + context: 701, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "creationDateTime", void 0); +__decorate$1([AsnProp({ + context: 702, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "origin", void 0); +__decorate$1([AsnProp({ + context: 703, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "rollbackResistant", void 0); +__decorate$1([AsnProp({ + context: 704, + type: RootOfTrust, + optional: true +})], AuthorizationList.prototype, "rootOfTrust", void 0); +__decorate$1([AsnProp({ + context: 705, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "osVersion", void 0); +__decorate$1([AsnProp({ + context: 706, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "osPatchLevel", void 0); +__decorate$1([AsnProp({ + context: 709, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationApplicationId", void 0); +__decorate$1([AsnProp({ + context: 710, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdBrand", void 0); +__decorate$1([AsnProp({ + context: 711, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdDevice", void 0); +__decorate$1([AsnProp({ + context: 712, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdProduct", void 0); +__decorate$1([AsnProp({ + context: 713, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdSerial", void 0); +__decorate$1([AsnProp({ + context: 714, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdImei", void 0); +__decorate$1([AsnProp({ + context: 715, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdMeid", void 0); +__decorate$1([AsnProp({ + context: 716, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdManufacturer", void 0); +__decorate$1([AsnProp({ + context: 717, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdModel", void 0); +__decorate$1([AsnProp({ + context: 718, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "vendorPatchLevel", void 0); +__decorate$1([AsnProp({ + context: 719, + type: AsnPropTypes.Integer, + optional: true +})], AuthorizationList.prototype, "bootPatchLevel", void 0); +__decorate$1([AsnProp({ + context: 720, + type: AsnPropTypes.Null, + optional: true +})], AuthorizationList.prototype, "deviceUniqueAttestation", void 0); +__decorate$1([AsnProp({ + context: 723, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "attestationIdSecondImei", void 0); +__decorate$1([AsnProp({ + context: 724, + type: OctetString, + optional: true +})], AuthorizationList.prototype, "moduleHash", void 0); +var SecurityLevel; +(function(SecurityLevel) { + SecurityLevel[SecurityLevel["software"] = 0] = "software"; + SecurityLevel[SecurityLevel["trustedEnvironment"] = 1] = "trustedEnvironment"; + SecurityLevel[SecurityLevel["strongBox"] = 2] = "strongBox"; +})(SecurityLevel || (SecurityLevel = {})); +var Version; +(function(Version) { + Version[Version["KM2"] = 1] = "KM2"; + Version[Version["KM3"] = 2] = "KM3"; + Version[Version["KM4"] = 3] = "KM4"; + Version[Version["KM4_1"] = 4] = "KM4_1"; + Version[Version["keyMint1"] = 100] = "keyMint1"; + Version[Version["keyMint2"] = 200] = "keyMint2"; + Version[Version["keyMint3"] = 300] = "keyMint3"; + Version[Version["keyMint4"] = 400] = "keyMint4"; +})(Version || (Version = {})); +var KeyDescription = class { + attestationVersion = Version.KM4; + attestationSecurityLevel = SecurityLevel.software; + keymasterVersion = 0; + keymasterSecurityLevel = SecurityLevel.software; + attestationChallenge = new OctetString(); + uniqueId = new OctetString(); + softwareEnforced = new AuthorizationList(); + teeEnforced = new AuthorizationList(); + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], KeyDescription.prototype, "attestationVersion", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], KeyDescription.prototype, "attestationSecurityLevel", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], KeyDescription.prototype, "keymasterVersion", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], KeyDescription.prototype, "keymasterSecurityLevel", void 0); +__decorate$1([AsnProp({ type: OctetString })], KeyDescription.prototype, "attestationChallenge", void 0); +__decorate$1([AsnProp({ type: OctetString })], KeyDescription.prototype, "uniqueId", void 0); +__decorate$1([AsnProp({ type: AuthorizationList })], KeyDescription.prototype, "softwareEnforced", void 0); +__decorate$1([AsnProp({ type: AuthorizationList })], KeyDescription.prototype, "teeEnforced", void 0); +var KeyMintKeyDescription = class KeyMintKeyDescription { + attestationVersion = Version.keyMint4; + attestationSecurityLevel = SecurityLevel.software; + keyMintVersion = 0; + keyMintSecurityLevel = SecurityLevel.software; + attestationChallenge = new OctetString(); + uniqueId = new OctetString(); + softwareEnforced = new AuthorizationList(); + hardwareEnforced = new AuthorizationList(); + constructor(params = {}) { + Object.assign(this, params); + } + toLegacyKeyDescription() { + return new KeyDescription({ + attestationVersion: this.attestationVersion, + attestationSecurityLevel: this.attestationSecurityLevel, + keymasterVersion: this.keyMintVersion, + keymasterSecurityLevel: this.keyMintSecurityLevel, + attestationChallenge: this.attestationChallenge, + uniqueId: this.uniqueId, + softwareEnforced: this.softwareEnforced, + teeEnforced: this.hardwareEnforced + }); + } + static fromLegacyKeyDescription(keyDesc) { + return new KeyMintKeyDescription({ + attestationVersion: keyDesc.attestationVersion, + attestationSecurityLevel: keyDesc.attestationSecurityLevel, + keyMintVersion: keyDesc.keymasterVersion, + keyMintSecurityLevel: keyDesc.keymasterSecurityLevel, + attestationChallenge: keyDesc.attestationChallenge, + uniqueId: keyDesc.uniqueId, + softwareEnforced: keyDesc.softwareEnforced, + hardwareEnforced: keyDesc.teeEnforced + }); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], KeyMintKeyDescription.prototype, "attestationVersion", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], KeyMintKeyDescription.prototype, "attestationSecurityLevel", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], KeyMintKeyDescription.prototype, "keyMintVersion", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], KeyMintKeyDescription.prototype, "keyMintSecurityLevel", void 0); +__decorate$1([AsnProp({ type: OctetString })], KeyMintKeyDescription.prototype, "attestationChallenge", void 0); +__decorate$1([AsnProp({ type: OctetString })], KeyMintKeyDescription.prototype, "uniqueId", void 0); +__decorate$1([AsnProp({ type: AuthorizationList })], KeyMintKeyDescription.prototype, "softwareEnforced", void 0); +__decorate$1([AsnProp({ type: AuthorizationList })], KeyMintKeyDescription.prototype, "hardwareEnforced", void 0); +//#endregion +//#region node_modules/@peculiar/asn1-android/build/es2015/nonstandard.js +init_tslib_es6$1(); +var NonStandardAuthorizationList_1; +let NonStandardAuthorization = class NonStandardAuthorization extends AuthorizationList {}; +NonStandardAuthorization = __decorate$1([AsnType({ type: AsnTypeTypes.Choice })], NonStandardAuthorization); +let NonStandardAuthorizationList = NonStandardAuthorizationList_1 = class NonStandardAuthorizationList extends AsnArray { + constructor(items) { + super(items); + Object.setPrototypeOf(this, NonStandardAuthorizationList_1.prototype); + } + findProperty(key) { + const prop = this.find((o) => o[key] !== void 0); + if (prop) return prop[key]; + } +}; +NonStandardAuthorizationList = NonStandardAuthorizationList_1 = __decorate$1([AsnType({ + type: AsnTypeTypes.Sequence, + itemType: NonStandardAuthorization +})], NonStandardAuthorizationList); +var NonStandardKeyDescription = class { + attestationVersion = Version.KM4; + attestationSecurityLevel = SecurityLevel.software; + keymasterVersion = 0; + keymasterSecurityLevel = SecurityLevel.software; + attestationChallenge = new OctetString(); + uniqueId = new OctetString(); + softwareEnforced = new NonStandardAuthorizationList(); + teeEnforced = new NonStandardAuthorizationList(); + get keyMintVersion() { + return this.keymasterVersion; + } + set keyMintVersion(value) { + this.keymasterVersion = value; + } + get keyMintSecurityLevel() { + return this.keymasterSecurityLevel; + } + set keyMintSecurityLevel(value) { + this.keymasterSecurityLevel = value; + } + get hardwareEnforced() { + return this.teeEnforced; + } + set hardwareEnforced(value) { + this.teeEnforced = value; + } + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], NonStandardKeyDescription.prototype, "attestationVersion", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], NonStandardKeyDescription.prototype, "attestationSecurityLevel", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], NonStandardKeyDescription.prototype, "keymasterVersion", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Enumerated })], NonStandardKeyDescription.prototype, "keymasterSecurityLevel", void 0); +__decorate$1([AsnProp({ type: OctetString })], NonStandardKeyDescription.prototype, "attestationChallenge", void 0); +__decorate$1([AsnProp({ type: OctetString })], NonStandardKeyDescription.prototype, "uniqueId", void 0); +__decorate$1([AsnProp({ type: NonStandardAuthorizationList })], NonStandardKeyDescription.prototype, "softwareEnforced", void 0); +__decorate$1([AsnProp({ type: NonStandardAuthorizationList })], NonStandardKeyDescription.prototype, "teeEnforced", void 0); +let NonStandardKeyMintKeyDescription = class NonStandardKeyMintKeyDescription extends NonStandardKeyDescription { + constructor(params = {}) { + if ("keymasterVersion" in params && !("keyMintVersion" in params)) params.keyMintVersion = params.keymasterVersion; + if ("keymasterSecurityLevel" in params && !("keyMintSecurityLevel" in params)) params.keyMintSecurityLevel = params.keymasterSecurityLevel; + if ("teeEnforced" in params && !("hardwareEnforced" in params)) params.hardwareEnforced = params.teeEnforced; + super(params); + } +}; +NonStandardKeyMintKeyDescription = __decorate$1([AsnType({ type: AsnTypeTypes.Sequence })], NonStandardKeyMintKeyDescription); +//#endregion +//#region node_modules/@peculiar/asn1-android/build/es2015/attestation.js +init_tslib_es6$1(); +var AttestationPackageInfo = class { + packageName; + version; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ type: AsnPropTypes.OctetString })], AttestationPackageInfo.prototype, "packageName", void 0); +__decorate$1([AsnProp({ type: AsnPropTypes.Integer })], AttestationPackageInfo.prototype, "version", void 0); +var AttestationApplicationId = class { + packageInfos; + signatureDigests; + constructor(params = {}) { + Object.assign(this, params); + } +}; +__decorate$1([AsnProp({ + type: AttestationPackageInfo, + repeated: "set" +})], AttestationApplicationId.prototype, "packageInfos", void 0); +__decorate$1([AsnProp({ + type: AsnPropTypes.OctetString, + repeated: "set" +})], AttestationApplicationId.prototype, "signatureDigests", void 0); +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationAndroidKey.js +/** +* Verify an attestation response with fmt 'android-key' +*/ +async function verifyAttestationAndroidKey(options) { + const { authData, clientDataHash, attStmt, credentialPublicKey, aaguid, rootCertificates } = options; + const x5c = attStmt.get("x5c"); + const sig = attStmt.get("sig"); + const alg = attStmt.get("alg"); + if (!x5c) throw new Error("No attestation certificate provided in attestation statement (Android Key)"); + if (!sig) throw new Error("No attestation signature provided in attestation statement (Android Key)"); + if (!alg) throw new Error(`Attestation statement did not contain alg (Android Key)`); + if (!isCOSEAlg(alg)) throw new Error(`Attestation statement contained invalid alg ${alg} (Android Key)`); + /** + * Verify that the public key in the first certificate in x5c matches the credentialPublicKey in + * the attestedCredentialData in authenticatorData. + */ + const parsedCert = AsnParser.parse(x5c[0], Certificate); + const parsedCertPubKey = new Uint8Array(parsedCert.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey); + if (!areEqual(convertCOSEtoPKCS(credentialPublicKey), parsedCertPubKey)) throw new Error("Credential public key does not equal leaf cert public key (Android Key)"); + /** + * Verify that the attestationChallenge field in the attestation certificate extension data is + * identical to clientDataHash. + */ + const extKeyStore = parsedCert.tbsCertificate.extensions?.find((ext) => ext.extnID === id_ce_keyDescription); + if (!extKeyStore) throw new Error("Certificate did not contain extKeyStore (Android Key)"); + const { attestationChallenge, teeEnforced, softwareEnforced } = AsnParser.parse(extKeyStore.extnValue, KeyDescription); + if (!areEqual(new Uint8Array(attestationChallenge.buffer), clientDataHash)) throw new Error("Attestation challenge was not equal to client data hash (Android Key)"); + /** + * The AuthorizationList.allApplications field is not present on either authorization list + * (softwareEnforced nor teeEnforced), since PublicKeyCredential MUST be scoped to the RP ID. + * + * (i.e. These shouldn't contain the [600] tag) + */ + if (teeEnforced.allApplications !== void 0) throw new Error("teeEnforced contained \"allApplications [600]\" tag (Android Key)"); + if (softwareEnforced.allApplications !== void 0) throw new Error("teeEnforced contained \"allApplications [600]\" tag (Android Key)"); + const statement = await MetadataService.getStatement(aaguid); + if (statement) try { + await verifyAttestationWithMetadata({ + statement, + credentialPublicKey, + x5c, + attestationStatementAlg: alg + }); + } catch (err) { + const _err = err; + throw new Error(`${_err.message} (Android Key)`, { cause: _err }); + } + else { + /** + * Verify that x5c contains a full certificate path. + */ + const x5cNoRootPEM = x5c.slice(0, -1).map(convertCertBufferToPEM); + const x5cRootPEM = x5c.slice(-1).map(convertCertBufferToPEM); + try { + await validateCertificatePath(x5cNoRootPEM, x5cRootPEM); + } catch (err) { + const _err = err; + throw new Error(`${_err.message} (Android Key)`, { cause: _err }); + } + /** + * Make sure the root certificate is one of the Google Hardware Attestation Root certificates + * + * https://developer.android.com/privacy-and-security/security-key-attestation#root_certificate + */ + if (rootCertificates.length > 0 && rootCertificates.indexOf(x5cRootPEM[0]) < 0) throw new Error("x5c root certificate was not a known root certificate (Android Key)"); + } + return verifySignature({ + signature: sig, + data: concat([authData, clientDataHash]), + x509Certificate: x5c[0], + hashAlgorithm: alg + }); +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifications/verifyAttestationApple.js +async function verifyAttestationApple(options) { + const { attStmt, authData, clientDataHash, credentialPublicKey, rootCertificates } = options; + const x5c = attStmt.get("x5c"); + if (!x5c) throw new Error("No attestation certificate provided in attestation statement (Apple)"); + /** + * Verify certificate path + */ + try { + await validateCertificatePath(x5c.map(convertCertBufferToPEM), rootCertificates); + } catch (err) { + throw new Error(`${err.message} (Apple)`); + } + const { extensions, subjectPublicKeyInfo } = AsnParser.parse(x5c[0], Certificate).tbsCertificate; + if (!extensions) throw new Error("credCert missing extensions (Apple)"); + const extCertNonce = extensions.find((ext) => ext.extnID === "1.2.840.113635.100.8.2"); + if (!extCertNonce) throw new Error("credCert missing \"1.2.840.113635.100.8.2\" extension (Apple)"); + if (!areEqual(await toHash(concat([authData, clientDataHash])), new Uint8Array(extCertNonce.extnValue.buffer).slice(6))) throw new Error(`credCert nonce was not expected value (Apple)`); + if (!areEqual(convertCOSEtoPKCS(credentialPublicKey), new Uint8Array(subjectPublicKeyInfo.subjectPublicKey))) throw new Error("Credential public key does not equal credCert public key (Apple)"); + return true; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js +/** +* Verify that the user has legitimately completed the registration process +* +* **Options:** +* +* @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()` +* @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateRegistrationOptions()` +* @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on +* @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options +* @param expectedType **(Optional)** - The response type expected ('webauthn.create') +* @param requireUserPresence **(Optional)** - Enforce user presence by the authenticator (or skip it during auto registration) Defaults to `true` +* @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true` +* @param supportedAlgorithmIDs **(Optional)** - Array of numeric COSE algorithm identifiers supported for attestation by this RP. See https://www.iana.org/assignments/cose/cose.xhtml#algorithms. Defaults to all supported algorithm IDs +* @param attestationSafetyNetEnforceCTSCheck **(Optional)** - Require that an Android device's system integrity has not been tampered with if it uses SafetyNet attestation. Defaults to `true` +*/ +async function verifyRegistrationResponse(options) { + const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, requireUserPresence = true, requireUserVerification = true, supportedAlgorithmIDs = supportedCOSEAlgorithmIdentifiers, attestationSafetyNetEnforceCTSCheck = true } = options; + const { id, rawId, type: credentialType, response: attestationResponse } = response; + if (!id) throw new Error("Missing credential ID"); + if (id !== rawId) throw new Error("Credential ID was not base64url-encoded"); + if (credentialType !== "public-key") throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`); + const clientDataJSON = decodeClientDataJSON(attestationResponse.clientDataJSON); + const { type, origin, challenge, tokenBinding } = clientDataJSON; + if (Array.isArray(expectedType)) { + if (!expectedType.includes(type)) { + const joinedExpectedType = expectedType.join(", "); + throw new Error(`Unexpected registration response type "${type}", expected one of: ${joinedExpectedType}`); + } + } else if (expectedType) { + if (type !== expectedType) throw new Error(`Unexpected registration response type "${type}", expected "${expectedType}"`); + } else if (type !== "webauthn.create") throw new Error(`Unexpected registration response type: ${type}`); + if (typeof expectedChallenge === "function") { + if (!await expectedChallenge(challenge)) throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`); + } else if (challenge !== expectedChallenge) throw new Error(`Unexpected registration response challenge "${challenge}", expected "${expectedChallenge}"`); + if (Array.isArray(expectedOrigin)) { + if (!expectedOrigin.includes(origin)) throw new Error(`Unexpected registration response origin "${origin}", expected one of: ${expectedOrigin.join(", ")}`); + } else if (origin !== expectedOrigin) throw new Error(`Unexpected registration response origin "${origin}", expected "${expectedOrigin}"`); + if (tokenBinding) { + if (typeof tokenBinding !== "object") throw new Error(`Unexpected value for TokenBinding "${tokenBinding}"`); + if ([ + "present", + "supported", + "not-supported" + ].indexOf(tokenBinding.status) < 0) throw new Error(`Unexpected tokenBinding.status value of "${tokenBinding.status}"`); + } + const attestationObject = toBuffer(attestationResponse.attestationObject); + const decodedAttestationObject = decodeAttestationObject(attestationObject); + const fmt = decodedAttestationObject.get("fmt"); + const authData = decodedAttestationObject.get("authData"); + const attStmt = decodedAttestationObject.get("attStmt"); + const { aaguid, rpIdHash, flags, credentialID, counter, credentialPublicKey, extensionsData } = parseAuthenticatorData(authData); + let matchedRPID; + if (expectedRPID) { + let expectedRPIDs = []; + if (typeof expectedRPID === "string") expectedRPIDs = [expectedRPID]; + else expectedRPIDs = expectedRPID; + matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs); + } + if (requireUserPresence && !flags.up) throw new Error("User presence was required, but user was not present"); + if (requireUserVerification && !flags.uv) throw new Error("User verification was required, but user could not be verified"); + if (!credentialID) throw new Error("No credential ID was provided by authenticator"); + if (!credentialPublicKey) throw new Error("No public key was provided by authenticator"); + if (!aaguid) throw new Error("No AAGUID was present during registration"); + const alg = decodeCredentialPublicKey(credentialPublicKey).get(COSEKEYS.alg); + if (typeof alg !== "number") throw new Error("Credential public key was missing numeric alg"); + if (!supportedAlgorithmIDs.includes(alg)) { + const supported = supportedAlgorithmIDs.join(", "); + throw new Error(`Unexpected public key alg "${alg}", expected one of "${supported}"`); + } + const verifierOpts = { + aaguid, + attStmt, + authData, + clientDataHash: await toHash(toBuffer(attestationResponse.clientDataJSON)), + credentialID, + credentialPublicKey, + rootCertificates: SettingsService.getRootCertificates({ identifier: fmt }), + rpIdHash, + attestationSafetyNetEnforceCTSCheck + }; + /** + * Verification can only be performed when attestation = 'direct' + */ + let verified = false; + if (fmt === "fido-u2f") verified = await verifyAttestationFIDOU2F(verifierOpts); + else if (fmt === "packed") verified = await verifyAttestationPacked(verifierOpts); + else if (fmt === "android-safetynet") verified = await verifyAttestationAndroidSafetyNet(verifierOpts); + else if (fmt === "android-key") verified = await verifyAttestationAndroidKey(verifierOpts); + else if (fmt === "tpm") verified = await verifyAttestationTPM(verifierOpts); + else if (fmt === "apple") verified = await verifyAttestationApple(verifierOpts); + else if (fmt === "none") { + if (attStmt.size > 0) throw new Error("None attestation had unexpected attestation statement"); + verified = true; + } else throw new Error(`Unsupported Attestation Format: ${fmt}`); + if (!verified) return { verified: false }; + const { credentialDeviceType, credentialBackedUp } = parseBackupFlags(flags); + return { + verified: true, + registrationInfo: { + fmt, + aaguid: convertAAGUIDToString(aaguid), + credentialType, + credential: { + id: fromBuffer(credentialID), + publicKey: credentialPublicKey, + counter, + transports: response.response.transports + }, + attestationObject, + userVerified: flags.uv, + credentialDeviceType, + credentialBackedUp, + origin: clientDataJSON.origin, + rpID: matchedRPID, + authenticatorExtensionResults: extensionsData + } + }; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/authentication/generateAuthenticationOptions.js +/** +* Prepare a value to pass into navigator.credentials.get(...) for authenticator authentication +* +* **Options:** +* +* @param rpID - Valid domain name (after `https://`) +* @param allowCredentials **(Optional)** - Authenticators previously registered by the user, if any. If undefined the client will ask the user which credential they want to use +* @param challenge **(Optional)** - Random value the authenticator needs to sign and pass back user for authentication. Defaults to generating a random value +* @param timeout **(Optional)** - How long (in ms) the user can take to complete authentication. Defaults to `60000` +* @param userVerification **(Optional)** - Set to `'discouraged'` when asserting as part of a 2FA flow, otherwise set to `'preferred'` or `'required'` as desired. Defaults to `"preferred"` +* @param extensions **(Optional)** - Additional plugins the authenticator or browser should use during authentication +*/ +async function generateAuthenticationOptions(options) { + const { allowCredentials, challenge = await generateChallenge(), timeout = 6e4, userVerification = "preferred", extensions, rpID } = options; + /** + * Preserve ability to specify `string` values for challenges + */ + let _challenge = challenge; + if (typeof _challenge === "string") _challenge = fromUTF8String(_challenge); + return { + rpId: rpID, + challenge: fromBuffer(_challenge), + allowCredentials: allowCredentials?.map((cred) => { + if (!isBase64URL(cred.id)) throw new Error(`allowCredential id "${cred.id}" is not a valid base64url string`); + return { + ...cred, + id: trimPadding(cred.id), + type: "public-key" + }; + }), + timeout, + userVerification, + extensions + }; +} +//#endregion +//#region node_modules/@simplewebauthn/server/esm/authentication/verifyAuthenticationResponse.js +/** +* Verify that the user has legitimately completed the authentication process +* +* **Options:** +* +* @param response - Response returned by **@simplewebauthn/browser**'s `startAuthentication()` +* @param expectedChallenge - The base64url-encoded `options.challenge` returned by `generateAuthenticationOptions()` +* @param expectedOrigin - Website URL (or array of URLs) that the registration should have occurred on +* @param expectedRPID - RP ID (or array of IDs) that was specified in the registration options +* @param credential - An internal {@link WebAuthnCredential} corresponding to `id` in the authentication response +* @param expectedType **(Optional)** - The response type expected ('webauthn.get') +* @param requireUserVerification **(Optional)** - Enforce user verification by the authenticator (via PIN, fingerprint, etc...) Defaults to `true` +* @param advancedFIDOConfig **(Optional)** - Options for satisfying more stringent FIDO RP feature requirements +* @param advancedFIDOConfig.userVerification **(Optional)** - Enable alternative rules for evaluating the User Presence and User Verified flags in authenticator data: UV (and UP) flags are optional unless this value is `"required"` +*/ +async function verifyAuthenticationResponse(options) { + const { response, expectedChallenge, expectedOrigin, expectedRPID, expectedType, credential, requireUserVerification = true, advancedFIDOConfig } = options; + const { id, rawId, type: credentialType, response: assertionResponse } = response; + if (!id) throw new Error("Missing credential ID"); + if (id !== rawId) throw new Error("Credential ID was not base64url-encoded"); + if (credentialType !== "public-key") throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`); + if (!response) throw new Error("Credential missing response"); + if (typeof assertionResponse?.clientDataJSON !== "string") throw new Error("Credential response clientDataJSON was not a string"); + const clientDataJSON = decodeClientDataJSON(assertionResponse.clientDataJSON); + const { type, origin, challenge, tokenBinding } = clientDataJSON; + if (Array.isArray(expectedType)) { + if (!expectedType.includes(type)) { + const joinedExpectedType = expectedType.join(", "); + throw new Error(`Unexpected authentication response type "${type}", expected one of: ${joinedExpectedType}`); + } + } else if (expectedType) { + if (type !== expectedType) throw new Error(`Unexpected authentication response type "${type}", expected "${expectedType}"`); + } else if (type !== "webauthn.get") throw new Error(`Unexpected authentication response type: ${type}`); + if (typeof expectedChallenge === "function") { + if (!await expectedChallenge(challenge)) throw new Error(`Custom challenge verifier returned false for registration response challenge "${challenge}"`); + } else if (challenge !== expectedChallenge) throw new Error(`Unexpected authentication response challenge "${challenge}", expected "${expectedChallenge}"`); + if (Array.isArray(expectedOrigin)) { + if (!expectedOrigin.includes(origin)) { + const joinedExpectedOrigin = expectedOrigin.join(", "); + throw new Error(`Unexpected authentication response origin "${origin}", expected one of: ${joinedExpectedOrigin}`); + } + } else if (origin !== expectedOrigin) throw new Error(`Unexpected authentication response origin "${origin}", expected "${expectedOrigin}"`); + if (!isBase64URL(assertionResponse.authenticatorData)) throw new Error("Credential response authenticatorData was not a base64url string"); + if (!isBase64URL(assertionResponse.signature)) throw new Error("Credential response signature was not a base64url string"); + if (assertionResponse.userHandle && typeof assertionResponse.userHandle !== "string") throw new Error("Credential response userHandle was not a string"); + if (tokenBinding) { + if (typeof tokenBinding !== "object") throw new Error("ClientDataJSON tokenBinding was not an object"); + if ([ + "present", + "supported", + "notSupported" + ].indexOf(tokenBinding.status) < 0) throw new Error(`Unexpected tokenBinding status ${tokenBinding.status}`); + } + const authDataBuffer = toBuffer(assertionResponse.authenticatorData); + const { rpIdHash, flags, counter, extensionsData } = parseAuthenticatorData(authDataBuffer); + let expectedRPIDs = []; + if (typeof expectedRPID === "string") expectedRPIDs = [expectedRPID]; + else expectedRPIDs = expectedRPID; + const matchedRPID = await matchExpectedRPID(rpIdHash, expectedRPIDs); + if (advancedFIDOConfig !== void 0) { + const { userVerification: fidoUserVerification } = advancedFIDOConfig; + /** + * Use FIDO Conformance-defined rules for verifying UP and UV flags + */ + if (fidoUserVerification === "required") { + if (!flags.uv) throw new Error("User verification required, but user could not be verified"); + } else if (fidoUserVerification === "preferred" || fidoUserVerification === "discouraged") {} + } else { + /** + * Use WebAuthn spec-defined rules for verifying UP and UV flags + */ + if (!flags.up) throw new Error("User not present during authentication"); + if (requireUserVerification && !flags.uv) throw new Error("User verification required, but user could not be verified"); + } + const signatureBase = concat([authDataBuffer, await toHash(toBuffer(assertionResponse.clientDataJSON))]); + const signature = toBuffer(assertionResponse.signature); + if ((counter > 0 || credential.counter > 0) && counter <= credential.counter) throw new Error(`Response counter value ${counter} was lower than expected ${credential.counter}`); + const { credentialDeviceType, credentialBackedUp } = parseBackupFlags(flags); + return { + verified: await verifySignature({ + signature, + data: signatureBase, + credentialPublicKey: credential.publicKey + }), + authenticationInfo: { + newCounter: counter, + credentialID: credential.id, + userVerified: flags.uv, + credentialDeviceType, + credentialBackedUp, + authenticatorExtensionResults: extensionsData, + origin: clientDataJSON.origin, + rpID: matchedRPID + } + }; +} +//#endregion +//#region server/src/webauthn.ts +/** Passkeys live for a month before the phone has to prove itself again. */ +const SESSION_TTL_MS = 720 * 60 * 6e4; +const CHALLENGE_TTL_MS = 5 * 6e4; +const MAX_CHALLENGES = 32; +/** +* There is exactly one logical user here — you. A stable handle means a second passkey +* enrolled later joins the same account instead of creating a parallel one. +*/ +const USER_HANDLE = new TextEncoder().encode("grok-glance"); +const USER_NAME = "grok-glance"; +/** +* Challenges are held server-side and consumed exactly once. SimpleWebAuthn lets us pass a +* predicate for `expectedChallenge`, so we never need to trust the client to tell us which +* challenge it was answering. +*/ +var ChallengeStore = class { + items = /* @__PURE__ */ new Map(); + issue(challenge, purpose) { + this.prune(); + if (this.items.size >= MAX_CHALLENGES) { + const oldest = this.items.keys().next(); + if (!oldest.done) this.items.delete(oldest.value); + } + this.items.set(challenge, { + purpose, + expiresAt: Date.now() + CHALLENGE_TTL_MS + }); + } + consume(challenge, purpose) { + this.prune(); + const entry = this.items.get(challenge); + if (!entry || entry.purpose !== purpose) return false; + this.items.delete(challenge); + return true; + } + prune() { + const now = Date.now(); + for (const [key, value] of this.items) if (value.expiresAt <= now) this.items.delete(key); + } +}; +var WebAuthnService = class { + cfg; + challenges = new ChallengeStore(); + constructor(cfg) { + this.cfg = cfg; + } + get rpId() { + return this.cfg.rpId ?? "localhost"; + } + get enrolled() { + return listCredentials().length > 0; + } + async registrationOptions() { + const existing = listCredentials(); + const options = await generateRegistrationOptions({ + rpName: this.cfg.rpName, + rpID: this.rpId, + userID: USER_HANDLE, + userName: USER_NAME, + userDisplayName: this.cfg.rpName, + attestationType: "none", + excludeCredentials: existing.map((c) => ({ + id: c.id, + transports: c.transports + })), + authenticatorSelection: { + residentKey: "required", + userVerification: "required" + }, + timeout: 12e4 + }); + this.challenges.issue(options.challenge, "register"); + return options; + } + async verifyRegistration(response, label) { + let verification; + try { + verification = await verifyRegistrationResponse({ + response, + expectedChallenge: (challenge) => this.challenges.consume(challenge, "register"), + expectedOrigin: expectedOrigins(this.cfg), + expectedRPID: expectedRpIds(this.cfg), + requireUserVerification: true + }); + } catch (err) { + return { + ok: false, + error: err.message + }; + } + if (!verification.verified || !verification.registrationInfo) return { + ok: false, + error: "registration could not be verified" + }; + const { credential, credentialDeviceType, credentialBackedUp } = verification.registrationInfo; + addCredential({ + id: credential.id, + publicKey: Buffer.from(credential.publicKey).toString("base64"), + counter: credential.counter, + transports: credential.transports, + label: label.trim().slice(0, 40) || "device", + createdAt: Date.now(), + deviceType: credentialDeviceType, + backedUp: credentialBackedUp + }); + return { + ok: true, + token: createAuthSession(credential.id, label, SESSION_TTL_MS).token, + label + }; + } + async authenticationOptions() { + const options = await generateAuthenticationOptions({ + rpID: this.rpId, + allowCredentials: listCredentials().map((c) => ({ + id: c.id, + transports: c.transports + })), + userVerification: "required", + timeout: 12e4 + }); + this.challenges.issue(options.challenge, "authenticate"); + return options; + } + async verifyAuthentication(response) { + const stored = findCredential(response.id); + if (!stored) return { + ok: false, + error: "unknown device" + }; + let verification; + try { + verification = await verifyAuthenticationResponse({ + response, + expectedChallenge: (challenge) => this.challenges.consume(challenge, "authenticate"), + expectedOrigin: expectedOrigins(this.cfg), + expectedRPID: expectedRpIds(this.cfg), + credential: { + id: stored.id, + publicKey: new Uint8Array(Buffer.from(stored.publicKey, "base64")), + counter: stored.counter, + transports: stored.transports + }, + requireUserVerification: true + }); + } catch (err) { + return { + ok: false, + error: err.message + }; + } + if (!verification.verified) return { + ok: false, + error: "assertion rejected" + }; + touchCredential(stored.id, verification.authenticationInfo.newCounter); + return { + ok: true, + token: createAuthSession(stored.id, stored.label, SESSION_TTL_MS).token, + label: stored.label + }; + } +}; +//#endregion +//#region server/src/index.ts +/** +* grok-glance daemon. +* +* One small http server with three kinds of caller: +* +* /hook/* the plugin's hook scripts, gated by the shared secret in hook.secret. +* /api/* the web app, gated by a passkey-backed cookie session. +* /local/* the `glance` CLI, gated by a rotating admin token on disk. +* +* None of the three trusts the source address: `tailscale serve` proxies tailnet traffic to +* 127.0.0.1, so every caller looks local. +* +* Everything the hooks touch is written to fail open: if this process is confused, wedged, or +* gone, Grok Build keeps working. +*/ +ensureHome(); +const cfg = loadConfig(); +const secret = sessionSecret(); +const adminToken = rotateAdminToken(); +const hookToken = hookSecret(); +const webauthn = new WebAuthnService(cfg); +const codes = new EnrollmentCodes(); +const authLimiter = new RateLimiter(40, 5 * 6e4); +const enrollLimiter = new RateLimiter(12, 5 * 6e4); +const state = new GlanceState(cfg); +let hub = null; +const broker = new ApprovalBroker(cfg, state, () => hub?.hasWatcher() ?? false); +const sse = new SseHub(() => state.snapshot(broker.pending())); +hub = sse; +state.onChange(() => sse.publish()); +function currentSession(req) { + const token = unsignToken(parseCookies(req.headers.cookie)[SESSION_COOKIE], secret); + if (!token) return null; + const record = lookupAuthSession(token); + if (!record) return null; + return { + token, + credentialId: record.credentialId, + label: record.label + }; +} +function sameSecret(provided, expected) { + if (!provided) return false; + const a = Buffer.from(provided); + const b = Buffer.from(expected); + return a.length === b.length && crypto$1.timingSafeEqual(a, b); +} +function isAdmin(req) { + return sameSecret(header(req, "x-glance-admin"), adminToken); +} +/** +* Is this really one of our hook scripts? +* +* "It came from 127.0.0.1" proves nothing: `tailscale serve` proxies tailnet traffic to +* loopback, so without a check anyone on the tailnet could POST forged events into the +* timeline and answer /hook/approve on your behalf. Two independent barriers: +* +* 1. A shared secret from $GLANCE_HOME/hook.secret (mode 0600), sent as a header and +* compared in constant time. Header only: a secret in a query string ends up in logs +* and shell history, and every caller here is a local process that can set one. +* 2. The request must not have been proxied. Tailscale stamps `x-forwarded-*` on anything +* it tunnels, so their presence means the caller is not a local process — which no +* real hook ever is. This keeps a leaked secret from being usable off-box. +*/ +function isHookCaller(req) { + if (header(req, "x-forwarded-for") || header(req, "x-forwarded-proto")) return false; + return sameSecret(header(req, HOOK_HEADER), hookToken); +} +/** +* `application/json` is not a CORS-safelisted content type, so requiring it exactly means a +* hostile page cannot post here without a preflight we never answer. The custom header on +* /api/* is a second, independent barrier on top of the SameSite=Strict cookie. +*/ +function isJsonPost(req) { + return (header(req, "content-type") ?? "").split(";")[0].trim().toLowerCase() === "application/json"; +} +function hasCsrfHeader(req) { + return !!header(req, CSRF_HEADER); +} +const server = http.createServer((req, res) => { + handle(req, res).catch((err) => { + console.error("[glance] unhandled", err); + try { + responder(res).json(500, { error: "internal error" }); + } catch {} + }); +}); +async function handle(req, res) { + const out = responder(res); + const p = new URL$1(req.url ?? "/", `http://localhost:${cfg.port}`).pathname; + const method = req.method ?? "GET"; + if (method === "OPTIONS") { + out.empty(405, { allow: "GET, POST" }); + return; + } + if (p === "/healthz") { + out.json(200, { + ok: true, + version: VERSION + }); + return; + } + if (p.startsWith("/hook/")) { + if (method !== "POST" || !isJsonPost(req)) { + out.json(405, { error: "post json" }); + return; + } + if (!isHookCaller(req)) { + out.json(403, { error: "hook token required" }); + return; + } + const payload = await readJson(req) ?? {}; + if (p === "/hook/record") { + const event = state.ingest(payload); + out.json(200, { + ok: true, + id: event?.id ?? null + }); + return; + } + if (p === "/hook/approve") { + const decision = await broker.request(payload); + out.json(200, decision); + return; + } + out.json(404, { error: "unknown hook" }); + return; + } + if (p.startsWith("/local/")) { + if (!isAdmin(req)) { + out.json(403, { error: "admin token required" }); + return; + } + if (p === "/local/status" && method === "GET") { + out.json(200, { + version: VERSION, + origin: cfg.origin, + rpId: cfg.rpId, + devices: deviceList().length, + approval: cfg.approval, + watchers: sse.count, + sessions: state.sessionCount, + sessionStates: state.stateSummary(broker.pending()), + events: state.eventCount, + webBuilt: webBuildExists(), + home: paths.home, + hookAuthOk: sameSecret(readHookSecretFromDisk(), hookToken) + }); + return; + } + if (p === "/local/enroll" && method === "POST") { + const minted = codes.mint(); + const base = cfg.origin?.replace(/\/$/, "") ?? `http://localhost:${cfg.port}`; + out.json(200, { + code: minted.code, + expiresInMs: minted.expiresInMs, + url: `${base}/?enroll=1`, + originConfigured: !!cfg.origin + }); + return; + } + if (p === "/local/origin" && method === "POST") { + const raw = ((await readJson(req))?.origin ?? "").trim().replace(/\/$/, ""); + let parsed; + try { + parsed = new URL$1(raw); + } catch { + out.json(400, { error: "not a url" }); + return; + } + if (isIpAddress(parsed.hostname)) { + out.json(400, { error: "a bare IP address cannot be a WebAuthn relying party id - use a hostname with TLS" }); + return; + } + if (parsed.protocol !== "https:" && parsed.hostname !== "localhost") { + out.json(400, { error: "passkeys need https (or localhost for local testing)" }); + return; + } + cfg.origin = `${parsed.protocol}//${parsed.host}`; + cfg.rpId = deriveRpId(cfg.origin); + saveConfig(cfg); + out.json(200, { + origin: cfg.origin, + rpId: cfg.rpId + }); + return; + } + if (p === "/local/devices" && method === "GET") { + out.json(200, { devices: deviceList() }); + return; + } + if (p === "/local/devices/revoke" && method === "POST") { + const prefix = ((await readJson(req))?.idPrefix ?? "").trim(); + if (prefix.length < 4) { + out.json(400, { error: "give at least 4 characters of the device id" }); + return; + } + out.json(200, { revoked: revokeCredentials(prefix) }); + sse.publish(); + return; + } + if (p === "/local/approval" && method === "POST") { + if (!applyApprovalMode((await readJson(req))?.mode)) { + out.json(400, { error: "mode must be off, risky or all" }); + return; + } + out.json(200, cfg.approval); + return; + } + if (p === "/local/shutdown" && method === "POST") { + out.json(200, { ok: true }); + shutdown("cli"); + return; + } + out.json(404, { error: "unknown local endpoint" }); + return; + } + if (p.startsWith("/api/")) { + if (method === "POST" && (!isJsonPost(req) || !hasCsrfHeader(req))) { + out.json(400, { error: "bad request" }); + return; + } + const session = currentSession(req); + const secure = requestIsHttps(req); + if (p === "/api/gate" && method === "GET") { + const gate = { + authenticated: !!session, + enrolled: webauthn.enrolled, + enrollmentOpen: codes.active, + version: VERSION, + deviceLabel: session?.label, + rpId: cfg.rpId + }; + out.json(200, gate); + return; + } + if (p === "/api/auth/register/options" && method === "POST") { + if (!enrollLimiter.allow("enroll")) { + out.json(429, { error: "too many attempts, wait a few minutes" }); + return; + } + const body = await readJson(req); + if (!session && !codes.check(body?.code ?? "")) { + out.json(403, { error: "that enrolment code is not valid" }); + return; + } + out.json(200, await webauthn.registrationOptions()); + return; + } + if (p === "/api/auth/register/verify" && method === "POST") { + if (!enrollLimiter.allow("enroll")) { + out.json(429, { error: "too many attempts, wait a few minutes" }); + return; + } + const body = await readJson(req); + if (!body?.response) { + out.json(400, { error: "missing response" }); + return; + } + if (!session && !codes.consume(body.code ?? "")) { + out.json(403, { error: "that enrolment code is not valid" }); + return; + } + const label = body.label?.trim() || "phone"; + const result = await webauthn.verifyRegistration(body.response, label); + if (!result.ok || !result.token) { + out.json(400, { error: result.error ?? "registration failed" }); + return; + } + enrollLimiter.reset("enroll"); + out.json(200, { + ok: true, + label + }, { "set-cookie": buildSessionCookie(signToken(result.token, secret), { + secure, + maxAgeSec: Math.floor(SESSION_TTL_MS / 1e3) + }) }); + console.log(`[glance] enrolled device "${label}"`); + return; + } + if (p === "/api/auth/login/options" && method === "POST") { + if (!authLimiter.allow("login")) { + out.json(429, { error: "too many attempts, wait a few minutes" }); + return; + } + if (!webauthn.enrolled) { + out.json(409, { error: "no device enrolled yet - run `glance enroll`" }); + return; + } + out.json(200, await webauthn.authenticationOptions()); + return; + } + if (p === "/api/auth/login/verify" && method === "POST") { + if (!authLimiter.allow("login")) { + out.json(429, { error: "too many attempts, wait a few minutes" }); + return; + } + const body = await readJson(req); + if (!body?.response) { + out.json(400, { error: "missing response" }); + return; + } + const result = await webauthn.verifyAuthentication(body.response); + if (!result.ok || !result.token) { + out.json(403, { error: result.error ?? "sign in failed" }); + return; + } + authLimiter.reset("login"); + out.json(200, { + ok: true, + label: result.label + }, { "set-cookie": buildSessionCookie(signToken(result.token, secret), { + secure, + maxAgeSec: Math.floor(SESSION_TTL_MS / 1e3) + }) }); + return; + } + if (p === "/api/auth/logout" && method === "POST") { + if (session) destroyAuthSession(session.token); + out.json(200, { ok: true }, { "set-cookie": clearSessionCookie(secure) }); + return; + } + if (!session) { + out.json(401, { error: "not signed in" }); + return; + } + if (p === "/api/snapshot" && method === "GET") { + out.json(200, state.snapshot(broker.pending())); + return; + } + if (p === "/api/approvals/resolve" && method === "POST") { + const body = await readJson(req); + const id = body?.id ?? ""; + const decision = body?.decision; + if (!id || decision !== "allow" && decision !== "deny") { + out.json(400, { error: "need id and decision" }); + return; + } + const settled = broker.resolve(id, decision, session.label); + out.json(settled ? 200 : 409, settled ? { ok: true } : { error: "no longer pending" }); + sse.publish(); + return; + } + if (p === "/api/approval" && method === "POST") { + const body = await readJson(req); + if (body?.mode !== void 0 && !applyApprovalMode(body.mode)) { + out.json(400, { error: "mode must be off, risky or all" }); + return; + } + if (typeof body?.requireWatcher === "boolean") cfg.approval.requireWatcher = body.requireWatcher; + if (body?.onTimeout === "allow" || body?.onTimeout === "deny") cfg.approval.onTimeout = body.onTimeout; + saveConfig(cfg); + out.json(200, cfg.approval); + sse.publish(); + return; + } + if (p === "/api/devices" && method === "GET") { + out.json(200, { + devices: deviceList(), + current: session.credentialId + }); + return; + } + out.json(404, { error: "unknown endpoint" }); + return; + } + if (p === "/events") { + if (method !== "GET") { + out.json(405, { error: "get only" }); + return; + } + if (!currentSession(req)) { + out.json(401, { error: "not signed in" }); + return; + } + sse.add(res); + return; + } + if (method !== "GET") { + out.json(405, { error: "get only" }); + return; + } + serveStatic(p, res); +} +/** Shared by the CLI and the web UI so both paths validate the same way. */ +function applyApprovalMode(mode) { + if (mode !== "off" && mode !== "risky" && mode !== "all") return false; + cfg.approval.mode = mode; + saveConfig(cfg); + sse.publish(); + return true; +} +let shuttingDown = false; +function shutdown(why) { + if (shuttingDown) return; + shuttingDown = true; + console.log(`[glance] shutting down (${why})`); + broker.drain(); + state.flush(); + sse.closeAll(); + server.close(() => process.exit(0)); + setTimeout(() => process.exit(0), 1500).unref(); +} +process.on("SIGINT", () => shutdown("SIGINT")); +process.on("SIGTERM", () => shutdown("SIGTERM")); +process.on("uncaughtException", (err) => { + console.error("[glance] uncaught", err); +}); +process.on("unhandledRejection", (err) => { + console.error("[glance] unhandled rejection", err); +}); +server.listen(cfg.port, cfg.host, () => { + console.log(`[glance] ${VERSION} listening on http://${cfg.host}:${cfg.port}`); + console.log(`[glance] state: ${paths.home}`); + console.log(`[glance] origin: ${cfg.origin ?? "(none set - see README)"} rpId: ${cfg.rpId ?? "localhost"}`); + console.log(`[glance] accepts assertions from: ${expectedOrigins(cfg).join(", ")}`); + if (!webBuildExists()) console.log("[glance] web app missing from dist/: npm install && npm run build"); +}); +server.on("error", (err) => { + console.error(`[glance] listen failed: ${err.message}`); + process.exit(1); +}); +//#endregion +export {}; diff --git a/dist/web/assets/index-BZSiLyex.css b/dist/web/assets/index-BZSiLyex.css new file mode 100644 index 0000000..554fbc6 --- /dev/null +++ b/dist/web/assets/index-BZSiLyex.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-outline-style:solid;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-lime-400:oklch(84.1% .238 128.85);--color-lime-500:oklch(76.8% .233 130.85);--color-lime-600:oklch(64.8% .2 131.684);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-cyan-600:oklch(60.9% .126 221.723);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-600:oklch(58.8% .158 241.966);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-600:oklch(54.1% .281 293.009);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-fuchsia-600:oklch(59.1% .293 322.896);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-snug:1.375;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme{@layer base{:root,.light,.default,[data-theme=light],[data-theme=default]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab, red, red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab, red, red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab, red, red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}}@layer components;}@layer base{@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart), color .15s var(--ease-out), background-color .1s var(--ease-out), box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media (hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out), height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out), height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{content:var(--tw-content);content:var(--tw-content);color:var(--danger);--tw-content:"*";content:var(--tw-content);margin-inline-start:calc(var(--spacing) * .5)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-inline-start:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);inset-inline-start:calc(var(--spacing) * 0);width:100%;height:1px;position:absolute;bottom:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:start;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out), box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab, red, red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab, var(--foreground) 3%, transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad), opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height, opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px, var(--radius-3xl))}@media (hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab, red, red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab, var(--surface-foreground) 6%, transparent)}}.accordion--surface .accordion__item:after{width:94%;inset-inline-start:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-start-start-radius:min(32px, var(--radius-3xl));border-start-end-radius:min(32px, var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-end-end-radius:min(32px, var(--radius-3xl));border-end-start-radius:min(32px, var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-inline-start:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad), opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height, opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);-webkit-text-decoration-color:var(--separator-tertiary);-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out), opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media (hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);-webkit-text-decoration-color:var(--muted);-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab, red, red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab, var(--muted) 50%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--muted) 50%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--muted) 50%, transparent);text-decoration-color:color-mix(in oklab, var(--muted) 50%, transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);-webkit-text-decoration-color:var(--muted);-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{padding-bottom:calc(var(--spacing) * 1.5);margin-inline-start:var(--spacing)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media (width>=40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media (width>=40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media (width>=40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media (width>=48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth), background-color .1s var(--ease-out), box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media (hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media (width>=48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}:is(.pagination__link--nav [data-slot=pagination-previous-icon],.pagination__link--nav [data-slot=pagination-next-icon]):where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){rotate:180deg}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media (width>=48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media (width>=48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{background-color:var(--default);border-radius:calc(var(--radius) * 2.5);position:relative}.tabs__list-container>.tabs__list-container__scroller[data-orientation=vertical]{height:100%}.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next{z-index:2;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);cursor:var(--cursor-interactive);border-style:var(--tw-border-style);color:var(--foreground);--tw-outline-style:none;transition:opacity .15s var(--ease-smooth);background-color:#0000;border-width:0;border-radius:3.40282e38px;outline-style:none;justify-content:center;align-items:center;padding:0;display:none;position:absolute}:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):hover{opacity:.7}}:is(.tabs__list-container>.tabs__list-container__scroll-prev,.tabs__list-container>.tabs__list-container__scroll-next):focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__list-container:has([data-orientation=horizontal])>.tabs__list-container__scroll-prev{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);inset-inline-start:calc(var(--spacing) * 1);top:50%}.tabs__list-container:has([data-orientation=horizontal])>.tabs__list-container__scroll-next{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);inset-inline-end:calc(var(--spacing) * 1);top:50%}:is(.tabs__list-container:has([data-orientation=horizontal])>.tabs__list-container__scroll-prev,.tabs__list-container:has([data-orientation=horizontal])>.tabs__list-container__scroll-next):where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){rotate:180deg}.tabs__list-container:has([data-orientation=vertical])>.tabs__list-container__scroll-prev{top:var(--spacing);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.tabs__list-container:has([data-orientation=vertical])>.tabs__list-container__scroll-next{bottom:var(--spacing);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}:is(.tabs__list-container:has(>:is([data-left-scroll=true],[data-left-right-scroll=true],[data-top-scroll=true],[data-top-bottom-scroll=true]))>.tabs__list-container__scroll-prev,.tabs__list-container:has(>:is([data-right-scroll=true],[data-left-right-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]))>.tabs__list-container__scroll-next){display:inline-flex}.tabs__list{padding:var(--spacing);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:max-content;min-width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;z-index:1;cursor:var(--cursor-interactive);transition:color .15s var(--ease-smooth), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out), opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media (hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--muted);position:absolute}@supports (color:color-mix(in lab, red, red)){.tabs__separator{background-color:color-mix(in oklab, var(--muted) 25%, transparent)}}.tabs__separator{transition:opacity .15s var(--ease-smooth)}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{inset-inline-start:calc(var(--spacing) * 0);width:1px;height:50%;top:25%}.tabs__list[data-orientation=vertical] .tabs__separator{inset-inline-start:5%;width:90%;height:1px;top:0}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{inset-inline-start:calc(var(--spacing) * 0);width:100%;position:absolute;top:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-inline-start:calc(var(--spacing) * 4)}.tabs__indicator{border-radius:calc(var(--radius) * 3);background-color:var(--segment);--tw-shadow:var(--surface-shadow);width:100%;height:100%;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);z-index:-1;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);inset-inline-start:calc(var(--spacing) * 0);position:absolute;top:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container{background-color:#0000;border-radius:0}.tabs--secondary>.tabs__list-container .tabs__list{padding:0}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border)}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:calc(var(--spacing) * .5);top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px;border-color:var(--border)}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{height:100%;width:calc(var(--spacing) * .5);inset-inline-start:calc(var(--spacing) * 0);top:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media (width>=48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth), background-color .1s var(--ease-out), box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);will-change:transform}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media (hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media (width>=40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media (width>=48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab, red, red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media (width>=48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media (width>=48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media (width>=48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{z-index:10}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{inset-inline-start:-1px;width:1px;height:50%;top:25%}.button-group--vertical .button-group__separator{inset-inline-start:25%;width:50%;height:1px;top:-1px}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media (width>=48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth), background-color .1s var(--ease-out), box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media (hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media (hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media (width>=40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media (width>=48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media (width>=48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media (width>=48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media (width>=48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media (width>=48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{inset-inline-start:-1px;width:1px;height:50%;top:25%}.toggle-button-group--vertical .toggle-button-group__separator{inset-inline-start:25%;width:50%;height:1px;top:-1px}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));will-change:transform;padding:0;overflow-y:auto}@media (width>=48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px, var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-inline-start:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart), box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media (hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-inline-start:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart), box-shadow .15s var(--ease-out);will-change:transform;outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media (hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-inline-start:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth), scale .1s var(--ease-smooth), opacity .1s var(--ease-smooth), background-color .1s var(--ease-smooth), box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media (hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media (hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media (hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;inset:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out), height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px, calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out), box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)), repeating-conic-gradient(#efefef 0% 25%, #f7f7f7 0% 50%) 50% / 16px 16px;border-start-start-radius:calc(var(--radius) * 2);border-end-start-radius:calc(var(--radius) * 2);inset-inline-start:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-start-end-radius:calc(var(--radius) * 2);border-end-end-radius:calc(var(--radius) * 2);inset-inline-end:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;inset-inline-start:calc(var(--spacing) * 0)}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)), repeating-conic-gradient(#efefef 0% 25%, #f7f7f7 0% 50%) 50% / 16px 16px;border-end-end-radius:999px;border-end-start-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-start-start-radius:999px;border-start-end-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current), var(--color-swatch-current)), repeating-conic-gradient(#efefef 0% 25%, #f7f7f7 0% 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out), box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media (width>=40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{border-start-start-radius:0;border-end-start-radius:0;padding-inline-start:calc(var(--spacing) * 2)}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{border-start-end-radius:0;border-end-end-radius:0;padding-inline-end:calc(var(--spacing) * 2)}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));flex-shrink:0;align-items:center;margin-inline-start:calc(var(--spacing) * 3);margin-inline-end:0;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));flex-shrink:0;align-items:center;margin-inline-end:calc(var(--spacing) * 3);display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media (hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth), transform .25s var(--ease-out), box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}.slider .slider__thumb:after:is(){transition-property:none}@media (prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}.slider .slider__thumb[data-dragging=true]:after:is(){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}@media (prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab, red, red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab, red, red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab, var(--default-foreground) 20%, transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth), box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media (prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid), background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);background-clip:padding-box;flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);width:fit-content;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px, calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px, var(--radius-2xl));border-end-start-radius:min(32px, var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px, var(--radius-2xl));border-end-end-radius:min(32px, var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab, red, red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab, var(--separator-tertiary) 50%, transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media (hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab, red, red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab, var(--default) 50%, transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab, red, red)){.table__header{border-color:color-mix(in oklab, var(--separator) 50%, transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:start;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media (hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);place-content:center;display:inline-grid}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px, var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px, var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px, var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px, var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px, var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab, red, red)){.table__row{border-color:color-mix(in oklab, var(--separator) 50%, transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab, red, red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab, var(--surface) 40%, transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab, red, red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab, var(--surface) 10%, transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab, red, red)){.table__cell{border-color:color-mix(in oklab, var(--separator-tertiary) 50%, transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x:calc(1 / 2 * 100%);width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:min(32px, var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab, red, red)){.skeleton{background-color:color-mix(in oklab, var(--surface-tertiary) 70%, transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;inset:0}@supports (background-image:linear-gradient(in lab, red, red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000 0%,#ffffff80 50%,#0000 100%);animation:2s linear infinite skeleton;position:absolute;inset:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);inset-inline-start:calc(var(--spacing) * 0);position:absolute;top:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);inset-inline-start:calc(var(--spacing) * 0);position:absolute;top:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media (width>=40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{inset-inline-start:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--bottom-end{inset-inline-end:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{inset-inline-start:calc(var(--spacing) * 4);top:calc(var(--spacing) * 4)}.toast-region--top-end{inset-inline-end:calc(var(--spacing) * 4);top:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:min(32px, var(--radius-3xl));flex-direction:row;display:flex;position:absolute;inset-inline:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;inset-inline-end:calc(var(--spacing) * -1);top:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media (width>=40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media (width>=40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media (hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media (width>=40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate, opacity}::view-transition-new(*){will-change:translate, opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out), border-color .2s var(--ease-out), transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear), opacity .2s var(--ease-linear), background-color .2s var(--ease-out);position:absolute;inset:0}.checkbox__control:before:is(){transition-property:none}@media (prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);width:100%;display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);min-width:0;display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));min-width:0;color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media (hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media (width>=40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media (hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}:is(.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus)){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media (width>=40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-start-start-radius:0;border-end-start-radius:0;padding-inline-start:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-start-end-radius:0;border-end-end-radius:0;padding-inline-end:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-inline-end-color:var(--field-border);border-inline-start:none;background-color:#0000;border-top:none;border-bottom:none;border-start-start-radius:var(--field-radius,calc(var(--radius) * 1.5));border-start-end-radius:0;border-end-end-radius:0;border-end-start-radius:var(--field-radius,calc(var(--radius) * 1.5));justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-inline-start-color:var(--field-border);border-inline-end:none;background-color:#0000;border-top:none;border-bottom:none;border-start-start-radius:0;border-start-end-radius:var(--field-radius,calc(var(--radius) * 1.5));border-end-end-radius:var(--field-radius,calc(var(--radius) * 1.5));border-end-start-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media (hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}:is(.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus)){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media (width>=40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-start-start-radius:0;border-end-start-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-start-end-radius:0;border-end-end-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab, red, red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab, var(--field-foreground,var(--foreground)) 10%, transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px;border-color:var(--field-placeholder,var(--muted));border-start-start-radius:0;border-start-end-radius:var(--field-radius,calc(var(--radius) * 1.5));border-end-end-radius:var(--field-radius,calc(var(--radius) * 1.5));border-end-start-radius:0}@supports (color:color-mix(in lab, red, red)){.number-field__increment-button{border-color:color-mix(in oklab, var(--field-placeholder,var(--muted)) 15%, transparent)}}.number-field__decrement-button{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px;border-color:var(--field-placeholder,var(--muted));border-start-start-radius:var(--field-radius,calc(var(--radius) * 1.5));border-start-end-radius:0;border-end-end-radius:0;border-end-start-radius:var(--field-radius,calc(var(--radius) * 1.5))}@supports (color:color-mix(in lab, red, red)){.number-field__decrement-button{border-color:color-mix(in oklab, var(--field-placeholder,var(--muted)) 15%, transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media (hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out), border-color .2s var(--ease-out), transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control{background-color:var(--accent);border-color:#0000}.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control{background-color:var(--accent);border-color:#0000}.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control{background-color:var(--accent-hover)}.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.radio[data-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out), background-color .2s var(--ease-out);scale:1}.radio__indicator:empty:before:is(){transition-property:none}@media (prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before{scale:.5714}.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media (width>=40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{appearance:none}.search-field__input::-webkit-search-decoration{appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{border-start-start-radius:0;border-end-start-radius:0;padding-inline-start:calc(var(--spacing) * 2)}.search-field__group:has([slot=clear]) .search-field__input{border-start-end-radius:0;border-end-end-radius:0;padding-inline-end:calc(var(--spacing) * 2)}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0;margin-inline-start:calc(var(--spacing) * 3);margin-inline-end:0}.search-field__clear-button{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;margin-inline-end:calc(var(--spacing) * 2)}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media (hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media (width>=40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media (hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out), background-color .1s var(--ease-out), box-shadow .1s var(--ease-out), opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media (hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__nav-button-icon:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){rotate:180deg}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out), box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media (hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media (hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out), background-color .1s var(--ease-out), box-shadow .1s var(--ease-out), opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media (hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__nav-button-icon:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){rotate:180deg}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color, border-color;transition:box-shadow .1s var(--ease-out), border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media (hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media (hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab, red, red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab, var(--default) 20%, transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}:is(.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]){border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}:is(.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]){border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}:is(.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid)){position:relative}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]){will-change:opacity;transition:opacity .15s var(--ease-out), visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]){pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out), visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground)}.calendar-year-picker__trigger-indicator:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *){transform:rotate(180deg)}.calendar-year-picker__trigger-indicator{transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;inset-inline-start:calc(var(--spacing) * 0);inset-inline-end:calc(var(--spacing) * 0);overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth), scale .1s var(--ease-smooth), opacity .1s var(--ease-smooth), background-color .1s var(--ease-smooth), box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media (hover:hover) and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media (hover:hover) and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media (hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}:is(.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true]))){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media (width>=40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{border-start-start-radius:0;border-end-start-radius:0;padding-inline-start:calc(var(--spacing) * 2)}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{border-start-end-radius:0;border-end-end-radius:0;padding-inline-end:calc(var(--spacing) * 2)}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-inline-end:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-inline-start:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));flex-shrink:0;align-items:center;margin-inline-start:calc(var(--spacing) * 3);margin-inline-end:0;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));flex-shrink:0;align-items:center;margin-inline-end:calc(var(--spacing) * 3);display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media (hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{width:fit-content;transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px, calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-picker__popover .calendar__nav-button-icon,.date-picker__popover .range-calendar__nav-button-icon{rotate:0deg}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{width:fit-content;transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px, calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker__popover .range-calendar__nav-button-icon,.date-range-picker__popover .calendar__nav-button-icon{rotate:0deg}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:min(32px, var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:start;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;inset:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;inset:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media (width>=40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale:calc(105*1%);transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media (width>=40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(0*100%)}}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y:calc(0*-100%)}.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px, var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media (width>=40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{inset-inline-end:calc(var(--spacing) * 4);top:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;inset:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media (prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;inset:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media (prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-start-start-radius:min(32px, var(--radius-2xl));border-start-end-radius:min(32px, var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-end-end-radius:min(32px, var(--radius-2xl));border-end-start-radius:min(32px, var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media (width>=40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media (width>=40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{inset-inline-end:calc(var(--spacing) * 4);top:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;inset:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media (width>=40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale:calc(105*1%);transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media (width>=40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(0*100%)}}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y:calc(0*-100%)}.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media (prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{height:auto;min-height:var(--visual-viewport-height);overflow-y:visible}.modal__backdrop:has(.modal__container--scroll-outside){scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);-webkit-overflow-scrolling:touch;align-items:flex-start;overflow-y:auto}.modal__container--full{padding:0}@media (width>=40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y:calc(0*100%);--tw-enter-scale:1}@media (width>=40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y:calc(0*100%)}}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px, var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media (width>=40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{inset-inline-end:calc(var(--spacing) * 4);top:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px, var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px, var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab, red, red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab, var(--border) 40%, transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth), background-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));overflow-wrap:break-word;color:var(--field-foreground,var(--foreground))}.combo-box__value:empty{display:none}.combo-box__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.combo-box__value [data-slot=list-box-item-indicator]{display:none}.combo-box__trigger{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media (hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px, var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media (hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media (hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media (width>=40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px, var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth), border-color .15s var(--ease-smooth), box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media (hover:hover){:is(.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover))){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media (hover:hover){:is(.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover))){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media (width>=40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-outline-style:none;border-radius:min(32px, var(--radius-3xl));box-shadow:var(--shadow-overlay);outline-style:none;flex-direction:column;display:flex;overflow:hidden}.autocomplete__popover:focus,.autocomplete__popover:focus-visible,.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [role=presentation]>[data-slot=list-box-item]{width:calc(100% - var(--spacing) * 3)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none;flex-shrink:0}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab, red, red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab, var(--overlay-foreground) 60%, transparent)}}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media (prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media (hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-inline-start-style:var(--tw-border-style);border-inline-start-width:4px;border-color:var(--border);color:var(--muted);padding-inline-start:calc(var(--spacing) * 4);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-inline-start:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-inline-start:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:start}.typography--align-center{text-align:center}.typography--align-end{text-align:end}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-position:0 0,100% 0;mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%, var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%, var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%, var(--scroll-shadow-scrollbar-size) 100%;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%, var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%, var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-position:0 0,0 100%;mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)), 100% var(--scroll-shadow-scrollbar-size);-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)), 100% var(--scroll-shadow-scrollbar-size);-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)), 100% var(--scroll-shadow-scrollbar-size);mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)), 100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)), linear-gradient(#000, #000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)), 100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)),.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.h-1{height:var(--spacing)}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-full{height:100%}.max-h-32{max-height:calc(var(--spacing) * 32)}.min-h-dvh{min-height:100dvh}.w-2{width:calc(var(--spacing) * 2)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-full{width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:calc(var(--radius) * 2)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-border{border-color:var(--border)}.border-separator{border-color:var(--separator)}.border-warning\/60{border-color:var(--warning)}@supports (color:color-mix(in lab, red, red)){.border-warning\/60{border-color:color-mix(in oklab, var(--warning) 60%, transparent)}}.bg-accent{background-color:var(--accent)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-background,.bg-background\/85{background-color:var(--background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/85{background-color:color-mix(in oklab, var(--background) 85%, transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-danger{background-color:var(--danger)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-fuchsia-500{background-color:var(--color-fuchsia-500)}.bg-lime-500{background-color:var(--color-lime-500)}.bg-muted{background-color:var(--muted)}.bg-rose-500{background-color:var(--color-rose-500)}.bg-sky-500{background-color:var(--color-sky-500)}.bg-success{background-color:var(--success)}.bg-surface-secondary{background-color:var(--surface-secondary)}.bg-violet-500{background-color:var(--color-violet-500)}.bg-warning{background-color:var(--warning)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.px-0{padding-inline:0}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:var(--spacing)}.pt-\[max\(0\.75rem\,env\(safe-area-inset-top\)\)\]{padding-top:max(.75rem, env(safe-area-inset-top))}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-\[max\(1\.5rem\,env\(safe-area-inset-bottom\)\)\]{padding-bottom:max(1.5rem, env(safe-area-inset-bottom))}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\[0\.25em\]{--tw-tracking:.25em;letter-spacing:.25em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:var(--accent)}.text-amber-600{color:var(--color-amber-600)}.text-cyan-600{color:var(--color-cyan-600)}.text-danger{color:var(--danger)}.text-emerald-600{color:var(--color-emerald-600)}.text-foreground{color:var(--foreground)}.text-fuchsia-600{color:var(--color-fuchsia-600)}.text-lime-600{color:var(--color-lime-600)}.text-muted{color:var(--muted)}.text-rose-600{color:var(--color-rose-600)}.text-sky-600{color:var(--color-sky-600)}.text-surface-secondary-foreground{color:var(--surface-secondary-foreground)}.text-violet-600{color:var(--color-violet-600)}.uppercase{text-transform:uppercase}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-1000{--tw-duration:1s;transition-duration:1s}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.running{animation-play-state:running}.first\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:bg-surface-hover:hover{background-color:var(--surface-hover)}}.dark\:text-amber-400:is(.dark *){color:var(--color-amber-400)}.dark\:text-cyan-400:is(.dark *){color:var(--color-cyan-400)}.dark\:text-emerald-400:is(.dark *){color:var(--color-emerald-400)}.dark\:text-fuchsia-400:is(.dark *){color:var(--color-fuchsia-400)}.dark\:text-lime-400:is(.dark *){color:var(--color-lime-400)}.dark\:text-rose-400:is(.dark *){color:var(--color-rose-400)}.dark\:text-sky-400:is(.dark *){color:var(--color-sky-400)}.dark\:text-violet-400:is(.dark *){color:var(--color-violet-400)}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}html{-webkit-text-size-adjust:100%;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}html.dark{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}body{overscroll-behavior-y:none;min-height:100dvh}.glance-scroll{scrollbar-width:thin}.glance-scroll::-webkit-scrollbar{width:6px}.glance-scroll::-webkit-scrollbar-thumb{background:currentColor;border-radius:3px}@supports (color:color-mix(in lab, red, red)){.glance-scroll::-webkit-scrollbar-thumb{background:color-mix(in oklab, currentColor 20%, transparent)}}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/dist/web/assets/index-D-dJ5pn0.js b/dist/web/assets/index-D-dJ5pn0.js new file mode 100644 index 0000000..c526a6e --- /dev/null +++ b/dist/web/assets/index-D-dJ5pn0.js @@ -0,0 +1,15 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function E(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function D(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}var ee=!1,S=-1,C=5,w=-1;function te(){return g?!0:!(e.unstable_now()-wt&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():ee=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,T()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1ue||(e.current=le[ue],le[ue]=null,ue--)}function M(e,t){ue++,le[ue]=e.current,e.current=t}var de=A(null),N=A(null),fe=A(null),pe=A(null);function me(e,t){switch(M(fe,t),M(N,e),M(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}j(de),M(de,e)}function he(){j(de),j(N),j(fe)}function ge(e){e.memoizedState!==null&&M(pe,e);var t=de.current,n=Hd(t,e.type);t!==n&&(M(N,e),M(de,n))}function _e(e){N.current===e&&(j(de),j(N)),pe.current===e&&(j(pe),Qf._currentValue=ce)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,P=t.unstable_getCurrentPriorityLevel,je=t.unstable_ImmediatePriority,Me=t.unstable_UserBlockingPriority,Ne=t.unstable_NormalPriority,Pe=t.unstable_LowPriority,Fe=t.unstable_IdlePriority,Ie=t.log,Le=t.unstable_setDisableYieldValue,Re=null,ze=null;function Be(e){if(typeof Ie==`function`&&Le(e),ze&&typeof ze.setStrictMode==`function`)try{ze.setStrictMode(Re,e)}catch{}}var Ve=Math.clz32?Math.clz32:We,He=Math.log,Ue=Math.LN2;function We(e){return e>>>=0,e===0?32:31-(He(e)/Ue|0)|0}var Ge=256,Ke=262144,qe=4194304;function Je(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ye(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Je(n))):i=Je(o):i=Je(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Je(n))):i=Je(o)):i=Je(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Xe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ze(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qe(){var e=qe;return qe<<=1,!(qe&62914560)&&(qe=4194304),e}function $e(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function et(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),pn=!1;if(fn)try{var mn={};Object.defineProperty(mn,"passive",{get:function(){pn=!0}}),window.addEventListener(`test`,mn,mn),window.removeEventListener(`test`,mn,mn)}catch{pn=!1}var hn=null,gn=null,_n=null;function vn(){if(_n)return _n;var e,t=gn,n=t.length,r,i=`value`in hn?hn.value:hn.textContent,a=i.length;for(e=0;e=Xn),$n=` `,er=!1;function tr(e,t){switch(e){case`keyup`:return Jn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function nr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var rr=!1;function ir(e,t){switch(e){case`compositionend`:return nr(t);case`keypress`:return t.which===32?(er=!0,$n):null;case`textInput`:return e=t.data,e===$n&&er?null:e;default:return null}}function ar(e,t){if(rr)return e===`compositionend`||!Yn&&tr(e,t)?(e=vn(),_n=gn=hn=null,rr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Er(n)}}function L(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?L(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=zt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=fn&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function R(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==zt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&Tr(Nr,r)||(Nr=r,r=Td(Mr,`onSelect`),0>=o,i-=o,Ei=1<<32-Ve(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&Oi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),z&&Oi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&Oi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),z&&Oi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=pi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=fi(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=gi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Oa(o),b(e,r,o,c)}if(se(o))return h(e,r,o,c);if(E(o)){if(l=E(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===S)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Y&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=O.T,s={};O.T=s,Ns(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,ga(c,r),fu(e)):Ms(e,t,r,fu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,ce,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:ce},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},fu())}function Es(){return ta(Qf)}function Ds(){return Ao().memoizedState}function Os(){return Ao().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(mu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=ni(e,t,n,r),n!==null&&(mu(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,fu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,wr(s,o))return ti(e,t,i,0),q===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return mu(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&mu(t,e,2)}function Ps(e){var t=e.alternate;return e===B||t!==null&&t===B}function Fs(e,t){ho=mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,rt(e,n)}}var Ls={readContext:ta,use:Mo,useCallback:xo,useContext:xo,useEffect:xo,useImperativeHandle:xo,useLayoutEffect:xo,useInsertionEffect:xo,useMemo:xo,useReducer:xo,useRef:xo,useState:xo,useDebugValue:xo,useDeferredValue:xo,useTransition:xo,useSyncExternalStore:xo,useId:xo,useHostTransitionStatus:xo,useFormState:xo,useActionState:xo,useOptimistic:xo,useMemoCache:xo,useCacheRefresh:xo};Ls.useEffectEvent=xo;var Rs={readContext:ta,use:Mo,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),os(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){os(4,2,e,t)},useMemo:function(e,t){var n=ko();t=t===void 0?null:t;var r=e();if(go){Be(!0);try{e()}finally{Be(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ko();if(n!==void 0){var i=n(t);if(go){Be(!0);try{n(t)}finally{Be(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=js.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(ko(),e,t)},useTransition:function(){var e=Wo(!1);return e=xs.bind(null,B,e.queue,!0,!1),ko().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=ko();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),q===null)throw Error(i(349));Y&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs(Vo.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=ko(),t=q.identifierPrefix;if(z){var n=Di,r=Ei;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=_o++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ut]=t,o[dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=fe.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ut]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ri(t,!0)}else e=Bd(e).createTextNode(r),e[ut]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ut]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ut]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return he(),e===null&&xd(t.stateNode.containerInfo),Lc(t),null;case 10:return Yi(t.type),Lc(t),null;case 19:if(j(uo),r=t.memoizedState,r===null)return Lc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ic(r,!1);else{if(Z!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return M(uo,uo.current&1|2),z&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ae()>eu&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!z)return Lc(t),null}else 2*Ae()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ae(),e.sibling=null,n=uo.current,M(uo,a?n&1|2:n&1),z&&Oi(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&j(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(uo),null;case 4:return he(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&j(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Bc(e,t){switch(ji(t),t.tag){case 3:Yi(sa),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:j(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&j(va);break;case 24:Yi(sa)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){Q(e,e.return,t)}}}function Wc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[dt]=t}catch(t){Q(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=nn));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[ut]=e,t[dt]=n}catch(t){Q(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Rd=sp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[ut]=e,St(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Dr(s,h),v=Dr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,O.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,rd(0,!1),ze&&typeof ze.onPostCommitFiberRoot==`function`)try{ze.onPostCommitFiberRoot(Re,o)}catch{}return!0}finally{k.p=a,O.T=r,Bu(e,t)}}function Uu(e,t,n){t=vi(n,t),t=Zs(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(et(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=vi(n,e),n=Qs(2),r=Wa(t,n,2),r!==null&&($s(n,r,t,e),et(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,q===e&&(Y&n)===n&&(Z===4||Z===3&&(Y&62914560)===Y&&300>Ae()-Ql?!(K&2)&&xu(e,0):Kl|=n,Jl===Y&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=Qe()),e=ri(e,t),e!==null&&(et(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return Ee(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ve(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Y,a=Ye(r,r===q?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Xe(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Ae(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}ru!==0&&ru!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Vt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Vt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Vt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Vt(n.imageSizes)+`"]`)):i+=`[href="`+Vt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),St(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Vt(r)+`"][href="`+Vt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),St(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=xt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);St(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=xt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),St(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=xt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),St(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=fe.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=xt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=xt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=xt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Vt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),St(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Vt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Vt(n.href)+`"]`);if(r)return t.instance=r,St(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),St(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,St(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),St(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,St(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),St(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,St(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),St(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()}));function _(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function v(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function y(e){let t=null;return()=>(t??=e(),t)}var b=y(function(){return v(/^Mac/i)}),x=y(function(){return v(/^iPhone/i)}),ee=y(function(){return v(/^iPad/i)||b()&&navigator.maxTouchPoints>1}),S=y(function(){return x()||ee()}),C=y(function(){return _(/AppleWebKit/i)&&(S()||!w())}),w=y(function(){return _(/Chrome|CriOS|CrMo/i)}),te=y(function(){return _(/Android/i)}),ne=y(function(){return _(/(Firefox|FxiOS)/i)});function T(e){if(ie())e.focus({preventScroll:!0});else{let t=ae(e);e.focus(),E(t)}}var re=null;function ie(){if(re==null){re=!1;try{document.createElement(`div`).focus({get preventScroll(){return re=!0,!0}})}catch{}}return re}function ae(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight{},O={prefix:String(Math.round(Math.random()*1e10)),current:0},k=D.createContext(O),ce=D.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;var le=new WeakMap;function ue(e=!1){let t=(0,D.useContext)(k),n=(0,D.useRef)(null);if(n.current===null&&!e){let e=D.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=le.get(e);n==null?le.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,le.delete(e))}n.current=++t.current}return n.current}function A(e){let t=(0,D.useContext)(k),n=ue(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function j(e){let t=D.useId(),[n]=(0,D.useState)(pe()),r=n?`react-aria`:`react-aria${O.prefix}`;return e||`${r}-${t}`}var M=typeof D.useId==`function`?j:A;function de(){return!1}function N(){return!0}function fe(e){return()=>{}}function pe(){return typeof D.useSyncExternalStore==`function`?D.useSyncExternalStore(fe,de,N):(0,D.useContext)(ce)}var me=!!(typeof window<`u`&&window.document&&window.document.createElement),he=new Map,ge;typeof FinalizationRegistry<`u`&&(ge=new FinalizationRegistry(e=>{he.delete(e)}));var _e=new WeakMap;function ve(e){let[t,n]=(0,D.useState)(e),r=(0,D.useRef)(null),i=M(t),a=(0,D.useRef)(null),o=_e.get(a);if(ge&&o!==i&&(o!=null&&ge.unregister(a),ge.register(a,i,a),_e.set(a,i)),me){let e=he.get(i);e&&!e.includes(r)?e.push(r):he.set(i,[r])}return se(()=>{let e=i;return()=>{ge&&(ge.unregister(a),_e.delete(a)),he.delete(e)}},[i]),(0,D.useEffect)(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function ye(e,t){if(e===t)return e;let n=he.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=he.get(t);return r?(r.forEach(t=>t.current=e),e):t}function be(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}var xe=e=>we(e)?e.document:Te(e)?e:e?.ownerDocument??(typeof document<`u`?document:void 0),Se=e=>xe(e)?.defaultView??(typeof window<`u`?window:void 0);function Ce(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function we(e){return typeof e==`object`&&!!e&&`window`in e&&e.window===e}function Te(e){return Ce(e)&&e.nodeType===9}function Ee(e){return Ce(e)&&e.nodeType===11&&`host`in e}var De=!1;function Oe(){return De}function ke(e,t){if(!Oe())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=typeof n.assignedElements!=`function`&&n.assignedSlot?.parentNode?n.assignedSlot.parentNode:Ee(n)?n.host:n.parentNode}return!1}var Ae=(e=document)=>{if(!Oe())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function P(e){if(Oe()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function je(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=Me(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():Me(e[n],null)})}}}function Me(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ne(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t=65&&e.charCodeAt(2)<=90?t[e]=be(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=Pe(n,i):e===`id`&&n&&i?t.id=ye(n,i):e===`ref`&&n&&i?t.ref=je(n,i):t[e]=i===void 0?n:i}}return t}var Ie=new Set([`id`]),Le=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),Re=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),ze=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),Be=new Set(`onClick.onAuxClick.onContextMenu.onDoubleClick.onMouseDown.onMouseEnter.onMouseLeave.onMouseMove.onMouseOut.onMouseOver.onMouseUp.onTouchCancel.onTouchEnd.onTouchMove.onTouchStart.onPointerDown.onPointerMove.onPointerUp.onPointerCancel.onPointerEnter.onPointerLeave.onPointerOver.onPointerOut.onGotPointerCapture.onLostPointerCapture.onScroll.onWheel.onAnimationStart.onAnimationEnd.onAnimationIteration.onTransitionCancel.onTransitionEnd.onTransitionRun.onTransitionStart`.split(`.`)),Ve=/^(data-.*)$/;function He(e,t={}){let{labelable:n,isLink:r,global:i,events:a=i,propNames:o}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(Ie.has(t)||n&&Le.has(t)||r&&Re.has(t)||i&&ze.has(t)||a&&(Be.has(t)||t.endsWith(`Capture`)&&Be.has(t.slice(0,-7)))||o?.has(t)||Ve.test(t))&&(s[t]=e[t]);return s}var Ue=new Map,We=new Set;function Ge(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=P(t);if(!e(t)||!r)return;let i=Ue.get(r);i||(i=new Set,Ue.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=P(t);if(!e(t)||!r)return;let i=Ue.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),Ue.delete(r)),Ue.size===0)){for(let e of We)e();We.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Ge):Ge());function Ke(){for(let[e]of Ue)`isConnected`in e&&!e.isConnected&&Ue.delete(e)}function qe(e){requestAnimationFrame(()=>{Ke(),Ue.size===0?e():We.add(e)})}function Je(){let e=(0,D.useRef)(new Map),t=(0,D.useCallback)((t,n,r,i)=>{let a=i?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,a,i)},[]),n=(0,D.useCallback)((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=(0,D.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,D.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Ye(e){let t=(0,D.useRef)(null),n=(0,D.useRef)(void 0),r=(0,D.useCallback)(t=>{if(typeof e==`function`){let n=e,r=n(t);return()=>{typeof r==`function`?r():n(null)}}else if(e)return e.current=t,()=>{e.current=null}},[e]);return(0,D.useMemo)(()=>({get current(){return t.current},set current(e){t.current=e,n.current&&=(n.current(),void 0),e!=null&&(n.current=r(e))}}),[r])}var Xe=D.useInsertionEffect??se;function Ze(e){let t=(0,D.useRef)(null);return Xe(()=>{t.current=e},[e]),(0,D.useCallback)((...e)=>{let n=t.current;return n?.(...e)},[])}function Qe(e,t){se(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function $e(e){return e.pointerType===``&&e.isTrusted?!0:te()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function et(e){return!te()&&e.width===0&&e.height===0||te()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}var tt=typeof Element<`u`&&`checkVisibility`in Element.prototype;function nt(e){let t=Se(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=Se(e),{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function rt(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function it(e,t){return tt?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&nt(e)&&rt(e,t)&&(!e.parentElement||it(e.parentElement,e))}var at=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable^="false"])`,`permission`],ot=at.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;at.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`),at.join(`:not([hidden]):not([tabindex="-1"]),`);function st(e,t){return e.matches(ot)&&!ct(e)&&(t?.skipVisibilityCheck||it(e))}function ct(e){let t=e;for(;t!=null;){if(t instanceof Se(t).HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function lt(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}var ut=new WeakMap;function dt(e){let t=e??(typeof document<`u`?document:void 0);if(!t)return lt(t);if(ut.has(t))return ut.get(t);let n=t.querySelector(`meta[property="csp-nonce"]`),r=n&&n instanceof Se(n).HTMLMetaElement&&(n.nonce||n.content)||lt(t)||void 0;return r!==void 0&&ut.set(t,r),r}var ft=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=o(((e,t)=>{t.exports=ft()}))();function pt(e,t){let{ref:n,render:r,...i}=t,a=(0,D.useRef)(null),o=(0,D.useMemo)(()=>je(n,a),[n,a]);se(()=>{},[e,r]);let s={...i,ref:o};return r?r(s,void 0):(0,F.jsx)(e,{...s})}var mt={},ht=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=mt[t];return n||(n=pt.bind(null,t),mt[t]=n),n}}),gt=Array.isArray,_t=e=>{if(!e&&e!==0&&e!==0n)return``;if(typeof e==`string`)return e;if(typeof e==`number`)return e===e?``+e:``;if(typeof e==`bigint`)return``+e;let t=``;if(gt(e)){let n=e.length;for(let r=0;rtypeof e!=`string`||!e?e:e.replace(vt,` `).trim(),xt=e=>{let t=e.length;if(t===0)return!1;let n=e.charCodeAt(0),r=e.charCodeAt(t-1);if(n===32||r===32||n>=9&&n<=13||n===160||r>=9&&r<=13||r===160)return!0;for(let n=0;n=9&&r<=13||r===160||r===32&&n+1{let t=_t(e);if(t)return xt(t)?bt(t):t},Ct=e=>e===!1?`false`:e===!0?`true`:e===0?`0`:e,wt=e=>{if(!e||typeof e!=`object`)return!0;for(let t in e)return!1;return!0},Tt=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t,i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;for(let e=0;e{let n=e;for(let e in t)if(Object.hasOwn(t,e)){let r=t[e];e in n?n[e]=St(n[e],r):n[e]=r}return e},Dt=(e,t)=>{for(let n=0;n{let t=[];Dt(e,t);let n=[];for(let e=0;e{let n=e,r=t,i={};for(let e in n){let t=n[e];if(e in r){let n=r[e];yt(t)||yt(n)?i[e]=Ot(n,t):typeof t==`object`&&typeof n==`object`&&t&&n?i[e]=kt(t,n):i[e]=n+` `+t}else i[e]=t}for(let e in r)e in n||(i[e]=r[e]);return i},At={twMerge:!0,twMergeConfig:{}},jt=256,Mt=128,Nt=Symbol(`tv-cache-miss`),Pt=e=>e?.class!=null&&e.class!==``||e?.className!=null&&e.className!==``,Ft=e=>{if(e===void 0)return``;if(e===null)return`null`;if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return e===0?`0`:String(e);if(typeof e==`bigint`)return String(e);let t=Ct(e),n=typeof t;if(n===`string`||n===`number`||n===`boolean`||n===`bigint`)return String(t);if(n===`object`)try{return JSON.stringify(t)}catch{return null}return null},It=(e,t)=>{if(t===void 0)return e;if(t===null)return e+`null`;let n=typeof t;if(n===`string`||n===`number`||n===`boolean`||n===`bigint`)return e+String(t);if(Array.isArray(t))return e+t.join(`\0`);try{return e+JSON.stringify(t)}catch{return e+`?`}},Lt=(e,t,n,r)=>{let i=``,a=Object.create(null);for(let r=0;r1&&o.sort();for(let e=0;e{let n=``;for(let t=0;t{let t=new Map,n=null;return{get(e){if(t.has(e))return t.get(e);if(n?.has(e)){let r=n.get(e);return t.set(e,r),r}return Nt},set(r,i){t.size>=e&&(n=t,t=new Map),t.set(r,i)}}},Bt=(e=jt)=>{let t=zt(e);return{get(e){return t.get(e)},set(e,n){t.set(e,n)}}},Vt=(e=Mt)=>{let t=new Map,n=null,r=0;return{get(e,i){let a=t.get(e);if(a){let e=a.get(i);if(e!==void 0||a.has(i))return e}if(n){let a=n.get(e);if(a){let n=a.get(i);if(n!==void 0||a.has(i)){let a=t.get(e);return a||(a=new Map,t.set(e,a)),a.has(i)||r++,a.set(i,n),n}}}return Nt},set(i,a,o){r>=e&&(n=t,t=new Map,r=0);let s=t.get(i);s||(s=new Map,t.set(i,s)),s.has(a)||r++,s.set(a,o)}}},Ht=(e,t)=>{let n=null;return(r,i)=>{if(!Pt(i))return r;let a=i.class,o=i.className;if(a!=null&&a!==``&&typeof a!=`string`||o!=null&&o!==``&&typeof o!=`string`)return e(t,r,a,o);n??=Vt();let s=r??``,c=(typeof a==`string`?a:``)+`\0`+(typeof o==`string`?o:``),l=n.get(s,c);if(l!==Nt)return l;let u=e(t,r,a,o);return n.set(s,c,u),u}};function Ut(){let e=null,t={},n=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(t){e=t},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(e){t=e},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(e){n=e},reset(){e=null,t={},n=!1}}}var Wt=Ut(),Gt=e=>{!wt(e.twMergeConfig)&&!Tt(e.twMergeConfig,Wt.cachedTwMergeConfig)&&(Wt.didTwMergeConfigChange=!0,Wt.cachedTwMergeConfig=e.twMergeConfig)},Kt=(e,t)=>{let n=[];for(let r=0;r{if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let n=0;n{if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let n=0;n{let t={};for(let n=0;n{let{extend:n=null,slots:r={},variants:i={},compoundVariants:a=[],compoundSlots:o=[],defaultVariants:s={}}=e,c={...At,...t},l=e.slots!==void 0,u=n?.base?St(n.base,e?.base):e?.base,d=n?.variants&&!wt(n.variants)?kt(i,n.variants):i,f=n?.defaultVariants&&!wt(n.defaultVariants)?{...n.defaultVariants,...s}:s;Gt(c);let p=!n?.slots||wt(n.slots),m=l?p&&n?.base?St(e?.base,n.base):typeof e?.base==`string`||e?.base==null?e.base:St(e.base):void 0,h=l?{base:m,...r}:{},g=p?h:Et({...n?.slots},wt(h)?{base:e?.base}:h),_=!n?.compoundVariants||wt(n.compoundVariants)?a:Ot(n?.compoundVariants,a),v=!n?.compoundSlots||wt(n.compoundSlots)?o:Ot(n?.compoundSlots,o),y=Object.keys(d);return{config:c,extend:n,base:u,variants:d,defaultVariants:f,slots:g,compoundVariants:_,compoundSlots:v,compiledVariants:null,compiledCompoundVariants:null,compiledCompoundSlots:null,compiledCompoundSlotsBySlot:null,deferredError:_&&!Array.isArray(_)?TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof _}`):v&&!Array.isArray(v)?TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof v}`):null,mode:l||!p?`slots`:y.length===0?`plain`:`variants`,slotKeys:null,variantKeys:y}},Zt=e=>e.compiledVariants===null?(e.compiledVariants=Kt(e.variants,e.variantKeys),e.compiledCompoundVariants=qt(e.compoundVariants),e.compiledCompoundSlots=Jt(e.compoundSlots),e.compiledCompoundSlotsBySlot=Yt(e.compiledCompoundSlots),e.slotKeys=e.slots&&typeof e.slots==`object`?Object.keys(e.slots):[],e):e,Qt=[],$t=[],en=[],tn=[],nn=[],rn=(e,t,n)=>{let r={};for(let t in e)r[t]=e[t];if(t)for(let e in t)t[e]!==void 0&&(r[e]=t[e]);if(n)for(let e in n)n[e]!==void 0&&(r[e]=n[e]);return r},an=e=>e==null||e===!1,on=(e,t)=>{if(!Array.isArray(e))return e===t||an(e)&&an(t);for(let n=0;n{if(e.isEmpty)return null;let i=r?.[e.key]??n?.[e.key];if(i===null)return null;let a=Ct(i);if(typeof a==`object`)return null;let o=t?.[e.key],s=a??Ct(o);return e.values[s||`false`]},cn=(e,t)=>{let{conditionKeys:n,source:r}=e;for(let e=0;e{typeof n==`string`?t===`base`&&e.push(n):n&&typeof n==`object`&&n[t]&&e.push(n[t])},un=(e,t,n)=>{let r=$t;r.length=0;for(let i=0;i{let a=$t;a.length=0;for(let o=0;o{let n=en;n.length=0;for(let r=0;r{let r=tn;r.length=0;for(let i=0;i{let n=nn;n.length=0;for(let r=0;r{let{base:n,config:r}=e,i=Nt,a=Ht(t,r);return(e=>(i===Nt&&(i=t(r,n)),a(i,e)))},gn=(e,t)=>{let{base:n,config:r,defaultVariants:i,deferredError:a,variantKeys:o}=e,s=e.compiledCompoundVariants,c=e.compiledVariants,l=Qt,u=null,d=Ht(t,r),f=1,p=e=>{let a=s.length>0?fn(s,rn(i,e)):void 0;return t(r,n,un(c,i,e),a)};return(t=>{if(a)throw a;(c===null||s===null)&&(Zt(e),c=e.compiledVariants,s=e.compiledCompoundVariants,l=e.compiledCompoundSlots??Qt);let n;if(f>0)f--,n=p(t);else{u??=Bt();let e=Lt(o,i,t);if(e!==null){let r=s.length>0||l.length>0?Rt(s,l):``,i=e+`#`+r,a=u.get(i);a===Nt?(n=p(t),u.set(i,n)):n=a}else n=p(t)}return d(n,t)})},_n=(e,t)=>{let{config:n,defaultVariants:r,deferredError:i,slots:a,variantKeys:o}=e,s=null,c=null,l=null,u=null,d=!1,f=null,p=null,m=1,h=()=>{if(l!==null)return;(e.compiledVariants===null||e.compiledCompoundVariants===null||e.compiledCompoundSlots===null||e.compiledCompoundSlotsBySlot===null||e.slotKeys===null)&&Zt(e);let i=e.compiledVariants;s=e.compiledCompoundVariants,c=e.compiledCompoundSlots;let o=e.compiledCompoundSlotsBySlot;l=e.slotKeys,d=s.length>0||c.length>0,f=Ht(t,n);let p=Array(l.length);for(let e=0;e{let l=d?rn(r,e,o):void 0,f=l?pn(c,s,l):void 0,p=l?mn(u,l):void 0;return t(n,a[c],dn(c,i,r,e,o),f,p)}}u=p},g=e=>{let t=l,n=u,r=f,i={};for(let a=0;a{if(t==null)return s;let n=!1;for(let e in t)if(!(e===`class`||e===`className`)&&t[e]!==void 0){n=!0;break}return r(n?o(e,t):s,t)}}return i};return(e=>{if(i)throw i;if(h(),m>0)return m--,g(e);let t=Lt(o,r,e);if(t===null)return g(e);let n=d?Rt(s,c):``,a=t+`#`+n;p??=zt();let l=p.get(a);if(l!==Nt)return l;let u=g(e);return p.set(a,u),u})},vn=(e,t)=>{if(e.mode===`plain`)return hn(e,t);let n;return(r=>(n??=e.mode===`slots`?_n(e,t):gn(e,t),n(r)))},yn=(e,t)=>{e.variantKeys=t.variantKeys,e.extend=t.extend,e.base=t.base,e.slots=t.slots,e.variants=t.variants,e.defaultVariants=t.defaultVariants,e.compoundSlots=t.compoundSlots,e.compoundVariants=t.compoundVariants},bn=e=>{let t=(t,n)=>{let r=Xt(t,n),i=vn(r,e);return yn(i,r),i};return{tv:t,createTV:e=>(n,r)=>t(n,r?kt(e,r):e)}},xn=(e,t)=>{let n=e.length,r=t.length,i=Array(n+r);for(let t=0;t({classGroupId:e,validator:t}),Cn=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wn=`-`,Tn=[],En=`arbitrary..`,Dn=e=>{let t=An(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e[0]===`[`&&e[e.length-1]===`]`)return kn(e);let n=e.split(wn);return On(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?xn(i,t):t:i||Tn}return n[e]||Tn}}},On=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=On(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(wn):e.slice(t).join(wn),s=a.length;for(let e=0;e{let t=e.slice(1,-1),n=t.indexOf(`:`);if(n===-1)return;let r=t.slice(0,n);return r?En+r:void 0},An=e=>{let{theme:t,classGroups:n}=e;return jn(n,t)},jn=(e,t)=>{let n=Cn();for(let r in e){let i=e[r];Mn(i,n,r,t)}return n},Mn=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){Pn(e,t,n);return}if(typeof e==`function`){Fn(e,t,n,r);return}In(e,t,n,r)},Pn=(e,t,n)=>{let r=e===``?t:Ln(t,e);r.classGroupId=n},Fn=(e,t,n,r)=>{if(Rn(e)){Mn(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Sn(n,e))},In=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(wn),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,zn=`!`,Bn=58,Vn=47,Hn=91,Un=93,Wn=40,Gn=41,Kn=33,qn=(e,t,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:void 0}),Jn=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return qn(t,l,c,d)},Yn=e=>{let t=new Set(e.orderSensitiveModifiers);return e=>{let n=[],r=[];for(let i=0;i0){r.sort();for(let e=0;e0){r.sort();for(let e=0;e{let t=Yn(e),n=er(e),{getClassGroupId:r,getConflictingClassGroupIds:i}=Dn(e),a=Object.create(null),o=Object.create(null),s=0,c=new Int32Array(256),l=0,u=new Uint8Array(64),d=!1,f=e=>{let t=[],n=e.length,r=-1;d=!1;for(let i=0;i=9&&n<=13?(d=!0,r!==-1&&(t.push(e.slice(r,i)),r=-1)):r===-1&&(r=i)}return r!==-1&&t.push(e.slice(r)),t},p=new Map,m=0,h=e=>{let t=p.get(e);if(t===void 0&&(t=m++,p.set(e,t),t>=c.length)){let e=new Int32Array(c.length*2);e.set(c),c=e}return t},g=e=>{let{isExternal:a,modifiers:o,hasImportantModifier:s,baseClassName:c,maybePostfixModifierPosition:l}=Jn(e);if(a)return Xn;let u=!!l,d;if(u){d=r(c.substring(0,l));let e=d&&n[d]?r(c):void 0;e&&e!==d&&(d=e,u=!1)}else d=r(c);if(!d){if(!u||(d=r(c),!d))return Xn;u=!1}let f=o.length===0?``:o.length===1?o[0]:t(o).join(`:`),p=s?f+zn:f,m=i(d,u),g=[];for(let e=0;e{let t=a[e];return t===void 0?(t=o[e],t===void 0&&(t=g(e)),a[e]=t,++s>Zn&&(s=0,o=a,a=Object.create(null)),t):t};return{parseClassName:Jn,sortModifiers:t,postfixLookupClassGroupIds:n,getClassGroupId:r,getConflictingClassGroupIds:i,getClassDescriptor:_,mergeClassList:e=>{let t=f(e),n=t.length;if(n===1)return t[0];m>Qn&&(p.clear(),m=0,a=Object.create(null),o=Object.create(null),s=0),l=l+1|0,l===0&&(l=1);let r=l;if(n>u.length){let e=u.length;for(;e=0;--e){let n=t[e];h+=n.length;let a=_(n);if(a.isExternal){u[e]=1;continue}let o=a.classId;if(c[o]===r){u[e]=0,i=!0;continue}c[o]=r;let s=a.conflictIds;for(let e=0;e{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let t,n,r=Object.create(null),i=Object.create(null),a=0,o=r=>(t=$n(e()),n=t.mergeClassList,c.mergeString=s,s(r)),s=e=>{let t=r[e];return t===void 0?(t=i[e],t===void 0&&(t=n(e)),r[e]=t,++a>tr&&(a=0,i=r,r=Object.create(null)),t):t},c=(...e)=>c.mergeString(_t(e));return c.mergeString=o,c},rr=[],ir=e=>{let t=t=>t[e]||rr;return t.isThemeGetter=!0,t},ar=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,or=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ur=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pr=Number,mr=Number.isNaN,hr=Number.isInteger,gr=e=>sr.test(e),I=e=>!!e&&!mr(pr(e)),_r=e=>!!e&&hr(pr(e)),vr=e=>e.endsWith(`%`)&&I(e.slice(0,-1)),yr=e=>cr.test(e),br=()=>!0,xr=e=>lr.test(e)&&!ur.test(e),Sr=()=>!1,Cr=e=>dr.test(e),wr=e=>fr.test(e),Tr=e=>!L(e)&&!R(e),Er=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Dr=e=>Hr(e,Kr,Sr),L=e=>ar.test(e),Or=e=>Hr(e,qr,xr),kr=e=>Hr(e,Jr,I),Ar=e=>Hr(e,Xr,br),jr=e=>Hr(e,Yr,Sr),Mr=e=>Hr(e,Wr,Sr),Nr=e=>Hr(e,Gr,wr),Pr=e=>Hr(e,Zr,Cr),R=e=>or.test(e),Fr=e=>Ur(e,qr),Ir=e=>Ur(e,Yr),Lr=e=>Ur(e,Wr),Rr=e=>Ur(e,Kr),zr=e=>Ur(e,Gr),Br=e=>Ur(e,Zr,!0),Vr=e=>Ur(e,Xr,!0),Hr=(e,t,n)=>{let r=ar.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ur=(e,t,n=!1)=>{let r=or.exec(e);return r?r[1]?t(r[1]):n:!1},Wr=e=>e===`position`||e===`percentage`,Gr=e=>e===`image`||e===`url`,Kr=e=>e===`length`||e===`size`||e===`bg-size`,qr=e=>e===`length`,Jr=e=>e===`number`,Yr=e=>e===`family-name`,Xr=e=>e===`number`||e===`weight`,Zr=e=>e===`shadow`,Qr=()=>{let e=ir(`color`),t=ir(`font`),n=ir(`text`),r=ir(`font-weight`),i=ir(`tracking`),a=ir(`leading`),o=ir(`breakpoint`),s=ir(`container`),c=ir(`spacing`),l=ir(`radius`),u=ir(`shadow`),d=ir(`inset-shadow`),f=ir(`text-shadow`),p=ir(`drop-shadow`),m=ir(`blur`),h=ir(`perspective`),g=ir(`aspect`),_=ir(`ease`),v=ir(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),R,L],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[R,L,c],w=()=>[gr,`full`,`auto`,...C()],te=()=>[_r,`none`,`subgrid`,R,L],ne=()=>[`auto`,{span:[`full`,_r,R,L]},_r,R,L],T=()=>[_r,`auto`,R,L],re=()=>[`auto`,`min`,`max`,`fr`,R,L],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],E=()=>[`auto`,...C()],D=()=>[gr,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],oe=()=>[gr,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],se=()=>[gr,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],O=()=>[e,R,L],k=()=>[...b(),Lr,Mr,{position:[R,L]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,Rr,Dr,{size:[R,L]}],ue=()=>[vr,Fr,Or],A=()=>[``,`none`,`full`,l,R,L],j=()=>[``,I,Fr,Or],M=()=>[`solid`,`dashed`,`dotted`,`double`],de=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],N=()=>[I,vr,Lr,Mr],fe=()=>[``,`none`,m,R,L],pe=()=>[`none`,I,R,L],me=()=>[`none`,I,R,L],he=()=>[I,R,L],ge=()=>[gr,`full`,...C()];return{theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[yr],breakpoint:[yr],color:[br],container:[yr],"drop-shadow":[yr],ease:[`in`,`out`,`in-out`],font:[Tr],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[yr],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[yr],shadow:[yr],spacing:[`px`,I],text:[yr],"text-shadow":[yr],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,gr,L,R,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,R,L]}],"container-named":[Er],columns:[{columns:[I,L,R,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[_r,`auto`,R,L]}],basis:[{basis:[gr,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[I,gr,`auto`,`initial`,`none`,L]}],grow:[{grow:[``,I,R,L]}],shrink:[{shrink:[``,I,R,L]}],order:[{order:[_r,`first`,`last`,`none`,R,L]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:D()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[s,`screen`,...D()]}],"min-w":[{"min-w":[s,`screen`,`none`,...D()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...D()]}],h:[{h:[`screen`,`lh`,...D()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...D()]}],"max-h":[{"max-h":[`screen`,`lh`,...D()]}],"font-size":[{text:[`base`,n,Fr,Or]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Vr,Ar]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,vr,L]}],"font-family":[{font:[Ir,jr,t]}],"font-features":[{"font-features":[L]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,R,L]}],"line-clamp":[{"line-clamp":[I,`none`,R,kr]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,R,L]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,R,L]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[I,`from-font`,`auto`,R,Or]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[I,`auto`,R,L]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[_r,R,L]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,R,L]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,R,L]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},_r,R,L],radial:[``,R,L],conic:[_r,R,L]},zr,Nr]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-bs":[{"border-bs":j()}],"border-w-be":[{"border-be":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":j()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...M(),`hidden`,`none`]}],"divide-style":[{divide:[...M(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...M(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[I,R,L]}],"outline-w":[{outline:[``,I,Fr,Or]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,u,Br,Pr]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,Br,Pr]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:j()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[I,Or]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,Br,Pr]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[I,R,L]}],"mix-blend":[{"mix-blend":[...de(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[I]}],"mask-image-linear-from-pos":[{"mask-linear-from":N()}],"mask-image-linear-to-pos":[{"mask-linear-to":N()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":N()}],"mask-image-t-to-pos":[{"mask-t-to":N()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":N()}],"mask-image-r-to-pos":[{"mask-r-to":N()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":N()}],"mask-image-b-to-pos":[{"mask-b-to":N()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":N()}],"mask-image-l-to-pos":[{"mask-l-to":N()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":N()}],"mask-image-x-to-pos":[{"mask-x-to":N()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":N()}],"mask-image-y-to-pos":[{"mask-y-to":N()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[R,L]}],"mask-image-radial-from-pos":[{"mask-radial-from":N()}],"mask-image-radial-to-pos":[{"mask-radial-to":N()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[I]}],"mask-image-conic-from-pos":[{"mask-conic-from":N()}],"mask-image-conic-to-pos":[{"mask-conic-to":N()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,R,L]}],filter:[{filter:[``,`none`,R,L]}],blur:[{blur:fe()}],brightness:[{brightness:[I,R,L]}],contrast:[{contrast:[I,R,L]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Br,Pr]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,I,R,L]}],"hue-rotate":[{"hue-rotate":[I,R,L]}],invert:[{invert:[``,I,R,L]}],saturate:[{saturate:[I,R,L]}],sepia:[{sepia:[``,I,R,L]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,R,L]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[I,R,L]}],"backdrop-contrast":[{"backdrop-contrast":[I,R,L]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,I,R,L]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[I,R,L]}],"backdrop-invert":[{"backdrop-invert":[``,I,R,L]}],"backdrop-opacity":[{"backdrop-opacity":[I,R,L]}],"backdrop-saturate":[{"backdrop-saturate":[I,R,L]}],"backdrop-sepia":[{"backdrop-sepia":[``,I,R,L]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,R,L]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[I,`initial`,R,L]}],ease:[{ease:[`linear`,`initial`,_,R,L]}],delay:[{delay:[I,R,L]}],animate:[{animate:[`none`,v,R,L]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,R,L]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[R,L,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[_r,R,L]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,R,L]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,R,L]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[I,Fr,Or,kr]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},$r=(e,{extend:t={},override:n={}})=>(ti(e.theme,n.theme),ti(e.classGroups,n.classGroups),ti(e.conflictingClassGroups,n.conflictingClassGroups),ti(e.conflictingClassGroupModifiers,n.conflictingClassGroupModifiers),ei(e,`postfixLookupClassGroups`,n.postfixLookupClassGroups),ei(e,`orderSensitiveModifiers`,n.orderSensitiveModifiers),ni(e.theme,t.theme),ni(e.classGroups,t.classGroups),ni(e.conflictingClassGroups,t.conflictingClassGroups),ni(e.conflictingClassGroupModifiers,t.conflictingClassGroupModifiers),ri(e,t,`postfixLookupClassGroups`),ri(e,t,`orderSensitiveModifiers`),e),ei=(e,t,n)=>{n!==void 0&&(e[t]=n)},ti=(e,t)=>{if(t)for(let n in t)ei(e,n,t[n])},ni=(e,t)=>{if(t)for(let n in t)ri(e,t,n)},ri=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},ii=e=>nr(e?typeof e==`function`?()=>e(Qr()):()=>$r(Qr(),e):Qr),ai=e=>{if(wt(e))return;let t=e,n={...t.extend??{}};for(let e of[`theme`,`classGroups`,`conflictingClassGroups`,`conflictingClassGroupModifiers`,`postfixLookupClassGroups`,`orderSensitiveModifiers`,`cacheSize`,`prefix`,`separator`,`experimentalParseClassName`])t[e]!==void 0&&n[e]===void 0&&(n[e]=t[e]);let r={};if(Object.keys(n).length>0&&(r.extend=n),t.override!=null&&!wt(t.override)&&(r.override=t.override),!(!r.extend&&!r.override))return r},oi=e=>{let t=ii(ai(e));return e=>t.mergeString(e)},si,ci=()=>(si||=ii(),si),li=()=>((!Wt.cachedTwMerge||Wt.didTwMergeConfigChange)&&(Wt.didTwMergeConfigChange=!1,Wt.cachedTwMerge=oi(Wt.cachedTwMergeConfig)),Wt.cachedTwMerge),ui=e=>{let t=e?.twMergeConfig;!t||wt(t)||Tt(t,Wt.cachedTwMergeConfig)||(Wt.cachedTwMergeConfig=t,Wt.didTwMergeConfigChange=!0)},di=e=>_t(e);(()=>{let e=Error();return!(`line`in e)&&!(`lineNumber`in e)})();var fi=Wt.reset.bind(Wt);Wt.reset=()=>{si=void 0,fi()};var pi=(e,t)=>{let n=di(e);return!n||!(t?.twMerge??!0)?n||void 0:n.indexOf(` `)===-1?n:(ui(t),(t?.twMergeConfig&&!wt(t.twMergeConfig)?li():ci().mergeString)(n)||void 0)},mi=bn((e,...t)=>pi(t,e));mi.tv,mi.createTV;var hi=St,gi=Array.isArray,_i=e=>{if(!e&&e!==0&&e!==0n)return``;if(typeof e==`string`)return e;if(typeof e==`number`)return e===e?``+e:``;if(typeof e==`bigint`)return``+e;let t=``;if(gi(e)){let n=e.length;for(let r=0;rtypeof e!=`string`||!e?e:e.replace(vi,` `).trim(),xi=e=>{let t=e.length;if(t===0)return!1;let n=e.charCodeAt(0),r=e.charCodeAt(t-1);if(n===32||r===32||n>=9&&n<=13||n===160||r>=9&&r<=13||r===160)return!0;for(let n=0;n=9&&r<=13||r===160||r===32&&n+1{let t=_i(e);if(t)return xi(t)?bi(t):t},Ci=e=>e===!1?`false`:e===!0?`true`:e===0?`0`:e,wi=e=>{if(!e||typeof e!=`object`)return!0;for(let t in e)return!1;return!0},Ti=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t,i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;for(let e=0;e{let n=e;for(let e in t)if(Object.hasOwn(t,e)){let r=t[e];e in n?n[e]=Si(n[e],r):n[e]=r}return e},Di=(e,t)=>{for(let n=0;n{let t=[];Di(e,t);let n=[];for(let e=0;e{let n=e,r=t,i={};for(let e in n){let t=n[e];if(e in r){let n=r[e];yi(t)||yi(n)?i[e]=Oi(n,t):typeof t==`object`&&typeof n==`object`&&t&&n?i[e]=ki(t,n):i[e]=n+` `+t}else i[e]=t}for(let e in r)e in n||(i[e]=r[e]);return i},Ai={twMerge:!0,twMergeConfig:{}},ji=256,Mi=128,Ni=Symbol(`tv-cache-miss`),Pi=e=>e?.class!=null&&e.class!==``||e?.className!=null&&e.className!==``,z=e=>{if(e===void 0)return``;if(e===null)return`null`;if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return e===0?`0`:String(e);if(typeof e==`bigint`)return String(e);let t=Ci(e),n=typeof t;if(n===`string`||n===`number`||n===`boolean`||n===`bigint`)return String(t);if(n===`object`)try{return JSON.stringify(t)}catch{return null}return null},Fi=(e,t)=>{if(t===void 0)return e;if(t===null)return e+`null`;let n=typeof t;if(n===`string`||n===`number`||n===`boolean`||n===`bigint`)return e+String(t);if(Array.isArray(t))return e+t.join(`\0`);try{return e+JSON.stringify(t)}catch{return e+`?`}},Ii=(e,t,n,r)=>{let i=``,a=Object.create(null);for(let r=0;r1&&o.sort();for(let e=0;e{let n=``;for(let t=0;t{let t=new Map,n=null;return{get(e){if(t.has(e))return t.get(e);if(n?.has(e)){let r=n.get(e);return t.set(e,r),r}return Ni},set(r,i){t.size>=e&&(n=t,t=new Map),t.set(r,i)}}},zi=(e=ji)=>{let t=Ri(e);return{get(e){return t.get(e)},set(e,n){t.set(e,n)}}},Bi=(e=Mi)=>{let t=new Map,n=null,r=0;return{get(e,i){let a=t.get(e);if(a){let e=a.get(i);if(e!==void 0||a.has(i))return e}if(n){let a=n.get(e);if(a){let n=a.get(i);if(n!==void 0||a.has(i)){let a=t.get(e);return a||(a=new Map,t.set(e,a)),a.has(i)||r++,a.set(i,n),n}}}return Ni},set(i,a,o){r>=e&&(n=t,t=new Map,r=0);let s=t.get(i);s||(s=new Map,t.set(i,s)),s.has(a)||r++,s.set(a,o)}}},Vi=(e,t)=>{let n=null;return(r,i)=>{if(!Pi(i))return r;let a=i.class,o=i.className;if(a!=null&&a!==``&&typeof a!=`string`||o!=null&&o!==``&&typeof o!=`string`)return e(t,r,a,o);n??=Bi();let s=r??``,c=(typeof a==`string`?a:``)+`\0`+(typeof o==`string`?o:``),l=n.get(s,c);if(l!==Ni)return l;let u=e(t,r,a,o);return n.set(s,c,u),u}};function Hi(){let e=null,t={},n=!1;return{get cachedTwMerge(){return e},set cachedTwMerge(t){e=t},get cachedTwMergeConfig(){return t},set cachedTwMergeConfig(e){t=e},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(e){n=e},reset(){e=null,t={},n=!1}}}var Ui=Hi(),Wi=e=>{!wi(e.twMergeConfig)&&!Ti(e.twMergeConfig,Ui.cachedTwMergeConfig)&&(Ui.didTwMergeConfigChange=!0,Ui.cachedTwMergeConfig=e.twMergeConfig)},Gi=(e,t)=>{let n=[];for(let r=0;r{if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let n=0;n{if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let n=0;n{let t={};for(let n=0;n{let{extend:n=null,slots:r={},variants:i={},compoundVariants:a=[],compoundSlots:o=[],defaultVariants:s={}}=e,c={...Ai,...t},l=e.slots!==void 0,u=n?.base?Si(n.base,e?.base):e?.base,d=n?.variants&&!wi(n.variants)?ki(i,n.variants):i,f=n?.defaultVariants&&!wi(n.defaultVariants)?{...n.defaultVariants,...s}:s;Wi(c);let p=!n?.slots||wi(n.slots),m=l?p&&n?.base?Si(e?.base,n.base):typeof e?.base==`string`||e?.base==null?e.base:Si(e.base):void 0,h=l?{base:m,...r}:{},g=p?h:Ei({...n?.slots},wi(h)?{base:e?.base}:h),_=!n?.compoundVariants||wi(n.compoundVariants)?a:Oi(n?.compoundVariants,a),v=!n?.compoundSlots||wi(n.compoundSlots)?o:Oi(n?.compoundSlots,o),y=Object.keys(d);return{config:c,extend:n,base:u,variants:d,defaultVariants:f,slots:g,compoundVariants:_,compoundSlots:v,compiledVariants:null,compiledCompoundVariants:null,compiledCompoundSlots:null,compiledCompoundSlotsBySlot:null,deferredError:_&&!Array.isArray(_)?TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof _}`):v&&!Array.isArray(v)?TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof v}`):null,mode:l||!p?`slots`:y.length===0?`plain`:`variants`,slotKeys:null,variantKeys:y}},Xi=e=>e.compiledVariants===null?(e.compiledVariants=Gi(e.variants,e.variantKeys),e.compiledCompoundVariants=Ki(e.compoundVariants),e.compiledCompoundSlots=qi(e.compoundSlots),e.compiledCompoundSlotsBySlot=Ji(e.compiledCompoundSlots),e.slotKeys=e.slots&&typeof e.slots==`object`?Object.keys(e.slots):[],e):e,Zi=[],Qi=[],$i=[],ea=[],ta=[],na=(e,t,n)=>{let r={};for(let t in e)r[t]=e[t];if(t)for(let e in t)t[e]!==void 0&&(r[e]=t[e]);if(n)for(let e in n)n[e]!==void 0&&(r[e]=n[e]);return r},ra=e=>e==null||e===!1,ia=(e,t)=>{if(!Array.isArray(e))return e===t||ra(e)&&ra(t);for(let n=0;n{if(e.isEmpty)return null;let i=r?.[e.key]??n?.[e.key];if(i===null)return null;let a=Ci(i);if(typeof a==`object`)return null;let o=t?.[e.key],s=a??Ci(o);return e.values[s||`false`]},oa=(e,t)=>{let{conditionKeys:n,source:r}=e;for(let e=0;e{typeof n==`string`?t===`base`&&e.push(n):n&&typeof n==`object`&&n[t]&&e.push(n[t])},ca=(e,t,n)=>{let r=Qi;r.length=0;for(let i=0;i{let a=Qi;a.length=0;for(let o=0;o{let n=$i;n.length=0;for(let r=0;r{let r=ea;r.length=0;for(let i=0;i{let n=ta;n.length=0;for(let r=0;r{let{base:n,config:r}=e,i=Ni,a=Vi(t,r);return(e=>(i===Ni&&(i=t(r,n)),a(i,e)))},ma=(e,t)=>{let{base:n,config:r,defaultVariants:i,deferredError:a,variantKeys:o}=e,s=e.compiledCompoundVariants,c=e.compiledVariants,l=Zi,u=null,d=Vi(t,r),f=1,p=e=>{let a=s.length>0?ua(s,na(i,e)):void 0;return t(r,n,ca(c,i,e),a)};return(t=>{if(a)throw a;(c===null||s===null)&&(Xi(e),c=e.compiledVariants,s=e.compiledCompoundVariants,l=e.compiledCompoundSlots??Zi);let n;if(f>0)f--,n=p(t);else{u??=zi();let e=Ii(o,i,t);if(e!==null){let r=s.length>0||l.length>0?Li(s,l):``,i=e+`#`+r,a=u.get(i);a===Ni?(n=p(t),u.set(i,n)):n=a}else n=p(t)}return d(n,t)})},ha=(e,t)=>{let{config:n,defaultVariants:r,deferredError:i,slots:a,variantKeys:o}=e,s=null,c=null,l=null,u=null,d=!1,f=null,p=null,m=1,h=()=>{if(l!==null)return;(e.compiledVariants===null||e.compiledCompoundVariants===null||e.compiledCompoundSlots===null||e.compiledCompoundSlotsBySlot===null||e.slotKeys===null)&&Xi(e);let i=e.compiledVariants;s=e.compiledCompoundVariants,c=e.compiledCompoundSlots;let o=e.compiledCompoundSlotsBySlot;l=e.slotKeys,d=s.length>0||c.length>0,f=Vi(t,n);let p=Array(l.length);for(let e=0;e{let l=d?na(r,e,o):void 0,f=l?da(c,s,l):void 0,p=l?fa(u,l):void 0;return t(n,a[c],la(c,i,r,e,o),f,p)}}u=p},g=e=>{let t=l,n=u,r=f,i={};for(let a=0;a{if(t==null)return s;let n=!1;for(let e in t)if(!(e===`class`||e===`className`)&&t[e]!==void 0){n=!0;break}return r(n?o(e,t):s,t)}}return i};return(e=>{if(i)throw i;if(h(),m>0)return m--,g(e);let t=Ii(o,r,e);if(t===null)return g(e);let n=d?Li(s,c):``,a=t+`#`+n;p??=Ri();let l=p.get(a);if(l!==Ni)return l;let u=g(e);return p.set(a,u),u})},ga=(e,t)=>{if(e.mode===`plain`)return pa(e,t);let n;return(r=>(n??=e.mode===`slots`?ha(e,t):ma(e,t),n(r)))},_a=(e,t)=>{e.variantKeys=t.variantKeys,e.extend=t.extend,e.base=t.base,e.slots=t.slots,e.variants=t.variants,e.defaultVariants=t.defaultVariants,e.compoundSlots=t.compoundSlots,e.compoundVariants=t.compoundVariants},va=e=>{let t=(t,n)=>{let r=Yi(t,n),i=ga(r,e);return _a(i,r),i};return{tv:t,createTV:e=>(n,r)=>t(n,r?ki(e,r):e)}},ya=(e,t)=>{let n=e.length,r=t.length,i=Array(n+r);for(let t=0;t({classGroupId:e,validator:t}),xa=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Sa=`-`,Ca=[],wa=`arbitrary..`,Ta=e=>{let t=Oa(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e[0]===`[`&&e[e.length-1]===`]`)return Da(e);let n=e.split(Sa);return Ea(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?ya(i,t):t:i||Ca}return n[e]||Ca}}},Ea=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Ea(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Sa):e.slice(t).join(Sa),s=a.length;for(let e=0;e{let t=e.slice(1,-1),n=t.indexOf(`:`);if(n===-1)return;let r=t.slice(0,n);return r?wa+r:void 0},Oa=e=>{let{theme:t,classGroups:n}=e;return ka(n,t)},ka=(e,t)=>{let n=xa();for(let r in e){let i=e[r];Aa(i,n,r,t)}return n},Aa=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){Ma(e,t,n);return}if(typeof e==`function`){Na(e,t,n,r);return}Pa(e,t,n,r)},Ma=(e,t,n)=>{let r=e===``?t:Fa(t,e);r.classGroupId=n},Na=(e,t,n,r)=>{if(Ia(e)){Aa(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ba(n,e))},Pa=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(Sa),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,La=`!`,Ra=58,za=47,Ba=91,Va=93,Ha=40,Ua=41,Wa=33,Ga=(e,t,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:void 0}),Ka=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return Ga(t,l,c,d)},qa=e=>{let t=new Set(e.orderSensitiveModifiers);return e=>{let n=[],r=[];for(let i=0;i0){r.sort();for(let e=0;e0){r.sort();for(let e=0;e{let t=qa(e),n=Qa(e),{getClassGroupId:r,getConflictingClassGroupIds:i}=Ta(e),a=Object.create(null),o=Object.create(null),s=0,c=new Int32Array(256),l=0,u=new Uint8Array(64),d=!1,f=e=>{let t=[],n=e.length,r=-1;d=!1;for(let i=0;i=9&&n<=13?(d=!0,r!==-1&&(t.push(e.slice(r,i)),r=-1)):r===-1&&(r=i)}return r!==-1&&t.push(e.slice(r)),t},p=new Map,m=0,h=e=>{let t=p.get(e);if(t===void 0&&(t=m++,p.set(e,t),t>=c.length)){let e=new Int32Array(c.length*2);e.set(c),c=e}return t},g=e=>{let{isExternal:a,modifiers:o,hasImportantModifier:s,baseClassName:c,maybePostfixModifierPosition:l}=Ka(e);if(a)return Ja;let u=!!l,d;if(u){d=r(c.substring(0,l));let e=d&&n[d]?r(c):void 0;e&&e!==d&&(d=e,u=!1)}else d=r(c);if(!d){if(!u||(d=r(c),!d))return Ja;u=!1}let f=o.length===0?``:o.length===1?o[0]:t(o).join(`:`),p=s?f+La:f,m=i(d,u),g=[];for(let e=0;e{let t=a[e];return t===void 0?(t=o[e],t===void 0&&(t=g(e)),a[e]=t,++s>Ya&&(s=0,o=a,a=Object.create(null)),t):t};return{parseClassName:Ka,sortModifiers:t,postfixLookupClassGroupIds:n,getClassGroupId:r,getConflictingClassGroupIds:i,getClassDescriptor:_,mergeClassList:e=>{let t=f(e),n=t.length;if(n===1)return t[0];m>Xa&&(p.clear(),m=0,a=Object.create(null),o=Object.create(null),s=0),l=l+1|0,l===0&&(l=1);let r=l;if(n>u.length){let e=u.length;for(;e=0;--e){let n=t[e];h+=n.length;let a=_(n);if(a.isExternal){u[e]=1;continue}let o=a.classId;if(c[o]===r){u[e]=0,i=!0;continue}c[o]=r;let s=a.conflictIds;for(let e=0;e{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let t,n,r=Object.create(null),i=Object.create(null),a=0,o=r=>(t=Za(e()),n=t.mergeClassList,c.mergeString=s,s(r)),s=e=>{let t=r[e];return t===void 0?(t=i[e],t===void 0&&(t=n(e)),r[e]=t,++a>$a&&(a=0,i=r,r=Object.create(null)),t):t},c=(...e)=>c.mergeString(_i(e));return c.mergeString=o,c},to=[],no=e=>{let t=t=>t[e]||to;return t.isThemeGetter=!0,t},ro=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,io=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ao=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,oo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,so=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,co=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,uo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fo=Number,po=Number.isNaN,B=Number.isInteger,V=e=>ao.test(e),H=e=>!!e&&!po(fo(e)),mo=e=>!!e&&B(fo(e)),ho=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),go=e=>oo.test(e),_o=()=>!0,vo=e=>so.test(e)&&!co.test(e),yo=()=>!1,bo=e=>lo.test(e),xo=e=>uo.test(e),So=e=>!U(e)&&!W(e),Co=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),wo=e=>zo(e,Uo,yo),U=e=>ro.test(e),To=e=>zo(e,Wo,vo),Eo=e=>zo(e,Go,H),Do=e=>zo(e,qo,_o),Oo=e=>zo(e,Ko,yo),ko=e=>zo(e,Vo,yo),Ao=e=>zo(e,Ho,xo),jo=e=>zo(e,Jo,bo),W=e=>io.test(e),Mo=e=>Bo(e,Wo),No=e=>Bo(e,Ko),Po=e=>Bo(e,Vo),Fo=e=>Bo(e,Uo),Io=e=>Bo(e,Ho),Lo=e=>Bo(e,Jo,!0),Ro=e=>Bo(e,qo,!0),zo=(e,t,n)=>{let r=ro.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Bo=(e,t,n=!1)=>{let r=io.exec(e);return r?r[1]?t(r[1]):n:!1},Vo=e=>e===`position`||e===`percentage`,Ho=e=>e===`image`||e===`url`,Uo=e=>e===`length`||e===`size`||e===`bg-size`,Wo=e=>e===`length`,Go=e=>e===`number`,Ko=e=>e===`family-name`,qo=e=>e===`number`||e===`weight`,Jo=e=>e===`shadow`,Yo=()=>{let e=no(`color`),t=no(`font`),n=no(`text`),r=no(`font-weight`),i=no(`tracking`),a=no(`leading`),o=no(`breakpoint`),s=no(`container`),c=no(`spacing`),l=no(`radius`),u=no(`shadow`),d=no(`inset-shadow`),f=no(`text-shadow`),p=no(`drop-shadow`),m=no(`blur`),h=no(`perspective`),g=no(`aspect`),_=no(`ease`),v=no(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),W,U],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[W,U,c],w=()=>[V,`full`,`auto`,...C()],te=()=>[mo,`none`,`subgrid`,W,U],ne=()=>[`auto`,{span:[`full`,mo,W,U]},mo,W,U],T=()=>[mo,`auto`,W,U],re=()=>[`auto`,`min`,`max`,`fr`,W,U],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],E=()=>[`auto`,...C()],D=()=>[V,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],oe=()=>[V,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],se=()=>[V,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],O=()=>[e,W,U],k=()=>[...b(),Po,ko,{position:[W,U]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,Fo,wo,{size:[W,U]}],ue=()=>[ho,Mo,To],A=()=>[``,`none`,`full`,l,W,U],j=()=>[``,H,Mo,To],M=()=>[`solid`,`dashed`,`dotted`,`double`],de=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],N=()=>[H,ho,Po,ko],fe=()=>[``,`none`,m,W,U],pe=()=>[`none`,H,W,U],me=()=>[`none`,H,W,U],he=()=>[H,W,U],ge=()=>[V,`full`,...C()];return{theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[go],breakpoint:[go],color:[_o],container:[go],"drop-shadow":[go],ease:[`in`,`out`,`in-out`],font:[So],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[go],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[go],shadow:[go],spacing:[`px`,H],text:[go],"text-shadow":[go],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,V,U,W,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,W,U]}],"container-named":[Co],columns:[{columns:[H,U,W,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[mo,`auto`,W,U]}],basis:[{basis:[V,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,V,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,H,W,U]}],shrink:[{shrink:[``,H,W,U]}],order:[{order:[mo,`first`,`last`,`none`,W,U]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:D()}],"inline-size":[{inline:[`auto`,...oe()]}],"min-inline-size":[{"min-inline":[`auto`,...oe()]}],"max-inline-size":[{"max-inline":[`none`,...oe()]}],"block-size":[{block:[`auto`,...se()]}],"min-block-size":[{"min-block":[`auto`,...se()]}],"max-block-size":[{"max-block":[`none`,...se()]}],w:[{w:[s,`screen`,...D()]}],"min-w":[{"min-w":[s,`screen`,`none`,...D()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...D()]}],h:[{h:[`screen`,`lh`,...D()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...D()]}],"max-h":[{"max-h":[`screen`,`lh`,...D()]}],"font-size":[{text:[`base`,n,Mo,To]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ro,Do]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ho,U]}],"font-family":[{font:[No,Oo,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,W,U]}],"line-clamp":[{"line-clamp":[H,`none`,W,Eo]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,W,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,W,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,W,To]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[H,`auto`,W,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[mo,W,U]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,W,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,W,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},mo,W,U],radial:[``,W,U],conic:[mo,W,U]},Io,Ao]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:j()}],"border-w-x":[{"border-x":j()}],"border-w-y":[{"border-y":j()}],"border-w-s":[{"border-s":j()}],"border-w-e":[{"border-e":j()}],"border-w-bs":[{"border-bs":j()}],"border-w-be":[{"border-be":j()}],"border-w-t":[{"border-t":j()}],"border-w-r":[{"border-r":j()}],"border-w-b":[{"border-b":j()}],"border-w-l":[{"border-l":j()}],"divide-x":[{"divide-x":j()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":j()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...M(),`hidden`,`none`]}],"divide-style":[{divide:[...M(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...M(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,W,U]}],"outline-w":[{outline:[``,H,Mo,To]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,u,Lo,jo]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,Lo,jo]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:j()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[H,To]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":j()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,Lo,jo]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[H,W,U]}],"mix-blend":[{"mix-blend":[...de(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":de()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":N()}],"mask-image-linear-to-pos":[{"mask-linear-to":N()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":N()}],"mask-image-t-to-pos":[{"mask-t-to":N()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":N()}],"mask-image-r-to-pos":[{"mask-r-to":N()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":N()}],"mask-image-b-to-pos":[{"mask-b-to":N()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":N()}],"mask-image-l-to-pos":[{"mask-l-to":N()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":N()}],"mask-image-x-to-pos":[{"mask-x-to":N()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":N()}],"mask-image-y-to-pos":[{"mask-y-to":N()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[W,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":N()}],"mask-image-radial-to-pos":[{"mask-radial-to":N()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":N()}],"mask-image-conic-to-pos":[{"mask-conic-to":N()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,W,U]}],filter:[{filter:[``,`none`,W,U]}],blur:[{blur:fe()}],brightness:[{brightness:[H,W,U]}],contrast:[{contrast:[H,W,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Lo,jo]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,H,W,U]}],"hue-rotate":[{"hue-rotate":[H,W,U]}],invert:[{invert:[``,H,W,U]}],saturate:[{saturate:[H,W,U]}],sepia:[{sepia:[``,H,W,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,W,U]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[H,W,U]}],"backdrop-contrast":[{"backdrop-contrast":[H,W,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,W,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,W,U]}],"backdrop-invert":[{"backdrop-invert":[``,H,W,U]}],"backdrop-opacity":[{"backdrop-opacity":[H,W,U]}],"backdrop-saturate":[{"backdrop-saturate":[H,W,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,W,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,W,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,W,U]}],ease:[{ease:[`linear`,`initial`,_,W,U]}],delay:[{delay:[H,W,U]}],animate:[{animate:[`none`,v,W,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,W,U]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:he()}],"skew-x":[{"skew-x":he()}],"skew-y":[{"skew-y":he()}],transform:[{transform:[W,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[mo,W,U]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,W,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,W,U]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[H,Mo,To,Eo]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}},Xo=(e,{extend:t={},override:n={}})=>(Qo(e.theme,n.theme),Qo(e.classGroups,n.classGroups),Qo(e.conflictingClassGroups,n.conflictingClassGroups),Qo(e.conflictingClassGroupModifiers,n.conflictingClassGroupModifiers),Zo(e,`postfixLookupClassGroups`,n.postfixLookupClassGroups),Zo(e,`orderSensitiveModifiers`,n.orderSensitiveModifiers),$o(e.theme,t.theme),$o(e.classGroups,t.classGroups),$o(e.conflictingClassGroups,t.conflictingClassGroups),$o(e.conflictingClassGroupModifiers,t.conflictingClassGroupModifiers),es(e,t,`postfixLookupClassGroups`),es(e,t,`orderSensitiveModifiers`),e),Zo=(e,t,n)=>{n!==void 0&&(e[t]=n)},Qo=(e,t)=>{if(t)for(let n in t)Zo(e,n,t[n])},$o=(e,t)=>{if(t)for(let n in t)es(e,t,n)},es=(e,t,n)=>{let r=t[n];r!==void 0&&(e[n]=e[n]?e[n].concat(r):r)},ts=e=>eo(e?typeof e==`function`?()=>e(Yo()):()=>Xo(Yo(),e):Yo),ns=e=>{if(wi(e))return;let t=e,n={...t.extend??{}};for(let e of[`theme`,`classGroups`,`conflictingClassGroups`,`conflictingClassGroupModifiers`,`postfixLookupClassGroups`,`orderSensitiveModifiers`,`cacheSize`,`prefix`,`separator`,`experimentalParseClassName`])t[e]!==void 0&&n[e]===void 0&&(n[e]=t[e]);let r={};if(Object.keys(n).length>0&&(r.extend=n),t.override!=null&&!wi(t.override)&&(r.override=t.override),!(!r.extend&&!r.override))return r},rs=e=>{let t=ts(ns(e));return e=>t.mergeString(e)},is,as=()=>(is||=ts(),is),os=()=>((!Ui.cachedTwMerge||Ui.didTwMergeConfigChange)&&(Ui.didTwMergeConfigChange=!1,Ui.cachedTwMerge=rs(Ui.cachedTwMergeConfig)),Ui.cachedTwMerge),ss=e=>{let t=e?.twMergeConfig;!t||wi(t)||Ti(t,Ui.cachedTwMergeConfig)||(Ui.cachedTwMergeConfig=t,Ui.didTwMergeConfigChange=!0)},cs=e=>_i(e);(()=>{let e=Error();return!(`line`in e)&&!(`lineNumber`in e)})();var ls=Ui.reset.bind(Ui);Ui.reset=()=>{is=void 0,ls()};var us=(e,t)=>{let n=cs(e);return!n||!(t?.twMerge??!0)?n||void 0:n.indexOf(` `)===-1?n:(ss(t),(t?.twMergeConfig&&!wi(t.twMergeConfig)?os():as().mergeString)(n)||void 0)},ds=va((e,...t)=>us(t,e)),fs=ds.tv;ds.createTV;var ps=fs({defaultVariants:{status:`default`},slots:{base:`alert`,content:`alert__content`,description:`alert__description`,indicator:`alert__indicator`,title:`alert__title`},variants:{status:{accent:{base:`alert--accent`},danger:{base:`alert--danger`},default:{base:`alert--default`},success:{base:`alert--success`},warning:{base:`alert--warning`}}}}),ms=fs({base:`button`,defaultVariants:{fullWidth:!1,isIconOnly:!1,size:`md`,variant:`primary`},variants:{fullWidth:{false:``,true:`button--full-width`},isIconOnly:{true:`button--icon-only`},size:{lg:`button--lg`,md:`button--md`,sm:`button--sm`},variant:{danger:`button--danger`,"danger-soft":`button--danger-soft`,ghost:`button--ghost`,outline:`button--outline`,primary:`button--primary`,secondary:`button--secondary`,tertiary:`button--tertiary`}}}),hs=fs({defaultVariants:{variant:`default`},slots:{base:`card`,content:`card__content`,description:`card__description`,footer:`card__footer`,header:`card__header`,title:`card__title`},variants:{variant:{default:{base:`card--default`},secondary:{base:`card--secondary`},tertiary:{base:`card--tertiary`},transparent:{base:`card--transparent`}}}}),gs=fs({defaultVariants:{color:`default`,variant:`secondary`},slots:{base:`chip`,label:`chip__label`},variants:{color:{accent:{base:`chip--accent`},danger:{base:`chip--danger`},default:{base:`chip--default`},success:{base:`chip--success`},warning:{base:`chip--warning`}},size:{lg:{base:`chip--lg`},md:{base:`chip--md`},sm:{base:`chip--sm`}},variant:{primary:{base:`chip--primary`},secondary:{base:`chip--secondary`},soft:{base:`chip--soft`},tertiary:{base:`chip--tertiary`}}}}),_s=fs({base:`input`,defaultVariants:{fullWidth:!1,variant:`primary`},variants:{fullWidth:{false:``,true:`input--full-width`},variant:{primary:`input--primary`,secondary:`input--secondary`}}}),vs=fs({base:`spinner`,defaultVariants:{color:`accent`,size:`md`},variants:{color:{accent:`spinner--accent`,current:`spinner--current`,danger:`spinner--danger`,success:`spinner--success`,warning:`spinner--warning`},size:{lg:`spinner--lg`,md:`spinner--md`,sm:`spinner--sm`,xl:`spinner--xl`}}}),ys=Symbol(`default`);function bs(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:c}=e;return(0,D.useMemo)(()=>{let e,l,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,l=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:l||o?{...o,...l}:void 0,children:u??a,"data-rac":``,render:c?e=>c(e,s):void 0}},[t,n,r,i,a,o,s,c])}function xs(e,t){return n=>t(typeof e==`function`?e(n):e,n)}function Ss(e,t){let n=(0,D.useContext)(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||ys;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function Cs(e,t,n){let{ref:r,...i}=Ss(n,e.slot)||{},a=Ye((0,D.useMemo)(()=>je(t,r),[t,r])),o=Fe(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(typeof i.style==`function`||typeof e.style==`function`?o.style=t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:o.style={...i.style,...e.style}),[o,a]}function ws(e,t,n){let{render:r,...i}=t,a=(0,D.useRef)(null),o=(0,D.useMemo)(()=>je(n,a),[n,a]);se(()=>{},[e,r]);let s={...i,ref:o};return r?r(s,void 0):D.createElement(e,s)}var Ts={},Es=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=Ts[t];return n||(n=(0,D.forwardRef)(ws.bind(null,t)),Ts[t]=n),n}});typeof HTMLTemplateElement<`u`&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.appendChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.removeChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(e,t){return this.content.insertBefore(e,t)}}));var Ds=(0,D.createContext)(!1);function Os(e){let t=(t,n)=>(0,D.useContext)(Ds)?null:e(t,n);return t.displayName=e.displayName||e.name,(0,D.forwardRef)(t)}var ks=(0,D.createContext)(null),As=7e3,js=null;function Ms(e,t=`assertive`,n=As){js?js.announce(e,t,n):(js=new Ns,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?js.announce(e,t,n):setTimeout(()=>{js?.isAttached()&&js?.announce(e,t,n)},100))}var Ns=class{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<`u`&&(this.node=document.createElement(`div`),this.node.dataset.liveAnnouncer=`true`,Object.assign(this.node.style,{border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`}),this.assertiveLog=this.createLog(`assertive`),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog(`polite`),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement(`div`);return t.setAttribute(`role`,`log`),t.setAttribute(`aria-live`,e),t.setAttribute(`aria-relevant`,`additions`),t}destroy(){this.node&&=(document.body.removeChild(this.node),null)}announce(e,t=`assertive`,n=As){if(!this.node)return;let r=document.createElement(`div`);typeof e==`object`?(r.setAttribute(`role`,`img`),r.setAttribute(`aria-labelledby`,e[`aria-labelledby`])):r.textContent=e,t===`assertive`?this.assertiveLog?.appendChild(r):this.politeLog?.appendChild(r),e!==``&&setTimeout(()=>{r.remove()},n)}clear(e){this.node&&((!e||e===`assertive`)&&this.assertiveLog&&(this.assertiveLog.innerHTML=``),(!e||e===`polite`)&&this.politeLog&&(this.politeLog.innerHTML=``))}};function Ps(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Fs(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Is(e){let t=(0,D.useRef)({isFocused:!1,observer:null});return se(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),(0,D.useCallback)(n=>{let r=P(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r;n.addEventListener(`focusout`,r=>{if(t.current.isFocused=!1,n.disabled){let t=Ps(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===Ae()?null:Ae();n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:e})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}var Ls=!1;function Rs(e){for(;e&&!st(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=Se(e),n=t.document.activeElement;if(!n||n===e)return;Ls=!0;let r=!1,i=e=>{(P(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(P(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,T(n),c()))},o=t=>{(P(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(P(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,T(n),c()))};t.addEventListener(`blur`,i,!0),t.addEventListener(`focusout`,a,!0),t.addEventListener(`focusin`,s,!0),t.addEventListener(`focus`,o,!0);let c=()=>{cancelAnimationFrame(l),t.removeEventListener(`blur`,i,!0),t.removeEventListener(`focusout`,a,!0),t.removeEventListener(`focusin`,s,!0),t.removeEventListener(`focus`,o,!0),Ls=!1,r=!1},l=requestAnimationFrame(c);return c}var zs=null,Bs=new Set,Vs=new Map,Hs=!1,Us=!1,Ws={Tab:!0,Escape:!0};function Gs(e,t){for(let n of Bs)n(e,t)}function Ks(e){return!(e.metaKey||!b()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function qs(e){Hs=!0,!oe.isOpening&&Ks(e)&&(zs=`keyboard`,Gs(`keyboard`,e))}function Js(e){zs=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(Hs=!0,Gs(`pointer`,e))}function Ys(e){!oe.isOpening&&$e(e)&&(Hs=!0,zs=`virtual`)}function Xs(e){let t=Se(P(e)),n=xe(P(e));P(e)===t||P(e)===n||Ls||!e.isTrusted||(!Hs&&!Us&&(zs=`virtual`,Gs(`virtual`,e)),Hs=!1,Us=!1)}function Zs(){Ls||(Hs=!1,Us=!0)}function Qs(e){if(typeof window>`u`||typeof document>`u`)return;let t=Se(e),n=xe(e);if(Vs.get(t))return;let r=t.HTMLElement.prototype.focus;Reflect.defineProperty(t.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:function(){Hs=!0,r.apply(this,arguments)}}),n.addEventListener(`keydown`,qs,!0),n.addEventListener(`keyup`,qs,!0),n.addEventListener(`click`,Ys,!0),t.addEventListener(`focus`,Xs,!0),t.addEventListener(`blur`,Zs,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,Js,!0),n.addEventListener(`pointermove`,Js,!0),n.addEventListener(`pointerup`,Js,!0)),t.addEventListener(`beforeunload`,()=>{$s(e)},{once:!0}),Vs.set(t,{focus:r})}var $s=(e,t)=>{let n=Se(e),r=xe(e);t&&r.removeEventListener(`DOMContentLoaded`,t),Vs.has(n)&&(Reflect.defineProperty(n.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:Vs.get(n).focus}),r.removeEventListener(`keydown`,qs,!0),r.removeEventListener(`keyup`,qs,!0),r.removeEventListener(`click`,Ys,!0),n.removeEventListener(`focus`,Xs,!0),n.removeEventListener(`blur`,Zs,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,Js,!0),r.removeEventListener(`pointermove`,Js,!0),r.removeEventListener(`pointerup`,Js,!0)),Vs.delete(n))};function ec(e){let t=xe(e),n;return t.readyState===`loading`?(n=()=>{Qs(e)},t.addEventListener(`DOMContentLoaded`,n)):Qs(e),()=>$s(e,n)}typeof document<`u`&&ec();function tc(){return zs!==`pointer`}function nc(){return zs}var rc=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function ic(e,t,n){let r=n?P(n):void 0,i=xe(r),a=Se(r),o=a===void 0?HTMLInputElement:a.HTMLInputElement,s=a===void 0?HTMLTextAreaElement:a.HTMLTextAreaElement,c=a===void 0?HTMLElement:a.HTMLElement,l=a===void 0?KeyboardEvent:a.KeyboardEvent,u=Ae(i);return e=e||u instanceof o&&!rc.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!Ws[n.key])}function ac(e,t,n){Qs(),(0,D.useEffect)(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{ic(!!n?.isTextInput,t,r)&&e(tc())};return Bs.add(t),()=>{Bs.delete(t)}},t)}function oc(e){if(!e.isConnected)return;let t=xe(e);if(nc()===`virtual`){let n=Ae(t);qe(()=>{let r=Ae(t);(r===n||r===t.body)&&e.isConnected&&T(e)})}else T(e)}function sc(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=(0,D.useCallback)(e=>{if(P(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),o=Is(a),s=(0,D.useCallback)(e=>{let t=P(e),r=xe(t),a=r?Ae(r):Ae();t===e.currentTarget&&t===a&&(n&&n(e),i&&i(!0),o(e))},[i,n,o]);return{focusProps:{onFocus:!t&&(n||i||r)?s:void 0,onBlur:!t&&(r||i)?a:void 0}}}function cc(e){if(e)return t=>{let n=!0;e({...t,preventDefault(){t.preventDefault()},isDefaultPrevented(){return t.isDefaultPrevented()},stopPropagation(){n=!0},continuePropagation(){n=!1,typeof t.continuePropagation==`function`&&t.continuePropagation()},isPropagationStopped(){return n}}),n&&!(typeof t.isPropagationStopped==`function`&&t.isPropagationStopped())&&t.stopPropagation()}}var lc=new Set([`shift`,`alt`,`control`,`meta`,`mod`]),uc=[`Alt`,`Control`,`Meta`,`Shift`];function dc(e){let t=new Set;return e.alt&&t.add(`Alt`),e.shift&&t.add(`Shift`),e.ctrl&&t.add(`Control`),e.meta&&t.add(`Meta`),e.mod&&t.add(b()?`Meta`:`Control`),t}function fc(e){let t=new Set;return e.altKey&&t.add(`Alt`),e.ctrlKey&&t.add(`Control`),e.metaKey&&t.add(`Meta`),e.shiftKey&&t.add(`Shift`),t}function pc(e){return uc.filter(t=>e.has(t))}function mc(e){let t=e.split(`+`).reduce((e,t)=>{let n=t.toLowerCase();return lc.has(n)?n===`shift`?e.shift=!0:n===`alt`?e.alt=!0:n===`control`?e.ctrl=!0:n===`meta`?e.meta=!0:n===`mod`&&(e.mod=!0):e.key=t,e},{shift:!1,alt:!1,ctrl:!1,meta:!1,mod:!1,key:``});if(t.key===``)throw Error(`Invalid keyboard shortcut: "${e}". Must include exactly one non-modifier key (e.g. "a", "Enter", "ArrowDown"). Combine any of Shift, Alt, Ctrl, Meta, and Mod.`);return t}function hc(e){return e.toLowerCase()}var gc={space:` `,esc:`escape`,del:`delete`,ins:`insert`,left:`arrowleft`,right:`arrowright`,up:`arrowup`,down:`arrowdown`,pageup:`pageup`,pagedown:`pagedown`};function _c(e){let t=hc(e);return gc[t]??t}function vc(e){let t=pc(dc(e)),n=_c(e.key);return t.length>0?`${t.join(`+`)}+${n}`:n}function yc(e){let t=pc(fc(e)),n=hc(e.key);return(t.length>0?`${t.join(`+`)}+`:``)+n}function bc(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=mc(n);t.set(vc(e),r)}return e=>{let n=yc(e),r=t.get(n),i=r?.(e);i===void 0&&r!==void 0?i={shouldContinuePropagation:!1,shouldPreventDefault:!0}:typeof i==`boolean`&&(i={shouldContinuePropagation:!i,shouldPreventDefault:i}),i?.shouldPreventDefault&&e.preventDefault(),(!r||i?.shouldContinuePropagation)&&e.continuePropagation()}}function xc(e){let{shortcuts:t,allowRepeats:n=!1,allowComposing:r=!1}=e,i,a;if(t){let o=bc(t),s=cc(e=>{if(!ke(e.currentTarget,P(e))){e.continuePropagation();return}if(e.nativeEvent?.repeat&&!n||e.nativeEvent?.isComposing&&!r){e.continuePropagation();return}o(e)}),c=cc(e=>{if(!ke(e.currentTarget,P(e))){e.continuePropagation();return}if(e.nativeEvent?.repeat&&!n||e.nativeEvent?.isComposing&&!r){e.continuePropagation();return}e.continuePropagation()});i=e.onKeyDown?be(e.onKeyDown,s):s,a=e.onKeyUp?be(e.onKeyUp,c):c}else i=cc(e.onKeyDown),a=cc(e.onKeyUp);return{keyboardProps:e.isDisabled?{}:{onKeyDown:i,onKeyUp:a}}}var Sc=D.createContext(null);function Cc(e){let t=(0,D.useContext)(Sc)||{};Qe(t,e);let{ref:n,...r}=t;return r}function wc(e,t){let{focusProps:n}=sc(e),{keyboardProps:r}=xc(e),i=Fe(n,r),a=Cc(t),o=e.isDisabled?{}:a,s=(0,D.useRef)(e.autoFocus);(0,D.useEffect)(()=>{s.current&&t.current&&oc(t.current),s.current=!1},[t]);let c=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(c=void 0),{focusableProps:Fe({...i,tabIndex:c},o)}}var Tc=`default`,Ec=``,Dc=new WeakMap;function Oc(e){if(S()&&C()){if(Tc==="default"){let t=xe(e);Ec=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}Tc=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;Dc.set(e,e.style[t]),e.style[t]=`none`}}function kc(e){if(S()&&C()){if(Tc!==`disabled`)return;Tc=`restoring`,setTimeout(()=>{qe(()=>{if(Tc===`restoring`){let t=xe(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=Ec||``),Ec=``,Tc=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&Dc.has(e)){let t=Dc.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),Dc.delete(e)}}var Ac=D.createContext({register:()=>{}});Ac.displayName=`PressResponderContext`,m();function jc(e){let t=(0,D.useContext)(Ac);if(t){let{register:n,ref:r,...i}=t;e=Fe(i,e),n()}return Qe(t,e.ref),e}var Mc=class{#e;constructor(e,t,n,r){this.#e=!0;let i=(r?.target??n.currentTarget)?.getBoundingClientRect(),a,o=0,s,c=null;n.clientX!=null&&n.clientY!=null&&(s=n.clientX,c=n.clientY),i&&(s!=null&&c!=null?(a=s-i.left,o=c-i.top):(a=i.width/2,o=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=a,this.y=o,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}},Nc=Symbol(`linkClicked`),Pc=`react-aria-pressable-style`,Fc=`data-react-aria-pressable`;function Ic(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:a,onClick:o,isDisabled:s,isPressed:c,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:d,ref:f,...p}=jc(e),[m,h]=(0,D.useState)(!1),g=(0,D.useRef)({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:_,removeAllGlobalListeners:v}=Je(),y=(0,D.useCallback)((e,t)=>{let i=g.current;if(s||i.didFirePressStart)return!1;let a=!0;if(i.isTriggeringEvent=!0,r){let n=new Mc(`pressstart`,t,e);r(n),a=n.shouldStopPropagation}return n&&n(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,h(!0),a},[s,r,n]),x=(0,D.useCallback)((e,r,a=!0)=>{let o=g.current;if(!o.didFirePressStart)return!1;o.didFirePressStart=!1,o.isTriggeringEvent=!0;let c=!0;if(i){let t=new Mc(`pressend`,r,e);i(t),c=t.shouldStopPropagation}if(n&&n(!1),h(!1),t&&a&&!s){let n=new Mc(`press`,r,e);t(n),c&&=n.shouldStopPropagation}return o.isTriggeringEvent=!1,c},[s,i,n,t]),ee=Ze(x),S=Ze((0,D.useCallback)((e,t)=>{let n=g.current;if(s)return!1;if(a){n.isTriggeringEvent=!0;let r=new Mc(`pressup`,t,e);return a(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[s,a])),C=(0,D.useCallback)(e=>{let t=g.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&x(zc(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,v(),d||kc(t.target);for(let e of t.disposables)e();t.disposables=[]}},[d,v,x]),w=Ze(C);(0,D.useEffect)(()=>{s&&g.current.isPressed&&w({currentTarget:g.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[s]);let te=(0,D.useCallback)(e=>{u&&C(e)},[u,C]),ne=(0,D.useCallback)(e=>{s||o?.(e)},[s,o]),re=(0,D.useCallback)((e,t)=>{if(!s&&o){let n=new MouseEvent(`click`,e);Fs(n,t),o(Ps(n))}},[s,o]),ie=(0,D.useMemo)(()=>{let e=g.current,t={onKeyDown(t){if(Rc(t.nativeEvent,t.currentTarget)&&ke(t.currentTarget,P(t))){Vc(P(t),t.key)&&t.preventDefault();let r=!0;!e.isPressed&&!t.repeat&&(e.target=t.currentTarget,e.isPressed=!0,e.pointerType=`keyboard`,r=y(t,`keyboard`));let i=t.currentTarget;_(xe(t.currentTarget),`keyup`,be(t=>{Rc(t,i)&&!t.repeat&&ke(i,P(t))&&e.target&&S(zc(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&b()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else t.key===`Meta`&&(e.metaKeyEvents=new Map)},onClick(t){if(!(t&&!ke(t.currentTarget,P(t)))&&t&&t.button===0&&!e.isTriggeringEvent&&!oe.isOpening){let n=!0;if(s&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||$e(t.nativeEvent))){let e=y(t,`virtual`),r=S(t,`virtual`),i=ee(t,`virtual`);ne(t),n=e&&r&&i}else if(e.isPressed&&e.pointerType!==`keyboard`){let r=e.pointerType||t.nativeEvent.pointerType||`virtual`,i=S(zc(t.currentTarget,t),r),a=ee(zc(t.currentTarget,t),r,!0);n=i&&a,e.isOverTarget=!1,ne(t),w(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&Rc(t,e.target)){Vc(P(t),t.key)&&t.preventDefault();let n=P(t),r=ke(e.target,n);ee(zc(e.target,t),`keyboard`,r),r&&re(t,e.target),v(),t.key!==`Enter`&&Lc(e.target)&&ke(e.target,n)&&!t[Nc]&&(t[Nc]=!0,oe(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if(t.key===`Meta`&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;e.metaKeyEvents=void 0;for(let n of t.values())e.target?.dispatchEvent(new KeyboardEvent(`keyup`,n))}};if(typeof PointerEvent<`u`){t.onPointerDown=t=>{if(t.button!==0||!ke(t.currentTarget,P(t)))return;if(et(t.nativeEvent)){e.pointerType=`virtual`;return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,d||Oc(e.target),i=y(t,e.pointerType);let a=P(t);`releasePointerCapture`in a&&(`hasPointerCapture`in a?a.hasPointerCapture(t.pointerId)&&a.releasePointerCapture(t.pointerId):a.releasePointerCapture(t.pointerId)),_(xe(t.currentTarget),`pointerup`,n,!1),_(xe(t.currentTarget),`pointercancel`,r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(ke(t.currentTarget,P(t))&&t.button===0){if(l){let n=Rs(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{!ke(t.currentTarget,P(t))||e.pointerType===`virtual`||t.button===0&&!e.isPressed&&S(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,y(zc(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,ee(zc(e.target,t),e.pointerType,!1),te(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&t.button===0&&e.target){if(ke(e.target,P(t))&&e.pointerType!=null){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?w(t):(T(e.target),e.target.click()))},80);_(t.currentTarget,`click`,()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else w(t);e.isOverTarget=!1}},r=e=>{w(e)};t.onDragStart=e=>{ke(e.currentTarget,P(e))&&w(e)}}return t},[_,s,l,v,d,te,y,ne,re]);return(0,D.useEffect)(()=>{if(!f)return;let e=xe(f.current);if(!e||!e.head||e.getElementById(Pc))return;let t=e.createElement(`style`);t.id=Pc;let n=dt(e);n&&(t.nonce=n),t.textContent=` +@layer { + [${Fc}] { + touch-action: pan-x pan-y pinch-zoom; + } +} + `.trim(),e.head.prepend(t)},[f]),(0,D.useEffect)(()=>{let e=g.current;return()=>{d||kc(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[d]),{isPressed:c||m,pressProps:Fe(p,ie,{[Fc]:!0})}}function Lc(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function Rc(e,t){let{key:n,code:r}=e,i=t,a=i.getAttribute(`role`);return(n===`Enter`||n===` `||n===`Spacebar`||r===`Space`)&&!(i instanceof Se(i).HTMLInputElement&&!Uc(i,n)||i instanceof Se(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&Lc(i))&&n!==`Enter`)}function zc(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function Bc(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!Lc(e)}function Vc(e,t){return b()&&t===`Enter`?!1:e instanceof HTMLInputElement?t===`Enter`&&(e.type===`checkbox`||e.type===`radio`)?!1:!Uc(e,t):Bc(e)}var Hc=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Uc(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:Hc.has(e.type)}function Wc(e,t){let{elementType:n=`button`,isDisabled:r,onPress:i,onPressStart:a,onPressEnd:o,onPressUp:s,onPressChange:c,preventFocusOnPress:l,allowFocusWhenDisabled:u,onClick:d,href:f,target:p,rel:m,type:h=`button`}=e,g;g=n===`button`?{type:h,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:`button`,href:n===`a`&&!r?f:void 0,target:n===`a`?p:void 0,type:n===`input`?h:void 0,disabled:n===`input`?r:void 0,"aria-disabled":!r||n===`input`?void 0:r,rel:n===`a`?m:void 0};let{pressProps:_,isPressed:v}=Ic({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=wc(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=Fe(y,_,He(e,{labelable:!0}));return{isPressed:v,buttonProps:Fe(g,b,{"aria-haspopup":e[`aria-haspopup`],"aria-expanded":e[`aria-expanded`],"aria-controls":e[`aria-controls`],"aria-pressed":e[`aria-pressed`],"aria-current":e[`aria-current`],"aria-disabled":e[`aria-disabled`]})}}function Gc(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=(0,D.useRef)({isFocusWithin:!1}),{addGlobalListener:o,removeAllGlobalListeners:s}=Je(),c=(0,D.useCallback)(e=>{ke(e.currentTarget,P(e))&&a.current.isFocusWithin&&!ke(e.currentTarget,e.relatedTarget)&&(a.current.isFocusWithin=!1,s(),n&&n(e),i&&i(!1))},[n,i,a,s]),l=Is(c),u=(0,D.useCallback)(e=>{if(!ke(e.currentTarget,P(e)))return;let t=P(e),n=xe(t),s=Ae(n);if(!a.current.isFocusWithin&&s===t){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,l(e);let t=e.currentTarget;o(n,`focus`,e=>{let r=P(e);if(a.current.isFocusWithin&&!ke(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});Fs(e,t),c(Ps(e))}},{capture:!0})}},[r,i,l,o,c]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:u,onBlur:c}}}function Kc(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=(0,D.useRef)({isFocused:!1,isFocusVisible:t||tc()}),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)(()=>i.current.isFocused&&i.current.isFocusVisible),l=(0,D.useCallback)(()=>c(i.current.isFocused&&i.current.isFocusVisible),[]),u=(0,D.useCallback)(e=>{i.current.isFocused=e,i.current.isFocusVisible=tc(),o(e),l()},[l]);ac(e=>{i.current.isFocusVisible=e,l()},[n,a],{enabled:a,isTextInput:n});let{focusProps:d}=sc({isDisabled:r,onFocusChange:u}),{focusWithinProps:f}=Gc({isDisabled:!r,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:s,focusProps:r?f:d}}var qc=!1,Jc=0;function Yc(){qc=!0,setTimeout(()=>{qc=!1},500)}function Xc(e){e.pointerType===`touch`&&Yc()}function Zc(){let e=xe(null);if(e!==void 0)return Jc===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,Xc),Jc++,()=>{Jc--,!(Jc>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,Xc)}}function Qc(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=(0,D.useState)(!1),s=(0,D.useRef)({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;(0,D.useEffect)(Zc,[]);let{addGlobalListener:c,removeAllGlobalListeners:l}=Je(),{hoverProps:u,triggerHoverEnd:d}=(0,D.useMemo)(()=>{let e=(e,r)=>{if(s.pointerType=r,i||r===`touch`||s.isHovered||!ke(e.currentTarget,P(e)))return;s.isHovered=!0;let l=e.currentTarget;s.target=l,c(xe(P(e)),`pointerover`,e=>{s.isHovered&&s.target&&!ke(s.target,P(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:l,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=s.target;s.pointerType=``,s.target=null,!(t===`touch`||!s.isHovered||!i)&&(s.isHovered=!1,l(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},u={};return typeof PointerEvent<`u`&&(u.onPointerEnter=t=>{qc&&t.pointerType===`mouse`||e(t,t.pointerType)},u.onPointerLeave=e=>{!i&&ke(e.currentTarget,P(e))&&a(e,e.pointerType)}),{hoverProps:u,triggerHoverEnd:a}},[t,n,r,i,s,c,l]);return(0,D.useEffect)(()=>{i&&d({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:u,isHovered:a}}var $c=(0,D.createContext)({}),el=Os(function(e,t){[e,t]=Cs(e,t,$c);let n=e,{isPending:r}=n,{buttonProps:i,isPressed:a}=Wc(e,t);i=nl(i,r);let{focusProps:o,isFocused:s,isFocusVisible:c}=Kc(e),{hoverProps:l,isHovered:u}=Qc({...e,isDisabled:e.isDisabled||r}),d={isHovered:u,isPressed:(n.isPressed||a)&&!r,isFocused:s,isFocusVisible:c,isDisabled:e.isDisabled||!1,isPending:r??!1},f=bs({...e,values:d,defaultClassName:`react-aria-Button`}),p=ve(i.id),m=ve(),h=i[`aria-labelledby`];r&&(h?h=`${h} ${m}`:i[`aria-label`]&&(h=`${p} ${m}`));let g=(0,D.useRef)(r);(0,D.useEffect)(()=>{let e={"aria-labelledby":h||p};(!g.current&&s&&r||g.current&&s&&!r)&&Ms(e,`assertive`),g.current=r},[r,s,h,p]);let _=He(e,{global:!0});return delete _.onClick,D.createElement(Es.button,{...Fe(_,f,i,o,l),type:i.type===`submit`&&r?`button`:i.type,id:p,ref:t,"aria-labelledby":h,slot:e.slot||void 0,"aria-disabled":r?`true`:i[`aria-disabled`],"data-disabled":e.isDisabled||void 0,"data-pressed":d.isPressed||void 0,"data-hovered":u||void 0,"data-focused":s||void 0,"data-pending":r||void 0,"data-focus-visible":c||void 0},D.createElement(ks.Provider,{value:{id:m}},f.children))}),tl=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function nl(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!tl.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}function rl(e,t){return xs(e,(e,n)=>hi(typeof t==`function`?t(n)??``:t??``,e??``)??``)}var il=(e,t,n)=>typeof e==`function`?e({...n??{},className:t}):t,al=e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,height:16,role:`presentation`,viewBox:`0 0 16 16`,width:16,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-.25 3a.75.75 0 0 0-1.5 0V11a.75.75 0 0 0 1.5 0z`,fill:`currentColor`,fillRule:`evenodd`})}),ol=e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,height:16,role:`presentation`,viewBox:`0 0 16 16`,width:16,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M7.134 2.994L2.217 11.5a1 1 0 0 0 .866 1.5h9.834a1 1 0 0 0 .866-1.5L8.866 2.993a1 1 0 0 0-1.732 0m3.03-.75c-.962-1.665-3.366-1.665-4.329 0L.918 10.749c-.963 1.666.24 3.751 2.165 3.751h9.834c1.925 0 3.128-2.085 2.164-3.751zM8 5a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2A.75.75 0 0 1 8 5m1 5.75a1 1 0 1 1-2 0a1 1 0 0 1 2 0`,fill:`currentColor`,fillRule:`evenodd`})}),sl=e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,height:16,role:`presentation`,viewBox:`0 0 16 16`,width:16,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-4.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0M8.75 5a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0z`,fill:`currentColor`,fillRule:`evenodd`})}),cl=e=>(0,F.jsx)(`svg`,{"aria-hidden":`true`,fill:`none`,height:16,role:`presentation`,viewBox:`0 0 16 16`,width:16,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M13.5 8a5.5 5.5 0 1 1-11 0a5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858L6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z`,fill:`currentColor`,fillRule:`evenodd`})}),ll=(0,D.createContext)({}),ul=(0,D.createContext)({}),dl=`__button_group_child`,fl=({children:e,className:t,fullWidth:n,isDisabled:r,isIconOnly:i,size:a,slot:o,style:s,variant:c,[dl]:l,...u})=>{let d=(0,D.use)(ul),f=l===!0,p=a??(f?d?.size:void 0),m=c??(f?d?.variant:void 0),h=r??(f?d?.isDisabled:void 0);return(0,F.jsx)(el,{className:rl(t,ms({fullWidth:n??(f?d?.fullWidth:void 0),isIconOnly:i,size:p,variant:m})),"data-slot":`button`,isDisabled:h,slot:o,style:s,...u,children:t=>typeof e==`function`?e(t):e})},pl=Object.assign(fl,{Root:fl}),ml=(0,D.createContext)({}),hl=({children:e,className:t,variant:n=`default`,...r})=>{let i=D.useMemo(()=>hs({variant:n}),[n]),a=(0,F.jsx)(ht.div,{className:i.base({className:t}),"data-slot":`card`,...r,children:e});return(0,F.jsx)(ml,{value:{slots:i},children:n===`transparent`?a:(0,F.jsx)(ll,{value:{variant:n},children:a})})},G=Object.assign(hl,{Root:hl,Header:({className:e,...t})=>{let{slots:n}=(0,D.use)(ml);return(0,F.jsx)(ht.div,{className:il(n?.header,e),"data-slot":`card-header`,...t})},Title:({children:e,className:t,...n})=>{let{slots:r}=(0,D.use)(ml);return(0,F.jsx)(ht.h3,{className:il(r?.title,t),"data-slot":`card-title`,...n,children:e})},Description:({children:e,className:t,...n})=>{let{slots:r}=(0,D.use)(ml);return(0,F.jsx)(ht.p,{className:il(r?.description,t),"data-slot":`card-description`,...n,children:e})},Content:({className:e,...t})=>{let{slots:n}=(0,D.use)(ml);return(0,F.jsx)(ht.div,{className:il(n?.content,e),"data-slot":`card-content`,...t})},Footer:({className:e,...t})=>{let{slots:n}=(0,D.use)(ml);return(0,F.jsx)(ht.div,{className:il(n?.footer,e),"data-slot":`card-footer`,...t})}}),gl=(0,D.createContext)({}),_l=({children:e,className:t,color:n,size:r,variant:i,...a})=>{let o=D.useMemo(()=>gs({color:n,size:r,variant:i}),[n,r,i]),s=D.useMemo(()=>typeof e==`string`||typeof e==`number`?(0,F.jsx)(vl,{children:e}):e,[e]);return(0,F.jsx)(gl,{value:{slots:o},children:(0,F.jsx)(ht.span,{...a,className:il(o.base,t),"data-slot":`chip`,children:s})})},vl=({children:e,className:t,...n})=>{let{slots:r}=(0,D.use)(gl);return(0,F.jsx)(ht.span,{className:il(r?.label,t),"data-slot":`chip-label`,...n,children:e})},yl=Object.assign(_l,{Root:_l,Label:vl}),bl=(0,D.createContext)({}),xl=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i},Sl=Os(function(e,t){[e,t]=Cs(e,t,bl);let{hoverProps:n,isHovered:r}=Qc({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:a,focusProps:o}=Kc({isTextInput:!0,autoFocus:e.autoFocus}),s=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,c=bs({...e,values:{isHovered:r,isFocused:i,isFocusVisible:a,isDisabled:e.disabled||!1,isInvalid:s},defaultClassName:`react-aria-Input`});return D.createElement(Es.input,{...Fe(xl(e),o,n),...c,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":a||void 0,"data-invalid":s||void 0})}),Cl={blue:`\x1B[34m`,green:`\x1B[32m`,magenta:`\x1B[35m`,red:`\x1B[31m`,reset:`\x1B[0m`,yellow:`\x1B[33m`},wl={debug:Cl.magenta,error:Cl.red,info:Cl.blue,success:Cl.green,warn:Cl.yellow},Tl={debug:`🔍`,error:`❌`,info:`ℹ️`,success:`✅`,warn:`⚠️`},El=new class{constructor(e={}){this.enabled=e.enabled??!0,this.prefix=e.prefix??`HeroUI`}formatMessage(e,t){let n=wl[e],r=Tl[e];return`${n}[${this.prefix}]${Cl.reset} ${r} ${t}`}log(e,t,...n){if(!this.enabled)return;let r=this.formatMessage(e,t);switch(e){case`error`:console.error(r,...n);break;case`warn`:console.warn(r,...n);break;default:console.log(r,...n)}}info(e,...t){this.log(`info`,e,...t)}success(e,...t){this.log(`success`,e,...t)}warn(e,...t){this.log(`warn`,e,...t)}error(e,...t){this.log(`error`,e,...t)}debug(e,...t){this.log(`debug`,e,...t)}divider(e=`=`,t=80){this.enabled&&console.log(e.repeat(t))}newline(){this.enabled&&console.log()}}({prefix:`HeroUI`}),Dl,Ol=typeof process<`u`&&!1,kl=e=>{Ol&&(Dl??=new Set,Dl.has(e)&&El.warn(`Duplicate collection slot "${e}". Use a unique, namespaced name (e.g. "tabs.listContainer", "menu.popover").`),Dl.add(e));let t=`$$heroui.collection.${e}`,n=(0,D.createContext)(void 0),r=(e,n)=>D.Children.map(e,e=>(0,D.isValidElement)(e)?D.cloneElement(e,{[t]:n}):e),i=e=>{let{[t]:n,...r}=e;return[n,r]},a=e=>{let[t,r]=i(e),a=(0,D.useContext)(n);return[t??a,r]},o=({children:e,...t})=>(0,F.jsx)(n.Provider,{value:t,children:r(e,t)});return o.displayName=`HeroUI.CollectionSlot(${e})`,{key:t,inject:r,consume:i,useSlot:a,Injector:o,withSlot:(t,n)=>{let r=(0,D.forwardRef)(function(r,i){let[o,s]=a(r),{children:c,...l}=s;if(!o)return(0,F.jsx)(t,{...l,ref:i,children:c});if(n)return n({...l,children:c},o,i);let{className:u,render:d,...f}=o;return(0,F.jsx)(t,{...l,ref:i,children:d?d({children:c,className:u,...f}):(0,F.jsx)(`div`,{className:u,"data-slot":`${e}-container`,...f,children:c})})});return r.displayName=`HeroUI.withCollectionSlot(${t.displayName||t.name||e})`,r},Context:n}},Al=(0,D.createContext)({});kl(`combo-box.inputGroup`);var jl=({...e})=>{let t=(0,D.useId)();return(0,F.jsxs)(`svg`,{"data-slot":`spinner-icon`,viewBox:`0 0 24 24`,...e,children:[(0,F.jsxs)(`defs`,{children:[(0,F.jsxs)(`linearGradient`,{id:`«data-slot-icon-def-1»-${t}`,x1:`50%`,x2:`50%`,y1:`5.271%`,y2:`91.793%`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`currentColor`}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`currentColor`,stopOpacity:.55})]}),(0,F.jsxs)(`linearGradient`,{id:`«data-slot-icon-def-2»-${t}`,x1:`50%`,x2:`50%`,y1:`15.24%`,y2:`87.15%`,children:[(0,F.jsx)(`stop`,{offset:`0%`,stopColor:`currentColor`,stopOpacity:0}),(0,F.jsx)(`stop`,{offset:`100%`,stopColor:`currentColor`,stopOpacity:.55})]})]}),(0,F.jsxs)(`g`,{fill:`none`,children:[(0,F.jsx)(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),(0,F.jsx)(`path`,{d:`M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.5 7.5 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021`,fill:`url(#«data-slot-icon-def-1»-${t})`,transform:`translate(1.5 1.625)`}),(0,F.jsx)(`path`,{d:`M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.48 10.48 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084a1.5 1.5 0 0 1-.115-2.118`,fill:`url(#«data-slot-icon-def-2»-${t})`,transform:`translate(1.5 1.625)`})]})]})},Ml=({className:e,color:t,size:n,...r})=>(0,F.jsx)(ht.span,{"aria-label":`Loading`,"data-slot":`spinner`,role:`status`,...r,className:vs({className:e,color:t,size:n}),children:(0,F.jsx)(jl,{"aria-hidden":!0})}),Nl=Object.assign(Ml,{Root:Ml}),Pl=typeof window<`u`?D.useLayoutEffect:D.useEffect,Fl=(0,D.createContext)({}),Il=({className:e,fullWidth:t,variant:n,...r})=>{let i=(0,D.use)(Fl),a=(0,D.use)(Al);return(0,F.jsx)(Sl,{className:rl(e,_s({fullWidth:t,variant:n??i.variant??a.variant})),"data-slot":`input`,...r})},Ll=Object.assign(Il,{Root:Il}),Rl=(0,D.createContext)({}),K=({children:e,className:t,status:n,...r})=>{let i=D.useMemo(()=>ps({status:n}),[n]);return(0,F.jsx)(Rl,{value:{slots:i,status:n},children:(0,F.jsx)(ll,{value:{variant:`default`},children:(0,F.jsx)(ht.div,{className:i?.base({className:t}),"data-slot":`alert-root`,...r,children:e})})})},q=Object.assign(K,{Root:K,Indicator:({children:e,className:t,...n})=>{let{slots:r,status:i}=(0,D.use)(Rl),a=()=>{switch(i){case`accent`:return(0,F.jsx)(al,{"data-slot":`alert-default-icon`});case`success`:return(0,F.jsx)(cl,{"data-slot":`alert-default-icon`});case`warning`:return(0,F.jsx)(ol,{"data-slot":`alert-default-icon`});case`danger`:return(0,F.jsx)(sl,{"data-slot":`alert-default-icon`});default:return(0,F.jsx)(al,{"data-slot":`alert-default-icon`})}};return(0,F.jsx)(ht.div,{className:il(r?.indicator,t),"data-slot":`alert-indicator`,...n,children:e??a()})},Content:({children:e,className:t,...n})=>{let{slots:r}=(0,D.use)(Rl);return(0,F.jsx)(ht.div,{className:il(r?.content,t),"data-slot":`alert-content`,...n,children:e})},Title:({children:e,className:t,...n})=>{let{slots:r}=(0,D.use)(Rl);return(0,F.jsx)(ht.p,{className:il(r?.title,t),"data-slot":`alert-title`,...n,children:e})},Description:({children:e,className:t,...n})=>{let{slots:r}=(0,D.use)(Rl);return(0,F.jsx)(ht.span,{className:il(r?.description,t),"data-slot":`alert-description`,...n,children:e})}}),J=`heroui-theme`,Y=`(prefers-color-scheme: dark)`;function X(e){if(typeof window>`u`)return()=>{};let t=window.matchMedia(Y);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}function zl(){return window.matchMedia?.(Y).matches?`dark`:`light`}function Bl(){}function Vl(e,t){t!==e&&(t&&document.documentElement.classList.remove(t),document.documentElement.classList.add(e),document.documentElement.setAttribute(`data-theme`,e))}function Hl(e=`system`){let[t,n]=(0,D.useState)(()=>typeof window>`u`?e:localStorage.getItem(J)??e),r=(0,D.useSyncExternalStore)(X,zl,Bl),i=t===`system`?r:t,a=(0,D.useRef)(void 0);return Pl(()=>{i&&(Vl(i,a.current),a.current=i)},[i]),{resolvedTheme:i,setTheme:(0,D.useCallback)(e=>{typeof window>`u`||(localStorage.setItem(J,e),n(e))},[]),theme:t}}var Ul=g();function Z(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function Wl(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;ee};function ql(e){let{id:t}=e;return{...e,id:Wl(t),transports:e.transports}}function Jl(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var Yl=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function Xl({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Yl({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new Yl({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new Yl({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new Yl({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new Yl({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new Yl({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new Yl({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new Yl({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Jl(t))return new Yl({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new Yl({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new Yl({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new Yl({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var Zl=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},Ql=[`cross-platform`,`platform`];function $l(e){if(e&&!(Ql.indexOf(e)<0))return e}async function eu(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!Gl())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:Wl(t.challenge),user:{...t.user,id:Wl(t.user.id)},excludeCredentials:t.excludeCredentials?.map(ql)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=Zl.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw Xl({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){tu(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=Z(e))}catch(e){tu(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=Z(c.getAuthenticatorData())}catch(e){tu(`getAuthenticatorData()`,e)}return{id:o,rawId:Z(s),response:{attestationObject:Z(c.attestationObject),clientDataJSON:Z(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:$l(a.authenticatorAttachment)}}function tu(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function nu(){if(!Gl())return ru.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?ru.stubThis(new Promise(e=>e(!1))):ru.stubThis(e.isConditionalMediationAvailable())}var ru={stubThis:e=>e};function iu({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new Yl({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new Yl({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!Jl(t))return new Yl({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new Yl({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new Yl({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function au(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!Gl())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(ql));let a={...t,challenge:Wl(t.challenge),allowCredentials:i},o={};if(n){if(!await nu())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=Zl.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw iu({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=Z(u.userHandle)),{id:c,rawId:Z(l),response:{authenticatorData:Z(u.authenticatorData),clientDataJSON:Z(u.clientDataJSON),signature:Z(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:$l(s.authenticatorAttachment)}}var ou={"content-type":`application/json`,"x-glance-csrf":`1`},su=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`ApiError`}};async function cu(e,t){let n=await fetch(e,{credentials:`same-origin`,...t}),r=await n.text(),i=null;try{i=r?JSON.parse(r):null}catch{i=null}if(!n.ok)throw new su(i?.error??`${n.status} ${n.statusText}`,n.status);return i}function lu(e,t){return cu(e,{method:`POST`,headers:ou,body:JSON.stringify(t??{})})}var uu={gate:()=>cu(`/api/gate`),snapshot:()=>cu(`/api/snapshot`),devices:()=>cu(`/api/devices`),logout:()=>lu(`/api/auth/logout`),resolveApproval:(e,t)=>lu(`/api/approvals/resolve`,{id:e,decision:t}),setApproval:e=>lu(`/api/approval`,e),async signIn(){return(await lu(`/api/auth/login/verify`,{response:await au({optionsJSON:await lu(`/api/auth/login/options`)})})).label},async enroll(e,t){await lu(`/api/auth/register/verify`,{code:e,label:t,response:await eu({optionsJSON:await lu(`/api/auth/register/options`,{code:e})})})}},du=[500,1e3,2e3,4e3,8e3,15e3];function fu(e){let[t,n]=(0,D.useState)(null),[r,i]=(0,D.useState)(`connecting`),a=(0,D.useRef)(0);return(0,D.useEffect)(()=>{if(!e){n(null),i(`connecting`);return}let t=!1,r=null,o,s=()=>{if(t)return;let e=du[Math.min(a.current,du.length-1)];a.current+=1,o=window.setTimeout(c,e)},c=()=>{t||(uu.snapshot().then(e=>{t||n(e)},()=>{}),r=new EventSource(`/events`,{withCredentials:!0}),r.addEventListener(`open`,()=>{t||(a.current=0,i(`live`))}),r.addEventListener(`snapshot`,e=>{if(!t)try{n(JSON.parse(e.data)),i(`live`)}catch{}}),r.addEventListener(`bye`,()=>{r?.close(),i(`offline`),s()}),r.addEventListener(`error`,()=>{r?.close(),r=null,!t&&(i(`offline`),s())}))};c();let l=()=>{if(document.visibilityState===`visible`){if(r&&r.readyState===EventSource.OPEN){uu.snapshot().then(n,()=>{});return}r?.close(),r=null,a.current=0,o&&window.clearTimeout(o),c()}};return document.addEventListener(`visibilitychange`,l),()=>{t=!0,document.removeEventListener(`visibilitychange`,l),o&&window.clearTimeout(o),r?.close()}},[e]),{snapshot:t,connection:r}}function pu(e=1e3){let[t,n]=(0,D.useState)(()=>Date.now());return(0,D.useEffect)(()=>{let t=window.setInterval(()=>n(Date.now()),e);return()=>window.clearInterval(t)},[e]),t}var mu=`h-4 w-4 shrink-0`;function hu({className:e}){return(0,F.jsxs)(`svg`,{className:e??mu,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`rect`,{x:`4`,y:`10.5`,width:`16`,height:`10.5`,rx:`2.5`}),(0,F.jsx)(`path`,{d:`M8 10.5V7.5a4 4 0 0 1 8 0v3`})]})}function gu({className:e}){return(0,F.jsxs)(`svg`,{className:e??mu,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`path`,{d:`M12 3a9 9 0 0 0-9 9`}),(0,F.jsx)(`path`,{d:`M21 12a9 9 0 0 0-9-9`}),(0,F.jsx)(`path`,{d:`M12 7a5 5 0 0 0-5 5v3`}),(0,F.jsx)(`path`,{d:`M17 12a5 5 0 0 0-5-5`}),(0,F.jsx)(`path`,{d:`M12 11a1.5 1.5 0 0 0-1.5 1.5V19`}),(0,F.jsx)(`path`,{d:`M13.5 12.5A1.5 1.5 0 0 0 12 11`}),(0,F.jsx)(`path`,{d:`M16.5 15.5V12`}),(0,F.jsx)(`path`,{d:`M7 19.5v-1`})]})}function _u({className:e}){return(0,F.jsxs)(`svg`,{className:e??mu,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,F.jsx)(`path`,{d:`M12 3v2.2M12 18.8V21M4.2 7.5l1.9 1.1M17.9 15.4l1.9 1.1M4.2 16.5l1.9-1.1M17.9 8.6l1.9-1.1`})]})}function vu({className:e}){return(0,F.jsx)(`svg`,{className:e??mu,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M5 12.5l4.5 4.5L19 7`})})}function yu({className:e}){return(0,F.jsxs)(`svg`,{className:e??mu,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`8.5`}),(0,F.jsx)(`path`,{d:`M6.2 17.8 17.8 6.2`})]})}function bu({className:e}){return(0,F.jsxs)(`svg`,{className:e??mu,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,F.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,F.jsx)(`path`,{d:`M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4`})]})}function xu({className:e}){return(0,F.jsx)(`svg`,{className:e??mu,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,F.jsx)(`path`,{d:`M20 14.5A8.5 8.5 0 0 1 9.5 4a7 7 0 1 0 10.5 10.5Z`})})}function Su(){let e=navigator.userAgent;return/iPhone/.test(e)?`iPhone`:/iPad/.test(e)?`iPad`:/Android/.test(e)?`Android phone`:/Macintosh/.test(e)?`Mac`:/Windows/.test(e)?`Windows PC`:`device`}function Cu(e){let t=e;return t?.name===`NotAllowedError`?`Cancelled, or the prompt timed out. Try again.`:t?.name===`InvalidStateError`?`This device is already enrolled — just sign in.`:t?.name===`SecurityError`?`The browser refused this origin. Passkeys need the exact https hostname the daemon was configured with.`:t?.message??`Something went wrong.`}function wu({gate:e,onSignedIn:t}){let n=new URLSearchParams(location.search).has(`enroll`),[r,i]=(0,D.useState)(!e.enrolled||n),[a,o]=(0,D.useState)(``),[s,c]=(0,D.useState)(Su),[l,u]=(0,D.useState)(!1),[d,f]=(0,D.useState)(null),p=Gl(),m=!!e.rpId&&location.hostname!==e.rpId&&!location.hostname.endsWith(`.${e.rpId}`)&&location.hostname!==`localhost`;async function h(e){u(!0),f(null);try{await e(),t()}catch(e){f(Cu(e))}finally{u(!1)}}return(0,F.jsxs)(`main`,{className:`mx-auto flex min-h-dvh w-full max-w-sm flex-col justify-center gap-5 px-5 py-10`,children:[(0,F.jsxs)(`header`,{className:`flex flex-col items-center gap-3 text-center`,children:[(0,F.jsx)(`span`,{className:`rounded-2xl border border-border p-3 text-foreground`,children:(0,F.jsx)(hu,{className:`h-6 w-6`})}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`grok-glance`}),(0,F.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`Only enrolled devices get past this screen.`})]})]}),!p&&(0,F.jsx)(q,{status:`danger`,children:(0,F.jsxs)(q.Content,{children:[(0,F.jsx)(q.Title,{children:`This browser cannot do passkeys`}),(0,F.jsx)(q.Description,{children:`Open the dashboard in Safari or Chrome over https.`})]})}),m&&(0,F.jsx)(q,{status:`warning`,children:(0,F.jsxs)(q.Content,{children:[(0,F.jsx)(q.Title,{children:`Wrong hostname for this passkey`}),(0,F.jsxs)(q.Description,{children:[`You are on `,location.hostname,`, but the daemon expects `,e.rpId,`. Open that hostname instead, or run`,` `,(0,F.jsx)(`code`,{className:`font-mono text-xs`,children:`glance set-origin`}),`.`]})]})}),d&&(0,F.jsx)(q,{status:`danger`,children:(0,F.jsx)(q.Content,{children:(0,F.jsx)(q.Title,{children:d})})}),r?(0,F.jsxs)(G,{children:[(0,F.jsxs)(G.Header,{children:[(0,F.jsx)(G.Title,{children:`Enrol this device`}),(0,F.jsxs)(G.Description,{children:[`Run `,(0,F.jsx)(`code`,{className:`font-mono text-xs`,children:`glance enroll`}),` on the machine running Grok Build, then type the code it prints.`]})]}),(0,F.jsxs)(G.Content,{className:`flex flex-col gap-3`,children:[(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Enrolment code`}),(0,F.jsx)(Ll,{value:a,onChange:e=>o(e.target.value.toUpperCase()),placeholder:`ABCD2345`,autoComplete:`off`,autoCapitalize:`characters`,spellCheck:!1,inputMode:`text`,maxLength:12,"aria-label":`Enrolment code`,className:`font-mono tracking-[0.25em]`})]}),(0,F.jsxs)(`label`,{className:`flex flex-col gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name this device`}),(0,F.jsx)(Ll,{value:s,onChange:e=>c(e.target.value),placeholder:`iPhone`,maxLength:40,"aria-label":`Device name`})]})]}),(0,F.jsxs)(G.Footer,{className:`flex flex-col gap-2`,children:[(0,F.jsxs)(pl,{variant:`primary`,size:`lg`,fullWidth:!0,isDisabled:l||!p||a.trim().length<4,onPress:()=>h(()=>uu.enroll(a,s)),children:[l?(0,F.jsx)(Nl,{size:`sm`,color:`current`}):(0,F.jsx)(gu,{}),`Create passkey`]}),e.enrolled&&(0,F.jsx)(pl,{variant:`ghost`,size:`md`,fullWidth:!0,onPress:()=>i(!1),children:`I already have a passkey`})]})]}):(0,F.jsxs)(G,{children:[(0,F.jsxs)(G.Header,{children:[(0,F.jsx)(G.Title,{children:`Unlock`}),(0,F.jsx)(G.Description,{children:`Use the passkey on this device.`})]}),(0,F.jsxs)(G.Footer,{className:`flex flex-col gap-2`,children:[(0,F.jsxs)(pl,{variant:`primary`,size:`lg`,fullWidth:!0,isDisabled:l||!p,onPress:()=>h(()=>uu.signIn()),children:[l?(0,F.jsx)(Nl,{size:`sm`,color:`current`}):(0,F.jsx)(gu,{}),`Unlock with passkey`]}),(0,F.jsx)(pl,{variant:`ghost`,size:`md`,fullWidth:!0,onPress:()=>i(!0),children:`Enrol a new device`})]})]}),(0,F.jsxs)(`p`,{className:`text-center text-xs text-muted`,children:[`grok-glance `,e.version,e.rpId?` · ${e.rpId}`:``]})]})}var Tu=[{dot:`bg-sky-500`,text:`text-sky-600 dark:text-sky-400`},{dot:`bg-violet-500`,text:`text-violet-600 dark:text-violet-400`},{dot:`bg-emerald-500`,text:`text-emerald-600 dark:text-emerald-400`},{dot:`bg-amber-500`,text:`text-amber-600 dark:text-amber-400`},{dot:`bg-rose-500`,text:`text-rose-600 dark:text-rose-400`},{dot:`bg-cyan-500`,text:`text-cyan-600 dark:text-cyan-400`},{dot:`bg-fuchsia-500`,text:`text-fuchsia-600 dark:text-fuchsia-400`},{dot:`bg-lime-500`,text:`text-lime-600 dark:text-lime-400`}];function Eu(e){return Tu[Math.max(0,Math.floor(e)-1)%Tu.length]}function Du({badge:e,label:t,className:n=``}){let r=Eu(e);return(0,F.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5 ${n}`,children:[(0,F.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${r.dot}`,"aria-hidden":`true`}),(0,F.jsxs)(`span`,{className:`shrink-0 text-[11px] font-semibold tabular-nums ${r.text}`,children:[`#`,e]}),t!==void 0&&(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:t})]})}var Ou={working:{color:`accent`,label:`working`},waiting:{color:`warning`,label:`waiting on you`},idle:{color:`success`,label:`idle`},error:{color:`danger`,label:`error`},ended:{color:`default`,label:`ended`}};function ku({state:e,size:t=`sm`}){let{color:n,label:r}=Ou[e];return(0,F.jsx)(yl,{color:n,size:t,variant:`soft`,children:(0,F.jsx)(yl.Label,{children:r})})}function Au({tool:e}){return(0,F.jsx)(yl,{color:`default`,size:`sm`,variant:`tertiary`,children:(0,F.jsx)(yl.Label,{children:e})})}function ju(e,t){let n=Math.max(0,t-e),r=Math.round(n/1e3);if(r<5)return`now`;if(r<60)return`${r}s ago`;let i=Math.round(r/60);if(i<60)return`${i}m ago`;let a=Math.round(i/60);return a<24?`${a}h ago`:`${Math.round(a/24)}d ago`}function Mu(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function Nu(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(+(e<1e4))}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}function Pu(e,t){return Math.max(0,Math.ceil((e-t)/1e3))}function Fu({session:e,now:t,onBack:n}){let r=e.running;return(0,F.jsxs)(G,{children:[(0,F.jsx)(G.Header,{children:(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(G.Title,{className:`flex min-w-0 items-center gap-2 text-base`,children:(0,F.jsx)(Du,{badge:e.badge,label:e.label})}),(0,F.jsx)(G.Description,{className:`truncate text-xs`,children:e.cwd})]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1.5`,children:[(0,F.jsx)(ku,{state:e.state}),n&&(0,F.jsx)(pl,{size:`sm`,variant:`ghost`,onPress:n,children:`All agents`})]})]})}),(0,F.jsxs)(G.Content,{className:`flex flex-col gap-3`,children:[e.lastPrompt&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-[11px] font-medium tracking-wide text-muted uppercase`,children:`Last asked`}),(0,F.jsx)(`p`,{className:`mt-0.5 text-sm leading-snug break-words`,children:e.lastPrompt})]}),r.length>0?(0,F.jsx)(`div`,{className:`flex flex-col gap-2.5 rounded-xl bg-surface-secondary p-3`,children:r.map(e=>(0,F.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,F.jsx)(Nl,{size:`sm`,color:`current`,className:`mt-0.5`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(Au,{tool:e.name}),(0,F.jsx)(`span`,{className:`text-xs tabular-nums text-muted`,children:Nu(Math.max(0,t-e.startedAt))})]}),(0,F.jsx)(`p`,{className:`mt-1 text-sm leading-snug break-words`,children:e.title})]})]},`${e.name}-${e.startedAt}`))}):(0,F.jsxs)(`p`,{className:`text-sm text-muted`,children:[`Nothing running · last activity `,ju(e.lastActivity,t)]})]}),(0,F.jsx)(G.Footer,{children:(0,F.jsxs)(`dl`,{className:`grid w-full grid-cols-3 gap-2 text-center`,children:[(0,F.jsx)(Iu,{label:`tools`,value:e.counts.tools}),(0,F.jsx)(Iu,{label:`failed`,value:e.counts.failures,tone:e.counts.failures>0}),(0,F.jsx)(Iu,{label:`denied`,value:e.counts.denials,tone:e.counts.denials>0})]})})]})}function Iu({label:e,value:t,tone:n}){return(0,F.jsxs)(`div`,{className:`rounded-lg bg-surface-secondary py-2`,children:[(0,F.jsx)(`dd`,{className:`text-lg leading-none font-semibold tabular-nums ${n?`text-danger`:``}`,children:t}),(0,F.jsx)(`dt`,{className:`mt-1 text-[11px] tracking-wide text-muted uppercase`,children:e})]})}function Lu({approval:e,now:t,busy:n,onResolve:r}){let i=Pu(e.expiresAt,t),a=Math.max(1,e.expiresAt-e.createdAt),o=Math.max(0,Math.min(1,(e.expiresAt-t)/a));return(0,F.jsxs)(G,{className:`border-warning/60`,children:[(0,F.jsxs)(G.Header,{children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(G.Title,{className:`text-base`,children:`Waiting on you`}),(0,F.jsxs)(`span`,{className:`text-xs tabular-nums text-muted`,children:[i,`s`]})]}),(0,F.jsxs)(G.Description,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,F.jsx)(Au,{tool:e.tool}),(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:`in`}),(0,F.jsx)(Du,{badge:e.sessionBadge,label:e.sessionLabel,className:`text-xs text-muted`})]})]}),(0,F.jsxs)(G.Content,{className:`flex flex-col gap-2`,children:[(0,F.jsx)(`p`,{className:`text-sm leading-snug break-words`,children:e.title}),e.detail&&(0,F.jsx)(`pre`,{className:`max-h-32 overflow-auto rounded-lg bg-surface-secondary p-2.5 font-mono text-xs leading-relaxed whitespace-pre-wrap break-all text-surface-secondary-foreground`,children:e.detail}),(0,F.jsx)(`div`,{className:`h-1 w-full overflow-hidden rounded-full bg-surface-secondary`,children:(0,F.jsx)(`div`,{className:`h-full rounded-full bg-warning transition-[width] duration-1000 ease-linear`,style:{width:`${o*100}%`}})})]}),(0,F.jsxs)(G.Footer,{className:`grid grid-cols-2 gap-2`,children:[(0,F.jsxs)(pl,{variant:`danger-soft`,size:`lg`,isDisabled:n,onPress:()=>r(e.id,`deny`),children:[(0,F.jsx)(yu,{}),`Deny`]}),(0,F.jsxs)(pl,{variant:`primary`,size:`lg`,isDisabled:n,onPress:()=>r(e.id,`allow`),children:[(0,F.jsx)(vu,{}),`Approve`]})]})]})}function Ru({sessions:e,selectedId:t,onSelect:n,now:r}){let[i,a]=(0,D.useState)(!1),o=e.filter(e=>e.state!==`ended`),s=e.filter(e=>e.state===`ended`),c=i?[...o,...s]:o;return(0,F.jsxs)(G,{children:[(0,F.jsxs)(G.Header,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(G.Title,{className:`text-base`,children:`Agents`}),(0,F.jsxs)(`span`,{className:`text-xs text-muted`,children:[o.length,` live`]})]}),(0,F.jsx)(G.Description,{className:`text-xs`,children:`Tap one for its detail and its own activity.`})]}),(0,F.jsx)(G.Content,{className:`px-0`,children:(0,F.jsxs)(`ul`,{className:`flex flex-col`,children:[(0,F.jsx)(`li`,{className:`border-b border-separator`,children:(0,F.jsxs)(Bu,{active:t===null,onPress:()=>n(null),children:[(0,F.jsx)(`span`,{className:`flex-1 text-sm`,children:`All agents`}),(0,F.jsx)(`span`,{className:`text-xs text-muted`,children:e.length})]})}),c.map(e=>(0,F.jsx)(`li`,{className:`border-b border-separator last:border-b-0`,children:(0,F.jsx)(Bu,{active:t===e.id,onPress:()=>n(e.id===t?null:e.id),children:(0,F.jsx)(zu,{session:e,now:r})})},e.id))]})}),s.length>0&&(0,F.jsx)(G.Footer,{children:(0,F.jsx)(`button`,{type:`button`,className:`w-full text-center text-xs text-muted`,onClick:()=>a(e=>!e),children:i?`Hide ended`:`Show ${s.length} ended session${s.length===1?``:`s`}`})})]})}function zu({session:e,now:t}){let[n,...r]=e.running,{tools:i,failures:a,denials:o}=e.counts;return(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(Du,{badge:e.badge,label:e.label,className:`flex-1 text-sm`}),(0,F.jsx)(ku,{state:e.state})]}),n?(0,F.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5 text-xs`,children:[(0,F.jsx)(`span`,{className:`shrink-0 font-medium`,children:n.name}),(0,F.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted`,children:Nu(Math.max(0,t-n.startedAt))}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted`,children:n.title}),r.length>0&&(0,F.jsxs)(`span`,{className:`shrink-0 text-muted`,children:[`+`,r.length]})]}):e.lastPrompt&&(0,F.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted`,children:e.lastPrompt}),(0,F.jsxs)(`span`,{className:`flex items-baseline gap-2 text-[11px] text-muted`,children:[(0,F.jsxs)(`span`,{className:`tabular-nums`,children:[i,` tools`]}),a>0&&(0,F.jsxs)(`span`,{className:`tabular-nums text-danger`,children:[a,` failed`]}),o>0&&(0,F.jsxs)(`span`,{className:`tabular-nums text-danger`,children:[o,` denied`]}),(0,F.jsx)(`span`,{className:`ml-auto tabular-nums`,children:ju(e.lastActivity,t)})]})]})}function Bu({active:e,onPress:t,children:n}){return(0,F.jsx)(`button`,{type:`button`,onClick:t,"aria-pressed":e,className:`flex w-full items-center gap-2 px-4 py-3 text-left transition-colors ${e?`bg-surface-secondary`:`hover:bg-surface-hover`}`,children:n})}var Vu=[{value:`off`,label:`Off`,hint:`Grok Build never waits for you.`},{value:`risky`,label:`Risky`,hint:`Shell commands and file writes need a tap.`},{value:`all`,label:`All`,hint:`Every tool call needs a tap. Noisy.`}];function Hu({approval:e,deviceLabel:t,version:n,theme:r,onToggleTheme:i,onSignedOut:a}){let[o,s]=(0,D.useState)(e),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)(null),[f,p]=(0,D.useState)(``);(0,D.useEffect)(()=>s(e),[e]),(0,D.useEffect)(()=>{uu.devices().then(e=>{d(e.devices),p(e.current)},()=>d([]))},[]);async function m(e){l(null);let t=o;s({...o,...e});try{s(await uu.setApproval(e))}catch(e){s(t),l(e.message)}}let h=Vu.find(e=>e.value===o.mode)?.hint;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[c&&(0,F.jsx)(q,{status:`danger`,children:(0,F.jsx)(q.Content,{children:(0,F.jsx)(q.Title,{children:c})})}),(0,F.jsxs)(G,{children:[(0,F.jsxs)(G.Header,{children:[(0,F.jsx)(G.Title,{className:`text-base`,children:`Remote approval`}),(0,F.jsx)(G.Description,{className:`text-xs`,children:`Which tool calls should pause and wait for a tap on this phone.`})]}),(0,F.jsxs)(G.Content,{className:`flex flex-col gap-3`,children:[(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:Vu.map(e=>(0,F.jsx)(pl,{size:`md`,variant:o.mode===e.value?`primary`:`outline`,onPress:()=>m({mode:e.value}),children:e.label},e.value))}),h&&(0,F.jsx)(`p`,{className:`text-xs text-muted`,children:h}),(0,F.jsx)(Uu,{label:`Only when a phone is watching`,hint:`Off means a tool call can wait even with nobody looking at this page.`,value:o.requireWatcher,onChange:e=>m({requireWatcher:e})}),(0,F.jsx)(Uu,{label:`Deny if nobody answers`,hint:`Otherwise it is allowed after ${Math.round(o.timeoutMs/1e3)}s.`,value:o.onTimeout===`deny`,onChange:e=>m({onTimeout:e?`deny`:`allow`})}),o.mode!==`off`&&(0,F.jsxs)(`p`,{className:`font-mono text-[11px] break-all text-muted`,children:[`risky pattern: `,o.riskyPattern]})]})]}),(0,F.jsxs)(G,{children:[(0,F.jsxs)(G.Header,{children:[(0,F.jsx)(G.Title,{className:`text-base`,children:`Devices`}),(0,F.jsxs)(G.Description,{className:`text-xs`,children:[`Revoke from the terminal with `,(0,F.jsx)(`code`,{className:`font-mono`,children:`glance revoke `}),`.`]})]}),(0,F.jsx)(G.Content,{className:`px-0`,children:u===null?(0,F.jsx)(`p`,{className:`px-4 text-sm text-muted`,children:`Loading…`}):(0,F.jsx)(`ul`,{className:`flex flex-col`,children:u.map(e=>(0,F.jsxs)(`li`,{className:`flex items-center justify-between gap-2 border-t border-separator px-4 py-2.5 first:border-t-0`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsxs)(`p`,{className:`truncate text-sm`,children:[e.label,e.id===f&&(0,F.jsx)(`span`,{className:`ml-1.5 text-[11px] text-muted`,children:`(this one)`})]}),(0,F.jsxs)(`p`,{className:`font-mono text-[11px] text-muted`,children:[e.id.slice(0,16),`…`]})]}),(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:new Date(e.createdAt).toLocaleDateString()})]},e.id))})})]}),(0,F.jsx)(G,{children:(0,F.jsxs)(G.Content,{className:`flex flex-col gap-2`,children:[(0,F.jsxs)(pl,{variant:`outline`,size:`md`,fullWidth:!0,onPress:i,children:[r===`dark`?(0,F.jsx)(bu,{}):(0,F.jsx)(xu,{}),r===`dark`?`Light mode`:`Dark mode`]}),(0,F.jsxs)(pl,{variant:`danger-soft`,size:`md`,fullWidth:!0,onPress:()=>uu.logout().then(a,a),children:[`Sign out `,t?`(${t})`:``]}),(0,F.jsxs)(`p`,{className:`pt-1 text-center text-xs text-muted`,children:[`grok-glance `,n]})]})})]})}function Uu({label:e,hint:t,value:n,onChange:r}){return(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`p`,{className:`text-sm`,children:e}),(0,F.jsx)(`p`,{className:`text-xs text-muted`,children:t})]}),(0,F.jsx)(pl,{size:`sm`,variant:n?`primary`:`outline`,onPress:()=>r(!n),"aria-pressed":n,children:n?`On`:`Off`})]})}var Q={session_start:`bg-muted`,session_end:`bg-muted`,prompt:`bg-accent`,tool_start:`bg-muted`,tool_end:`bg-success`,tool_fail:`bg-danger`,permission_denied:`bg-danger`,turn_end:`bg-accent`,turn_error:`bg-danger`,notification:`bg-warning`,subagent_start:`bg-muted`,subagent_end:`bg-muted`,compact:`bg-muted`,approval_request:`bg-warning`,approval_allowed:`bg-success`,approval_denied:`bg-danger`,approval_expired:`bg-warning`},Wu=40;function Gu(e,t){return e.filter(e=>e.kind!==`tool_start`&&(t===null||e.sessionId===t))}function Ku({events:e,sessionId:t,sessions:n,onClearFilter:r}){let[i,a]=(0,D.useState)(Wu),o=Gu(e,t),s=o.slice(0,i),c=t?n.find(e=>e.id===t):void 0,l=n.length>1&&!t?new Map(n.map(e=>[e.id,e])):null;return(0,F.jsxs)(G,{children:[(0,F.jsxs)(G.Header,{children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(G.Title,{className:`text-base`,children:`Activity`}),t&&r&&(0,F.jsx)(`button`,{type:`button`,className:`text-xs text-accent`,onClick:r,children:`Show all`})]}),(0,F.jsxs)(G.Description,{className:`flex items-center gap-1.5 text-xs`,children:[c&&(0,F.jsx)(Du,{badge:c.badge,label:c.label}),(0,F.jsx)(`span`,{children:o.length===0?`Nothing yet.`:`${o.length} events`})]})]}),(0,F.jsx)(G.Content,{className:`px-0`,children:(0,F.jsx)(`ol`,{className:`flex flex-col`,children:s.map(e=>(0,F.jsxs)(`li`,{className:`flex gap-2.5 border-t border-separator px-4 py-2.5 first:border-t-0`,children:[(0,F.jsx)(`span`,{className:`mt-1.5 h-2 w-2 shrink-0 rounded-full ${Q[e.kind]??`bg-muted`}`,"aria-hidden":`true`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,F.jsx)(`p`,{className:`min-w-0 text-sm leading-snug break-words`,children:e.title}),(0,F.jsxs)(`span`,{className:`flex shrink-0 items-baseline gap-1.5 text-[11px] tabular-nums text-muted`,children:[l?.get(e.sessionId)&&(0,F.jsx)(Du,{badge:l.get(e.sessionId).badge}),Mu(e.ts)]})]}),e.detail&&(0,F.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] leading-relaxed break-all text-muted`,children:e.detail}),e.durationMs!==void 0&&(0,F.jsxs)(`p`,{className:`mt-0.5 text-[11px] tabular-nums text-muted`,children:[`took `,Nu(e.durationMs)]})]})]},e.id))})}),o.length>s.length&&(0,F.jsx)(G.Footer,{children:(0,F.jsxs)(pl,{variant:`ghost`,size:`sm`,fullWidth:!0,onPress:()=>a(i+Wu),children:[`Show `,Math.min(Wu,o.length-s.length),` older`]})})]})}function qu(){let[e,t]=(0,D.useState)(null),[n,r]=(0,D.useState)(null),{resolvedTheme:i,setTheme:a}=Hl(),[o,s]=(0,D.useState)(!1),[c,l]=(0,D.useState)(null),[u,d]=(0,D.useState)([]),f=(0,D.useCallback)(async()=>{try{t(await uu.gate()),r(null)}catch(e){r(e.message)}},[]);(0,D.useEffect)(()=>{f()},[f]);let p=!!e?.authenticated,{snapshot:m,connection:h}=fu(p),g=pu(1e3);(0,D.useEffect)(()=>{if(!p||h!==`offline`)return;let e=window.setTimeout(()=>void f(),3e3);return()=>window.clearTimeout(e)},[p,h,f]);async function _(e,t){d(t=>[...t,e]);try{await uu.resolveApproval(e,t)}catch{}finally{d(t=>t.filter(t=>t!==e))}}if(n&&!e)return(0,F.jsxs)(Xu,{children:[(0,F.jsx)(q,{status:`danger`,children:(0,F.jsxs)(q.Content,{children:[(0,F.jsx)(q.Title,{children:`Cannot reach the daemon`}),(0,F.jsx)(q.Description,{children:n})]})}),(0,F.jsx)(pl,{variant:`outline`,size:`md`,fullWidth:!0,onPress:()=>void f(),children:`Try again`})]});if(!e)return(0,F.jsx)(Xu,{children:(0,F.jsx)(Nl,{size:`lg`,color:`current`})});if(!p)return(0,F.jsx)(wu,{gate:e,onSignedIn:()=>void f()});let v=m?.sessions??[],y=m?.pending??[],b=v.find(e=>e.id===c)??(v.length===1?v[0]:void 0),x=v.length>1;return(0,F.jsxs)(`div`,{className:`min-h-dvh bg-background text-foreground`,children:[(0,F.jsx)(`header`,{className:`sticky top-0 z-10 border-b border-separator bg-background/85 backdrop-blur-md`,children:(0,F.jsxs)(`div`,{className:`mx-auto flex max-w-md items-center gap-3 px-4 pt-[max(0.75rem,env(safe-area-inset-top))] pb-3`,children:[(0,F.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${h===`live`?`bg-success`:h===`connecting`?`bg-warning`:`bg-danger`}`,"aria-hidden":`true`}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h1`,{className:`truncate text-sm font-semibold tracking-tight`,children:`grok-glance`}),(0,F.jsx)(`p`,{className:`text-[11px] text-muted`,children:h===`live`?Yu(v):h===`connecting`?`connecting…`:`offline — retrying`})]}),(0,F.jsx)(pl,{size:`sm`,variant:o?`primary`:`ghost`,isIconOnly:!0,"aria-label":`Settings`,onPress:()=>s(e=>!e),children:(0,F.jsx)(_u,{})})]})}),(0,F.jsxs)(`main`,{className:`mx-auto flex max-w-md flex-col gap-3 px-4 py-4 pb-[max(1.5rem,env(safe-area-inset-bottom))]`,children:[y.map(e=>(0,F.jsx)(Lu,{approval:e,now:g,busy:u.includes(e.id),onResolve:_},e.id)),o&&m&&(0,F.jsx)(Hu,{approval:m.approval,deviceLabel:e.deviceLabel,version:m.version,theme:i===`dark`?`dark`:`light`,onToggleTheme:()=>a(i===`dark`?`light`:`dark`),onSignedOut:()=>void f()}),m?v.length===0?(0,F.jsx)(G,{children:(0,F.jsxs)(G.Header,{children:[(0,F.jsx)(G.Title,{className:`text-base`,children:`Nothing to show yet`}),(0,F.jsx)(G.Description,{children:`Start Grok Build in a workspace and this page will fill in as it works.`})]})}):(0,F.jsxs)(F.Fragment,{children:[b&&(0,F.jsx)(Fu,{session:b,now:g,onBack:x?()=>l(null):void 0}),x&&(0,F.jsx)(Ru,{sessions:v,selectedId:c,onSelect:l,now:g}),(0,F.jsx)(Ku,{events:m.events,sessionId:c,sessions:v,onClearFilter:()=>l(null)})]}):(0,F.jsx)(Xu,{inline:!0,children:(0,F.jsx)(Nl,{size:`lg`,color:`current`})})]})]})}var Ju=[[`waiting`,`waiting`],[`error`,`error`],[`working`,`working`],[`idle`,`idle`],[`ended`,`ended`]];function Yu(e){if(e.length===0)return`no sessions yet`;let t=new Map;for(let n of e)t.set(n.state,(t.get(n.state)??0)+1);return Ju.filter(([e])=>t.get(e)).map(([e,n])=>`${t.get(e)} ${n}`).join(` · `)}function Xu({children:e,inline:t}){return(0,F.jsx)(`div`,{className:`mx-auto flex w-full max-w-sm flex-col items-center justify-center gap-4 px-5 ${t?`py-16`:`min-h-dvh`}`,children:e})}var Zu=document.getElementById(`root`);if(!Zu)throw Error(`missing #root`);(0,Ul.createRoot)(Zu).render((0,F.jsx)(D.StrictMode,{children:(0,F.jsx)(qu,{})})); \ No newline at end of file diff --git a/dist/web/icon.svg b/dist/web/icon.svg new file mode 100644 index 0000000..d58587d --- /dev/null +++ b/dist/web/icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/dist/web/index.html b/dist/web/index.html new file mode 100644 index 0000000..3e64e66 --- /dev/null +++ b/dist/web/index.html @@ -0,0 +1,22 @@ + + + + + + + + + + grok-glance + + + + + + + + + +
+ + diff --git a/dist/web/manifest.webmanifest b/dist/web/manifest.webmanifest new file mode 100644 index 0000000..e0daaa0 --- /dev/null +++ b/dist/web/manifest.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "grok-glance", + "short_name": "glance", + "description": "Glance at what Grok Build is doing.", + "start_url": "/", + "scope": "/", + "display": "standalone", + "orientation": "portrait", + "background_color": "#09090b", + "theme_color": "#09090b", + "icons": [ + { + "src": "/icon.svg", + "sizes": "any", + "type": "image/svg+xml", + "purpose": "any" + } + ] +} diff --git a/package-lock.json b/package-lock.json index f9791f4..70570b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@vitejs/plugin-react": "6.0.2", + "rolldown": "1.0.3", "tailwind-variants": "3.3.0", "tailwindcss": "4.3.1", "typescript": "5.6.3", diff --git a/package.json b/package.json index 7112813..cfbd704 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,12 @@ }, "scripts": { "build": "npm run build:server && npm run build:web", - "build:server": "tsc -p tsconfig.server.json", + "build:server": "tsc -p tsconfig.server.json && rolldown server/src/index.ts -o dist/server/index.js -f esm -p node", "build:web": "tsc -p tsconfig.web.json && vite build", "dev": "vite", "start": "node dist/server/index.js", - "glance": "node bin/glance" + "glance": "node bin/glance", + "check:dist": "npm run build && test -z \"$(git status --porcelain dist)\"" }, "dependencies": { "@heroui/react": "3.2.4", @@ -29,6 +30,7 @@ "@types/react": "^19.0.0", "@types/react-dom": "^19.0.0", "@vitejs/plugin-react": "6.0.2", + "rolldown": "1.0.3", "tailwind-variants": "3.3.0", "tailwindcss": "4.3.1", "typescript": "5.6.3", diff --git a/server/src/index.ts b/server/src/index.ts index be2aa94..2a148ec 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -18,7 +18,6 @@ import http from "node:http"; import crypto from "node:crypto"; import { URL } from "node:url"; import { - DEFAULT_PORT, VERSION, deriveRpId, ensureHome, @@ -564,8 +563,9 @@ server.listen(cfg.port, cfg.host, () => { console.log(`[glance] state: ${paths.home}`); console.log(`[glance] origin: ${cfg.origin ?? "(none set - see README)"} rpId: ${cfg.rpId ?? "localhost"}`); console.log(`[glance] accepts assertions from: ${expectedOrigins(cfg).join(", ")}`); - if (!webBuildExists()) console.log("[glance] web app not built yet: npm install && npm run build"); - if (cfg.port !== DEFAULT_PORT) console.log(`[glance] note: non-default port, run \`glance sync-hooks\``); + // dist/ is committed, so this only fires for a developer who deleted it. Nothing warns about a + // non-default port any more: the hook scripts read config.json themselves. + if (!webBuildExists()) console.log("[glance] web app missing from dist/: npm install && npm run build"); }); server.on("error", (err) => { diff --git a/server/src/static.ts b/server/src/static.ts index 8f2c8d9..dd74436 100644 --- a/server/src/static.ts +++ b/server/src/static.ts @@ -32,7 +32,7 @@ export function webBuildExists(): boolean { export function serveStatic(urlPath: string, res: ServerResponse): void { if (!webBuildExists()) { res.writeHead(503, { ...SECURITY_HEADERS, "content-type": "text/plain; charset=utf-8" }); - res.end("grok-glance: web app not built yet. Run `npm install && npm run build`.\n"); + res.end("grok-glance: dist/web is missing. Run `npm install && npm run build`.\n"); return; } diff --git a/skills/glance/SKILL.md b/skills/glance/SKILL.md index a5965a2..3b720c2 100644 --- a/skills/glance/SKILL.md +++ b/skills/glance/SKILL.md @@ -14,16 +14,12 @@ same dashboard — no per-session setup. The daemon is started automatically by the `SessionStart` hook. Everything below is done through the `glance` CLI at `$GROK_PLUGIN_ROOT/bin/glance`. -## First check whether it is even built +## No build step -The plugin ships as TypeScript and must be built once: - -```sh -cd "$GROK_PLUGIN_ROOT" && npm install && npm run build -``` - -`glance status` prints a "not built" error with this same instruction if it is missing. Do not -attempt to skip the build — the daemon entry point is `dist/server/index.js`. +The plugin ships prebuilt: `dist/` is committed, and the daemon is a single dependency-free +bundle. A clone is ready to run. Only reach for `npm install && npm run build` in +`$GROK_PLUGIN_ROOT` if `glance status` actually says it is not built, which means `dist/` was +deleted from the checkout. ## The commands @@ -99,7 +95,8 @@ and wait for a tap on the phone. Defaults that matter: secret in `$GLANCE_HOME/hook.secret` no longer matches the one the daemon loaded (events are being dropped with a 403); `glance stop && glance up` fixes that. Otherwise check that `hooks/hooks.json` exists and that the plugin is registered with Grok Build. -- **Page says "run npm install && npm run build"** → the web bundle is missing; build it. +- **Page says "run npm install && npm run build"** → `dist/web` is missing from the checkout, + which should not happen in a clone. Re-clone, or build it. - **Only one agent shows up** → the others were started before the plugin was installed, or in an environment where the hooks are not registered. A session appears on its next hook event; nothing can be back-filled for one that already ran. diff --git a/tsconfig.server.json b/tsconfig.server.json index 005eeb8..79d3212 100644 --- a/tsconfig.server.json +++ b/tsconfig.server.json @@ -5,8 +5,7 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "types": ["node"], - "outDir": "dist/server", - "rootDir": "server/src", + "noEmit": true, "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, @@ -15,8 +14,7 @@ "skipLibCheck": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "declaration": false, - "sourceMap": true + "declaration": false }, "include": ["server/src"] }