diff --git a/architecture/overview.md b/architecture/overview.md
index 2b200d2..baecd63 100644
--- a/architecture/overview.md
+++ b/architecture/overview.md
@@ -47,7 +47,7 @@ flowchart LR
srv --> store
srv --> meta
eng -->|"scan: warn, never hold"| sec
- srv -->|"share mint: refuse"| sec
+ srv -->|"share mint: refuse · markdown render: badge"| sec
cli -->|"init --template: seed locally"| tpl
srv -->|"POST /api/projects template: seed as ops under the hub's device"| tpl
fe -->|/api/config, /api/projects, viewer APIs| srv
diff --git a/architecture/webapp-frontend.md b/architecture/webapp-frontend.md
index e602244..8ff87d6 100644
--- a/architecture/webapp-frontend.md
+++ b/architecture/webapp-frontend.md
@@ -100,6 +100,7 @@ classDiagram
note for components "HistoryFilters drives the SERVER (?q=/?user=/?since=/?until= on the history API), never the loaded page — filtering what is on screen would lie about everything below the fold and break next_cursor. Its state is Route.filters, so a narrowed feed is linkable, survives reload, and Back undoes it; the author list accumulates across fetches, because filtering by one author leaves only their rows loaded"
note for components "FileView's transformHTML resolves the server's `wiki:` marker against flatFiles into a real urlForPath() href (unresolvable ones lose the href and get .wiki-missing), so copy-link/middle-click/new-tab work and only a plain click reaches the delegated handler — resolution used to happen at click time, which left a dead `wiki:guide` string in the DOM (BEA-136). It also drops `data:image/svg` from any rendered img and any `data:` href from any rendered link — goldmark admits them, and an inline SVG is a document rather than a picture (the same property the server's sandboxInline walls off). Insights builds its per-device folder bag with Object.create(null), since folder names come off a peer's journal and one named __proto__ silently emptied the matrix. style.css sets unicode-bidi isolate-override on the peer-authored strings a reader is expected to CHECK (listing rows, breadcrumb, history path/note/device) — journal.SafeText refuses the bidi CONTROLS, but a single strong-RTL LETTER is legal and still reorders a row"
note for components "HistoryView's RunGroup header carries the run-wide undo (POST undo-run, gated by the same write permission as the per-row restore/remove). It asks the SERVER for the file list first (preview: true) rather than deriving it from the loaded feed — that window is paged and filterable, so a client-computed list is wrong exactly when the run is old. modal.tsx's Confirm.message widened from string to ReactNode for it (the prompt's one-field API is untouched), so the dialog can show every path, its action, and the "changed after this run" warning inline"
+ note for components "FileView's MarkdownView renders SecretBadge above the content when the render response carries findings — VersionBanner's shape (a strip, role=status, no actions), the red family rather than the accent because accent+glow already means 'you are looking at an old version' and the two strips stack on the ?sha= view. It phrases from lib/secrets so the badge and the share dialog name the rule and the line identically"
note for components "components/ui — shadcn/ui primitives (Radix, copied in), themed from BearDrive tokens in tw.css; rendered markdown is transformed as a string before mounting, link clicks delegated on the container — never patch the dangerouslySetInnerHTML subtree"
class lib {
@@ -114,11 +115,13 @@ classDiagram
+conflict.ts parseConflict Conflict
+sniff.ts sniffBytes BlobText MAX_BYTES
+csv.ts parseDelimited Csv CSV_ROWS
+ +secrets.ts SecretFinding secretsMessage secretsBadge
+mermaid.ts hasMermaid renderMermaid Palette DARK LIGHT
+utils.ts
}
note for lib "mermaid.ts is the one exception to 'pure, no React, unit-tested on node': it needs a DOM and a browser-only library, so its coverage is Playwright. html in → html out, so neither caller can be tempted to patch a live subtree. It imports mermaid only when hasMermaid() says a document has a fence — that gate is what keeps a diagram-free page from downloading any of it — and every failure (unparseable fence, render throw, chunk that never loads) returns the untouched <pre><code> instead of throwing"
note for lib "pure, no React, unit-tested on node (npm test) — the line diff is ~40 lines, cheaper than auditing a diff package. heat.ts is the one read-count arithmetic: every surface (file header, folder listing, Dashboard bar) totals and splits through it, so they cannot disagree; useBrowse re-exports it. HEAT_DISCLOSURE sits beside that arithmetic for the same reason: a member's own views count toward the number, and four surfaces printing their own copy of that promise is four promises that can drift (BEA-61). The constant is NOT re-exported through useBrowse — surfaces import it straight from lib/heat, and a unit test asserts src/ holds exactly one copy of the sentence. The hot-and-stale VERDICT joined the totals for the same reason (BEA-119): HOT_READS/STALE_DAYS/isDanger were private to Insights.tsx, so the Dashboard was the only screen that could say a doc was hot and unmaintained — the file page and the folder listing showed the ingredients and no verdict. isDanger takes (reads, days) rather than a heat entry because only the Dashboard has a reader lens: it passes its lens-filtered count, the other two pass heatTotal. staleNote returns a STRING (empty when not flagged) so the badge stays pure and survives whichever component owns the meta line"
+ note for lib "secrets.ts is the six credential rules in words, mirroring internal/secrets' Label map. It lived in Browser.tsx under a comment saying one caller did not justify a file; BEA-147 gave it a second one, and the two callers are the two surfaces that report the SAME finding — the share dialog that refuses to mint, and FileView's badge that only warns. One map is what makes 'wording consistent with the share dialog' mechanical rather than a copy-editing promise"
note for lib "conflict.ts recognises a conflict copy from its NAME alone — syncer.conflictName is a pure function of the path, so the device and the moment come out of the string with no server route, no journal field and no request. The regex is an ANCHORED suffix and a strictly narrower match of the Go convention (sanitize's character class, clip's 32), and every mismatch — truncated suffix, impossible date — is null rather than a throw, so a stray filename can never break a listing. Two callers: FolderListing marks the row, ConflictBanner explains the file (BEA-128)"
note for lib "csv.ts parses .csv/.tsv for FileView's table view — ~50 lines against RFC 4180, so no papaparse. It NEVER throws: null means 'not a table' (unterminated quote, no delimiter) and the caller falls back to the plain-text preview, which is why the fallback is a type-level guarantee rather than a try/catch someone can forget"
@@ -133,7 +136,8 @@ classDiagram
Browser --> components
HubApp --> components
components --> nav : linkProps navigate
- components --> lib : diffText groupRuns hotPathSplit placeLabels staleNote isDanger parseDelimited renderMermaid parseConflict
+ components --> lib : diffText groupRuns hotPathSplit placeLabels staleNote isDanger parseDelimited renderMermaid parseConflict secretsBadge
+ Browser --> lib : secretsMessage (the share dialog's half of lib/secrets)
hooks --> lib : re-exports heat.ts, sniffBytes
shareMermaid --> lib : renderMermaid
hooks --> api
diff --git a/architecture/webapp-server.md b/architecture/webapp-server.md
index b7924de..87ec4f9 100644
--- a/architecture/webapp-server.md
+++ b/architecture/webapp-server.md
@@ -293,8 +293,15 @@ classDiagram
+Rule string
+Line int
}
- note for secretScan "No longer a webapp file: internal/secrets is stdlib-only so internal/syncer can run the SAME rules on the path every file takes (the sync scan, warn-only — see cli-sync.md). The rule ids are a wire contract, keyed off by Browser.tsx's SECRET_LABELS and now by Label, whose test asserts it covers every rule"
+ class renderFindings {
+ <>
+ +renderFindings(src) []Finding
+ caps at ScanLimit, then Scan
+ findings on the render response, omitted when empty
+ }
+ note for secretScan "No longer a webapp file: internal/secrets is stdlib-only so internal/syncer can run the SAME rules on the path every file takes (the sync scan, warn-only — see cli-sync.md). The rule ids are a wire contract, keyed off by lib/secrets.ts's SECRET_LABELS and by Label, whose test asserts it covers every rule"
note for secretScan "Mint-time gate on handleShareCreate: the one place a member turns private bytes into a public URL is the one place the bytes are read first. It returns rule ids and LINE NUMBERS only — the matched text never reaches a response body, a log line, or a metric label, the same rule ReadLedger keeps for actor identity. Bypassed by confirm:true (bdrive share --force, the UI's Share anyway) and by Server.alreadyPublic, since a path that already has a live link is public already. Fails CLOSED: an unreadable blob is 503, not a silent pass"
+ note for renderFindings "The SECOND caller, and the reason the gate is no longer the only one (BEA-147): minting is the rarest path in the product, so a hub that could name an AWS key on line 3 well enough to refuse to publish a file rendered that same key to every member as prose. handleRender and renderVersion already hold the bytes RenderMarkdown needs, so the cap is a slice rather than the LimitReader the two streaming callers use — same ScanLimit, so the badge and the share dialog can never disagree about one file. Advisory: findings ride along on the render response (omitted when empty), nothing is blocked and nothing is redacted, because a member who can open the file could already read the key"
class sandboxInline {
<>
@@ -426,6 +433,8 @@ classDiagram
reservations ..> QuotaProvider : CheckWrite(size + outstanding), RecordUsage on landing
ShareDB ..> QuotaProvider : CheckRead before the stream, RecordEgress after
Server ..> secretScan : handleShareCreate scans the first 1 MiB unless confirmed or alreadyPublic
+ Server ..> renderFindings : handleRender + renderVersion, every markdown view
+ renderFindings ..> secretScan
secretScan ..> secretFinding
Server ..> countingWriter : every bytes-out route that bills
Server ..> wireCodec : gzip on /store/ GET+list, inflate above spool on PUT
diff --git a/internal/webapp/frontend/e2e/browse.spec.ts b/internal/webapp/frontend/e2e/browse.spec.ts
index 83cbaa3..44a370c 100644
--- a/internal/webapp/frontend/e2e/browse.spec.ts
+++ b/internal/webapp/frontend/e2e/browse.spec.ts
@@ -265,6 +265,29 @@ test("share mints a public link that serves the file, revoke kills it", async ({
expect(gone.status()).toBe(404);
});
+// BEA-147: the same finding the share dialog names, on the path every file
+// takes — the viewer used to render the key as ordinary prose.
+test("a file holding a key carries a badge in the file view", async ({ page }) => {
+ await login(page);
+ const pid = await wikiId(page);
+ await page.goto(`/${pid}/deploy.md`);
+
+ const badge = page.locator(".sbadge");
+ await expect(badge).toBeVisible();
+ // Same rule, same line, same words as the share dialog's modal below.
+ await expect(badge).toContainText("an AWS access key (line 3)");
+ // Advisory: the file still renders in full, nothing is redacted.
+ await expect(page.locator("#content h1")).toHaveText("Deploy");
+ await expect(page.locator("#content")).toContainText("AWS_ACCESS_KEY_ID");
+ // The badge itself must never echo the thing it found.
+ await expect(badge).not.toContainText("AKIA");
+
+ // A clean file gets no badge at all.
+ await page.goto(`/${pid}/index.md`);
+ await expect(page.locator("#content h1")).toHaveText("Wiki");
+ await expect(page.locator(".sbadge")).toHaveCount(0);
+});
+
// BEA-111: sharing a file that looks like it holds credentials asks first.
// Cancel mints nothing; Share anyway mints the link it would have.
test("share on a file holding a key asks before it mints, and Cancel mints nothing", async ({
diff --git a/internal/webapp/frontend/src/api/types.ts b/internal/webapp/frontend/src/api/types.ts
index b8bee85..db0933b 100644
--- a/internal/webapp/frontend/src/api/types.ts
+++ b/internal/webapp/frontend/src/api/types.ts
@@ -3,6 +3,8 @@
// The API is deliberately storage-blind: nothing here ever names a bucket,
// remote URL, or credential, and heat responses carry no actor identities.
+import type { SecretFinding } from "../lib/secrets";
+
// GET /api/config (handleConfig, server.go)
export interface ServerConfig {
mode: "volume" | "hub";
@@ -154,6 +156,10 @@ export interface RenderDoc {
user_name?: string;
author?: string;
device?: string;
+ // The share gate's credential scan, run on the render path too (BEA-147).
+ // Omitted by the server when the file is clean, so a truthiness test is
+ // the whole check. Rule ids and line numbers only — never the matched text.
+ findings?: SecretFinding[];
}
// GET .../heat (handleHeat, reads.go) — counts only, never who.
diff --git a/internal/webapp/frontend/src/apps/Browser.tsx b/internal/webapp/frontend/src/apps/Browser.tsx
index 7452801..77de956 100644
--- a/internal/webapp/frontend/src/apps/Browser.tsx
+++ b/internal/webapp/frontend/src/apps/Browser.tsx
@@ -32,36 +32,10 @@ import { Insights, useInsightsDevices } from "../components/Insights";
import { HistoryView, historyTitle } from "../components/HistoryView";
import type { Run } from "../lib/runs";
import { VersionBanner } from "../components/VersionBanner";
+import { secretsMessage } from "../lib/secrets";
import { ConflictBanner } from "../components/ConflictBanner";
import { parseConflict } from "../lib/conflict";
-// The hub's six share-time credential rules, in words. Only one caller
-// (shareNow), so it lives here rather than in its own file.
-const SECRET_LABELS: Record = {
- aws_access_key_id: "an AWS access key",
- openai_api_key: "an OpenAI API key",
- github_pat: "a GitHub token",
- slack_token: "a Slack token",
- private_key: "a private key",
- gitlab_pat: "a GitLab token",
-};
-
-// secretsMessage phrases the 409 for the confirm dialog. The second sentence
-// is not decoration: a link always serves the file's LATEST content, so the
-// copy may only ever claim what was true at the moment of sharing — never
-// that the file is clean.
-function secretsMessage(findings: { rule: string; line: number }[] = []): string {
- const parts = findings.map((f) => `${SECRET_LABELS[f.rule] ?? f.rule} (line ${f.line})`);
- const what =
- parts.length > 1
- ? parts.slice(0, -1).join(", ") + " and " + parts[parts.length - 1]
- : parts[0] || "something credential-shaped";
- return (
- `BearDrive found ${what} in this file. The check covers the file at the moment you share it — ` +
- `a link always serves the file's latest content, so later changes are never checked. Share anyway?`
- );
-}
-
// The browsing surface shared by hub projects and single-volume mode: the
// file tree, folder listings, file views, and every topbar action. Sidebar
// chrome (vault header, project nav, org bar) is injected by the caller;
diff --git a/internal/webapp/frontend/src/components/FileView.tsx b/internal/webapp/frontend/src/components/FileView.tsx
index 1120e3c..b608411 100644
--- a/internal/webapp/frontend/src/components/FileView.tsx
+++ b/internal/webapp/frontend/src/components/FileView.tsx
@@ -20,6 +20,8 @@ import {
import { urlForPath } from "../router";
import { CSV_ROWS, parseDelimited, type Csv } from "../lib/csv";
import { hasMermaid, renderMermaid } from "../lib/mermaid";
+import { secretsBadge, type SecretFinding } from "../lib/secrets";
+import { Icon } from "./shell";
export function FileView(props: {
apiBase: string;
@@ -235,10 +237,36 @@ function MarkdownView(props: Parameters[0]) {
// Server-rendered, server-sanitized markdown — same trust model as the
// classic app assigning innerHTML.
return (
-
handleLinkClick(e, path, onOpenFile)}
+ />
+ >
+ );
+}
+
+/* The share gate could already name the rule and the line well enough to
+ refuse to publish this file, while the file view rendered the same key as
+ ordinary prose (BEA-147). Advisory only, in VersionBanner's shape: a strip
+ above the content, role="status", no actions. Nothing is blocked and
+ nothing is redacted — a reader who can open the file could already read
+ the key, and the point is that they now know it is in there. */
+function SecretBadge({ findings }: { findings?: SecretFinding[] }) {
+ if (!findings?.length) return null;
+ return (
+
+
+
+
+
+ {secretsBadge(findings)}
+
+ Checked when this page loaded. Sharing the file asks you to confirm first.
+
+
+
);
}
diff --git a/internal/webapp/frontend/src/lib/secrets.test.ts b/internal/webapp/frontend/src/lib/secrets.test.ts
new file mode 100644
index 0000000..7316c66
--- /dev/null
+++ b/internal/webapp/frontend/src/lib/secrets.test.ts
@@ -0,0 +1,43 @@
+// Run with `npm test` (node's built-in runner; node ≥ 23 strips the types).
+// Excluded from tsconfig's include — it imports node: builtins, which the
+// app's DOM-only lib set does not know about.
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import { secretsBadge, secretsMessage } from "./secrets.ts";
+
+test("one finding names the rule in words and the line", () => {
+ const s = secretsBadge([{ rule: "aws_access_key_id", line: 3 }]);
+ assert.equal(s, "This file contains an AWS access key (line 3).");
+});
+
+test("several findings read as a list", () => {
+ const s = secretsBadge([
+ { rule: "aws_access_key_id", line: 3 },
+ { rule: "github_pat", line: 9 },
+ { rule: "private_key", line: 40 },
+ ]);
+ assert.equal(
+ s,
+ "This file contains an AWS access key (line 3), a GitHub token (line 9) and a private key (line 40).",
+ );
+});
+
+test("an unknown rule id falls back to the raw id rather than reporting nothing", () => {
+ assert.match(secretsBadge([{ rule: "nomad_token", line: 1 }]), /nomad_token \(line 1\)/);
+});
+
+test("the badge and the share dialog name the same finding identically", () => {
+ const f = [{ rule: "openai_api_key", line: 12 }];
+ assert.match(secretsBadge(f), /an OpenAI API key \(line 12\)/);
+ assert.match(secretsMessage(f), /an OpenAI API key \(line 12\)/);
+});
+
+test("the share dialog never claims the file stays clean", () => {
+ const s = secretsMessage([{ rule: "aws_access_key_id", line: 3 }]);
+ assert.match(s, /latest content/);
+ assert.match(s, /Share anyway\?$/);
+});
+
+test("no findings still phrases something rather than an empty sentence", () => {
+ assert.match(secretsMessage(), /something credential-shaped/);
+});
diff --git a/internal/webapp/frontend/src/lib/secrets.ts b/internal/webapp/frontend/src/lib/secrets.ts
new file mode 100644
index 0000000..efc82c4
--- /dev/null
+++ b/internal/webapp/frontend/src/lib/secrets.ts
@@ -0,0 +1,53 @@
+/* The hub's six credential rules, in words — shared by the two surfaces that
+ report the same finding: the share dialog's confirm (it refuses to mint)
+ and the file view's badge (it only warns). One map, so the two wordings
+ cannot drift; that shared vocabulary is the whole reason this lives in
+ lib/ rather than beside either caller.
+
+ Mirrors `labels` in internal/secrets/secrets.go, which is what `bdrive
+ share` and `bdrive status` print. */
+
+export interface SecretFinding {
+ rule: string;
+ line: number;
+}
+
+const SECRET_LABELS: Record = {
+ aws_access_key_id: "an AWS access key",
+ openai_api_key: "an OpenAI API key",
+ github_pat: "a GitHub token",
+ slack_token: "a Slack token",
+ private_key: "a private key",
+ gitlab_pat: "a GitLab token",
+};
+
+// A rule with no label renders as its bare id: ugly, but a seventh rule that
+// reported nothing would be worse.
+function phrase(f: SecretFinding): string {
+ return `${SECRET_LABELS[f.rule] ?? f.rule} (line ${f.line})`;
+}
+
+function list(findings: SecretFinding[]): string {
+ const parts = findings.map(phrase);
+ if (parts.length > 1) return parts.slice(0, -1).join(", ") + " and " + parts[parts.length - 1];
+ return parts[0] || "something credential-shaped";
+}
+
+// secretsMessage phrases the 409 for the confirm dialog. The second sentence
+// is not decoration: a link always serves the file's LATEST content, so the
+// copy may only ever claim what was true at the moment of sharing — never
+// that the file is clean.
+export function secretsMessage(findings: SecretFinding[] = []): string {
+ return (
+ `BearDrive found ${list(findings)} in this file. The check covers the file at the moment you share it — ` +
+ `a link always serves the file's latest content, so later changes are never checked. Share anyway?`
+ );
+}
+
+// secretsBadge phrases the same finding for the file view, where nothing is
+// blocked and nothing is redacted — a reader who can open the file could
+// already read the key. Same map, so the badge and the dialog name the rule
+// and the line identically.
+export function secretsBadge(findings: SecretFinding[] = []): string {
+ return `This file contains ${list(findings)}.`;
+}
diff --git a/internal/webapp/frontend/src/style.css b/internal/webapp/frontend/src/style.css
index 88ac481..b40acce 100644
--- a/internal/webapp/frontend/src/style.css
+++ b/internal/webapp/frontend/src/style.css
@@ -1177,6 +1177,18 @@ input[type="checkbox"] { accent-color: var(--accent); }
.vbanner .vb-actions { flex: none; display: flex; gap: 8px; }
.vbanner .vb-actions .ai-btn { display: inline-flex; align-items: center; text-decoration: none; }
+/* Credential badge on the file view (BEA-147) — the share gate's finding on
+ the path every file takes. Same strip geometry as .vbanner above; the red
+ family rather than the accent, because accent+glow already means "you are
+ looking at an old version" and the two strips can appear together. The hue
+ is .meta-stale's (#e07070, style.css:385), which is the warning colour this
+ same view already speaks. */
+.sbadge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; padding: 11px 14px; border: 1px solid rgba(242,109,109,.32); border-radius: var(--r-card); background: rgba(242,109,109,.08); }
+.sbadge .sb-icon { flex: none; display: flex; color: #e07070; }
+.sbadge .sb-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; line-height: 1.45; }
+.sbadge .sb-text b { color: #e07070; font-weight: 600; }
+.sbadge .sb-text span { color: var(--text-dim); }
+
/* plain file / binary views */
pre.plain { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; overflow-x: auto; font: 12.5px/1.6 var(--mono); color: #c6cbd3; white-space: pre-wrap; overflow-wrap: anywhere; }
/* long unbreakable lines wrap instead of blowing out the column: .page has min-width: 0 */
diff --git a/internal/webapp/render_secrets_test.go b/internal/webapp/render_secrets_test.go
new file mode 100644
index 0000000..1256122
--- /dev/null
+++ b/internal/webapp/render_secrets_test.go
@@ -0,0 +1,151 @@
+package webapp
+
+import (
+ "bytes"
+ "encoding/json"
+ "log"
+ "net/http"
+ "net/http/httptest"
+ "reflect"
+ "strings"
+ "testing"
+
+ "github.com/runbear-io/beardrive/internal/secrets"
+)
+
+// getAs fetches as a signed-in member: the render route is membership-gated,
+// and the badge is for the people who can already read the file.
+func getAs(t *testing.T, srv *Server, h http.Handler, url string) *httptest.ResponseRecorder {
+ t.Helper()
+ req := httptest.NewRequest("GET", url, nil)
+ authAs(t, srv, req)
+ return doHTTP(h, req)
+}
+
+func renderDoc(t *testing.T, srv *Server, h http.Handler, url string) (struct {
+ HTML string `json:"html"`
+ Findings []secrets.Finding `json:"findings"`
+}, *httptest.ResponseRecorder) {
+ t.Helper()
+ var doc struct {
+ HTML string `json:"html"`
+ Findings []secrets.Finding `json:"findings"`
+ }
+ rec := getAs(t, srv, h, url)
+ if rec.Code != 200 {
+ t.Fatalf("render %s: %d %s", url, rec.Code, rec.Body)
+ }
+ if err := json.Unmarshal(rec.Body.Bytes(), &doc); err != nil {
+ t.Fatalf("decode render body %q: %v", rec.Body, err)
+ }
+ return doc, rec
+}
+
+// TestRenderSecretFindings: the scan that refuses to publish the file also
+// runs on the path every file takes, so the viewer can say what the share
+// dialog would say (BEA-147).
+func TestRenderSecretFindings(t *testing.T) {
+ srv, p, _, f, h := shareHub(t)
+ f.put("dev1", "deploy.md", "# Deploy\n\nexport AWS_ACCESS_KEY_ID="+planted+"\n")
+ f.put("dev1", "clean.md", "# Clean\n\nnothing to see\n")
+ base := "/api/p/" + p.ID + "/"
+
+ doc, _ := renderDoc(t, srv, h, base+"render?path=deploy.md")
+ want := []secrets.Finding{{Rule: "aws_access_key_id", Line: 3}}
+ if !reflect.DeepEqual(doc.Findings, want) {
+ t.Fatalf("findings = %+v, want %+v", doc.Findings, want)
+ }
+ // Advisory, not a redaction: the file still renders in full.
+ if !strings.Contains(doc.HTML, "Deploy") {
+ t.Fatalf("the render was suppressed: %q", doc.HTML)
+ }
+
+ // A clean file carries no field at all — omitted, not empty, so the
+ // frontend's check is a plain truthiness test.
+ doc, rec := renderDoc(t, srv, h, base+"render?path=clean.md")
+ if len(doc.Findings) != 0 {
+ t.Fatalf("clean file has findings: %+v", doc.Findings)
+ }
+ if strings.Contains(rec.Body.String(), "findings") {
+ t.Fatalf("clean render sent an empty findings field: %s", rec.Body)
+ }
+}
+
+// TestRenderSecretNeverEchoed mirrors TestShareSecretNeverEchoed for the new
+// caller: rule ids and line numbers only, never the matched text.
+func TestRenderSecretNeverEchoed(t *testing.T) {
+ srv, p, _, f, h := shareHub(t)
+ f.put("dev1", "creds.md", "key = "+planted+"\n")
+
+ var logs bytes.Buffer
+ prev := log.Writer()
+ log.SetOutput(&logs)
+ t.Cleanup(func() { log.SetOutput(prev) })
+
+ rec := getAs(t, srv, h, "/api/p/"+p.ID+"/render?path=creds.md")
+ if rec.Code != 200 {
+ t.Fatalf("render: %d %s", rec.Code, rec.Body)
+ }
+ // The rendered HTML is the file, so the key is in the body by design —
+ // what must never appear is a SECOND copy carried by the finding.
+ var doc struct {
+ HTML string `json:"html"`
+ Findings json.RawMessage `json:"findings"`
+ }
+ if err := json.Unmarshal(rec.Body.Bytes(), &doc); err != nil {
+ t.Fatal(err)
+ }
+ if strings.Contains(string(doc.Findings), planted) {
+ t.Errorf("the finding echoed the secret: %s", doc.Findings)
+ }
+ if strings.Contains(logs.String(), planted) {
+ t.Errorf("the secret reached the log: %s", logs.String())
+ }
+}
+
+// TestRenderSecretScanLimit: the 1 MiB boundary is a decision, pinned for
+// minting in shares_test.go and pinned here so the two surfaces cannot
+// disagree about the same file.
+func TestRenderSecretScanLimit(t *testing.T) {
+ srv, p, _, f, h := shareHub(t)
+ f.put("dev1", "big.md", strings.Repeat("filler\n", secrets.ScanLimit/7+1)+planted+"\n")
+ base := "/api/p/" + p.ID + "/"
+
+ doc, _ := renderDoc(t, srv, h, base+"render?path=big.md")
+ if len(doc.Findings) != 0 {
+ t.Fatalf("a key past the scan limit was badged: %+v", doc.Findings)
+ }
+}
+
+// TestRenderVersionSecretFindings: clicking into history on the file the
+// badge was warning about must not make the warning disappear.
+func TestRenderVersionSecretFindings(t *testing.T) {
+ srv, p, _, f, h := shareHub(t)
+ f.put("dev1", "deploy.md", "# Deploy\n\nexport AWS_ACCESS_KEY_ID="+planted+"\n")
+ f.put("dev1", "deploy.md", "# Deploy\n\ncleaned up\n")
+ base := "/api/p/" + p.ID + "/"
+
+ rec := getAs(t, srv, h, base+"history?path=deploy.md")
+ var hist struct {
+ Entries []HistoryEntry `json:"entries"`
+ }
+ if err := json.Unmarshal(rec.Body.Bytes(), &hist); err != nil {
+ t.Fatal(err)
+ }
+ if len(hist.Entries) < 2 {
+ t.Fatalf("history has %d entries, want the pre-cleanup version too", len(hist.Entries))
+ }
+ old := hist.Entries[len(hist.Entries)-1].Blob
+
+ // Current version is clean...
+ doc, _ := renderDoc(t, srv, h, base+"render?path=deploy.md")
+ if len(doc.Findings) != 0 {
+ t.Fatalf("cleaned-up file has findings: %+v", doc.Findings)
+ }
+ // ...the version that held the key still says so.
+ doc, _ = renderDoc(t, srv, h, base+"render?path=deploy.md&sha="+old)
+ want := []secrets.Finding{{Rule: "aws_access_key_id", Line: 3}}
+ if !reflect.DeepEqual(doc.Findings, want) {
+ t.Fatalf("version findings = %+v, want %+v", doc.Findings, want)
+ }
+}
diff --git a/internal/webapp/server.go b/internal/webapp/server.go
index bd82163..35bd17d 100644
--- a/internal/webapp/server.go
+++ b/internal/webapp/server.go
@@ -43,6 +43,7 @@ import (
"github.com/runbear-io/beardrive/internal/journal"
"github.com/runbear-io/beardrive/internal/remote"
+ "github.com/runbear-io/beardrive/internal/secrets"
"github.com/runbear-io/beardrive/internal/templates"
)
@@ -1413,9 +1414,33 @@ func (s *Server) handleRender(v *volume, w http.ResponseWriter, r *http.Request)
if fi.UserName != "" {
doc["user_name"] = fi.UserName
}
+ if f := renderFindings(src); len(f) > 0 {
+ doc["findings"] = f
+ }
writeJSON(w, doc)
}
+// renderFindings is the share gate's credential scan on the path every file
+// takes. The gate could name the rule and the line well enough to refuse to
+// publish a file while the viewer rendered the same key as ordinary prose
+// (BEA-147), so the render response carries the finding too — advisory only,
+// nothing is blocked and nothing is redacted, since a member who can open the
+// file could already read the key.
+//
+// Rule ids and line numbers only. The matched text must never reach a
+// response body; see the doc comment on secrets.Scan.
+//
+// The cap is a slice rather than the LimitReader the two streaming callers
+// use: the render path already holds the whole file, because that is what
+// RenderMarkdown needs. Same ScanLimit either way, so the badge and the share
+// dialog can never disagree about the same file.
+func renderFindings(src []byte) []secrets.Finding {
+ if len(src) > secrets.ScanLimit {
+ src = src[:secrets.ScanLimit]
+ }
+ return secrets.Scan(src)
+}
+
// renderVersion renders one exact past version by content hash — the
// markdown counterpart of /blob?sha=, so opening an old .md from history
// shows a rendered page instead of raw source. Provenance is not returned:
@@ -1446,9 +1471,16 @@ func (s *Server) renderVersion(v *volume, w http.ResponseWriter, r *http.Request
http.Error(w, fmt.Sprintf("render: %v", err), http.StatusInternalServerError)
return
}
- writeJSON(w, map[string]any{
+ doc := map[string]any{
"path": r.URL.Query().Get("path"), "html": html, "size": len(src),
- })
+ }
+ // The history view goes through this same endpoint, so scanning here too
+ // is what stops the badge vanishing the moment you click into history on
+ // the very file it was warning about.
+ if f := renderFindings(src); len(f) > 0 {
+ doc["findings"] = f
+ }
+ writeJSON(w, doc)
}
// inlineMarkup reports whether a Content-Type names something the browser
diff --git a/internal/webapp/static/assets/index-BysAiMHJ.js b/internal/webapp/static/assets/index-C17b7d2I.js
similarity index 53%
rename from internal/webapp/static/assets/index-BysAiMHJ.js
rename to internal/webapp/static/assets/index-C17b7d2I.js
index 5f3f49f..b49281c 100644
--- a/internal/webapp/static/assets/index-BysAiMHJ.js
+++ b/internal/webapp/static/assets/index-C17b7d2I.js
@@ -1,57 +1,57 @@
-import{g as ww}from"./_commonjsHelpers-CqkleIqs.js";import{h as S2,r as _2}from"./mermaid-DQuCJ8Gi.js";function C2(e,t){for(var r=0;ri[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();var Th={exports:{}},qo={};var fb;function E2(){if(fb)return qo;fb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return qo.Fragment=t,qo.jsx=r,qo.jsxs=r,qo}var hb;function R2(){return hb||(hb=1,Th.exports=E2()),Th.exports}var f=R2(),Oh={exports:{}},Ve={};var mb;function j2(){if(mb)return Ve;mb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function R(D,M,U){this.props=D,this.context=M,this.refs=E,this.updater=U||w}R.prototype.isReactComponent={},R.prototype.setState=function(D,M){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,M,"setState")},R.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=R.prototype;function O(D,M,U){this.props=D,this.context=M,this.refs=E,this.updater=U||w}var N=O.prototype=new T;N.constructor=O,_(N,R.prototype),N.isPureReactComponent=!0;var k=Array.isArray;function B(){}var H={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function ne(D,M,U){var X=U.ref;return{$$typeof:e,type:D,key:M,ref:X!==void 0?X:null,props:U}}function pe(D,M){return ne(D.type,M,D.props)}function ge(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function he(D){var M={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(U){return M[U]})}var de=/\/+/g;function Z(D,M){return typeof D=="object"&&D!==null&&D.key!=null?he(""+D.key):M.toString(36)}function Se(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(B,B):(D.status="pending",D.then(function(M){D.status==="pending"&&(D.status="fulfilled",D.value=M)},function(M){D.status==="pending"&&(D.status="rejected",D.reason=M)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function L(D,M,U,X,Y){var fe=typeof D;(fe==="undefined"||fe==="boolean")&&(D=null);var re=!1;if(D===null)re=!0;else switch(fe){case"bigint":case"string":case"number":re=!0;break;case"object":switch(D.$$typeof){case e:case t:re=!0;break;case y:return re=D._init,L(re(D._payload),M,U,X,Y)}}if(re)return Y=Y(D),re=X===""?"."+Z(D,0):X,k(Y)?(U="",re!=null&&(U=re.replace(de,"$&/")+"/"),L(Y,M,U,"",function(Me){return Me})):Y!=null&&(ge(Y)&&(Y=pe(Y,U+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(de,"$&/")+"/")+re)),M.push(Y)),1;re=0;var be=X===""?".":X+":";if(k(D))for(var xe=0;xe>>1,te=L[J];if(0>>1;Jo(U,ie))Xo(Y,U)?(L[J]=Y,L[X]=ie,J=X):(L[J]=U,L[M]=ie,J=M);else if(Xo(Y,ie))L[J]=Y,L[X]=ie,J=X;else break e}}return K}function o(L,K){var ie=L.sortIndex-K.sortIndex;return ie!==0?ie:L.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var m=[],p=[],y=1,v=null,b=3,x=!1,w=!1,_=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function N(L){for(var K=r(p);K!==null;){if(K.callback===null)i(p);else if(K.startTime<=L)i(p),K.sortIndex=K.expirationTime,t(m,K);else break;K=r(p)}}function k(L){if(_=!1,N(L),!w)if(r(m)!==null)w=!0,B||(B=!0,he());else{var K=r(p);K!==null&&Se(k,K.startTime-L)}}var B=!1,H=-1,I=5,ne=-1;function pe(){return E?!0:!(e.unstable_now()-neL&&pe());){var J=v.callback;if(typeof J=="function"){v.callback=null,b=v.priorityLevel;var te=J(v.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){v.callback=te,N(L),K=!0;break t}v===r(m)&&i(m),N(L)}else i(m);v=r(m)}if(v!==null)K=!0;else{var D=r(p);D!==null&&Se(k,D.startTime-L),K=!1}}break e}finally{v=null,b=ie,x=!1}K=void 0}}finally{K?he():B=!1}}}var he;if(typeof O=="function")he=function(){O(ge)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,Z=de.port2;de.port1.onmessage=ge,he=function(){Z.postMessage(null)}}else he=function(){R(ge,0)};function Se(L,K){H=R(function(){L(e.unstable_now())},K)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125J?(L.sortIndex=ie,t(p,L),r(m)===null&&L===r(p)&&(_?(T(H),H=-1):_=!0,Se(k,ie-J))):(L.sortIndex=te,t(m,L),w||x||(w=!0,B||(B=!0,he()))),L},e.unstable_shouldYield=pe,e.unstable_wrapCallback=function(L){var K=b;return function(){var ie=b;b=K;try{return L.apply(this,arguments)}finally{b=ie}}}})(Nh)),Nh}var vb;function O2(){return vb||(vb=1,Mh.exports=T2()),Mh.exports}var Dh={exports:{}},un={};var yb;function A2(){if(yb)return un;yb=1;var e=sp();function t(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=A2(),Dh.exports}var xb;function M2(){if(xb)return Go;xb=1;var e=O2(),t=sp(),r=Sw();function i(n){var a="https://react.dev/errors/"+n;if(1te||(n.current=J[te],J[te]=null,te--)}function U(n,a){te++,J[te]=n.current,n.current=a}var X=D(null),Y=D(null),fe=D(null),re=D(null);function be(n,a){switch(U(fe,a),U(Y,n),U(X,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?z0(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=z0(a),n=L0(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}M(X),U(X,n)}function xe(){M(X),M(Y),M(fe)}function Me(n){n.memoizedState!==null&&U(re,n);var a=X.current,s=L0(a,n.type);a!==s&&(U(Y,n),U(X,s))}function Fe(n){Y.current===n&&(M(X),M(Y)),re.current===n&&(M(re),Vo._currentValue=ie)}var He,ct;function Je(n){if(He===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);He=a&&a[1]||"",ct=-1a[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();var Th={exports:{}},qo={};var fb;function R2(){if(fb)return qo;fb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:l}}return qo.Fragment=t,qo.jsx=r,qo.jsxs=r,qo}var hb;function j2(){return hb||(hb=1,Th.exports=R2()),Th.exports}var f=j2(),Oh={exports:{}},Ve={};var mb;function T2(){if(mb)return Ve;mb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,E={};function R(D,M,U){this.props=D,this.context=M,this.refs=E,this.updater=U||w}R.prototype.isReactComponent={},R.prototype.setState=function(D,M){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,M,"setState")},R.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function T(){}T.prototype=R.prototype;function O(D,M,U){this.props=D,this.context=M,this.refs=E,this.updater=U||w}var N=O.prototype=new T;N.constructor=O,_(N,R.prototype),N.isPureReactComponent=!0;var k=Array.isArray;function B(){}var H={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function ne(D,M,U){var X=U.ref;return{$$typeof:e,type:D,key:M,ref:X!==void 0?X:null,props:U}}function pe(D,M){return ne(D.type,M,D.props)}function ge(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function he(D){var M={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(U){return M[U]})}var de=/\/+/g;function Z(D,M){return typeof D=="object"&&D!==null&&D.key!=null?he(""+D.key):M.toString(36)}function Se(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(B,B):(D.status="pending",D.then(function(M){D.status==="pending"&&(D.status="fulfilled",D.value=M)},function(M){D.status==="pending"&&(D.status="rejected",D.reason=M)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function L(D,M,U,X,Y){var fe=typeof D;(fe==="undefined"||fe==="boolean")&&(D=null);var re=!1;if(D===null)re=!0;else switch(fe){case"bigint":case"string":case"number":re=!0;break;case"object":switch(D.$$typeof){case e:case t:re=!0;break;case y:return re=D._init,L(re(D._payload),M,U,X,Y)}}if(re)return Y=Y(D),re=X===""?"."+Z(D,0):X,k(Y)?(U="",re!=null&&(U=re.replace(de,"$&/")+"/"),L(Y,M,U,"",function(Me){return Me})):Y!=null&&(ge(Y)&&(Y=pe(Y,U+(Y.key==null||D&&D.key===Y.key?"":(""+Y.key).replace(de,"$&/")+"/")+re)),M.push(Y)),1;re=0;var be=X===""?".":X+":";if(k(D))for(var xe=0;xe>>1,te=L[J];if(0>>1;Jo(U,ae))Xo(Y,U)?(L[J]=Y,L[X]=ae,J=X):(L[J]=U,L[M]=ae,J=M);else if(Xo(Y,ae))L[J]=Y,L[X]=ae,J=X;else break e}}return K}function o(L,K){var ae=L.sortIndex-K.sortIndex;return ae!==0?ae:L.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var m=[],p=[],y=1,v=null,b=3,x=!1,w=!1,_=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function N(L){for(var K=r(p);K!==null;){if(K.callback===null)a(p);else if(K.startTime<=L)a(p),K.sortIndex=K.expirationTime,t(m,K);else break;K=r(p)}}function k(L){if(_=!1,N(L),!w)if(r(m)!==null)w=!0,B||(B=!0,he());else{var K=r(p);K!==null&&Se(k,K.startTime-L)}}var B=!1,H=-1,I=5,ne=-1;function pe(){return E?!0:!(e.unstable_now()-neL&&pe());){var J=v.callback;if(typeof J=="function"){v.callback=null,b=v.priorityLevel;var te=J(v.expirationTime<=L);if(L=e.unstable_now(),typeof te=="function"){v.callback=te,N(L),K=!0;break t}v===r(m)&&a(m),N(L)}else a(m);v=r(m)}if(v!==null)K=!0;else{var D=r(p);D!==null&&Se(k,D.startTime-L),K=!1}}break e}finally{v=null,b=ae,x=!1}K=void 0}}finally{K?he():B=!1}}}var he;if(typeof O=="function")he=function(){O(ge)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,Z=de.port2;de.port1.onmessage=ge,he=function(){Z.postMessage(null)}}else he=function(){R(ge,0)};function Se(L,K){H=R(function(){L(e.unstable_now())},K)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125J?(L.sortIndex=ae,t(p,L),r(m)===null&&L===r(p)&&(_?(T(H),H=-1):_=!0,Se(k,ae-J))):(L.sortIndex=te,t(m,L),w||x||(w=!0,B||(B=!0,he()))),L},e.unstable_shouldYield=pe,e.unstable_wrapCallback=function(L){var K=b;return function(){var ae=b;b=K;try{return L.apply(this,arguments)}finally{b=ae}}}})(Nh)),Nh}var vb;function A2(){return vb||(vb=1,Mh.exports=O2()),Mh.exports}var Dh={exports:{}},un={};var yb;function M2(){if(yb)return un;yb=1;var e=sp();function t(m){var p="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=M2(),Dh.exports}var xb;function N2(){if(xb)return Go;xb=1;var e=A2(),t=sp(),r=Sw();function a(n){var i="https://react.dev/errors/"+n;if(1te||(n.current=J[te],J[te]=null,te--)}function U(n,i){te++,J[te]=n.current,n.current=i}var X=D(null),Y=D(null),fe=D(null),re=D(null);function be(n,i){switch(U(fe,i),U(Y,n),U(X,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?z0(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=z0(i),n=L0(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}M(X),U(X,n)}function xe(){M(X),M(Y),M(fe)}function Me(n){n.memoizedState!==null&&U(re,n);var i=X.current,s=L0(i,n.type);i!==s&&(U(Y,n),U(X,s))}function Fe(n){Y.current===n&&(M(X),M(Y)),re.current===n&&(M(re),Vo._currentValue=ae)}var He,ct;function Je(n){if(He===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);He=i&&i[1]||"",ct=-1)":-1h||z[c]!==G[h]){var ae=`
-`+z[c].replace(" at new "," at ");return n.displayName&&ae.includes("")&&(ae=ae.replace("",n.displayName)),ae}while(1<=c&&0<=h);break}}}finally{hn=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Je(s):""}function Xt(n,a){switch(n.tag){case 26:case 27:case 5:return Je(n.type);case 16:return Je("Lazy");case 13:return n.child!==a&&a!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return mn(n.type,!1);case 11:return mn(n.type.render,!1);case 1:return mn(n.type,!0);case 31:return Je("Activity");default:return""}}function yr(n){try{var a="",s=null;do a+=Xt(n,s),s=n,n=n.return;while(n);return a}catch(c){return`
+`);for(h=c=0;ch||z[c]!==G[h]){var ie=`
+`+z[c].replace(" at new "," at ");return n.displayName&&ie.includes("")&&(ie=ie.replace("",n.displayName)),ie}while(1<=c&&0<=h);break}}}finally{hn=!1,Error.prepareStackTrace=s}return(s=n?n.displayName||n.name:"")?Je(s):""}function Xt(n,i){switch(n.tag){case 26:case 27:case 5:return Je(n.type);case 16:return Je("Lazy");case 13:return n.child!==i&&i!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return mn(n.type,!1);case 11:return mn(n.type.render,!1);case 1:return mn(n.type,!0);case 31:return Je("Activity");default:return""}}function yr(n){try{var i="",s=null;do i+=Xt(n,s),s=n,n=n.return;while(n);return i}catch(c){return`
Error generating stack: `+c.message+`
-`+c.stack}}var At=Object.prototype.hasOwnProperty,rr=e.unstable_scheduleCallback,br=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,Vn=e.unstable_requestPaint,zt=e.unstable_now,Dr=e.unstable_getCurrentPriorityLevel,ar=e.unstable_ImmediatePriority,oa=e.unstable_UserBlockingPriority,ir=e.unstable_NormalPriority,la=e.unstable_LowPriority,Jt=e.unstable_IdlePriority,A=e.log,P=e.unstable_setDisableYieldValue,F=null,ue=null;function oe(n){if(typeof A=="function"&&P(n),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(F,n)}catch{}}var ye=Math.clz32?Math.clz32:le,we=Math.log,ee=Math.LN2;function le(n){return n>>>=0,n===0?32:31-(we(n)/ee|0)|0}var Re=256,ze=262144,it=4194304;function _t(n){var a=n&42;if(a!==0)return a;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ae(n,a,s){var c=n.pendingLanes;if(c===0)return 0;var h=0,g=n.suspendedLanes,C=n.pingedLanes;n=n.warmLanes;var j=c&134217727;return j!==0?(c=j&~g,c!==0?h=_t(c):(C&=j,C!==0?h=_t(C):s||(s=j&~n,s!==0&&(h=_t(s))))):(j=c&~g,j!==0?h=_t(j):C!==0?h=_t(C):s||(s=c&~n,s!==0&&(h=_t(s)))),h===0?0:a!==0&&a!==h&&(a&g)===0&&(g=h&-h,s=a&-a,g>=s||g===32&&(s&4194048)!==0)?a:h}function ut(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function st(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 Gt(){var n=it;return it<<=1,(it&62914560)===0&&(it=4194304),n}function sr(n){for(var a=[],s=0;31>s;s++)a.push(n);return a}function Ct(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function yn(n,a,s,c,h,g){var C=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var j=n.entanglements,z=n.expirationTimes,G=n.hiddenUpdates;for(s=C&~s;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var gE=/[\n"\\]/g;function Hn(n){return n.replace(gE,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function wd(n,a,s,c,h,g,C,j){n.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.type=C:n.removeAttribute("type"),a!=null?C==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+Un(a)):n.value!==""+Un(a)&&(n.value=""+Un(a)):C!=="submit"&&C!=="reset"||n.removeAttribute("value"),a!=null?Sd(n,C,Un(a)):s!=null?Sd(n,C,Un(s)):c!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.name=""+Un(j):n.removeAttribute("name")}function Og(n,a,s,c,h,g,C,j){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),a!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){xd(n);return}s=s!=null?""+Un(s):"",a=a!=null?""+Un(a):s,j||a===n.value||(n.value=a),n.defaultValue=a}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=j?n.checked:!!c,n.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(n.name=C),xd(n)}function Sd(n,a,s){a==="number"&&Nl(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Zi(n,a,s,c){if(n=n.options,a){a={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jd=!1;if(Lr)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){jd=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{jd=!1}var ua=null,Td=null,kl=null;function Lg(){if(kl)return kl;var n,a=Td,s=a.length,c,h="value"in ua?ua.value:ua.textContent,g=h.length;for(n=0;n=oo),Ug=" ",Hg=!1;function Bg(n,a){switch(n){case"keyup":return BE.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Xi=!1;function GE(n,a){switch(n){case"compositionend":return qg(a);case"keypress":return a.which!==32?null:(Hg=!0,Ug);case"textInput":return n=a.data,n===Ug&&Hg?null:n;default:return null}}function ZE(n,a){if(Xi)return n==="compositionend"||!Dd&&Bg(n,a)?(n=Lg(),kl=Td=ua=null,Xi=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:s,offset:a-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wg(s)}}function tv(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?tv(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function nv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=Nl(n.document);a instanceof n.HTMLIFrameElement;){try{var s=typeof a.contentWindow.location.href=="string"}catch{s=!1}if(s)n=a.contentWindow;else break;a=Nl(n.document)}return a}function Ld(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var tR=Lr&&"documentMode"in document&&11>=document.documentMode,Ji=null,$d=null,fo=null,Id=!1;function rv(n,a,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Id||Ji==null||Ji!==Nl(c)||(c=Ji,"selectionStart"in c&&Ld(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),fo&&uo(fo,c)||(fo=c,c=jc($d,"onSelect"),0>=C,h-=C,xr=1<<32-ye(a)+h|s<Be?(Qe=Oe,Oe=null):Qe=Oe.sibling;var tt=Q(V,Oe,q[Be],se);if(tt===null){Oe===null&&(Oe=Qe);break}n&&Oe&&tt.alternate===null&&a(V,Oe),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt,Oe=Qe}if(Be===q.length)return s(V,Oe),Xe&&Ir(V,Be),Ne;if(Oe===null){for(;BeBe?(Qe=Oe,Oe=null):Qe=Oe.sibling;var Na=Q(V,Oe,tt.value,se);if(Na===null){Oe===null&&(Oe=Qe);break}n&&Oe&&Na.alternate===null&&a(V,Oe),$=g(Na,$,Be),et===null?Ne=Na:et.sibling=Na,et=Na,Oe=Qe}if(tt.done)return s(V,Oe),Xe&&Ir(V,Be),Ne;if(Oe===null){for(;!tt.done;Be++,tt=q.next())tt=ce(V,tt.value,se),tt!==null&&($=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return Xe&&Ir(V,Be),Ne}for(Oe=c(Oe);!tt.done;Be++,tt=q.next())tt=W(Oe,V,Be,tt.value,se),tt!==null&&(n&&tt.alternate!==null&&Oe.delete(tt.key===null?Be:tt.key),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return n&&Oe.forEach(function(w2){return a(V,w2)}),Xe&&Ir(V,Be),Ne}function ht(V,$,q,se){if(typeof q=="object"&&q!==null&&q.type===_&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var Ne=q.key;$!==null;){if($.key===Ne){if(Ne=q.type,Ne===_){if($.tag===7){s(V,$.sibling),se=h($,q.props.children),se.return=V,V=se;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===I&&fi(Ne)===$.type){s(V,$.sibling),se=h($,q.props),yo(se,q),se.return=V,V=se;break e}s(V,$);break}else a(V,$);$=$.sibling}q.type===_?(se=oi(q.props.children,V.mode,se,q.key),se.return=V,V=se):(se=Bl(q.type,q.key,q.props,null,V.mode,se),yo(se,q),se.return=V,V=se)}return C(V);case w:e:{for(Ne=q.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===q.containerInfo&&$.stateNode.implementation===q.implementation){s(V,$.sibling),se=h($,q.children||[]),se.return=V,V=se;break e}else{s(V,$);break}else a(V,$);$=$.sibling}se=qd(q,V.mode,se),se.return=V,V=se}return C(V);case I:return q=fi(q),ht(V,$,q,se)}if(Se(q))return je(V,$,q,se);if(he(q)){if(Ne=he(q),typeof Ne!="function")throw Error(i(150));return q=Ne.call(q),ke(V,$,q,se)}if(typeof q.then=="function")return ht(V,$,Xl(q),se);if(q.$$typeof===O)return ht(V,$,Zl(V,q),se);Jl(V,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,$!==null&&$.tag===6?(s(V,$.sibling),se=h($,q),se.return=V,V=se):(s(V,$),se=Bd(q,V.mode,se),se.return=V,V=se),C(V)):s(V,$)}return function(V,$,q,se){try{vo=0;var Ne=ht(V,$,q,se);return cs=null,Ne}catch(Oe){if(Oe===ls||Oe===Yl)throw Oe;var et=Dn(29,Oe,null,V.mode);return et.lanes=se,et.return=V,et}}}var mi=Rv(!0),jv=Rv(!1),pa=!1;function rf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function ga(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function va(n,a,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(nt&2)!==0){var h=c.pending;return h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a,a=Hl(n),uv(n,null,s),a}return Ul(n,c,a,s),Hl(n)}function bo(n,a,s){if(a=a.updateQueue,a!==null&&(a=a.shared,(s&4194048)!==0)){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bn(n,s)}}function sf(n,a){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?h=g=C:g=g.next=C,s=s.next}while(s!==null);g===null?h=g=a:g=g.next=a}else h=g=a;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=a:n.next=a,s.lastBaseUpdate=a}var of=!1;function xo(){if(of){var n=os;if(n!==null)throw n}}function wo(n,a,s,c){of=!1;var h=n.updateQueue;pa=!1;var g=h.firstBaseUpdate,C=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var z=j,G=z.next;z.next=null,C===null?g=G:C.next=G,C=z;var ae=n.alternate;ae!==null&&(ae=ae.updateQueue,j=ae.lastBaseUpdate,j!==C&&(j===null?ae.firstBaseUpdate=G:j.next=G,ae.lastBaseUpdate=z))}if(g!==null){var ce=h.baseState;C=0,ae=G=z=null,j=g;do{var Q=j.lane&-536870913,W=Q!==j.lane;if(W?(Ye&Q)===Q:(c&Q)===Q){Q!==0&&Q===ss&&(of=!0),ae!==null&&(ae=ae.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var je=n,ke=j;Q=a;var ht=s;switch(ke.tag){case 1:if(je=ke.payload,typeof je=="function"){ce=je.call(ht,ce,Q);break e}ce=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ke.payload,Q=typeof je=="function"?je.call(ht,ce,Q):je,Q==null)break e;ce=v({},ce,Q);break e;case 2:pa=!0}}Q=j.callback,Q!==null&&(n.flags|=64,W&&(n.flags|=8192),W=h.callbacks,W===null?h.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ae===null?(G=ae=W,z=ce):ae=ae.next=W,C|=Q;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;W=j,j=W.next,W.next=null,h.lastBaseUpdate=W,h.shared.pending=null}}while(!0);ae===null&&(z=ce),h.baseState=z,h.firstBaseUpdate=G,h.lastBaseUpdate=ae,g===null&&(h.shared.lanes=0),Sa|=C,n.lanes=C,n.memoizedState=ce}}function Tv(n,a){if(typeof n!="function")throw Error(i(191,n));n.call(a)}function Ov(n,a){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;ng?g:8;var C=L.T,j={};L.T=j,Rf(n,!1,a,s);try{var z=h(),G=L.S;if(G!==null&&G(j,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ae=uR(z,c);Co(n,a,ae,In(n))}else Co(n,a,c,In(n))}catch(ce){Co(n,a,{then:function(){},status:"rejected",reason:ce},In())}finally{K.p=g,C!==null&&j.types!==null&&(C.types=j.types),L.T=C}}function gR(){}function Cf(n,a,s,c){if(n.tag!==5)throw Error(i(476));var h=oy(n).queue;sy(n,h,a,ie,s===null?gR:function(){return ly(n),s(c)})}function oy(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:ie},next:null};var s={};return a.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:s},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function ly(n){var a=oy(n);a.next===null&&(a=n.alternate.memoizedState),Co(n,a.next.queue,{},In())}function Ef(){return tn(Vo)}function cy(){return Nt().memoizedState}function uy(){return Nt().memoizedState}function vR(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var s=In();n=ga(s);var c=va(a,n,s);c!==null&&(jn(c,a,s),bo(c,a,s)),a={cache:Wd()},n.payload=a;return}a=a.return}}function yR(n,a,s){var c=In();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lc(n)?fy(a,s):(s=Ud(n,a,s,c),s!==null&&(jn(s,n,c),hy(s,a,c)))}function dy(n,a,s){var c=In();Co(n,a,s,c)}function Co(n,a,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lc(n))fy(a,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var C=a.lastRenderedState,j=g(C,s);if(h.hasEagerState=!0,h.eagerState=j,Nn(j,C))return Ul(n,a,h,0),gt===null&&Vl(),!1}catch{}if(s=Ud(n,a,h,c),s!==null)return jn(s,n,c),hy(s,a,c),!0}return!1}function Rf(n,a,s,c){if(c={lane:2,revertLane:ah(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},lc(n)){if(a)throw Error(i(479))}else a=Ud(n,s,c,2),a!==null&&jn(a,n,2)}function lc(n){var a=n.alternate;return n===Ue||a!==null&&a===Ue}function fy(n,a){ds=tc=!0;var s=n.pending;s===null?a.next=a:(a.next=s.next,s.next=a),n.pending=a}function hy(n,a,s){if((s&4194048)!==0){var c=a.lanes;c&=n.pendingLanes,s|=c,a.lanes=s,bn(n,s)}}var Eo={readContext:tn,use:ac,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Eo.useEffectEvent=jt;var my={readContext:tn,use:ac,useCallback:function(n,a){return pn().memoizedState=[n,a===void 0?null:a],n},useContext:tn,useEffect:Xv,useImperativeHandle:function(n,a,s){s=s!=null?s.concat([n]):null,sc(4194308,4,ty.bind(null,a,n),s)},useLayoutEffect:function(n,a){return sc(4194308,4,n,a)},useInsertionEffect:function(n,a){sc(4,2,n,a)},useMemo:function(n,a){var s=pn();a=a===void 0?null:a;var c=n();if(pi){oe(!0);try{n()}finally{oe(!1)}}return s.memoizedState=[c,a],c},useReducer:function(n,a,s){var c=pn();if(s!==void 0){var h=s(a);if(pi){oe(!0);try{s(a)}finally{oe(!1)}}}else h=a;return c.memoizedState=c.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},c.queue=n,n=n.dispatch=yR.bind(null,Ue,n),[c.memoizedState,n]},useRef:function(n){var a=pn();return n={current:n},a.memoizedState=n},useState:function(n){n=bf(n);var a=n.queue,s=dy.bind(null,Ue,a);return a.dispatch=s,[n.memoizedState,s]},useDebugValue:Sf,useDeferredValue:function(n,a){var s=pn();return _f(s,n,a)},useTransition:function(){var n=bf(!1);return n=sy.bind(null,Ue,n.queue,!0,!1),pn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,s){var c=Ue,h=pn();if(Xe){if(s===void 0)throw Error(i(407));s=s()}else{if(s=a(),gt===null)throw Error(i(349));(Ye&127)!==0||zv(c,a,s)}h.memoizedState=s;var g={value:s,getSnapshot:a};return h.queue=g,Xv($v.bind(null,c,g,n),[n]),c.flags|=2048,hs(9,{destroy:void 0},Lv.bind(null,c,g,s,a),null),s},useId:function(){var n=pn(),a=gt.identifierPrefix;if(Xe){var s=wr,c=xr;s=(c&~(1<<32-ye(c)-1)).toString(32)+s,a="_"+a+"R_"+s,s=nc++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?C.createElement(h,{is:c.is}):C.createElement(h)}}g[Wt]=a,g[wn]=c;e:for(C=a.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===a)break e;for(;C.sibling===null;){if(C.return===null||C.return===a)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}a.stateNode=g;e:switch(rn(g,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Br(a)}}return yt(a),Ff(a,a.type,n===null?null:n.memoizedProps,a.pendingProps,s),null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==c&&Br(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(i(166));if(n=fe.current,as(a)){if(n=a.stateNode,s=a.memoizedProps,c=null,h=en,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}n[Wt]=a,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||D0(n.nodeValue,s)),n||ha(a,!0)}else n=Tc(n).createTextNode(c),n[Wt]=a,a.stateNode=n}return yt(a),null;case 31:if(s=a.memoizedState,n===null||n.memoizedState!==null){if(c=as(a),s!==null){if(n===null){if(!c)throw Error(i(318));if(n=a.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(i(557));n[Wt]=a}else li(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;yt(a),n=!1}else s=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return a.flags&256?(zn(a),a):(zn(a),null);if((a.flags&128)!==0)throw Error(i(558))}return yt(a),null;case 13:if(c=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=as(a),c!==null&&c.dehydrated!==null){if(n===null){if(!h)throw Error(i(318));if(h=a.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(i(317));h[Wt]=a}else li(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;yt(a),h=!1}else h=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return a.flags&256?(zn(a),a):(zn(a),null)}return zn(a),(a.flags&128)!==0?(a.lanes=s,a):(s=c!==null,n=n!==null&&n.memoizedState!==null,s&&(c=a.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048)),s!==n&&s&&(a.child.flags|=8192),hc(a,a.updateQueue),yt(a),null);case 4:return xe(),n===null&&lh(a.stateNode.containerInfo),yt(a),null;case 10:return Fr(a.type),yt(a),null;case 19:if(M(Mt),c=a.memoizedState,c===null)return yt(a),null;if(h=(a.flags&128)!==0,g=c.rendering,g===null)if(h)jo(c,!1);else{if(Tt!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(g=ec(n),g!==null){for(a.flags|=128,jo(c,!1),n=g.updateQueue,a.updateQueue=n,hc(a,n),a.subtreeFlags=0,n=s,s=a.child;s!==null;)dv(s,n),s=s.sibling;return U(Mt,Mt.current&1|2),Xe&&Ir(a,c.treeForkCount),a.child}n=n.sibling}c.tail!==null&&zt()>yc&&(a.flags|=128,h=!0,jo(c,!1),a.lanes=4194304)}else{if(!h)if(n=ec(g),n!==null){if(a.flags|=128,h=!0,n=n.updateQueue,a.updateQueue=n,hc(a,n),jo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Xe)return yt(a),null}else 2*zt()-c.renderingStartTime>yc&&s!==536870912&&(a.flags|=128,h=!0,jo(c,!1),a.lanes=4194304);c.isBackwards?(g.sibling=a.child,a.child=g):(n=c.last,n!==null?n.sibling=g:a.child=g,c.last=g)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=zt(),n.sibling=null,s=Mt.current,U(Mt,h?s&1|2:s&1),Xe&&Ir(a,c.treeForkCount),n):(yt(a),null);case 22:case 23:return zn(a),cf(),c=a.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(s&536870912)!==0&&(a.flags&128)===0&&(yt(a),a.subtreeFlags&6&&(a.flags|=8192)):yt(a),s=a.updateQueue,s!==null&&hc(a,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==s&&(a.flags|=2048),n!==null&&M(di),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),a.memoizedState.cache!==s&&(a.flags|=2048),Fr(Lt),yt(a),null;case 25:return null;case 30:return null}throw Error(i(156,a.tag))}function _R(n,a){switch(Zd(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Fr(Lt),xe(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return Fe(a),null;case 31:if(a.memoizedState!==null){if(zn(a),a.alternate===null)throw Error(i(340));li()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 13:if(zn(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(i(340));li()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return M(Mt),null;case 4:return xe(),null;case 10:return Fr(a.type),null;case 22:case 23:return zn(a),cf(),n!==null&&M(di),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Fr(Lt),null;case 25:return null;default:return null}}function Iy(n,a){switch(Zd(a),a.tag){case 3:Fr(Lt),xe();break;case 26:case 27:case 5:Fe(a);break;case 4:xe();break;case 31:a.memoizedState!==null&&zn(a);break;case 13:zn(a);break;case 19:M(Mt);break;case 10:Fr(a.type);break;case 22:case 23:zn(a),cf(),n!==null&&M(di);break;case 24:Fr(Lt)}}function To(n,a){try{var s=a.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&n)===n){c=void 0;var g=s.create,C=s.inst;c=g(),C.destroy=c}s=s.next}while(s!==h)}}catch(j){lt(a,a.return,j)}}function xa(n,a,s){try{var c=a.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var g=h.next;c=g;do{if((c.tag&n)===n){var C=c.inst,j=C.destroy;if(j!==void 0){C.destroy=void 0,h=a;var z=s,G=j;try{G()}catch(ae){lt(h,z,ae)}}}c=c.next}while(c!==g)}}catch(ae){lt(a,a.return,ae)}}function Py(n){var a=n.updateQueue;if(a!==null){var s=n.stateNode;try{Ov(a,s)}catch(c){lt(n,n.return,c)}}}function Fy(n,a,s){s.props=gi(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){lt(n,a,c)}}function Oo(n,a){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(h){lt(n,a,h)}}function Sr(n,a){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){lt(n,a,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){lt(n,a,h)}else s.current=null}function Vy(n){var a=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){lt(n,n.return,h)}}function Vf(n,a,s){try{var c=n.stateNode;qR(c,n.type,s,a),c[wn]=a}catch(h){lt(n,n.return,h)}}function Uy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ja(n.type)||n.tag===4}function Uf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Uy(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ja(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hf(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,a):(a=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,a.appendChild(n),s=s._reactRootContainer,s!=null||a.onclick!==null||(a.onclick=zr));else if(c!==4&&(c===27&&ja(n.type)&&(s=n.stateNode,a=null),n=n.child,n!==null))for(Hf(n,a,s),n=n.sibling;n!==null;)Hf(n,a,s),n=n.sibling}function mc(n,a,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?s.insertBefore(n,a):s.appendChild(n);else if(c!==4&&(c===27&&ja(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(mc(n,a,s),n=n.sibling;n!==null;)mc(n,a,s),n=n.sibling}function Hy(n){var a=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,h=a.attributes;h.length;)a.removeAttributeNode(h[0]);rn(a,c,s),a[Wt]=n,a[wn]=s}catch(g){lt(n,n.return,g)}}var qr=!1,Pt=!1,Bf=!1,By=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function CR(n,a){if(n=n.containerInfo,dh=zc,n=nv(n),Ld(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var C=0,j=-1,z=-1,G=0,ae=0,ce=n,Q=null;t:for(;;){for(var W;ce!==s||h!==0&&ce.nodeType!==3||(j=C+h),ce!==g||c!==0&&ce.nodeType!==3||(z=C+c),ce.nodeType===3&&(C+=ce.nodeValue.length),(W=ce.firstChild)!==null;)Q=ce,ce=W;for(;;){if(ce===n)break t;if(Q===s&&++G===h&&(j=C),Q===g&&++ae===c&&(z=C),(W=ce.nextSibling)!==null)break;ce=Q,Q=ce.parentNode}ce=W}s=j===-1||z===-1?null:{start:j,end:z}}else s=null}s=s||{start:0,end:0}}else s=null;for(fh={focusedElem:n,selectionRange:s},zc=!1,Kt=a;Kt!==null;)if(a=Kt,n=a.child,(a.subtreeFlags&1028)!==0&&n!==null)n.return=a,Kt=n;else for(;Kt!==null;){switch(a=Kt,g=a.alternate,n=a.flags,a.tag){case 0:if((n&4)!==0&&(n=a.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s title"))),rn(g,c,s),g[Wt]=n,Zt(g),c=g;break e;case"link":var C=Q0("link","href",h).get(c+(s.href||""));if(C){for(var j=0;jht&&(C=ht,ht=ke,ke=C);var V=ev(j,ke),$=ev(j,ht);if(V&&$&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==$.node||W.focusOffset!==$.offset)){var q=ce.createRange();q.setStart(V.node,V.offset),W.removeAllRanges(),ke>ht?(W.addRange(q),W.extend($.node,$.offset)):(q.setEnd($.node,$.offset),W.addRange(q))}}}}for(ce=[],W=j;W=W.parentNode;)W.nodeType===1&&ce.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;js?32:s,L.T=null,s=Xf,Xf=null;var g=Ca,C=Qr;if(Ht=0,ys=Ca=null,Qr=0,(nt&6)!==0)throw Error(i(331));var j=nt;if(nt|=4,t0(g.current),Jy(g,g.current,C,s),nt=j,zo(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(F,g)}catch{}return!0}finally{K.p=h,L.T=c,b0(n,a)}}function w0(n,a,s){a=qn(s,a),a=Af(n.stateNode,a,2),n=va(n,a,2),n!==null&&(Ct(n,2),_r(n))}function lt(n,a,s){if(n.tag===3)w0(n,n,s);else for(;a!==null;){if(a.tag===3){w0(a,n,s);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(_a===null||!_a.has(c))){n=qn(s,n),s=Sy(2),c=va(a,s,2),c!==null&&(_y(s,c,a,n),Ct(c,2),_r(c));break}}a=a.return}}function th(n,a,s){var c=n.pingCache;if(c===null){c=n.pingCache=new jR;var h=new Set;c.set(a,h)}else h=c.get(a),h===void 0&&(h=new Set,c.set(a,h));h.has(s)||(Zf=!0,h.add(s),n=NR.bind(null,n,a,s),a.then(n,n))}function NR(n,a,s){var c=n.pingCache;c!==null&&c.delete(a),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,gt===n&&(Ye&s)===s&&(Tt===4||Tt===3&&(Ye&62914560)===Ye&&300>zt()-vc?(nt&2)===0&&bs(n,0):Kf|=s,vs===Ye&&(vs=0)),_r(n)}function S0(n,a){a===0&&(a=Gt()),n=si(n,a),n!==null&&(Ct(n,a),_r(n))}function DR(n){var a=n.memoizedState,s=0;a!==null&&(s=a.retryLane),S0(n,s)}function kR(n,a){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(a),S0(n,s)}function zR(n,a){return rr(n,a)}var Cc=null,ws=null,nh=!1,Ec=!1,rh=!1,Ra=0;function _r(n){n!==ws&&n.next===null&&(ws===null?Cc=ws=n:ws=ws.next=n),Ec=!0,nh||(nh=!0,$R())}function zo(n,a){if(!rh&&Ec){rh=!0;do for(var s=!1,c=Cc;c!==null;){if(n!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var C=c.suspendedLanes,j=c.pingedLanes;g=(1<<31-ye(42|n)+1)-1,g&=h&~(C&~j),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,R0(c,g))}else g=Ye,g=Ae(c,c===gt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ut(c,g)||(s=!0,R0(c,g));c=c.next}while(s);rh=!1}}function LR(){_0()}function _0(){Ec=nh=!1;var n=0;Ra!==0&&ZR()&&(n=Ra);for(var a=zt(),s=null,c=Cc;c!==null;){var h=c.next,g=C0(c,a);g===0?(c.next=null,s===null?Cc=h:s.next=h,h===null&&(ws=s)):(s=c,(n!==0||(g&3)!==0)&&(Ec=!0)),c=h}Ht!==0&&Ht!==5||zo(n),Ra!==0&&(Ra=0)}function C0(n,a){for(var s=n.suspendedLanes,c=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0j)break;var ae=z.transferSize,ce=z.initiatorType;ae&&k0(ce)&&(z=z.responseEnd,C+=ae*(z"u"?null:document;function G0(n,a,s){var c=Ss;if(c&&typeof a=="string"&&a){var h=Hn(a);h='link[rel="'+n+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),q0.has(h)||(q0.add(h),n={rel:n,crossOrigin:s,href:a},c.querySelector(h)===null&&(a=c.createElement("link"),rn(a,"link",n),Zt(a),c.head.appendChild(a)))}}function n2(n){Xr.D(n),G0("dns-prefetch",n,null)}function r2(n,a){Xr.C(n,a),G0("preconnect",n,a)}function a2(n,a,s){Xr.L(n,a,s);var c=Ss;if(c&&n&&a){var h='link[rel="preload"][as="'+Hn(a)+'"]';a==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+Hn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+Hn(s.imageSizes)+'"]')):h+='[href="'+Hn(n)+'"]';var g=h;switch(a){case"style":g=_s(n);break;case"script":g=Cs(n)}Xn.has(g)||(n=v({rel:"preload",href:a==="image"&&s&&s.imageSrcSet?void 0:n,as:a},s),Xn.set(g,n),c.querySelector(h)!==null||a==="style"&&c.querySelector(Po(g))||a==="script"&&c.querySelector(Fo(g))||(a=c.createElement("link"),rn(a,"link",n),Zt(a),c.head.appendChild(a)))}}function i2(n,a){Xr.m(n,a);var s=Ss;if(s&&n){var c=a&&typeof a.as=="string"?a.as:"script",h='link[rel="modulepreload"][as="'+Hn(c)+'"][href="'+Hn(n)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Cs(n)}if(!Xn.has(g)&&(n=v({rel:"modulepreload",href:n},a),Xn.set(g,n),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Fo(g)))return}c=s.createElement("link"),rn(c,"link",n),Zt(c),s.head.appendChild(c)}}}function s2(n,a,s){Xr.S(n,a,s);var c=Ss;if(c&&n){var h=qi(c).hoistableStyles,g=_s(n);a=a||"default";var C=h.get(g);if(!C){var j={loading:0,preload:null};if(C=c.querySelector(Po(g)))j.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":a},s),(s=Xn.get(g))&&bh(n,s);var z=C=c.createElement("link");Zt(z),rn(z,"link",n),z._p=new Promise(function(G,ae){z.onload=G,z.onerror=ae}),z.addEventListener("load",function(){j.loading|=1}),z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ac(C,a,c)}C={type:"stylesheet",instance:C,count:1,state:j},h.set(g,C)}}}function o2(n,a){Xr.X(n,a);var s=Ss;if(s&&n){var c=qi(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0},a),(a=Xn.get(h))&&xh(n,a),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function l2(n,a){Xr.M(n,a);var s=Ss;if(s&&n){var c=qi(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0,type:"module"},a),(a=Xn.get(h))&&xh(n,a),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function Z0(n,a,s,c){var h=(h=fe.current)?Oc(h):null;if(!h)throw Error(i(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(a=_s(s.href),s=qi(h).hoistableStyles,c=s.get(a),c||(c={type:"style",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=_s(s.href);var g=qi(h).hoistableStyles,C=g.get(n);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,C),(g=h.querySelector(Po(n)))&&!g._p&&(C.instance=g,C.state.loading=5),Xn.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Xn.set(n,s),g||c2(h,n,s,C.state))),a&&c===null)throw Error(i(528,""));return C}if(a&&c!==null)throw Error(i(529,""));return null;case"script":return a=s.async,s=s.src,typeof s=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=Cs(s),s=qi(h).hoistableScripts,c=s.get(a),c||(c={type:"script",instance:null,count:0,state:null},s.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,n))}}function _s(n){return'href="'+Hn(n)+'"'}function Po(n){return'link[rel="stylesheet"]['+n+"]"}function K0(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function c2(n,a,s,c){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=n.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),rn(a,"link",s),Zt(a),n.head.appendChild(a))}function Cs(n){return'[src="'+Hn(n)+'"]'}function Fo(n){return"script[async]"+n}function Y0(n,a,s){if(a.count++,a.instance===null)switch(a.type){case"style":var c=n.querySelector('style[data-href~="'+Hn(s.href)+'"]');if(c)return a.instance=c,Zt(c),c;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),Zt(c),rn(c,"style",h),Ac(c,s.precedence,n),a.instance=c;case"stylesheet":h=_s(s.href);var g=n.querySelector(Po(h));if(g)return a.state.loading|=4,a.instance=g,Zt(g),g;c=K0(s),(h=Xn.get(h))&&bh(c,h),g=(n.ownerDocument||n).createElement("link"),Zt(g);var C=g;return C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),a.state.loading|=4,Ac(g,s.precedence,n),a.instance=g;case"script":return g=Cs(s.src),(h=n.querySelector(Fo(g)))?(a.instance=h,Zt(h),h):(c=s,(h=Xn.get(g))&&(c=v({},s),xh(c,h)),n=n.ownerDocument||n,h=n.createElement("script"),Zt(h),rn(h,"link",c),n.head.appendChild(h),a.instance=h);case"void":return null;default:throw Error(i(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Ac(c,s.precedence,n));return a.instance}function Ac(n,a,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,g=h,C=0;C title"):null)}function u2(n,a,s){if(s===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(n=a.disabled,typeof a.precedence=="string"&&n==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function J0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function d2(n,a,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=_s(c.href),g=a.querySelector(Po(h));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(n.count++,n=Nc.bind(n),a.then(n,n)),s.state.loading|=4,s.instance=g,Zt(g);return}g=a.ownerDocument||a,c=K0(c),(h=Xn.get(h))&&bh(c,h),g=g.createElement("link"),Zt(g);var C=g;C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),s.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,a),(a=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Nc.bind(n),a.addEventListener("load",s),a.addEventListener("error",s))}}var wh=0;function f2(n,a){return n.stylesheets&&n.count===0&&kc(n,n.stylesheets),0wh?50:800)+a);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Nc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Dc=null;function kc(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Dc=new Map,a.forEach(h2,n),Dc=null,Nc.call(n))}function h2(n,a){if(!(a.state.loading&4)){var s=Dc.get(n);if(s)var c=s.get(null);else{s=new Map,Dc.set(n,s);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ah.exports=M2(),Ah.exports}var D2=N2(),yl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},k2=class extends yl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},op=new k2,z2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},L2=class{#e=z2;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Si=new L2;function $2(e){setTimeout(e,0)}var I2=typeof window>"u"||"Deno"in globalThis;function On(){}function P2(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function _w(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ia(e,t){return typeof e=="function"?e(t):e}function Pn(e,t){return typeof e=="function"?e(t):e}function Sb(e,t){const{type:r="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(i){if(t.queryHash!==lp(u,t.options))return!1}else if(!ll(t.queryKey,u))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||l&&!l(t))}function _b(e,t){const{exact:r,status:i,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(ol(t.options.mutationKey)!==ol(l))return!1}else if(!ll(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||o&&!o(t))}function lp(e,t){return(t?.queryKeyHashFn||ol)(e)}function ol(e){return JSON.stringify(e,(t,r)=>gm(r)?Object.keys(r).sort().reduce((i,o)=>(i[o]=r[o],i),{}):r)}function ll(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ll(e[r],t[r])):!1}var F2=Object.prototype.hasOwnProperty;function Cw(e,t,r=0){if(e===t)return e;if(r>500)return t;const i=Cb(e)&&Cb(t);if(!i&&!(gm(e)&&gm(t)))return t;const l=(i?e:Object.keys(e)).length,u=i?t:Object.keys(t),d=u.length,m=i?new Array(d):{};let p=0;for(let y=0;y{Si.setTimeout(t,e)})}function vm(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Cw(e,t):t}function U2(e,t,r=0){const i=[...e,t];return r&&i.length>r?i.slice(1):i}function H2(e,t,r=0){const i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var cp=Symbol();function Ew(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rw(e,t){return typeof e=="function"?e(...t):!!e}function B2(e,t,r){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),i||(i=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var cl=(()=>{let e=()=>I2;return{isServer(){return e()},setIsServer(t){e=t}}})();function ym(){let e,t;const r=new Promise((o,l)=>{e=o,t=l});r.status="pending",r.catch(()=>{});function i(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{i({status:"fulfilled",value:o}),e(o)},r.reject=o=>{i({status:"rejected",reason:o}),t(o)},r}var q2=$2;function G2(){let e=[],t=0,r=d=>{d()},i=d=>{d()},o=q2;const l=d=>{t?e.push(d):o(()=>{r(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{i(()=>{d.forEach(m=>{r(m)})})})};return{batch:d=>{let m;t++;try{m=d()}finally{t--,t||u()}return m},batchCalls:d=>(...m)=>{l(()=>{d(...m)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{i=d},setScheduler:d=>{o=d}}}var on=G2(),Z2=class extends yl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},mu=new Z2;function K2(e){return Math.min(1e3*2**e,3e4)}function jw(e){return(e??"online")==="online"?mu.isOnline():!0}var bm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Tw(e){let t=!1,r=0,i;const o=ym(),l=()=>o.status!=="pending",u=_=>{if(!l()){const E=new bm(_);b(E),e.onCancel?.(E)}},d=()=>{t=!0},m=()=>{t=!1},p=()=>op.isFocused()&&(e.networkMode==="always"||mu.isOnline())&&e.canRun(),y=()=>jw(e.networkMode)&&e.canRun(),v=_=>{l()||(i?.(),o.resolve(_))},b=_=>{l()||(i?.(),o.reject(_))},x=()=>new Promise(_=>{i=E=>{(l()||p())&&_(E)},e.onPause?.()}).then(()=>{i=void 0,l()||e.onContinue?.()}),w=()=>{if(l())return;let _;const E=r===0?e.initialPromise:void 0;try{_=E??e.fn()}catch(R){_=Promise.reject(R)}Promise.resolve(_).then(v).catch(R=>{if(l())return;const T=e.retry??(cl.isServer()?0:3),O=e.retryDelay??K2,N=typeof O=="function"?O(r,R):O,k=T===!0||typeof T=="number"&&rp()?void 0:x()).then(()=>{t?b(R):w()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(i?.(),o),cancelRetry:d,continueRetry:m,canStart:y,start:()=>(y()?w():x().then(w),o)}}var Ow=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&(this.#e=Si.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Si.clearTimeout(this.#e),this.#e=void 0)}};function Y2(e){return{onFetch:(t,r)=>{const i=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let y=!1;const v=w=>{B2(w,()=>t.signal,()=>y=!0)},b=Ew(t.options,t.fetchOptions),x=async(w,_,E)=>{if(y)return Promise.reject(t.signal.reason);if(_==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:_,direction:E?"backward":"forward",meta:t.options.meta};return v(B),B})(),O=await b(T),{maxPages:N}=t.options,k=E?H2:U2;return{pages:k(w.pages,O,N),pageParams:k(w.pageParams,_,N)}};if(o&&l.length){const w=o==="backward",_=w?Aw:xm,E={pages:l,pageParams:u},R=_(i,E);d=await x(E,R,w)}else{const w=e??l.length;do{const _=m===0?u[0]??i.initialPageParam:xm(i,d);if(m>0&&_==null)break;d=await x(d,_),m++}while(mt.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=p}}}function xm(e,{pages:t,pageParams:r}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,r[i],r):void 0}function Aw(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function Q2(e,t){return t?xm(e,t)!=null:!1}function X2(e,t){return!t||!e.getPreviousPageParam?!1:Aw(e,t)!=null}var J2=class extends Ow{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=jb(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=jb(this.options);t.data!==void 0&&(this.setState(Rb(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=vm(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(On).catch(On):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ia(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!_w(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#u()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,i=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},o=()=>{const m=Ew(this.options,t),y=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return i(v),v})();return this.#s=!1,this.options.persister?this.options.persister(m,y,this):m(y)},u=(()=>{const m={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:o};return i(m),m})();(this.#e==="infinite"?Y2(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#a=Tw({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:m=>{m instanceof bm&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(m,p)=>{this.#l({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const m=await this.#a.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#r.config.onSuccess?.(m,this),this.#r.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof bm){if(m.silent)return this.#a.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#l({type:"error",error:m}),this.#r.config.onError?.(m,this),this.#r.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#l(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Mw(r.data,this.options),fetchMeta:e.meta??null};case"success":const i={...r,...Rb(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?i:void 0,i;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),on.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Mw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,i=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Nw=class extends yl{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ym(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#u;#l;#m;#d;#f;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Tb(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!pm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&Ob(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),i&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||Ia(this.options.staleTime,this.#t)!==Ia(t.staleTime,this.#t))&&this.#g();const o=this.#v();i&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return ej(this,r)&&(this.#r=r,this.#a=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(r,i)=>(this.trackProp(i),t?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(On)),t}#g(){this.#x();const e=Ia(this.options.staleTime,this.#t);if(cl.isServer()||this.#r.isStale||!mm(e))return;const r=_w(this.#r.dataUpdatedAt,e)+1;this.#d=Si.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(cl.isServer()||Pn(this.options.enabled,this.#t)===!1||!mm(this.#c)||this.#c===0)&&(this.#f=Si.setInterval(()=>{(this.options.refetchIntervalInBackground||op.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#d!==void 0&&(Si.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Si.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,i=this.options,o=this.#r,l=this.#i,u=this.#a,m=e!==r?e.state:this.#n,{state:p}=e;let y={...p},v=!1,b;if(t._optimisticResults){const I=this.hasListeners(),ne=!I&&Tb(e,t),pe=I&&Ob(e,r,t,i);(ne||pe)&&(y={...y,...Mw(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:_}=y;b=y.data;let E=!1;if(t.placeholderData!==void 0&&b===void 0&&_==="pending"){let I;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(I=o.data,E=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,I!==void 0&&(_="success",b=vm(o?.data,I,t),v=!0)}if(t.select&&b!==void 0&&!E)if(o&&b===l?.data&&t.select===this.#u)b=this.#l;else try{this.#u=t.select,b=t.select(b),b=vm(o?.data,b,t),this.#l=b,this.#s=null}catch(I){this.#s=I}this.#s&&(x=this.#s,b=this.#l,w=Date.now(),_="error");const R=y.fetchStatus==="fetching",T=_==="pending",O=_==="error",N=T&&R,k=b!==void 0,H={status:_,fetchStatus:y.fetchStatus,isPending:T,isSuccess:_==="success",isError:O,isInitialLoading:N,isLoading:N,data:b,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:R,isRefetching:R&&!T,isLoadingError:O&&!k,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:O&&k,isStale:up(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Pn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=H.data!==void 0,ne=H.status==="error"&&!I,pe=de=>{ne?de.reject(H.error):I&&de.resolve(H.data)},ge=()=>{const de=this.#o=H.promise=ym();pe(de)},he=this.#o;switch(he.status){case"pending":e.queryHash===r.queryHash&&pe(he);break;case"fulfilled":(ne||H.data!==he.value)&&ge();break;case"rejected":(!ne||H.error!==he.reason)&&ge();break}}return H}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#m=this.#t),pm(t,e))return;this.#r=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!this.#p.size)return!0;const l=new Set(o??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(u=>{const d=u;return this.#r[d]!==e[d]&&l.has(d)})};this.#_({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){on.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function W2(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(t.retryOnMount,e)===!1)}function Tb(e,t){return W2(e,t)||e.state.data!==void 0&&wm(e,t,t.refetchOnMount)}function wm(e,t,r){if(Pn(t.enabled,e)!==!1&&Ia(t.staleTime,e)!=="static"){const i=typeof r=="function"?r(e):r;return i==="always"||i!==!1&&up(e,t)}return!1}function Ob(e,t,r,i){return(e!==t||Pn(i.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&up(e,r)}function up(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Ia(t.staleTime,e))}function ej(e,t){return!pm(e.getCurrentResult(),t)}var tj=class extends Nw{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,i=super.createResult(e,t),{isFetching:o,isRefetching:l,isError:u,isRefetchError:d}=i,m=r.fetchMeta?.fetchMore?.direction,p=u&&m==="forward",y=o&&m==="forward",v=u&&m==="backward",b=o&&m==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Q2(t,r.data),hasPreviousPage:X2(t,r.data),isFetchNextPageError:p,isFetchingNextPage:y,isFetchPreviousPageError:v,isFetchingPreviousPage:b,isRefetchError:d&&!p&&!v,isRefetching:l&&!y&&!b}}},nj=class extends Ow{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||rj(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Tw({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#i({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#r.canStart();try{if(i)t();else{this.#i({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#i({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#r.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#i({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#i({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#i(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),on.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function rj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aj=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,r){const i=new nj({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(i),i}add(e){this.#e.add(e);const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uc(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Uc(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){on.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>_b(t,r))}findAll(e={}){return this.getAll().filter(t=>_b(e,t))}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return on.batch(()=>Promise.all(e.map(t=>t.continue().catch(On))))}};function Uc(e){return e.options.scope?.id}var ij=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const i=t.queryKey,o=t.queryHash??lp(i,t);let l=this.get(o);return l||(l=new J2({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){on.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Sb(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Sb(e,r)):t}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){on.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){on.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},sj=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ij,this.#t=e.mutationCache||new aj,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=op.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ia(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const i=r.data;return[t,i]})}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=P2(t,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return on.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;on.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return on.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},i=on.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(i).then(On).catch(On)}invalidateQueries(e,t={}){return on.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},i=on.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,r);return r.throwOnError||(l=l.catch(On)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(On)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Ia(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(On).catch(On)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(On).catch(On)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return mu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ol(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(i=>{ll(e,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(e,t){this.#i.set(ol(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],r={};return t.forEach(i=>{ll(e,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cp&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Dw=S.createContext(void 0),ki=e=>{const t=S.useContext(Dw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oj=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Dw.Provider,{value:e,children:t})),kw=S.createContext(!1),lj=()=>S.useContext(kw);kw.Provider;function cj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uj=S.createContext(cj()),dj=()=>S.useContext(uj),fj=(e,t,r)=>{const i=r?.state.error&&typeof e.throwOnError=="function"?Rw(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},hj=e=>{S.useEffect(()=>{e.clearReset()},[e])},mj=({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||Rw(r,[e.error,i])),pj=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>r(i(...o)):r(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},gj=(e,t)=>e.isLoading&&e.isFetching&&!t,vj=(e,t)=>e?.suspense&&t.isPending,Ab=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function zw(e,t,r){const i=lj(),o=dj(),l=ki(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=l.getQueryCache().get(u.queryHash),m=e.subscribed!==!1;u._optimisticResults=i?"isRestoring":m?"optimistic":void 0,pj(u),fj(u,o,d),hj(o);const p=!l.getQueryCache().get(u.queryHash),[y]=S.useState(()=>new t(l,u)),v=y.getOptimisticResult(u),b=!i&&m;if(S.useSyncExternalStore(S.useCallback(x=>{const w=b?y.subscribe(on.batchCalls(x)):On;return y.updateResult(),w},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),S.useEffect(()=>{y.setOptions(u)},[u,y]),vj(u,v))throw Ab(u,y,o);if(mj({result:v,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw v.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,v),u.experimental_prefetchInRender&&!cl.isServer()&&gj(v,i)&&(p?Ab(u,y,o):d?.promise)?.catch(On).finally(()=>{y.updateResult()}),u.notifyOnChangeProps?v:y.trackResult(v)}function Ft(e,t){return zw(e,Nw)}function yj(e,t){return zw(e,tj)}let Mb=!1;function bj(e){const t=e.analytics;if(!t?.key||Mb)return;Mb=!0;const r=document.createElement("script");r.src=t.host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",r.async=!0,r.onload=()=>{const i=window.posthog;i&&(i.init(t.key,{api_host:t.host,defaults:"2026-05-30",capture_pageview:"history_change",session_recording:{maskAllInputs:!0,maskTextSelector:"*"}}),e.me&&i.identify(e.me.email,{email:e.me.email,name:e.me.name,...e.billing?{plan:e.billing.plan}:{}}))},document.head.appendChild(r)}function Lw(e,t){window.posthog?.capture(e,t)}const xj=[[/^POST \/api\/projects$/,"project_created"],[/^DELETE \/api\/projects\//,"project_deleted"],[/^POST \/api\/p\/[^/]+\/restore$/,"file_restored"],[/^DELETE \/api\/shares\//,"share_revoked"],[/^PATCH \/api\/shares\//,"share_expiry_changed"],[/^POST \/api\/orgs\/[^/]+\/invites$/,"invite_created"],[/^DELETE \/api\/orgs\/[^/]+\/invites\//,"invite_revoked"],[/^POST \/api\/invites\//,"invite_accepted"],[/^PUT \/api\/p\/[^/]+\/permissions\/./,"project_access_granted"],[/^DELETE \/api\/p\/[^/]+\/permissions\/./,"project_access_revoked"]];function $w(e,t){const r=e+" "+t.split("?")[0],i=xj.find(([o])=>o.test(r));i&&Lw(i[1])}function dp(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}function wj(e,t){const r=t.trim();switch(e){case 403:return r.includes("seat")?"This plan is out of seats. Upgrade to add more people.":r.includes("owner")?"Only owners can do that.":"You don't have access to that.";case 409:return r?r[0].toUpperCase()+r.slice(1):"That is managed outside this hub.";case 404:return"That is gone — it may have been removed already.";case 413:return"This project is over its plan limit.";case 429:return"Too many requests. Give it a moment.";default:return e>=500?"The server had a problem. Try again.":r?r[0].toUpperCase()+r.slice(1):"Something went wrong."}}async function Nu(e){throw new Error(wj(e.status,await e.text()))}async function qt(e){const t=await fetch(e,{headers:{Accept:"application/json"}});return t.status===401&&dp(),t.ok||await Nu(t),t.json()}async function Sj(e){const t=await fetch(e);return t.status===401&&dp(),t.ok||await Nu(t),t}async function Wn(e,t,r){const i={method:e};r!==void 0&&(i.headers={"Content-Type":"application/json"},i.body=JSON.stringify(r));const o=await fetch(t,i);return o.ok||await Nu(o),$w(e,t),o.status===204?{}:o.json()}async function ea(e,t){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return r.status===401&&dp(),r.ok||await Nu(r),$w("POST",e),r.json()}function _j(){return Ft({queryKey:["config"],queryFn:async()=>{const e=await qt("/api/config");return e.auth.enabled&&!e.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),bj(e),e},staleTime:1/0})}var zi=Sw();const Cj=ww(zi);function Nb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gs(...e){return t=>{let r=!1;const i=e.map(o=>{const l=Nb(o,t);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;o{let{children:o,...l}=r,u=null,d=!1;const m=[];Db(o)&&typeof Hc=="function"&&(o=Hc(o._payload)),S.Children.forEach(o,b=>{if(Aj(b)){d=!0;const x=b;let w="child"in x.props?x.props.child:x.props.children;Db(w)&&typeof Hc=="function"&&(w=Hc(w._payload)),u=jj(x,w),m.push(u?.props?.children)}else m.push(b)}),u?u=S.cloneElement(u,void 0,m):!d&&S.Children.count(o)===1&&S.isValidElement(o)&&(u=o);const p=u?Oj(u):void 0,y=at(i,p);if(!u){if(o||o===0)throw new Error(d?kj(e):Dj(e));return o}const v=Tj(l,u.props??{});return u.type!==S.Fragment&&(v.ref=i?y:p),S.cloneElement(u,v)});return t.displayName=`${e}.Slot`,t}var Ej=Ei("Slot"),Iw=Symbol.for("radix.slottable");function Rj(e){const t=r=>"child"in r?r.children(r.child):r.children;return t.displayName=`${e}.Slottable`,t.__radixId=Iw,t}var jj=(e,t)=>{if("child"in e.props){const r=e.props.child;return S.isValidElement(r)?S.cloneElement(r,void 0,e.props.children(r.props.children)):null}return S.isValidElement(t)?t:null};function Tj(e,t){const r={...t};for(const i in t){const o=e[i],l=t[i];/^on[A-Z]/.test(i)?o&&l?r[i]=(...d)=>{const m=l(...d);return o(...d),m}:o&&(r[i]=o):i==="style"?r[i]={...o,...l}:i==="className"&&(r[i]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function Oj(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Aj(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iw}var Mj=Symbol.for("react.lazy");function Db(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Mj&&"_payload"in e&&Nj(e._payload)}function Nj(e){return typeof e=="object"&&e!==null&&"then"in e}var Dj=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,kj=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Hc=Mu[" use ".trim().toString()],zj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=zj.reduce((e,t)=>{const r=Ei(`Primitive.${t}`),i=S.forwardRef((o,l)=>{const{asChild:u,...d}=o,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function Pw(e,t){e&&zi.flushSync(()=>e.dispatchEvent(t))}var Fw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Lj="VisuallyHidden",Vw=S.forwardRef((e,t)=>f.jsx(Pe.span,{...e,ref:t,style:{...Fw,...e.style}}));Vw.displayName=Lj;var $j=Vw;function Ka(e,t=[]){let r=[];function i(l,u){const d=S.createContext(u);d.displayName=l+"Context";const m=r.length;r=[...r,u];const p=v=>{const{scope:b,children:x,...w}=v,_=b?.[e]?.[m]||d,E=S.useMemo(()=>w,Object.values(w));return f.jsx(_.Provider,{value:E,children:x})};p.displayName=l+"Provider";function y(v,b,x={}){const{optional:w=!1}=x,_=b?.[e]?.[m]||d,E=S.useContext(_);if(E)return E;if(u!==void 0)return u;if(!w)throw new Error(`\`${v}\` must be used within \`${l}\``)}return[p,y]}const o=()=>{const l=r.map(u=>S.createContext(u));return function(d){const m=d?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return o.scopeName=e,[i,Ij(o,...t)]}function Ij(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const i=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=i.reduce((d,{useScope:m,scopeName:p})=>{const v=m(l)[`__scope${p}`];return{...d,...v}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function fp(e){const t=e+"CollectionProvider",[r,i]=Ka(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=_=>{const{scope:E,children:R}=_,T=S.useRef(null),O=S.useRef(new Map).current;return f.jsx(o,{scope:E,itemMap:O,collectionRef:T,children:R})};u.displayName=t;const d=e+"CollectionSlot",m=Ei(d),p=S.forwardRef((_,E)=>{const{scope:R,children:T}=_,O=l(d,R),N=at(E,O.collectionRef);return f.jsx(m,{ref:N,children:T})});p.displayName=d;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=Ei(y),x=S.forwardRef((_,E)=>{const{scope:R,children:T,...O}=_,N=S.useRef(null),k=at(E,N),B=l(y,R);return S.useEffect(()=>(B.itemMap.set(N,{ref:N,...O}),()=>{B.itemMap.delete(N)})),f.jsx(b,{[v]:"",ref:k,children:T})});x.displayName=y;function w(_){const E=l(e+"CollectionConsumer",_);return S.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const O=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((B,H)=>O.indexOf(B.ref.current)-O.indexOf(H.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:u,Slot:p,ItemSlot:x},w,i]}function Te(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o||!o.defaultPrevented)return t?.(o)}}var Qt=globalThis?.document?S.useLayoutEffect:()=>{},Pj=Mu[" useInsertionEffect ".trim().toString()]||Qt;function Zs({prop:e,defaultProp:t,onChange:r=()=>{},caller:i}){const[o,l,u]=Fj({defaultProp:t,onChange:r}),d=e!==void 0,m=d?e:o;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const v=y.current;v!==d&&console.warn(`${i} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=d},[d,i])}const p=S.useCallback(y=>{if(d){const v=Vj(y)?y(e):y;v!==e&&u.current?.(v)}else l(y)},[d,e,l,u]);return[m,p]}function Fj({defaultProp:e,onChange:t}){const[r,i]=S.useState(e),o=S.useRef(r),l=S.useRef(t);return Pj(()=>{l.current=t},[t]),S.useEffect(()=>{o.current!==r&&(l.current?.(r),o.current=r)},[r,o]),[r,i,l]}function Vj(e){return typeof e=="function"}function Uj(e,t){return S.useReducer((r,i)=>t[r][i]??r,e)}var gr=e=>{const{present:t,children:r}=e,i=Hj(t),o=typeof r=="function"?r({present:i.isPresent}):S.Children.only(r),l=Bj(i.ref,qj(o));return typeof r=="function"||i.isPresent?S.cloneElement(o,{ref:l}):null};gr.displayName="Presence";function Hj(e){const[t,r]=S.useState(),i=S.useRef(null),o=S.useRef(e),l=S.useRef("none"),u=S.useRef(void 0),d=e?"mounted":"unmounted",[m,p]=Uj(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{m==="mounted"?(l.current=u.current??Zo(i.current),u.current=void 0):l.current="none"},[m]),Qt(()=>{const y=i.current,v=o.current;if(v!==e){const x=l.current,w=Zo(y);e?(u.current=w,p("MOUNT")):w==="none"||y?.display==="none"?p("UNMOUNT"):p(v&&x!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),Qt(()=>{if(t){let y;const v=t.ownerDocument.defaultView??window,b=w=>{const E=Zo(i.current).includes(CSS.escape(w.animationName));if(w.target===t&&E&&(p("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",y=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},x=w=>{w.target===t&&(l.current=Zo(i.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{v.clearTimeout(y),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:S.useCallback(y=>{if(y){const v=getComputedStyle(y);i.current=v,u.current=Zo(v)}else i.current=null;r(y)},[])}}function kb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bj(...e){const t=S.useRef(e);return t.current=e,S.useCallback(r=>{const i=t.current;let o=!1;const l=i.map(u=>{const d=kb(u,r);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u{}),Zj=0;function fn(e){const[t,r]=S.useState(Gj());return Qt(()=>{r(i=>i??String(Zj++))},[e]),t?`radix-${t}`:""}var Kj=S.createContext(void 0);function hp(e){const t=S.useContext(Kj);return e||t||"ltr"}function tr(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>((...r)=>t.current?.(...r)),[])}var Yj="DismissableLayer",Sm="dismissableLayer.update",Qj="dismissableLayer.pointerDownOutside",Xj="dismissableLayer.focusOutside",zb,mp=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),bl=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:m,...p}=e,y=S.useContext(mp),[v,b]=S.useState(null),x=v?.ownerDocument??globalThis?.document,[,w]=S.useState({}),_=at(t,b),E=Array.from(y.layers),[R]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=R?E.indexOf(R):-1,O=v?E.indexOf(v):-1,N=y.layersWithOutsidePointerEventsDisabled.size>0,k=O>=T,B=S.useRef(!1),H=nT(ge=>{l?.(ge),d?.(ge),ge.defaultPrevented||m?.()},{ownerDocument:x,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(ge=>{if(!(ge instanceof Node))return!1;const he=[...y.branches].some(de=>de.contains(ge));return k&&!he},[y.branches,k])}),I=rT(ge=>{if(i&&B.current)return;const he=ge.target;[...y.branches].some(Z=>Z.contains(he))||(u?.(ge),d?.(ge),ge.defaultPrevented||m?.())},x),ne=v?O===E.length-1:!1,pe=tr(ge=>{ge.key==="Escape"&&(o?.(ge),!ge.defaultPrevented&&m&&(ge.preventDefault(),m()))});return S.useEffect(()=>{if(ne)return x.addEventListener("keydown",pe,{capture:!0}),()=>x.removeEventListener("keydown",pe,{capture:!0})},[x,ne,pe]),S.useEffect(()=>{if(v)return r&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(zb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),Lb(),()=>{r&&(y.layersWithOutsidePointerEventsDisabled.delete(v),y.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=zb))}},[v,x,r,y]),S.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),Lb())},[v,y]),S.useEffect(()=>{const ge=()=>w({});return document.addEventListener(Sm,ge),()=>document.removeEventListener(Sm,ge)},[]),f.jsx(Pe.div,{...p,ref:_,style:{pointerEvents:N?k?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,H.onPointerDownCapture)})});bl.displayName=Yj;var Jj="DismissableLayerBranch",Wj=S.forwardRef((e,t)=>{const r=S.useContext(mp),i=S.useRef(null),o=at(t,i);return S.useEffect(()=>{const l=i.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),f.jsx(Pe.div,{...e,ref:o})});Wj.displayName=Jj;function eT(){const e=S.useContext(mp),[t,r]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}var tT=()=>!0;function nT(e,t){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=tT}=t,d=tr(e),m=S.useRef(!1),p=S.useRef(!1),y=S.useRef(new Map),v=S.useRef(()=>{});return S.useEffect(()=>{function b(){p.current=!1,o.current=!1,y.current.clear()}function x(){return Array.from(y.current.values()).some(Boolean)}function w(O){if(!p.current)return;const N=O.target;N instanceof Node&&[...l].some(B=>B.contains(N))||y.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{p.current&&v.current()},0)}function _(O){p.current&&y.current.set(O.type,!1)}const E=O=>{if(O.target&&!m.current){let N=function(){r.removeEventListener("click",v.current);const B=x();b(),B||Uw(Qj,d,k,{discrete:!0})};if(!u(O.target)){r.removeEventListener("click",v.current),b(),m.current=!1;return}const k={originalEvent:O};p.current=!0,o.current=i&&O.button===0,y.current.clear(),!i||O.button!==0?N():(r.removeEventListener("click",v.current),v.current=N,r.addEventListener("click",v.current,{once:!0}))}else r.removeEventListener("click",v.current),b();m.current=!1},R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of R)r.addEventListener(O,w,!0),r.addEventListener(O,_);const T=window.setTimeout(()=>{r.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(T),r.removeEventListener("pointerdown",E),r.removeEventListener("click",v.current);for(const O of R)r.removeEventListener(O,w,!0),r.removeEventListener(O,_)}},[r,d,i,o,l,u]),{onPointerDownCapture:()=>m.current=!0}}function rT(e,t=globalThis?.document){const r=tr(e),i=S.useRef(!1);return S.useEffect(()=>{const o=l=>{l.target&&!i.current&&Uw(Xj,r,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Lb(){const e=new CustomEvent(Sm);document.dispatchEvent(e)}function Uw(e,t,r,{discrete:i}){const o=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),i?Pw(o,l):o.dispatchEvent(l)}var kh="focusScope.autoFocusOnMount",zh="focusScope.autoFocusOnUnmount",$b={bubbles:!1,cancelable:!0},aT="FocusScope",Du=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:i=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,m]=S.useState(null),p=tr(o),y=tr(l),v=S.useRef(null),b=at(t,m),x=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(i){let _=function(O){if(x.paused||!d)return;const N=O.target;d.contains(N)?v.current=N:ka(v.current,{select:!0})},E=function(O){if(x.paused||!d)return;const N=O.relatedTarget;N!==null&&(d.contains(N)||ka(v.current,{select:!0}))},R=function(O){if(document.activeElement===document.body)for(const k of O)k.removedNodes.length>0&&ka(d)};document.addEventListener("focusin",_),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",E),T.disconnect()}}},[i,d,x.paused]),S.useEffect(()=>{if(d){Pb.add(x);const _=document.activeElement;if(!d.contains(_)){const R=new CustomEvent(kh,$b);d.addEventListener(kh,p),d.dispatchEvent(R),R.defaultPrevented||(iT(uT(Hw(d)),{select:!0}),document.activeElement===_&&ka(d))}return()=>{d.removeEventListener(kh,p),setTimeout(()=>{const R=new CustomEvent(zh,$b);d.addEventListener(zh,y),d.dispatchEvent(R),R.defaultPrevented||ka(_??document.body,{select:!0}),d.removeEventListener(zh,y),Pb.remove(x)},0)}}},[d,p,y,x]);const w=S.useCallback(_=>{if(!r&&!i||x.paused)return;const E=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,R=document.activeElement;if(E&&R){const T=_.currentTarget,[O,N]=sT(T);O&&N?!_.shiftKey&&R===N?(_.preventDefault(),r&&ka(O,{select:!0})):_.shiftKey&&R===O&&(_.preventDefault(),r&&ka(N,{select:!0})):R===T&&_.preventDefault()}},[r,i,x.paused]);return f.jsx(Pe.div,{tabIndex:-1,...u,ref:b,onKeyDown:w})});Du.displayName=aT;function iT(e,{select:t=!1}={}){const r=document.activeElement;for(const i of e)if(ka(i,{select:t}),document.activeElement!==r)return}function sT(e){const t=Hw(e),r=Ib(t,e),i=Ib(t.reverse(),e);return[r,i]}function Hw(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const o=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||o?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ib(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const i of e)if(!(r?!i.checkVisibility({checkVisibilityCSS:!0}):oT(i,{upTo:t})))return i}function oT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function lT(e){return e instanceof HTMLInputElement&&"select"in e}function ka(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&lT(e)&&t&&e.select()}}var Pb=cT();function cT(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Fb(e,t),e.unshift(t)},remove(t){e=Fb(e,t),e[0]?.resume()}}}function Fb(e,t){const r=[...e],i=r.indexOf(t);return i!==-1&&r.splice(i,1),r}function uT(e){return e.filter(t=>t.tagName!=="A")}var dT="Portal",xl=S.forwardRef((e,t)=>{const{container:r,...i}=e,[o,l]=S.useState(!1);Qt(()=>l(!0),[]);const u=r||o&&globalThis?.document?.body;return u?zi.createPortal(f.jsx(Pe.div,{...i,ref:t}),u):null});xl.displayName=dT;var Bc=0,Rs=null;function pp(){S.useEffect(()=>{Rs||(Rs={start:Vb(),end:Vb()});const{start:e,end:t}=Rs;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Bc++,()=>{Bc===1&&(Rs?.start.remove(),Rs?.end.remove(),Rs=null),Bc=Math.max(0,Bc-1)}},[])}function Vb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Tr=function(){return Tr=Object.assign||function(t){for(var r,i=1,o=arguments.length;i"u")return TT;var t=OT(e),r=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-r+t[2]-t[0])}},MT=Zw(),Ps="data-scroll-locked",NT=function(e,t,r,i){var o=e.left,l=e.top,u=e.right,d=e.gap;return r===void 0&&(r="margin"),`
- .`.concat(hT,` {
- overflow: hidden `).concat(i,`;
- padding-right: `).concat(d,"px ").concat(i,`;
+`+c.stack}}var At=Object.prototype.hasOwnProperty,rr=e.unstable_scheduleCallback,br=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,Vn=e.unstable_requestPaint,zt=e.unstable_now,Dr=e.unstable_getCurrentPriorityLevel,ir=e.unstable_ImmediatePriority,oi=e.unstable_UserBlockingPriority,ar=e.unstable_NormalPriority,li=e.unstable_LowPriority,Jt=e.unstable_IdlePriority,A=e.log,P=e.unstable_setDisableYieldValue,F=null,ue=null;function oe(n){if(typeof A=="function"&&P(n),ue&&typeof ue.setStrictMode=="function")try{ue.setStrictMode(F,n)}catch{}}var ye=Math.clz32?Math.clz32:le,we=Math.log,ee=Math.LN2;function le(n){return n>>>=0,n===0?32:31-(we(n)/ee|0)|0}var Re=256,ze=262144,at=4194304;function _t(n){var i=n&42;if(i!==0)return i;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Ae(n,i,s){var c=n.pendingLanes;if(c===0)return 0;var h=0,g=n.suspendedLanes,C=n.pingedLanes;n=n.warmLanes;var j=c&134217727;return j!==0?(c=j&~g,c!==0?h=_t(c):(C&=j,C!==0?h=_t(C):s||(s=j&~n,s!==0&&(h=_t(s))))):(j=c&~g,j!==0?h=_t(j):C!==0?h=_t(C):s||(s=c&~n,s!==0&&(h=_t(s)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,s=i&-i,g>=s||g===32&&(s&4194048)!==0)?i:h}function ut(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function st(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Gt(){var n=at;return at<<=1,(at&62914560)===0&&(at=4194304),n}function sr(n){for(var i=[],s=0;31>s;s++)i.push(n);return i}function Ct(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function yn(n,i,s,c,h,g){var C=n.pendingLanes;n.pendingLanes=s,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=s,n.entangledLanes&=s,n.errorRecoveryDisabledLanes&=s,n.shellSuspendCounter=0;var j=n.entanglements,z=n.expirationTimes,G=n.hiddenUpdates;for(s=C&~s;0"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var vE=/[\n"\\]/g;function Hn(n){return n.replace(vE,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function wd(n,i,s,c,h,g,C,j){n.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?n.type=C:n.removeAttribute("type"),i!=null?C==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+Un(i)):n.value!==""+Un(i)&&(n.value=""+Un(i)):C!=="submit"&&C!=="reset"||n.removeAttribute("value"),i!=null?Sd(n,C,Un(i)):s!=null?Sd(n,C,Un(s)):c!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.name=""+Un(j):n.removeAttribute("name")}function Og(n,i,s,c,h,g,C,j){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){xd(n);return}s=s!=null?""+Un(s):"",i=i!=null?""+Un(i):s,j||i===n.value||(n.value=i),n.defaultValue=i}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=j?n.checked:!!c,n.defaultChecked=!!c,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(n.name=C),xd(n)}function Sd(n,i,s){i==="number"&&Nl(n.ownerDocument)===n||n.defaultValue===""+s||(n.defaultValue=""+s)}function Za(n,i,s,c){if(n=n.options,i){i={};for(var h=0;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jd=!1;if(Lr)try{var io={};Object.defineProperty(io,"passive",{get:function(){jd=!0}}),window.addEventListener("test",io,io),window.removeEventListener("test",io,io)}catch{jd=!1}var ui=null,Td=null,kl=null;function Lg(){if(kl)return kl;var n,i=Td,s=i.length,c,h="value"in ui?ui.value:ui.textContent,g=h.length;for(n=0;n=oo),Ug=" ",Hg=!1;function Bg(n,i){switch(n){case"keyup":return qE.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Xa=!1;function ZE(n,i){switch(n){case"compositionend":return qg(i);case"keypress":return i.which!==32?null:(Hg=!0,Ug);case"textInput":return n=i.data,n===Ug&&Hg?null:n;default:return null}}function KE(n,i){if(Xa)return n==="compositionend"||!Dd&&Bg(n,i)?(n=Lg(),kl=Td=ui=null,Xa=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:s,offset:i-n};n=c}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wg(s)}}function tv(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?tv(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function nv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=Nl(n.document);i instanceof n.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)n=i.contentWindow;else break;i=Nl(n.document)}return i}function Ld(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var nR=Lr&&"documentMode"in document&&11>=document.documentMode,Ja=null,$d=null,fo=null,Id=!1;function rv(n,i,s){var c=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Id||Ja==null||Ja!==Nl(c)||(c=Ja,"selectionStart"in c&&Ld(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),fo&&uo(fo,c)||(fo=c,c=jc($d,"onSelect"),0>=C,h-=C,xr=1<<32-ye(i)+h|s<Be?(Qe=Oe,Oe=null):Qe=Oe.sibling;var tt=Q(V,Oe,q[Be],se);if(tt===null){Oe===null&&(Oe=Qe);break}n&&Oe&&tt.alternate===null&&i(V,Oe),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt,Oe=Qe}if(Be===q.length)return s(V,Oe),Xe&&Ir(V,Be),Ne;if(Oe===null){for(;BeBe?(Qe=Oe,Oe=null):Qe=Oe.sibling;var Ni=Q(V,Oe,tt.value,se);if(Ni===null){Oe===null&&(Oe=Qe);break}n&&Oe&&Ni.alternate===null&&i(V,Oe),$=g(Ni,$,Be),et===null?Ne=Ni:et.sibling=Ni,et=Ni,Oe=Qe}if(tt.done)return s(V,Oe),Xe&&Ir(V,Be),Ne;if(Oe===null){for(;!tt.done;Be++,tt=q.next())tt=ce(V,tt.value,se),tt!==null&&($=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return Xe&&Ir(V,Be),Ne}for(Oe=c(Oe);!tt.done;Be++,tt=q.next())tt=W(Oe,V,Be,tt.value,se),tt!==null&&(n&&tt.alternate!==null&&Oe.delete(tt.key===null?Be:tt.key),$=g(tt,$,Be),et===null?Ne=tt:et.sibling=tt,et=tt);return n&&Oe.forEach(function(S2){return i(V,S2)}),Xe&&Ir(V,Be),Ne}function ht(V,$,q,se){if(typeof q=="object"&&q!==null&&q.type===_&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case x:e:{for(var Ne=q.key;$!==null;){if($.key===Ne){if(Ne=q.type,Ne===_){if($.tag===7){s(V,$.sibling),se=h($,q.props.children),se.return=V,V=se;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===I&&fa(Ne)===$.type){s(V,$.sibling),se=h($,q.props),yo(se,q),se.return=V,V=se;break e}s(V,$);break}else i(V,$);$=$.sibling}q.type===_?(se=oa(q.props.children,V.mode,se,q.key),se.return=V,V=se):(se=Bl(q.type,q.key,q.props,null,V.mode,se),yo(se,q),se.return=V,V=se)}return C(V);case w:e:{for(Ne=q.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===q.containerInfo&&$.stateNode.implementation===q.implementation){s(V,$.sibling),se=h($,q.children||[]),se.return=V,V=se;break e}else{s(V,$);break}else i(V,$);$=$.sibling}se=qd(q,V.mode,se),se.return=V,V=se}return C(V);case I:return q=fa(q),ht(V,$,q,se)}if(Se(q))return je(V,$,q,se);if(he(q)){if(Ne=he(q),typeof Ne!="function")throw Error(a(150));return q=Ne.call(q),ke(V,$,q,se)}if(typeof q.then=="function")return ht(V,$,Xl(q),se);if(q.$$typeof===O)return ht(V,$,Zl(V,q),se);Jl(V,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,$!==null&&$.tag===6?(s(V,$.sibling),se=h($,q),se.return=V,V=se):(s(V,$),se=Bd(q,V.mode,se),se.return=V,V=se),C(V)):s(V,$)}return function(V,$,q,se){try{vo=0;var Ne=ht(V,$,q,se);return cs=null,Ne}catch(Oe){if(Oe===ls||Oe===Yl)throw Oe;var et=Dn(29,Oe,null,V.mode);return et.lanes=se,et.return=V,et}}}var ma=Rv(!0),jv=Rv(!1),pi=!1;function rf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function gi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function vi(n,i,s){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(rt&2)!==0){var h=c.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),c.pending=i,i=Hl(n),uv(n,null,s),i}return Ul(n,c,i,s),Hl(n)}function bo(n,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,bn(n,s)}}function sf(n,i){var s=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,s===c)){var h=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var C={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?h=g=C:g=g.next=C,s=s.next}while(s!==null);g===null?h=g=i:g=g.next=i}else h=g=i;s={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},n.updateQueue=s;return}n=s.lastBaseUpdate,n===null?s.firstBaseUpdate=i:n.next=i,s.lastBaseUpdate=i}var of=!1;function xo(){if(of){var n=os;if(n!==null)throw n}}function wo(n,i,s,c){of=!1;var h=n.updateQueue;pi=!1;var g=h.firstBaseUpdate,C=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var z=j,G=z.next;z.next=null,C===null?g=G:C.next=G,C=z;var ie=n.alternate;ie!==null&&(ie=ie.updateQueue,j=ie.lastBaseUpdate,j!==C&&(j===null?ie.firstBaseUpdate=G:j.next=G,ie.lastBaseUpdate=z))}if(g!==null){var ce=h.baseState;C=0,ie=G=z=null,j=g;do{var Q=j.lane&-536870913,W=Q!==j.lane;if(W?(Ye&Q)===Q:(c&Q)===Q){Q!==0&&Q===ss&&(of=!0),ie!==null&&(ie=ie.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var je=n,ke=j;Q=i;var ht=s;switch(ke.tag){case 1:if(je=ke.payload,typeof je=="function"){ce=je.call(ht,ce,Q);break e}ce=je;break e;case 3:je.flags=je.flags&-65537|128;case 0:if(je=ke.payload,Q=typeof je=="function"?je.call(ht,ce,Q):je,Q==null)break e;ce=v({},ce,Q);break e;case 2:pi=!0}}Q=j.callback,Q!==null&&(n.flags|=64,W&&(n.flags|=8192),W=h.callbacks,W===null?h.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ie===null?(G=ie=W,z=ce):ie=ie.next=W,C|=Q;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;W=j,j=W.next,W.next=null,h.lastBaseUpdate=W,h.shared.pending=null}}while(!0);ie===null&&(z=ce),h.baseState=z,h.firstBaseUpdate=G,h.lastBaseUpdate=ie,g===null&&(h.shared.lanes=0),Si|=C,n.lanes=C,n.memoizedState=ce}}function Tv(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function Ov(n,i){var s=n.callbacks;if(s!==null)for(n.callbacks=null,n=0;ng?g:8;var C=L.T,j={};L.T=j,Rf(n,!1,i,s);try{var z=h(),G=L.S;if(G!==null&&G(j,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var ie=dR(z,c);Co(n,i,ie,In(n))}else Co(n,i,c,In(n))}catch(ce){Co(n,i,{then:function(){},status:"rejected",reason:ce},In())}finally{K.p=g,C!==null&&j.types!==null&&(C.types=j.types),L.T=C}}function vR(){}function Cf(n,i,s,c){if(n.tag!==5)throw Error(a(476));var h=oy(n).queue;sy(n,h,i,ae,s===null?vR:function(){return ly(n),s(c)})}function oy(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:ae},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ur,lastRenderedState:s},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function ly(n){var i=oy(n);i.next===null&&(i=n.alternate.memoizedState),Co(n,i.next.queue,{},In())}function Ef(){return tn(Vo)}function cy(){return Nt().memoizedState}function uy(){return Nt().memoizedState}function yR(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var s=In();n=gi(s);var c=vi(i,n,s);c!==null&&(jn(c,i,s),bo(c,i,s)),i={cache:Wd()},n.payload=i;return}i=i.return}}function bR(n,i,s){var c=In();s={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lc(n)?fy(i,s):(s=Ud(n,i,s,c),s!==null&&(jn(s,n,c),hy(s,i,c)))}function dy(n,i,s){var c=In();Co(n,i,s,c)}function Co(n,i,s,c){var h={lane:c,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lc(n))fy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var C=i.lastRenderedState,j=g(C,s);if(h.hasEagerState=!0,h.eagerState=j,Nn(j,C))return Ul(n,i,h,0),gt===null&&Vl(),!1}catch{}if(s=Ud(n,i,h,c),s!==null)return jn(s,n,c),hy(s,i,c),!0}return!1}function Rf(n,i,s,c){if(c={lane:2,revertLane:ih(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},lc(n)){if(i)throw Error(a(479))}else i=Ud(n,s,c,2),i!==null&&jn(i,n,2)}function lc(n){var i=n.alternate;return n===Ue||i!==null&&i===Ue}function fy(n,i){ds=tc=!0;var s=n.pending;s===null?i.next=i:(i.next=s.next,s.next=i),n.pending=i}function hy(n,i,s){if((s&4194048)!==0){var c=i.lanes;c&=n.pendingLanes,s|=c,i.lanes=s,bn(n,s)}}var Eo={readContext:tn,use:ic,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};Eo.useEffectEvent=jt;var my={readContext:tn,use:ic,useCallback:function(n,i){return pn().memoizedState=[n,i===void 0?null:i],n},useContext:tn,useEffect:Xv,useImperativeHandle:function(n,i,s){s=s!=null?s.concat([n]):null,sc(4194308,4,ty.bind(null,i,n),s)},useLayoutEffect:function(n,i){return sc(4194308,4,n,i)},useInsertionEffect:function(n,i){sc(4,2,n,i)},useMemo:function(n,i){var s=pn();i=i===void 0?null:i;var c=n();if(pa){oe(!0);try{n()}finally{oe(!1)}}return s.memoizedState=[c,i],c},useReducer:function(n,i,s){var c=pn();if(s!==void 0){var h=s(i);if(pa){oe(!0);try{s(i)}finally{oe(!1)}}}else h=i;return c.memoizedState=c.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},c.queue=n,n=n.dispatch=bR.bind(null,Ue,n),[c.memoizedState,n]},useRef:function(n){var i=pn();return n={current:n},i.memoizedState=n},useState:function(n){n=bf(n);var i=n.queue,s=dy.bind(null,Ue,i);return i.dispatch=s,[n.memoizedState,s]},useDebugValue:Sf,useDeferredValue:function(n,i){var s=pn();return _f(s,n,i)},useTransition:function(){var n=bf(!1);return n=sy.bind(null,Ue,n.queue,!0,!1),pn().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,s){var c=Ue,h=pn();if(Xe){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),gt===null)throw Error(a(349));(Ye&127)!==0||zv(c,i,s)}h.memoizedState=s;var g={value:s,getSnapshot:i};return h.queue=g,Xv($v.bind(null,c,g,n),[n]),c.flags|=2048,hs(9,{destroy:void 0},Lv.bind(null,c,g,s,i),null),s},useId:function(){var n=pn(),i=gt.identifierPrefix;if(Xe){var s=wr,c=xr;s=(c&~(1<<32-ye(c)-1)).toString(32)+s,i="_"+i+"R_"+s,s=nc++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?C.createElement("select",{is:c.is}):C.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?C.createElement(h,{is:c.is}):C.createElement(h)}}g[Wt]=i,g[wn]=c;e:for(C=i.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===i)break e;for(;C.sibling===null;){if(C.return===null||C.return===i)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}i.stateNode=g;e:switch(rn(g,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Br(i)}}return yt(i),Ff(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,s),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==c&&Br(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(a(166));if(n=fe.current,is(i)){if(n=i.stateNode,s=i.memoizedProps,c=null,h=en,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}n[Wt]=i,n=!!(n.nodeValue===s||c!==null&&c.suppressHydrationWarning===!0||D0(n.nodeValue,s)),n||hi(i,!0)}else n=Tc(n).createTextNode(c),n[Wt]=i,i.stateNode=n}return yt(i),null;case 31:if(s=i.memoizedState,n===null||n.memoizedState!==null){if(c=is(i),s!==null){if(n===null){if(!c)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Wt]=i}else la(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),n=!1}else s=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=s),n=!0;if(!n)return i.flags&256?(zn(i),i):(zn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return yt(i),null;case 13:if(c=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=is(i),c!==null&&c.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Wt]=i}else la(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;yt(i),h=!1}else h=Yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(zn(i),i):(zn(i),null)}return zn(i),(i.flags&128)!==0?(i.lanes=s,i):(s=c!==null,n=n!==null&&n.memoizedState!==null,s&&(c=i.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048)),s!==n&&s&&(i.child.flags|=8192),hc(i,i.updateQueue),yt(i),null);case 4:return xe(),n===null&&lh(i.stateNode.containerInfo),yt(i),null;case 10:return Fr(i.type),yt(i),null;case 19:if(M(Mt),c=i.memoizedState,c===null)return yt(i),null;if(h=(i.flags&128)!==0,g=c.rendering,g===null)if(h)jo(c,!1);else{if(Tt!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=ec(n),g!==null){for(i.flags|=128,jo(c,!1),n=g.updateQueue,i.updateQueue=n,hc(i,n),i.subtreeFlags=0,n=s,s=i.child;s!==null;)dv(s,n),s=s.sibling;return U(Mt,Mt.current&1|2),Xe&&Ir(i,c.treeForkCount),i.child}n=n.sibling}c.tail!==null&&zt()>yc&&(i.flags|=128,h=!0,jo(c,!1),i.lanes=4194304)}else{if(!h)if(n=ec(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,hc(i,n),jo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Xe)return yt(i),null}else 2*zt()-c.renderingStartTime>yc&&s!==536870912&&(i.flags|=128,h=!0,jo(c,!1),i.lanes=4194304);c.isBackwards?(g.sibling=i.child,i.child=g):(n=c.last,n!==null?n.sibling=g:i.child=g,c.last=g)}return c.tail!==null?(n=c.tail,c.rendering=n,c.tail=n.sibling,c.renderingStartTime=zt(),n.sibling=null,s=Mt.current,U(Mt,h?s&1|2:s&1),Xe&&Ir(i,c.treeForkCount),n):(yt(i),null);case 22:case 23:return zn(i),cf(),c=i.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(s&536870912)!==0&&(i.flags&128)===0&&(yt(i),i.subtreeFlags&6&&(i.flags|=8192)):yt(i),s=i.updateQueue,s!==null&&hc(i,s.retryQueue),s=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048),n!==null&&M(da),null;case 24:return s=null,n!==null&&(s=n.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Fr(Lt),yt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function CR(n,i){switch(Zd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Fr(Lt),xe(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return Fe(i),null;case 31:if(i.memoizedState!==null){if(zn(i),i.alternate===null)throw Error(a(340));la()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(zn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));la()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return M(Mt),null;case 4:return xe(),null;case 10:return Fr(i.type),null;case 22:case 23:return zn(i),cf(),n!==null&&M(da),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Fr(Lt),null;case 25:return null;default:return null}}function Iy(n,i){switch(Zd(i),i.tag){case 3:Fr(Lt),xe();break;case 26:case 27:case 5:Fe(i);break;case 4:xe();break;case 31:i.memoizedState!==null&&zn(i);break;case 13:zn(i);break;case 19:M(Mt);break;case 10:Fr(i.type);break;case 22:case 23:zn(i),cf(),n!==null&&M(da);break;case 24:Fr(Lt)}}function To(n,i){try{var s=i.updateQueue,c=s!==null?s.lastEffect:null;if(c!==null){var h=c.next;s=h;do{if((s.tag&n)===n){c=void 0;var g=s.create,C=s.inst;c=g(),C.destroy=c}s=s.next}while(s!==h)}}catch(j){lt(i,i.return,j)}}function xi(n,i,s){try{var c=i.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var g=h.next;c=g;do{if((c.tag&n)===n){var C=c.inst,j=C.destroy;if(j!==void 0){C.destroy=void 0,h=i;var z=s,G=j;try{G()}catch(ie){lt(h,z,ie)}}}c=c.next}while(c!==g)}}catch(ie){lt(i,i.return,ie)}}function Py(n){var i=n.updateQueue;if(i!==null){var s=n.stateNode;try{Ov(i,s)}catch(c){lt(n,n.return,c)}}}function Fy(n,i,s){s.props=ga(n.type,n.memoizedProps),s.state=n.memoizedState;try{s.componentWillUnmount()}catch(c){lt(n,i,c)}}function Oo(n,i){try{var s=n.ref;if(s!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof s=="function"?n.refCleanup=s(c):s.current=c}}catch(h){lt(n,i,h)}}function Sr(n,i){var s=n.ref,c=n.refCleanup;if(s!==null)if(typeof c=="function")try{c()}catch(h){lt(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){lt(n,i,h)}else s.current=null}function Vy(n){var i=n.type,s=n.memoizedProps,c=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&c.focus();break e;case"img":s.src?c.src=s.src:s.srcSet&&(c.srcset=s.srcSet)}}catch(h){lt(n,n.return,h)}}function Vf(n,i,s){try{var c=n.stateNode;GR(c,n.type,s,i),c[wn]=i}catch(h){lt(n,n.return,h)}}function Uy(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ji(n.type)||n.tag===4}function Uf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Uy(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ji(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Hf(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(n,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(n),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=zr));else if(c!==4&&(c===27&&ji(n.type)&&(s=n.stateNode,i=null),n=n.child,n!==null))for(Hf(n,i,s),n=n.sibling;n!==null;)Hf(n,i,s),n=n.sibling}function mc(n,i,s){var c=n.tag;if(c===5||c===6)n=n.stateNode,i?s.insertBefore(n,i):s.appendChild(n);else if(c!==4&&(c===27&&ji(n.type)&&(s=n.stateNode),n=n.child,n!==null))for(mc(n,i,s),n=n.sibling;n!==null;)mc(n,i,s),n=n.sibling}function Hy(n){var i=n.stateNode,s=n.memoizedProps;try{for(var c=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);rn(i,c,s),i[Wt]=n,i[wn]=s}catch(g){lt(n,n.return,g)}}var qr=!1,Pt=!1,Bf=!1,By=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function ER(n,i){if(n=n.containerInfo,dh=zc,n=nv(n),Ld(n)){if("selectionStart"in n)var s={start:n.selectionStart,end:n.selectionEnd};else e:{s=(s=n.ownerDocument)&&s.defaultView||window;var c=s.getSelection&&s.getSelection();if(c&&c.rangeCount!==0){s=c.anchorNode;var h=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var C=0,j=-1,z=-1,G=0,ie=0,ce=n,Q=null;t:for(;;){for(var W;ce!==s||h!==0&&ce.nodeType!==3||(j=C+h),ce!==g||c!==0&&ce.nodeType!==3||(z=C+c),ce.nodeType===3&&(C+=ce.nodeValue.length),(W=ce.firstChild)!==null;)Q=ce,ce=W;for(;;){if(ce===n)break t;if(Q===s&&++G===h&&(j=C),Q===g&&++ie===c&&(z=C),(W=ce.nextSibling)!==null)break;ce=Q,Q=ce.parentNode}ce=W}s=j===-1||z===-1?null:{start:j,end:z}}else s=null}s=s||{start:0,end:0}}else s=null;for(fh={focusedElem:n,selectionRange:s},zc=!1,Kt=i;Kt!==null;)if(i=Kt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Kt=n;else for(;Kt!==null;){switch(i=Kt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(s=0;s title"))),rn(g,c,s),g[Wt]=n,Zt(g),c=g;break e;case"link":var C=Q0("link","href",h).get(c+(s.href||""));if(C){for(var j=0;jht&&(C=ht,ht=ke,ke=C);var V=ev(j,ke),$=ev(j,ht);if(V&&$&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==$.node||W.focusOffset!==$.offset)){var q=ce.createRange();q.setStart(V.node,V.offset),W.removeAllRanges(),ke>ht?(W.addRange(q),W.extend($.node,$.offset)):(q.setEnd($.node,$.offset),W.addRange(q))}}}}for(ce=[],W=j;W=W.parentNode;)W.nodeType===1&&ce.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;js?32:s,L.T=null,s=Xf,Xf=null;var g=Ci,C=Qr;if(Ht=0,ys=Ci=null,Qr=0,(rt&6)!==0)throw Error(a(331));var j=rt;if(rt|=4,t0(g.current),Jy(g,g.current,C,s),rt=j,zo(0,!1),ue&&typeof ue.onPostCommitFiberRoot=="function")try{ue.onPostCommitFiberRoot(F,g)}catch{}return!0}finally{K.p=h,L.T=c,b0(n,i)}}function w0(n,i,s){i=qn(s,i),i=Af(n.stateNode,i,2),n=vi(n,i,2),n!==null&&(Ct(n,2),_r(n))}function lt(n,i,s){if(n.tag===3)w0(n,n,s);else for(;i!==null;){if(i.tag===3){w0(i,n,s);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(_i===null||!_i.has(c))){n=qn(s,n),s=Sy(2),c=vi(i,s,2),c!==null&&(_y(s,c,i,n),Ct(c,2),_r(c));break}}i=i.return}}function th(n,i,s){var c=n.pingCache;if(c===null){c=n.pingCache=new TR;var h=new Set;c.set(i,h)}else h=c.get(i),h===void 0&&(h=new Set,c.set(i,h));h.has(s)||(Zf=!0,h.add(s),n=DR.bind(null,n,i,s),i.then(n,n))}function DR(n,i,s){var c=n.pingCache;c!==null&&c.delete(i),n.pingedLanes|=n.suspendedLanes&s,n.warmLanes&=~s,gt===n&&(Ye&s)===s&&(Tt===4||Tt===3&&(Ye&62914560)===Ye&&300>zt()-vc?(rt&2)===0&&bs(n,0):Kf|=s,vs===Ye&&(vs=0)),_r(n)}function S0(n,i){i===0&&(i=Gt()),n=sa(n,i),n!==null&&(Ct(n,i),_r(n))}function kR(n){var i=n.memoizedState,s=0;i!==null&&(s=i.retryLane),S0(n,s)}function zR(n,i){var s=0;switch(n.tag){case 31:case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(s=h.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(a(314))}c!==null&&c.delete(i),S0(n,s)}function LR(n,i){return rr(n,i)}var Cc=null,ws=null,nh=!1,Ec=!1,rh=!1,Ri=0;function _r(n){n!==ws&&n.next===null&&(ws===null?Cc=ws=n:ws=ws.next=n),Ec=!0,nh||(nh=!0,IR())}function zo(n,i){if(!rh&&Ec){rh=!0;do for(var s=!1,c=Cc;c!==null;){if(n!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var C=c.suspendedLanes,j=c.pingedLanes;g=(1<<31-ye(42|n)+1)-1,g&=h&~(C&~j),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,R0(c,g))}else g=Ye,g=Ae(c,c===gt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ut(c,g)||(s=!0,R0(c,g));c=c.next}while(s);rh=!1}}function $R(){_0()}function _0(){Ec=nh=!1;var n=0;Ri!==0&&KR()&&(n=Ri);for(var i=zt(),s=null,c=Cc;c!==null;){var h=c.next,g=C0(c,i);g===0?(c.next=null,s===null?Cc=h:s.next=h,h===null&&(ws=s)):(s=c,(n!==0||(g&3)!==0)&&(Ec=!0)),c=h}Ht!==0&&Ht!==5||zo(n),Ri!==0&&(Ri=0)}function C0(n,i){for(var s=n.suspendedLanes,c=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0j)break;var ie=z.transferSize,ce=z.initiatorType;ie&&k0(ce)&&(z=z.responseEnd,C+=ie*(z"u"?null:document;function G0(n,i,s){var c=Ss;if(c&&typeof i=="string"&&i){var h=Hn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),q0.has(h)||(q0.add(h),n={rel:n,crossOrigin:s,href:i},c.querySelector(h)===null&&(i=c.createElement("link"),rn(i,"link",n),Zt(i),c.head.appendChild(i)))}}function r2(n){Xr.D(n),G0("dns-prefetch",n,null)}function i2(n,i){Xr.C(n,i),G0("preconnect",n,i)}function a2(n,i,s){Xr.L(n,i,s);var c=Ss;if(c&&n&&i){var h='link[rel="preload"][as="'+Hn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+Hn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+Hn(s.imageSizes)+'"]')):h+='[href="'+Hn(n)+'"]';var g=h;switch(i){case"style":g=_s(n);break;case"script":g=Cs(n)}Xn.has(g)||(n=v({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:n,as:i},s),Xn.set(g,n),c.querySelector(h)!==null||i==="style"&&c.querySelector(Po(g))||i==="script"&&c.querySelector(Fo(g))||(i=c.createElement("link"),rn(i,"link",n),Zt(i),c.head.appendChild(i)))}}function s2(n,i){Xr.m(n,i);var s=Ss;if(s&&n){var c=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Hn(c)+'"][href="'+Hn(n)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Cs(n)}if(!Xn.has(g)&&(n=v({rel:"modulepreload",href:n},i),Xn.set(g,n),s.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Fo(g)))return}c=s.createElement("link"),rn(c,"link",n),Zt(c),s.head.appendChild(c)}}}function o2(n,i,s){Xr.S(n,i,s);var c=Ss;if(c&&n){var h=qa(c).hoistableStyles,g=_s(n);i=i||"default";var C=h.get(g);if(!C){var j={loading:0,preload:null};if(C=c.querySelector(Po(g)))j.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":i},s),(s=Xn.get(g))&&bh(n,s);var z=C=c.createElement("link");Zt(z),rn(z,"link",n),z._p=new Promise(function(G,ie){z.onload=G,z.onerror=ie}),z.addEventListener("load",function(){j.loading|=1}),z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ac(C,i,c)}C={type:"stylesheet",instance:C,count:1,state:j},h.set(g,C)}}}function l2(n,i){Xr.X(n,i);var s=Ss;if(s&&n){var c=qa(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0},i),(i=Xn.get(h))&&xh(n,i),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function c2(n,i){Xr.M(n,i);var s=Ss;if(s&&n){var c=qa(s).hoistableScripts,h=Cs(n),g=c.get(h);g||(g=s.querySelector(Fo(h)),g||(n=v({src:n,async:!0,type:"module"},i),(i=Xn.get(h))&&xh(n,i),g=s.createElement("script"),Zt(g),rn(g,"link",n),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function Z0(n,i,s,c){var h=(h=fe.current)?Oc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=_s(s.href),s=qa(h).hoistableStyles,c=s.get(i),c||(c={type:"style",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){n=_s(s.href);var g=qa(h).hoistableStyles,C=g.get(n);if(C||(h=h.ownerDocument||h,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,C),(g=h.querySelector(Po(n)))&&!g._p&&(C.instance=g,C.state.loading=5),Xn.has(n)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Xn.set(n,s),g||u2(h,n,s,C.state))),i&&c===null)throw Error(a(528,""));return C}if(i&&c!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Cs(s),s=qa(h).hoistableScripts,c=s.get(i),c||(c={type:"script",instance:null,count:0,state:null},s.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function _s(n){return'href="'+Hn(n)+'"'}function Po(n){return'link[rel="stylesheet"]['+n+"]"}function K0(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function u2(n,i,s,c){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=n.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),rn(i,"link",s),Zt(i),n.head.appendChild(i))}function Cs(n){return'[src="'+Hn(n)+'"]'}function Fo(n){return"script[async]"+n}function Y0(n,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var c=n.querySelector('style[data-href~="'+Hn(s.href)+'"]');if(c)return i.instance=c,Zt(c),c;var h=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),Zt(c),rn(c,"style",h),Ac(c,s.precedence,n),i.instance=c;case"stylesheet":h=_s(s.href);var g=n.querySelector(Po(h));if(g)return i.state.loading|=4,i.instance=g,Zt(g),g;c=K0(s),(h=Xn.get(h))&&bh(c,h),g=(n.ownerDocument||n).createElement("link"),Zt(g);var C=g;return C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),i.state.loading|=4,Ac(g,s.precedence,n),i.instance=g;case"script":return g=Cs(s.src),(h=n.querySelector(Fo(g)))?(i.instance=h,Zt(h),h):(c=s,(h=Xn.get(g))&&(c=v({},s),xh(c,h)),n=n.ownerDocument||n,h=n.createElement("script"),Zt(h),rn(h,"link",c),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Ac(c,s.precedence,n));return i.instance}function Ac(n,i,s){for(var c=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,g=h,C=0;C title"):null)}function d2(n,i,s){if(s===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function J0(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function f2(n,i,s,c){if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=_s(c.href),g=i.querySelector(Po(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Nc.bind(n),i.then(n,n)),s.state.loading|=4,s.instance=g,Zt(g);return}g=i.ownerDocument||i,c=K0(c),(h=Xn.get(h))&&bh(c,h),g=g.createElement("link"),Zt(g);var C=g;C._p=new Promise(function(j,z){C.onload=j,C.onerror=z}),rn(g,"link",c),s.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(n.count++,s=Nc.bind(n),i.addEventListener("load",s),i.addEventListener("error",s))}}var wh=0;function h2(n,i){return n.stylesheets&&n.count===0&&kc(n,n.stylesheets),0wh?50:800)+i);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Nc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)kc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Dc=null;function kc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Dc=new Map,i.forEach(m2,n),Dc=null,Nc.call(n))}function m2(n,i){if(!(i.state.loading&4)){var s=Dc.get(n);if(s)var c=s.get(null);else{s=new Map,Dc.set(n,s);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ah.exports=N2(),Ah.exports}var k2=D2(),yl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},z2=class extends yl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},op=new z2,L2={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},$2=class{#e=L2;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Sa=new $2;function I2(e){setTimeout(e,0)}var P2=typeof window>"u"||"Deno"in globalThis;function On(){}function F2(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function _w(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ii(e,t){return typeof e=="function"?e(t):e}function Pn(e,t){return typeof e=="function"?e(t):e}function Sb(e,t){const{type:r="all",exact:a,fetchStatus:o,predicate:l,queryKey:u,stale:d}=e;if(u){if(a){if(t.queryHash!==lp(u,t.options))return!1}else if(!ll(t.queryKey,u))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||o&&o!==t.state.fetchStatus||l&&!l(t))}function _b(e,t){const{exact:r,status:a,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(r){if(ol(t.options.mutationKey)!==ol(l))return!1}else if(!ll(t.options.mutationKey,l))return!1}return!(a&&t.state.status!==a||o&&!o(t))}function lp(e,t){return(t?.queryKeyHashFn||ol)(e)}function ol(e){return JSON.stringify(e,(t,r)=>gm(r)?Object.keys(r).sort().reduce((a,o)=>(a[o]=r[o],a),{}):r)}function ll(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>ll(e[r],t[r])):!1}var V2=Object.prototype.hasOwnProperty;function Cw(e,t,r=0){if(e===t)return e;if(r>500)return t;const a=Cb(e)&&Cb(t);if(!a&&!(gm(e)&&gm(t)))return t;const l=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),d=u.length,m=a?new Array(d):{};let p=0;for(let y=0;y{Sa.setTimeout(t,e)})}function vm(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Cw(e,t):t}function H2(e,t,r=0){const a=[...e,t];return r&&a.length>r?a.slice(1):a}function B2(e,t,r=0){const a=[t,...e];return r&&a.length>r?a.slice(0,-1):a}var cp=Symbol();function Ew(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rw(e,t){return typeof e=="function"?e(...t):!!e}function q2(e,t,r){let a=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),a||(a=!0,o.aborted?r():o.addEventListener("abort",r,{once:!0})),o)}),e}var cl=(()=>{let e=()=>P2;return{isServer(){return e()},setIsServer(t){e=t}}})();function ym(){let e,t;const r=new Promise((o,l)=>{e=o,t=l});r.status="pending",r.catch(()=>{});function a(o){Object.assign(r,o),delete r.resolve,delete r.reject}return r.resolve=o=>{a({status:"fulfilled",value:o}),e(o)},r.reject=o=>{a({status:"rejected",reason:o}),t(o)},r}var G2=I2;function Z2(){let e=[],t=0,r=d=>{d()},a=d=>{d()},o=G2;const l=d=>{t?e.push(d):o(()=>{r(d)})},u=()=>{const d=e;e=[],d.length&&o(()=>{a(()=>{d.forEach(m=>{r(m)})})})};return{batch:d=>{let m;t++;try{m=d()}finally{t--,t||u()}return m},batchCalls:d=>(...m)=>{l(()=>{d(...m)})},schedule:l,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{a=d},setScheduler:d=>{o=d}}}var on=Z2(),K2=class extends yl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},mu=new K2;function Y2(e){return Math.min(1e3*2**e,3e4)}function jw(e){return(e??"online")==="online"?mu.isOnline():!0}var bm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Tw(e){let t=!1,r=0,a;const o=ym(),l=()=>o.status!=="pending",u=_=>{if(!l()){const E=new bm(_);b(E),e.onCancel?.(E)}},d=()=>{t=!0},m=()=>{t=!1},p=()=>op.isFocused()&&(e.networkMode==="always"||mu.isOnline())&&e.canRun(),y=()=>jw(e.networkMode)&&e.canRun(),v=_=>{l()||(a?.(),o.resolve(_))},b=_=>{l()||(a?.(),o.reject(_))},x=()=>new Promise(_=>{a=E=>{(l()||p())&&_(E)},e.onPause?.()}).then(()=>{a=void 0,l()||e.onContinue?.()}),w=()=>{if(l())return;let _;const E=r===0?e.initialPromise:void 0;try{_=E??e.fn()}catch(R){_=Promise.reject(R)}Promise.resolve(_).then(v).catch(R=>{if(l())return;const T=e.retry??(cl.isServer()?0:3),O=e.retryDelay??Y2,N=typeof O=="function"?O(r,R):O,k=T===!0||typeof T=="number"&&rp()?void 0:x()).then(()=>{t?b(R):w()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(a?.(),o),cancelRetry:d,continueRetry:m,canStart:y,start:()=>(y()?w():x().then(w),o)}}var Ow=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&(this.#e=Sa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(cl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(Sa.clearTimeout(this.#e),this.#e=void 0)}};function Q2(e){return{onFetch:(t,r)=>{const a=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let d={pages:[],pageParams:[]},m=0;const p=async()=>{let y=!1;const v=w=>{q2(w,()=>t.signal,()=>y=!0)},b=Ew(t.options,t.fetchOptions),x=async(w,_,E)=>{if(y)return Promise.reject(t.signal.reason);if(_==null&&w.pages.length)return Promise.resolve(w);const T=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:_,direction:E?"backward":"forward",meta:t.options.meta};return v(B),B})(),O=await b(T),{maxPages:N}=t.options,k=E?B2:H2;return{pages:k(w.pages,O,N),pageParams:k(w.pageParams,_,N)}};if(o&&l.length){const w=o==="backward",_=w?Aw:xm,E={pages:l,pageParams:u},R=_(a,E);d=await x(E,R,w)}else{const w=e??l.length;do{const _=m===0?u[0]??a.initialPageParam:xm(a,d);if(m>0&&_==null)break;d=await x(d,_),m++}while(mt.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=p}}}function xm(e,{pages:t,pageParams:r}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,r[a],r):void 0}function Aw(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function X2(e,t){return t?xm(e,t)!=null:!1}function J2(e,t){return!t||!e.getPreviousPageParam?!1:Aw(e,t)!=null}var W2=class extends Ow{#e;#t;#n;#r;#a;#i;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#r=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=jb(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=jb(this.options);t.data!==void 0&&(this.setState(Rb(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,t){const r=vm(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(On).catch(On):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Pn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ii(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!_w(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#s||this.#u()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,a=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},o=()=>{const m=Ew(this.options,t),y=(()=>{const v={client:this.#a,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#s=!1,this.options.persister?this.options.persister(m,y,this):m(y)},u=(()=>{const m={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:o};return a(m),m})();(this.#e==="infinite"?Q2(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#i=Tw({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:m=>{m instanceof bm&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(m,p)=>{this.#l({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const m=await this.#i.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#r.config.onSuccess?.(m,this),this.#r.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof bm){if(m.silent)return this.#i.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#l({type:"error",error:m}),this.#r.config.onError?.(m,this),this.#r.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#l(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Mw(r.data,this.options),fetchMeta:e.meta??null};case"success":const a={...r,...Rb(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?a:void 0,a;case"error":const o=e.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),on.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function Mw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Rb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jb(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,a=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Nw=class extends yl{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ym(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#a;#i;#o;#s;#u;#l;#m;#d;#f;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Tb(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pn(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!pm(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const a=this.hasListeners();a&&Ob(this.#t,r,this.options,t)&&this.#h(),this.updateResult(),a&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||Ii(this.options.staleTime,this.#t)!==Ii(t.staleTime,this.#t))&&this.#g();const o=this.#v();a&&(this.#t!==r||Pn(this.options.enabled,this.#t)!==Pn(t.enabled,this.#t)||o!==this.#c)&&this.#y(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);return tj(this,r)&&(this.#r=r,this.#i=this.options,this.#a=this.#t.state),r}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(r,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(On)),t}#g(){this.#x();const e=Ii(this.options.staleTime,this.#t);if(cl.isServer()||this.#r.isStale||!mm(e))return;const r=_w(this.#r.dataUpdatedAt,e)+1;this.#d=Sa.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#c=e,!(cl.isServer()||Pn(this.options.enabled,this.#t)===!1||!mm(this.#c)||this.#c===0)&&(this.#f=Sa.setInterval(()=>{(this.options.refetchIntervalInBackground||op.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#d!==void 0&&(Sa.clearTimeout(this.#d),this.#d=void 0)}#w(){this.#f!==void 0&&(Sa.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const r=this.#t,a=this.options,o=this.#r,l=this.#a,u=this.#i,m=e!==r?e.state:this.#n,{state:p}=e;let y={...p},v=!1,b;if(t._optimisticResults){const I=this.hasListeners(),ne=!I&&Tb(e,t),pe=I&&Ob(e,r,t,a);(ne||pe)&&(y={...y,...Mw(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:w,status:_}=y;b=y.data;let E=!1;if(t.placeholderData!==void 0&&b===void 0&&_==="pending"){let I;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(I=o.data,E=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,I!==void 0&&(_="success",b=vm(o?.data,I,t),v=!0)}if(t.select&&b!==void 0&&!E)if(o&&b===l?.data&&t.select===this.#u)b=this.#l;else try{this.#u=t.select,b=t.select(b),b=vm(o?.data,b,t),this.#l=b,this.#s=null}catch(I){this.#s=I}this.#s&&(x=this.#s,b=this.#l,w=Date.now(),_="error");const R=y.fetchStatus==="fetching",T=_==="pending",O=_==="error",N=T&&R,k=b!==void 0,H={status:_,fetchStatus:y.fetchStatus,isPending:T,isSuccess:_==="success",isError:O,isInitialLoading:N,isLoading:N,data:b,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:w,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:y.dataUpdateCount>m.dataUpdateCount||y.errorUpdateCount>m.errorUpdateCount,isFetching:R,isRefetching:R&&!T,isLoadingError:O&&!k,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:O&&k,isStale:up(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Pn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=H.data!==void 0,ne=H.status==="error"&&!I,pe=de=>{ne?de.reject(H.error):I&&de.resolve(H.data)},ge=()=>{const de=this.#o=H.promise=ym();pe(de)},he=this.#o;switch(he.status){case"pending":e.queryHash===r.queryHash&&pe(he);break;case"fulfilled":(ne||H.data!==he.value)&&ge();break;case"rejected":(!ne||H.error!==he.reason)&&ge();break}}return H}updateResult(){const e=this.#r,t=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#i=this.options,this.#a.data!==void 0&&(this.#m=this.#t),pm(t,e))return;this.#r=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#p.size)return!0;const l=new Set(o??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#r).some(u=>{const d=u;return this.#r[d]!==e[d]&&l.has(d)})};this.#_({listeners:r()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){on.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function ej(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Pn(t.retryOnMount,e)===!1)}function Tb(e,t){return ej(e,t)||e.state.data!==void 0&&wm(e,t,t.refetchOnMount)}function wm(e,t,r){if(Pn(t.enabled,e)!==!1&&Ii(t.staleTime,e)!=="static"){const a=typeof r=="function"?r(e):r;return a==="always"||a!==!1&&up(e,t)}return!1}function Ob(e,t,r,a){return(e!==t||Pn(a.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&up(e,r)}function up(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Ii(t.staleTime,e))}function tj(e,t){return!pm(e.getCurrentResult(),t)}var nj=class extends Nw{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:r}=e,a=super.createResult(e,t),{isFetching:o,isRefetching:l,isError:u,isRefetchError:d}=a,m=r.fetchMeta?.fetchMore?.direction,p=u&&m==="forward",y=o&&m==="forward",v=u&&m==="backward",b=o&&m==="backward";return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:X2(t,r.data),hasPreviousPage:J2(t,r.data),isFetchNextPageError:p,isFetchingNextPage:y,isFetchPreviousPageError:v,isFetchingPreviousPage:b,isRefetchError:d&&!p&&!v,isRefetching:l&&!y&&!b}}},rj=class extends Ow{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ij(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#a({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Tw({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#a({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#a({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",o=!this.#r.canStart();try{if(a)t();else{this.#a({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#a({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#r.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,r),await this.options.onSuccess?.(l,e,this.state.context,r),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(l,null,e,this.state.context,r),this.#a({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#a({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#a(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),on.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ij(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aj=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,r){const a=new rj({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(a),a}add(e){this.#e.add(e);const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);r?r.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Uc(e);if(typeof t=="string"){const r=this.#t.get(t);if(r)if(r.length>1){const a=r.indexOf(e);a!==-1&&r.splice(a,1)}else r[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uc(e);if(typeof t=="string"){const a=this.#t.get(t)?.find(o=>o.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Uc(e);return typeof t=="string"?this.#t.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){on.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>_b(t,r))}findAll(e={}){return this.getAll().filter(t=>_b(e,t))}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return on.batch(()=>Promise.all(e.map(t=>t.continue().catch(On))))}};function Uc(e){return e.options.scope?.id}var sj=class extends yl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){const a=t.queryKey,o=t.queryHash??lp(a,t);let l=this.get(o);return l||(l=new W2({client:e,queryKey:a,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){on.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Sb(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>Sb(e,r)):t}notify(e){on.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){on.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){on.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},oj=class{#e;#t;#n;#r;#a;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new sj,this.#t=e.mutationCache||new aj,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=op.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#e.build(this,t),a=r.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ii(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:r})=>{const a=r.data;return[t,a]})}setQueryData(e,t,r){const a=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(a.queryHash)?.state.data,u=F2(t,l);if(u!==void 0)return this.#e.build(this,a).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return on.batch(()=>this.#e.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;on.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#e;return on.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},a=on.batch(()=>this.#e.findAll(e).map(o=>o.cancel(r)));return Promise.all(a).then(On).catch(On)}invalidateQueries(e,t={}){return on.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},a=on.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,r);return r.throwOnError||(l=l.catch(On)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(a).then(On)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#e.build(this,t);return r.isStaleByTime(Ii(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(On).catch(On)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(On).catch(On)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return mu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ol(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(a=>{ll(e,a.queryKey)&&Object.assign(r,a.defaultOptions)}),r}setMutationDefaults(e,t){this.#a.set(ol(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],r={};return t.forEach(a=>{ll(e,a.mutationKey)&&Object.assign(r,a.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=lp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cp&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Dw=S.createContext(void 0),ka=e=>{const t=S.useContext(Dw);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},lj=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Dw.Provider,{value:e,children:t})),kw=S.createContext(!1),cj=()=>S.useContext(kw);kw.Provider;function uj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var dj=S.createContext(uj()),fj=()=>S.useContext(dj),hj=(e,t,r)=>{const a=r?.state.error&&typeof e.throwOnError=="function"?Rw(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},mj=e=>{S.useEffect(()=>{e.clearReset()},[e])},pj=({result:e,errorResetBoundary:t,throwOnError:r,query:a,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(o&&e.data===void 0||Rw(r,[e.error,a])),gj=e=>{if(e.suspense){const r=o=>o==="static"?o:Math.max(o??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...o)=>r(a(...o)):r(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},vj=(e,t)=>e.isLoading&&e.isFetching&&!t,yj=(e,t)=>e?.suspense&&t.isPending,Ab=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function zw(e,t,r){const a=cj(),o=fj(),l=ka(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const d=l.getQueryCache().get(u.queryHash),m=e.subscribed!==!1;u._optimisticResults=a?"isRestoring":m?"optimistic":void 0,gj(u),hj(u,o,d),mj(o);const p=!l.getQueryCache().get(u.queryHash),[y]=S.useState(()=>new t(l,u)),v=y.getOptimisticResult(u),b=!a&&m;if(S.useSyncExternalStore(S.useCallback(x=>{const w=b?y.subscribe(on.batchCalls(x)):On;return y.updateResult(),w},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),S.useEffect(()=>{y.setOptions(u)},[u,y]),yj(u,v))throw Ab(u,y,o);if(pj({result:v,errorResetBoundary:o,throwOnError:u.throwOnError,query:d,suspense:u.suspense}))throw v.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,v),u.experimental_prefetchInRender&&!cl.isServer()&&vj(v,a)&&(p?Ab(u,y,o):d?.promise)?.catch(On).finally(()=>{y.updateResult()}),u.notifyOnChangeProps?v:y.trackResult(v)}function Ft(e,t){return zw(e,Nw)}function bj(e,t){return zw(e,nj)}let Mb=!1;function xj(e){const t=e.analytics;if(!t?.key||Mb)return;Mb=!0;const r=document.createElement("script");r.src=t.host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",r.async=!0,r.onload=()=>{const a=window.posthog;a&&(a.init(t.key,{api_host:t.host,defaults:"2026-05-30",capture_pageview:"history_change",session_recording:{maskAllInputs:!0,maskTextSelector:"*"}}),e.me&&a.identify(e.me.email,{email:e.me.email,name:e.me.name,...e.billing?{plan:e.billing.plan}:{}}))},document.head.appendChild(r)}function Lw(e,t){window.posthog?.capture(e,t)}const wj=[[/^POST \/api\/projects$/,"project_created"],[/^DELETE \/api\/projects\//,"project_deleted"],[/^POST \/api\/p\/[^/]+\/restore$/,"file_restored"],[/^DELETE \/api\/shares\//,"share_revoked"],[/^PATCH \/api\/shares\//,"share_expiry_changed"],[/^POST \/api\/orgs\/[^/]+\/invites$/,"invite_created"],[/^DELETE \/api\/orgs\/[^/]+\/invites\//,"invite_revoked"],[/^POST \/api\/invites\//,"invite_accepted"],[/^PUT \/api\/p\/[^/]+\/permissions\/./,"project_access_granted"],[/^DELETE \/api\/p\/[^/]+\/permissions\/./,"project_access_revoked"]];function $w(e,t){const r=e+" "+t.split("?")[0],a=wj.find(([o])=>o.test(r));a&&Lw(a[1])}function dp(){throw location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),new Error("signing in…")}function Sj(e,t){const r=t.trim();switch(e){case 403:return r.includes("seat")?"This plan is out of seats. Upgrade to add more people.":r.includes("owner")?"Only owners can do that.":"You don't have access to that.";case 409:return r?r[0].toUpperCase()+r.slice(1):"That is managed outside this hub.";case 404:return"That is gone — it may have been removed already.";case 413:return"This project is over its plan limit.";case 429:return"Too many requests. Give it a moment.";default:return e>=500?"The server had a problem. Try again.":r?r[0].toUpperCase()+r.slice(1):"Something went wrong."}}async function Nu(e){throw new Error(Sj(e.status,await e.text()))}async function qt(e){const t=await fetch(e,{headers:{Accept:"application/json"}});return t.status===401&&dp(),t.ok||await Nu(t),t.json()}async function _j(e){const t=await fetch(e);return t.status===401&&dp(),t.ok||await Nu(t),t}async function Wn(e,t,r){const a={method:e};r!==void 0&&(a.headers={"Content-Type":"application/json"},a.body=JSON.stringify(r));const o=await fetch(t,a);return o.ok||await Nu(o),$w(e,t),o.status===204?{}:o.json()}async function ei(e,t){const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t||{})});return r.status===401&&dp(),r.ok||await Nu(r),$w("POST",e),r.json()}function Cj(){return Ft({queryKey:["config"],queryFn:async()=>{const e=await qt("/api/config");return e.auth.enabled&&!e.me&&(location.href="/auth/login?next="+encodeURIComponent(location.pathname+location.search),await new Promise(()=>{})),xj(e),e},staleTime:1/0})}var za=Sw();const Ej=ww(za);function Nb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gs(...e){return t=>{let r=!1;const a=e.map(o=>{const l=Nb(o,t);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;o{let{children:o,...l}=r,u=null,d=!1;const m=[];Db(o)&&typeof Hc=="function"&&(o=Hc(o._payload)),S.Children.forEach(o,b=>{if(Mj(b)){d=!0;const x=b;let w="child"in x.props?x.props.child:x.props.children;Db(w)&&typeof Hc=="function"&&(w=Hc(w._payload)),u=Tj(x,w),m.push(u?.props?.children)}else m.push(b)}),u?u=S.cloneElement(u,void 0,m):!d&&S.Children.count(o)===1&&S.isValidElement(o)&&(u=o);const p=u?Aj(u):void 0,y=it(a,p);if(!u){if(o||o===0)throw new Error(d?zj(e):kj(e));return o}const v=Oj(l,u.props??{});return u.type!==S.Fragment&&(v.ref=a?y:p),S.cloneElement(u,v)});return t.displayName=`${e}.Slot`,t}var Rj=Ea("Slot"),Iw=Symbol.for("radix.slottable");function jj(e){const t=r=>"child"in r?r.children(r.child):r.children;return t.displayName=`${e}.Slottable`,t.__radixId=Iw,t}var Tj=(e,t)=>{if("child"in e.props){const r=e.props.child;return S.isValidElement(r)?S.cloneElement(r,void 0,e.props.children(r.props.children)):null}return S.isValidElement(t)?t:null};function Oj(e,t){const r={...t};for(const a in t){const o=e[a],l=t[a];/^on[A-Z]/.test(a)?o&&l?r[a]=(...d)=>{const m=l(...d);return o(...d),m}:o&&(r[a]=o):a==="style"?r[a]={...o,...l}:a==="className"&&(r[a]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}function Aj(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Mj(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iw}var Nj=Symbol.for("react.lazy");function Db(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Nj&&"_payload"in e&&Dj(e._payload)}function Dj(e){return typeof e=="object"&&e!==null&&"then"in e}var kj=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,zj=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Hc=Mu[" use ".trim().toString()],Lj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=Lj.reduce((e,t)=>{const r=Ea(`Primitive.${t}`),a=S.forwardRef((o,l)=>{const{asChild:u,...d}=o,m=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(m,{...d,ref:l})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function Pw(e,t){e&&za.flushSync(()=>e.dispatchEvent(t))}var Fw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$j="VisuallyHidden",Vw=S.forwardRef((e,t)=>f.jsx(Pe.span,{...e,ref:t,style:{...Fw,...e.style}}));Vw.displayName=$j;var Ij=Vw;function Ki(e,t=[]){let r=[];function a(l,u){const d=S.createContext(u);d.displayName=l+"Context";const m=r.length;r=[...r,u];const p=v=>{const{scope:b,children:x,...w}=v,_=b?.[e]?.[m]||d,E=S.useMemo(()=>w,Object.values(w));return f.jsx(_.Provider,{value:E,children:x})};p.displayName=l+"Provider";function y(v,b,x={}){const{optional:w=!1}=x,_=b?.[e]?.[m]||d,E=S.useContext(_);if(E)return E;if(u!==void 0)return u;if(!w)throw new Error(`\`${v}\` must be used within \`${l}\``)}return[p,y]}const o=()=>{const l=r.map(u=>S.createContext(u));return function(d){const m=d?.[e]||l;return S.useMemo(()=>({[`__scope${e}`]:{...d,[e]:m}}),[d,m])}};return o.scopeName=e,[a,Pj(o,...t)]}function Pj(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const a=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=a.reduce((d,{useScope:m,scopeName:p})=>{const v=m(l)[`__scope${p}`];return{...d,...v}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function fp(e){const t=e+"CollectionProvider",[r,a]=Ki(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=_=>{const{scope:E,children:R}=_,T=S.useRef(null),O=S.useRef(new Map).current;return f.jsx(o,{scope:E,itemMap:O,collectionRef:T,children:R})};u.displayName=t;const d=e+"CollectionSlot",m=Ea(d),p=S.forwardRef((_,E)=>{const{scope:R,children:T}=_,O=l(d,R),N=it(E,O.collectionRef);return f.jsx(m,{ref:N,children:T})});p.displayName=d;const y=e+"CollectionItemSlot",v="data-radix-collection-item",b=Ea(y),x=S.forwardRef((_,E)=>{const{scope:R,children:T,...O}=_,N=S.useRef(null),k=it(E,N),B=l(y,R);return S.useEffect(()=>(B.itemMap.set(N,{ref:N,...O}),()=>{B.itemMap.delete(N)})),f.jsx(b,{[v]:"",ref:k,children:T})});x.displayName=y;function w(_){const E=l(e+"CollectionConsumer",_);return S.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const O=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((B,H)=>O.indexOf(B.ref.current)-O.indexOf(H.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:u,Slot:p,ItemSlot:x},w,a]}function Te(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e?.(o),r===!1||!o||!o.defaultPrevented)return t?.(o)}}var Qt=globalThis?.document?S.useLayoutEffect:()=>{},Fj=Mu[" useInsertionEffect ".trim().toString()]||Qt;function Zs({prop:e,defaultProp:t,onChange:r=()=>{},caller:a}){const[o,l,u]=Vj({defaultProp:t,onChange:r}),d=e!==void 0,m=d?e:o;{const y=S.useRef(e!==void 0);S.useEffect(()=>{const v=y.current;v!==d&&console.warn(`${a} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),y.current=d},[d,a])}const p=S.useCallback(y=>{if(d){const v=Uj(y)?y(e):y;v!==e&&u.current?.(v)}else l(y)},[d,e,l,u]);return[m,p]}function Vj({defaultProp:e,onChange:t}){const[r,a]=S.useState(e),o=S.useRef(r),l=S.useRef(t);return Fj(()=>{l.current=t},[t]),S.useEffect(()=>{o.current!==r&&(l.current?.(r),o.current=r)},[r,o]),[r,a,l]}function Uj(e){return typeof e=="function"}function Hj(e,t){return S.useReducer((r,a)=>t[r][a]??r,e)}var gr=e=>{const{present:t,children:r}=e,a=Bj(t),o=typeof r=="function"?r({present:a.isPresent}):S.Children.only(r),l=qj(a.ref,Gj(o));return typeof r=="function"||a.isPresent?S.cloneElement(o,{ref:l}):null};gr.displayName="Presence";function Bj(e){const[t,r]=S.useState(),a=S.useRef(null),o=S.useRef(e),l=S.useRef("none"),u=S.useRef(void 0),d=e?"mounted":"unmounted",[m,p]=Hj(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{m==="mounted"?(l.current=u.current??Zo(a.current),u.current=void 0):l.current="none"},[m]),Qt(()=>{const y=a.current,v=o.current;if(v!==e){const x=l.current,w=Zo(y);e?(u.current=w,p("MOUNT")):w==="none"||y?.display==="none"?p("UNMOUNT"):p(v&&x!==w?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),Qt(()=>{if(t){let y;const v=t.ownerDocument.defaultView??window,b=w=>{const E=Zo(a.current).includes(CSS.escape(w.animationName));if(w.target===t&&E&&(p("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",y=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},x=w=>{w.target===t&&(l.current=Zo(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{v.clearTimeout(y),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:S.useCallback(y=>{if(y){const v=getComputedStyle(y);a.current=v,u.current=Zo(v)}else a.current=null;r(y)},[])}}function kb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qj(...e){const t=S.useRef(e);return t.current=e,S.useCallback(r=>{const a=t.current;let o=!1;const l=a.map(u=>{const d=kb(u,r);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u{}),Kj=0;function fn(e){const[t,r]=S.useState(Zj());return Qt(()=>{r(a=>a??String(Kj++))},[e]),t?`radix-${t}`:""}var Yj=S.createContext(void 0);function hp(e){const t=S.useContext(Yj);return e||t||"ltr"}function tr(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>((...r)=>t.current?.(...r)),[])}var Qj="DismissableLayer",Sm="dismissableLayer.update",Xj="dismissableLayer.pointerDownOutside",Jj="dismissableLayer.focusOutside",zb,mp=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),bl=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:m,...p}=e,y=S.useContext(mp),[v,b]=S.useState(null),x=v?.ownerDocument??globalThis?.document,[,w]=S.useState({}),_=it(t,b),E=Array.from(y.layers),[R]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=R?E.indexOf(R):-1,O=v?E.indexOf(v):-1,N=y.layersWithOutsidePointerEventsDisabled.size>0,k=O>=T,B=S.useRef(!1),H=rT(ge=>{l?.(ge),d?.(ge),ge.defaultPrevented||m?.()},{ownerDocument:x,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback(ge=>{if(!(ge instanceof Node))return!1;const he=[...y.branches].some(de=>de.contains(ge));return k&&!he},[y.branches,k])}),I=iT(ge=>{if(a&&B.current)return;const he=ge.target;[...y.branches].some(Z=>Z.contains(he))||(u?.(ge),d?.(ge),ge.defaultPrevented||m?.())},x),ne=v?O===E.length-1:!1,pe=tr(ge=>{ge.key==="Escape"&&(o?.(ge),!ge.defaultPrevented&&m&&(ge.preventDefault(),m()))});return S.useEffect(()=>{if(ne)return x.addEventListener("keydown",pe,{capture:!0}),()=>x.removeEventListener("keydown",pe,{capture:!0})},[x,ne,pe]),S.useEffect(()=>{if(v)return r&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(zb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(v)),y.layers.add(v),Lb(),()=>{r&&(y.layersWithOutsidePointerEventsDisabled.delete(v),y.layersWithOutsidePointerEventsDisabled.size===0&&(x.body.style.pointerEvents=zb))}},[v,x,r,y]),S.useEffect(()=>()=>{v&&(y.layers.delete(v),y.layersWithOutsidePointerEventsDisabled.delete(v),Lb())},[v,y]),S.useEffect(()=>{const ge=()=>w({});return document.addEventListener(Sm,ge),()=>document.removeEventListener(Sm,ge)},[]),f.jsx(Pe.div,{...p,ref:_,style:{pointerEvents:N?k?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,I.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,H.onPointerDownCapture)})});bl.displayName=Qj;var Wj="DismissableLayerBranch",eT=S.forwardRef((e,t)=>{const r=S.useContext(mp),a=S.useRef(null),o=it(t,a);return S.useEffect(()=>{const l=a.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),f.jsx(Pe.div,{...e,ref:o})});eT.displayName=Wj;function tT(){const e=S.useContext(mp),[t,r]=S.useState(null);return S.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}var nT=()=>!0;function rT(e,t){const{ownerDocument:r=globalThis?.document,deferPointerDownOutside:a=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:l,shouldHandlePointerDownOutside:u=nT}=t,d=tr(e),m=S.useRef(!1),p=S.useRef(!1),y=S.useRef(new Map),v=S.useRef(()=>{});return S.useEffect(()=>{function b(){p.current=!1,o.current=!1,y.current.clear()}function x(){return Array.from(y.current.values()).some(Boolean)}function w(O){if(!p.current)return;const N=O.target;N instanceof Node&&[...l].some(B=>B.contains(N))||y.current.set(O.type,!0),O.type==="click"&&window.setTimeout(()=>{p.current&&v.current()},0)}function _(O){p.current&&y.current.set(O.type,!1)}const E=O=>{if(O.target&&!m.current){let N=function(){r.removeEventListener("click",v.current);const B=x();b(),B||Uw(Xj,d,k,{discrete:!0})};if(!u(O.target)){r.removeEventListener("click",v.current),b(),m.current=!1;return}const k={originalEvent:O};p.current=!0,o.current=a&&O.button===0,y.current.clear(),!a||O.button!==0?N():(r.removeEventListener("click",v.current),v.current=N,r.addEventListener("click",v.current,{once:!0}))}else r.removeEventListener("click",v.current),b();m.current=!1},R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const O of R)r.addEventListener(O,w,!0),r.addEventListener(O,_);const T=window.setTimeout(()=>{r.addEventListener("pointerdown",E)},0);return()=>{window.clearTimeout(T),r.removeEventListener("pointerdown",E),r.removeEventListener("click",v.current);for(const O of R)r.removeEventListener(O,w,!0),r.removeEventListener(O,_)}},[r,d,a,o,l,u]),{onPointerDownCapture:()=>m.current=!0}}function iT(e,t=globalThis?.document){const r=tr(e),a=S.useRef(!1);return S.useEffect(()=>{const o=l=>{l.target&&!a.current&&Uw(Jj,r,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Lb(){const e=new CustomEvent(Sm);document.dispatchEvent(e)}function Uw(e,t,r,{discrete:a}){const o=r.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),a?Pw(o,l):o.dispatchEvent(l)}var kh="focusScope.autoFocusOnMount",zh="focusScope.autoFocusOnUnmount",$b={bubbles:!1,cancelable:!0},aT="FocusScope",Du=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:a=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=e,[d,m]=S.useState(null),p=tr(o),y=tr(l),v=S.useRef(null),b=it(t,m),x=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(a){let _=function(O){if(x.paused||!d)return;const N=O.target;d.contains(N)?v.current=N:ki(v.current,{select:!0})},E=function(O){if(x.paused||!d)return;const N=O.relatedTarget;N!==null&&(d.contains(N)||ki(v.current,{select:!0}))},R=function(O){if(document.activeElement===document.body)for(const k of O)k.removedNodes.length>0&&ki(d)};document.addEventListener("focusin",_),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",E),T.disconnect()}}},[a,d,x.paused]),S.useEffect(()=>{if(d){Pb.add(x);const _=document.activeElement;if(!d.contains(_)){const R=new CustomEvent(kh,$b);d.addEventListener(kh,p),d.dispatchEvent(R),R.defaultPrevented||(sT(dT(Hw(d)),{select:!0}),document.activeElement===_&&ki(d))}return()=>{d.removeEventListener(kh,p),setTimeout(()=>{const R=new CustomEvent(zh,$b);d.addEventListener(zh,y),d.dispatchEvent(R),R.defaultPrevented||ki(_??document.body,{select:!0}),d.removeEventListener(zh,y),Pb.remove(x)},0)}}},[d,p,y,x]);const w=S.useCallback(_=>{if(!r&&!a||x.paused)return;const E=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,R=document.activeElement;if(E&&R){const T=_.currentTarget,[O,N]=oT(T);O&&N?!_.shiftKey&&R===N?(_.preventDefault(),r&&ki(O,{select:!0})):_.shiftKey&&R===O&&(_.preventDefault(),r&&ki(N,{select:!0})):R===T&&_.preventDefault()}},[r,a,x.paused]);return f.jsx(Pe.div,{tabIndex:-1,...u,ref:b,onKeyDown:w})});Du.displayName=aT;function sT(e,{select:t=!1}={}){const r=document.activeElement;for(const a of e)if(ki(a,{select:t}),document.activeElement!==r)return}function oT(e){const t=Hw(e),r=Ib(t,e),a=Ib(t.reverse(),e);return[r,a]}function Hw(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ib(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const a of e)if(!(r?!a.checkVisibility({checkVisibilityCSS:!0}):lT(a,{upTo:t})))return a}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cT(e){return e instanceof HTMLInputElement&&"select"in e}function ki(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&cT(e)&&t&&e.select()}}var Pb=uT();function uT(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Fb(e,t),e.unshift(t)},remove(t){e=Fb(e,t),e[0]?.resume()}}}function Fb(e,t){const r=[...e],a=r.indexOf(t);return a!==-1&&r.splice(a,1),r}function dT(e){return e.filter(t=>t.tagName!=="A")}var fT="Portal",xl=S.forwardRef((e,t)=>{const{container:r,...a}=e,[o,l]=S.useState(!1);Qt(()=>l(!0),[]);const u=r||o&&globalThis?.document?.body;return u?za.createPortal(f.jsx(Pe.div,{...a,ref:t}),u):null});xl.displayName=fT;var Bc=0,Rs=null;function pp(){S.useEffect(()=>{Rs||(Rs={start:Vb(),end:Vb()});const{start:e,end:t}=Rs;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Bc++,()=>{Bc===1&&(Rs?.start.remove(),Rs?.end.remove(),Rs=null),Bc=Math.max(0,Bc-1)}},[])}function Vb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Tr=function(){return Tr=Object.assign||function(t){for(var r,a=1,o=arguments.length;a"u")return OT;var t=AT(e),r=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-r+t[2]-t[0])}},NT=Zw(),Ps="data-scroll-locked",DT=function(e,t,r,a){var o=e.left,l=e.top,u=e.right,d=e.gap;return r===void 0&&(r="margin"),`
+ .`.concat(mT,` {
+ overflow: hidden `).concat(a,`;
+ padding-right: `).concat(d,"px ").concat(a,`;
}
body[`).concat(Ps,`] {
- overflow: hidden `).concat(i,`;
+ overflow: hidden `).concat(a,`;
overscroll-behavior: contain;
- `).concat([t&&"position: relative ".concat(i,";"),r==="margin"&&`
+ `).concat([t&&"position: relative ".concat(a,";"),r==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(l,`px;
padding-right: `).concat(u,`px;
margin-left:0;
margin-top:0;
- margin-right: `).concat(d,"px ").concat(i,`;
- `),r==="padding"&&"padding-right: ".concat(d,"px ").concat(i,";")].filter(Boolean).join(""),`
+ margin-right: `).concat(d,"px ").concat(a,`;
+ `),r==="padding"&&"padding-right: ".concat(d,"px ").concat(a,";")].filter(Boolean).join(""),`
}
.`).concat(su,` {
- right: `).concat(d,"px ").concat(i,`;
+ right: `).concat(d,"px ").concat(a,`;
}
.`).concat(ou,` {
- margin-right: `).concat(d,"px ").concat(i,`;
+ margin-right: `).concat(d,"px ").concat(a,`;
}
.`).concat(su," .").concat(su,` {
- right: 0 `).concat(i,`;
+ right: 0 `).concat(a,`;
}
.`).concat(ou," .").concat(ou,` {
- margin-right: 0 `).concat(i,`;
+ margin-right: 0 `).concat(a,`;
}
body[`).concat(Ps,`] {
- `).concat(mT,": ").concat(d,`px;
+ `).concat(pT,": ").concat(d,`px;
}
-`)},Hb=function(){var e=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(e)?e:0},DT=function(){S.useEffect(function(){return document.body.setAttribute(Ps,(Hb()+1).toString()),function(){var e=Hb()-1;e<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,e.toString())}},[])},kT=function(e){var t=e.noRelative,r=e.noImportant,i=e.gapMode,o=i===void 0?"margin":i;DT();var l=S.useMemo(function(){return AT(o)},[o]);return S.createElement(MT,{styles:NT(l,!t,o,r?"":"!important")})},_m=!1;if(typeof window<"u")try{var qc=Object.defineProperty({},"passive",{get:function(){return _m=!0,!0}});window.addEventListener("test",qc,qc),window.removeEventListener("test",qc,qc)}catch{_m=!1}var js=_m?{passive:!1}:!1,zT=function(e){return e.tagName==="TEXTAREA"},Kw=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!zT(e)&&r[t]==="visible")},LT=function(e){return Kw(e,"overflowY")},$T=function(e){return Kw(e,"overflowX")},Bb=function(e,t){var r=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var o=Yw(e,i);if(o){var l=Qw(e,i),u=l[1],d=l[2];if(u>d)return!0}i=i.parentNode}while(i&&i!==r.body);return!1},IT=function(e){var t=e.scrollTop,r=e.scrollHeight,i=e.clientHeight;return[t,r,i]},PT=function(e){var t=e.scrollLeft,r=e.scrollWidth,i=e.clientWidth;return[t,r,i]},Yw=function(e,t){return e==="v"?LT(t):$T(t)},Qw=function(e,t){return e==="v"?IT(t):PT(t)},FT=function(e,t){return e==="h"&&t==="rtl"?-1:1},VT=function(e,t,r,i,o){var l=FT(e,window.getComputedStyle(t).direction),u=l*i,d=r.target,m=t.contains(d),p=!1,y=u>0,v=0,b=0;do{if(!d)break;var x=Qw(e,d),w=x[0],_=x[1],E=x[2],R=_-E-l*w;(w||R)&&Yw(e,d)&&(v+=R,b+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&d!==document.body||m&&(t.contains(d)||t===d));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(p=!0),p},Gc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qb=function(e){return[e.deltaX,e.deltaY]},Gb=function(e){return e&&"current"in e?e.current:e},UT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HT=function(e){return`
+`)},Hb=function(){var e=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(e)?e:0},kT=function(){S.useEffect(function(){return document.body.setAttribute(Ps,(Hb()+1).toString()),function(){var e=Hb()-1;e<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,e.toString())}},[])},zT=function(e){var t=e.noRelative,r=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;kT();var l=S.useMemo(function(){return MT(o)},[o]);return S.createElement(NT,{styles:DT(l,!t,o,r?"":"!important")})},_m=!1;if(typeof window<"u")try{var qc=Object.defineProperty({},"passive",{get:function(){return _m=!0,!0}});window.addEventListener("test",qc,qc),window.removeEventListener("test",qc,qc)}catch{_m=!1}var js=_m?{passive:!1}:!1,LT=function(e){return e.tagName==="TEXTAREA"},Kw=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!LT(e)&&r[t]==="visible")},$T=function(e){return Kw(e,"overflowY")},IT=function(e){return Kw(e,"overflowX")},Bb=function(e,t){var r=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=Yw(e,a);if(o){var l=Qw(e,a),u=l[1],d=l[2];if(u>d)return!0}a=a.parentNode}while(a&&a!==r.body);return!1},PT=function(e){var t=e.scrollTop,r=e.scrollHeight,a=e.clientHeight;return[t,r,a]},FT=function(e){var t=e.scrollLeft,r=e.scrollWidth,a=e.clientWidth;return[t,r,a]},Yw=function(e,t){return e==="v"?$T(t):IT(t)},Qw=function(e,t){return e==="v"?PT(t):FT(t)},VT=function(e,t){return e==="h"&&t==="rtl"?-1:1},UT=function(e,t,r,a,o){var l=VT(e,window.getComputedStyle(t).direction),u=l*a,d=r.target,m=t.contains(d),p=!1,y=u>0,v=0,b=0;do{if(!d)break;var x=Qw(e,d),w=x[0],_=x[1],E=x[2],R=_-E-l*w;(w||R)&&Yw(e,d)&&(v+=R,b+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!m&&d!==document.body||m&&(t.contains(d)||t===d));return(y&&Math.abs(v)<1||!y&&Math.abs(b)<1)&&(p=!0),p},Gc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qb=function(e){return[e.deltaX,e.deltaY]},Gb=function(e){return e&&"current"in e?e.current:e},HT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},BT=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
-`)},BT=0,Ts=[];function qT(e){var t=S.useRef([]),r=S.useRef([0,0]),i=S.useRef(),o=S.useState(BT++)[0],l=S.useState(Zw)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var _=fT([e.lockRef.current],(e.shards||[]).map(Gb),!0).filter(Boolean);return _.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),_.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=S.useCallback(function(_,E){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!u.current.allowPinchZoom;var R=Gc(_),T=r.current,O="deltaX"in _?_.deltaX:T[0]-R[0],N="deltaY"in _?_.deltaY:T[1]-R[1],k,B=_.target,H=Math.abs(O)>Math.abs(N)?"h":"v";if("touches"in _&&H==="h"&&B.type==="range")return!1;var I=window.getSelection(),ne=I&&I.anchorNode,pe=ne?ne===B||ne.contains(B):!1;if(pe)return!1;var ge=Bb(H,B);if(!ge)return!0;if(ge?k=H:(k=H==="v"?"h":"v",ge=Bb(H,B)),!ge)return!1;if(!i.current&&"changedTouches"in _&&(O||N)&&(i.current=k),!k)return!0;var he=i.current||k;return VT(he,E,_,he==="h"?O:N)},[]),m=S.useCallback(function(_){var E=_;if(!(!Ts.length||Ts[Ts.length-1]!==l)){var R="deltaY"in E?qb(E):Gc(E),T=t.current.filter(function(k){return k.name===E.type&&(k.target===E.target||E.target===k.shadowParent)&&UT(k.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var O=(u.current.shards||[]).map(Gb).filter(Boolean).filter(function(k){return k.contains(E.target)}),N=O.length>0?d(E,O[0]):!u.current.noIsolation;N&&E.cancelable&&E.preventDefault()}}},[]),p=S.useCallback(function(_,E,R,T){var O={name:_,delta:E,target:R,should:T,shadowParent:GT(R)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(N){return N!==O})},1)},[]),y=S.useCallback(function(_){r.current=Gc(_),i.current=void 0},[]),v=S.useCallback(function(_){p(_.type,qb(_),_.target,d(_,e.lockRef.current))},[]),b=S.useCallback(function(_){p(_.type,Gc(_),_.target,d(_,e.lockRef.current))},[]);S.useEffect(function(){return Ts.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",m,js),document.addEventListener("touchmove",m,js),document.addEventListener("touchstart",y,js),function(){Ts=Ts.filter(function(_){return _!==l}),document.removeEventListener("wheel",m,js),document.removeEventListener("touchmove",m,js),document.removeEventListener("touchstart",y,js)}},[]);var x=e.removeScrollBar,w=e.inert;return S.createElement(S.Fragment,null,w?S.createElement(l,{styles:HT(o)}):null,x?S.createElement(kT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function GT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ZT=wT(Gw,qT);var zu=S.forwardRef(function(e,t){return S.createElement(ku,Tr({},e,{ref:t,sideCar:ZT}))});zu.classNames=ku.classNames;var KT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Os=new WeakMap,Zc=new WeakMap,Kc={},Ph=0,Xw=function(e){return e&&(e.host||Xw(e.parentNode))},YT=function(e,t){return t.map(function(r){if(e.contains(r))return r;var i=Xw(r);return i&&e.contains(i)?i:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},QT=function(e,t,r,i){var o=YT(t,Array.isArray(e)?e:[e]);Kc[r]||(Kc[r]=new WeakMap);var l=Kc[r],u=[],d=new Set,m=new Set(o),p=function(v){!v||d.has(v)||(d.add(v),p(v.parentNode))};o.forEach(p);var y=function(v){!v||m.has(v)||Array.prototype.forEach.call(v.children,function(b){if(d.has(b))y(b);else try{var x=b.getAttribute(i),w=x!==null&&x!=="false",_=(Os.get(b)||0)+1,E=(l.get(b)||0)+1;Os.set(b,_),l.set(b,E),u.push(b),_===1&&w&&Zc.set(b,!0),E===1&&b.setAttribute(r,"true"),w||b.setAttribute(i,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return y(t),d.clear(),Ph++,function(){u.forEach(function(v){var b=Os.get(v)-1,x=l.get(v)-1;Os.set(v,b),l.set(v,x),b||(Zc.has(v)||v.removeAttribute(i),Zc.delete(v)),x||v.removeAttribute(r)}),Ph--,Ph||(Os=new WeakMap,Os=new WeakMap,Zc=new WeakMap,Kc={})}},gp=function(e,t,r){r===void 0&&(r="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),o=KT(e);return o?(i.push.apply(i,Array.from(o.querySelectorAll("[aria-live], script"))),QT(i,o,r,"aria-hidden")):function(){return null}},Lu="Dialog",[Jw]=Ka(Lu),[XT,vr]=Jw(Lu),vp=e=>{const{__scopeDialog:t,children:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=S.useRef(null),m=S.useRef(null),[p,y]=Zs({prop:i,defaultProp:o??!1,onChange:l,caller:Lu});return f.jsx(XT,{scope:t,triggerRef:d,contentRef:m,contentId:fn(),titleId:fn(),descriptionId:fn(),open:p,onOpenChange:y,onOpenToggle:S.useCallback(()=>y(v=>!v),[y]),modal:u,children:r})};vp.displayName=Lu;var Ww="DialogTrigger",JT=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(Ww,r),l=at(t,o.triggerRef);return f.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Sp(o.open),...i,ref:l,onClick:Te(e.onClick,o.onOpenToggle)})});JT.displayName=Ww;var yp="DialogPortal",[WT,eS]=Jw(yp,{forceMount:void 0}),bp=e=>{const{__scopeDialog:t,forceMount:r,children:i,container:o}=e,l=vr(yp,t);return f.jsx(WT,{scope:t,forceMount:r,children:S.Children.map(i,u=>f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:u})}))})};bp.displayName=yp;var pu="DialogOverlay",xp=S.forwardRef((e,t)=>{const r=eS(pu,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=vr(pu,e.__scopeDialog);return l.modal?f.jsx(gr,{present:i||l.open,children:f.jsx(tO,{...o,ref:t})}):null});xp.displayName=pu;var eO=Ei("DialogOverlay.RemoveScroll"),tO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(pu,r),l=eT(),u=at(t,l);return f.jsx(zu,{as:eO,allowPinchZoom:!0,shards:[o.contentRef],children:f.jsx(Pe.div,{"data-state":Sp(o.open),...i,ref:u,style:{pointerEvents:"auto",...i.style}})})}),Ks="DialogContent",wp=S.forwardRef((e,t)=>{const r=eS(Ks,e.__scopeDialog),{forceMount:i=r.forceMount,...o}=e,l=vr(Ks,e.__scopeDialog);return f.jsx(gr,{present:i||l.open,children:l.modal?f.jsx(nO,{...o,ref:t}):f.jsx(rO,{...o,ref:t})})});wp.displayName=Ks;var nO=S.forwardRef((e,t)=>{const r=vr(Ks,e.__scopeDialog),i=S.useRef(null),o=at(t,r.contentRef,i);return S.useEffect(()=>{const l=i.current;if(l)return gp(l)},[]),f.jsx(tS,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{l.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault())})}),rO=S.forwardRef((e,t)=>{const r=vr(Ks,e.__scopeDialog),i=S.useRef(!1),o=S.useRef(!1);return f.jsx(tS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(i.current||r.triggerRef.current?.focus(),l.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(i.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=l.target;r.triggerRef.current?.contains(u)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),tS=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,...u}=e,d=vr(Ks,r);return pp(),f.jsx(f.Fragment,{children:f.jsx(Du,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:l,children:f.jsx(bl,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Sp(d.open),...u,ref:t,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1)})})})}),nS="DialogTitle",rS=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(nS,r);return f.jsx(Pe.h2,{id:o.titleId,...i,ref:t})});rS.displayName=nS;var aS="DialogDescription",aO=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(aS,r);return f.jsx(Pe.p,{id:o.descriptionId,...i,ref:t})});aO.displayName=aS;var iS="DialogClose",sS=S.forwardRef((e,t)=>{const{__scopeDialog:r,...i}=e,o=vr(iS,r);return f.jsx(Pe.button,{type:"button",...i,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});sS.displayName=iS;function Sp(e){return e?"open":"closed"}function iO(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function sO(e){const[t,r]=S.useState(void 0);return Qt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let u,d;if("borderBoxSize"in l){const m=l.borderBoxSize,p=Array.isArray(m)?m[0]:m;u=p.inlineSize,d=p.blockSize}else u=e.offsetWidth,d=e.offsetHeight;r({width:u,height:d})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else r(void 0)},[e]),t}const oO=["top","right","bottom","left"],Ha=Math.min,ra=Math.max,gu=Math.round,Yc=Math.floor,aa=e=>({x:e,y:e}),lO={left:"right",right:"left",bottom:"top",top:"bottom"};function oS(e,t,r){return ra(e,Ha(t,r))}function ia(e,t){return typeof e=="function"?e(t):e}function Ba(e){return e.split("-")[0]}function Xs(e){return e.split("-")[1]}function _p(e){return e==="x"?"y":"x"}function Cp(e){return e==="y"?"height":"width"}function Or(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Ep(e){return _p(Or(e))}function cO(e,t,r){r===void 0&&(r=!1);const i=Xs(e),o=Ep(e),l=Cp(o);let u=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=vu(u)),[u,vu(u)]}function uO(e){const t=vu(e);return[Cm(e),t,Cm(t)]}function Cm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Zb=["left","right"],Kb=["right","left"],dO=["top","bottom"],fO=["bottom","top"];function hO(e,t,r){switch(e){case"top":case"bottom":return r?t?Kb:Zb:t?Zb:Kb;case"left":case"right":return t?dO:fO;default:return[]}}function mO(e,t,r,i){const o=Xs(e);let l=hO(Ba(e),r==="start",i);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Cm)))),l}function vu(e){const t=Ba(e);return lO[t]+e.slice(t.length)}function pO(e){var t,r,i,o;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(i=e.bottom)!=null?i:0,left:(o=e.left)!=null?o:0}}function lS(e){return typeof e!="number"?pO(e):{top:e,right:e,bottom:e,left:e}}function yu(e){const{x:t,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:t,right:t+i,bottom:r+o,x:t,y:r}}function Yb(e,t,r){let{reference:i,floating:o}=e;const l=Or(t),u=Ep(t),d=Cp(u),m=Ba(t),p=l==="y",y=i.x+i.width/2-o.width/2,v=i.y+i.height/2-o.height/2,b=i[d]/2-o[d]/2;let x;switch(m){case"top":x={x:y,y:i.y-o.height};break;case"bottom":x={x:y,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y:v};break;case"left":x={x:i.x-o.width,y:v};break;default:x={x:i.x,y:i.y}}const w=Xs(t);return w&&(x[u]+=b*(w==="end"?1:-1)*(r&&p?-1:1)),x}async function gO(e,t){var r;t===void 0&&(t={});const{x:i,y:o,platform:l,rects:u,elements:d,strategy:m}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=ia(t,e),w=lS(x),E=d[b?v==="floating"?"reference":"floating":v],R=yu(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(E)))==null||r?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:y,strategy:m})),T=v==="floating"?{x:i,y:o,width:u.floating.width,height:u.floating.height}:u.reference,O=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),N=await(l.isElement==null?void 0:l.isElement(O))&&await(l.getScale==null?void 0:l.getScale(O))||{x:1,y:1},k=yu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:O,strategy:m}):T);return{top:(R.top-k.top+w.top)/N.y,bottom:(k.bottom-R.bottom+w.bottom)/N.y,left:(R.left-k.left+w.left)/N.x,right:(k.right-R.right+w.right)/N.x}}const vO=50,yO=async(e,t,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=r,d=u.detectOverflow?u:{...u,detectOverflow:gO},m=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:y,y:v}=Yb(p,i,m),b=i,x=0;const w={};for(let _=0;_({name:"arrow",options:e,async fn(t){const{x:r,y:i,placement:o,rects:l,platform:u,elements:d,middlewareData:m}=t,{element:p,padding:y=0}=ia(e,t)||{};if(p==null)return{};const v=lS(y),b={x:r,y:i},x=Ep(o),w=Cp(x),_=await u.getDimensions(p),E=x==="y",R=E?"top":"left",T=E?"bottom":"right",O=E?"clientHeight":"clientWidth",N=l.reference[w]+l.reference[x]-b[x]-l.floating[w],k=b[x]-l.reference[x],B=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let H=B?B[O]:0;(!H||!await(u.isElement==null?void 0:u.isElement(B)))&&(H=d.floating[O]||l.floating[w]);const I=N/2-k/2,ne=H/2-_[w]/2-1,pe=Ha(v[R],ne),ge=Ha(v[T],ne),he=H-_[w]-ge,de=H/2-_[w]/2+I,Z=oS(pe,de,he),Se=!m.arrow&&Xs(o)!=null&&de!==Z&&l.reference[w]/2-(deZ<=0)){var ge,he;const Z=(((ge=l.flip)==null?void 0:ge.index)||0)+1,Se=H[Z];if(Se&&(!(v==="alignment"?T!==Or(Se):!1)||pe.every(ie=>Or(ie.placement)===T?ie.overflows[0]>0:!0)))return{data:{index:Z,overflows:pe},reset:{placement:Se}};let L=(he=pe.filter(K=>K.overflows[0]<=0).sort((K,ie)=>K.overflows[1]-ie.overflows[1])[0])==null?void 0:he.placement;if(!L)switch(x){case"bestFit":{var de;const K=(de=pe.filter(ie=>{if(B){const J=Or(ie.placement);return J===T||J==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(J=>J>0).reduce((J,te)=>J+te,0)]).sort((ie,J)=>ie[1]-J[1])[0])==null?void 0:de[0];K&&(L=K);break}case"initialPlacement":L=d;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Qb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xb(e){return oO.some(t=>e[t]>=0)}const wO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:i}=t,{strategy:o="referenceHidden",...l}=ia(e,t);switch(o){case"referenceHidden":{const u=await i.detectOverflow(t,{...l,elementContext:"reference"}),d=Qb(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:Xb(d)}}}case"escaped":{const u=await i.detectOverflow(t,{...l,altBoundary:!0}),d=Qb(u,r.floating);return{data:{escapedOffsets:d,escaped:Xb(d)}}}default:return{}}}}},cS=new Set(["left","top"]);async function SO(e,t){const{placement:r,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=Ba(r),d=Xs(r),m=Or(r)==="y",p=cS.has(u)?-1:1,y=l&&m?-1:1,v=ia(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:w}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof w=="number"&&(x=d==="end"?w*-1:w),m?{x:x*y,y:b*p}:{x:b*p,y:x*y}}const _O=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,i;const{x:o,y:l,placement:u,middlewareData:d}=t,m=await SO(t,e);return u===((r=d.offset)==null?void 0:r.placement)&&(i=d.arrow)!=null&&i.alignmentOffset?{}:{x:o+m.x,y:l+m.y,data:{...m,placement:u}}}}},CO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:i,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:m={fn:T=>{let{x:O,y:N}=T;return{x:O,y:N}}},...p}=ia(e,t),y={x:r,y:i},v=await l.detectOverflow(t,p),b=Or(o),x=_p(b);let w=y[x],_=y[b];const E=(T,O)=>oS(O+v[T==="y"?"top":"left"],O,O-v[T==="y"?"bottom":"right"]);u&&(w=E(x,w)),d&&(_=E(b,_));const R=m.fn({...t,[x]:w,[b]:_});return{...R,data:{x:R.x-r,y:R.y-i,enabled:{[x]:u,[b]:d}}}}}},EO=function(e){return e===void 0&&(e={}),{options:e,fn(t){var r,i;const{x:o,y:l,placement:u,rects:d,middlewareData:m}=t,{offset:p=0,mainAxis:y=!0,crossAxis:v=!0}=ia(e,t),b={x:o,y:l},x=Or(u),w=_p(x);let _=b[w],E=b[x];const R=ia(p,t),T=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(r=R.mainAxis)!=null?r:0,crossAxis:(i=R.crossAxis)!=null?i:0};if(y){const k=w==="y"?"height":"width",B=d.reference[w]-d.floating[k]+T.mainAxis,H=d.reference[w]+d.reference[k]-T.mainAxis;_H&&(_=H)}if(v){var O,N;const k=w==="y"?"width":"height",B=cS.has(Ba(u)),H=d.reference[x]-d.floating[k]+(B&&((O=m.offset)==null?void 0:O[x])||0)+(B?0:T.crossAxis),I=d.reference[x]+d.reference[k]+(B?0:((N=m.offset)==null?void 0:N[x])||0)-(B?T.crossAxis:0);EI&&(E=I)}return{[w]:_,[x]:E}}}},RO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:i,platform:o,elements:l}=t,{apply:u=()=>{},...d}=ia(e,t),m=await o.detectOverflow(t,d),p=Ba(r),y=Xs(r),v=Or(r)==="y",{width:b,height:x}=i.floating;let w,_;p==="top"||p==="bottom"?(w=p,_=y===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(_=p,w=y==="end"?"top":"bottom");const E=x-m.top-m.bottom,R=b-m.left-m.right,T=Ha(x-m[w],E),O=Ha(b-m[_],R),N=t.middlewareData.shift,k=!N;let B=T,H=O;N!=null&&N.enabled.x&&(H=R),N!=null&&N.enabled.y&&(B=E),k&&!y&&(v?H=b-2*ra(m.left,m.right):B=x-2*ra(m.top,m.bottom)),await u({...t,availableWidth:H,availableHeight:B});const I=await o.getDimensions(l.floating);return b!==I.width||x!==I.height?{reset:{rects:!0}}:{}}}};function $u(){return typeof window<"u"}function Js(e){return uS(e)?(e.nodeName||"").toLowerCase():"#document"}function Mn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sa(e){var t;return(t=(uS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uS(e){return $u()?e instanceof Node||e instanceof Mn(e).Node:!1}function Ar(e){return $u()?e instanceof Element||e instanceof Mn(e).Element:!1}function Ya(e){return $u()?e instanceof HTMLElement||e instanceof Mn(e).HTMLElement:!1}function Jb(e){return!$u()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mn(e).ShadowRoot}function Iu(e){const{overflow:t,overflowX:r,overflowY:i,display:o}=Mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+r)&&o!=="inline"&&o!=="contents"}function jO(e){return/^(table|td|th)$/.test(Js(e))}function Pu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const TO=/transform|translate|scale|rotate|perspective|filter/,OO=/paint|layout|strict|content/,bi=e=>!!e&&e!=="none";let Fh;function Rp(e){const t=Ar(e)?Mr(e):e;return bi(t.transform)||bi(t.translate)||bi(t.scale)||bi(t.rotate)||bi(t.perspective)||!jp()&&(bi(t.backdropFilter)||bi(t.filter))||TO.test(t.willChange||"")||OO.test(t.contain||"")}function AO(e){let t=Ri(e);for(;Ya(t)&&!ul(t);){if(Rp(t))return t;if(Pu(t))return null;t=Ri(t)}return null}function jp(){return Fh==null&&(Fh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fh}function ul(e){return/^(html|body|#document)$/.test(Js(e))}function Mr(e){return Mn(e).getComputedStyle(e)}function Fu(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ri(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jb(e)&&e.host||sa(e);return Jb(t)?t.host:t}function dS(e){const t=Ri(e);return ul(t)?(e.ownerDocument||e).body:Ya(t)&&Iu(t)?t:dS(t)}function dl(e,t,r){var i;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=dS(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=Mn(o);if(l){const d=Em(u);return t.concat(u,u.visualViewport||[],Iu(o)?o:[],d&&r?dl(d):[])}else return t.concat(o,dl(o,[],r))}function Em(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fS(e){const t=Mr(e);let r=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=Ya(e),l=o?e.offsetWidth:r,u=o?e.offsetHeight:i,d=gu(r)!==l||gu(i)!==u;return d&&(r=l,i=u),{width:r,height:i,$:d}}function Tp(e){return Ar(e)?e:e.contextElement}function Fs(e){const t=Tp(e);if(!Ya(t))return aa(1);const r=t.getBoundingClientRect(),{width:i,height:o,$:l}=fS(t);let u=(l?gu(r.width):r.width)/i,d=(l?gu(r.height):r.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const MO=aa(0);function hS(e){const t=Mn(e);return!jp()||!t.visualViewport?MO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function NO(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===Mn(e)}function ji(e,t,r,i){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=Tp(e);let u=aa(1);t&&(i?Ar(i)&&(u=Fs(i)):u=Fs(e));const d=NO(l,r,i)?hS(l):aa(0);let m=(o.left+d.x)/u.x,p=(o.top+d.y)/u.y,y=o.width/u.x,v=o.height/u.y;if(l&&i){const b=Mn(l),x=Ar(i)?Mn(i):i;let w=b,_=Em(w);for(;_&&x!==w;){const E=Fs(_),R=_.getBoundingClientRect(),T=Mr(_),O=R.left+(_.clientLeft+parseFloat(T.paddingLeft))*E.x,N=R.top+(_.clientTop+parseFloat(T.paddingTop))*E.y;m*=E.x,p*=E.y,y*=E.x,v*=E.y,m+=O,p+=N,w=Mn(_),_=Em(w)}}return yu({width:y,height:v,x:m,y:p})}function Vu(e,t){const r=Fu(e).scrollLeft;return t?t.left+r:ji(sa(e)).left+r}function mS(e,t){const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-Vu(e,r),o=r.top+t.scrollTop;return{x:i,y:o}}function DO(e){let{elements:t,rect:r,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=sa(i),d=t?Pu(t.floating):!1;if(i===u||d&&l)return r;let m={scrollLeft:0,scrollTop:0},p=aa(1);const y=aa(0),v=Ya(i);if((v||!l)&&((Js(i)!=="body"||Iu(u))&&(m=Fu(i)),v)){const x=ji(i);p=Fs(i),y.x=x.x+i.clientLeft,y.y=x.y+i.clientTop}const b=u&&!v&&!l?mS(u,m):aa(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-m.scrollLeft*p.x+y.x+b.x,y:r.y*p.y-m.scrollTop*p.y+y.y+b.y}}function kO(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function zO(e){const t=Fu(e),r=e.ownerDocument.body,i=ra(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ra(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-t.scrollLeft+Vu(e);const u=-t.scrollTop;return Mr(r).direction==="rtl"&&(l+=ra(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const LO=25;function $O(e,t,r){r===void 0&&(r="viewport");const i=r==="layoutViewport",o=Mn(e),l=sa(e),u=o.visualViewport;let d=l.clientWidth,m=l.clientHeight,p=0,y=0;if(u){const b=!jp()||t==="fixed";i?b||(p=-u.offsetLeft,y=-u.offsetTop):(d=u.width,m=u.height,b&&(p=u.offsetLeft,y=u.offsetTop))}if(Vu(l)<=0){const b=l.ownerDocument,x=b.body,w=getComputedStyle(x),_=b.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,E=Math.abs(l.clientWidth-x.clientWidth-_),R=getComputedStyle(l).scrollbarGutter==="stable both-edges"?E/2:E;R<=LO&&(d-=R)}return{width:d,height:m,x:p,y}}function IO(e,t){const r=ji(e,!0,t==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,l=Fs(e),u=e.clientWidth*l.x,d=e.clientHeight*l.y,m=o*l.x,p=i*l.y;return{width:u,height:d,x:m,y:p}}function Wb(e,t,r){let i;if(t==="viewport"||t==="layoutViewport")i=$O(e,r,t);else if(t==="document")i=zO(sa(e));else if(Ar(t))i=IO(t,r);else{const o=hS(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return yu(i)}function PO(e,t){const r=t.get(e);if(r)return r;let i=dl(e,[],!1).filter(d=>Ar(d)&&Js(d)!=="body"),o=null;const l=Mr(e).position==="fixed";let u=l?Ri(e):e;for(;Ar(u)&&!ul(u);){const d=Mr(u),m=Rp(u),p=o?o.position:l?"fixed":"";!m&&(p==="fixed"||p==="absolute"&&d.position==="static")?i=i.filter(v=>v!==u):o=d,u=Ri(u)}return t.set(e,i),i}function FO(e){let{element:t,boundary:r,rootBoundary:i,strategy:o}=e;const u=[...r==="clippingAncestors"?Pu(t)?[]:PO(t,this._c):[].concat(r),i],d=Wb(t,u[0],o);let m=d.top,p=d.right,y=d.bottom,v=d.left;for(let b=1;b{d(!1,1e-7)},1e3)}H=!1}try{i=new IntersectionObserver(I,{...B,root:l.ownerDocument})}catch{i=new IntersectionObserver(I,B)}i.observe(e)}const m=Mn(e),p=()=>d(r);return m.addEventListener("resize",p),d(!0),()=>{m.removeEventListener("resize",p),u()}}function ZO(e,t,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:m=!1}=i,p=Tp(e),y=o||l?[...p?dl(p):[],...t?dl(t):[]]:[];y.forEach(R=>{o&&R.addEventListener("scroll",r),l&&R.addEventListener("resize",r)});const v=p&&d?GO(p,r,l):null;let b=-1,x=null;u&&(x=new ResizeObserver(R=>{let[T]=R;T&&T.target===p&&x&&t&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var O;(O=x)==null||O.observe(t)})),r()}),p&&!m&&x.observe(p),t&&x.observe(t));let w,_=m?ji(e):null;m&&E();function E(){const R=ji(e);_&&!gS(_,R)&&r(),_=R,w=requestAnimationFrame(E)}return r(),()=>{var R;y.forEach(T=>{o&&T.removeEventListener("scroll",r),l&&T.removeEventListener("resize",r)}),v?.(),(R=x)==null||R.disconnect(),x=null,m&&cancelAnimationFrame(w)}}const KO=_O,YO=CO,QO=xO,XO=RO,JO=wO,tx=bO,WO=EO,eA=(e,t,r)=>{const i=new Map,o=r??{},l={...qO,...o.platform,_c:i};return yO(e,t,{...o,platform:l})};var tA=typeof document<"u",nA=function(){},lu=tA?S.useLayoutEffect:nA;function bu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(i=r;i--!==0;)if(!bu(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(i=r;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=r;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!bu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function vS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nx(e,t){const r=vS(e);return Math.round(t*r)/r}function Uh(e){const t=S.useRef(e);return lu(()=>{t.current=e}),t}function rA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:d=!0,whileElementsMounted:m,open:p}=e,[y,v]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=S.useState(i);bu(b,i)||x(i);const[w,_]=S.useState(null),[E,R]=S.useState(null),T=S.useCallback(ie=>{ie!==B.current&&(B.current=ie,_(ie))},[]),O=S.useCallback(ie=>{ie!==H.current&&(H.current=ie,R(ie))},[]),N=l||w,k=u||E,B=S.useRef(null),H=S.useRef(null),I=S.useRef(y),ne=m!=null,pe=Uh(m),ge=Uh(o),he=Uh(p),de=S.useCallback(()=>{if(!B.current||!H.current)return;const ie={placement:t,strategy:r,middleware:b};ge.current&&(ie.platform=ge.current),eA(B.current,H.current,ie).then(J=>{const te={...J,isPositioned:he.current!==!1};Z.current&&!bu(I.current,te)&&(I.current=te,zi.flushSync(()=>{v(te)}))})},[b,t,r,ge,he]);lu(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,v(ie=>({...ie,isPositioned:!1})))},[p]);const Z=S.useRef(!1);lu(()=>(Z.current=!0,()=>{Z.current=!1}),[]),lu(()=>{if(N&&(B.current=N),k&&(H.current=k),N&&k){if(pe.current)return pe.current(N,k,de);de()}},[N,k,de,pe,ne]);const Se=S.useMemo(()=>({reference:B,floating:H,setReference:T,setFloating:O}),[T,O]),L=S.useMemo(()=>({reference:N,floating:k}),[N,k]),K=S.useMemo(()=>{const ie={position:r,left:0,top:0};if(!L.floating)return ie;const J=nx(L.floating,y.x),te=nx(L.floating,y.y);return d?{...ie,transform:"translate("+J+"px, "+te+"px)",...vS(L.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:J,top:te}},[r,d,L.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:de,refs:Se,elements:L,floatingStyles:K}),[y,de,Se,L,K])}const aA=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:i,padding:o}=typeof e=="function"?e(r):e;return i&&t(i)?i.current!=null?tx({element:i.current,padding:o}).fn(r):{}:i?tx({element:i,padding:o}).fn(r):{}}}},iA=(e,t)=>{const r=KO(e);return{name:r.name,fn:r.fn,options:[e,t]}},sA=(e,t)=>{const r=YO(e);return{name:r.name,fn:r.fn,options:[e,t]}},oA=(e,t)=>({fn:WO(e).fn,options:[e,t]}),lA=(e,t)=>{const r=QO(e);return{name:r.name,fn:r.fn,options:[e,t]}},cA=(e,t)=>{const r=XO(e);return{name:r.name,fn:r.fn,options:[e,t]}},uA=(e,t)=>{const r=JO(e);return{name:r.name,fn:r.fn,options:[e,t]}},dA=(e,t)=>{const r=aA(e);return{name:r.name,fn:r.fn,options:[e,t]}};var fA="Arrow",yS=S.forwardRef((e,t)=>{const{children:r,width:i=10,height:o=5,...l}=e;return f.jsx(Pe.svg,{...l,ref:t,width:i,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});yS.displayName=fA;var hA=yS,Op="Popper",[bS,Ws]=Ka(Op),[mA,xS]=bS(Op),wS=e=>{const{__scopePopper:t,children:r}=e,[i,o]=S.useState(null),[l,u]=S.useState(void 0);return f.jsx(mA,{scope:t,anchor:i,onAnchorChange:o,placementState:l,setPlacementState:u,children:r})};wS.displayName=Op;var SS="PopperAnchor",_S=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:i,...o}=e,l=xS(SS,r),u=S.useRef(null),d=l.onAnchorChange,m=S.useCallback(w=>{u.current=w,w&&d(w)},[d]),p=at(t,m),y=S.useRef(null);S.useEffect(()=>{if(!i)return;const w=y.current;y.current=i.current,w!==y.current&&d(y.current)});const v=l.placementState&&Mp(l.placementState),b=v?.[0],x=v?.[1];return i?null:f.jsx(Pe.div,{"data-radix-popper-side":b,"data-radix-popper-align":x,...o,ref:p})});_S.displayName=SS;var Ap="PopperContent",[pA,gA]=bS(Ap),CS=S.forwardRef((e,t)=>{const{__scopePopper:r,side:i="bottom",sideOffset:o=0,align:l="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:y=0,sticky:v="partial",hideWhenDetached:b=!1,updatePositionStrategy:x="optimized",onPlaced:w,..._}=e,E=xS(Ap,r),[R,T]=S.useState(null),O=at(t,T),[N,k]=S.useState(null),B=sO(N),H=B?.width??0,I=B?.height??0,ne=i+(l!=="center"?"-"+l:""),pe=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},ge=Array.isArray(p)?p:[p],he=ge.length>0,de={padding:pe,boundary:ge.filter(yA),altBoundary:he},{refs:Z,floatingStyles:Se,placement:L,isPositioned:K,middlewareData:ie}=rA({strategy:"fixed",placement:ne,whileElementsMounted:(...be)=>ZO(...be,{animationFrame:x==="always"}),elements:{reference:E.anchor},middleware:[iA({mainAxis:o+I,alignmentAxis:u}),m&&sA({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?oA():void 0,...de}),m&&lA({...de}),cA({...de,apply:({elements:be,rects:xe,availableWidth:Me,availableHeight:Fe})=>{const{width:He,height:ct}=xe.reference,Je=be.floating.style;Je.setProperty("--radix-popper-available-width",`${Me}px`),Je.setProperty("--radix-popper-available-height",`${Fe}px`),Je.setProperty("--radix-popper-anchor-width",`${He}px`),Je.setProperty("--radix-popper-anchor-height",`${ct}px`)}}),N&&dA({element:N,padding:d}),bA({arrowWidth:H,arrowHeight:I}),b&&uA({strategy:"referenceHidden",...de,boundary:he?de.boundary:void 0})]}),J=E.setPlacementState;Qt(()=>(J(L),()=>{J(void 0)}),[L,J]);const[te,D]=Mp(L),M=tr(w);Qt(()=>{K&&M?.()},[K,M]);const U=ie.arrow?.x,X=ie.arrow?.y,Y=ie.arrow?.centerOffset!==0,[fe,re]=S.useState();return Qt(()=>{R&&re(window.getComputedStyle(R).zIndex)},[R]),f.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...Se,transform:K?Se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[ie.transformOrigin?.x,ie.transformOrigin?.y].join(" "),...ie.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(pA,{scope:r,placedSide:te,placedAlign:D,onArrowChange:k,arrowX:U,arrowY:X,shouldHideArrow:Y,children:f.jsx(Pe.div,{"data-side":te,"data-align":D,..._,ref:O,style:{..._.style,animation:K?void 0:"none"}})})})});CS.displayName=Ap;var ES="PopperArrow",vA={top:"bottom",right:"left",bottom:"top",left:"right"},RS=S.forwardRef(function(t,r){const{__scopePopper:i,...o}=t,l=gA(ES,i),u=vA[l.placedSide];return f.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:f.jsx(hA,{...o,ref:r,style:{...o.style,display:"block"}})})});RS.displayName=ES;function yA(e){return e!==null}var bA=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:i,middlewareData:o}=t,u=o.arrow?.centerOffset!==0,d=u?0:e.arrowWidth,m=u?0:e.arrowHeight,[p,y]=Mp(r),v={start:"0%",center:"50%",end:"100%"}[y],b=(o.arrow?.x??0)+d/2,x=(o.arrow?.y??0)+m/2;let w="",_="";return p==="bottom"?(w=u?v:`${b}px`,_=`${-m}px`):p==="top"?(w=u?v:`${b}px`,_=`${i.floating.height+m}px`):p==="right"?(w=`${-m}px`,_=u?v:`${x}px`):p==="left"&&(w=`${i.floating.width+m}px`,_=u?v:`${x}px`),{data:{x:w,y:_}}}});function Mp(e){const[t,r="center"]=e.split("-");return[t,r]}var Np=wS,Dp=_S,kp=CS,zp=RS,Hh=!1;function xA(){const[e,t]=S.useState(Hh);return S.useEffect(()=>{Hh||(Hh=!0,t(!0))},[]),e}var jS=Mu[" useSyncExternalStore ".trim().toString()];function wA(){return()=>{}}function SA(){return jS(wA,()=>!0,()=>!1)}var _A=typeof jS=="function"?SA:xA,Bh="rovingFocusGroup.onEntryFocus",CA={bubbles:!1,cancelable:!0},wl="RovingFocusGroup",[Rm,TS,EA]=fp(wl),[RA,OS]=Ka(wl,[EA]),[jA,TA]=RA(wl),AS=S.forwardRef((e,t)=>f.jsx(Rm.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Rm.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(OA,{...e,ref:t})})}));AS.displayName=wl;var OA=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:i,loop:o=!1,dir:l,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:y=!1,...v}=e,b=S.useRef(null),x=at(t,b),w=hp(l),[_,E]=Zs({prop:u,defaultProp:d??null,onChange:m,caller:wl}),[R,T]=S.useState(!1),O=tr(p),N=TS(r),k=S.useRef(!1),[B,H]=S.useState(0);return S.useEffect(()=>{const I=b.current;if(I)return I.addEventListener(Bh,O),()=>I.removeEventListener(Bh,O)},[O]),f.jsx(jA,{scope:r,orientation:i,dir:w,loop:o,currentTabStopId:_,onItemFocus:S.useCallback(I=>E(I),[E]),onItemShiftTab:S.useCallback(()=>T(!0),[]),onFocusableItemAdd:S.useCallback(()=>H(I=>I+1),[]),onFocusableItemRemove:S.useCallback(()=>H(I=>I-1),[]),children:f.jsx(Pe.div,{tabIndex:R||B===0?-1:0,"data-orientation":i,...v,ref:x,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{k.current=!0}),onFocus:Te(e.onFocus,I=>{const ne=!k.current;if(I.target===I.currentTarget&&ne&&!R){const pe=new CustomEvent(Bh,CA);if(I.currentTarget.dispatchEvent(pe),!pe.defaultPrevented){const ge=N().filter(L=>L.focusable),he=ge.find(L=>L.active),de=ge.find(L=>L.id===_),Se=[he,de,...ge].filter(Boolean).map(L=>L.ref.current);DS(Se,y)}}k.current=!1}),onBlur:Te(e.onBlur,()=>T(!1))})})}),MS="RovingFocusGroupItem",NS=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:i=!0,active:o=!1,tabStopId:l,children:u,...d}=e,m=fn(),p=l||m,y=TA(MS,r),v=y.currentTabStopId===p,b=TS(r),{onFocusableItemAdd:x,onFocusableItemRemove:w,currentTabStopId:_}=y,E=_A();return Qt(()=>{if(!(!E||!i))return x(),()=>w()},[E,i,x,w]),S.useEffect(()=>{if(!(E||!i))return x(),()=>w()},[E,i,x,w]),f.jsx(Rm.ItemSlot,{scope:r,id:p,focusable:i,active:o,children:f.jsx(Pe.span,{tabIndex:v?0:-1,"data-orientation":y.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,R=>{i?y.onItemFocus(p):R.preventDefault()}),onFocus:Te(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:Te(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){y.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const T=NA(R,y.orientation,y.dir);if(T!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let N=b().filter(k=>k.focusable).map(k=>k.ref.current);if(T==="last")N.reverse();else if(T==="prev"||T==="next"){T==="prev"&&N.reverse();const k=N.indexOf(R.currentTarget);N=y.loop?DA(N,k+1):N.slice(k+1)}setTimeout(()=>DS(N))}}),children:typeof u=="function"?u({isCurrentTabStop:v,hasTabStop:_!=null}):u})})});NS.displayName=MS;var AA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NA(e,t,r){const i=MA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return AA[i]}function DS(e,t=!1){const r=document.activeElement;for(const i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}function DA(e,t){return e.map((r,i)=>e[(t+i)%e.length])}var kA=AS,zA=NS,jm=["Enter"," "],LA=["ArrowDown","PageUp","Home"],kS=["ArrowUp","PageDown","End"],$A=[...LA,...kS],IA={ltr:[...jm,"ArrowRight"],rtl:[...jm,"ArrowLeft"]},PA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sl="Menu",[fl,FA,VA]=fp(Sl),[Li,zS]=Ka(Sl,[VA,Ws,OS]),Uu=Ws(),LS=OS(),[UA,$i]=Li(Sl),[HA,_l]=Li(Sl),$S=e=>{const{__scopeMenu:t,open:r=!1,children:i,dir:o,onOpenChange:l,modal:u=!0}=e,d=Uu(t),[m,p]=S.useState(null),y=S.useRef(!1),v=tr(l),b=hp(o);return S.useEffect(()=>{const x=()=>{y.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>y.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),S.useEffect(()=>{if(!r)return;const x=()=>v(!1);return window.addEventListener("blur",x),()=>window.removeEventListener("blur",x)},[r,v]),f.jsx(Np,{...d,children:f.jsx(UA,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:p,children:f.jsx(HA,{scope:t,onClose:S.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:y,dir:b,modal:u,children:i})})})};$S.displayName=Sl;var BA="MenuAnchor",Lp=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e,o=Uu(r);return f.jsx(Dp,{...o,...i,ref:t})});Lp.displayName=BA;var $p="MenuPortal",[qA,IS]=Li($p,{forceMount:void 0}),PS=e=>{const{__scopeMenu:t,forceMount:r,children:i,container:o}=e,l=$i($p,t);return f.jsx(qA,{scope:t,forceMount:r,children:f.jsx(gr,{present:r||l.open,children:f.jsx(xl,{asChild:!0,container:o,children:i})})})};PS.displayName=$p;var er="MenuContent",[GA,Ip]=Li(er),FS=S.forwardRef((e,t)=>{const r=IS(er,e.__scopeMenu),{forceMount:i=r.forceMount,...o}=e,l=$i(er,e.__scopeMenu),u=_l(er,e.__scopeMenu);return f.jsx(fl.Provider,{scope:e.__scopeMenu,children:f.jsx(gr,{present:i||l.open,children:f.jsx(fl.Slot,{scope:e.__scopeMenu,children:u.modal?f.jsx(ZA,{...o,ref:t}):f.jsx(KA,{...o,ref:t})})})})}),ZA=S.forwardRef((e,t)=>{const r=$i(er,e.__scopeMenu),i=S.useRef(null),o=at(t,i);return S.useEffect(()=>{const l=i.current;if(l)return gp(l)},[]),f.jsx(Pp,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),KA=S.forwardRef((e,t)=>{const r=$i(er,e.__scopeMenu);return f.jsx(Pp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),YA=Ei("MenuContent.ScrollLock"),Pp=S.forwardRef((e,t)=>{const{__scopeMenu:r,loop:i=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,disableOutsideScroll:w,..._}=e,E=$i(er,r),R=_l(er,r),T=Uu(r),O=LS(r),N=FA(r),[k,B]=S.useState(null),H=S.useRef(null),I=at(t,H,E.onContentChange),ne=S.useRef(0),pe=S.useRef(""),ge=S.useRef(0),he=S.useRef(null),de=S.useRef("right"),Z=S.useRef(0),Se=w?zu:S.Fragment,L=w?{as:YA,allowPinchZoom:!0}:void 0,K=J=>{const te=pe.current+J,D=N().filter(re=>!re.disabled),M=document.activeElement,U=D.find(re=>re.ref.current===M)?.textValue,X=D.map(re=>re.textValue),Y=oM(X,te,U),fe=D.find(re=>re.textValue===Y)?.ref.current;(function re(be){pe.current=be,window.clearTimeout(ne.current),be!==""&&(ne.current=window.setTimeout(()=>re(""),1e3))})(te),fe&&setTimeout(()=>fe.focus())};S.useEffect(()=>()=>window.clearTimeout(ne.current),[]),pp();const ie=S.useCallback(J=>de.current===he.current?.side&&cM(J,he.current?.area),[]);return f.jsx(GA,{scope:r,searchRef:pe,onItemEnter:S.useCallback(J=>{ie(J)&&J.preventDefault()},[ie]),onItemLeave:S.useCallback(J=>{ie(J)||(H.current?.focus(),B(null))},[ie]),onTriggerLeave:S.useCallback(J=>{ie(J)&&J.preventDefault()},[ie]),pointerGraceTimerRef:ge,onPointerGraceIntentChange:S.useCallback(J=>{he.current=J},[]),children:f.jsx(Se,{...L,children:f.jsx(Du,{asChild:!0,trapped:o,onMountAutoFocus:Te(l,J=>{J.preventDefault(),H.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:v,onInteractOutside:b,onDismiss:x,children:f.jsx(kA,{asChild:!0,...O,dir:R.dir,orientation:"vertical",loop:i,currentTabStopId:k,onCurrentTabStopIdChange:B,onEntryFocus:Te(m,J=>{R.isUsingKeyboardRef.current||J.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(kp,{role:"menu","aria-orientation":"vertical","data-state":n1(E.open),"data-radix-menu-content":"",dir:R.dir,...T,..._,ref:I,style:{outline:"none",..._.style},onKeyDown:Te(_.onKeyDown,J=>{const D=J.target.closest("[data-radix-menu-content]")===J.currentTarget,M=J.ctrlKey||J.altKey||J.metaKey,U=J.key.length===1;D&&(J.key==="Tab"&&J.preventDefault(),!M&&U&&K(J.key));const X=H.current;if(J.target!==X||!$A.includes(J.key))return;J.preventDefault();const fe=N().filter(re=>!re.disabled).map(re=>re.ref.current);kS.includes(J.key)&&fe.reverse(),iM(fe)}),onBlur:Te(e.onBlur,J=>{J.currentTarget.contains(J.target)||(window.clearTimeout(ne.current),pe.current="")}),onPointerMove:Te(e.onPointerMove,hl(J=>{const te=J.target,D=Z.current!==J.clientX;if(J.currentTarget.contains(te)&&D){const M=J.clientX>Z.current?"right":"left";de.current=M,Z.current=J.clientX}}))})})})})})})});FS.displayName=er;var QA="MenuGroup",Fp=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{role:"group",...i,ref:t})});Fp.displayName=QA;var XA="MenuLabel",VS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{...i,ref:t})});VS.displayName=XA;var xu="MenuItem",rx="menu.itemSelect",Hu=S.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:i,...o}=e,l=S.useRef(null),u=_l(xu,e.__scopeMenu),d=Ip(xu,e.__scopeMenu),m=at(t,l),p=S.useRef(!1),y=()=>{const v=l.current;if(!r&&v){const b=new CustomEvent(rx,{bubbles:!0,cancelable:!0});v.addEventListener(rx,x=>i?.(x),{once:!0}),Pw(v,b),b.defaultPrevented?p.current=!1:u.onClose()}};return f.jsx(US,{...o,ref:m,disabled:r,onClick:Te(e.onClick,y),onPointerDown:v=>{e.onPointerDown?.(v),p.current=!0},onPointerUp:Te(e.onPointerUp,v=>{p.current||v.currentTarget?.click()}),onKeyDown:Te(e.onKeyDown,v=>{r||v.target!==v.currentTarget||d.searchRef.current!==""&&v.key===" "||jm.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});Hu.displayName=xu;var US=S.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:i=!1,textValue:o,...l}=e,u=Ip(xu,r),d=LS(r),m=S.useRef(null),p=at(t,m),[y,v]=S.useState(!1),[b,x]=S.useState("");return S.useEffect(()=>{const w=m.current;w&&x((w.textContent??"").trim())},[l.children]),f.jsx(fl.ItemSlot,{scope:r,disabled:i,textValue:o??b,children:f.jsx(zA,{asChild:!0,...d,focusable:!i,children:f.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...l,ref:p,onPointerMove:Te(e.onPointerMove,hl(w=>{i?u.onItemLeave(w):(u.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,hl(w=>u.onItemLeave(w))),onFocus:Te(e.onFocus,()=>v(!0)),onBlur:Te(e.onBlur,()=>v(!1))})})})}),JA="MenuCheckboxItem",HS=S.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:i,...o}=e;return f.jsx(KS,{scope:e.__scopeMenu,checked:r,children:f.jsx(Hu,{role:"menuitemcheckbox","aria-checked":wu(r)?"mixed":r,...o,ref:t,"data-state":Up(r),onSelect:Te(o.onSelect,()=>i?.(wu(r)?!0:!r),{checkForDefaultPrevented:!1})})})});HS.displayName=JA;var BS="MenuRadioGroup",[WA,eM]=Li(BS,{value:void 0,onValueChange:()=>{}}),qS=S.forwardRef((e,t)=>{const{value:r,onValueChange:i,...o}=e,l=tr(i);return f.jsx(WA,{scope:e.__scopeMenu,value:r,onValueChange:l,children:f.jsx(Fp,{...o,ref:t})})});qS.displayName=BS;var GS="MenuRadioItem",ZS=S.forwardRef((e,t)=>{const{value:r,...i}=e,o=eM(GS,e.__scopeMenu),l=r===o.value;return f.jsx(KS,{scope:e.__scopeMenu,checked:l,children:f.jsx(Hu,{role:"menuitemradio","aria-checked":l,...i,ref:t,"data-state":Up(l),onSelect:Te(i.onSelect,()=>o.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});ZS.displayName=GS;var Vp="MenuItemIndicator",[KS,tM]=Li(Vp,{checked:!1}),YS=S.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:i,...o}=e,l=tM(Vp,r);return f.jsx(gr,{present:i||wu(l.checked)||l.checked===!0,children:f.jsx(Pe.span,{...o,ref:t,"data-state":Up(l.checked)})})});YS.displayName=Vp;var nM="MenuSeparator",QS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e;return f.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...i,ref:t})});QS.displayName=nM;var rM="MenuArrow",XS=S.forwardRef((e,t)=>{const{__scopeMenu:r,...i}=e,o=Uu(r);return f.jsx(zp,{...o,...i,ref:t})});XS.displayName=rM;var aM="MenuSub",[SF,JS]=Li(aM),Wo="MenuSubTrigger",WS=S.forwardRef((e,t)=>{const r=$i(Wo,e.__scopeMenu),i=_l(Wo,e.__scopeMenu),o=JS(Wo,e.__scopeMenu),l=Ip(Wo,e.__scopeMenu),u=S.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:m}=l,p={__scopeMenu:e.__scopeMenu},y=S.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);S.useEffect(()=>y,[y]),S.useEffect(()=>{const b=d.current;return()=>{window.clearTimeout(b),m(null)}},[d,m]);const v=at(t,o.onTriggerChange);return f.jsx(Lp,{asChild:!0,...p,children:f.jsx(US,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?o.contentId:void 0,"data-state":n1(r.open),...e,ref:v,onClick:b=>{e.onClick?.(b),!(e.disabled||b.defaultPrevented)&&(b.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,hl(b=>{l.onItemEnter(b),!b.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),y()},100))})),onPointerLeave:Te(e.onPointerLeave,hl(b=>{y();const x=r.content?.getBoundingClientRect();if(x){const w=r.content?.dataset.side,_=w==="right",E=_?-5:5,R=x[_?"left":"right"],T=x[_?"right":"left"];l.onPointerGraceIntentChange({area:[{x:b.clientX+E,y:b.clientY},{x:R,y:x.top},{x:T,y:x.top},{x:T,y:x.bottom},{x:R,y:x.bottom}],side:w}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(b),b.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,b=>{e.disabled||b.target!==b.currentTarget||l.searchRef.current!==""&&b.key===" "||IA[i.dir].includes(b.key)&&(r.onOpenChange(!0),r.content?.focus(),b.preventDefault())})})})});WS.displayName=Wo;var e1="MenuSubContent",t1=S.forwardRef((e,t)=>{const r=IS(er,e.__scopeMenu),{forceMount:i=r.forceMount,align:o="start",...l}=e,u=$i(er,e.__scopeMenu),d=_l(er,e.__scopeMenu),m=JS(e1,e.__scopeMenu),p=S.useRef(null),y=at(t,p);return f.jsx(fl.Provider,{scope:e.__scopeMenu,children:f.jsx(gr,{present:i||u.open,children:f.jsx(fl.Slot,{scope:e.__scopeMenu,children:f.jsx(Pp,{id:m.contentId,"aria-labelledby":m.triggerId,...l,ref:y,align:o,side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&p.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:Te(e.onFocusOutside,v=>{v.target!==m.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:Te(e.onKeyDown,v=>{const b=v.currentTarget.contains(v.target),x=PA[d.dir].includes(v.key);b&&x&&(u.onOpenChange(!1),m.trigger?.focus(),v.preventDefault())})})})})})});t1.displayName=e1;function n1(e){return e?"open":"closed"}function wu(e){return e==="indeterminate"}function Up(e){return wu(e)?"indeterminate":e?"checked":"unchecked"}function iM(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function sM(e,t){return e.map((r,i)=>e[(t+i)%e.length])}function oM(e,t,r){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,l=r?e.indexOf(r):-1;let u=sM(e,Math.max(l,0));o.length===1&&(u=u.filter(p=>p!==r));const m=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return m!==r?m:void 0}function lM(e,t){const{x:r,y:i}=e;let o=!1;for(let l=0,u=t.length-1;li!=b>i&&r<(v-p)*(i-y)/(b-y)+p&&(o=!o)}return o}function cM(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return lM(r,t)}function hl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var uM=$S,dM=Lp,fM=PS,hM=FS,mM=Fp,pM=VS,gM=Hu,vM=HS,yM=qS,bM=ZS,xM=YS,wM=QS,SM=XS,_M=WS,CM=t1,Bu="DropdownMenu",[EM]=Ka(Bu,[zS]),vn=zS(),[RM,r1]=EM(Bu),a1=e=>{const{__scopeDropdownMenu:t,children:r,dir:i,open:o,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,m=vn(t),p=S.useRef(null),[y,v]=Zs({prop:o,defaultProp:l??!1,onChange:u,caller:Bu});return f.jsx(RM,{scope:t,triggerId:fn(),triggerRef:p,contentId:fn(),open:y,onOpenChange:v,onOpenToggle:S.useCallback(()=>v(b=>!b),[v]),modal:d,children:f.jsx(uM,{...m,open:y,onOpenChange:v,dir:i,modal:d,children:r})})};a1.displayName=Bu;var i1="DropdownMenuTrigger",s1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:i=!1,...o}=e,l=r1(i1,r),u=vn(r),d=at(t,l.triggerRef);return f.jsx(dM,{asChild:!0,...u,children:f.jsx(Pe.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":i?"":void 0,disabled:i,...o,ref:d,onPointerDown:Te(e.onPointerDown,m=>{!i&&m.button===0&&m.ctrlKey===!1&&(l.onOpenToggle(),l.open||m.preventDefault())}),onKeyDown:Te(e.onKeyDown,m=>{i||(["Enter"," "].includes(m.key)&&l.onOpenToggle(),m.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(m.key)&&m.preventDefault())})})})});s1.displayName=i1;var jM="DropdownMenuPortal",o1=e=>{const{__scopeDropdownMenu:t,...r}=e,i=vn(t);return f.jsx(fM,{...i,...r})};o1.displayName=jM;var l1="DropdownMenuContent",c1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=r1(l1,r),l=vn(r),u=S.useRef(!1);return f.jsx(hM,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...i,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{u.current||o.triggerRef.current?.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,d=>{const m=d.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,y=m.button===2||p;(!o.modal||y)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});c1.displayName=l1;var TM="DropdownMenuGroup",OM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(mM,{...o,...i,ref:t})});OM.displayName=TM;var AM="DropdownMenuLabel",u1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(pM,{...o,...i,ref:t})});u1.displayName=AM;var MM="DropdownMenuItem",d1=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(gM,{...o,...i,ref:t})});d1.displayName=MM;var NM="DropdownMenuCheckboxItem",DM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(vM,{...o,...i,ref:t})});DM.displayName=NM;var kM="DropdownMenuRadioGroup",zM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(yM,{...o,...i,ref:t})});zM.displayName=kM;var LM="DropdownMenuRadioItem",$M=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(bM,{...o,...i,ref:t})});$M.displayName=LM;var IM="DropdownMenuItemIndicator",PM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(xM,{...o,...i,ref:t})});PM.displayName=IM;var FM="DropdownMenuSeparator",VM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(wM,{...o,...i,ref:t})});VM.displayName=FM;var UM="DropdownMenuArrow",HM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(SM,{...o,...i,ref:t})});HM.displayName=UM;var BM="DropdownMenuSubTrigger",qM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(_M,{...o,...i,ref:t})});qM.displayName=BM;var GM="DropdownMenuSubContent",ZM=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...i}=e,o=vn(r);return f.jsx(CM,{...o,...i,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ZM.displayName=GM;var KM=a1,YM=s1,QM=o1,XM=c1,JM=u1,WM=d1,eN="Label",f1=S.forwardRef((e,t)=>f.jsx(Pe.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));f1.displayName=eN;var tN=f1;function ax(e,[t,r]){return Math.min(r,Math.max(t,e))}var nN=[" ","Enter","ArrowUp","ArrowDown"],rN=[" ","Enter"],Ti="Select",[qu,Gu,aN]=fp(Ti),[Ii]=Ka(Ti,[aN,Ws]),Zu=Ws(),[iN,Qa]=Ii(Ti),[sN,oN]=Ii(Ti),lN="SelectProvider";function h1(e){const{__scopeSelect:t,children:r,open:i,defaultOpen:o,onOpenChange:l,value:u,defaultValue:d,onValueChange:m,dir:p,name:y,autoComplete:v,disabled:b,required:x,form:w,internal_do_not_use_render:_}=e,E=Zu(t),[R,T]=S.useState(null),[O,N]=S.useState(null),[k,B]=S.useState(!1),H=hp(p),[I,ne]=Zs({prop:i,defaultProp:o??!1,onChange:l,caller:Ti}),[pe,ge]=Zs({prop:u,defaultProp:d,onChange:m,caller:Ti}),he=S.useRef(null),de=S.useRef(pe);S.useEffect(()=>{const M=w?R?.ownerDocument.getElementById(w):R?.form;if(M instanceof HTMLFormElement){const U=()=>ge(de.current);return M.addEventListener("reset",U),()=>M.removeEventListener("reset",U)}},[w,R,ge]);const Z=R?!!w||!!R.closest("form"):!0,[Se,L]=S.useState(new Set),K=fn(),ie=Array.from(Se).map(M=>M.props.value).join(";"),J=S.useCallback(M=>{L(U=>new Set(U).add(M))},[]),te=S.useCallback(M=>{L(U=>{const X=new Set(U);return X.delete(M),X})},[]),D={required:x,trigger:R,onTriggerChange:T,valueNode:O,onValueNodeChange:N,valueNodeHasChildren:k,onValueNodeHasChildrenChange:B,contentId:K,value:pe,onValueChange:ge,open:I,onOpenChange:ne,dir:H,triggerPointerDownPosRef:he,disabled:b,name:y,autoComplete:v,form:w,nativeOptions:Se,nativeSelectKey:ie,isFormControl:Z};return f.jsx(Np,{...E,children:f.jsx(iN,{scope:t,...D,children:f.jsx(qu.Provider,{scope:t,children:f.jsx(sN,{scope:t,onNativeOptionAdd:J,onNativeOptionRemove:te,children:EN(_)?_(D):r})})})})}h1.displayName=lN;var m1=e=>{const{__scopeSelect:t,children:r,...i}=e;return f.jsx(h1,{__scopeSelect:t,...i,internal_do_not_use_render:({isFormControl:o})=>f.jsxs(f.Fragment,{children:[r,o?f.jsx(F1,{__scopeSelect:t}):null]})})};m1.displayName=Ti;var p1="SelectTrigger",g1=S.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:i=!1,...o}=e,l=Zu(r),u=Qa(p1,r),d=u.disabled||i,m=at(t,u.onTriggerChange),p=Gu(r),y=S.useRef("touch"),[v,b,x]=V1(_=>{const E=p().filter(O=>!O.disabled),R=E.find(O=>O.value===u.value),T=U1(E,_,R);T!==void 0&&u.onValueChange(T.value)}),w=_=>{d||(u.onOpenChange(!0),x()),_&&(u.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return f.jsx(Dp,{asChild:!0,...l,children:f.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Ku(u.value)?"":void 0,...o,ref:m,onClick:Te(o.onClick,_=>{_.currentTarget.focus(),y.current!=="mouse"&&w(_)}),onPointerDown:Te(o.onPointerDown,_=>{y.current=_.pointerType;const E=_.target;E.hasPointerCapture(_.pointerId)&&E.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(w(_),_.preventDefault())}),onKeyDown:Te(o.onKeyDown,_=>{const E=v.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&b(_.key),!(E&&_.key===" ")&&nN.includes(_.key)&&(w(),_.preventDefault())})})})});g1.displayName=p1;var v1="SelectValue",y1=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:o,children:l,placeholder:u="",...d}=e,m=Qa(v1,r),{onValueNodeHasChildrenChange:p}=m,y=l!==void 0,v=at(t,m.onValueNodeChange);Qt(()=>{p(y)},[p,y]);const b=Ku(m.value);return f.jsx(Pe.span,{...d,asChild:b?!1:d.asChild,ref:v,style:{pointerEvents:"none"},children:f.jsx(S.Fragment,{children:b?u:l},b?"placeholder":"value")})});y1.displayName=v1;var cN="SelectIcon",b1=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,...o}=e;return f.jsx(Pe.span,{"aria-hidden":!0,...o,ref:t,children:i||"▼"})});b1.displayName=cN;var x1="SelectPortal",[uN,dN]=Ii(x1,{forceMount:void 0}),w1=e=>{const{__scopeSelect:t,forceMount:r,...i}=e;return f.jsx(uN,{scope:e.__scopeSelect,forceMount:r,children:f.jsx(xl,{asChild:!0,...i})})};w1.displayName=x1;var qa="SelectContent",S1=S.forwardRef((e,t)=>{const r=dN(qa,e.__scopeSelect),{forceMount:i=r.forceMount,...o}=e,l=Qa(qa,e.__scopeSelect),[u,d]=S.useState();return Qt(()=>{d(new DocumentFragment)},[]),f.jsx(gr,{present:i||l.open,children:({present:m})=>m?f.jsx(E1,{...o,ref:t}):f.jsx(_1,{...o,fragment:u})})});S1.displayName=qa;var _1=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:i,fragment:o}=e;return o?zi.createPortal(f.jsx(C1,{scope:r,children:f.jsx(qu.Slot,{scope:r,children:f.jsx("div",{ref:t,children:i})})}),o):null});_1.displayName="SelectContentFragment";var dr=10,[C1,Xa]=Ii(qa),fN="SelectContentImpl",hN=Ei("SelectContent.RemoveScroll"),E1=S.forwardRef((e,t)=>{const{__scopeSelect:r}=e,{position:i="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:u,side:d,sideOffset:m,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E,...R}=e,T=Qa(qa,r),[O,N]=S.useState(null),[k,B]=S.useState(null),H=at(t,N),[I,ne]=S.useState(null),[pe,ge]=S.useState(null),he=Gu(r),[de,Z]=S.useState(!1),Se=S.useRef(!1);S.useEffect(()=>{if(O)return gp(O)},[O]),pp();const L=S.useCallback(re=>{const[be,...xe]=he().map(He=>He.ref.current),[Me]=xe.slice(-1),Fe=document.activeElement;for(const He of re)if(He===Fe||(He?.scrollIntoView({block:"nearest"}),He===be&&k&&(k.scrollTop=0),He===Me&&k&&(k.scrollTop=k.scrollHeight),He?.focus(),document.activeElement!==Fe))return},[he,k]),K=S.useCallback(()=>L([I,O]),[L,I,O]);S.useEffect(()=>{de&&K()},[de,K]);const{onOpenChange:ie,triggerPointerDownPosRef:J}=T;S.useEffect(()=>{if(O){let re={x:0,y:0};const be=Me=>{re={x:Math.abs(Math.round(Me.pageX)-(J.current?.x??0)),y:Math.abs(Math.round(Me.pageY)-(J.current?.y??0))}},xe=Me=>{re.x<=10&&re.y<=10?Me.preventDefault():Me.composedPath().includes(O)||ie(!1),document.removeEventListener("pointermove",be),J.current=null};return J.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",xe,{capture:!0})}}},[O,ie,J]),S.useEffect(()=>{const re=()=>ie(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[ie]);const[te,D]=V1(re=>{const be=he().filter(Fe=>!Fe.disabled),xe=be.find(Fe=>Fe.ref.current===document.activeElement),Me=U1(be,re,xe);Me&&setTimeout(()=>Me.ref.current?.focus())}),M=S.useCallback((re,be,xe)=>{const Me=!Se.current&&!xe;(T.value!==void 0&&T.value===be||Me)&&(ne(re),Me&&(Se.current=!0))},[T.value]),U=S.useCallback(()=>O?.focus(),[O]),X=S.useCallback((re,be,xe)=>{const Me=!Se.current&&!xe;(T.value!==void 0&&T.value===be||Me)&&ge(re)},[T.value]),Y=i==="popper"?Tm:R1,fe=Y===Tm?{side:d,sideOffset:m,align:p,alignOffset:y,arrowPadding:v,collisionBoundary:b,collisionPadding:x,sticky:w,hideWhenDetached:_,avoidCollisions:E}:{};return f.jsx(C1,{scope:r,content:O,viewport:k,onViewportChange:B,itemRefCallback:M,selectedItem:I,onItemLeave:U,itemTextRefCallback:X,focusSelectedItem:K,selectedItemText:pe,position:i,isPositioned:de,searchRef:te,children:f.jsx(zu,{as:hN,allowPinchZoom:!0,children:f.jsx(Du,{asChild:!0,trapped:T.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Te(o,re=>{T.trigger?.focus({preventScroll:!0}),re.preventDefault()}),children:f.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:f.jsx(Y,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:re=>re.preventDefault(),...R,...fe,onPlaced:()=>Z(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,re=>{const be=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!be&&re.key.length===1&&D(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Me=he().filter(Fe=>!Fe.disabled).map(Fe=>Fe.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Me=Me.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Fe=re.target,He=Me.indexOf(Fe);Me=Me.slice(He+1)}setTimeout(()=>L(Me)),re.preventDefault()}})})})})})})});E1.displayName=fN;var mN="SelectItemAlignedPosition",R1=S.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:i,...o}=e,l=Qa(qa,r),u=Xa(qa,r),[d,m]=S.useState(null),[p,y]=S.useState(null),v=at(t,y),b=Gu(r),x=S.useRef(!1),w=S.useRef(!0),{viewport:_,selectedItem:E,selectedItemText:R,focusSelectedItem:T}=u,O=S.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&p&&_&&E&&R){const H=l.trigger.getBoundingClientRect(),I=p.getBoundingClientRect(),ne=l.valueNode.getBoundingClientRect(),pe=R.getBoundingClientRect();if(l.dir!=="rtl"){const Fe=pe.left-I.left,He=ne.left-Fe,ct=H.left-He,Je=H.width+ct,hn=Math.max(Je,I.width),mn=window.innerWidth-dr,Xt=ax(He,[dr,Math.max(dr,mn-hn)]);d.style.minWidth=Je+"px",d.style.left=Xt+"px"}else{const Fe=I.right-pe.right,He=window.innerWidth-ne.right-Fe,ct=window.innerWidth-H.right-He,Je=H.width+ct,hn=Math.max(Je,I.width),mn=window.innerWidth-dr,Xt=ax(He,[dr,Math.max(dr,mn-hn)]);d.style.minWidth=Je+"px",d.style.right=Xt+"px"}const ge=b(),he=window.innerHeight-dr*2,de=_.scrollHeight,Z=window.getComputedStyle(p),Se=parseInt(Z.borderTopWidth,10),L=parseInt(Z.paddingTop,10),K=parseInt(Z.borderBottomWidth,10),ie=parseInt(Z.paddingBottom,10),J=Se+L+de+ie+K,te=Math.min(E.offsetHeight*5,J),D=window.getComputedStyle(_),M=parseInt(D.paddingTop,10),U=parseInt(D.paddingBottom,10),X=H.top+H.height/2-dr,Y=he-X,fe=E.offsetHeight/2,re=E.offsetTop+fe,be=Se+L+re,xe=J-be;if(be<=X){const Fe=ge.length>0&&E===ge[ge.length-1].ref.current;d.style.bottom="0px";const He=p.clientHeight-_.offsetTop-_.offsetHeight,ct=Math.max(Y,fe+(Fe?U:0)+He+K),Je=be+ct;d.style.height=Je+"px"}else{const Fe=ge.length>0&&E===ge[0].ref.current;d.style.top="0px";const ct=Math.max(X,Se+_.offsetTop+(Fe?M:0)+fe)+xe;d.style.height=ct+"px",_.scrollTop=be-X+_.offsetTop}d.style.margin=`${dr}px 0`,d.style.minHeight=te+"px",d.style.maxHeight=he+"px",i?.(),requestAnimationFrame(()=>x.current=!0)}},[b,l.trigger,l.valueNode,d,p,_,E,R,l.dir,i]);Qt(()=>O(),[O]);const[N,k]=S.useState();Qt(()=>{p&&k(window.getComputedStyle(p).zIndex)},[p]);const B=S.useCallback(H=>{H&&w.current===!0&&(O(),T?.(),w.current=!1)},[O,T]);return f.jsx(gN,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:x,onScrollButtonChange:B,children:f.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:f.jsx(Pe.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});R1.displayName=mN;var pN="SelectPopperPosition",Tm=S.forwardRef((e,t)=>{const{__scopeSelect:r,align:i="start",collisionPadding:o=dr,...l}=e,u=Zu(r);return f.jsx(kp,{...u,...l,ref:t,align:i,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Tm.displayName=pN;var[gN,Hp]=Ii(qa,{}),Om="SelectViewport",j1=S.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:i,...o}=e,l=Xa(Om,r),u=Hp(Om,r),d=at(t,l.onViewportChange),m=S.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),f.jsx(qu.Slot,{scope:r,children:f.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,p=>{const y=p.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:b}=u;if(b?.current&&v){const x=Math.abs(m.current-y.scrollTop);if(x>0){const w=window.innerHeight-dr*2,_=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(_,E);if(R0?N:0,v.style.justifyContent="flex-end")}}}m.current=y.scrollTop})})})]})});j1.displayName=Om;var T1="SelectGroup",[vN,yN]=Ii(T1),bN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=fn();return f.jsx(vN,{scope:r,id:o,children:f.jsx(Pe.div,{role:"group","aria-labelledby":o,...i,ref:t})})});bN.displayName=T1;var O1="SelectLabel",xN=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e,o=yN(O1,r);return f.jsx(Pe.div,{id:o.id,...i,ref:t})});xN.displayName=O1;var Su="SelectItem",[wN,A1]=Ii(Su),M1=S.forwardRef((e,t)=>{const{__scopeSelect:r,value:i,disabled:o=!1,textValue:l,...u}=e,d=Qa(Su,r),m=Xa(Su,r),p=d.value===i,[y,v]=S.useState(l??""),[b,x]=S.useState(!1),w=tr(O=>m.itemRefCallback?.(O,i,o)),_=at(t,w),E=fn(),R=S.useRef("touch"),T=()=>{o||(d.onValueChange(i),d.onOpenChange(!1))};return f.jsx(wN,{scope:r,value:i,disabled:o,textId:E,isSelected:p,onItemTextChange:S.useCallback(O=>{v(N=>N||(O?.textContent??"").trim())},[]),children:f.jsx(qu.ItemSlot,{scope:r,value:i,disabled:o,textValue:y,children:f.jsx(Pe.div,{role:"option","aria-labelledby":E,"data-highlighted":b?"":void 0,"aria-selected":p&&b,"data-state":p?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...u,ref:_,onFocus:Te(u.onFocus,()=>x(!0)),onBlur:Te(u.onBlur,()=>x(!1)),onClick:Te(u.onClick,()=>{R.current!=="mouse"&&T()}),onPointerUp:Te(u.onPointerUp,()=>{R.current==="mouse"&&T()}),onPointerDown:Te(u.onPointerDown,O=>{R.current=O.pointerType}),onPointerMove:Te(u.onPointerMove,O=>{R.current=O.pointerType,o?m.onItemLeave?.():R.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(u.onPointerLeave,O=>{O.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:Te(u.onKeyDown,O=>{o||O.target!==O.currentTarget||m.searchRef?.current!==""&&O.key===" "||(rN.includes(O.key)&&T(),O.key===" "&&O.preventDefault())})})})})});M1.displayName=Su;var el="SelectItemText",N1=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:i,style:o,...l}=e,u=Qa(el,r),d=Xa(el,r),m=A1(el,r),p=oN(el,r),[y,v]=S.useState(null),b=tr(T=>d.itemTextRefCallback?.(T,m.value,m.disabled)),x=at(t,v,m.onItemTextChange,b),w=y?.textContent,_=S.useMemo(()=>f.jsx("option",{value:m.value,disabled:m.disabled,children:w},m.value),[m.disabled,m.value,w]),{onNativeOptionAdd:E,onNativeOptionRemove:R}=p;return Qt(()=>(E(_),()=>R(_)),[E,R,_]),f.jsxs(f.Fragment,{children:[f.jsx(Pe.span,{id:m.textId,...l,ref:x}),m.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!Ku(u.value)?zi.createPortal(l.children,u.valueNode):null]})});N1.displayName=el;var D1="SelectItemIndicator",k1=S.forwardRef((e,t)=>{const{__scopeSelect:r,...i}=e;return A1(D1,r).isSelected?f.jsx(Pe.span,{"aria-hidden":!0,...i,ref:t}):null});k1.displayName=D1;var Am="SelectScrollUpButton",z1=S.forwardRef((e,t)=>{const r=Xa(Am,e.__scopeSelect),i=Hp(Am,e.__scopeSelect),[o,l]=S.useState(!1),u=at(t,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollTop>0;l(p)};const m=r.viewport;return d(),m.addEventListener("scroll",d),()=>m.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),o?f.jsx($1,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=r;d&&m&&(d.scrollTop=d.scrollTop-m.offsetHeight)}}):null});z1.displayName=Am;var Mm="SelectScrollDownButton",L1=S.forwardRef((e,t)=>{const r=Xa(Mm,e.__scopeSelect),i=Hp(Mm,e.__scopeSelect),[o,l]=S.useState(!1),u=at(t,i.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollHeight-m.clientHeight,y=Math.ceil(m.scrollTop)