diff --git a/README.md b/README.md index 862f42c..0cafbfa 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,6 @@ You may use, run, modify and distribute the console, including in production, fr | What | Reviews for one GitHub, GitLab and Bitbucket host each; local executor; repository on/off; `@bot` commands; review history for 30 days; status dashboard; admin sign-in by email | More hosts per platform and per-host bot identities; host, group and pattern rules; team learnings; Docker and Kubernetes executors; token budgets; metrics and long history; audit log viewer; branch-sync skip; SSO domain and group rules | | Cost | Free in every environment, production included | A license key from Divmora, in every environment (development, CI, staging and production) | -Install a key under **License** in the admin panel, or with `CODEREVIEW_CONSOLE_LICENSE` or `license.file` ([docs/deploy.md](docs/deploy.md#license)). Keys are verified offline. Licenses and trials: licensing@divmora.com. +Install, replace or remove the key under **License** in the admin panel; it applies at once ([docs/deploy.md](docs/deploy.md#license)). Keys are verified offline. Licenses and trials: licensing@divmora.com. The review engine, [code-review-bot](https://github.com/divmora/code-review-bot), is Apache 2.0 and free in any environment. diff --git a/cmd/console/main.go b/cmd/console/main.go index baec811..ba3306c 100644 --- a/cmd/console/main.go +++ b/cmd/console/main.go @@ -125,13 +125,18 @@ func serve(ctx context.Context, args []string) error { } lic := loadLicense(ctx, cfg, deps.Store, logger) if err := requireExecutor(cfg, lic); err != nil { - return err + // Start anyway, so the license can be added in the admin panel; + // reviews are refused until it is (see licensedExecutor). + logger.Error("reviews are paused until a license is added in the admin panel", "error", err) } warnSSORules(cfg, lic, logger) exec, err := newExecutor(cfg) if err != nil { return err } + if cfg.Executor.Type != "local" { + exec = &licensedExecutor{Executor: exec, lic: lic} + } deps.License = lic deps.Settings = settings.New(cfg, deps.Store) deps.Settings.Lic = lic @@ -175,6 +180,7 @@ func serve(ctx context.Context, args []string) error { adm.Settings = deps.Settings adm.Lic = lic adm.Hosts = deps.Hosts + adm.ExecutorType = cfg.Executor.Type deps.Admin = adm logger.Info("admin enabled", "url", cfg.Admin.BaseURL, "issuer", cfg.Admin.OIDC.Issuer) } @@ -202,7 +208,7 @@ func checkConfig(ctx context.Context, args []string) error { return err } if err := requireExecutor(cfg, loadLicense(ctx, cfg, nil, slog.New(slog.DiscardHandler))); err != nil { - fmt.Printf("note: %v\n (a key pasted in the admin panel is read from the database when the console starts)\n", err) + fmt.Printf("note: %v\n (the console still starts; reviews wait until the license is added in the admin panel)\n", err) } fmt.Printf("executor: %s\nworkers: %d\nadmin: %v\nallowlist: %v\ndatabase: %v\n", exec.Name(), cfg.Server.Workers, cfg.Admin.Enabled, cfg.Repos.Allowlist, cfg.Database.URL != "") if len(hosts.FromConfig(cfg)) > 0 { @@ -253,27 +259,59 @@ func checkConfig(ctx context.Context, args []string) error { return nil } -// loadLicense reads the license key: $CODEREVIEW_CONSOLE_LICENSE, then -// license.file, then a key pasted in the admin panel (database). Without a -// valid key the console runs the free core. +// loadLicense reads the license key: $CODEREVIEW_CONSOLE_LICENSE (an +// override, e.g. when nobody can sign in), then the key managed in the admin +// panel (database). license.file is deprecated: when the database has no key +// yet, a valid key from the file is copied into it once, and from then on +// the admin panel is where the license changes. Without a database the file +// is read as before. Without a valid key the console runs the free core. func loadLicense(ctx context.Context, cfg *config.Config, st store.Store, logger *slog.Logger) *license.Manager { - lic := license.Default() + return loadLicenseInto(ctx, license.Default(), cfg, st, logger) +} + +// loadLicenseInto is loadLicense with the Manager given (tests trust a test key). +func loadLicenseInto(ctx context.Context, lic *license.Manager, cfg *config.Config, st store.Store, logger *slog.Logger) *license.Manager { key, source := strings.TrimSpace(os.Getenv("CODEREVIEW_CONSOLE_LICENSE")), "env" - if key == "" && cfg.License.File != "" { + var stored admin.StoredLicense + found := false + if st != nil { + var err error + if found, err = st.GetSetting(ctx, admin.LicenseSetting, &stored); err != nil { + logger.Error("could not read the stored license", "error", err) + } + found = found && stored.Key != "" + } + if key == "" && found { + key, source = stored.Key, "database" + } + if cfg.License.File != "" { + switch { + case st == nil: + logger.Warn("deprecated: license.file; set database.url and manage the license in the admin panel") + case found: + logger.Warn("license.file is ignored: the license is managed in the admin panel (remove license.file)") + default: + logger.Warn("deprecated: license.file; its key is copied into the database once, then the license is managed in the admin panel (remove license.file)") + } + } + if key == "" && !found && cfg.License.File != "" { b, err := os.ReadFile(cfg.License.File) if err != nil { lic.Fail("file", err) logger.Error("license file unreadable; running the free core", "file", cfg.License.File, "error", err) return lic } - key, source = strings.TrimSpace(string(b)), "file" - } - if key == "" && st != nil { - var stored admin.StoredLicense - if found, err := st.GetSetting(ctx, admin.LicenseSetting, &stored); err != nil { - logger.Error("could not read the stored license; running the free core", "error", err) - } else if found { - key, source = stored.Key, "database" + key, source = strings.Join(strings.Fields(string(b)), ""), "file" + if st != nil { + if c, err := lic.Verify(key); err == nil { + detail := map[string]any{"id": c.ID, "customer": c.Customer.Name, "plan": c.Plan, "expires_at": c.ExpiresAt, "from": "license.file"} + if err := st.PutSettingAudited(ctx, admin.LicenseSetting, admin.StoredLicense{Key: key}, detail, "license.file (initial)"); err != nil { + logger.Error("could not copy the license from license.file into the database", "error", err) + } else { + source = "database" + logger.Info("license copied from license.file into the database; manage it in the admin panel from now on") + } + } } } if key == "" { @@ -308,15 +346,29 @@ func warnSSORules(cfg *config.Config, lic *license.Manager, logger *slog.Logger) "allowed_emails", len(o.AllowedEmails)) } -// requireExecutor refuses the docker and kubernetes executors without a -// license that covers them. +// requireExecutor reports whether the docker and kubernetes executors are +// covered by the license. func requireExecutor(cfg *config.Config, lic *license.Manager) error { if cfg.Executor.Type == "local" { return nil } if err := lic.Require(license.Executors); err != nil { - return fmt.Errorf("executor.type %s: %w (on a first start, provide the key with CODEREVIEW_CONSOLE_LICENSE or license.file, "+ - "or start once with executor.type: local and paste it in the admin panel)", cfg.Executor.Type, err) + return fmt.Errorf("executor.type %s: %w", cfg.Executor.Type, err) } return nil } + +// licensedExecutor refuses to run jobs while the license does not cover the +// docker or kubernetes executor. It checks on every job, so a key added in +// the admin panel applies without a restart. +type licensedExecutor struct { + executor.Executor + lic *license.Manager +} + +func (e *licensedExecutor) Run(ctx context.Context, t executor.Task) (*executor.Result, error) { + if err := e.lic.Require(license.Executors); err != nil { + return nil, &executor.RunError{Message: "the " + e.Name() + " executor needs a Divmora license with the executors feature: add one under License in the admin panel"} + } + return e.Executor.Run(ctx, t) +} diff --git a/cmd/console/main_test.go b/cmd/console/main_test.go new file mode 100644 index 0000000..a1fc3bf --- /dev/null +++ b/cmd/console/main_test.go @@ -0,0 +1,105 @@ +package main + +import ( + "context" + "io" + "log/slog" + "os" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/divmora/code-review-console/internal/admin" + "github.com/divmora/code-review-console/internal/config" + "github.com/divmora/code-review-console/internal/ee/license" + "github.com/divmora/code-review-console/internal/ee/license/licensetest" + "github.com/divmora/code-review-console/internal/executor" + "github.com/divmora/code-review-console/internal/store/storetest" +) + +var quiet = slog.New(slog.NewTextHandler(io.Discard, nil)) + +func TestLicenseSources(t *testing.T) { + ctx := context.Background() + k := licensetest.NewKey(t) + fileKey := k.Issue(t, 30*24*time.Hour, license.Hosts) + panelKey := k.Issue(t, 60*24*time.Hour, license.Executors) + envKey := k.Issue(t, 90*24*time.Hour, license.Rules) + path := filepath.Join(t.TempDir(), "license.key") + if err := os.WriteFile(path, []byte(fileKey+"\n"), 0o600); err != nil { + t.Fatal(err) + } + cfg := &config.Config{License: config.License{File: path}} + t.Setenv("CODEREVIEW_CONSOLE_LICENSE", "") + + // license.file with an empty database: copied in once, then managed there. + st := storetest.New() + lic := loadLicenseInto(ctx, k.Manager(t), cfg, st, quiet) + if s := lic.Status(); s.Source != "database" || s.Managed || !lic.Has(license.Hosts) { + t.Fatalf("seeded from the file: %+v", s) + } + var stored admin.StoredLicense + if found, _ := st.GetSetting(ctx, admin.LicenseSetting, &stored); !found || stored.Key != fileKey { + t.Fatalf("the file key must be stored: %v %q", found, stored.Key) + } + + // A key replaced in the panel wins over the file on the next start. + _ = st.PutSetting(ctx, admin.LicenseSetting, admin.StoredLicense{Key: panelKey}, "a@x") + lic = loadLicenseInto(ctx, k.Manager(t), cfg, st, quiet) + if !lic.Has(license.Executors) || lic.Has(license.Hosts) { + t.Errorf("the panel's key must win over license.file: %+v", lic.Status()) + } + + // The environment overrides the panel, and the panel can't replace it. + t.Setenv("CODEREVIEW_CONSOLE_LICENSE", envKey) + lic = loadLicenseInto(ctx, k.Manager(t), cfg, st, quiet) + if s := lic.Status(); s.Source != "env" || !s.Managed || !lic.Has(license.Rules) { + t.Errorf("env override: %+v", s) + } + t.Setenv("CODEREVIEW_CONSOLE_LICENSE", "") + + // An invalid file key is not copied into the database. + bad := filepath.Join(t.TempDir(), "bad.key") + _ = os.WriteFile(bad, []byte("DIV1.nope"), 0o600) + st2 := storetest.New() + lic = loadLicenseInto(ctx, k.Manager(t), &config.Config{License: config.License{File: bad}}, st2, quiet) + if found, _ := st2.GetSetting(ctx, admin.LicenseSetting, &stored); found || lic.Status().State != license.Invalid { + t.Errorf("invalid file key: stored=%v %+v", found, lic.Status()) + } + + // Without a database the file is read as before. + lic = loadLicenseInto(ctx, k.Manager(t), cfg, nil, quiet) + if s := lic.Status(); s.Source != "file" || !s.Managed || !lic.Has(license.Hosts) { + t.Errorf("no database: %+v", s) + } +} + +type okExec struct{ runs int } + +func (e *okExec) Name() string { return "kubernetes" } +func (e *okExec) Run(context.Context, executor.Task) (*executor.Result, error) { + e.runs++ + return &executor.Result{}, nil +} + +func TestLicensedExecutorAppliesWithoutRestart(t *testing.T) { + k := licensetest.NewKey(t) + lic := k.Manager(t) // no key yet: the free core + inner := &okExec{} + ex := &licensedExecutor{Executor: inner, lic: lic} + _, err := ex.Run(context.Background(), executor.Task{Kind: "review"}) + if err == nil || !strings.Contains(err.Error(), "needs a Divmora license") || inner.runs != 0 { + t.Fatalf("unlicensed: %v (runs %d)", err, inner.runs) + } + if err := lic.Install(k.Issue(t, time.Hour, license.Executors), "database"); err != nil { + t.Fatal(err) + } + if _, err := ex.Run(context.Background(), executor.Task{Kind: "review"}); err != nil || inner.runs != 1 { + t.Errorf("after the key is added: %v (runs %d)", err, inner.runs) + } + cfg := &config.Config{Executor: config.Executor{Type: "kubernetes"}} + if err := requireExecutor(cfg, k.Manager(t)); err == nil { + t.Error("requireExecutor still reports the missing feature (for logs and check-config)") + } +} diff --git a/docs/deploy.md b/docs/deploy.md index ac3dc92..cd3135a 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -35,25 +35,22 @@ by email. Paid features need a Divmora license key (a `DIV1.…` token, or the a `-----BEGIN DIVMORA LICENSE KEY-----` block) for product `code-review-console`. The README lists the features. -The key is read from the first of these that is set: - -1. `CODEREVIEW_CONSOLE_LICENSE`: the key itself -2. `license.file` in the config: a file holding the key (for example a mounted Secret) -3. the key pasted under **License** in the admin panel (stored in the database, audited without - the key itself) - -Keys are verified offline against Divmora's public key; nothing is sent anywhere. A new key -applies at once, except for the executor type, which is checked when the console starts: -`executor.type: docker` or `kubernetes` without the `executors` feature stops startup with a clear -error. - -**First start with the docker or kubernetes executor.** Because the check runs before the admin -panel is up, a fresh install can't use the panel to add its first key. Either: - -- provide the key by `CODEREVIEW_CONSOLE_LICENSE` or `license.file` for the first start (it can - stay there, or you can paste it in the panel later and remove it), or -- start once with `executor.type: local`, paste the key under **License**, then switch the executor - and restart. The pasted key is stored in the database and read on every later start. +**Manage the key under License in the admin panel**: paste it to install or replace it, or remove it. +It is stored in the database and audited without the key itself, and applies at once, with no +restart. That includes the docker and kubernetes executors: without the `executors` feature the +console still starts, shows "reviews are paused" in the panel and on **Setup**, and refuses review +jobs with a clear error until the key is added. + +Two other sources exist: + +- `CODEREVIEW_CONSOLE_LICENSE`: an **override**, for example when nobody can sign in. While it is + set, it wins over the panel, and the panel shows the key as managed by the variable. +- `license.file` (**deprecated**): when the database has no key yet, a valid key from the file is + copied into it on start, and from then on the panel manages it. Afterwards the file is ignored, + and the console logs a warning until you remove `license.file`. Without a database, the file is + read as before. + +Keys are verified offline against Divmora's public key; nothing is sent anywhere. When a license expires, paid features keep working for its grace period (14 days unless the license says otherwise), with a banner in the admin panel. After that the console goes back diff --git a/examples/console.yaml b/examples/console.yaml index 240be6a..edc3288 100644 --- a/examples/console.yaml +++ b/examples/console.yaml @@ -110,8 +110,9 @@ database: repos: allowlist: true # review only repositories enabled directly or by a group/pattern rule require_reviewer: false # true: review an MR/PR only when the bot user is one of its reviewers -# Divmora license key for paid features (or CODEREVIEW_CONSOLE_LICENSE, or paste it in the -# admin panel under License). Without one the console runs the free core. +# The Divmora license key is managed in the admin panel under License (without one the console runs +# the free core). license.file is deprecated: its key is copied into the database once. +# CODEREVIEW_CONSOLE_LICENSE overrides the panel, for example when nobody can sign in. # license: # file: /etc/console/license.key diff --git a/internal/admin/admin_test.go b/internal/admin/admin_test.go index 2b1e225..3e06b51 100644 --- a/internal/admin/admin_test.go +++ b/internal/admin/admin_test.go @@ -27,6 +27,7 @@ import ( "github.com/divmora/code-review-bot/pkg/vcs" "github.com/divmora/code-review-console/internal/config" + "github.com/divmora/code-review-console/internal/ee/license" "github.com/divmora/code-review-console/internal/ee/license/licensetest" "github.com/divmora/code-review-console/internal/hosts" "github.com/divmora/code-review-console/internal/secrets" @@ -748,3 +749,35 @@ func TestCommentWarningText(t *testing.T) { t.Errorf("gitlab with a group hook but no comments: %q", w) } } + +func TestReviewsPausedWithoutExecutorLicense(t *testing.T) { + e := setup(t, config.OIDC{AllowedEmails: []string{"alice@example.com"}}) + e.idp.as(map[string]any{"sub": "u1", "email": "alice@example.com", "email_verified": true}) + _ = e.login(t).Body.Close() + e.adm.ExecutorType = "kubernetes" + e.adm.Lic = licensetest.Manager(t, license.Hosts) // no executors feature + if _, body := e.do(t, "GET", "/admin/api/me", "", nil); !bytes.Contains(body, []byte(`"reviews_paused":"reviews are paused: the kubernetes executor needs a license`)) { + t.Errorf("/me must say reviews are paused: %s", body) + } + _, body := e.do(t, "GET", "/admin/api/setup", "", nil) + var st struct { + Steps []struct { + ID string + Done bool + Optional bool + } + Total int + } + _ = json.Unmarshal(body, &st) + if st.Steps[0].ID != "license" || st.Steps[0].Done || st.Steps[0].Optional || st.Total != 7 { + t.Errorf("the license step is required while reviews are paused: %s", body) + } + e.adm.Lic = licensetest.Full(t) + if _, body := e.do(t, "GET", "/admin/api/me", "", nil); !bytes.Contains(body, []byte(`"reviews_paused":""`)) { + t.Errorf("licensed: %s", body) + } + e.adm.ExecutorType, e.adm.Lic = "local", nil + if _, body := e.do(t, "GET", "/admin/api/me", "", nil); !bytes.Contains(body, []byte(`"reviews_paused":""`)) { + t.Errorf("the local executor never needs a license: %s", body) + } +} diff --git a/internal/admin/auth.go b/internal/admin/auth.go index f4dc990..3bd8389 100644 --- a/internal/admin/auth.go +++ b/internal/admin/auth.go @@ -52,6 +52,9 @@ type Admin struct { // Hosts is the code host registry shared with the server; nil hides // the Hosts page. Hosts *hosts.Registry + // ExecutorType is the configured executor (local, docker, kubernetes); + // docker and kubernetes need the executors license feature to run. + ExecutorType string // Lic is the installed license (nil = the free core). License keys // pasted in the panel are stored under licenseKey. Lic *license.Manager diff --git a/internal/admin/handlers.go b/internal/admin/handlers.go index dd72124..ef577c8 100644 --- a/internal/admin/handlers.go +++ b/internal/admin/handlers.go @@ -157,7 +157,7 @@ func (a *Admin) apiMe(w http.ResponseWriter, r *http.Request, s *store.Session) } writeJSON(w, http.StatusOK, map[string]any{ "email": s.Email, "name": firstNonEmpty(s.Name, s.Email), "expires": s.Expires, "csrf": s.CSRF, "version": version.Version, "license": a.Lic.Status(), "free_retention_days": license.FreeRetentionDays, "profiles": a.profiles, "allowlist": eff.Allowlist, "require_reviewer": eff.RequireReviewer, - "setup": setup, + "setup": setup, "reviews_paused": a.reviewsPaused(), }) } diff --git a/internal/admin/license.go b/internal/admin/license.go index a91fddf..3b6a638 100644 --- a/internal/admin/license.go +++ b/internal/admin/license.go @@ -61,7 +61,7 @@ func (a *Admin) apiPutLicense(w http.ResponseWriter, r *http.Request, s *store.S return } if a.Lic.Status().Managed { - writeJSON(w, http.StatusConflict, map[string]string{"error": "the license comes from CODEREVIEW_CONSOLE_LICENSE or license.file; change it there"}) + writeJSON(w, http.StatusConflict, map[string]string{"error": "the license comes from CODEREVIEW_CONSOLE_LICENSE, which overrides the panel: remove the variable and restart to manage it here"}) return } var req StoredLicense diff --git a/internal/admin/setup.go b/internal/admin/setup.go index e267047..333a537 100644 --- a/internal/admin/setup.go +++ b/internal/admin/setup.go @@ -66,6 +66,10 @@ func (a *Admin) setup(ctx context.Context) (setupStatus, error) { default: lic.Detail = "free core" } + if paused := a.reviewsPaused(); paused != "" { + lic.Optional, lic.Done, lic.Detail = false, false, paused + lic.Help = "The " + a.ExecutorType + " executor runs reviews only with a Divmora license that includes executors. Paste the key under License: it applies at once, no restart." + } steps = append(steps, lic) // 2. A code host, and 3. a webhook on it. @@ -208,6 +212,14 @@ func (a *Admin) setup(ctx context.Context) (setupStatus, error) { return out, nil } +// reviewsPaused says why reviews can't run with the current license, or "". +func (a *Admin) reviewsPaused() string { + if a.ExecutorType == "" || a.ExecutorType == "local" || a.Lic.Has(license.Executors) { + return "" + } + return "reviews are paused: the " + a.ExecutorType + " executor needs a license with the executors feature" +} + func plural(n int, noun string) string { if n == 1 { return "1 " + noun diff --git a/internal/admin/ui/assets/index-DMQms6p-.js b/internal/admin/ui/assets/index-C6kZagEB.js similarity index 90% rename from internal/admin/ui/assets/index-DMQms6p-.js rename to internal/admin/ui/assets/index-C6kZagEB.js index 58a4c2c..fa25ff3 100644 --- a/internal/admin/ui/assets/index-DMQms6p-.js +++ b/internal/admin/ui/assets/index-C6kZagEB.js @@ -1,4 +1,4 @@ -var Xh=n=>{throw TypeError(n)};var Jh=(n,r,i)=>r.has(n)||Xh("Cannot "+i);var ht=(n,r,i)=>(Jh(n,r,"read from private field"),i?i.call(n):r.get(n)),Zh=(n,r,i)=>r.has(n)?Xh("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,i),tu=(n,r,i,l)=>(Jh(n,r,"write to private field"),l?l.call(n,i):r.set(n,i),i);function A0(n,r){for(var i=0;il[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();function I0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nu={exports:{}},$i={},ru={exports:{}},Ne={};/** +var Xh=n=>{throw TypeError(n)};var Jh=(n,r,i)=>r.has(n)||Xh("Cannot "+i);var ht=(n,r,i)=>(Jh(n,r,"read from private field"),i?i.call(n):r.get(n)),Zh=(n,r,i)=>r.has(n)?Xh("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,i),tu=(n,r,i,l)=>(Jh(n,r,"write to private field"),l?l.call(n,i):r.set(n,i),i);function A0(n,r){for(var i=0;il[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))l(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function i(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(c){if(c.ep)return;c.ep=!0;const u=i(c);fetch(c.href,u)}})();function I0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var nu={exports:{}},Bi={},ru={exports:{}},Ne={};/** * @license React * react.production.min.js * @@ -14,7 +14,7 @@ var Xh=n=>{throw TypeError(n)};var Jh=(n,r,i)=>r.has(n)||Xh("Cannot "+i);var ht= * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var nm;function z0(){if(nm)return $i;nm=1;var n=Zu(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,v,g){var y,x={},b=null,j=null;g!==void 0&&(b=""+g),v.key!==void 0&&(b=""+v.key),v.ref!==void 0&&(j=v.ref);for(y in v)l.call(v,y)&&!u.hasOwnProperty(y)&&(x[y]=v[y]);if(h&&h.defaultProps)for(y in v=h.defaultProps,v)x[y]===void 0&&(x[y]=v[y]);return{$$typeof:r,type:h,key:b,ref:j,props:x,_owner:c.current}}return $i.Fragment=i,$i.jsx=f,$i.jsxs=f,$i}var rm;function F0(){return rm||(rm=1,nu.exports=z0()),nu.exports}var s=F0(),m=Zu();const $0=I0(m),Rr=A0({__proto__:null,default:$0},[m]);var hl={},ou={exports:{}},Dt={},iu={exports:{}},su={};/** + */var nm;function z0(){if(nm)return Bi;nm=1;var n=Zu(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,v,g){var y,x={},b=null,j=null;g!==void 0&&(b=""+g),v.key!==void 0&&(b=""+v.key),v.ref!==void 0&&(j=v.ref);for(y in v)l.call(v,y)&&!u.hasOwnProperty(y)&&(x[y]=v[y]);if(h&&h.defaultProps)for(y in v=h.defaultProps,v)x[y]===void 0&&(x[y]=v[y]);return{$$typeof:r,type:h,key:b,ref:j,props:x,_owner:c.current}}return Bi.Fragment=i,Bi.jsx=f,Bi.jsxs=f,Bi}var rm;function F0(){return rm||(rm=1,nu.exports=z0()),nu.exports}var s=F0(),m=Zu();const $0=I0(m),Rr=A0({__proto__:null,default:$0},[m]);var hl={},ou={exports:{}},Dt={},iu={exports:{}},su={};/** * @license React * scheduler.production.min.js * @@ -34,10 +34,10 @@ var Xh=n=>{throw TypeError(n)};var Jh=(n,r,i)=>r.has(n)||Xh("Cannot "+i);var ht= `+M+e}var he=!1;function be(e,t){if(!e||he)return"";he=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(U){var a=U}Reflect.construct(e,[],t)}else{try{t.call()}catch(U){a=U}e.call(t.prototype)}else{try{throw Error()}catch(U){a=U}e()}}catch(U){if(U&&a&&typeof U.stack=="string"){for(var d=U.stack.split(` `),p=a.stack.split(` `),w=d.length-1,_=p.length-1;1<=w&&0<=_&&d[w]!==p[_];)_--;for(;1<=w&&0<=_;w--,_--)if(d[w]!==p[_]){if(w!==1||_!==1)do if(w--,_--,0>_||d[w]!==p[_]){var O=` -`+d[w].replace(" at new "," at ");return e.displayName&&O.includes("")&&(O=O.replace("",e.displayName)),O}while(1<=w&&0<=_);break}}}finally{he=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?V(e):""}function pe(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=be(e.type,!1),e;case 11:return e=be(e.type.render,!1),e;case 1:return e=be(e.type,!0),e;default:return""}}function Y(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I:return"Fragment";case N:return"Portal";case Q:return"Profiler";case L:return"StrictMode";case de:return"Suspense";case re:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J:return(e.displayName||"Context")+".Consumer";case ee:return(e._context.displayName||"Context")+".Provider";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return t=e.displayName||null,t!==null?t:Y(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return Y(e(t))}catch{}}return null}function we(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Y(t);case 8:return t===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Be(e){var t=me(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,p=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(w){a=""+w,p.call(this,w)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mt(e){e._valueTracker||(e._valueTracker=Be(e))}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),a="";return e&&(a=me(e)?e.checked?"true":"false":e.value),e=a,e!==o?(t.setValue(e),!0):!1}function ut(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tt(e,t){var o=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Jn(e,t){var o=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;o=ke(t.value!=null?t.value:o),e._wrapperState={initialChecked:a,initialValue:o,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Cn(e,t){t=t.checked,t!=null&&T(e,"checked",t,!1)}function dt(e,t){Cn(e,t);var o=ke(t.value),a=t.type;if(o!=null)a==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ti(e,t.type,o):t.hasOwnProperty("defaultValue")&&ti(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function is(e,t,o){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,o||t===e.value||(e.value=t),e.defaultValue=t}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function ti(e,t,o){(t!=="number"||ut(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Mr=Array.isArray;function Zn(e,t,o,a){if(e=e.options,t){t={};for(var d=0;d"+t.valueOf().toString()+"",t=ss.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ni(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var ri={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fy=["Webkit","ms","Moz","O"];Object.keys(ri).forEach(function(e){Fy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ri[t]=ri[e]})});function ff(e,t,o){return t==null||typeof t=="boolean"||t===""?"":o||typeof t!="number"||t===0||ri.hasOwnProperty(e)&&ri[e]?(""+t).trim():t+"px"}function pf(e,t){e=e.style;for(var o in t)if(t.hasOwnProperty(o)){var a=o.indexOf("--")===0,d=ff(o,t[o],a);o==="float"&&(o="cssFloat"),a?e.setProperty(o,d):e[o]=d}}var $y=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pa(e,t){if(t){if($y[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function ha(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ma=null;function ga(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var va=null,po=null,ho=null;function hf(e){if(e=Si(e)){if(typeof va!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Rs(t),va(e.stateNode,e.type,t))}}function mf(e){po?ho?ho.push(e):ho=[e]:po=e}function gf(){if(po){var e=po,t=ho;if(ho=po=null,hf(e),t)for(e=0;e>>=0,e===0?32:31-(Xy(e)/Jy|0)|0}var ds=64,fs=4194304;function li(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ps(e,t){var o=e.pendingLanes;if(o===0)return 0;var a=0,d=e.suspendedLanes,p=e.pingedLanes,w=o&268435455;if(w!==0){var _=w&~d;_!==0?a=li(_):(p&=w,p!==0&&(a=li(p)))}else w=o&~d,w!==0?a=li(w):p!==0&&(a=li(p));if(a===0)return 0;if(t!==0&&t!==a&&(t&d)===0&&(d=a&-a,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((a&4)!==0&&(a|=o&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0o;o++)t.push(e);return t}function ai(e,t,o){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zt(t),e[t]=o}function nw(e,t){var o=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0=gi),Vf=" ",Hf=!1;function Gf(e,t){switch(e){case"keyup":return Pw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vo=!1;function Tw(e,t){switch(e){case"compositionend":return Kf(t);case"keypress":return t.which!==32?null:(Hf=!0,Vf);case"textInput":return e=t.data,e===Vf&&Hf?null:e;default:return null}}function Ow(e,t){if(vo)return e==="compositionend"||!Aa&&Gf(e,t)?(e=zf(),xs=Ra=ir=null,vo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:o,offset:t-e};e=a}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ep(o)}}function np(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?np(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rp(){for(var e=window,t=ut();t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=ut(e.document)}return t}function za(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Bw(e){var t=rp(),o=e.focusedElem,a=e.selectionRange;if(t!==o&&o&&o.ownerDocument&&np(o.ownerDocument.documentElement,o)){if(a!==null&&za(o)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in o)o.selectionStart=t,o.selectionEnd=Math.min(e,o.value.length);else if(e=(t=o.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=o.textContent.length,p=Math.min(a.start,d);a=a.end===void 0?p:Math.min(a.end,d),!e.extend&&p>a&&(d=a,a=p,p=d),d=tp(o,p);var w=tp(o,a);d&&w&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>a?(e.addRange(t),e.extend(w.node,w.offset)):(t.setEnd(w.node,w.offset),e.addRange(t)))}}for(t=[],e=o;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,xo=null,Fa=null,wi=null,$a=!1;function op(e,t,o){var a=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;$a||xo==null||xo!==ut(a)||(a=xo,"selectionStart"in a&&za(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),wi&&yi(wi,a)||(wi=a,a=Es(Fa,"onSelect"),0jo||(e.current=Ja[jo],Ja[jo]=null,jo--)}function Le(e,t){jo++,Ja[jo]=e.current,e.current=t}var cr={},gt=ar(cr),Et=ar(!1),Lr=cr;function Co(e,t){var o=e.type.contextTypes;if(!o)return cr;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in o)d[p]=t[p];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function _t(e){return e=e.childContextTypes,e!=null}function Ps(){$e(Et),$e(gt)}function yp(e,t,o){if(gt.current!==cr)throw Error(i(168));Le(gt,t),Le(Et,o)}function wp(e,t,o){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return o;a=a.getChildContext();for(var d in a)if(!(d in t))throw Error(i(108,we(e)||"Unknown",d));return F({},o,a)}function Ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cr,Lr=gt.current,Le(gt,e),Le(Et,Et.current),!0}function bp(e,t,o){var a=e.stateNode;if(!a)throw Error(i(169));o?(e=wp(e,t,Lr),a.__reactInternalMemoizedMergedChildContext=e,$e(Et),$e(gt),Le(gt,e)):$e(Et),Le(Et,o)}var En=null,Ts=!1,Za=!1;function kp(e){En===null?En=[e]:En.push(e)}function e0(e){Ts=!0,kp(e)}function ur(){if(!Za&&En!==null){Za=!0;var e=0,t=Ae;try{var o=En;for(Ae=1;e>=w,d-=w,_n=1<<32-Zt(t)+d|o<ye?(at=xe,xe=null):at=xe.sibling;var Pe=H(z,xe,$[ye],X);if(Pe===null){xe===null&&(xe=at);break}e&&xe&&Pe.alternate===null&&t(z,xe),A=p(Pe,A,ye),ve===null?fe=Pe:ve.sibling=Pe,ve=Pe,xe=at}if(ye===$.length)return o(z,xe),Ue&&Fr(z,ye),fe;if(xe===null){for(;ye<$.length;ye++)xe=K(z,$[ye],X),xe!==null&&(A=p(xe,A,ye),ve===null?fe=xe:ve.sibling=xe,ve=xe);return Ue&&Fr(z,ye),fe}for(xe=a(z,xe);ye<$.length;ye++)at=oe(xe,z,ye,$[ye],X),at!==null&&(e&&at.alternate!==null&&xe.delete(at.key===null?ye:at.key),A=p(at,A,ye),ve===null?fe=at:ve.sibling=at,ve=at);return e&&xe.forEach(function(yr){return t(z,yr)}),Ue&&Fr(z,ye),fe}function ue(z,A,$,X){var fe=q($);if(typeof fe!="function")throw Error(i(150));if($=fe.call($),$==null)throw Error(i(151));for(var ve=fe=null,xe=A,ye=A=0,at=null,Pe=$.next();xe!==null&&!Pe.done;ye++,Pe=$.next()){xe.index>ye?(at=xe,xe=null):at=xe.sibling;var yr=H(z,xe,Pe.value,X);if(yr===null){xe===null&&(xe=at);break}e&&xe&&yr.alternate===null&&t(z,xe),A=p(yr,A,ye),ve===null?fe=yr:ve.sibling=yr,ve=yr,xe=at}if(Pe.done)return o(z,xe),Ue&&Fr(z,ye),fe;if(xe===null){for(;!Pe.done;ye++,Pe=$.next())Pe=K(z,Pe.value,X),Pe!==null&&(A=p(Pe,A,ye),ve===null?fe=Pe:ve.sibling=Pe,ve=Pe);return Ue&&Fr(z,ye),fe}for(xe=a(z,xe);!Pe.done;ye++,Pe=$.next())Pe=oe(xe,z,ye,Pe.value,X),Pe!==null&&(e&&Pe.alternate!==null&&xe.delete(Pe.key===null?ye:Pe.key),A=p(Pe,A,ye),ve===null?fe=Pe:ve.sibling=Pe,ve=Pe);return e&&xe.forEach(function(M0){return t(z,M0)}),Ue&&Fr(z,ye),fe}function qe(z,A,$,X){if(typeof $=="object"&&$!==null&&$.type===I&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case R:e:{for(var fe=$.key,ve=A;ve!==null;){if(ve.key===fe){if(fe=$.type,fe===I){if(ve.tag===7){o(z,ve.sibling),A=d(ve,$.props.children),A.return=z,z=A;break e}}else if(ve.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===B&&Np(fe)===ve.type){o(z,ve.sibling),A=d(ve,$.props),A.ref=Ei(z,ve,$),A.return=z,z=A;break e}o(z,ve);break}else t(z,ve);ve=ve.sibling}$.type===I?(A=Kr($.props.children,z.mode,X,$.key),A.return=z,z=A):(X=sl($.type,$.key,$.props,null,z.mode,X),X.ref=Ei(z,A,$),X.return=z,z=X)}return w(z);case N:e:{for(ve=$.key;A!==null;){if(A.key===ve)if(A.tag===4&&A.stateNode.containerInfo===$.containerInfo&&A.stateNode.implementation===$.implementation){o(z,A.sibling),A=d(A,$.children||[]),A.return=z,z=A;break e}else{o(z,A);break}else t(z,A);A=A.sibling}A=qc($,z.mode,X),A.return=z,z=A}return w(z);case B:return ve=$._init,qe(z,A,ve($._payload),X)}if(Mr($))return ce(z,A,$,X);if(q($))return ue(z,A,$,X);Is(z,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,A!==null&&A.tag===6?(o(z,A.sibling),A=d(A,$),A.return=z,z=A):(o(z,A),A=Yc($,z.mode,X),A.return=z,z=A),w(z)):o(z,A)}return qe}var No=Rp(!0),Pp=Rp(!1),Ls=ar(null),zs=null,Ro=null,ic=null;function sc(){ic=Ro=zs=null}function lc(e){var t=Ls.current;$e(Ls),e._currentValue=t}function ac(e,t,o){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===o)break;e=e.return}}function Po(e,t){zs=e,ic=Ro=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Nt=!0),e.firstContext=null)}function Ht(e){var t=e._currentValue;if(ic!==e)if(e={context:e,memoizedValue:t,next:null},Ro===null){if(zs===null)throw Error(i(308));Ro=e,zs.dependencies={lanes:0,firstContext:e}}else Ro=Ro.next=e;return t}var $r=null;function cc(e){$r===null?$r=[e]:$r.push(e)}function Dp(e,t,o,a){var d=t.interleaved;return d===null?(o.next=o,cc(t)):(o.next=d.next,d.next=o),t.interleaved=o,Rn(e,a)}function Rn(e,t){e.lanes|=t;var o=e.alternate;for(o!==null&&(o.lanes|=t),o=e,e=e.return;e!==null;)e.childLanes|=t,o=e.alternate,o!==null&&(o.childLanes|=t),o=e,e=e.return;return o.tag===3?o.stateNode:null}var dr=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fr(e,t,o){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Re&2)!==0){var d=a.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),a.pending=t,Rn(e,o)}return d=a.interleaved,d===null?(t.next=t,cc(a)):(t.next=d.next,d.next=t),a.interleaved=t,Rn(e,o)}function Fs(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,Ca(e,o)}}function Op(e,t){var o=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,o===a)){var d=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var w={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};p===null?d=p=w:p=p.next=w,o=o.next}while(o!==null);p===null?d=p=t:p=p.next=t}else d=p=t;o={baseState:a.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:a.shared,effects:a.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}function $s(e,t,o,a){var d=e.updateQueue;dr=!1;var p=d.firstBaseUpdate,w=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var O=_,U=O.next;O.next=null,w===null?p=U:w.next=U,w=O;var G=e.alternate;G!==null&&(G=G.updateQueue,_=G.lastBaseUpdate,_!==w&&(_===null?G.firstBaseUpdate=U:_.next=U,G.lastBaseUpdate=O))}if(p!==null){var K=d.baseState;w=0,G=U=O=null,_=p;do{var H=_.lane,oe=_.eventTime;if((a&H)===H){G!==null&&(G=G.next={eventTime:oe,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var ce=e,ue=_;switch(H=t,oe=o,ue.tag){case 1:if(ce=ue.payload,typeof ce=="function"){K=ce.call(oe,K,H);break e}K=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ue.payload,H=typeof ce=="function"?ce.call(oe,K,H):ce,H==null)break e;K=F({},K,H);break e;case 2:dr=!0}}_.callback!==null&&_.lane!==0&&(e.flags|=64,H=d.effects,H===null?d.effects=[_]:H.push(_))}else oe={eventTime:oe,lane:H,tag:_.tag,payload:_.payload,callback:_.callback,next:null},G===null?(U=G=oe,O=K):G=G.next=oe,w|=H;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;H=_,_=H.next,H.next=null,d.lastBaseUpdate=H,d.shared.pending=null}}while(!0);if(G===null&&(O=K),d.baseState=O,d.firstBaseUpdate=U,d.lastBaseUpdate=G,t=d.shared.interleaved,t!==null){d=t;do w|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);Wr|=w,e.lanes=w,e.memoizedState=K}}function Mp(e,t,o){if(e=t.effects,t.effects=null,e!==null)for(t=0;to?o:4,e(!0);var a=mc.transition;mc.transition={};try{e(!1),t()}finally{Ae=o,mc.transition=a}}function Zp(){return Gt().memoizedState}function o0(e,t,o){var a=gr(e);if(o={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null},eh(e))th(t,o);else if(o=Dp(e,t,o,a),o!==null){var d=jt();sn(o,e,a,d),nh(o,t,a)}}function i0(e,t,o){var a=gr(e),d={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null};if(eh(e))th(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var w=t.lastRenderedState,_=p(w,o);if(d.hasEagerState=!0,d.eagerState=_,en(_,w)){var O=t.interleaved;O===null?(d.next=d,cc(t)):(d.next=O.next,O.next=d),t.interleaved=d;return}}catch{}finally{}o=Dp(e,t,d,a),o!==null&&(d=jt(),sn(o,e,a,d),nh(o,t,a))}}function eh(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function th(e,t){Pi=Ws=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function nh(e,t,o){if((o&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,Ca(e,o)}}var Gs={readContext:Ht,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},s0={readContext:Ht,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Hp,useImperativeHandle:function(e,t,o){return o=o!=null?o.concat([e]):null,Vs(4194308,4,Qp.bind(null,t,e),o)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vs(4,2,e,t)},useMemo:function(e,t){var o=pn();return t=t===void 0?null:t,e=e(),o.memoizedState=[e,t],e},useReducer:function(e,t,o){var a=pn();return t=o!==void 0?o(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=o0.bind(null,Ve,e),[a.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:Wp,useDebugValue:kc,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=Wp(!1),t=e[0];return e=r0.bind(null,e[1]),pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,o){var a=Ve,d=pn();if(Ue){if(o===void 0)throw Error(i(407));o=o()}else{if(o=t(),lt===null)throw Error(i(349));(Br&30)!==0||zp(a,t,o)}d.memoizedState=o;var p={value:o,getSnapshot:t};return d.queue=p,Hp($p.bind(null,a,p,e),[e]),a.flags|=2048,Oi(9,Fp.bind(null,a,p,o,t),void 0,null),o},useId:function(){var e=pn(),t=lt.identifierPrefix;if(Ue){var o=Nn,a=_n;o=(a&~(1<<32-Zt(a)-1)).toString(32)+o,t=":"+t+"R"+o,o=Di++,0")&&(O=O.replace("",e.displayName)),O}while(1<=w&&0<=_);break}}}finally{he=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?V(e):""}function pe(e){switch(e.tag){case 5:return V(e.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return e=be(e.type,!1),e;case 11:return e=be(e.type.render,!1),e;case 1:return e=be(e.type,!0),e;default:return""}}function Y(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I:return"Fragment";case N:return"Portal";case Q:return"Profiler";case L:return"StrictMode";case de:return"Suspense";case re:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case J:return(e.displayName||"Context")+".Consumer";case ee:return(e._context.displayName||"Context")+".Provider";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ie:return t=e.displayName||null,t!==null?t:Y(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return Y(e(t))}catch{}}return null}function we(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Y(t);case 8:return t===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ke(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function me(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Be(e){var t=me(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,p=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(w){a=""+w,p.call(this,w)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mt(e){e._valueTracker||(e._valueTracker=Be(e))}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),a="";return e&&(a=me(e)?e.checked?"true":"false":e.value),e=a,e!==o?(t.setValue(e),!0):!1}function ut(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function tt(e,t){var o=t.checked;return F({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function Jn(e,t){var o=t.defaultValue==null?"":t.defaultValue,a=t.checked!=null?t.checked:t.defaultChecked;o=ke(t.value!=null?t.value:o),e._wrapperState={initialChecked:a,initialValue:o,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Cn(e,t){t=t.checked,t!=null&&T(e,"checked",t,!1)}function dt(e,t){Cn(e,t);var o=ke(t.value),a=t.type;if(o!=null)a==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(a==="submit"||a==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ri(e,t.type,o):t.hasOwnProperty("defaultValue")&&ri(e,t.type,ke(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function is(e,t,o){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var a=t.type;if(!(a!=="submit"&&a!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,o||t===e.value||(e.value=t),e.defaultValue=t}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function ri(e,t,o){(t!=="number"||ut(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Mr=Array.isArray;function Zn(e,t,o,a){if(e=e.options,t){t={};for(var d=0;d"+t.valueOf().toString()+"",t=ss.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function oi(e,t){if(t){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=t;return}}e.textContent=t}var ii={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fy=["Webkit","ms","Moz","O"];Object.keys(ii).forEach(function(e){Fy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ii[t]=ii[e]})});function ff(e,t,o){return t==null||typeof t=="boolean"||t===""?"":o||typeof t!="number"||t===0||ii.hasOwnProperty(e)&&ii[e]?(""+t).trim():t+"px"}function pf(e,t){e=e.style;for(var o in t)if(t.hasOwnProperty(o)){var a=o.indexOf("--")===0,d=ff(o,t[o],a);o==="float"&&(o="cssFloat"),a?e.setProperty(o,d):e[o]=d}}var $y=F({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pa(e,t){if(t){if($y[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function ha(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ma=null;function ga(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var va=null,ho=null,mo=null;function hf(e){if(e=_i(e)){if(typeof va!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Rs(t),va(e.stateNode,e.type,t))}}function mf(e){ho?mo?mo.push(e):mo=[e]:ho=e}function gf(){if(ho){var e=ho,t=mo;if(mo=ho=null,hf(e),t)for(e=0;e>>=0,e===0?32:31-(Xy(e)/Jy|0)|0}var ds=64,fs=4194304;function ci(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ps(e,t){var o=e.pendingLanes;if(o===0)return 0;var a=0,d=e.suspendedLanes,p=e.pingedLanes,w=o&268435455;if(w!==0){var _=w&~d;_!==0?a=ci(_):(p&=w,p!==0&&(a=ci(p)))}else w=o&~d,w!==0?a=ci(w):p!==0&&(a=ci(p));if(a===0)return 0;if(t!==0&&t!==a&&(t&d)===0&&(d=a&-a,p=t&-t,d>=p||d===16&&(p&4194240)!==0))return t;if((a&4)!==0&&(a|=o&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=a;0o;o++)t.push(e);return t}function ui(e,t,o){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zt(t),e[t]=o}function nw(e,t){var o=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var a=e.eventTimes;for(e=e.expirationTimes;0=xi),Vf=" ",Hf=!1;function Gf(e,t){switch(e){case"keyup":return Pw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xo=!1;function Tw(e,t){switch(e){case"compositionend":return Kf(t);case"keypress":return t.which!==32?null:(Hf=!0,Vf);case"textInput":return e=t.data,e===Vf&&Hf?null:e;default:return null}}function Ow(e,t){if(xo)return e==="compositionend"||!Aa&&Gf(e,t)?(e=zf(),xs=Ra=ir=null,xo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:o,offset:t-e};e=a}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=ep(o)}}function np(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?np(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rp(){for(var e=window,t=ut();t instanceof e.HTMLIFrameElement;){try{var o=typeof t.contentWindow.location.href=="string"}catch{o=!1}if(o)e=t.contentWindow;else break;t=ut(e.document)}return t}function za(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Bw(e){var t=rp(),o=e.focusedElem,a=e.selectionRange;if(t!==o&&o&&o.ownerDocument&&np(o.ownerDocument.documentElement,o)){if(a!==null&&za(o)){if(t=a.start,e=a.end,e===void 0&&(e=t),"selectionStart"in o)o.selectionStart=t,o.selectionEnd=Math.min(e,o.value.length);else if(e=(t=o.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var d=o.textContent.length,p=Math.min(a.start,d);a=a.end===void 0?p:Math.min(a.end,d),!e.extend&&p>a&&(d=a,a=p,p=d),d=tp(o,p);var w=tp(o,a);d&&w&&(e.rangeCount!==1||e.anchorNode!==d.node||e.anchorOffset!==d.offset||e.focusNode!==w.node||e.focusOffset!==w.offset)&&(t=t.createRange(),t.setStart(d.node,d.offset),e.removeAllRanges(),p>a?(e.addRange(t),e.extend(w.node,w.offset)):(t.setEnd(w.node,w.offset),e.addRange(t)))}}for(t=[],e=o;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o=document.documentMode,yo=null,Fa=null,ki=null,$a=!1;function op(e,t,o){var a=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;$a||yo==null||yo!==ut(a)||(a=yo,"selectionStart"in a&&za(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ki&&bi(ki,a)||(ki=a,a=Es(Fa,"onSelect"),0Co||(e.current=Ja[Co],Ja[Co]=null,Co--)}function Le(e,t){Co++,Ja[Co]=e.current,e.current=t}var cr={},gt=ar(cr),Et=ar(!1),Lr=cr;function So(e,t){var o=e.type.contextTypes;if(!o)return cr;var a=e.stateNode;if(a&&a.__reactInternalMemoizedUnmaskedChildContext===t)return a.__reactInternalMemoizedMaskedChildContext;var d={},p;for(p in o)d[p]=t[p];return a&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=d),d}function _t(e){return e=e.childContextTypes,e!=null}function Ps(){$e(Et),$e(gt)}function yp(e,t,o){if(gt.current!==cr)throw Error(i(168));Le(gt,t),Le(Et,o)}function wp(e,t,o){var a=e.stateNode;if(t=t.childContextTypes,typeof a.getChildContext!="function")return o;a=a.getChildContext();for(var d in a)if(!(d in t))throw Error(i(108,we(e)||"Unknown",d));return F({},o,a)}function Ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cr,Lr=gt.current,Le(gt,e),Le(Et,Et.current),!0}function bp(e,t,o){var a=e.stateNode;if(!a)throw Error(i(169));o?(e=wp(e,t,Lr),a.__reactInternalMemoizedMergedChildContext=e,$e(Et),$e(gt),Le(gt,e)):$e(Et),Le(Et,o)}var En=null,Ts=!1,Za=!1;function kp(e){En===null?En=[e]:En.push(e)}function e0(e){Ts=!0,kp(e)}function ur(){if(!Za&&En!==null){Za=!0;var e=0,t=Ae;try{var o=En;for(Ae=1;e>=w,d-=w,_n=1<<32-Zt(t)+d|o<ye?(at=xe,xe=null):at=xe.sibling;var Pe=H(z,xe,$[ye],X);if(Pe===null){xe===null&&(xe=at);break}e&&xe&&Pe.alternate===null&&t(z,xe),A=p(Pe,A,ye),ve===null?fe=Pe:ve.sibling=Pe,ve=Pe,xe=at}if(ye===$.length)return o(z,xe),Ue&&Fr(z,ye),fe;if(xe===null){for(;ye<$.length;ye++)xe=K(z,$[ye],X),xe!==null&&(A=p(xe,A,ye),ve===null?fe=xe:ve.sibling=xe,ve=xe);return Ue&&Fr(z,ye),fe}for(xe=a(z,xe);ye<$.length;ye++)at=oe(xe,z,ye,$[ye],X),at!==null&&(e&&at.alternate!==null&&xe.delete(at.key===null?ye:at.key),A=p(at,A,ye),ve===null?fe=at:ve.sibling=at,ve=at);return e&&xe.forEach(function(yr){return t(z,yr)}),Ue&&Fr(z,ye),fe}function ue(z,A,$,X){var fe=q($);if(typeof fe!="function")throw Error(i(150));if($=fe.call($),$==null)throw Error(i(151));for(var ve=fe=null,xe=A,ye=A=0,at=null,Pe=$.next();xe!==null&&!Pe.done;ye++,Pe=$.next()){xe.index>ye?(at=xe,xe=null):at=xe.sibling;var yr=H(z,xe,Pe.value,X);if(yr===null){xe===null&&(xe=at);break}e&&xe&&yr.alternate===null&&t(z,xe),A=p(yr,A,ye),ve===null?fe=yr:ve.sibling=yr,ve=yr,xe=at}if(Pe.done)return o(z,xe),Ue&&Fr(z,ye),fe;if(xe===null){for(;!Pe.done;ye++,Pe=$.next())Pe=K(z,Pe.value,X),Pe!==null&&(A=p(Pe,A,ye),ve===null?fe=Pe:ve.sibling=Pe,ve=Pe);return Ue&&Fr(z,ye),fe}for(xe=a(z,xe);!Pe.done;ye++,Pe=$.next())Pe=oe(xe,z,ye,Pe.value,X),Pe!==null&&(e&&Pe.alternate!==null&&xe.delete(Pe.key===null?ye:Pe.key),A=p(Pe,A,ye),ve===null?fe=Pe:ve.sibling=Pe,ve=Pe);return e&&xe.forEach(function(M0){return t(z,M0)}),Ue&&Fr(z,ye),fe}function qe(z,A,$,X){if(typeof $=="object"&&$!==null&&$.type===I&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case R:e:{for(var fe=$.key,ve=A;ve!==null;){if(ve.key===fe){if(fe=$.type,fe===I){if(ve.tag===7){o(z,ve.sibling),A=d(ve,$.props.children),A.return=z,z=A;break e}}else if(ve.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===B&&Np(fe)===ve.type){o(z,ve.sibling),A=d(ve,$.props),A.ref=Ni(z,ve,$),A.return=z,z=A;break e}o(z,ve);break}else t(z,ve);ve=ve.sibling}$.type===I?(A=Kr($.props.children,z.mode,X,$.key),A.return=z,z=A):(X=sl($.type,$.key,$.props,null,z.mode,X),X.ref=Ni(z,A,$),X.return=z,z=X)}return w(z);case N:e:{for(ve=$.key;A!==null;){if(A.key===ve)if(A.tag===4&&A.stateNode.containerInfo===$.containerInfo&&A.stateNode.implementation===$.implementation){o(z,A.sibling),A=d(A,$.children||[]),A.return=z,z=A;break e}else{o(z,A);break}else t(z,A);A=A.sibling}A=qc($,z.mode,X),A.return=z,z=A}return w(z);case B:return ve=$._init,qe(z,A,ve($._payload),X)}if(Mr($))return ce(z,A,$,X);if(q($))return ue(z,A,$,X);Is(z,$)}return typeof $=="string"&&$!==""||typeof $=="number"?($=""+$,A!==null&&A.tag===6?(o(z,A.sibling),A=d(A,$),A.return=z,z=A):(o(z,A),A=Yc($,z.mode,X),A.return=z,z=A),w(z)):o(z,A)}return qe}var Ro=Rp(!0),Pp=Rp(!1),Ls=ar(null),zs=null,Po=null,ic=null;function sc(){ic=Po=zs=null}function lc(e){var t=Ls.current;$e(Ls),e._currentValue=t}function ac(e,t,o){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===o)break;e=e.return}}function Do(e,t){zs=e,ic=Po=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Nt=!0),e.firstContext=null)}function Ht(e){var t=e._currentValue;if(ic!==e)if(e={context:e,memoizedValue:t,next:null},Po===null){if(zs===null)throw Error(i(308));Po=e,zs.dependencies={lanes:0,firstContext:e}}else Po=Po.next=e;return t}var $r=null;function cc(e){$r===null?$r=[e]:$r.push(e)}function Dp(e,t,o,a){var d=t.interleaved;return d===null?(o.next=o,cc(t)):(o.next=d.next,d.next=o),t.interleaved=o,Rn(e,a)}function Rn(e,t){e.lanes|=t;var o=e.alternate;for(o!==null&&(o.lanes|=t),o=e,e=e.return;e!==null;)e.childLanes|=t,o=e.alternate,o!==null&&(o.childLanes|=t),o=e,e=e.return;return o.tag===3?o.stateNode:null}var dr=!1;function uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Tp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Pn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fr(e,t,o){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Re&2)!==0){var d=a.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),a.pending=t,Rn(e,o)}return d=a.interleaved,d===null?(t.next=t,cc(a)):(t.next=d.next,d.next=t),a.interleaved=t,Rn(e,o)}function Fs(e,t,o){if(t=t.updateQueue,t!==null&&(t=t.shared,(o&4194240)!==0)){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,Ca(e,o)}}function Op(e,t){var o=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,o===a)){var d=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var w={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};p===null?d=p=w:p=p.next=w,o=o.next}while(o!==null);p===null?d=p=t:p=p.next=t}else d=p=t;o={baseState:a.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:a.shared,effects:a.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=t:e.next=t,o.lastBaseUpdate=t}function $s(e,t,o,a){var d=e.updateQueue;dr=!1;var p=d.firstBaseUpdate,w=d.lastBaseUpdate,_=d.shared.pending;if(_!==null){d.shared.pending=null;var O=_,U=O.next;O.next=null,w===null?p=U:w.next=U,w=O;var G=e.alternate;G!==null&&(G=G.updateQueue,_=G.lastBaseUpdate,_!==w&&(_===null?G.firstBaseUpdate=U:_.next=U,G.lastBaseUpdate=O))}if(p!==null){var K=d.baseState;w=0,G=U=O=null,_=p;do{var H=_.lane,oe=_.eventTime;if((a&H)===H){G!==null&&(G=G.next={eventTime:oe,lane:0,tag:_.tag,payload:_.payload,callback:_.callback,next:null});e:{var ce=e,ue=_;switch(H=t,oe=o,ue.tag){case 1:if(ce=ue.payload,typeof ce=="function"){K=ce.call(oe,K,H);break e}K=ce;break e;case 3:ce.flags=ce.flags&-65537|128;case 0:if(ce=ue.payload,H=typeof ce=="function"?ce.call(oe,K,H):ce,H==null)break e;K=F({},K,H);break e;case 2:dr=!0}}_.callback!==null&&_.lane!==0&&(e.flags|=64,H=d.effects,H===null?d.effects=[_]:H.push(_))}else oe={eventTime:oe,lane:H,tag:_.tag,payload:_.payload,callback:_.callback,next:null},G===null?(U=G=oe,O=K):G=G.next=oe,w|=H;if(_=_.next,_===null){if(_=d.shared.pending,_===null)break;H=_,_=H.next,H.next=null,d.lastBaseUpdate=H,d.shared.pending=null}}while(!0);if(G===null&&(O=K),d.baseState=O,d.firstBaseUpdate=U,d.lastBaseUpdate=G,t=d.shared.interleaved,t!==null){d=t;do w|=d.lane,d=d.next;while(d!==t)}else p===null&&(d.shared.lanes=0);Wr|=w,e.lanes=w,e.memoizedState=K}}function Mp(e,t,o){if(e=t.effects,t.effects=null,e!==null)for(t=0;to?o:4,e(!0);var a=mc.transition;mc.transition={};try{e(!1),t()}finally{Ae=o,mc.transition=a}}function Zp(){return Gt().memoizedState}function o0(e,t,o){var a=gr(e);if(o={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null},eh(e))th(t,o);else if(o=Dp(e,t,o,a),o!==null){var d=jt();sn(o,e,a,d),nh(o,t,a)}}function i0(e,t,o){var a=gr(e),d={lane:a,action:o,hasEagerState:!1,eagerState:null,next:null};if(eh(e))th(t,d);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var w=t.lastRenderedState,_=p(w,o);if(d.hasEagerState=!0,d.eagerState=_,en(_,w)){var O=t.interleaved;O===null?(d.next=d,cc(t)):(d.next=O.next,O.next=d),t.interleaved=d;return}}catch{}finally{}o=Dp(e,t,d,a),o!==null&&(d=jt(),sn(o,e,a,d),nh(o,t,a))}}function eh(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function th(e,t){Ti=Ws=!0;var o=e.pending;o===null?t.next=t:(t.next=o.next,o.next=t),e.pending=t}function nh(e,t,o){if((o&4194240)!==0){var a=t.lanes;a&=e.pendingLanes,o|=a,t.lanes=o,Ca(e,o)}}var Gs={readContext:Ht,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},s0={readContext:Ht,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:Hp,useImperativeHandle:function(e,t,o){return o=o!=null?o.concat([e]):null,Vs(4194308,4,Qp.bind(null,t,e),o)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vs(4,2,e,t)},useMemo:function(e,t){var o=pn();return t=t===void 0?null:t,e=e(),o.memoizedState=[e,t],e},useReducer:function(e,t,o){var a=pn();return t=o!==void 0?o(t):t,a.memoizedState=a.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},a.queue=e,e=e.dispatch=o0.bind(null,Ve,e),[a.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:Wp,useDebugValue:kc,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=Wp(!1),t=e[0];return e=r0.bind(null,e[1]),pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,o){var a=Ve,d=pn();if(Ue){if(o===void 0)throw Error(i(407));o=o()}else{if(o=t(),lt===null)throw Error(i(349));(Br&30)!==0||zp(a,t,o)}d.memoizedState=o;var p={value:o,getSnapshot:t};return d.queue=p,Hp($p.bind(null,a,p,e),[e]),a.flags|=2048,Ai(9,Fp.bind(null,a,p,o,t),void 0,null),o},useId:function(){var e=pn(),t=lt.identifierPrefix;if(Ue){var o=Nn,a=_n;o=(a&~(1<<32-Zt(a)-1)).toString(32)+o,t=":"+t+"R"+o,o=Oi++,0<\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=w.createElement(o,{is:a.is}):(e=w.createElement(o),o==="select"&&(w=e,a.multiple?w.multiple=!0:a.size&&(w.size=a.size))):e=w.createElementNS(e,o),e[dn]=t,e[Ci]=a,kh(e,t,!1,!1),t.stateNode=e;e:{switch(w=ha(o,a),o){case"dialog":Fe("cancel",e),Fe("close",e),d=a;break;case"iframe":case"object":case"embed":Fe("load",e),d=a;break;case"video":case"audio":for(d=0;dAo&&(t.flags|=128,a=!0,Mi(p,!1),t.lanes=4194304)}else{if(!a)if(e=Us(w),e!==null){if(t.flags|=128,a=!0,o=e.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),Mi(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Ue)return xt(t),null}else 2*Ye()-p.renderingStartTime>Ao&&o!==1073741824&&(t.flags|=128,a=!0,Mi(p,!1),t.lanes=4194304);p.isBackwards?(w.sibling=t.child,t.child=w):(o=p.last,o!==null?o.sibling=w:t.child=w,p.last=w)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=Ye(),t.sibling=null,o=We.current,Le(We,a?o&1|2:o&1),t):(xt(t),null);case 22:case 23:return Gc(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?($t&1073741824)!==0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function h0(e,t){switch(tc(t),t.tag){case 1:return _t(t.type)&&Ps(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Do(),$e(Et),$e(gt),hc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return fc(t),null;case 13:if($e(We),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));_o()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(We),null;case 4:return Do(),null;case 10:return lc(t.type._context),null;case 22:case 23:return Gc(),null;case 24:return null;default:return null}}var qs=!1,yt=!1,m0=typeof WeakSet=="function"?WeakSet:Set,le=null;function Oo(e,t){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(a){Ke(e,t,a)}else o.current=null}function Mc(e,t,o){try{o()}catch(a){Ke(e,t,a)}}var Sh=!1;function g0(e,t){if(Ga=gs,e=rp(),za(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var a=o.getSelection&&o.getSelection();if(a&&a.rangeCount!==0){o=a.anchorNode;var d=a.anchorOffset,p=a.focusNode;a=a.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var w=0,_=-1,O=-1,U=0,G=0,K=e,H=null;t:for(;;){for(var oe;K!==o||d!==0&&K.nodeType!==3||(_=w+d),K!==p||a!==0&&K.nodeType!==3||(O=w+a),K.nodeType===3&&(w+=K.nodeValue.length),(oe=K.firstChild)!==null;)H=K,K=oe;for(;;){if(K===e)break t;if(H===o&&++U===d&&(_=w),H===p&&++G===a&&(O=w),(oe=K.nextSibling)!==null)break;K=H,H=K.parentNode}K=oe}o=_===-1||O===-1?null:{start:_,end:O}}else o=null}o=o||{start:0,end:0}}else o=null;for(Ka={focusedElem:e,selectionRange:o},gs=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var ce=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ce!==null){var ue=ce.memoizedProps,qe=ce.memoizedState,z=t.stateNode,A=z.getSnapshotBeforeUpdate(t.elementType===t.type?ue:nn(t.type,ue),qe);z.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var $=t.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(X){Ke(t,t.return,X)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return ce=Sh,Sh=!1,ce}function Ai(e,t,o){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Mc(t,o,p)}d=d.next}while(d!==a)}}function Xs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var o=t=t.next;do{if((o.tag&e)===e){var a=o.create;o.destroy=a()}o=o.next}while(o!==t)}}function Ac(e){var t=e.ref;if(t!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof t=="function"?t(e):t.current=e}}function Eh(e){var t=e.alternate;t!==null&&(e.alternate=null,Eh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dn],delete t[Ci],delete t[Xa],delete t[Jw],delete t[Zw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function _h(e){return e.tag===5||e.tag===3||e.tag===4}function Nh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_h(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ic(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?o.nodeType===8?o.parentNode.insertBefore(e,t):o.insertBefore(e,t):(o.nodeType===8?(t=o.parentNode,t.insertBefore(e,o)):(t=o,t.appendChild(e)),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=Ns));else if(a!==4&&(e=e.child,e!==null))for(Ic(e,t,o),e=e.sibling;e!==null;)Ic(e,t,o),e=e.sibling}function Lc(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Lc(e,t,o),e=e.sibling;e!==null;)Lc(e,t,o),e=e.sibling}var ft=null,rn=!1;function pr(e,t,o){for(o=o.child;o!==null;)Rh(e,t,o),o=o.sibling}function Rh(e,t,o){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(us,o)}catch{}switch(o.tag){case 5:yt||Oo(o,t);case 6:var a=ft,d=rn;ft=null,pr(e,t,o),ft=a,rn=d,ft!==null&&(rn?(e=ft,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):ft.removeChild(o.stateNode));break;case 18:ft!==null&&(rn?(e=ft,o=o.stateNode,e.nodeType===8?qa(e.parentNode,o):e.nodeType===1&&qa(e,o),pi(e)):qa(ft,o.stateNode));break;case 4:a=ft,d=rn,ft=o.stateNode.containerInfo,rn=!0,pr(e,t,o),ft=a,rn=d;break;case 0:case 11:case 14:case 15:if(!yt&&(a=o.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){d=a=a.next;do{var p=d,w=p.destroy;p=p.tag,w!==void 0&&((p&2)!==0||(p&4)!==0)&&Mc(o,t,w),d=d.next}while(d!==a)}pr(e,t,o);break;case 1:if(!yt&&(Oo(o,t),a=o.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=o.memoizedProps,a.state=o.memoizedState,a.componentWillUnmount()}catch(_){Ke(o,t,_)}pr(e,t,o);break;case 21:pr(e,t,o);break;case 22:o.mode&1?(yt=(a=yt)||o.memoizedState!==null,pr(e,t,o),yt=a):pr(e,t,o);break;default:pr(e,t,o)}}function Ph(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new m0),t.forEach(function(a){var d=S0.bind(null,e,a);o.has(a)||(o.add(a),a.then(d,d))})}}function on(e,t){var o=t.deletions;if(o!==null)for(var a=0;ad&&(d=w),a&=~p}if(a=d,a=Ye()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*x0(a/1960))-a,10e?16:e,mr===null)var a=!1;else{if(e=mr,mr=null,nl=0,(Re&6)!==0)throw Error(i(331));var d=Re;for(Re|=4,le=e.current;le!==null;){var p=le,w=p.child;if((le.flags&16)!==0){var _=p.deletions;if(_!==null){for(var O=0;O<_.length;O++){var U=_[O];for(le=U;le!==null;){var G=le;switch(G.tag){case 0:case 11:case 15:Ai(8,G,p)}var K=G.child;if(K!==null)K.return=G,le=K;else for(;le!==null;){G=le;var H=G.sibling,oe=G.return;if(Eh(G),G===U){le=null;break}if(H!==null){H.return=oe,le=H;break}le=oe}}}var ce=p.alternate;if(ce!==null){var ue=ce.child;if(ue!==null){ce.child=null;do{var qe=ue.sibling;ue.sibling=null,ue=qe}while(ue!==null)}}le=p}}if((p.subtreeFlags&2064)!==0&&w!==null)w.return=p,le=w;else e:for(;le!==null;){if(p=le,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Ai(9,p,p.return)}var z=p.sibling;if(z!==null){z.return=p.return,le=z;break e}le=p.return}}var A=e.current;for(le=A;le!==null;){w=le;var $=w.child;if((w.subtreeFlags&2064)!==0&&$!==null)$.return=w,le=$;else e:for(w=A;le!==null;){if(_=le,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Xs(9,_)}}catch(fe){Ke(_,_.return,fe)}if(_===w){le=null;break e}var X=_.sibling;if(X!==null){X.return=_.return,le=X;break e}le=_.return}}if(Re=d,ur(),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(us,e)}catch{}a=!0}return a}finally{Ae=o,Kt.transition=t}}return!1}function Bh(e,t,o){t=To(o,t),t=sh(e,t,1),e=fr(e,t,1),t=jt(),e!==null&&(ai(e,1,t),Pt(e,t))}function Ke(e,t,o){if(e.tag===3)Bh(e,e,o);else for(;t!==null;){if(t.tag===3){Bh(t,e,o);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(hr===null||!hr.has(a))){e=To(o,e),e=lh(t,e,1),t=fr(t,e,1),e=jt(),t!==null&&(ai(t,1,e),Pt(t,e));break}}t=t.return}}function j0(e,t,o){var a=e.pingCache;a!==null&&a.delete(t),t=jt(),e.pingedLanes|=e.suspendedLanes&o,lt===e&&(pt&o)===o&&(rt===4||rt===3&&(pt&130023424)===pt&&500>Ye()-$c?Hr(e,0):Fc|=o),Pt(e,t)}function Wh(e,t){t===0&&((e.mode&1)===0?t=1:(t=fs,fs<<=1,(fs&130023424)===0&&(fs=4194304)));var o=jt();e=Rn(e,t),e!==null&&(ai(e,t,o),Pt(e,o))}function C0(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),Wh(e,o)}function S0(e,t){var o=0;switch(e.tag){case 13:var a=e.stateNode,d=e.memoizedState;d!==null&&(o=d.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(i(314))}a!==null&&a.delete(t),Wh(e,o)}var Vh;Vh=function(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)Nt=!0;else{if((e.lanes&o)===0&&(t.flags&128)===0)return Nt=!1,f0(e,t,o);Nt=(e.flags&131072)!==0}else Nt=!1,Ue&&(t.flags&1048576)!==0&&jp(t,Ms,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;Ys(e,t),e=t.pendingProps;var d=Co(t,gt.current);Po(t,o),d=vc(null,t,a,e,d,o);var p=xc();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(a)?(p=!0,Ds(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,uc(t),d.updater=Ks,t.stateNode=d,d._reactInternals=t,Cc(t,a,e,o),t=Nc(null,t,a,!0,p,o)):(t.tag=0,Ue&&p&&ec(t),kt(null,t,d,o),t=t.child),t;case 16:a=t.elementType;e:{switch(Ys(e,t),e=t.pendingProps,d=a._init,a=d(a._payload),t.type=a,d=t.tag=_0(a),e=nn(a,e),d){case 0:t=_c(null,t,a,e,o);break e;case 1:t=gh(null,t,a,e,o);break e;case 11:t=dh(null,t,a,e,o);break e;case 14:t=fh(null,t,a,nn(a.type,e),o);break e}throw Error(i(306,a,""))}return t;case 0:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),_c(e,t,a,d,o);case 1:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),gh(e,t,a,d,o);case 3:e:{if(vh(t),e===null)throw Error(i(387));a=t.pendingProps,p=t.memoizedState,d=p.element,Tp(e,t),$s(t,a,null,o);var w=t.memoizedState;if(a=w.element,p.isDehydrated)if(p={element:a,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=To(Error(i(423)),t),t=xh(e,t,a,o,d);break e}else if(a!==d){d=To(Error(i(424)),t),t=xh(e,t,a,o,d);break e}else for(Ft=lr(t.stateNode.containerInfo.firstChild),zt=t,Ue=!0,tn=null,o=Pp(t,null,a,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(_o(),a===d){t=Dn(e,t,o);break e}kt(e,t,a,o)}t=t.child}return t;case 5:return Ap(t),e===null&&rc(t),a=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,w=d.children,Qa(a,d)?w=null:p!==null&&Qa(a,p)&&(t.flags|=32),mh(e,t),kt(e,t,w,o),t.child;case 6:return e===null&&rc(t),null;case 13:return yh(e,t,o);case 4:return dc(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=No(t,null,a,o):kt(e,t,a,o),t.child;case 11:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),dh(e,t,a,d,o);case 7:return kt(e,t,t.pendingProps,o),t.child;case 8:return kt(e,t,t.pendingProps.children,o),t.child;case 12:return kt(e,t,t.pendingProps.children,o),t.child;case 10:e:{if(a=t.type._context,d=t.pendingProps,p=t.memoizedProps,w=d.value,Le(Ls,a._currentValue),a._currentValue=w,p!==null)if(en(p.value,w)){if(p.children===d.children&&!Et.current){t=Dn(e,t,o);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var _=p.dependencies;if(_!==null){w=p.child;for(var O=_.firstContext;O!==null;){if(O.context===a){if(p.tag===1){O=Pn(-1,o&-o),O.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var G=U.pending;G===null?O.next=O:(O.next=G.next,G.next=O),U.pending=O}}p.lanes|=o,O=p.alternate,O!==null&&(O.lanes|=o),ac(p.return,o,t),_.lanes|=o;break}O=O.next}}else if(p.tag===10)w=p.type===t.type?null:p.child;else if(p.tag===18){if(w=p.return,w===null)throw Error(i(341));w.lanes|=o,_=w.alternate,_!==null&&(_.lanes|=o),ac(w,o,t),w=p.sibling}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===t){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}kt(e,t,d.children,o),t=t.child}return t;case 9:return d=t.type,a=t.pendingProps.children,Po(t,o),d=Ht(d),a=a(d),t.flags|=1,kt(e,t,a,o),t.child;case 14:return a=t.type,d=nn(a,t.pendingProps),d=nn(a.type,d),fh(e,t,a,d,o);case 15:return ph(e,t,t.type,t.pendingProps,o);case 17:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),Ys(e,t),t.tag=1,_t(a)?(e=!0,Ds(t)):e=!1,Po(t,o),oh(t,a,d),Cc(t,a,d,o),Nc(null,t,a,!0,e,o);case 19:return bh(e,t,o);case 22:return hh(e,t,o)}throw Error(i(156,t.tag))};function Hh(e,t){return Cf(e,t)}function E0(e,t,o,a){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,o,a){return new E0(e,t,o,a)}function Qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _0(e){if(typeof e=="function")return Qc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ne)return 11;if(e===ie)return 14}return 2}function xr(e,t){var o=e.alternate;return o===null?(o=Qt(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function sl(e,t,o,a,d,p){var w=2;if(a=e,typeof e=="function")Qc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case I:return Kr(o.children,d,p,t);case L:w=8,d|=8;break;case Q:return e=Qt(12,o,t,d|2),e.elementType=Q,e.lanes=p,e;case de:return e=Qt(13,o,t,d),e.elementType=de,e.lanes=p,e;case re:return e=Qt(19,o,t,d),e.elementType=re,e.lanes=p,e;case Z:return ll(o,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ee:w=10;break e;case J:w=9;break e;case ne:w=11;break e;case ie:w=14;break e;case B:w=16,a=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Qt(w,o,t,d),t.elementType=e,t.type=a,t.lanes=p,t}function Kr(e,t,o,a){return e=Qt(7,e,a,t),e.lanes=o,e}function ll(e,t,o,a){return e=Qt(22,e,a,t),e.elementType=Z,e.lanes=o,e.stateNode={isHidden:!1},e}function Yc(e,t,o){return e=Qt(6,e,null,t),e.lanes=o,e}function qc(e,t,o){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function N0(e,t,o,a,d){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ja(0),this.expirationTimes=ja(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ja(0),this.identifierPrefix=a,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Xc(e,t,o,a,d,p,w,_,O){return e=new N0(e,t,o,_,O),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Qt(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:a,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},uc(p),e}function R0(e,t,o){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),ou.exports=W0(),ou.exports}var am;function V0(){if(am)return hl;am=1;var n=ug();return hl.createRoot=n.createRoot,hl.hydrateRoot=n.hydrateRoot,hl}var H0=V0(),ed=ug();/** +`+p.stack}return{value:e,source:t,stack:d,digest:null}}function Sc(e,t,o){return{value:e,source:null,stack:o??null,digest:t??null}}function Ec(e,t){try{console.error(t.value)}catch(o){setTimeout(function(){throw o})}}var c0=typeof WeakMap=="function"?WeakMap:Map;function sh(e,t,o){o=Pn(-1,o),o.tag=3,o.payload={element:null};var a=t.value;return o.callback=function(){el||(el=!0,Uc=a),Ec(e,t)},o}function lh(e,t,o){o=Pn(-1,o),o.tag=3;var a=e.type.getDerivedStateFromError;if(typeof a=="function"){var d=t.value;o.payload=function(){return a(d)},o.callback=function(){Ec(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(o.callback=function(){Ec(e,t),typeof a!="function"&&(hr===null?hr=new Set([this]):hr.add(this));var w=t.stack;this.componentDidCatch(t.value,{componentStack:w!==null?w:""})}),o}function ah(e,t,o){var a=e.pingCache;if(a===null){a=e.pingCache=new c0;var d=new Set;a.set(t,d)}else d=a.get(t),d===void 0&&(d=new Set,a.set(t,d));d.has(o)||(d.add(o),e=j0.bind(null,e,t,o),t.then(e,e))}function ch(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function uh(e,t,o,a,d){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(t=Pn(-1,1),t.tag=2,fr(o,t,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=d,e)}var u0=P.ReactCurrentOwner,Nt=!1;function kt(e,t,o,a){t.child=e===null?Pp(t,null,o,a):Ro(t,e.child,o,a)}function dh(e,t,o,a,d){o=o.render;var p=t.ref;return Do(t,d),a=vc(e,t,o,a,p,d),o=xc(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Dn(e,t,d)):(Ue&&o&&ec(t),t.flags|=1,kt(e,t,a,d),t.child)}function fh(e,t,o,a,d){if(e===null){var p=o.type;return typeof p=="function"&&!Qc(p)&&p.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(t.tag=15,t.type=p,ph(e,t,p,a,d)):(e=sl(o.type,null,a,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&d)===0){var w=p.memoizedProps;if(o=o.compare,o=o!==null?o:bi,o(w,a)&&e.ref===t.ref)return Dn(e,t,d)}return t.flags|=1,e=xr(p,a),e.ref=t.ref,e.return=t,t.child=e}function ph(e,t,o,a,d){if(e!==null){var p=e.memoizedProps;if(bi(p,a)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=a=p,(e.lanes&d)!==0)(e.flags&131072)!==0&&(Nt=!0);else return t.lanes=e.lanes,Dn(e,t,d)}return _c(e,t,o,a,d)}function hh(e,t,o){var a=t.pendingProps,d=a.children,p=e!==null?e.memoizedState:null;if(a.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(Ao,$t),$t|=o;else{if((o&1073741824)===0)return e=p!==null?p.baseLanes|o:o,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Le(Ao,$t),$t|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},a=p!==null?p.baseLanes:o,Le(Ao,$t),$t|=a}else p!==null?(a=p.baseLanes|o,t.memoizedState=null):a=o,Le(Ao,$t),$t|=a;return kt(e,t,d,o),t.child}function mh(e,t){var o=t.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(t.flags|=512,t.flags|=2097152)}function _c(e,t,o,a,d){var p=_t(o)?Lr:gt.current;return p=So(t,p),Do(t,d),o=vc(e,t,o,a,p,d),a=xc(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~d,Dn(e,t,d)):(Ue&&a&&ec(t),t.flags|=1,kt(e,t,o,d),t.child)}function gh(e,t,o,a,d){if(_t(o)){var p=!0;Ds(t)}else p=!1;if(Do(t,d),t.stateNode===null)Ys(e,t),oh(t,o,a),Cc(t,o,a,d),a=!0;else if(e===null){var w=t.stateNode,_=t.memoizedProps;w.props=_;var O=w.context,U=o.contextType;typeof U=="object"&&U!==null?U=Ht(U):(U=_t(o)?Lr:gt.current,U=So(t,U));var G=o.getDerivedStateFromProps,K=typeof G=="function"||typeof w.getSnapshotBeforeUpdate=="function";K||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==a||O!==U)&&ih(t,w,a,U),dr=!1;var H=t.memoizedState;w.state=H,$s(t,a,w,d),O=t.memoizedState,_!==a||H!==O||Et.current||dr?(typeof G=="function"&&(jc(t,o,G,a),O=t.memoizedState),(_=dr||rh(t,o,_,a,H,O,U))?(K||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(t.flags|=4194308)):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=O),w.props=a,w.state=O,w.context=U,a=_):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{w=t.stateNode,Tp(e,t),_=t.memoizedProps,U=t.type===t.elementType?_:nn(t.type,_),w.props=U,K=t.pendingProps,H=w.context,O=o.contextType,typeof O=="object"&&O!==null?O=Ht(O):(O=_t(o)?Lr:gt.current,O=So(t,O));var oe=o.getDerivedStateFromProps;(G=typeof oe=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==K||H!==O)&&ih(t,w,a,O),dr=!1,H=t.memoizedState,w.state=H,$s(t,a,w,d);var ce=t.memoizedState;_!==K||H!==ce||Et.current||dr?(typeof oe=="function"&&(jc(t,o,oe,a),ce=t.memoizedState),(U=dr||rh(t,o,U,a,H,ce,O)||!1)?(G||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(a,ce,O),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(a,ce,O)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=ce),w.props=a,w.state=ce,w.context=O,a=U):(typeof w.componentDidUpdate!="function"||_===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),a=!1)}return Nc(e,t,o,a,p,d)}function Nc(e,t,o,a,d,p){mh(e,t);var w=(t.flags&128)!==0;if(!a&&!w)return d&&bp(t,o,!1),Dn(e,t,p);a=t.stateNode,u0.current=t;var _=w&&typeof o.getDerivedStateFromError!="function"?null:a.render();return t.flags|=1,e!==null&&w?(t.child=Ro(t,e.child,null,p),t.child=Ro(t,null,_,p)):kt(e,t,_,p),t.memoizedState=a.state,d&&bp(t,o,!0),t.child}function vh(e){var t=e.stateNode;t.pendingContext?yp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&yp(e,t.context,!1),dc(e,t.containerInfo)}function xh(e,t,o,a,d){return No(),oc(d),t.flags|=256,kt(e,t,o,a),t.child}var Rc={dehydrated:null,treeContext:null,retryLane:0};function Pc(e){return{baseLanes:e,cachePool:null,transitions:null}}function yh(e,t,o){var a=t.pendingProps,d=We.current,p=!1,w=(t.flags&128)!==0,_;if((_=w)||(_=e!==null&&e.memoizedState===null?!1:(d&2)!==0),_?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(d|=1),Le(We,d&1),e===null)return rc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(w=a.children,e=a.fallback,p?(a=t.mode,p=t.child,w={mode:"hidden",children:w},(a&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=w):p=ll(w,a,0,null),e=Kr(e,a,o,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Pc(o),t.memoizedState=Rc,e):Dc(t,w));if(d=e.memoizedState,d!==null&&(_=d.dehydrated,_!==null))return d0(e,t,w,a,_,d,o);if(p){p=a.fallback,w=t.mode,d=e.child,_=d.sibling;var O={mode:"hidden",children:a.children};return(w&1)===0&&t.child!==d?(a=t.child,a.childLanes=0,a.pendingProps=O,t.deletions=null):(a=xr(d,O),a.subtreeFlags=d.subtreeFlags&14680064),_!==null?p=xr(_,p):(p=Kr(p,w,o,null),p.flags|=2),p.return=t,a.return=t,a.sibling=p,t.child=a,a=p,p=t.child,w=e.child.memoizedState,w=w===null?Pc(o):{baseLanes:w.baseLanes|o,cachePool:null,transitions:w.transitions},p.memoizedState=w,p.childLanes=e.childLanes&~o,t.memoizedState=Rc,a}return p=e.child,e=p.sibling,a=xr(p,{mode:"visible",children:a.children}),(t.mode&1)===0&&(a.lanes=o),a.return=t,a.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=a,t.memoizedState=null,a}function Dc(e,t){return t=ll({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Qs(e,t,o,a){return a!==null&&oc(a),Ro(t,e.child,null,o),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function d0(e,t,o,a,d,p,w){if(o)return t.flags&256?(t.flags&=-257,a=Sc(Error(i(422))),Qs(e,t,w,a)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=a.fallback,d=t.mode,a=ll({mode:"visible",children:a.children},d,0,null),p=Kr(p,d,w,null),p.flags|=2,a.return=t,p.return=t,a.sibling=p,t.child=a,(t.mode&1)!==0&&Ro(t,e.child,null,w),t.child.memoizedState=Pc(w),t.memoizedState=Rc,p);if((t.mode&1)===0)return Qs(e,t,w,null);if(d.data==="$!"){if(a=d.nextSibling&&d.nextSibling.dataset,a)var _=a.dgst;return a=_,p=Error(i(419)),a=Sc(p,a,void 0),Qs(e,t,w,a)}if(_=(w&e.childLanes)!==0,Nt||_){if(a=lt,a!==null){switch(w&-w){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(a.suspendedLanes|w))!==0?0:d,d!==0&&d!==p.retryLane&&(p.retryLane=d,Rn(e,d),sn(a,e,d,-1))}return Kc(),a=Sc(Error(i(421))),Qs(e,t,w,a)}return d.data==="$?"?(t.flags|=128,t.child=e.child,t=C0.bind(null,e),d._reactRetry=t,null):(e=p.treeContext,Ft=lr(d.nextSibling),zt=t,Ue=!0,tn=null,e!==null&&(Wt[Vt++]=_n,Wt[Vt++]=Nn,Wt[Vt++]=zr,_n=e.id,Nn=e.overflow,zr=t),t=Dc(t,a.children),t.flags|=4096,t)}function wh(e,t,o){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),ac(e.return,t,o)}function Tc(e,t,o,a,d){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:o,tailMode:d}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=a,p.tail=o,p.tailMode=d)}function bh(e,t,o){var a=t.pendingProps,d=a.revealOrder,p=a.tail;if(kt(e,t,a.children,o),a=We.current,(a&2)!==0)a=a&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wh(e,o,t);else if(e.tag===19)wh(e,o,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}if(Le(We,a),(t.mode&1)===0)t.memoizedState=null;else switch(d){case"forwards":for(o=t.child,d=null;o!==null;)e=o.alternate,e!==null&&Us(e)===null&&(d=o),o=o.sibling;o=d,o===null?(d=t.child,t.child=null):(d=o.sibling,o.sibling=null),Tc(t,!1,d,o,p);break;case"backwards":for(o=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Us(e)===null){t.child=d;break}e=d.sibling,d.sibling=o,o=d,d=e}Tc(t,!0,o,null,p);break;case"together":Tc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ys(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Dn(e,t,o){if(e!==null&&(t.dependencies=e.dependencies),Wr|=t.lanes,(o&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,o=xr(e,e.pendingProps),t.child=o,o.return=t;e.sibling!==null;)e=e.sibling,o=o.sibling=xr(e,e.pendingProps),o.return=t;o.sibling=null}return t.child}function f0(e,t,o){switch(t.tag){case 3:vh(t),No();break;case 5:Ap(t);break;case 1:_t(t.type)&&Ds(t);break;case 4:dc(t,t.stateNode.containerInfo);break;case 10:var a=t.type._context,d=t.memoizedProps.value;Le(Ls,a._currentValue),a._currentValue=d;break;case 13:if(a=t.memoizedState,a!==null)return a.dehydrated!==null?(Le(We,We.current&1),t.flags|=128,null):(o&t.child.childLanes)!==0?yh(e,t,o):(Le(We,We.current&1),e=Dn(e,t,o),e!==null?e.sibling:null);Le(We,We.current&1);break;case 19:if(a=(o&t.childLanes)!==0,(e.flags&128)!==0){if(a)return bh(e,t,o);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Le(We,We.current),a)break;return null;case 22:case 23:return t.lanes=0,hh(e,t,o)}return Dn(e,t,o)}var kh,Oc,jh,Ch;kh=function(e,t){for(var o=t.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===t)break;for(;o.sibling===null;){if(o.return===null||o.return===t)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Oc=function(){},jh=function(e,t,o,a){var d=e.memoizedProps;if(d!==a){e=t.stateNode,Ur(fn.current);var p=null;switch(o){case"input":d=tt(e,d),a=tt(e,a),p=[];break;case"select":d=F({},d,{value:void 0}),a=F({},a,{value:void 0}),p=[];break;case"textarea":d=er(e,d),a=er(e,a),p=[];break;default:typeof d.onClick!="function"&&typeof a.onClick=="function"&&(e.onclick=Ns)}pa(o,a);var w;o=null;for(U in d)if(!a.hasOwnProperty(U)&&d.hasOwnProperty(U)&&d[U]!=null)if(U==="style"){var _=d[U];for(w in _)_.hasOwnProperty(w)&&(o||(o={}),o[w]="")}else U!=="dangerouslySetInnerHTML"&&U!=="children"&&U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&U!=="autoFocus"&&(c.hasOwnProperty(U)?p||(p=[]):(p=p||[]).push(U,null));for(U in a){var O=a[U];if(_=d!=null?d[U]:void 0,a.hasOwnProperty(U)&&O!==_&&(O!=null||_!=null))if(U==="style")if(_){for(w in _)!_.hasOwnProperty(w)||O&&O.hasOwnProperty(w)||(o||(o={}),o[w]="");for(w in O)O.hasOwnProperty(w)&&_[w]!==O[w]&&(o||(o={}),o[w]=O[w])}else o||(p||(p=[]),p.push(U,o)),o=O;else U==="dangerouslySetInnerHTML"?(O=O?O.__html:void 0,_=_?_.__html:void 0,O!=null&&_!==O&&(p=p||[]).push(U,O)):U==="children"?typeof O!="string"&&typeof O!="number"||(p=p||[]).push(U,""+O):U!=="suppressContentEditableWarning"&&U!=="suppressHydrationWarning"&&(c.hasOwnProperty(U)?(O!=null&&U==="onScroll"&&Fe("scroll",e),p||_===O||(p=[])):(p=p||[]).push(U,O))}o&&(p=p||[]).push("style",o);var U=p;(t.updateQueue=U)&&(t.flags|=4)}},Ch=function(e,t,o,a){o!==a&&(t.flags|=4)};function Ii(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var o=null;t!==null;)t.alternate!==null&&(o=t),t=t.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var a=null;o!==null;)o.alternate!==null&&(a=o),o=o.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function xt(e){var t=e.alternate!==null&&e.alternate.child===e.child,o=0,a=0;if(t)for(var d=e.child;d!==null;)o|=d.lanes|d.childLanes,a|=d.subtreeFlags&14680064,a|=d.flags&14680064,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)o|=d.lanes|d.childLanes,a|=d.subtreeFlags,a|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=a,e.childLanes=o,t}function p0(e,t,o){var a=t.pendingProps;switch(tc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xt(t),null;case 1:return _t(t.type)&&Ps(),xt(t),null;case 3:return a=t.stateNode,To(),$e(Et),$e(gt),hc(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(As(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tn!==null&&(Vc(tn),tn=null))),Oc(e,t),xt(t),null;case 5:fc(t);var d=Ur(Di.current);if(o=t.type,e!==null&&t.stateNode!=null)jh(e,t,o,a,d),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(t.stateNode===null)throw Error(i(166));return xt(t),null}if(e=Ur(fn.current),As(t)){a=t.stateNode,o=t.type;var p=t.memoizedProps;switch(a[dn]=t,a[Ei]=p,e=(t.mode&1)!==0,o){case"dialog":Fe("cancel",a),Fe("close",a);break;case"iframe":case"object":case"embed":Fe("load",a);break;case"video":case"audio":for(d=0;d<\/script>",e=e.removeChild(e.firstChild)):typeof a.is=="string"?e=w.createElement(o,{is:a.is}):(e=w.createElement(o),o==="select"&&(w=e,a.multiple?w.multiple=!0:a.size&&(w.size=a.size))):e=w.createElementNS(e,o),e[dn]=t,e[Ei]=a,kh(e,t,!1,!1),t.stateNode=e;e:{switch(w=ha(o,a),o){case"dialog":Fe("cancel",e),Fe("close",e),d=a;break;case"iframe":case"object":case"embed":Fe("load",e),d=a;break;case"video":case"audio":for(d=0;dIo&&(t.flags|=128,a=!0,Ii(p,!1),t.lanes=4194304)}else{if(!a)if(e=Us(w),e!==null){if(t.flags|=128,a=!0,o=e.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),Ii(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Ue)return xt(t),null}else 2*Ye()-p.renderingStartTime>Io&&o!==1073741824&&(t.flags|=128,a=!0,Ii(p,!1),t.lanes=4194304);p.isBackwards?(w.sibling=t.child,t.child=w):(o=p.last,o!==null?o.sibling=w:t.child=w,p.last=w)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=Ye(),t.sibling=null,o=We.current,Le(We,a?o&1|2:o&1),t):(xt(t),null);case 22:case 23:return Gc(),a=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==a&&(t.flags|=8192),a&&(t.mode&1)!==0?($t&1073741824)!==0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function h0(e,t){switch(tc(t),t.tag){case 1:return _t(t.type)&&Ps(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return To(),$e(Et),$e(gt),hc(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return fc(t),null;case 13:if($e(We),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));No()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(We),null;case 4:return To(),null;case 10:return lc(t.type._context),null;case 22:case 23:return Gc(),null;case 24:return null;default:return null}}var qs=!1,yt=!1,m0=typeof WeakSet=="function"?WeakSet:Set,le=null;function Mo(e,t){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(a){Ke(e,t,a)}else o.current=null}function Mc(e,t,o){try{o()}catch(a){Ke(e,t,a)}}var Sh=!1;function g0(e,t){if(Ga=gs,e=rp(),za(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var a=o.getSelection&&o.getSelection();if(a&&a.rangeCount!==0){o=a.anchorNode;var d=a.anchorOffset,p=a.focusNode;a=a.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var w=0,_=-1,O=-1,U=0,G=0,K=e,H=null;t:for(;;){for(var oe;K!==o||d!==0&&K.nodeType!==3||(_=w+d),K!==p||a!==0&&K.nodeType!==3||(O=w+a),K.nodeType===3&&(w+=K.nodeValue.length),(oe=K.firstChild)!==null;)H=K,K=oe;for(;;){if(K===e)break t;if(H===o&&++U===d&&(_=w),H===p&&++G===a&&(O=w),(oe=K.nextSibling)!==null)break;K=H,H=K.parentNode}K=oe}o=_===-1||O===-1?null:{start:_,end:O}}else o=null}o=o||{start:0,end:0}}else o=null;for(Ka={focusedElem:e,selectionRange:o},gs=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var ce=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ce!==null){var ue=ce.memoizedProps,qe=ce.memoizedState,z=t.stateNode,A=z.getSnapshotBeforeUpdate(t.elementType===t.type?ue:nn(t.type,ue),qe);z.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var $=t.stateNode.containerInfo;$.nodeType===1?$.textContent="":$.nodeType===9&&$.documentElement&&$.removeChild($.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(X){Ke(t,t.return,X)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return ce=Sh,Sh=!1,ce}function Li(e,t,o){var a=t.updateQueue;if(a=a!==null?a.lastEffect:null,a!==null){var d=a=a.next;do{if((d.tag&e)===e){var p=d.destroy;d.destroy=void 0,p!==void 0&&Mc(t,o,p)}d=d.next}while(d!==a)}}function Xs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var o=t=t.next;do{if((o.tag&e)===e){var a=o.create;o.destroy=a()}o=o.next}while(o!==t)}}function Ac(e){var t=e.ref;if(t!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof t=="function"?t(e):t.current=e}}function Eh(e){var t=e.alternate;t!==null&&(e.alternate=null,Eh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dn],delete t[Ei],delete t[Xa],delete t[Jw],delete t[Zw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function _h(e){return e.tag===5||e.tag===3||e.tag===4}function Nh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_h(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ic(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?o.nodeType===8?o.parentNode.insertBefore(e,t):o.insertBefore(e,t):(o.nodeType===8?(t=o.parentNode,t.insertBefore(e,o)):(t=o,t.appendChild(e)),o=o._reactRootContainer,o!=null||t.onclick!==null||(t.onclick=Ns));else if(a!==4&&(e=e.child,e!==null))for(Ic(e,t,o),e=e.sibling;e!==null;)Ic(e,t,o),e=e.sibling}function Lc(e,t,o){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?o.insertBefore(e,t):o.appendChild(e);else if(a!==4&&(e=e.child,e!==null))for(Lc(e,t,o),e=e.sibling;e!==null;)Lc(e,t,o),e=e.sibling}var ft=null,rn=!1;function pr(e,t,o){for(o=o.child;o!==null;)Rh(e,t,o),o=o.sibling}function Rh(e,t,o){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(us,o)}catch{}switch(o.tag){case 5:yt||Mo(o,t);case 6:var a=ft,d=rn;ft=null,pr(e,t,o),ft=a,rn=d,ft!==null&&(rn?(e=ft,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):ft.removeChild(o.stateNode));break;case 18:ft!==null&&(rn?(e=ft,o=o.stateNode,e.nodeType===8?qa(e.parentNode,o):e.nodeType===1&&qa(e,o),mi(e)):qa(ft,o.stateNode));break;case 4:a=ft,d=rn,ft=o.stateNode.containerInfo,rn=!0,pr(e,t,o),ft=a,rn=d;break;case 0:case 11:case 14:case 15:if(!yt&&(a=o.updateQueue,a!==null&&(a=a.lastEffect,a!==null))){d=a=a.next;do{var p=d,w=p.destroy;p=p.tag,w!==void 0&&((p&2)!==0||(p&4)!==0)&&Mc(o,t,w),d=d.next}while(d!==a)}pr(e,t,o);break;case 1:if(!yt&&(Mo(o,t),a=o.stateNode,typeof a.componentWillUnmount=="function"))try{a.props=o.memoizedProps,a.state=o.memoizedState,a.componentWillUnmount()}catch(_){Ke(o,t,_)}pr(e,t,o);break;case 21:pr(e,t,o);break;case 22:o.mode&1?(yt=(a=yt)||o.memoizedState!==null,pr(e,t,o),yt=a):pr(e,t,o);break;default:pr(e,t,o)}}function Ph(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new m0),t.forEach(function(a){var d=S0.bind(null,e,a);o.has(a)||(o.add(a),a.then(d,d))})}}function on(e,t){var o=t.deletions;if(o!==null)for(var a=0;ad&&(d=w),a&=~p}if(a=d,a=Ye()-a,a=(120>a?120:480>a?480:1080>a?1080:1920>a?1920:3e3>a?3e3:4320>a?4320:1960*x0(a/1960))-a,10e?16:e,mr===null)var a=!1;else{if(e=mr,mr=null,nl=0,(Re&6)!==0)throw Error(i(331));var d=Re;for(Re|=4,le=e.current;le!==null;){var p=le,w=p.child;if((le.flags&16)!==0){var _=p.deletions;if(_!==null){for(var O=0;O<_.length;O++){var U=_[O];for(le=U;le!==null;){var G=le;switch(G.tag){case 0:case 11:case 15:Li(8,G,p)}var K=G.child;if(K!==null)K.return=G,le=K;else for(;le!==null;){G=le;var H=G.sibling,oe=G.return;if(Eh(G),G===U){le=null;break}if(H!==null){H.return=oe,le=H;break}le=oe}}}var ce=p.alternate;if(ce!==null){var ue=ce.child;if(ue!==null){ce.child=null;do{var qe=ue.sibling;ue.sibling=null,ue=qe}while(ue!==null)}}le=p}}if((p.subtreeFlags&2064)!==0&&w!==null)w.return=p,le=w;else e:for(;le!==null;){if(p=le,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Li(9,p,p.return)}var z=p.sibling;if(z!==null){z.return=p.return,le=z;break e}le=p.return}}var A=e.current;for(le=A;le!==null;){w=le;var $=w.child;if((w.subtreeFlags&2064)!==0&&$!==null)$.return=w,le=$;else e:for(w=A;le!==null;){if(_=le,(_.flags&2048)!==0)try{switch(_.tag){case 0:case 11:case 15:Xs(9,_)}}catch(fe){Ke(_,_.return,fe)}if(_===w){le=null;break e}var X=_.sibling;if(X!==null){X.return=_.return,le=X;break e}le=_.return}}if(Re=d,ur(),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(us,e)}catch{}a=!0}return a}finally{Ae=o,Kt.transition=t}}return!1}function Bh(e,t,o){t=Oo(o,t),t=sh(e,t,1),e=fr(e,t,1),t=jt(),e!==null&&(ui(e,1,t),Pt(e,t))}function Ke(e,t,o){if(e.tag===3)Bh(e,e,o);else for(;t!==null;){if(t.tag===3){Bh(t,e,o);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(hr===null||!hr.has(a))){e=Oo(o,e),e=lh(t,e,1),t=fr(t,e,1),e=jt(),t!==null&&(ui(t,1,e),Pt(t,e));break}}t=t.return}}function j0(e,t,o){var a=e.pingCache;a!==null&&a.delete(t),t=jt(),e.pingedLanes|=e.suspendedLanes&o,lt===e&&(pt&o)===o&&(rt===4||rt===3&&(pt&130023424)===pt&&500>Ye()-$c?Hr(e,0):Fc|=o),Pt(e,t)}function Wh(e,t){t===0&&((e.mode&1)===0?t=1:(t=fs,fs<<=1,(fs&130023424)===0&&(fs=4194304)));var o=jt();e=Rn(e,t),e!==null&&(ui(e,t,o),Pt(e,o))}function C0(e){var t=e.memoizedState,o=0;t!==null&&(o=t.retryLane),Wh(e,o)}function S0(e,t){var o=0;switch(e.tag){case 13:var a=e.stateNode,d=e.memoizedState;d!==null&&(o=d.retryLane);break;case 19:a=e.stateNode;break;default:throw Error(i(314))}a!==null&&a.delete(t),Wh(e,o)}var Vh;Vh=function(e,t,o){if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)Nt=!0;else{if((e.lanes&o)===0&&(t.flags&128)===0)return Nt=!1,f0(e,t,o);Nt=(e.flags&131072)!==0}else Nt=!1,Ue&&(t.flags&1048576)!==0&&jp(t,Ms,t.index);switch(t.lanes=0,t.tag){case 2:var a=t.type;Ys(e,t),e=t.pendingProps;var d=So(t,gt.current);Do(t,o),d=vc(null,t,a,e,d,o);var p=xc();return t.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_t(a)?(p=!0,Ds(t)):p=!1,t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,uc(t),d.updater=Ks,t.stateNode=d,d._reactInternals=t,Cc(t,a,e,o),t=Nc(null,t,a,!0,p,o)):(t.tag=0,Ue&&p&&ec(t),kt(null,t,d,o),t=t.child),t;case 16:a=t.elementType;e:{switch(Ys(e,t),e=t.pendingProps,d=a._init,a=d(a._payload),t.type=a,d=t.tag=_0(a),e=nn(a,e),d){case 0:t=_c(null,t,a,e,o);break e;case 1:t=gh(null,t,a,e,o);break e;case 11:t=dh(null,t,a,e,o);break e;case 14:t=fh(null,t,a,nn(a.type,e),o);break e}throw Error(i(306,a,""))}return t;case 0:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),_c(e,t,a,d,o);case 1:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),gh(e,t,a,d,o);case 3:e:{if(vh(t),e===null)throw Error(i(387));a=t.pendingProps,p=t.memoizedState,d=p.element,Tp(e,t),$s(t,a,null,o);var w=t.memoizedState;if(a=w.element,p.isDehydrated)if(p={element:a,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){d=Oo(Error(i(423)),t),t=xh(e,t,a,o,d);break e}else if(a!==d){d=Oo(Error(i(424)),t),t=xh(e,t,a,o,d);break e}else for(Ft=lr(t.stateNode.containerInfo.firstChild),zt=t,Ue=!0,tn=null,o=Pp(t,null,a,o),t.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(No(),a===d){t=Dn(e,t,o);break e}kt(e,t,a,o)}t=t.child}return t;case 5:return Ap(t),e===null&&rc(t),a=t.type,d=t.pendingProps,p=e!==null?e.memoizedProps:null,w=d.children,Qa(a,d)?w=null:p!==null&&Qa(a,p)&&(t.flags|=32),mh(e,t),kt(e,t,w,o),t.child;case 6:return e===null&&rc(t),null;case 13:return yh(e,t,o);case 4:return dc(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Ro(t,null,a,o):kt(e,t,a,o),t.child;case 11:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),dh(e,t,a,d,o);case 7:return kt(e,t,t.pendingProps,o),t.child;case 8:return kt(e,t,t.pendingProps.children,o),t.child;case 12:return kt(e,t,t.pendingProps.children,o),t.child;case 10:e:{if(a=t.type._context,d=t.pendingProps,p=t.memoizedProps,w=d.value,Le(Ls,a._currentValue),a._currentValue=w,p!==null)if(en(p.value,w)){if(p.children===d.children&&!Et.current){t=Dn(e,t,o);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var _=p.dependencies;if(_!==null){w=p.child;for(var O=_.firstContext;O!==null;){if(O.context===a){if(p.tag===1){O=Pn(-1,o&-o),O.tag=2;var U=p.updateQueue;if(U!==null){U=U.shared;var G=U.pending;G===null?O.next=O:(O.next=G.next,G.next=O),U.pending=O}}p.lanes|=o,O=p.alternate,O!==null&&(O.lanes|=o),ac(p.return,o,t),_.lanes|=o;break}O=O.next}}else if(p.tag===10)w=p.type===t.type?null:p.child;else if(p.tag===18){if(w=p.return,w===null)throw Error(i(341));w.lanes|=o,_=w.alternate,_!==null&&(_.lanes|=o),ac(w,o,t),w=p.sibling}else w=p.child;if(w!==null)w.return=p;else for(w=p;w!==null;){if(w===t){w=null;break}if(p=w.sibling,p!==null){p.return=w.return,w=p;break}w=w.return}p=w}kt(e,t,d.children,o),t=t.child}return t;case 9:return d=t.type,a=t.pendingProps.children,Do(t,o),d=Ht(d),a=a(d),t.flags|=1,kt(e,t,a,o),t.child;case 14:return a=t.type,d=nn(a,t.pendingProps),d=nn(a.type,d),fh(e,t,a,d,o);case 15:return ph(e,t,t.type,t.pendingProps,o);case 17:return a=t.type,d=t.pendingProps,d=t.elementType===a?d:nn(a,d),Ys(e,t),t.tag=1,_t(a)?(e=!0,Ds(t)):e=!1,Do(t,o),oh(t,a,d),Cc(t,a,d,o),Nc(null,t,a,!0,e,o);case 19:return bh(e,t,o);case 22:return hh(e,t,o)}throw Error(i(156,t.tag))};function Hh(e,t){return Cf(e,t)}function E0(e,t,o,a){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,o,a){return new E0(e,t,o,a)}function Qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _0(e){if(typeof e=="function")return Qc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ne)return 11;if(e===ie)return 14}return 2}function xr(e,t){var o=e.alternate;return o===null?(o=Qt(e.tag,t,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=t,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,t=e.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function sl(e,t,o,a,d,p){var w=2;if(a=e,typeof e=="function")Qc(e)&&(w=1);else if(typeof e=="string")w=5;else e:switch(e){case I:return Kr(o.children,d,p,t);case L:w=8,d|=8;break;case Q:return e=Qt(12,o,t,d|2),e.elementType=Q,e.lanes=p,e;case de:return e=Qt(13,o,t,d),e.elementType=de,e.lanes=p,e;case re:return e=Qt(19,o,t,d),e.elementType=re,e.lanes=p,e;case Z:return ll(o,d,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ee:w=10;break e;case J:w=9;break e;case ne:w=11;break e;case ie:w=14;break e;case B:w=16,a=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=Qt(w,o,t,d),t.elementType=e,t.type=a,t.lanes=p,t}function Kr(e,t,o,a){return e=Qt(7,e,a,t),e.lanes=o,e}function ll(e,t,o,a){return e=Qt(22,e,a,t),e.elementType=Z,e.lanes=o,e.stateNode={isHidden:!1},e}function Yc(e,t,o){return e=Qt(6,e,null,t),e.lanes=o,e}function qc(e,t,o){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=o,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function N0(e,t,o,a,d){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ja(0),this.expirationTimes=ja(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ja(0),this.identifierPrefix=a,this.onRecoverableError=d,this.mutableSourceEagerHydrationData=null}function Xc(e,t,o,a,d,p,w,_,O){return e=new N0(e,t,o,_,O),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Qt(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:a,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},uc(p),e}function R0(e,t,o){var a=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),ou.exports=W0(),ou.exports}var am;function V0(){if(am)return hl;am=1;var n=ug();return hl.createRoot=n.createRoot,hl.hydrateRoot=n.hydrateRoot,hl}var H0=V0(),ed=ug();/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+p.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Wi(){return Wi=Object.assign?Object.assign.bind():function(n){for(var r=1;r"u")throw new Error(r)}function dg(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function K0(){return Math.random().toString(36).substr(2,8)}function um(n,r){return{usr:n.state,key:n.key,idx:r}}function Cu(n,r,i,l){return i===void 0&&(i=null),Wi({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof r=="string"?Ko(r):r,{state:i,key:r&&r.key||l||K0()})}function Ol(n){let{pathname:r="/",search:i="",hash:l=""}=n;return i&&i!=="?"&&(r+=i.charAt(0)==="?"?i:"?"+i),l&&l!=="#"&&(r+=l.charAt(0)==="#"?l:"#"+l),r}function Ko(n){let r={};if(n){let i=n.indexOf("#");i>=0&&(r.hash=n.substr(i),n=n.substr(0,i));let l=n.indexOf("?");l>=0&&(r.search=n.substr(l),n=n.substr(0,l)),n&&(r.pathname=n)}return r}function Q0(n,r,i,l){l===void 0&&(l={});let{window:c=document.defaultView,v5Compat:u=!1}=l,f=c.history,h=jr.Pop,v=null,g=y();g==null&&(g=0,f.replaceState(Wi({},f.state,{idx:g}),""));function y(){return(f.state||{idx:null}).idx}function x(){h=jr.Pop;let C=y(),E=C==null?null:C-g;g=C,v&&v({action:h,location:S.location,delta:E})}function b(C,E){h=jr.Push;let D=Cu(S.location,C,E);g=y()+1;let T=um(D,g),P=S.createHref(D);try{f.pushState(T,"",P)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;c.location.assign(P)}u&&v&&v({action:h,location:S.location,delta:1})}function j(C,E){h=jr.Replace;let D=Cu(S.location,C,E);g=y();let T=um(D,g),P=S.createHref(D);f.replaceState(T,"",P),u&&v&&v({action:h,location:S.location,delta:0})}function k(C){let E=c.location.origin!=="null"?c.location.origin:c.location.href,D=typeof C=="string"?C:Ol(C);return D=D.replace(/ $/,"%20"),Ge(E,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,E)}let S={get action(){return h},get location(){return n(c,f)},listen(C){if(v)throw new Error("A history only accepts one active listener");return c.addEventListener(cm,x),v=C,()=>{c.removeEventListener(cm,x),v=null}},createHref(C){return r(c,C)},createURL:k,encodeLocation(C){let E=k(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:j,go(C){return f.go(C)}};return S}var dm;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(dm||(dm={}));function Y0(n,r,i){return i===void 0&&(i="/"),q0(n,r,i)}function q0(n,r,i,l){let c=typeof r=="string"?Ko(r):r,u=Vo(c.pathname||"/",i);if(u==null)return null;let f=fg(n);X0(f);let h=null;for(let v=0;h==null&&v{let v={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};v.relativePath.startsWith("/")&&(Ge(v.relativePath.startsWith(l),'Absolute route path "'+v.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),v.relativePath=v.relativePath.slice(l.length));let g=Cr([l,v.relativePath]),y=i.concat(v);u.children&&u.children.length>0&&(Ge(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),fg(u.children,r,y,g)),!(u.path==null&&!u.index)&&r.push({path:g,score:ob(g,u.index),routesMeta:y})};return n.forEach((u,f)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))c(u,f);else for(let v of pg(u.path))c(u,f,v)}),r}function pg(n){let r=n.split("/");if(r.length===0)return[];let[i,...l]=r,c=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return c?[u,""]:[u];let f=pg(l.join("/")),h=[];return h.push(...f.map(v=>v===""?u:[u,v].join("/"))),c&&h.push(...f),h.map(v=>n.startsWith("/")&&v===""?"/":v)}function X0(n){n.sort((r,i)=>r.score!==i.score?i.score-r.score:ib(r.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}const J0=/^:[\w-]+$/,Z0=3,eb=2,tb=1,nb=10,rb=-2,fm=n=>n==="*";function ob(n,r){let i=n.split("/"),l=i.length;return i.some(fm)&&(l+=rb),r&&(l+=eb),i.filter(c=>!fm(c)).reduce((c,u)=>c+(J0.test(u)?Z0:u===""?tb:nb),l)}function ib(n,r){return n.length===r.length&&n.slice(0,-1).every((l,c)=>l===r[c])?n[n.length-1]-r[r.length-1]:0}function sb(n,r,i){let{routesMeta:l}=n,c={},u="/",f=[];for(let h=0;h{let{paramName:b,isOptional:j}=y;if(b==="*"){let S=h[x]||"";f=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const k=h[x];return j&&!k?g[b]=void 0:g[b]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:n}}function lb(n,r,i){r===void 0&&(r=!1),i===void 0&&(i=!0),dg(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let l=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,v)=>(l.push({paramName:h,isOptional:v!=null}),v?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(l.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,r?void 0:"i"),l]}function ab(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return dg(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),n}}function Vo(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}function cb(n,r){r===void 0&&(r="/");let{pathname:i,search:l="",hash:c=""}=typeof n=="string"?Ko(n):n;return{pathname:i?i.startsWith("/")?i:ub(i,r):r,search:pb(l),hash:hb(c)}}function ub(n,r){let i=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function lu(n,r,i,l){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(l)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function db(n){return n.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function td(n,r){let i=db(n);return r?i.map((l,c)=>c===i.length-1?l.pathname:l.pathnameBase):i.map(l=>l.pathnameBase)}function nd(n,r,i,l){l===void 0&&(l=!1);let c;typeof n=="string"?c=Ko(n):(c=Wi({},n),Ge(!c.pathname||!c.pathname.includes("?"),lu("?","pathname","search",c)),Ge(!c.pathname||!c.pathname.includes("#"),lu("#","pathname","hash",c)),Ge(!c.search||!c.search.includes("#"),lu("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,h;if(f==null)h=i;else{let x=r.length-1;if(!l&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),x-=1;c.pathname=b.join("/")}h=x>=0?r[x]:"/"}let v=cb(c,h),g=f&&f!=="/"&&f.endsWith("/"),y=(u||f===".")&&i.endsWith("/");return!v.pathname.endsWith("/")&&(g||y)&&(v.pathname+="/"),v}const Cr=n=>n.join("/").replace(/\/\/+/g,"/"),fb=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),pb=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,hb=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function mb(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const hg=["post","put","patch","delete"];new Set(hg);const gb=["get",...hg];new Set(gb);/** + */function Hi(){return Hi=Object.assign?Object.assign.bind():function(n){for(var r=1;r"u")throw new Error(r)}function dg(n,r){if(!n){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function K0(){return Math.random().toString(36).substr(2,8)}function um(n,r){return{usr:n.state,key:n.key,idx:r}}function Cu(n,r,i,l){return i===void 0&&(i=null),Hi({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof r=="string"?Yo(r):r,{state:i,key:r&&r.key||l||K0()})}function Ol(n){let{pathname:r="/",search:i="",hash:l=""}=n;return i&&i!=="?"&&(r+=i.charAt(0)==="?"?i:"?"+i),l&&l!=="#"&&(r+=l.charAt(0)==="#"?l:"#"+l),r}function Yo(n){let r={};if(n){let i=n.indexOf("#");i>=0&&(r.hash=n.substr(i),n=n.substr(0,i));let l=n.indexOf("?");l>=0&&(r.search=n.substr(l),n=n.substr(0,l)),n&&(r.pathname=n)}return r}function Q0(n,r,i,l){l===void 0&&(l={});let{window:c=document.defaultView,v5Compat:u=!1}=l,f=c.history,h=jr.Pop,v=null,g=y();g==null&&(g=0,f.replaceState(Hi({},f.state,{idx:g}),""));function y(){return(f.state||{idx:null}).idx}function x(){h=jr.Pop;let C=y(),E=C==null?null:C-g;g=C,v&&v({action:h,location:S.location,delta:E})}function b(C,E){h=jr.Push;let D=Cu(S.location,C,E);g=y()+1;let T=um(D,g),P=S.createHref(D);try{f.pushState(T,"",P)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;c.location.assign(P)}u&&v&&v({action:h,location:S.location,delta:1})}function j(C,E){h=jr.Replace;let D=Cu(S.location,C,E);g=y();let T=um(D,g),P=S.createHref(D);f.replaceState(T,"",P),u&&v&&v({action:h,location:S.location,delta:0})}function k(C){let E=c.location.origin!=="null"?c.location.origin:c.location.href,D=typeof C=="string"?C:Ol(C);return D=D.replace(/ $/,"%20"),Ge(E,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,E)}let S={get action(){return h},get location(){return n(c,f)},listen(C){if(v)throw new Error("A history only accepts one active listener");return c.addEventListener(cm,x),v=C,()=>{c.removeEventListener(cm,x),v=null}},createHref(C){return r(c,C)},createURL:k,encodeLocation(C){let E=k(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:b,replace:j,go(C){return f.go(C)}};return S}var dm;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(dm||(dm={}));function Y0(n,r,i){return i===void 0&&(i="/"),q0(n,r,i)}function q0(n,r,i,l){let c=typeof r=="string"?Yo(r):r,u=Ko(c.pathname||"/",i);if(u==null)return null;let f=fg(n);X0(f);let h=null;for(let v=0;h==null&&v{let v={relativePath:h===void 0?u.path||"":h,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};v.relativePath.startsWith("/")&&(Ge(v.relativePath.startsWith(l),'Absolute route path "'+v.relativePath+'" nested under path '+('"'+l+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),v.relativePath=v.relativePath.slice(l.length));let g=Cr([l,v.relativePath]),y=i.concat(v);u.children&&u.children.length>0&&(Ge(u.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+g+'".')),fg(u.children,r,y,g)),!(u.path==null&&!u.index)&&r.push({path:g,score:ob(g,u.index),routesMeta:y})};return n.forEach((u,f)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))c(u,f);else for(let v of pg(u.path))c(u,f,v)}),r}function pg(n){let r=n.split("/");if(r.length===0)return[];let[i,...l]=r,c=i.endsWith("?"),u=i.replace(/\?$/,"");if(l.length===0)return c?[u,""]:[u];let f=pg(l.join("/")),h=[];return h.push(...f.map(v=>v===""?u:[u,v].join("/"))),c&&h.push(...f),h.map(v=>n.startsWith("/")&&v===""?"/":v)}function X0(n){n.sort((r,i)=>r.score!==i.score?i.score-r.score:ib(r.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}const J0=/^:[\w-]+$/,Z0=3,eb=2,tb=1,nb=10,rb=-2,fm=n=>n==="*";function ob(n,r){let i=n.split("/"),l=i.length;return i.some(fm)&&(l+=rb),r&&(l+=eb),i.filter(c=>!fm(c)).reduce((c,u)=>c+(J0.test(u)?Z0:u===""?tb:nb),l)}function ib(n,r){return n.length===r.length&&n.slice(0,-1).every((l,c)=>l===r[c])?n[n.length-1]-r[r.length-1]:0}function sb(n,r,i){let{routesMeta:l}=n,c={},u="/",f=[];for(let h=0;h{let{paramName:b,isOptional:j}=y;if(b==="*"){let S=h[x]||"";f=u.slice(0,u.length-S.length).replace(/(.)\/+$/,"$1")}const k=h[x];return j&&!k?g[b]=void 0:g[b]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:n}}function lb(n,r,i){r===void 0&&(r=!1),i===void 0&&(i=!0),dg(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let l=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,v)=>(l.push({paramName:h,isOptional:v!=null}),v?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(l.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,r?void 0:"i"),l]}function ab(n){try{return n.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return dg(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+r+").")),n}}function Ko(n,r){if(r==="/")return n;if(!n.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}function cb(n,r){r===void 0&&(r="/");let{pathname:i,search:l="",hash:c=""}=typeof n=="string"?Yo(n):n;return{pathname:i?i.startsWith("/")?i:ub(i,r):r,search:pb(l),hash:hb(c)}}function ub(n,r){let i=r.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?i.length>1&&i.pop():c!=="."&&i.push(c)}),i.length>1?i.join("/"):"/"}function lu(n,r,i,l){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+r+"` field ["+JSON.stringify(l)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function db(n){return n.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function td(n,r){let i=db(n);return r?i.map((l,c)=>c===i.length-1?l.pathname:l.pathnameBase):i.map(l=>l.pathnameBase)}function nd(n,r,i,l){l===void 0&&(l=!1);let c;typeof n=="string"?c=Yo(n):(c=Hi({},n),Ge(!c.pathname||!c.pathname.includes("?"),lu("?","pathname","search",c)),Ge(!c.pathname||!c.pathname.includes("#"),lu("#","pathname","hash",c)),Ge(!c.search||!c.search.includes("#"),lu("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,h;if(f==null)h=i;else{let x=r.length-1;if(!l&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),x-=1;c.pathname=b.join("/")}h=x>=0?r[x]:"/"}let v=cb(c,h),g=f&&f!=="/"&&f.endsWith("/"),y=(u||f===".")&&i.endsWith("/");return!v.pathname.endsWith("/")&&(g||y)&&(v.pathname+="/"),v}const Cr=n=>n.join("/").replace(/\/\/+/g,"/"),fb=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),pb=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,hb=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function mb(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const hg=["post","put","patch","delete"];new Set(hg);const gb=["get",...hg];new Set(gb);/** * React Router v6.30.1 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+p.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Vi(){return Vi=Object.assign?Object.assign.bind():function(n){for(var r=1;r{h.current=!0}),m.useCallback(function(g,y){if(y===void 0&&(y={}),!h.current)return;if(typeof g=="number"){l.go(g);return}let x=nd(g,JSON.parse(f),u,y.relative==="path");n==null&&r!=="/"&&(x.pathname=x.pathname==="/"?r:Cr([r,x.pathname])),(y.replace?l.replace:l.push)(x,y.state,y)},[r,l,f,u,n])}function Kl(n,r){let{relative:i}=r===void 0?{}:r,{future:l}=m.useContext(Hn),{matches:c}=m.useContext(Pr),{pathname:u}=Dr(),f=JSON.stringify(td(c,l.v7_relativeSplatPath));return m.useMemo(()=>nd(n,JSON.parse(f),u,i==="path"),[n,f,u,i])}function yb(n,r){return wb(n,r)}function wb(n,r,i,l){Qo()||Ge(!1);let{navigator:c}=m.useContext(Hn),{matches:u}=m.useContext(Pr),f=u[u.length-1],h=f?f.params:{};f&&f.pathname;let v=f?f.pathnameBase:"/";f&&f.route;let g=Dr(),y;if(r){var x;let C=typeof r=="string"?Ko(r):r;v==="/"||(x=C.pathname)!=null&&x.startsWith(v)||Ge(!1),y=C}else y=g;let b=y.pathname||"/",j=b;if(v!=="/"){let C=v.replace(/^\//,"").split("/");j="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=Y0(n,{pathname:j}),S=Sb(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},h,C.params),pathname:Cr([v,c.encodeLocation?c.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?v:Cr([v,c.encodeLocation?c.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),u,i,l);return r&&S?m.createElement(Gl.Provider,{value:{location:Vi({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:jr.Pop}},S):S}function bb(){let n=Rb(),r=mb(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},r),i?m.createElement("pre",{style:c},i):null,null)}const kb=m.createElement(bb,null);class jb extends m.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,i){return i.location!==r.location||i.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:i.error,location:i.location,revalidation:r.revalidation||i.revalidation}}componentDidCatch(r,i){console.error("React Router caught the following error during render",r,i)}render(){return this.state.error!==void 0?m.createElement(Pr.Provider,{value:this.props.routeContext},m.createElement(gg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Cb(n){let{routeContext:r,match:i,children:l}=n,c=m.useContext(Hl);return c&&c.static&&c.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=i.route.id),m.createElement(Pr.Provider,{value:r},l)}function Sb(n,r,i,l){var c;if(r===void 0&&(r=[]),i===void 0&&(i=null),l===void 0&&(l=null),n==null){var u;if(!i)return null;if(i.errors)n=i.matches;else if((u=l)!=null&&u.v7_partialHydration&&r.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let f=n,h=(c=i)==null?void 0:c.errors;if(h!=null){let y=f.findIndex(x=>x.route.id&&(h==null?void 0:h[x.route.id])!==void 0);y>=0||Ge(!1),f=f.slice(0,Math.min(f.length,y+1))}let v=!1,g=-1;if(i&&l&&l.v7_partialHydration)for(let y=0;y=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((y,x,b)=>{let j,k=!1,S=null,C=null;i&&(j=h&&x.route.id?h[x.route.id]:void 0,S=x.route.errorElement||kb,v&&(g<0&&b===0?(Db("route-fallback"),k=!0,C=null):g===b&&(k=!0,C=x.route.hydrateFallbackElement||null)));let E=r.concat(f.slice(0,b+1)),D=()=>{let T;return j?T=S:k?T=C:x.route.Component?T=m.createElement(x.route.Component,null):x.route.element?T=x.route.element:T=y,m.createElement(Cb,{match:x,routeContext:{outlet:y,matches:E,isDataRoute:i!=null},children:T})};return i&&(x.route.ErrorBoundary||x.route.errorElement||b===0)?m.createElement(jb,{location:i.location,revalidation:i.revalidation,component:S,error:j,children:D(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):D()},null)}var yg=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(yg||{}),wg=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(wg||{});function Eb(n){let r=m.useContext(Hl);return r||Ge(!1),r}function _b(n){let r=m.useContext(mg);return r||Ge(!1),r}function Nb(n){let r=m.useContext(Pr);return r||Ge(!1),r}function bg(n){let r=Nb(),i=r.matches[r.matches.length-1];return i.route.id||Ge(!1),i.route.id}function Rb(){var n;let r=m.useContext(gg),i=_b(),l=bg();return r!==void 0?r:(n=i.errors)==null?void 0:n[l]}function Pb(){let{router:n}=Eb(yg.UseNavigateStable),r=bg(wg.UseNavigateStable),i=m.useRef(!1);return vg(()=>{i.current=!0}),m.useCallback(function(c,u){u===void 0&&(u={}),i.current&&(typeof c=="number"?n.navigate(c):n.navigate(c,Vi({fromRouteId:r},u)))},[n,r])}const pm={};function Db(n,r,i){pm[n]||(pm[n]=!0)}function Tb(n,r){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function hm(n){let{to:r,replace:i,state:l,relative:c}=n;Qo()||Ge(!1);let{future:u,static:f}=m.useContext(Hn),{matches:h}=m.useContext(Pr),{pathname:v}=Dr(),g=xg(),y=nd(r,td(h,u.v7_relativeSplatPath),v,c==="path"),x=JSON.stringify(y);return m.useEffect(()=>g(JSON.parse(x),{replace:i,state:l,relative:c}),[g,x,c,i,l]),null}function El(n){Ge(!1)}function Ob(n){let{basename:r="/",children:i=null,location:l,navigationType:c=jr.Pop,navigator:u,static:f=!1,future:h}=n;Qo()&&Ge(!1);let v=r.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:v,navigator:u,static:f,future:Vi({v7_relativeSplatPath:!1},h)}),[v,h,u,f]);typeof l=="string"&&(l=Ko(l));let{pathname:y="/",search:x="",hash:b="",state:j=null,key:k="default"}=l,S=m.useMemo(()=>{let C=Vo(y,v);return C==null?null:{location:{pathname:C,search:x,hash:b,state:j,key:k},navigationType:c}},[v,y,x,b,j,k,c]);return S==null?null:m.createElement(Hn.Provider,{value:g},m.createElement(Gl.Provider,{children:i,value:S}))}function Mb(n){let{children:r,location:i}=n;return yb(Eu(r),i)}new Promise(()=>{});function Eu(n,r){r===void 0&&(r=[]);let i=[];return m.Children.forEach(n,(l,c)=>{if(!m.isValidElement(l))return;let u=[...r,c];if(l.type===m.Fragment){i.push.apply(i,Eu(l.props.children,u));return}l.type!==El&&Ge(!1),!l.props.index||!l.props.children||Ge(!1);let f={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=Eu(l.props.children,u)),i.push(f)}),i}/** + */function Gi(){return Gi=Object.assign?Object.assign.bind():function(n){for(var r=1;r{h.current=!0}),m.useCallback(function(g,y){if(y===void 0&&(y={}),!h.current)return;if(typeof g=="number"){l.go(g);return}let x=nd(g,JSON.parse(f),u,y.relative==="path");n==null&&r!=="/"&&(x.pathname=x.pathname==="/"?r:Cr([r,x.pathname])),(y.replace?l.replace:l.push)(x,y.state,y)},[r,l,f,u,n])}function Kl(n,r){let{relative:i}=r===void 0?{}:r,{future:l}=m.useContext(Hn),{matches:c}=m.useContext(Pr),{pathname:u}=Dr(),f=JSON.stringify(td(c,l.v7_relativeSplatPath));return m.useMemo(()=>nd(n,JSON.parse(f),u,i==="path"),[n,f,u,i])}function yb(n,r){return wb(n,r)}function wb(n,r,i,l){qo()||Ge(!1);let{navigator:c}=m.useContext(Hn),{matches:u}=m.useContext(Pr),f=u[u.length-1],h=f?f.params:{};f&&f.pathname;let v=f?f.pathnameBase:"/";f&&f.route;let g=Dr(),y;if(r){var x;let C=typeof r=="string"?Yo(r):r;v==="/"||(x=C.pathname)!=null&&x.startsWith(v)||Ge(!1),y=C}else y=g;let b=y.pathname||"/",j=b;if(v!=="/"){let C=v.replace(/^\//,"").split("/");j="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=Y0(n,{pathname:j}),S=Sb(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},h,C.params),pathname:Cr([v,c.encodeLocation?c.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?v:Cr([v,c.encodeLocation?c.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),u,i,l);return r&&S?m.createElement(Gl.Provider,{value:{location:Gi({pathname:"/",search:"",hash:"",state:null,key:"default"},y),navigationType:jr.Pop}},S):S}function bb(){let n=Rb(),r=mb(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},r),i?m.createElement("pre",{style:c},i):null,null)}const kb=m.createElement(bb,null);class jb extends m.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,i){return i.location!==r.location||i.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:i.error,location:i.location,revalidation:r.revalidation||i.revalidation}}componentDidCatch(r,i){console.error("React Router caught the following error during render",r,i)}render(){return this.state.error!==void 0?m.createElement(Pr.Provider,{value:this.props.routeContext},m.createElement(gg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Cb(n){let{routeContext:r,match:i,children:l}=n,c=m.useContext(Hl);return c&&c.static&&c.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=i.route.id),m.createElement(Pr.Provider,{value:r},l)}function Sb(n,r,i,l){var c;if(r===void 0&&(r=[]),i===void 0&&(i=null),l===void 0&&(l=null),n==null){var u;if(!i)return null;if(i.errors)n=i.matches;else if((u=l)!=null&&u.v7_partialHydration&&r.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let f=n,h=(c=i)==null?void 0:c.errors;if(h!=null){let y=f.findIndex(x=>x.route.id&&(h==null?void 0:h[x.route.id])!==void 0);y>=0||Ge(!1),f=f.slice(0,Math.min(f.length,y+1))}let v=!1,g=-1;if(i&&l&&l.v7_partialHydration)for(let y=0;y=0?f=f.slice(0,g+1):f=[f[0]];break}}}return f.reduceRight((y,x,b)=>{let j,k=!1,S=null,C=null;i&&(j=h&&x.route.id?h[x.route.id]:void 0,S=x.route.errorElement||kb,v&&(g<0&&b===0?(Db("route-fallback"),k=!0,C=null):g===b&&(k=!0,C=x.route.hydrateFallbackElement||null)));let E=r.concat(f.slice(0,b+1)),D=()=>{let T;return j?T=S:k?T=C:x.route.Component?T=m.createElement(x.route.Component,null):x.route.element?T=x.route.element:T=y,m.createElement(Cb,{match:x,routeContext:{outlet:y,matches:E,isDataRoute:i!=null},children:T})};return i&&(x.route.ErrorBoundary||x.route.errorElement||b===0)?m.createElement(jb,{location:i.location,revalidation:i.revalidation,component:S,error:j,children:D(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):D()},null)}var yg=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(yg||{}),wg=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(wg||{});function Eb(n){let r=m.useContext(Hl);return r||Ge(!1),r}function _b(n){let r=m.useContext(mg);return r||Ge(!1),r}function Nb(n){let r=m.useContext(Pr);return r||Ge(!1),r}function bg(n){let r=Nb(),i=r.matches[r.matches.length-1];return i.route.id||Ge(!1),i.route.id}function Rb(){var n;let r=m.useContext(gg),i=_b(),l=bg();return r!==void 0?r:(n=i.errors)==null?void 0:n[l]}function Pb(){let{router:n}=Eb(yg.UseNavigateStable),r=bg(wg.UseNavigateStable),i=m.useRef(!1);return vg(()=>{i.current=!0}),m.useCallback(function(c,u){u===void 0&&(u={}),i.current&&(typeof c=="number"?n.navigate(c):n.navigate(c,Gi({fromRouteId:r},u)))},[n,r])}const pm={};function Db(n,r,i){pm[n]||(pm[n]=!0)}function Tb(n,r){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function hm(n){let{to:r,replace:i,state:l,relative:c}=n;qo()||Ge(!1);let{future:u,static:f}=m.useContext(Hn),{matches:h}=m.useContext(Pr),{pathname:v}=Dr(),g=xg(),y=nd(r,td(h,u.v7_relativeSplatPath),v,c==="path"),x=JSON.stringify(y);return m.useEffect(()=>g(JSON.parse(x),{replace:i,state:l,relative:c}),[g,x,c,i,l]),null}function El(n){Ge(!1)}function Ob(n){let{basename:r="/",children:i=null,location:l,navigationType:c=jr.Pop,navigator:u,static:f=!1,future:h}=n;qo()&&Ge(!1);let v=r.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:v,navigator:u,static:f,future:Gi({v7_relativeSplatPath:!1},h)}),[v,h,u,f]);typeof l=="string"&&(l=Yo(l));let{pathname:y="/",search:x="",hash:b="",state:j=null,key:k="default"}=l,S=m.useMemo(()=>{let C=Ko(y,v);return C==null?null:{location:{pathname:C,search:x,hash:b,state:j,key:k},navigationType:c}},[v,y,x,b,j,k,c]);return S==null?null:m.createElement(Hn.Provider,{value:g},m.createElement(Gl.Provider,{children:i,value:S}))}function Mb(n){let{children:r,location:i}=n;return yb(Eu(r),i)}new Promise(()=>{});function Eu(n,r){r===void 0&&(r=[]);let i=[];return m.Children.forEach(n,(l,c)=>{if(!m.isValidElement(l))return;let u=[...r,c];if(l.type===m.Fragment){i.push.apply(i,Eu(l.props.children,u));return}l.type!==El&&Ge(!1),!l.props.index||!l.props.children||Ge(!1);let f={id:l.props.id||u.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(f.children=Eu(l.props.children,u)),i.push(f)}),i}/** * React Router DOM v6.30.1 * * Copyright (c) Remix Software Inc. @@ -64,7 +64,7 @@ Error generating stack: `+p.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ml(){return Ml=Object.assign?Object.assign.bind():function(n){for(var r=1;r=0)&&(i[c]=n[c]);return i}function Ab(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Ib(n,r){return n.button===0&&(!r||r==="_self")&&!Ab(n)}const Lb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],zb=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Fb="6";try{window.__reactRouterVersion=Fb}catch{}const $b=m.createContext({isTransitioning:!1}),Ub="startTransition",mm=Rr[Ub];function Bb(n){let{basename:r,children:i,future:l,window:c}=n,u=m.useRef();u.current==null&&(u.current=G0({window:c,v5Compat:!0}));let f=u.current,[h,v]=m.useState({action:f.action,location:f.location}),{v7_startTransition:g}=l||{},y=m.useCallback(x=>{g&&mm?mm(()=>v(x)):v(x)},[v,g]);return m.useLayoutEffect(()=>f.listen(y),[f,y]),m.useEffect(()=>Tb(l),[l]),m.createElement(Ob,{basename:r,children:i,location:h.location,navigationType:h.action,navigator:f,future:l})}const Wb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ho=m.forwardRef(function(r,i){let{onClick:l,relative:c,reloadDocument:u,replace:f,state:h,target:v,to:g,preventScrollReset:y,viewTransition:x}=r,b=kg(r,Lb),{basename:j}=m.useContext(Hn),k,S=!1;if(typeof g=="string"&&Vb.test(g)&&(k=g,Wb))try{let T=new URL(window.location.href),P=g.startsWith("//")?new URL(T.protocol+g):new URL(g),R=Vo(P.pathname,j);P.origin===T.origin&&R!=null?g=R+P.search+P.hash:S=!0}catch{}let C=vb(g,{relative:c}),E=Kb(g,{replace:f,state:h,target:v,preventScrollReset:y,relative:c,viewTransition:x});function D(T){l&&l(T),T.defaultPrevented||E(T)}return m.createElement("a",Ml({},b,{href:k||C,onClick:S||u?l:D,ref:i,target:v}))}),Hb=m.forwardRef(function(r,i){let{"aria-current":l="page",caseSensitive:c=!1,className:u="",end:f=!1,style:h,to:v,viewTransition:g,children:y}=r,x=kg(r,zb),b=Kl(v,{relative:x.relative}),j=Dr(),k=m.useContext(mg),{navigator:S,basename:C}=m.useContext(Hn),E=k!=null&&Qb(b)&&g===!0,D=S.encodeLocation?S.encodeLocation(b).pathname:b.pathname,T=j.pathname,P=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;c||(T=T.toLowerCase(),P=P?P.toLowerCase():null,D=D.toLowerCase()),P&&C&&(P=Vo(P,C)||P);const R=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let N=T===D||!f&&T.startsWith(D)&&T.charAt(R)==="/",I=P!=null&&(P===D||!f&&P.startsWith(D)&&P.charAt(D.length)==="/"),L={isActive:N,isPending:I,isTransitioning:E},Q=N?l:void 0,ee;typeof u=="function"?ee=u(L):ee=[u,N?"active":null,I?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof h=="function"?h(L):h;return m.createElement(Ho,Ml({},x,{"aria-current":Q,className:ee,ref:i,style:J,to:v,viewTransition:g}),typeof y=="function"?y(L):y)});var _u;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(_u||(_u={}));var gm;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(gm||(gm={}));function Gb(n){let r=m.useContext(Hl);return r||Ge(!1),r}function Kb(n,r){let{target:i,replace:l,state:c,preventScrollReset:u,relative:f,viewTransition:h}=r===void 0?{}:r,v=xg(),g=Dr(),y=Kl(n,{relative:f});return m.useCallback(x=>{if(Ib(x,i)){x.preventDefault();let b=l!==void 0?l:Ol(g)===Ol(y);v(n,{replace:b,state:c,preventScrollReset:u,relative:f,viewTransition:h})}},[g,v,y,l,c,i,n,u,f,h])}function Qb(n,r){r===void 0&&(r={});let i=m.useContext($b);i==null&&Ge(!1);let{basename:l}=Gb(_u.useViewTransitionState),c=Kl(n,{relative:r.relative});if(!i.isTransitioning)return!1;let u=Vo(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=Vo(i.nextLocation.pathname,l)||i.nextLocation.pathname;return Su(c.pathname,f)!=null||Su(c.pathname,u)!=null}var Nu,Yb=function(n){Nu=n},qb=function(){if(Nu)return Nu;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};/** + */function Ml(){return Ml=Object.assign?Object.assign.bind():function(n){for(var r=1;r=0)&&(i[c]=n[c]);return i}function Ab(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Ib(n,r){return n.button===0&&(!r||r==="_self")&&!Ab(n)}const Lb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],zb=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Fb="6";try{window.__reactRouterVersion=Fb}catch{}const $b=m.createContext({isTransitioning:!1}),Ub="startTransition",mm=Rr[Ub];function Bb(n){let{basename:r,children:i,future:l,window:c}=n,u=m.useRef();u.current==null&&(u.current=G0({window:c,v5Compat:!0}));let f=u.current,[h,v]=m.useState({action:f.action,location:f.location}),{v7_startTransition:g}=l||{},y=m.useCallback(x=>{g&&mm?mm(()=>v(x)):v(x)},[v,g]);return m.useLayoutEffect(()=>f.listen(y),[f,y]),m.useEffect(()=>Tb(l),[l]),m.createElement(Ob,{basename:r,children:i,location:h.location,navigationType:h.action,navigator:f,future:l})}const Wb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jr=m.forwardRef(function(r,i){let{onClick:l,relative:c,reloadDocument:u,replace:f,state:h,target:v,to:g,preventScrollReset:y,viewTransition:x}=r,b=kg(r,Lb),{basename:j}=m.useContext(Hn),k,S=!1;if(typeof g=="string"&&Vb.test(g)&&(k=g,Wb))try{let T=new URL(window.location.href),P=g.startsWith("//")?new URL(T.protocol+g):new URL(g),R=Ko(P.pathname,j);P.origin===T.origin&&R!=null?g=R+P.search+P.hash:S=!0}catch{}let C=vb(g,{relative:c}),E=Kb(g,{replace:f,state:h,target:v,preventScrollReset:y,relative:c,viewTransition:x});function D(T){l&&l(T),T.defaultPrevented||E(T)}return m.createElement("a",Ml({},b,{href:k||C,onClick:S||u?l:D,ref:i,target:v}))}),Hb=m.forwardRef(function(r,i){let{"aria-current":l="page",caseSensitive:c=!1,className:u="",end:f=!1,style:h,to:v,viewTransition:g,children:y}=r,x=kg(r,zb),b=Kl(v,{relative:x.relative}),j=Dr(),k=m.useContext(mg),{navigator:S,basename:C}=m.useContext(Hn),E=k!=null&&Qb(b)&&g===!0,D=S.encodeLocation?S.encodeLocation(b).pathname:b.pathname,T=j.pathname,P=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;c||(T=T.toLowerCase(),P=P?P.toLowerCase():null,D=D.toLowerCase()),P&&C&&(P=Ko(P,C)||P);const R=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let N=T===D||!f&&T.startsWith(D)&&T.charAt(R)==="/",I=P!=null&&(P===D||!f&&P.startsWith(D)&&P.charAt(D.length)==="/"),L={isActive:N,isPending:I,isTransitioning:E},Q=N?l:void 0,ee;typeof u=="function"?ee=u(L):ee=[u,N?"active":null,I?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let J=typeof h=="function"?h(L):h;return m.createElement(Jr,Ml({},x,{"aria-current":Q,className:ee,ref:i,style:J,to:v,viewTransition:g}),typeof y=="function"?y(L):y)});var _u;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(_u||(_u={}));var gm;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(gm||(gm={}));function Gb(n){let r=m.useContext(Hl);return r||Ge(!1),r}function Kb(n,r){let{target:i,replace:l,state:c,preventScrollReset:u,relative:f,viewTransition:h}=r===void 0?{}:r,v=xg(),g=Dr(),y=Kl(n,{relative:f});return m.useCallback(x=>{if(Ib(x,i)){x.preventDefault();let b=l!==void 0?l:Ol(g)===Ol(y);v(n,{replace:b,state:c,preventScrollReset:u,relative:f,viewTransition:h})}},[g,v,y,l,c,i,n,u,f,h])}function Qb(n,r){r===void 0&&(r={});let i=m.useContext($b);i==null&&Ge(!1);let{basename:l}=Gb(_u.useViewTransitionState),c=Kl(n,{relative:r.relative});if(!i.isTransitioning)return!1;let u=Ko(i.currentLocation.pathname,l)||i.currentLocation.pathname,f=Ko(i.nextLocation.pathname,l)||i.nextLocation.pathname;return Su(c.pathname,f)!=null||Su(c.pathname,u)!=null}var Nu,Yb=function(n){Nu=n},qb=function(){if(Nu)return Nu;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};/** * @license lucide-react v1.68.0 - ISC * * This source code is licensed under the ISC license. @@ -274,12 +274,12 @@ Error generating stack: `+p.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};sv.node;const lv=Te(sv);let av="";function R1(n){av=n}class vm extends Error{constructor(r,i){super(r),this.status=i}}async function ql(n,r,i){const l={};n!=="GET"&&(l["X-CSRF-Token"]=av),i!==void 0&&(l["Content-Type"]="application/json");const c=await fetch(r,{method:n,headers:l,cache:"no-store",body:i===void 0?void 0:JSON.stringify(i)});if(c.status===401)throw location.href="/admin/login?next="+encodeURIComponent(location.pathname),new vm("signed out",401);const u=await c.json().catch(()=>({}));if(!c.ok)throw new vm(u&&u.error||"HTTP "+c.status,c.status);return u}const Ct=n=>ql("GET",n),Fn=(n,r)=>ql("POST",n,r),oo=(n,r)=>ql("PUT",n,r),Ji=n=>ql("DELETE",n);function Pu(n){const r=new URLSearchParams;for(const[l,c]of Object.entries(n))c!=null&&c!==""&&r.set(l,String(c));const i=r.toString();return i?"?"+i:""}function cv(n){var r,i,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(r=0;r{const i=new Array(n.length+r.length);for(let l=0;l({classGroupId:n,validator:r}),dv=(n=new Map,r=null,i)=>({nextPart:n,validators:r,classGroupId:i}),Al="-",xm=[],T1="arbitrary..",O1=n=>{const r=A1(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return M1(f);const h=f.split(Al),v=h[0]===""&&h.length>1?1:0;return fv(h,v,r)},getConflictingClassGroupIds:(f,h)=>{if(h){const v=l[f],g=i[f];return v?g?P1(g,v):v:g||xm}return i[f]||xm}}},fv=(n,r,i)=>{if(n.length-r===0)return i.classGroupId;const c=n[r],u=i.nextPart.get(c);if(u){const g=fv(n,r+1,u);if(g)return g}const f=i.validators;if(f===null)return;const h=r===0?n.join(Al):n.slice(r).join(Al),v=f.length;for(let g=0;gn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),i=r.indexOf(":"),l=r.slice(0,i);return l?T1+l:void 0})(),A1=n=>{const{theme:r,classGroups:i}=n;return I1(i,r)},I1=(n,r)=>{const i=dv();for(const l in n){const c=n[l];rd(c,i,l,r)}return i},rd=(n,r,i,l)=>{const c=n.length;for(let u=0;u{if(typeof n=="string"){z1(n,r,i);return}if(typeof n=="function"){F1(n,r,i,l);return}$1(n,r,i,l)},z1=(n,r,i)=>{const l=n===""?r:pv(r,n);l.classGroupId=i},F1=(n,r,i,l)=>{if(U1(n)){rd(n(l),r,i,l);return}r.validators===null&&(r.validators=[]),r.validators.push(D1(i,n))},$1=(n,r,i,l)=>{const c=Object.entries(n),u=c.length;for(let f=0;f{let i=n;const l=r.split(Al),c=l.length;for(let u=0;u"isThemeGetter"in n&&n.isThemeGetter===!0,B1=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,i=Object.create(null),l=Object.create(null);const c=(u,f)=>{i[u]=f,r++,r>n&&(r=0,l=i,i=Object.create(null))};return{get(u){let f=i[u];if(f!==void 0)return f;if((f=l[u])!==void 0)return c(u,f),f},set(u,f){u in i?i[u]=f:c(u,f)}}},Du="!",ym=":",W1=[],wm=(n,r,i,l,c)=>({modifiers:n,hasImportantModifier:r,baseClassName:i,maybePostfixModifierPosition:l,isExternal:c}),V1=n=>{const{prefix:r,experimentalParseClassName:i}=n;let l=c=>{const u=[];let f=0,h=0,v=0,g;const y=c.length;for(let S=0;Sv?g-v:void 0;return wm(u,j,b,k)};if(r){const c=r+ym,u=l;l=f=>f.startsWith(c)?u(f.slice(c.length)):wm(W1,!1,f,void 0,!0)}if(i){const c=l;l=u=>i({className:u,parseClassName:c})}return l},H1=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((i,l)=>{r.set(i,1e6+l)}),i=>{const l=[];let c=[];for(let u=0;u0&&(c.sort(),l.push(...c),c=[]),l.push(f)):c.push(f)}return c.length>0&&(c.sort(),l.push(...c)),l}},G1=n=>({cache:B1(n.cacheSize),parseClassName:V1(n),sortModifiers:H1(n),postfixLookupClassGroupIds:K1(n),...O1(n)}),K1=n=>{const r=Object.create(null),i=n.postfixLookupClassGroups;if(i)for(let l=0;l{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:c,sortModifiers:u,postfixLookupClassGroupIds:f}=r,h=[],v=n.trim().split(Q1);let g="";for(let y=v.length-1;y>=0;y-=1){const x=v[y],{isExternal:b,modifiers:j,hasImportantModifier:k,baseClassName:S,maybePostfixModifierPosition:C}=i(x);if(b){g=x+(g.length>0?" "+g:g);continue}let E=!!C,D;if(E){const I=S.substring(0,C);D=l(I);const L=D&&f[D]?l(S):void 0;L&&L!==D&&(D=L,E=!1)}else D=l(S);if(!D){if(!E){g=x+(g.length>0?" "+g:g);continue}if(D=l(S),!D){g=x+(g.length>0?" "+g:g);continue}E=!1}const T=j.length===0?"":j.length===1?j[0]:u(j).join(":"),P=k?T+Du:T,R=P+D;if(h.indexOf(R)>-1)continue;h.push(R);const N=c(D,E);for(let I=0;I0?" "+g:g)}return g},q1=(...n)=>{let r=0,i,l,c="";for(;r{if(typeof n=="string")return n;let r,i="";for(let l=0;l{let i,l,c,u;const f=v=>{const g=r.reduce((y,x)=>x(y),n());return i=G1(g),l=i.cache.get,c=i.cache.set,u=h,h(v)},h=v=>{const g=l(v);if(g)return g;const y=Y1(v,i);return c(v,y),y};return u=f,(...v)=>u(q1(...v))},J1=[],ot=n=>{const r=i=>i[n]||J1;return r.isThemeGetter=!0,r.themeKey=n,r},mv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Z1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ek=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,rk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ok=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wr=n=>Z1.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),mn=n=>!!n&&Number.isInteger(Number(n)),cu=n=>n.endsWith("%")&&_e(n.slice(0,-1)),On=n=>ek.test(n),vv=()=>!0,ik=n=>tk.test(n)&&!nk.test(n),od=()=>!1,sk=n=>rk.test(n),lk=n=>ok.test(n),ak=n=>!se(n)&&!ae(n),ck=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),uk=n=>Tr(n,wv,od),se=n=>mv.test(n),Yr=n=>Tr(n,bv,ik),bm=n=>Tr(n,xk,_e),dk=n=>Tr(n,jv,vv),fk=n=>Tr(n,kv,od),km=n=>Tr(n,xv,od),pk=n=>Tr(n,yv,lk),ml=n=>Tr(n,Cv,sk),ae=n=>gv.test(n),Ui=n=>io(n,bv),hk=n=>io(n,kv),jm=n=>io(n,xv),mk=n=>io(n,wv),gk=n=>io(n,yv),gl=n=>io(n,Cv,!0),vk=n=>io(n,jv,!0),Tr=(n,r,i)=>{const l=mv.exec(n);return l?l[1]?r(l[1]):i(l[2]):!1},io=(n,r,i=!1)=>{const l=gv.exec(n);return l?l[1]?r(l[1]):i:!1},xv=n=>n==="position"||n==="percentage",yv=n=>n==="image"||n==="url",wv=n=>n==="length"||n==="size"||n==="bg-size",bv=n=>n==="length",xk=n=>n==="number",kv=n=>n==="family-name",jv=n=>n==="number"||n==="weight",Cv=n=>n==="shadow",yk=()=>{const n=ot("color"),r=ot("font"),i=ot("text"),l=ot("font-weight"),c=ot("tracking"),u=ot("leading"),f=ot("breakpoint"),h=ot("container"),v=ot("spacing"),g=ot("radius"),y=ot("shadow"),x=ot("inset-shadow"),b=ot("text-shadow"),j=ot("drop-shadow"),k=ot("blur"),S=ot("perspective"),C=ot("aspect"),E=ot("ease"),D=ot("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...P(),ae,se],N=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],L=()=>[ae,se,v],Q=()=>[wr,"full","auto",...L()],ee=()=>[mn,"none","subgrid",ae,se],J=()=>["auto",{span:["full",mn,ae,se]},mn,ae,se],ne=()=>[mn,"auto",ae,se],de=()=>["auto","min","max","fr",ae,se],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...L()],Z=()=>[wr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],W=()=>[h,wr,"screen","full","dvw","lvw","svw","min","max","fit",...L()],q=()=>[wr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],F=()=>[n,ae,se],M=()=>[...P(),jm,km,{position:[ae,se]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",mk,uk,{size:[ae,se]}],be=()=>[cu,Ui,Yr],pe=()=>["","none","full",g,ae,se],Y=()=>["",_e,Ui,Yr],we=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[_e,cu,jm,km],Be=()=>["","none",k,ae,se],mt=()=>["none",_e,ae,se],It=()=>["none",_e,ae,se],ut=()=>[_e,ae,se],tt=()=>[wr,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[On],breakpoint:[On],color:[vv],container:[On],"drop-shadow":[On],ease:["in","out","in-out"],font:[ak],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[On],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[On],shadow:[On],spacing:["px",_e],text:[On],"text-shadow":[On],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wr,se,ae,C]}],container:["container"],"container-type":[{"@container":["","normal","size",ae,se]}],"container-named":[ck],columns:[{columns:[_e,"auto",se,ae,h]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[mn,"auto",ae,se]}],basis:[{basis:[wr,"full","auto",h,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,wr,"auto","initial","none",se]}],grow:[{grow:["",_e,ae,se]}],shrink:[{shrink:["",_e,ae,se]}],order:[{order:[mn,"first","last","none",ae,se]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[h,"screen",...Z()]}],"min-w":[{"min-w":[h,"screen","none",...Z()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[f]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh","none",...Z()]}],"font-size":[{text:["base",i,Ui,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,vk,dk]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cu,se]}],"font-family":[{font:[hk,fk,r]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,ae,se]}],"line-clamp":[{"line-clamp":[_e,"none",ae,bm]}],leading:[{leading:["none",u,...L()]}],"list-image":[{"list-image":["none",ae,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ae,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ae,Yr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[_e,"auto",ae,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"tab-size":[{tab:[mn,ae,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ae,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:he()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mn,ae,se],radial:["",ae,se],conic:["",mn,ae,se]},gk,pk]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:be()}],"gradient-via-pos":[{via:be()}],"gradient-to-pos":[{to:be()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-bs":[{"border-bs":Y()}],"border-w-be":[{"border-be":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ae,se]}],"outline-w":[{outline:["",_e,Ui,Yr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","inner","none",y,gl,ml]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",x,gl,ml]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[_e,Yr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",b,gl,ml]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[_e,ae,se]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ae,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:he()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ae,se]}],filter:[{filter:["","none",ae,se]}],blur:[{blur:Be()}],brightness:[{brightness:[_e,ae,se]}],contrast:[{contrast:[_e,ae,se]}],"drop-shadow":[{"drop-shadow":["","none",j,gl,ml]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",_e,ae,se]}],"hue-rotate":[{"hue-rotate":[_e,ae,se]}],invert:[{invert:["",_e,ae,se]}],saturate:[{saturate:[_e,ae,se]}],sepia:[{sepia:["",_e,ae,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ae,se]}],"backdrop-blur":[{"backdrop-blur":Be()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ae,se]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ae,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ae,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ae,se]}],"backdrop-invert":[{"backdrop-invert":["",_e,ae,se]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ae,se]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ae,se]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ae,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ae,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ae,se]}],ease:[{ease:["linear","initial",E,ae,se]}],delay:[{delay:[_e,ae,se]}],animate:[{animate:["none",D,ae,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ae,se]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:mt()}],"rotate-x":[{"rotate-x":mt()}],"rotate-y":[{"rotate-y":mt()}],"rotate-z":[{"rotate-z":mt()}],scale:[{scale:It()}],"scale-x":[{"scale-x":It()}],"scale-y":[{"scale-y":It()}],"scale-z":[{"scale-z":It()}],"scale-3d":["scale-3d"],skew:[{skew:ut()}],"skew-x":[{"skew-x":ut()}],"skew-y":[{"skew-y":ut()}],transform:[{transform:[ae,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tt()}],"translate-x":[{"translate-x":tt()}],"translate-y":[{"translate-y":tt()}],"translate-z":[{"translate-z":tt()}],"translate-none":["translate-none"],zoom:[{zoom:[mn,ae,se]}],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ae,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ae,se]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[_e,Ui,Yr,bm]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wk=X1(yk);function te(...n){return wk(uv(n))}const Cm=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Sm=uv,Xl=(n,r)=>i=>{var l;if((r==null?void 0:r.variants)==null)return Sm(n,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:c,defaultVariants:u}=r,f=Object.keys(c).map(g=>{const y=i==null?void 0:i[g],x=u==null?void 0:u[g];if(y===null)return null;const b=Cm(y)||Cm(x);return c[g][b]}),h=i&&Object.entries(i).reduce((g,y)=>{let[x,b]=y;return b===void 0||(g[x]=b),g},{}),v=r==null||(l=r.compoundVariants)===null||l===void 0?void 0:l.reduce((g,y)=>{let{class:x,className:b,...j}=y;return Object.entries(j).every(k=>{let[S,C]=k;return Array.isArray(C)?C.includes({...u,...h}[S]):{...u,...h}[S]===C})?[...g,x,b]:g},[]);return Sm(n,f,v,i==null?void 0:i.class,i==null?void 0:i.className)},bk=Xl("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Hi({className:n,variant:r,...i}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:te(bk({variant:r}),n),...i})}function kk({className:n,...r}){return s.jsx("div",{"data-slot":"alert-title",className:te("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",n),...r})}function Gi({className:n,...r}){return s.jsx("div",{"data-slot":"alert-description",className:te("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",n),...r})}var jk=Object.defineProperty,id=(n,r)=>jk(n,"name",{value:r,configurable:!0});function Tu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}id(Tu,"setRef");function Sv(...n){return r=>{let i=!1;const l=n.map(c=>{const u=Tu(c,r);return!i&&typeof u=="function"&&(i=!0),u});if(i)return()=>{for(let c=0;cCk(n,"name",{value:r,configurable:!0});function $n(n){const r=m.forwardRef((i,l)=>{let{children:c,...u}=i,f=null,h=!1;const v=[];c=Tv(c),m.Children.forEach(c,b=>{var j;if(Pv(b)){h=!0;const k=b;let S="child"in k.props?k.props.child:k.props.children;for(;ld(S)&&typeof Il=="function";)S=Il(S._payload);f=Sk(k,S),v.push((j=f==null?void 0:f.props)==null?void 0:j.children)}else v.push(b)}),f?f=m.cloneElement(f,void 0,v):!h&&m.Children.count(c)===1&&m.isValidElement(c)&&(f=c);const g=f?Rv(f):void 0,y=Ie(l,g);if(!f){if(c||c===0)throw new Error(h?Nk(n):_k(n));return c}const x=Nv(u,f.props??{});return f.type!==m.Fragment&&(x.ref=l?y:g),m.cloneElement(f,x)});return r.displayName=`${n}.Slot`,r}Bt($n,"createSlot");var sd=$n("Slot"),Ev=Symbol.for("radix.slottable");function _v(n){const r=Bt(i=>"child"in i?i.children(i.child):i.children,"Slottable");return r.displayName=`${n}.Slottable`,r.__radixId=Ev,r}Bt(_v,"createSlottable");var Sk=Bt((n,r)=>"child"in n.props?m.isValidElement(r)?m.cloneElement(r,void 0,n.props.children(r.props.children)):null:m.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function Nv(n,r){const i={...r};for(const l in r){const c=n[l],u=r[l];/^on[A-Z]/.test(l)?c&&u?i[l]=(...h)=>{const v=u(...h);return c(...h),v}:c&&(i[l]=c):l==="style"?i[l]={...c,...u}:l==="className"?i[l]=[c,u].filter(Boolean).join(" "):l==="aria-describedby"&&(i[l]=Ov(u,c))}return{...n,...i}}Bt(Nv,"mergeProps");function Rv(n){var l,c;let r=(l=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:l.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?n.ref:(r=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}Bt(Rv,"getElementRef");function Pv(n){return m.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Ev}Bt(Pv,"isSlottable");var Ek=Symbol.for("react.lazy");function ld(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===Ek&&"_payload"in n&&Dv(n._payload)}Bt(ld,"isLazyComponent");function Dv(n){return typeof n=="object"&&n!==null&&"then"in n}Bt(Dv,"isPromiseLike");function Tv(n){let r=n;for(;ld(r)&&typeof Il=="function";)r=Il(r._payload);return r}Bt(Tv,"useUnwrappedLazy");function Ov(...n){const r=new Set;for(const i of n)if(typeof i=="string")for(const l of String(i).trim().split(/\s+/))l&&r.add(l);return r.size>0?Array.from(r).join(" "):void 0}Bt(Ov,"concatAriaDescribedby");var _k=Bt(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Nk=Bt(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Il=Rr[" use ".trim().toString()],Rk=Object.defineProperty,Pk=(n,r)=>Rk(n,"name",{value:r,configurable:!0}),Dk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=Dk.reduce((n,r)=>{const i=$n(`Primitive.${r}`),l=m.forwardRef((c,u)=>{const{asChild:f,...h}=c,v=f?i:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(v,{...h,ref:u})});return l.displayName=`Primitive.${r}`,{...n,[r]:l}},{});function ad(n,r){n&&ed.flushSync(()=>n.dispatchEvent(r))}Pk(ad,"dispatchDiscreteCustomEvent");var Tk=Object.defineProperty,Ok=(n,r)=>Tk(n,"name",{value:r,configurable:!0}),Mk=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"}),Ak=m.forwardRef(Ok(function(r,i){return s.jsx(ze.span,{...r,ref:i,style:{...Mk,...r.style}})},"VisuallyHidden")),Ik=Object.defineProperty,Yt=(n,r)=>Ik(n,"name",{value:r,configurable:!0});function Lk(n,r){const i=m.createContext(r);i.displayName=n+"Context";const l=Yt(u=>{const{children:f,...h}=u,v=m.useMemo(()=>h,Object.values(h));return s.jsx(i.Provider,{value:v,children:f})},"Provider");l.displayName=n+"Provider";function c(u,f={}){const{optional:h=!1}=f,v=m.useContext(i);if(v)return v;if(r!==void 0)return r;if(!h)throw new Error(`\`${u}\` must be used within \`${n}\``)}return Yt(c,"useContext"),[l,c]}Yt(Lk,"createContext");function an(n,r=[]){let i=[];function l(u,f){const h=m.createContext(f);h.displayName=u+"Context";const v=i.length;i=[...i,f];const g=Yt(x=>{var E;const{scope:b,children:j,...k}=x,S=((E=b==null?void 0:b[n])==null?void 0:E[v])||h,C=m.useMemo(()=>k,Object.values(k));return s.jsx(S.Provider,{value:C,children:j})},"Provider");g.displayName=u+"Provider";function y(x,b,j={}){var E;const{optional:k=!1}=j,S=((E=b==null?void 0:b[n])==null?void 0:E[v])||h,C=m.useContext(S);if(C)return C;if(f!==void 0)return f;if(!k)throw new Error(`\`${x}\` must be used within \`${u}\``)}return Yt(y,"useContext"),[g,y]}Yt(l,"createContext");const c=Yt(()=>{const u=i.map(f=>m.createContext(f));return Yt(function(h){const v=(h==null?void 0:h[n])||u;return m.useMemo(()=>({[`__scope${n}`]:{...h,[n]:v}}),[h,v])},"useScope")},"createScope");return c.scopeName=n,[l,Mv(c,...r)]}Yt(an,"createContextScope");function Mv(...n){const r=n[0];if(n.length===1)return r;const i=Yt(()=>{const l=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return Yt(function(u){const f=l.reduce((h,{useScope:v,scopeName:g})=>{const x=v(u)[`__scope${g}`];return{...h,...x}},{});return m.useMemo(()=>({[`__scope${r.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return i.scopeName=r.scopeName,i}Yt(Mv,"composeContextScopes");var wt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},zk=Object.defineProperty,it=(n,r)=>zk(n,"name",{value:r,configurable:!0});function cd(n){const r=n+"CollectionProvider",[i,l]=an(r),[c,u]=i(r,{collectionRef:{current:null},itemMap:new Map}),f=it(S=>{const{scope:C,children:E}=S,D=m.useRef(null),T=m.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:T,collectionRef:D,children:E})},"CollectionProvider");f.displayName=r;const h=n+"CollectionSlot",v=$n(h),g=m.forwardRef((S,C)=>{const{scope:E,children:D}=S,T=u(h,E),P=Ie(C,T.collectionRef);return s.jsx(v,{ref:P,children:D})});g.displayName=h;const y=n+"CollectionItemSlot",x="data-radix-collection-item",b=$n(y),j=m.forwardRef((S,C)=>{const{scope:E,children:D,...T}=S,P=m.useRef(null),R=Ie(C,P),N=u(y,E);return m.useEffect(()=>(N.itemMap.set(P,{ref:P,...T}),()=>void N.itemMap.delete(P))),s.jsx(b,{[x]:"",ref:R,children:D})});j.displayName=y;function k(S){const C=u(n+"CollectionConsumer",S);return m.useCallback(()=>{const D=C.collectionRef.current;if(!D)return[];const T=Array.from(D.querySelectorAll(`[${x}]`));return Array.from(C.itemMap.values()).sort((N,I)=>T.indexOf(N.ref.current)-T.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return it(k,"useCollection"),[{Provider:f,Slot:g,ItemSlot:j},k,l]}it(cd,"createCollection");var Em=new WeakMap,Xe,Ut,vl=(Ut=class extends Map{constructor(i){super(i);Zh(this,Xe);tu(this,Xe,[...super.keys()]),Em.set(this,!0)}set(i,l){return Em.get(this)&&!this.has(i)&&ht(this,Xe).push(i),super.set(i,l),this}insert(i,l,c){const u=this.has(l),f=u?this.size:this.size+1,h=ud(i),v=h>=0?Math.min(h,f-1):Math.max(f+h,0);if(u?ht(this,Xe).indexOf(l)===v:v===this.size)return this.set(l,c),this;const g=ht(this,Xe).filter(x=>x!==l);g.splice(v,0,l);const y=g.map(x=>[x,x===l?c:this.get(x)]);this.clear();for(const[x,b]of y)this.set(x,b);return this}with(i,l,c){const u=new Ut(this);return u.insert(i,l,c),u}before(i){const l=ht(this,Xe).indexOf(i)-1;if(!(l<0))return this.entryAt(l)}setBefore(i,l,c){const u=ht(this,Xe).indexOf(i);if(u===-1)return this;const f=ht(this,Xe).indexOf(l),h=f!==-1&&f=this.size&&(u=this.size-1),this.at(u)}keyFrom(i,l){const c=this.indexOf(i);if(c===-1)return;let u=c+l;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(i,l){let c=0;for(const u of this){if(Reflect.apply(i,l,[u,c,this]))return u;c++}}findIndex(i,l){let c=0;for(const u of this){if(Reflect.apply(i,l,[u,c,this]))return c;c++}return-1}filter(i,l){const c=[];let u=0;for(const f of this)Reflect.apply(i,l,[f,u,this])&&c.push(f),u++;return new Ut(c)}map(i,l){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(i,l,[f,u,this])]),u++;return new Ut(c)}reduce(...i){const[l,c]=i,u=i.length>1;if(!u&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let f=0,h=c;for(const v of this)f===0&&!u?h=v:h=Reflect.apply(l,this,[h,v,f,this]),f++;return h}reduceRight(...i){const[l,c]=i,u=i.length>1;if(!u&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let f=c;for(let h=this.size-1;h>=0;h--){const v=this.entryAt(h);h===this.size-1&&!u?f=v:f=Reflect.apply(l,this,[f,v,h,this])}return f}sort(i){if(typeof i!="function")throw new TypeError("OrderedDict.sort requires a compare function");const l=[...this.entries()].sort(i);this.clear();for(const[c,u]of l)this.set(c,u);return this}toSorted(i){if(typeof i!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const l=[...this.entries()].sort(i);return new Ut(l)}toReversed(){const i=new Ut;for(let l=this.size-1;l>=0;l--){const c=this.keyAt(l),u=this.get(c);i.set(c,u)}return i}toSpliced(...i){const l=[...this.entries()];return l.splice(...i),new Ut(l)}slice(i,l){const c=new Ut;for(const u of ht(this,Xe).slice(i,l))c.set(u,this.get(u));return c}every(i,l){let c=0;for(const u of this){if(!Reflect.apply(i,l,[u,c,this]))return!1;c++}return!0}some(i,l){let c=0;for(const u of this){if(Reflect.apply(i,l,[u,c,this]))return!0;c++}return!1}},Xe=new WeakMap,it(Ut,"OrderedDict"),Ut);function _l(n,r){if("at"in Array.prototype)return Array.prototype.at.call(n,r);const i=Av(n,r);return i===-1?void 0:n[i]}it(_l,"at");function Av(n,r){const i=n.length,l=ud(r),c=l>=0?l:i+l;return c<0||c>=i?-1:c}it(Av,"toSafeIndex");function ud(n){return n!==n||n===0?0:Math.trunc(n)}it(ud,"toSafeInteger");function Fk(n){const r=n+"CollectionProvider",[i,l]=an(r),[c,u]=i(r);c.displayName=n+"CollectionStableContextProvider";const[f,h]=i(r);f.displayName=n+"CollectionStatefulContextProvider";const v=it(({state:N,...I})=>N?s.jsx(y,{...I,state:N}):s.jsx(g,{...I}),"CollectionProvider");v.displayName=r;const g=it(N=>{const I=D();return s.jsx(y,{...N,state:I})},"CollectionInit");g.displayName=n+"CollectionInit";const y=it(N=>{const{scope:I,children:L,state:Q}=N,ee=m.useRef(null),[J,ne]=m.useState(null),de=Ie(ee,ne),[re,ie]=Q,B=m.useRef(new vl),Z=m.useCallback(()=>{const W=B.current;return zv(W)||W.sort(Nl),W},[]);return m.useEffect(()=>{if(!J)return;const W=Fv(()=>{ie(q=>{const F=q.toSorted(Nl);return F.some(([V],he)=>q.keyAt(he)!==V)?F:q})});return W.observe(J,{childList:!0,subtree:!0}),()=>{W.disconnect()}},[J,ie]),s.jsx(c,{scope:I,collectionElementRef:de,collectionElementRefObject:ee,getCollection:Z,setCollection:ie,registryRef:B,children:s.jsx(f,{scope:I,collectionElement:J,collection:re,children:L})})},"CollectionProviderImpl");y.displayName=n+"CollectionProviderImpl";const x=n+"CollectionSlot",b=$n(x),j=m.forwardRef((N,I)=>{const{scope:L,children:Q}=N,ee=u(x,L),J=Ie(I,ee.collectionElementRef);return s.jsx(b,{ref:J,children:Q})});j.displayName=x;const k=n+"CollectionItemSlot",S="data-radix-collection-item",C=$n(k),E=m.forwardRef((N,I)=>{const{scope:L,children:Q,...ee}=N,J=m.useRef(null),ne=u(k,L),{setCollection:de,registryRef:re}=ne,ie=m.useRef(ee);Iv(ie.current,ee)||(ie.current=ee);const B=ie.current,Z=m.useCallback(F=>{const M=re.current;F?M.set(F,{...ie.current,element:F}):J.current&&M.delete(J.current)},[re]),W=Ie(I,Z,J);wt(()=>{const F=J.current,M=re.current;F&&M.has(F)&&M.set(F,{...B,element:F})},[B,re]);const q=m.useRef(null);return m.useEffect(()=>{const F=J.current,M=q.current;((M==null?void 0:M.element)??null)===F&&(!F||(M==null?void 0:M.itemData)===B)||(q.current=F?{element:F,itemData:B}:null,de(V=>{const he=new vl(V);return M&&M.element!==F&&he.delete(M.element),F&&he.set(F,{...B,element:F}),he.sort(Nl)}))}),m.useEffect(()=>()=>{const F=q.current;q.current=null,F&&de(M=>{if(!M.has(F.element))return M;const V=new vl(M);return V.delete(F.element),V})},[de]),s.jsx(C,{[S]:"",ref:W,children:Q})});E.displayName=k;function D(){return m.useState(new vl)}it(D,"useInitCollection");function T(N){const{collection:I}=h(n+"CollectionConsumer",N);return I}it(T,"useCollection");function P(N){const{getCollection:I}=u(n+"CollectionConsumer",N);return I}return it(P,"useGetCollection"),[{Provider:v,Slot:j,ItemSlot:E},{createCollectionScope:l,useCollection:T,useGetCollection:P,useInitCollection:D}]}it(Fk,"createCollection");function Iv(n,r){if(n===r)return!0;if(typeof n!="object"||typeof r!="object"||n==null||r==null)return!1;const i=Object.keys(n),l=Object.keys(r);if(i.length!==l.length)return!1;for(const c of i)if(!Object.prototype.hasOwnProperty.call(r,c)||n[c]!==r[c])return!1;return!0}it(Iv,"shallowEqual");function Lv(n,r){return!!(r.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}it(Lv,"isElementPreceding");function zv(n){let r;for(const i of n.keys()){if(r){const l=r.compareDocumentPosition(i);if(!(l&Node.DOCUMENT_POSITION_DISCONNECTED)&&l&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=i}return!0}it(zv,"isInDocumentOrder");function Nl(n,r){return!n[1].element||!r[1].element?0:Lv(n[1].element,r[1].element)?-1:1}it(Nl,"sortByDocumentPosition");function Fv(n){return new MutationObserver(i=>{for(const l of i)if(l.type==="childList"){n();return}})}it(Fv,"getChildListObserver");var $k=Object.defineProperty,Yo=(n,r)=>$k(n,"name",{value:r,configurable:!0}),$v=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(n,r,{checkForDefaultPrevented:i=!0}={}){return Yo(function(c){if(n==null||n(c),i===!1||!c||!c.defaultPrevented)return r==null?void 0:r(c)},"handleEvent")}Yo(je,"composeEventHandlers");function Uk(n){var r;if(!$v)throw new Error("Cannot access window outside of the DOM");return((r=n==null?void 0:n.ownerDocument)==null?void 0:r.defaultView)??window}Yo(Uk,"getOwnerWindow");function Ou(n){if(!$v)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Yo(Ou,"getOwnerDocument");function Uv(n,r=!1){const{activeElement:i}=Ou(n);if(!(i!=null&&i.nodeName))return null;if(Bv(i)&&i.contentDocument)return Uv(i.contentDocument.body,r);if(r){const l=i.getAttribute("aria-activedescendant");if(l){const c=Ou(i).getElementById(l);if(c)return c}}return i}Yo(Uv,"getActiveElement");function Bv(n){return n.tagName==="IFRAME"}Yo(Bv,"isFrame");var Bk=Object.defineProperty,Wk=(n,r)=>Bk(n,"name",{value:r,configurable:!0}),_m=Rr[" useEffectEvent ".trim().toString()],Nm=Rr[" useInsertionEffect ".trim().toString()];function Wv(n){if(typeof _m=="function")return _m(n);const r=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Nm=="function"?Nm(()=>{r.current=n}):wt(()=>{r.current=n}),m.useMemo(()=>((...i)=>{var l;return(l=r.current)==null?void 0:l.call(r,...i)}),[])}Wk(Wv,"useEffectEvent");var Vk=Object.defineProperty,Zi=(n,r)=>Vk(n,"name",{value:r,configurable:!0}),Hk=Rr[" useInsertionEffect ".trim().toString()]||wt;function qo({prop:n,defaultProp:r,onChange:i=Zi(()=>{},"onChange"),caller:l}){const[c,u,f]=Vv({defaultProp:r,onChange:i}),h=n!==void 0,v=h?n:c,g=m.useCallback(y=>{var x;if(h){const b=Hv(y)?y(n):y;b!==n&&((x=f.current)==null||x.call(f,b))}else u(y)},[h,n,u,f]);return[v,g]}Zi(qo,"useControllableState");function Vv({defaultProp:n,onChange:r}){const[i,l]=m.useState(n),c=m.useRef(i),u=m.useRef(r);return Hk(()=>{u.current=r},[r]),m.useEffect(()=>{var f;c.current!==i&&((f=u.current)==null||f.call(u,i),c.current=i)},[i,c]),[i,l,u]}Zi(Vv,"useUncontrolledState");function Hv(n){return typeof n=="function"}Zi(Hv,"isFunction");var Rm=Symbol("RADIX:SYNC_STATE");function Gk(n,r,i,l){const{prop:c,defaultProp:u,onChange:f,caller:h}=r,v=c!==void 0,g=Wv(f),y=[{...i,state:u}];l&&y.push(l);const[x,b]=m.useReducer((C,E)=>{if(E.type===Rm)return{...C,state:E.state};const D=n(C,E);return v&&!Object.is(D.state,C.state)&&g(D.state),D},...y),j=x.state,k=m.useRef(j);m.useEffect(()=>{k.current!==j&&(k.current=j,v||g(j))},[j,k,v]);const S=m.useMemo(()=>c!==void 0?{...x,state:c}:x,[x,c]);return m.useEffect(()=>{v&&!Object.is(c,x.state)&&b({type:Rm,state:c})},[c,x.state,v]),[S,b]}Zi(Gk,"useControllableStateReducer");var Kk=Object.defineProperty,Un=(n,r)=>Kk(n,"name",{value:r,configurable:!0});function Gv(n,r){return m.useReducer((i,l)=>r[i][l]??i,n)}Un(Gv,"useStateMachine");var Gn=Un(n=>{const{present:r,children:i}=n,l=Kv(r),c=typeof i=="function"?i({present:l.isPresent}):m.Children.only(i),u=Qv(l.ref,Yv(c));return typeof i=="function"||l.isPresent?m.cloneElement(c,{ref:u}):null},"Presence");function Kv(n){const[r,i]=m.useState(),l=m.useRef(null),c=m.useRef(n),u=m.useRef("none"),f=m.useRef(void 0),h=n?"mounted":"unmounted",[v,g]=Gv(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{v==="mounted"?(u.current=f.current??Uo(l.current),f.current=void 0):u.current="none"},[v]),wt(()=>{const y=l.current,x=c.current;if(x!==n){const j=u.current,k=Uo(y);n?(f.current=k,g("MOUNT")):k==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(x&&j!==k?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,g]),wt(()=>{if(r){let y;const x=r.ownerDocument.defaultView??window,b=Un(k=>{const C=Uo(l.current).includes(CSS.escape(k.animationName));if(k.target===r&&C&&(g("ANIMATION_END"),!c.current)){const E=r.style.animationFillMode;r.style.animationFillMode="forwards",y=x.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=E)})}},"handleAnimationEnd"),j=Un(k=>{k.target===r&&(u.current=Uo(l.current))},"handleAnimationStart");return r.addEventListener("animationstart",j),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{x.clearTimeout(y),r.removeEventListener("animationstart",j),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else g("ANIMATION_END")},[r,g]),{isPresent:["mounted","unmountSuspended"].includes(v),ref:m.useCallback(y=>{if(y){const x=getComputedStyle(y);l.current=x,f.current=Uo(x)}else l.current=null;i(y)},[])}}Un(Kv,"usePresence");function Mu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}Un(Mu,"setRef");function Qv(...n){const r=m.useRef(n);return r.current=n,m.useCallback(i=>{const l=r.current;let c=!1;const u=l.map(f=>{const h=Mu(f,i);return!c&&typeof h=="function"&&(c=!0),h});if(c)return()=>{for(let f=0;fQk(n,"name",{value:r,configurable:!0}),qk=Rr[" useId ".trim().toString()]||(()=>{}),Xk=0;function Sr(n){const[r,i]=m.useState(qk());return wt(()=>{n||i(l=>l??String(Xk++))},[n]),n||(r?`radix-${r}`:"")}Yk(Sr,"useId");var Jk=Object.defineProperty,Zk=(n,r)=>Jk(n,"name",{value:r,configurable:!0}),ej={LTR:"ltr"},tj=m.createContext(void 0);function dd(n){const r=m.useContext(tj);return n||r||ej.LTR}Zk(dd,"useDirection");var nj=Object.defineProperty,rj=(n,r)=>nj(n,"name",{value:r,configurable:!0}),Pm=Rr[" useInsertionEffect ".trim().toString()];function wn(n){const r=m.useRef(n);return typeof Pm=="function"?Pm(()=>{r.current=n}):wt(()=>{r.current=n}),m.useMemo(()=>((...i)=>{var l;return(l=r.current)==null?void 0:l.call(r,...i)}),[])}rj(wn,"useCallbackRef");var oj=Object.defineProperty,ct=(n,r)=>oj(n,"name",{value:r,configurable:!0}),Au="dismissableLayer.update",ij="dismissableLayer.pointerDownOutside",sj="dismissableLayer.focusOutside",Dm,qv=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),fd=m.forwardRef(ct(function(r,i){const{disableOutsidePointerEvents:l=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:v,onDismiss:g,...y}=r,x=m.useContext(qv),[b,j]=m.useState(null),k=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=m.useState({}),C=Ie(i,j),E=Array.from(x.layers),[D]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),T=D?E.indexOf(D):-1,P=b?E.indexOf(b):-1,R=x.layersWithOutsidePointerEventsDisabled.size>0,N=P>=T,I=m.useRef(!1),L=Jv(ne=>{f==null||f(ne),v==null||v(ne),ne.defaultPrevented||g==null||g()},{ownerDocument:k,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:x.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(ne=>{if(!(ne instanceof Node))return!1;const de=[...x.branches].some(re=>re.contains(ne));return N&&!de},[x.branches,N])}),Q=Zv(ne=>{if(c&&I.current)return;const de=ne.target;[...x.branches].some(ie=>ie.contains(de))||(h==null||h(ne),v==null||v(ne),ne.defaultPrevented||g==null||g())},k),ee=b?P===E.length-1:!1,J=wn(ne=>{ne.key==="Escape"&&(u==null||u(ne),!ne.defaultPrevented&&g&&(ne.preventDefault(),g()))});return m.useEffect(()=>{if(ee)return k.addEventListener("keydown",J,{capture:!0}),()=>k.removeEventListener("keydown",J,{capture:!0})},[k,ee,J]),m.useEffect(()=>{if(b)return l&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(Dm=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(b)),x.layers.add(b),Iu(),()=>{l&&(x.layersWithOutsidePointerEventsDisabled.delete(b),x.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=Dm))}},[b,k,l,x]),m.useEffect(()=>()=>{b&&(x.layers.delete(b),x.layersWithOutsidePointerEventsDisabled.delete(b),Iu())},[b,x]),m.useEffect(()=>{const ne=ct(()=>S({}),"handleUpdate");return document.addEventListener(Au,ne),()=>document.removeEventListener(Au,ne)},[]),s.jsx(ze.div,{...y,ref:C,style:{pointerEvents:R?N?"auto":"none":void 0,...r.style},onFocusCapture:je(r.onFocusCapture,Q.onFocusCapture),onBlurCapture:je(r.onBlurCapture,Q.onBlurCapture),onPointerDownCapture:je(r.onPointerDownCapture,L.onPointerDownCapture)})},"DismissableLayer"));function Xv(){const n=m.useContext(qv),[r,i]=m.useState(null);return m.useEffect(()=>{if(r)return n.dismissableSurfaces.add(r),()=>{n.dismissableSurfaces.delete(r)}},[r,n.dismissableSurfaces]),i}ct(Xv,"useDismissableLayerSurface");var lj=ct(()=>!0,"IS_TRUE");function Jv(n,r){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:l=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=lj}=r,h=wn(n),v=m.useRef(!1),g=m.useRef(!1),y=m.useRef(new Map),x=m.useRef(()=>{});return m.useEffect(()=>{function b(){g.current=!1,c.current=!1,y.current.clear()}ct(b,"resetOutsideInteraction");function j(){return Array.from(y.current.values()).some(Boolean)}ct(j,"isOutsideInteractionIntercepted");function k(T){if(!g.current)return;const P=T.target;P instanceof Node&&[...u].some(N=>N.contains(P))||y.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{g.current&&x.current()},0)}ct(k,"handleInteractionCapture");function S(T){g.current&&y.current.set(T.type,!1)}ct(S,"handleInteractionBubble");const C=ct(T=>{if(T.target&&!v.current){let P=function(){i.removeEventListener("click",x.current);const N=j();b(),N||pd(ij,h,R,{discrete:!0})};if(ct(P,"handleAndDispatchPointerDownOutsideEvent"),!f(T.target)){i.removeEventListener("click",x.current),b(),v.current=!1;return}const R={originalEvent:T};g.current=!0,c.current=l&&T.button===0,y.current.clear(),!l||T.button!==0?P():(i.removeEventListener("click",x.current),x.current=P,i.addEventListener("click",x.current,{once:!0}))}else i.removeEventListener("click",x.current),b();v.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of E)i.addEventListener(T,k,!0),i.addEventListener(T,S);const D=window.setTimeout(()=>{i.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(D),i.removeEventListener("pointerdown",C),i.removeEventListener("click",x.current);for(const T of E)i.removeEventListener(T,k,!0),i.removeEventListener(T,S)}},[i,h,l,c,u,f]),{onPointerDownCapture:ct(()=>v.current=!0,"onPointerDownCapture")}}ct(Jv,"usePointerDownOutside");function Zv(n,r=globalThis==null?void 0:globalThis.document){const i=wn(n),l=m.useRef(!1);return m.useEffect(()=>{const c=ct(u=>{u.target&&!l.current&&pd(sj,i,{originalEvent:u},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,i]),{onFocusCapture:ct(()=>l.current=!0,"onFocusCapture"),onBlurCapture:ct(()=>l.current=!1,"onBlurCapture")}}ct(Zv,"useFocusOutside");function Iu(){const n=new CustomEvent(Au);document.dispatchEvent(n)}ct(Iu,"dispatchUpdate");function pd(n,r,i,{discrete:l}){const c=i.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:i});r&&c.addEventListener(n,r,{once:!0}),l?ad(c,u):c.dispatchEvent(u)}ct(pd,"handleAndDispatchCustomEvent");var aj=Object.defineProperty,Ze=(n,r)=>aj(n,"name",{value:r,configurable:!0}),uu="focusScope.autoFocusOnMount",du="focusScope.autoFocusOnUnmount",Tm={bubbles:!1,cancelable:!0},ex=m.forwardRef(Ze(function(r,i){const{loop:l=!1,trapped:c=!1,branches:u,onMountAutoFocus:f,onUnmountAutoFocus:h,...v}=r,[g,y]=m.useState(null),x=wn(f),b=wn(h),j=m.useRef(null),k=Ie(i,y),S=m.useRef(u);m.useEffect(()=>{S.current=u});const C=m.useCallback(T=>{var P;return T?g!=null&&g.contains(T)?!0:!!((P=S.current)!=null&&P.some(R=>R.contains(T))):!1},[g]),E=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(c){let T=function(I){if(E.paused||!g)return;const L=I.target;C(L)?j.current=L:An(j.current,{select:!0})},P=function(I){if(E.paused||!g)return;const L=I.relatedTarget;L!==null&&(C(L)||An(j.current,{select:!0}))},R=function(I){if(document.activeElement===document.body)for(const Q of I)Q.removedNodes.length>0&&An(g)};Ze(T,"handleFocusIn"),Ze(P,"handleFocusOut"),Ze(R,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",P);const N=new MutationObserver(R);return g&&N.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",P),N.disconnect()}}},[c,g,E.paused,C]),m.useEffect(()=>{if(g){Om.add(E);const T=document.activeElement;if(!g.contains(T)){const R=new CustomEvent(uu,Tm);g.addEventListener(uu,x),g.dispatchEvent(R),R.defaultPrevented||(nx(lx(vd(g)),{select:!0}),document.activeElement===T&&An(g))}return()=>{g.removeEventListener(uu,x);const R=g.ownerDocument,N=CustomEvent;setTimeout(()=>{const I=new N(du,Tm);g.addEventListener(du,b),g.dispatchEvent(I),I.defaultPrevented||An(T??R.body,{select:!0}),g.removeEventListener(du,b),Om.remove(E)},0)}}},[g,x,b,E]);const D=m.useCallback(T=>{if(!l&&!c||E.paused)return;const P=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,R=document.activeElement;if(P&&R){const N=T.currentTarget,[I,L]=rx(N);I&&L?!T.shiftKey&&R===L?(T.preventDefault(),l&&An(I,{select:!0})):T.shiftKey&&R===I&&(T.preventDefault(),l&&An(L,{select:!0})):R===N&&T.preventDefault()}},[l,c,E.paused]);return s.jsx(ze.div,{tabIndex:-1,...v,ref:k,onKeyDown:D})},"FocusScope")),tx=m.createContext(null);function hd({registry:n,children:r}){return n?s.jsx(tx.Provider,{value:n,children:r}):r}Ze(hd,"FocusScopeBranchProvider");function md(){const[n,r]=m.useState([]),i=m.useMemo(()=>({add:Ze(l=>r(c=>c.includes(l)?c:[...c,l]),"add"),remove:Ze(l=>r(c=>c.filter(u=>u!==l)),"remove")}),[]);return{nodes:n,registry:i}}Ze(md,"useFocusScopeBranchRegistry");function gd(n){const r=m.useContext(tx);m.useEffect(()=>{if(!(!n||!r))return r.add(n),()=>r.remove(n)},[n,r])}Ze(gd,"useFocusScopeBranch");function nx(n,{select:r=!1}={}){const i=document.activeElement;for(const l of n)if(An(l,{select:r}),document.activeElement!==i)return}Ze(nx,"focusFirst");function rx(n){const r=vd(n),i=Lu(r,n),l=Lu(r.reverse(),n);return[i,l]}Ze(rx,"getTabbableEdges");function vd(n){const r=[],l=n.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:Ze(c=>{const u=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||u?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;l.nextNode();)r.push(l.currentNode);return r}Ze(vd,"getTabbableCandidates");function Lu(n,r){const i=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const l of n)if(!(i?!l.checkVisibility({checkVisibilityCSS:!0}):ox(l,{upTo:r})))return l}Ze(Lu,"findVisible");function ox(n,{upTo:r}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(r!==void 0&&n===r)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}Ze(ox,"isHidden");function ix(n){return n.tagName==="INPUT"&&typeof n.select=="function"}Ze(ix,"isSelectableInput");function An(n,{select:r=!1}={}){if(n&&n.focus){const l=(n.ownerDocument??document).activeElement;n.focus({preventScroll:!0}),n!==l&&ix(n)&&r&&n.select()}}Ze(An,"focus");var Om=sx();function sx(){let n=[];return{add(r){const i=n[0];r!==i&&(i==null||i.pause()),n=zu(n,r),n.unshift(r)},remove(r){var i;n=zu(n,r),(i=n[0])==null||i.resume()}}}Ze(sx,"createFocusScopesStack");function zu(n,r){const i=[...n],l=i.indexOf(r);return l!==-1&&i.splice(l,1),i}Ze(zu,"arrayRemove");function lx(n){return n.filter(r=>r.tagName!=="A")}Ze(lx,"removeLinks");var cj=Object.defineProperty,uj=(n,r)=>cj(n,"name",{value:r,configurable:!0}),xd=m.forwardRef(uj(function(r,i){var v;const{container:l,...c}=r,[u,f]=m.useState(!1);wt(()=>f(!0),[]);const h=l||u&&((v=globalThis==null?void 0:globalThis.document)==null?void 0:v.body);return h?ed.createPortal(s.jsx(ze.div,{...c,ref:i}),h):null},"Portal")),dj=Object.defineProperty,yd=(n,r)=>dj(n,"name",{value:r,configurable:!0}),xl=0,gn=null;function fj(n){return Jl(),n.children}yd(fj,"FocusGuards");function Jl(){m.useEffect(()=>{gn||(gn={start:Fu(),end:Fu()});const{start:n,end:r}=gn;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),xl++,()=>{xl===1&&(gn==null||gn.start.remove(),gn==null||gn.end.remove(),gn=null),xl=Math.max(0,xl-1)}},[])}yd(Jl,"useFocusGuards");function Fu(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}yd(Fu,"createFocusGuard");var vn=function(){return vn=Object.assign||function(r){for(var i,l=1,c=arguments.length;l"u")return Nj;var r=Rj(n),i=document.documentElement.clientWidth,l=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,l-i+r[2]-r[0])}},Dj=dx(),Bo="data-scroll-locked",Tj=function(n,r,i,l){var c=n.left,u=n.top,f=n.right,h=n.gap;return i===void 0&&(i="margin"),` + */const sv={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};sv.node;const lv=Te(sv);let av="";function R1(n){av=n}class vm extends Error{constructor(r,i){super(r),this.status=i}}async function ql(n,r,i){const l={};n!=="GET"&&(l["X-CSRF-Token"]=av),i!==void 0&&(l["Content-Type"]="application/json");const c=await fetch(r,{method:n,headers:l,cache:"no-store",body:i===void 0?void 0:JSON.stringify(i)});if(c.status===401)throw location.href="/admin/login?next="+encodeURIComponent(location.pathname),new vm("signed out",401);const u=await c.json().catch(()=>({}));if(!c.ok)throw new vm(u&&u.error||"HTTP "+c.status,c.status);return u}const Ct=n=>ql("GET",n),Fn=(n,r)=>ql("POST",n,r),io=(n,r)=>ql("PUT",n,r),Ji=n=>ql("DELETE",n);function Pu(n){const r=new URLSearchParams;for(const[l,c]of Object.entries(n))c!=null&&c!==""&&r.set(l,String(c));const i=r.toString();return i?"?"+i:""}function cv(n){var r,i,l="";if(typeof n=="string"||typeof n=="number")l+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(r=0;r{const i=new Array(n.length+r.length);for(let l=0;l({classGroupId:n,validator:r}),dv=(n=new Map,r=null,i)=>({nextPart:n,validators:r,classGroupId:i}),Al="-",xm=[],T1="arbitrary..",O1=n=>{const r=A1(n),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=n;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return M1(f);const h=f.split(Al),v=h[0]===""&&h.length>1?1:0;return fv(h,v,r)},getConflictingClassGroupIds:(f,h)=>{if(h){const v=l[f],g=i[f];return v?g?P1(g,v):v:g||xm}return i[f]||xm}}},fv=(n,r,i)=>{if(n.length-r===0)return i.classGroupId;const c=n[r],u=i.nextPart.get(c);if(u){const g=fv(n,r+1,u);if(g)return g}const f=i.validators;if(f===null)return;const h=r===0?n.join(Al):n.slice(r).join(Al),v=f.length;for(let g=0;gn.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const r=n.slice(1,-1),i=r.indexOf(":"),l=r.slice(0,i);return l?T1+l:void 0})(),A1=n=>{const{theme:r,classGroups:i}=n;return I1(i,r)},I1=(n,r)=>{const i=dv();for(const l in n){const c=n[l];rd(c,i,l,r)}return i},rd=(n,r,i,l)=>{const c=n.length;for(let u=0;u{if(typeof n=="string"){z1(n,r,i);return}if(typeof n=="function"){F1(n,r,i,l);return}$1(n,r,i,l)},z1=(n,r,i)=>{const l=n===""?r:pv(r,n);l.classGroupId=i},F1=(n,r,i,l)=>{if(U1(n)){rd(n(l),r,i,l);return}r.validators===null&&(r.validators=[]),r.validators.push(D1(i,n))},$1=(n,r,i,l)=>{const c=Object.entries(n),u=c.length;for(let f=0;f{let i=n;const l=r.split(Al),c=l.length;for(let u=0;u"isThemeGetter"in n&&n.isThemeGetter===!0,B1=n=>{if(n<1)return{get:()=>{},set:()=>{}};let r=0,i=Object.create(null),l=Object.create(null);const c=(u,f)=>{i[u]=f,r++,r>n&&(r=0,l=i,i=Object.create(null))};return{get(u){let f=i[u];if(f!==void 0)return f;if((f=l[u])!==void 0)return c(u,f),f},set(u,f){u in i?i[u]=f:c(u,f)}}},Du="!",ym=":",W1=[],wm=(n,r,i,l,c)=>({modifiers:n,hasImportantModifier:r,baseClassName:i,maybePostfixModifierPosition:l,isExternal:c}),V1=n=>{const{prefix:r,experimentalParseClassName:i}=n;let l=c=>{const u=[];let f=0,h=0,v=0,g;const y=c.length;for(let S=0;Sv?g-v:void 0;return wm(u,j,b,k)};if(r){const c=r+ym,u=l;l=f=>f.startsWith(c)?u(f.slice(c.length)):wm(W1,!1,f,void 0,!0)}if(i){const c=l;l=u=>i({className:u,parseClassName:c})}return l},H1=n=>{const r=new Map;return n.orderSensitiveModifiers.forEach((i,l)=>{r.set(i,1e6+l)}),i=>{const l=[];let c=[];for(let u=0;u0&&(c.sort(),l.push(...c),c=[]),l.push(f)):c.push(f)}return c.length>0&&(c.sort(),l.push(...c)),l}},G1=n=>({cache:B1(n.cacheSize),parseClassName:V1(n),sortModifiers:H1(n),postfixLookupClassGroupIds:K1(n),...O1(n)}),K1=n=>{const r=Object.create(null),i=n.postfixLookupClassGroups;if(i)for(let l=0;l{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:c,sortModifiers:u,postfixLookupClassGroupIds:f}=r,h=[],v=n.trim().split(Q1);let g="";for(let y=v.length-1;y>=0;y-=1){const x=v[y],{isExternal:b,modifiers:j,hasImportantModifier:k,baseClassName:S,maybePostfixModifierPosition:C}=i(x);if(b){g=x+(g.length>0?" "+g:g);continue}let E=!!C,D;if(E){const I=S.substring(0,C);D=l(I);const L=D&&f[D]?l(S):void 0;L&&L!==D&&(D=L,E=!1)}else D=l(S);if(!D){if(!E){g=x+(g.length>0?" "+g:g);continue}if(D=l(S),!D){g=x+(g.length>0?" "+g:g);continue}E=!1}const T=j.length===0?"":j.length===1?j[0]:u(j).join(":"),P=k?T+Du:T,R=P+D;if(h.indexOf(R)>-1)continue;h.push(R);const N=c(D,E);for(let I=0;I0?" "+g:g)}return g},q1=(...n)=>{let r=0,i,l,c="";for(;r{if(typeof n=="string")return n;let r,i="";for(let l=0;l{let i,l,c,u;const f=v=>{const g=r.reduce((y,x)=>x(y),n());return i=G1(g),l=i.cache.get,c=i.cache.set,u=h,h(v)},h=v=>{const g=l(v);if(g)return g;const y=Y1(v,i);return c(v,y),y};return u=f,(...v)=>u(q1(...v))},J1=[],ot=n=>{const r=i=>i[n]||J1;return r.isThemeGetter=!0,r.themeKey=n,r},mv=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gv=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Z1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ek=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,tk=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,rk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ok=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wr=n=>Z1.test(n),_e=n=>!!n&&!Number.isNaN(Number(n)),mn=n=>!!n&&Number.isInteger(Number(n)),cu=n=>n.endsWith("%")&&_e(n.slice(0,-1)),On=n=>ek.test(n),vv=()=>!0,ik=n=>tk.test(n)&&!nk.test(n),od=()=>!1,sk=n=>rk.test(n),lk=n=>ok.test(n),ak=n=>!se(n)&&!ae(n),ck=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),uk=n=>Tr(n,wv,od),se=n=>mv.test(n),Yr=n=>Tr(n,bv,ik),bm=n=>Tr(n,xk,_e),dk=n=>Tr(n,jv,vv),fk=n=>Tr(n,kv,od),km=n=>Tr(n,xv,od),pk=n=>Tr(n,yv,lk),ml=n=>Tr(n,Cv,sk),ae=n=>gv.test(n),Wi=n=>so(n,bv),hk=n=>so(n,kv),jm=n=>so(n,xv),mk=n=>so(n,wv),gk=n=>so(n,yv),gl=n=>so(n,Cv,!0),vk=n=>so(n,jv,!0),Tr=(n,r,i)=>{const l=mv.exec(n);return l?l[1]?r(l[1]):i(l[2]):!1},so=(n,r,i=!1)=>{const l=gv.exec(n);return l?l[1]?r(l[1]):i:!1},xv=n=>n==="position"||n==="percentage",yv=n=>n==="image"||n==="url",wv=n=>n==="length"||n==="size"||n==="bg-size",bv=n=>n==="length",xk=n=>n==="number",kv=n=>n==="family-name",jv=n=>n==="number"||n==="weight",Cv=n=>n==="shadow",yk=()=>{const n=ot("color"),r=ot("font"),i=ot("text"),l=ot("font-weight"),c=ot("tracking"),u=ot("leading"),f=ot("breakpoint"),h=ot("container"),v=ot("spacing"),g=ot("radius"),y=ot("shadow"),x=ot("inset-shadow"),b=ot("text-shadow"),j=ot("drop-shadow"),k=ot("blur"),S=ot("perspective"),C=ot("aspect"),E=ot("ease"),D=ot("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...P(),ae,se],N=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],L=()=>[ae,se,v],Q=()=>[wr,"full","auto",...L()],ee=()=>[mn,"none","subgrid",ae,se],J=()=>["auto",{span:["full",mn,ae,se]},mn,ae,se],ne=()=>[mn,"auto",ae,se],de=()=>["auto","min","max","fr",ae,se],re=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...L()],Z=()=>[wr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],W=()=>[h,wr,"screen","full","dvw","lvw","svw","min","max","fit",...L()],q=()=>[wr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],F=()=>[n,ae,se],M=()=>[...P(),jm,km,{position:[ae,se]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",mk,uk,{size:[ae,se]}],be=()=>[cu,Wi,Yr],pe=()=>["","none","full",g,ae,se],Y=()=>["",_e,Wi,Yr],we=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[_e,cu,jm,km],Be=()=>["","none",k,ae,se],mt=()=>["none",_e,ae,se],It=()=>["none",_e,ae,se],ut=()=>[_e,ae,se],tt=()=>[wr,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[On],breakpoint:[On],color:[vv],container:[On],"drop-shadow":[On],ease:["in","out","in-out"],font:[ak],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[On],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[On],shadow:[On],spacing:["px",_e],text:[On],"text-shadow":[On],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wr,se,ae,C]}],container:["container"],"container-type":[{"@container":["","normal","size",ae,se]}],"container-named":[ck],columns:[{columns:[_e,"auto",se,ae,h]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:R()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{"inset-s":Q(),start:Q()}],end:[{"inset-e":Q(),end:Q()}],"inset-bs":[{"inset-bs":Q()}],"inset-be":[{"inset-be":Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[mn,"auto",ae,se]}],basis:[{basis:[wr,"full","auto",h,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[_e,wr,"auto","initial","none",se]}],grow:[{grow:["",_e,ae,se]}],shrink:[{shrink:["",_e,ae,se]}],order:[{order:[mn,"first","last","none",ae,se]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":de()}],"auto-rows":[{"auto-rows":de()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...re(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...re()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[h,"screen",...Z()]}],"min-w":[{"min-w":[h,"screen","none",...Z()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[f]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh","none",...Z()]}],"font-size":[{text:["base",i,Wi,Yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,vk,dk]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",cu,se]}],"font-family":[{font:[hk,fk,r]}],"font-features":[{"font-features":[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[c,ae,se]}],"line-clamp":[{"line-clamp":[_e,"none",ae,bm]}],leading:[{leading:["none",u,...L()]}],"list-image":[{"list-image":["none",ae,se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ae,se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[_e,"from-font","auto",ae,Yr]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[_e,"auto",ae,se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"tab-size":[{tab:[mn,ae,se]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ae,se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ae,se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:he()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},mn,ae,se],radial:["",ae,se],conic:["",mn,ae,se]},gk,pk]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:be()}],"gradient-via-pos":[{via:be()}],"gradient-to-pos":[{to:be()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-bs":[{"border-bs":Y()}],"border-w-be":[{"border-be":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-bs":[{"border-bs":F()}],"border-color-be":[{"border-be":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[_e,ae,se]}],"outline-w":[{outline:["",_e,Wi,Yr]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","inner","none",y,gl,ml]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",x,gl,ml]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[_e,Yr]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",b,gl,ml]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[_e,ae,se]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[_e]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[ae,se]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[_e]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:he()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ae,se]}],filter:[{filter:["","none",ae,se]}],blur:[{blur:Be()}],brightness:[{brightness:[_e,ae,se]}],contrast:[{contrast:[_e,ae,se]}],"drop-shadow":[{"drop-shadow":["","none",j,gl,ml]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",_e,ae,se]}],"hue-rotate":[{"hue-rotate":[_e,ae,se]}],invert:[{invert:["",_e,ae,se]}],saturate:[{saturate:[_e,ae,se]}],sepia:[{sepia:["",_e,ae,se]}],"backdrop-filter":[{"backdrop-filter":["","none",ae,se]}],"backdrop-blur":[{"backdrop-blur":Be()}],"backdrop-brightness":[{"backdrop-brightness":[_e,ae,se]}],"backdrop-contrast":[{"backdrop-contrast":[_e,ae,se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",_e,ae,se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[_e,ae,se]}],"backdrop-invert":[{"backdrop-invert":["",_e,ae,se]}],"backdrop-opacity":[{"backdrop-opacity":[_e,ae,se]}],"backdrop-saturate":[{"backdrop-saturate":[_e,ae,se]}],"backdrop-sepia":[{"backdrop-sepia":["",_e,ae,se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ae,se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[_e,"initial",ae,se]}],ease:[{ease:["linear","initial",E,ae,se]}],delay:[{delay:[_e,ae,se]}],animate:[{animate:["none",D,ae,se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ae,se]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:mt()}],"rotate-x":[{"rotate-x":mt()}],"rotate-y":[{"rotate-y":mt()}],"rotate-z":[{"rotate-z":mt()}],scale:[{scale:It()}],"scale-x":[{"scale-x":It()}],"scale-y":[{"scale-y":It()}],"scale-z":[{"scale-z":It()}],"scale-3d":["scale-3d"],skew:[{skew:ut()}],"skew-x":[{"skew-x":ut()}],"skew-y":[{"skew-y":ut()}],transform:[{transform:[ae,se,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:tt()}],"translate-x":[{"translate-x":tt()}],"translate-y":[{"translate-y":tt()}],"translate-z":[{"translate-z":tt()}],"translate-none":["translate-none"],zoom:[{zoom:[mn,ae,se]}],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ae,se]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":F()}],"scrollbar-track-color":[{"scrollbar-track":F()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ae,se]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[_e,Wi,Yr,bm]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},wk=X1(yk);function te(...n){return wk(uv(n))}const Cm=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,Sm=uv,Xl=(n,r)=>i=>{var l;if((r==null?void 0:r.variants)==null)return Sm(n,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:c,defaultVariants:u}=r,f=Object.keys(c).map(g=>{const y=i==null?void 0:i[g],x=u==null?void 0:u[g];if(y===null)return null;const b=Cm(y)||Cm(x);return c[g][b]}),h=i&&Object.entries(i).reduce((g,y)=>{let[x,b]=y;return b===void 0||(g[x]=b),g},{}),v=r==null||(l=r.compoundVariants)===null||l===void 0?void 0:l.reduce((g,y)=>{let{class:x,className:b,...j}=y;return Object.entries(j).every(k=>{let[S,C]=k;return Array.isArray(C)?C.includes({...u,...h}[S]):{...u,...h}[S]===C})?[...g,x,b]:g},[]);return Sm(n,f,v,i==null?void 0:i.class,i==null?void 0:i.className)},bk=Xl("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Wo({className:n,variant:r,...i}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:te(bk({variant:r}),n),...i})}function kk({className:n,...r}){return s.jsx("div",{"data-slot":"alert-title",className:te("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",n),...r})}function Vo({className:n,...r}){return s.jsx("div",{"data-slot":"alert-description",className:te("col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed",n),...r})}var jk=Object.defineProperty,id=(n,r)=>jk(n,"name",{value:r,configurable:!0});function Tu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}id(Tu,"setRef");function Sv(...n){return r=>{let i=!1;const l=n.map(c=>{const u=Tu(c,r);return!i&&typeof u=="function"&&(i=!0),u});if(i)return()=>{for(let c=0;cCk(n,"name",{value:r,configurable:!0});function $n(n){const r=m.forwardRef((i,l)=>{let{children:c,...u}=i,f=null,h=!1;const v=[];c=Tv(c),m.Children.forEach(c,b=>{var j;if(Pv(b)){h=!0;const k=b;let S="child"in k.props?k.props.child:k.props.children;for(;ld(S)&&typeof Il=="function";)S=Il(S._payload);f=Sk(k,S),v.push((j=f==null?void 0:f.props)==null?void 0:j.children)}else v.push(b)}),f?f=m.cloneElement(f,void 0,v):!h&&m.Children.count(c)===1&&m.isValidElement(c)&&(f=c);const g=f?Rv(f):void 0,y=Ie(l,g);if(!f){if(c||c===0)throw new Error(h?Nk(n):_k(n));return c}const x=Nv(u,f.props??{});return f.type!==m.Fragment&&(x.ref=l?y:g),m.cloneElement(f,x)});return r.displayName=`${n}.Slot`,r}Bt($n,"createSlot");var sd=$n("Slot"),Ev=Symbol.for("radix.slottable");function _v(n){const r=Bt(i=>"child"in i?i.children(i.child):i.children,"Slottable");return r.displayName=`${n}.Slottable`,r.__radixId=Ev,r}Bt(_v,"createSlottable");var Sk=Bt((n,r)=>"child"in n.props?m.isValidElement(r)?m.cloneElement(r,void 0,n.props.children(r.props.children)):null:m.isValidElement(r)?r:null,"getSlottableElementFromSlottable");function Nv(n,r){const i={...r};for(const l in r){const c=n[l],u=r[l];/^on[A-Z]/.test(l)?c&&u?i[l]=(...h)=>{const v=u(...h);return c(...h),v}:c&&(i[l]=c):l==="style"?i[l]={...c,...u}:l==="className"?i[l]=[c,u].filter(Boolean).join(" "):l==="aria-describedby"&&(i[l]=Ov(u,c))}return{...n,...i}}Bt(Nv,"mergeProps");function Rv(n){var l,c;let r=(l=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:l.get,i=r&&"isReactWarning"in r&&r.isReactWarning;return i?n.ref:(r=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,i=r&&"isReactWarning"in r&&r.isReactWarning,i?n.props.ref:n.props.ref||n.ref)}Bt(Rv,"getElementRef");function Pv(n){return m.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===Ev}Bt(Pv,"isSlottable");var Ek=Symbol.for("react.lazy");function ld(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===Ek&&"_payload"in n&&Dv(n._payload)}Bt(ld,"isLazyComponent");function Dv(n){return typeof n=="object"&&n!==null&&"then"in n}Bt(Dv,"isPromiseLike");function Tv(n){let r=n;for(;ld(r)&&typeof Il=="function";)r=Il(r._payload);return r}Bt(Tv,"useUnwrappedLazy");function Ov(...n){const r=new Set;for(const i of n)if(typeof i=="string")for(const l of String(i).trim().split(/\s+/))l&&r.add(l);return r.size>0?Array.from(r).join(" "):void 0}Bt(Ov,"concatAriaDescribedby");var _k=Bt(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Nk=Bt(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Il=Rr[" use ".trim().toString()],Rk=Object.defineProperty,Pk=(n,r)=>Rk(n,"name",{value:r,configurable:!0}),Dk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=Dk.reduce((n,r)=>{const i=$n(`Primitive.${r}`),l=m.forwardRef((c,u)=>{const{asChild:f,...h}=c,v=f?i:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(v,{...h,ref:u})});return l.displayName=`Primitive.${r}`,{...n,[r]:l}},{});function ad(n,r){n&&ed.flushSync(()=>n.dispatchEvent(r))}Pk(ad,"dispatchDiscreteCustomEvent");var Tk=Object.defineProperty,Ok=(n,r)=>Tk(n,"name",{value:r,configurable:!0}),Mk=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"}),Ak=m.forwardRef(Ok(function(r,i){return s.jsx(ze.span,{...r,ref:i,style:{...Mk,...r.style}})},"VisuallyHidden")),Ik=Object.defineProperty,Yt=(n,r)=>Ik(n,"name",{value:r,configurable:!0});function Lk(n,r){const i=m.createContext(r);i.displayName=n+"Context";const l=Yt(u=>{const{children:f,...h}=u,v=m.useMemo(()=>h,Object.values(h));return s.jsx(i.Provider,{value:v,children:f})},"Provider");l.displayName=n+"Provider";function c(u,f={}){const{optional:h=!1}=f,v=m.useContext(i);if(v)return v;if(r!==void 0)return r;if(!h)throw new Error(`\`${u}\` must be used within \`${n}\``)}return Yt(c,"useContext"),[l,c]}Yt(Lk,"createContext");function an(n,r=[]){let i=[];function l(u,f){const h=m.createContext(f);h.displayName=u+"Context";const v=i.length;i=[...i,f];const g=Yt(x=>{var E;const{scope:b,children:j,...k}=x,S=((E=b==null?void 0:b[n])==null?void 0:E[v])||h,C=m.useMemo(()=>k,Object.values(k));return s.jsx(S.Provider,{value:C,children:j})},"Provider");g.displayName=u+"Provider";function y(x,b,j={}){var E;const{optional:k=!1}=j,S=((E=b==null?void 0:b[n])==null?void 0:E[v])||h,C=m.useContext(S);if(C)return C;if(f!==void 0)return f;if(!k)throw new Error(`\`${x}\` must be used within \`${u}\``)}return Yt(y,"useContext"),[g,y]}Yt(l,"createContext");const c=Yt(()=>{const u=i.map(f=>m.createContext(f));return Yt(function(h){const v=(h==null?void 0:h[n])||u;return m.useMemo(()=>({[`__scope${n}`]:{...h,[n]:v}}),[h,v])},"useScope")},"createScope");return c.scopeName=n,[l,Mv(c,...r)]}Yt(an,"createContextScope");function Mv(...n){const r=n[0];if(n.length===1)return r;const i=Yt(()=>{const l=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return Yt(function(u){const f=l.reduce((h,{useScope:v,scopeName:g})=>{const x=v(u)[`__scope${g}`];return{...h,...x}},{});return m.useMemo(()=>({[`__scope${r.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return i.scopeName=r.scopeName,i}Yt(Mv,"composeContextScopes");var wt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},zk=Object.defineProperty,it=(n,r)=>zk(n,"name",{value:r,configurable:!0});function cd(n){const r=n+"CollectionProvider",[i,l]=an(r),[c,u]=i(r,{collectionRef:{current:null},itemMap:new Map}),f=it(S=>{const{scope:C,children:E}=S,D=m.useRef(null),T=m.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:T,collectionRef:D,children:E})},"CollectionProvider");f.displayName=r;const h=n+"CollectionSlot",v=$n(h),g=m.forwardRef((S,C)=>{const{scope:E,children:D}=S,T=u(h,E),P=Ie(C,T.collectionRef);return s.jsx(v,{ref:P,children:D})});g.displayName=h;const y=n+"CollectionItemSlot",x="data-radix-collection-item",b=$n(y),j=m.forwardRef((S,C)=>{const{scope:E,children:D,...T}=S,P=m.useRef(null),R=Ie(C,P),N=u(y,E);return m.useEffect(()=>(N.itemMap.set(P,{ref:P,...T}),()=>void N.itemMap.delete(P))),s.jsx(b,{[x]:"",ref:R,children:D})});j.displayName=y;function k(S){const C=u(n+"CollectionConsumer",S);return m.useCallback(()=>{const D=C.collectionRef.current;if(!D)return[];const T=Array.from(D.querySelectorAll(`[${x}]`));return Array.from(C.itemMap.values()).sort((N,I)=>T.indexOf(N.ref.current)-T.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return it(k,"useCollection"),[{Provider:f,Slot:g,ItemSlot:j},k,l]}it(cd,"createCollection");var Em=new WeakMap,Xe,Ut,vl=(Ut=class extends Map{constructor(i){super(i);Zh(this,Xe);tu(this,Xe,[...super.keys()]),Em.set(this,!0)}set(i,l){return Em.get(this)&&!this.has(i)&&ht(this,Xe).push(i),super.set(i,l),this}insert(i,l,c){const u=this.has(l),f=u?this.size:this.size+1,h=ud(i),v=h>=0?Math.min(h,f-1):Math.max(f+h,0);if(u?ht(this,Xe).indexOf(l)===v:v===this.size)return this.set(l,c),this;const g=ht(this,Xe).filter(x=>x!==l);g.splice(v,0,l);const y=g.map(x=>[x,x===l?c:this.get(x)]);this.clear();for(const[x,b]of y)this.set(x,b);return this}with(i,l,c){const u=new Ut(this);return u.insert(i,l,c),u}before(i){const l=ht(this,Xe).indexOf(i)-1;if(!(l<0))return this.entryAt(l)}setBefore(i,l,c){const u=ht(this,Xe).indexOf(i);if(u===-1)return this;const f=ht(this,Xe).indexOf(l),h=f!==-1&&f=this.size&&(u=this.size-1),this.at(u)}keyFrom(i,l){const c=this.indexOf(i);if(c===-1)return;let u=c+l;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(i,l){let c=0;for(const u of this){if(Reflect.apply(i,l,[u,c,this]))return u;c++}}findIndex(i,l){let c=0;for(const u of this){if(Reflect.apply(i,l,[u,c,this]))return c;c++}return-1}filter(i,l){const c=[];let u=0;for(const f of this)Reflect.apply(i,l,[f,u,this])&&c.push(f),u++;return new Ut(c)}map(i,l){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(i,l,[f,u,this])]),u++;return new Ut(c)}reduce(...i){const[l,c]=i,u=i.length>1;if(!u&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let f=0,h=c;for(const v of this)f===0&&!u?h=v:h=Reflect.apply(l,this,[h,v,f,this]),f++;return h}reduceRight(...i){const[l,c]=i,u=i.length>1;if(!u&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let f=c;for(let h=this.size-1;h>=0;h--){const v=this.entryAt(h);h===this.size-1&&!u?f=v:f=Reflect.apply(l,this,[f,v,h,this])}return f}sort(i){if(typeof i!="function")throw new TypeError("OrderedDict.sort requires a compare function");const l=[...this.entries()].sort(i);this.clear();for(const[c,u]of l)this.set(c,u);return this}toSorted(i){if(typeof i!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const l=[...this.entries()].sort(i);return new Ut(l)}toReversed(){const i=new Ut;for(let l=this.size-1;l>=0;l--){const c=this.keyAt(l),u=this.get(c);i.set(c,u)}return i}toSpliced(...i){const l=[...this.entries()];return l.splice(...i),new Ut(l)}slice(i,l){const c=new Ut;for(const u of ht(this,Xe).slice(i,l))c.set(u,this.get(u));return c}every(i,l){let c=0;for(const u of this){if(!Reflect.apply(i,l,[u,c,this]))return!1;c++}return!0}some(i,l){let c=0;for(const u of this){if(Reflect.apply(i,l,[u,c,this]))return!0;c++}return!1}},Xe=new WeakMap,it(Ut,"OrderedDict"),Ut);function _l(n,r){if("at"in Array.prototype)return Array.prototype.at.call(n,r);const i=Av(n,r);return i===-1?void 0:n[i]}it(_l,"at");function Av(n,r){const i=n.length,l=ud(r),c=l>=0?l:i+l;return c<0||c>=i?-1:c}it(Av,"toSafeIndex");function ud(n){return n!==n||n===0?0:Math.trunc(n)}it(ud,"toSafeInteger");function Fk(n){const r=n+"CollectionProvider",[i,l]=an(r),[c,u]=i(r);c.displayName=n+"CollectionStableContextProvider";const[f,h]=i(r);f.displayName=n+"CollectionStatefulContextProvider";const v=it(({state:N,...I})=>N?s.jsx(y,{...I,state:N}):s.jsx(g,{...I}),"CollectionProvider");v.displayName=r;const g=it(N=>{const I=D();return s.jsx(y,{...N,state:I})},"CollectionInit");g.displayName=n+"CollectionInit";const y=it(N=>{const{scope:I,children:L,state:Q}=N,ee=m.useRef(null),[J,ne]=m.useState(null),de=Ie(ee,ne),[re,ie]=Q,B=m.useRef(new vl),Z=m.useCallback(()=>{const W=B.current;return zv(W)||W.sort(Nl),W},[]);return m.useEffect(()=>{if(!J)return;const W=Fv(()=>{ie(q=>{const F=q.toSorted(Nl);return F.some(([V],he)=>q.keyAt(he)!==V)?F:q})});return W.observe(J,{childList:!0,subtree:!0}),()=>{W.disconnect()}},[J,ie]),s.jsx(c,{scope:I,collectionElementRef:de,collectionElementRefObject:ee,getCollection:Z,setCollection:ie,registryRef:B,children:s.jsx(f,{scope:I,collectionElement:J,collection:re,children:L})})},"CollectionProviderImpl");y.displayName=n+"CollectionProviderImpl";const x=n+"CollectionSlot",b=$n(x),j=m.forwardRef((N,I)=>{const{scope:L,children:Q}=N,ee=u(x,L),J=Ie(I,ee.collectionElementRef);return s.jsx(b,{ref:J,children:Q})});j.displayName=x;const k=n+"CollectionItemSlot",S="data-radix-collection-item",C=$n(k),E=m.forwardRef((N,I)=>{const{scope:L,children:Q,...ee}=N,J=m.useRef(null),ne=u(k,L),{setCollection:de,registryRef:re}=ne,ie=m.useRef(ee);Iv(ie.current,ee)||(ie.current=ee);const B=ie.current,Z=m.useCallback(F=>{const M=re.current;F?M.set(F,{...ie.current,element:F}):J.current&&M.delete(J.current)},[re]),W=Ie(I,Z,J);wt(()=>{const F=J.current,M=re.current;F&&M.has(F)&&M.set(F,{...B,element:F})},[B,re]);const q=m.useRef(null);return m.useEffect(()=>{const F=J.current,M=q.current;((M==null?void 0:M.element)??null)===F&&(!F||(M==null?void 0:M.itemData)===B)||(q.current=F?{element:F,itemData:B}:null,de(V=>{const he=new vl(V);return M&&M.element!==F&&he.delete(M.element),F&&he.set(F,{...B,element:F}),he.sort(Nl)}))}),m.useEffect(()=>()=>{const F=q.current;q.current=null,F&&de(M=>{if(!M.has(F.element))return M;const V=new vl(M);return V.delete(F.element),V})},[de]),s.jsx(C,{[S]:"",ref:W,children:Q})});E.displayName=k;function D(){return m.useState(new vl)}it(D,"useInitCollection");function T(N){const{collection:I}=h(n+"CollectionConsumer",N);return I}it(T,"useCollection");function P(N){const{getCollection:I}=u(n+"CollectionConsumer",N);return I}return it(P,"useGetCollection"),[{Provider:v,Slot:j,ItemSlot:E},{createCollectionScope:l,useCollection:T,useGetCollection:P,useInitCollection:D}]}it(Fk,"createCollection");function Iv(n,r){if(n===r)return!0;if(typeof n!="object"||typeof r!="object"||n==null||r==null)return!1;const i=Object.keys(n),l=Object.keys(r);if(i.length!==l.length)return!1;for(const c of i)if(!Object.prototype.hasOwnProperty.call(r,c)||n[c]!==r[c])return!1;return!0}it(Iv,"shallowEqual");function Lv(n,r){return!!(r.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}it(Lv,"isElementPreceding");function zv(n){let r;for(const i of n.keys()){if(r){const l=r.compareDocumentPosition(i);if(!(l&Node.DOCUMENT_POSITION_DISCONNECTED)&&l&Node.DOCUMENT_POSITION_PRECEDING)return!1}r=i}return!0}it(zv,"isInDocumentOrder");function Nl(n,r){return!n[1].element||!r[1].element?0:Lv(n[1].element,r[1].element)?-1:1}it(Nl,"sortByDocumentPosition");function Fv(n){return new MutationObserver(i=>{for(const l of i)if(l.type==="childList"){n();return}})}it(Fv,"getChildListObserver");var $k=Object.defineProperty,Xo=(n,r)=>$k(n,"name",{value:r,configurable:!0}),$v=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(n,r,{checkForDefaultPrevented:i=!0}={}){return Xo(function(c){if(n==null||n(c),i===!1||!c||!c.defaultPrevented)return r==null?void 0:r(c)},"handleEvent")}Xo(je,"composeEventHandlers");function Uk(n){var r;if(!$v)throw new Error("Cannot access window outside of the DOM");return((r=n==null?void 0:n.ownerDocument)==null?void 0:r.defaultView)??window}Xo(Uk,"getOwnerWindow");function Ou(n){if(!$v)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Xo(Ou,"getOwnerDocument");function Uv(n,r=!1){const{activeElement:i}=Ou(n);if(!(i!=null&&i.nodeName))return null;if(Bv(i)&&i.contentDocument)return Uv(i.contentDocument.body,r);if(r){const l=i.getAttribute("aria-activedescendant");if(l){const c=Ou(i).getElementById(l);if(c)return c}}return i}Xo(Uv,"getActiveElement");function Bv(n){return n.tagName==="IFRAME"}Xo(Bv,"isFrame");var Bk=Object.defineProperty,Wk=(n,r)=>Bk(n,"name",{value:r,configurable:!0}),_m=Rr[" useEffectEvent ".trim().toString()],Nm=Rr[" useInsertionEffect ".trim().toString()];function Wv(n){if(typeof _m=="function")return _m(n);const r=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Nm=="function"?Nm(()=>{r.current=n}):wt(()=>{r.current=n}),m.useMemo(()=>((...i)=>{var l;return(l=r.current)==null?void 0:l.call(r,...i)}),[])}Wk(Wv,"useEffectEvent");var Vk=Object.defineProperty,Zi=(n,r)=>Vk(n,"name",{value:r,configurable:!0}),Hk=Rr[" useInsertionEffect ".trim().toString()]||wt;function Jo({prop:n,defaultProp:r,onChange:i=Zi(()=>{},"onChange"),caller:l}){const[c,u,f]=Vv({defaultProp:r,onChange:i}),h=n!==void 0,v=h?n:c,g=m.useCallback(y=>{var x;if(h){const b=Hv(y)?y(n):y;b!==n&&((x=f.current)==null||x.call(f,b))}else u(y)},[h,n,u,f]);return[v,g]}Zi(Jo,"useControllableState");function Vv({defaultProp:n,onChange:r}){const[i,l]=m.useState(n),c=m.useRef(i),u=m.useRef(r);return Hk(()=>{u.current=r},[r]),m.useEffect(()=>{var f;c.current!==i&&((f=u.current)==null||f.call(u,i),c.current=i)},[i,c]),[i,l,u]}Zi(Vv,"useUncontrolledState");function Hv(n){return typeof n=="function"}Zi(Hv,"isFunction");var Rm=Symbol("RADIX:SYNC_STATE");function Gk(n,r,i,l){const{prop:c,defaultProp:u,onChange:f,caller:h}=r,v=c!==void 0,g=Wv(f),y=[{...i,state:u}];l&&y.push(l);const[x,b]=m.useReducer((C,E)=>{if(E.type===Rm)return{...C,state:E.state};const D=n(C,E);return v&&!Object.is(D.state,C.state)&&g(D.state),D},...y),j=x.state,k=m.useRef(j);m.useEffect(()=>{k.current!==j&&(k.current=j,v||g(j))},[j,k,v]);const S=m.useMemo(()=>c!==void 0?{...x,state:c}:x,[x,c]);return m.useEffect(()=>{v&&!Object.is(c,x.state)&&b({type:Rm,state:c})},[c,x.state,v]),[S,b]}Zi(Gk,"useControllableStateReducer");var Kk=Object.defineProperty,Un=(n,r)=>Kk(n,"name",{value:r,configurable:!0});function Gv(n,r){return m.useReducer((i,l)=>r[i][l]??i,n)}Un(Gv,"useStateMachine");var Gn=Un(n=>{const{present:r,children:i}=n,l=Kv(r),c=typeof i=="function"?i({present:l.isPresent}):m.Children.only(i),u=Qv(l.ref,Yv(c));return typeof i=="function"||l.isPresent?m.cloneElement(c,{ref:u}):null},"Presence");function Kv(n){const[r,i]=m.useState(),l=m.useRef(null),c=m.useRef(n),u=m.useRef("none"),f=m.useRef(void 0),h=n?"mounted":"unmounted",[v,g]=Gv(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{v==="mounted"?(u.current=f.current??Bo(l.current),f.current=void 0):u.current="none"},[v]),wt(()=>{const y=l.current,x=c.current;if(x!==n){const j=u.current,k=Bo(y);n?(f.current=k,g("MOUNT")):k==="none"||(y==null?void 0:y.display)==="none"?g("UNMOUNT"):g(x&&j!==k?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,g]),wt(()=>{if(r){let y;const x=r.ownerDocument.defaultView??window,b=Un(k=>{const C=Bo(l.current).includes(CSS.escape(k.animationName));if(k.target===r&&C&&(g("ANIMATION_END"),!c.current)){const E=r.style.animationFillMode;r.style.animationFillMode="forwards",y=x.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=E)})}},"handleAnimationEnd"),j=Un(k=>{k.target===r&&(u.current=Bo(l.current))},"handleAnimationStart");return r.addEventListener("animationstart",j),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{x.clearTimeout(y),r.removeEventListener("animationstart",j),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else g("ANIMATION_END")},[r,g]),{isPresent:["mounted","unmountSuspended"].includes(v),ref:m.useCallback(y=>{if(y){const x=getComputedStyle(y);l.current=x,f.current=Bo(x)}else l.current=null;i(y)},[])}}Un(Kv,"usePresence");function Mu(n,r){if(typeof n=="function")return n(r);n!=null&&(n.current=r)}Un(Mu,"setRef");function Qv(...n){const r=m.useRef(n);return r.current=n,m.useCallback(i=>{const l=r.current;let c=!1;const u=l.map(f=>{const h=Mu(f,i);return!c&&typeof h=="function"&&(c=!0),h});if(c)return()=>{for(let f=0;fQk(n,"name",{value:r,configurable:!0}),qk=Rr[" useId ".trim().toString()]||(()=>{}),Xk=0;function Sr(n){const[r,i]=m.useState(qk());return wt(()=>{n||i(l=>l??String(Xk++))},[n]),n||(r?`radix-${r}`:"")}Yk(Sr,"useId");var Jk=Object.defineProperty,Zk=(n,r)=>Jk(n,"name",{value:r,configurable:!0}),ej={LTR:"ltr"},tj=m.createContext(void 0);function dd(n){const r=m.useContext(tj);return n||r||ej.LTR}Zk(dd,"useDirection");var nj=Object.defineProperty,rj=(n,r)=>nj(n,"name",{value:r,configurable:!0}),Pm=Rr[" useInsertionEffect ".trim().toString()];function wn(n){const r=m.useRef(n);return typeof Pm=="function"?Pm(()=>{r.current=n}):wt(()=>{r.current=n}),m.useMemo(()=>((...i)=>{var l;return(l=r.current)==null?void 0:l.call(r,...i)}),[])}rj(wn,"useCallbackRef");var oj=Object.defineProperty,ct=(n,r)=>oj(n,"name",{value:r,configurable:!0}),Au="dismissableLayer.update",ij="dismissableLayer.pointerDownOutside",sj="dismissableLayer.focusOutside",Dm,qv=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),fd=m.forwardRef(ct(function(r,i){const{disableOutsidePointerEvents:l=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:v,onDismiss:g,...y}=r,x=m.useContext(qv),[b,j]=m.useState(null),k=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=m.useState({}),C=Ie(i,j),E=Array.from(x.layers),[D]=[...x.layersWithOutsidePointerEventsDisabled].slice(-1),T=D?E.indexOf(D):-1,P=b?E.indexOf(b):-1,R=x.layersWithOutsidePointerEventsDisabled.size>0,N=P>=T,I=m.useRef(!1),L=Jv(ne=>{f==null||f(ne),v==null||v(ne),ne.defaultPrevented||g==null||g()},{ownerDocument:k,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:x.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(ne=>{if(!(ne instanceof Node))return!1;const de=[...x.branches].some(re=>re.contains(ne));return N&&!de},[x.branches,N])}),Q=Zv(ne=>{if(c&&I.current)return;const de=ne.target;[...x.branches].some(ie=>ie.contains(de))||(h==null||h(ne),v==null||v(ne),ne.defaultPrevented||g==null||g())},k),ee=b?P===E.length-1:!1,J=wn(ne=>{ne.key==="Escape"&&(u==null||u(ne),!ne.defaultPrevented&&g&&(ne.preventDefault(),g()))});return m.useEffect(()=>{if(ee)return k.addEventListener("keydown",J,{capture:!0}),()=>k.removeEventListener("keydown",J,{capture:!0})},[k,ee,J]),m.useEffect(()=>{if(b)return l&&(x.layersWithOutsidePointerEventsDisabled.size===0&&(Dm=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),x.layersWithOutsidePointerEventsDisabled.add(b)),x.layers.add(b),Iu(),()=>{l&&(x.layersWithOutsidePointerEventsDisabled.delete(b),x.layersWithOutsidePointerEventsDisabled.size===0&&(k.body.style.pointerEvents=Dm))}},[b,k,l,x]),m.useEffect(()=>()=>{b&&(x.layers.delete(b),x.layersWithOutsidePointerEventsDisabled.delete(b),Iu())},[b,x]),m.useEffect(()=>{const ne=ct(()=>S({}),"handleUpdate");return document.addEventListener(Au,ne),()=>document.removeEventListener(Au,ne)},[]),s.jsx(ze.div,{...y,ref:C,style:{pointerEvents:R?N?"auto":"none":void 0,...r.style},onFocusCapture:je(r.onFocusCapture,Q.onFocusCapture),onBlurCapture:je(r.onBlurCapture,Q.onBlurCapture),onPointerDownCapture:je(r.onPointerDownCapture,L.onPointerDownCapture)})},"DismissableLayer"));function Xv(){const n=m.useContext(qv),[r,i]=m.useState(null);return m.useEffect(()=>{if(r)return n.dismissableSurfaces.add(r),()=>{n.dismissableSurfaces.delete(r)}},[r,n.dismissableSurfaces]),i}ct(Xv,"useDismissableLayerSurface");var lj=ct(()=>!0,"IS_TRUE");function Jv(n,r){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:l=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=lj}=r,h=wn(n),v=m.useRef(!1),g=m.useRef(!1),y=m.useRef(new Map),x=m.useRef(()=>{});return m.useEffect(()=>{function b(){g.current=!1,c.current=!1,y.current.clear()}ct(b,"resetOutsideInteraction");function j(){return Array.from(y.current.values()).some(Boolean)}ct(j,"isOutsideInteractionIntercepted");function k(T){if(!g.current)return;const P=T.target;P instanceof Node&&[...u].some(N=>N.contains(P))||y.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{g.current&&x.current()},0)}ct(k,"handleInteractionCapture");function S(T){g.current&&y.current.set(T.type,!1)}ct(S,"handleInteractionBubble");const C=ct(T=>{if(T.target&&!v.current){let P=function(){i.removeEventListener("click",x.current);const N=j();b(),N||pd(ij,h,R,{discrete:!0})};if(ct(P,"handleAndDispatchPointerDownOutsideEvent"),!f(T.target)){i.removeEventListener("click",x.current),b(),v.current=!1;return}const R={originalEvent:T};g.current=!0,c.current=l&&T.button===0,y.current.clear(),!l||T.button!==0?P():(i.removeEventListener("click",x.current),x.current=P,i.addEventListener("click",x.current,{once:!0}))}else i.removeEventListener("click",x.current),b();v.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of E)i.addEventListener(T,k,!0),i.addEventListener(T,S);const D=window.setTimeout(()=>{i.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(D),i.removeEventListener("pointerdown",C),i.removeEventListener("click",x.current);for(const T of E)i.removeEventListener(T,k,!0),i.removeEventListener(T,S)}},[i,h,l,c,u,f]),{onPointerDownCapture:ct(()=>v.current=!0,"onPointerDownCapture")}}ct(Jv,"usePointerDownOutside");function Zv(n,r=globalThis==null?void 0:globalThis.document){const i=wn(n),l=m.useRef(!1);return m.useEffect(()=>{const c=ct(u=>{u.target&&!l.current&&pd(sj,i,{originalEvent:u},{discrete:!1})},"handleFocus");return r.addEventListener("focusin",c),()=>r.removeEventListener("focusin",c)},[r,i]),{onFocusCapture:ct(()=>l.current=!0,"onFocusCapture"),onBlurCapture:ct(()=>l.current=!1,"onBlurCapture")}}ct(Zv,"useFocusOutside");function Iu(){const n=new CustomEvent(Au);document.dispatchEvent(n)}ct(Iu,"dispatchUpdate");function pd(n,r,i,{discrete:l}){const c=i.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:i});r&&c.addEventListener(n,r,{once:!0}),l?ad(c,u):c.dispatchEvent(u)}ct(pd,"handleAndDispatchCustomEvent");var aj=Object.defineProperty,Ze=(n,r)=>aj(n,"name",{value:r,configurable:!0}),uu="focusScope.autoFocusOnMount",du="focusScope.autoFocusOnUnmount",Tm={bubbles:!1,cancelable:!0},ex=m.forwardRef(Ze(function(r,i){const{loop:l=!1,trapped:c=!1,branches:u,onMountAutoFocus:f,onUnmountAutoFocus:h,...v}=r,[g,y]=m.useState(null),x=wn(f),b=wn(h),j=m.useRef(null),k=Ie(i,y),S=m.useRef(u);m.useEffect(()=>{S.current=u});const C=m.useCallback(T=>{var P;return T?g!=null&&g.contains(T)?!0:!!((P=S.current)!=null&&P.some(R=>R.contains(T))):!1},[g]),E=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(c){let T=function(I){if(E.paused||!g)return;const L=I.target;C(L)?j.current=L:An(j.current,{select:!0})},P=function(I){if(E.paused||!g)return;const L=I.relatedTarget;L!==null&&(C(L)||An(j.current,{select:!0}))},R=function(I){if(document.activeElement===document.body)for(const Q of I)Q.removedNodes.length>0&&An(g)};Ze(T,"handleFocusIn"),Ze(P,"handleFocusOut"),Ze(R,"handleMutations"),document.addEventListener("focusin",T),document.addEventListener("focusout",P);const N=new MutationObserver(R);return g&&N.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",T),document.removeEventListener("focusout",P),N.disconnect()}}},[c,g,E.paused,C]),m.useEffect(()=>{if(g){Om.add(E);const T=document.activeElement;if(!g.contains(T)){const R=new CustomEvent(uu,Tm);g.addEventListener(uu,x),g.dispatchEvent(R),R.defaultPrevented||(nx(lx(vd(g)),{select:!0}),document.activeElement===T&&An(g))}return()=>{g.removeEventListener(uu,x);const R=g.ownerDocument,N=CustomEvent;setTimeout(()=>{const I=new N(du,Tm);g.addEventListener(du,b),g.dispatchEvent(I),I.defaultPrevented||An(T??R.body,{select:!0}),g.removeEventListener(du,b),Om.remove(E)},0)}}},[g,x,b,E]);const D=m.useCallback(T=>{if(!l&&!c||E.paused)return;const P=T.key==="Tab"&&!T.altKey&&!T.ctrlKey&&!T.metaKey,R=document.activeElement;if(P&&R){const N=T.currentTarget,[I,L]=rx(N);I&&L?!T.shiftKey&&R===L?(T.preventDefault(),l&&An(I,{select:!0})):T.shiftKey&&R===I&&(T.preventDefault(),l&&An(L,{select:!0})):R===N&&T.preventDefault()}},[l,c,E.paused]);return s.jsx(ze.div,{tabIndex:-1,...v,ref:k,onKeyDown:D})},"FocusScope")),tx=m.createContext(null);function hd({registry:n,children:r}){return n?s.jsx(tx.Provider,{value:n,children:r}):r}Ze(hd,"FocusScopeBranchProvider");function md(){const[n,r]=m.useState([]),i=m.useMemo(()=>({add:Ze(l=>r(c=>c.includes(l)?c:[...c,l]),"add"),remove:Ze(l=>r(c=>c.filter(u=>u!==l)),"remove")}),[]);return{nodes:n,registry:i}}Ze(md,"useFocusScopeBranchRegistry");function gd(n){const r=m.useContext(tx);m.useEffect(()=>{if(!(!n||!r))return r.add(n),()=>r.remove(n)},[n,r])}Ze(gd,"useFocusScopeBranch");function nx(n,{select:r=!1}={}){const i=document.activeElement;for(const l of n)if(An(l,{select:r}),document.activeElement!==i)return}Ze(nx,"focusFirst");function rx(n){const r=vd(n),i=Lu(r,n),l=Lu(r.reverse(),n);return[i,l]}Ze(rx,"getTabbableEdges");function vd(n){const r=[],l=n.ownerDocument.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:Ze(c=>{const u=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||u?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;l.nextNode();)r.push(l.currentNode);return r}Ze(vd,"getTabbableCandidates");function Lu(n,r){const i=typeof r.checkVisibility=="function"&&r.checkVisibility({checkVisibilityCSS:!0});for(const l of n)if(!(i?!l.checkVisibility({checkVisibilityCSS:!0}):ox(l,{upTo:r})))return l}Ze(Lu,"findVisible");function ox(n,{upTo:r}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(r!==void 0&&n===r)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}Ze(ox,"isHidden");function ix(n){return n.tagName==="INPUT"&&typeof n.select=="function"}Ze(ix,"isSelectableInput");function An(n,{select:r=!1}={}){if(n&&n.focus){const l=(n.ownerDocument??document).activeElement;n.focus({preventScroll:!0}),n!==l&&ix(n)&&r&&n.select()}}Ze(An,"focus");var Om=sx();function sx(){let n=[];return{add(r){const i=n[0];r!==i&&(i==null||i.pause()),n=zu(n,r),n.unshift(r)},remove(r){var i;n=zu(n,r),(i=n[0])==null||i.resume()}}}Ze(sx,"createFocusScopesStack");function zu(n,r){const i=[...n],l=i.indexOf(r);return l!==-1&&i.splice(l,1),i}Ze(zu,"arrayRemove");function lx(n){return n.filter(r=>r.tagName!=="A")}Ze(lx,"removeLinks");var cj=Object.defineProperty,uj=(n,r)=>cj(n,"name",{value:r,configurable:!0}),xd=m.forwardRef(uj(function(r,i){var v;const{container:l,...c}=r,[u,f]=m.useState(!1);wt(()=>f(!0),[]);const h=l||u&&((v=globalThis==null?void 0:globalThis.document)==null?void 0:v.body);return h?ed.createPortal(s.jsx(ze.div,{...c,ref:i}),h):null},"Portal")),dj=Object.defineProperty,yd=(n,r)=>dj(n,"name",{value:r,configurable:!0}),xl=0,gn=null;function fj(n){return Jl(),n.children}yd(fj,"FocusGuards");function Jl(){m.useEffect(()=>{gn||(gn={start:Fu(),end:Fu()});const{start:n,end:r}=gn;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==r&&document.body.insertAdjacentElement("beforeend",r),xl++,()=>{xl===1&&(gn==null||gn.start.remove(),gn==null||gn.end.remove(),gn=null),xl=Math.max(0,xl-1)}},[])}yd(Jl,"useFocusGuards");function Fu(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}yd(Fu,"createFocusGuard");var vn=function(){return vn=Object.assign||function(r){for(var i,l=1,c=arguments.length;l"u")return Nj;var r=Rj(n),i=document.documentElement.clientWidth,l=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,l-i+r[2]-r[0])}},Dj=dx(),Ho="data-scroll-locked",Tj=function(n,r,i,l){var c=n.left,u=n.top,f=n.right,h=n.gap;return i===void 0&&(i="margin"),` .`.concat(hj,` { overflow: hidden `).concat(l,`; padding-right: `).concat(h,"px ").concat(l,`; } - body[`).concat(Bo,`] { + body[`).concat(Ho,`] { overflow: hidden `).concat(l,`; overscroll-behavior: contain; `).concat([r&&"position: relative ".concat(l,";"),i==="margin"&&` @@ -308,11 +308,11 @@ Error generating stack: `+p.message+` margin-right: 0 `).concat(l,`; } - body[`).concat(Bo,`] { + body[`).concat(Ho,`] { `).concat(mj,": ").concat(h,`px; } -`)},Am=function(){var n=parseInt(document.body.getAttribute(Bo)||"0",10);return isFinite(n)?n:0},Oj=function(){m.useEffect(function(){return document.body.setAttribute(Bo,(Am()+1).toString()),function(){var n=Am()-1;n<=0?document.body.removeAttribute(Bo):document.body.setAttribute(Bo,n.toString())}},[])},Mj=function(n){var r=n.noRelative,i=n.noImportant,l=n.gapMode,c=l===void 0?"margin":l;Oj();var u=m.useMemo(function(){return Pj(c)},[c]);return m.createElement(Dj,{styles:Tj(u,!r,c,i?"":"!important")})},$u=!1;if(typeof window<"u")try{var yl=Object.defineProperty({},"passive",{get:function(){return $u=!0,!0}});window.addEventListener("test",yl,yl),window.removeEventListener("test",yl,yl)}catch{$u=!1}var Lo=$u?{passive:!1}:!1,Aj=function(n){return n.tagName==="TEXTAREA"},fx=function(n,r){if(!(n instanceof Element))return!1;var i=window.getComputedStyle(n);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!Aj(n)&&i[r]==="visible")},Ij=function(n){return fx(n,"overflowY")},Lj=function(n){return fx(n,"overflowX")},Im=function(n,r){var i=r.ownerDocument,l=r;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var c=px(n,l);if(c){var u=hx(n,l),f=u[1],h=u[2];if(f>h)return!0}l=l.parentNode}while(l&&l!==i.body);return!1},zj=function(n){var r=n.scrollTop,i=n.scrollHeight,l=n.clientHeight;return[r,i,l]},Fj=function(n){var r=n.scrollLeft,i=n.scrollWidth,l=n.clientWidth;return[r,i,l]},px=function(n,r){return n==="v"?Ij(r):Lj(r)},hx=function(n,r){return n==="v"?zj(r):Fj(r)},$j=function(n,r){return n==="h"&&r==="rtl"?-1:1},Uj=function(n,r,i,l,c){var u=$j(n,window.getComputedStyle(r).direction),f=u*l,h=i.target,v=r.contains(h),g=!1,y=f>0,x=0,b=0;do{if(!h)break;var j=hx(n,h),k=j[0],S=j[1],C=j[2],E=S-C-u*k;(k||E)&&px(n,h)&&(x+=E,b+=k);var D=h.parentNode;h=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!v&&h!==document.body||v&&(r.contains(h)||r===h));return(y&&Math.abs(x)<1||!y&&Math.abs(b)<1)&&(g=!0),g},wl=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Lm=function(n){return[n.deltaX,n.deltaY]},zm=function(n){return n&&"current"in n?n.current:n},Bj=function(n,r){return n[0]===r[0]&&n[1]===r[1]},Wj=function(n){return` +`)},Am=function(){var n=parseInt(document.body.getAttribute(Ho)||"0",10);return isFinite(n)?n:0},Oj=function(){m.useEffect(function(){return document.body.setAttribute(Ho,(Am()+1).toString()),function(){var n=Am()-1;n<=0?document.body.removeAttribute(Ho):document.body.setAttribute(Ho,n.toString())}},[])},Mj=function(n){var r=n.noRelative,i=n.noImportant,l=n.gapMode,c=l===void 0?"margin":l;Oj();var u=m.useMemo(function(){return Pj(c)},[c]);return m.createElement(Dj,{styles:Tj(u,!r,c,i?"":"!important")})},$u=!1;if(typeof window<"u")try{var yl=Object.defineProperty({},"passive",{get:function(){return $u=!0,!0}});window.addEventListener("test",yl,yl),window.removeEventListener("test",yl,yl)}catch{$u=!1}var zo=$u?{passive:!1}:!1,Aj=function(n){return n.tagName==="TEXTAREA"},fx=function(n,r){if(!(n instanceof Element))return!1;var i=window.getComputedStyle(n);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!Aj(n)&&i[r]==="visible")},Ij=function(n){return fx(n,"overflowY")},Lj=function(n){return fx(n,"overflowX")},Im=function(n,r){var i=r.ownerDocument,l=r;do{typeof ShadowRoot<"u"&&l instanceof ShadowRoot&&(l=l.host);var c=px(n,l);if(c){var u=hx(n,l),f=u[1],h=u[2];if(f>h)return!0}l=l.parentNode}while(l&&l!==i.body);return!1},zj=function(n){var r=n.scrollTop,i=n.scrollHeight,l=n.clientHeight;return[r,i,l]},Fj=function(n){var r=n.scrollLeft,i=n.scrollWidth,l=n.clientWidth;return[r,i,l]},px=function(n,r){return n==="v"?Ij(r):Lj(r)},hx=function(n,r){return n==="v"?zj(r):Fj(r)},$j=function(n,r){return n==="h"&&r==="rtl"?-1:1},Uj=function(n,r,i,l,c){var u=$j(n,window.getComputedStyle(r).direction),f=u*l,h=i.target,v=r.contains(h),g=!1,y=f>0,x=0,b=0;do{if(!h)break;var j=hx(n,h),k=j[0],S=j[1],C=j[2],E=S-C-u*k;(k||E)&&px(n,h)&&(x+=E,b+=k);var D=h.parentNode;h=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!v&&h!==document.body||v&&(r.contains(h)||r===h));return(y&&Math.abs(x)<1||!y&&Math.abs(b)<1)&&(g=!0),g},wl=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Lm=function(n){return[n.deltaX,n.deltaY]},zm=function(n){return n&&"current"in n?n.current:n},Bj=function(n,r){return n[0]===r[0]&&n[1]===r[1]},Wj=function(n){return` .block-interactivity-`.concat(n,` {pointer-events: none;} .allow-interactivity-`).concat(n,` {pointer-events: all;} -`)},Vj=0,zo=[];function Hj(n){var r=m.useRef([]),i=m.useRef([0,0]),l=m.useRef(),c=m.useState(Vj++)[0],u=m.useState(dx)[0],f=m.useRef(n);m.useEffect(function(){f.current=n},[n]),m.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var S=pj([n.lockRef.current],(n.shards||[]).map(zm),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var h=m.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!f.current.allowPinchZoom;var E=wl(S),D=i.current,T="deltaX"in S?S.deltaX:D[0]-E[0],P="deltaY"in S?S.deltaY:D[1]-E[1],R,N=S.target,I=Math.abs(T)>Math.abs(P)?"h":"v";if("touches"in S&&I==="h"&&N.type==="range")return!1;var L=window.getSelection(),Q=L&&L.anchorNode,ee=Q?Q===N||Q.contains(N):!1;if(ee)return!1;var J=Im(I,N);if(!J)return!0;if(J?R=I:(R=I==="v"?"h":"v",J=Im(I,N)),!J)return!1;if(!l.current&&"changedTouches"in S&&(T||P)&&(l.current=R),!R)return!0;var ne=l.current||R;return Uj(ne,C,S,ne==="h"?T:P)},[]),v=m.useCallback(function(S){var C=S;if(!(!zo.length||zo[zo.length-1]!==u)){var E="deltaY"in C?Lm(C):wl(C),D=r.current.filter(function(R){return R.name===C.type&&(R.target===C.target||C.target===R.shadowParent)&&Bj(R.delta,E)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var T=(f.current.shards||[]).map(zm).filter(Boolean).filter(function(R){return R.contains(C.target)}),P=T.length>0?h(C,T[0]):!f.current.noIsolation;P&&C.cancelable&&C.preventDefault()}}},[]),g=m.useCallback(function(S,C,E,D){var T={name:S,delta:C,target:E,should:D,shadowParent:Gj(E)};r.current.push(T),setTimeout(function(){r.current=r.current.filter(function(P){return P!==T})},1)},[]),y=m.useCallback(function(S){i.current=wl(S),l.current=void 0},[]),x=m.useCallback(function(S){g(S.type,Lm(S),S.target,h(S,n.lockRef.current))},[]),b=m.useCallback(function(S){g(S.type,wl(S),S.target,h(S,n.lockRef.current))},[]);m.useEffect(function(){return zo.push(u),n.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:b}),document.addEventListener("wheel",v,Lo),document.addEventListener("touchmove",v,Lo),document.addEventListener("touchstart",y,Lo),function(){zo=zo.filter(function(S){return S!==u}),document.removeEventListener("wheel",v,Lo),document.removeEventListener("touchmove",v,Lo),document.removeEventListener("touchstart",y,Lo)}},[]);var j=n.removeScrollBar,k=n.inert;return m.createElement(m.Fragment,null,k?m.createElement(u,{styles:Wj(c)}):null,j?m.createElement(Mj,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function Gj(n){for(var r=null;n!==null;)n instanceof ShadowRoot&&(r=n.host,n=n.host),n=n.parentNode;return r}const Kj=kj(ux,Hj);var wd=m.forwardRef(function(n,r){return m.createElement(Zl,vn({},n,{ref:r,sideCar:Kj}))});wd.classNames=Zl.classNames;var Qj=function(n){if(typeof document>"u")return null;var r=Array.isArray(n)?n[0]:n;return r.ownerDocument.body},Fo=new WeakMap,bl=new WeakMap,kl={},mu=0,mx=function(n){return n&&(n.host||mx(n.parentNode))},Yj=function(n,r){return r.map(function(i){if(n.contains(i))return i;var l=mx(i);return l&&n.contains(l)?l:(console.error("aria-hidden",i,"in not contained inside",n,". Doing nothing"),null)}).filter(function(i){return!!i})},qj=function(n,r,i,l){var c=Yj(r,Array.isArray(n)?n:[n]);kl[i]||(kl[i]=new WeakMap);var u=kl[i],f=[],h=new Set,v=new Set(c),g=function(x){!x||h.has(x)||(h.add(x),g(x.parentNode))};c.forEach(g);var y=function(x){!x||v.has(x)||Array.prototype.forEach.call(x.children,function(b){if(h.has(b))y(b);else try{var j=b.getAttribute(l),k=j!==null&&j!=="false",S=(Fo.get(b)||0)+1,C=(u.get(b)||0)+1;Fo.set(b,S),u.set(b,C),f.push(b),S===1&&k&&bl.set(b,!0),C===1&&b.setAttribute(i,"true"),k||b.setAttribute(l,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return y(r),h.clear(),mu++,function(){f.forEach(function(x){var b=Fo.get(x)-1,j=u.get(x)-1;Fo.set(x,b),u.set(x,j),b||(bl.has(x)||x.removeAttribute(l),bl.delete(x)),j||x.removeAttribute(i)}),mu--,mu||(Fo=new WeakMap,Fo=new WeakMap,bl=new WeakMap,kl={})}},gx=function(n,r,i){i===void 0&&(i="data-aria-hidden");var l=Array.from(Array.isArray(n)?n:[n]),c=Qj(n);return c?(l.push.apply(l,Array.from(c.querySelectorAll("[aria-live], script"))),qj(l,c,i,"aria-hidden")):function(){return null}},Xj=Object.defineProperty,At=(n,r)=>Xj(n,"name",{value:r,configurable:!0}),bd="Dialog",[vx,xx]=an(bd),[Jj,cn]=vx(bd),kd=At(n=>{const{__scopeDialog:r,children:i,open:l,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,h=m.useRef(null),v=m.useRef(null),{nodes:g,registry:y}=md(),[x,b]=qo({prop:l,defaultProp:c??!1,onChange:u,caller:bd}),[j,k]=m.useState(0),[S,C]=m.useState(0);return s.jsx(Jj,{scope:r,triggerRef:h,contentRef:v,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),titlePresent:j>0,descriptionPresent:S>0,setTitleCount:k,setDescriptionCount:C,open:x,onOpenChange:b,onOpenToggle:m.useCallback(()=>b(E=>!E),[b]),modal:f,branchNodes:g,branchRegistry:y,children:i})},"Dialog"),Zj="DialogTrigger",eC=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn(Zj,l),f=Ie(i,u.triggerRef);return s.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":ea(u.open),...c,ref:f,onClick:je(r.onClick,u.onOpenToggle)})},"DialogTrigger")),yx="DialogPortal",[tC,wx]=vx(yx,{forceMount:void 0}),jd=At(n=>{const{__scopeDialog:r,forceMount:i,children:l,container:c}=n,u=cn(yx,r);return s.jsx(tC,{scope:r,forceMount:i,children:m.Children.map(l,f=>s.jsx(Gn,{present:i||u.open,children:s.jsx(xd,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),Uu="DialogOverlay",Cd=m.forwardRef(At(function(r,i){const l=wx(Uu,r.__scopeDialog),{forceMount:c=l.forceMount,...u}=r,f=cn(Uu,r.__scopeDialog);return f.modal?s.jsx(Gn,{present:c||f.open,children:s.jsx(rC,{...u,ref:i})}):null},"DialogOverlay")),nC=$n("DialogOverlay.RemoveScroll"),rC=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn(Uu,l),f=Xv(),h=Ie(i,f);return s.jsx(wd,{as:nC,allowPinchZoom:!0,shards:m.useMemo(()=>[u.contentRef,...u.branchNodes.map(v=>({current:v}))],[u.contentRef,u.branchNodes]),children:s.jsx(ze.div,{"data-state":ea(u.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),Ki="DialogContent",Sd=m.forwardRef(At(function(r,i){const l=wx(Ki,r.__scopeDialog),{forceMount:c=l.forceMount,...u}=r,f=cn(Ki,r.__scopeDialog);return s.jsx(Gn,{present:c||f.open,children:f.modal?s.jsx(oC,{...u,ref:i}):s.jsx(iC,{...u,ref:i})})},"DialogContent")),oC=m.forwardRef(At(function(r,i){const l=cn(Ki,r.__scopeDialog),c=m.useRef(null),u=Ie(i,l.contentRef,c);return m.useEffect(()=>{const f=c.current;if(f)return gx(f)},[]),s.jsx(bx,{...r,ref:u,trapFocus:l.open,disableOutsidePointerEvents:l.open,onCloseAutoFocus:je(r.onCloseAutoFocus,f=>{var h;f.preventDefault(),(h=l.triggerRef.current)==null||h.focus()}),onPointerDownOutside:je(r.onPointerDownOutside,f=>{const h=f.detail.originalEvent,v=h.button===0&&h.ctrlKey===!0;(h.button===2||v)&&f.preventDefault()}),onFocusOutside:je(r.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),iC=m.forwardRef(At(function(r,i){const l=cn(Ki,r.__scopeDialog),c=m.useRef(!1),u=m.useRef(!1);return s.jsx(bx,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var h,v;(h=r.onCloseAutoFocus)==null||h.call(r,f),f.defaultPrevented||(c.current||(v=l.triggerRef.current)==null||v.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var g,y;(g=r.onInteractOutside)==null||g.call(r,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const h=f.target;((y=l.triggerRef.current)==null?void 0:y.contains(h))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),bx=m.forwardRef(At(function(r,i){const{__scopeDialog:l,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,"aria-describedby":h,children:v,...g}=r,y=cn(Ki,l);return Jl(),s.jsx(hd,{registry:y.branchRegistry,children:s.jsx(ex,{asChild:!0,loop:!0,trapped:c,branches:y.branchNodes,onMountAutoFocus:u,onUnmountAutoFocus:f,children:s.jsx(fd,{role:"dialog",id:y.contentId,"aria-labelledby":y.titlePresent?y.titleId:void 0,"aria-describedby":y.descriptionPresent?kx(h,y.descriptionId):h,"data-state":ea(y.open),...g,ref:i,deferPointerDownOutside:!0,onDismiss:()=>y.onOpenChange(!1),children:v})})})},"DialogContentImpl")),Ed=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn("DialogTitle",l),{setTitleCount:f}=u;return wt(()=>(f(h=>h+1),()=>f(h=>h-1)),[f]),s.jsx(ze.h2,{id:u.titleId,...c,ref:i})},"DialogTitle")),_d=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn("DialogDescription",l),{setDescriptionCount:f}=u;return wt(()=>(f(h=>h+1),()=>f(h=>h-1)),[f]),s.jsx(ze.p,{id:u.descriptionId,...c,ref:i})},"DialogDescription")),sC="DialogClose",es=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn(sC,l);return s.jsx(ze.button,{type:"button",...c,ref:i,onClick:je(r.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function kx(...n){const r=new Set;for(const i of n)if(typeof i=="string")for(const l of String(i).trim().split(/\s+/))l&&r.add(l);return r.size>0?Array.from(r).join(" "):void 0}At(kx,"concatAriaDescribedby");function ea(n){return n?"open":"closed"}At(ea,"getState");var lC=Object.defineProperty,Kn=(n,r)=>lC(n,"name",{value:r,configurable:!0}),aC="AlertDialog",[cC,X2]=an(aC,[xx]),Qn=xx(),uC=Kn(n=>{const{__scopeAlertDialog:r,...i}=n,l=Qn(r);return s.jsx(kd,{...l,...i,modal:!0})},"AlertDialog");m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(eC,{...u,...c,ref:i})},"AlertDialogTrigger"));var dC=Kn(n=>{const{__scopeAlertDialog:r,...i}=n,l=Qn(r);return s.jsx(jd,{...l,...i})},"AlertDialogPortal"),fC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(Cd,{...u,...c,ref:i})},"AlertDialogOverlay")),pC="AlertDialogContent",[hC,mC]=cC(pC),gC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,children:c,...u}=r,f=Qn(l),h=m.useRef(null),v=Ie(i,h),g=m.useRef(null);return s.jsx(hC,{scope:l,cancelRef:g,children:s.jsx(Sd,{role:"alertdialog",...f,...u,ref:v,onOpenAutoFocus:je(u.onOpenAutoFocus,y=>{var x;y.preventDefault(),(x=g.current)==null||x.focus({preventScroll:!0})}),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault(),children:c})})},"AlertDialogContent")),vC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(Ed,{...u,...c,ref:i})},"AlertDialogTitle")),xC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(_d,{...u,...c,ref:i})},"AlertDialogDescription")),yC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(es,{...u,...c,ref:i})},"AlertDialogAction")),wC="AlertDialogCancel",bC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,{cancelRef:u}=mC(wC,l),f=Qn(l),h=Ie(i,u);return s.jsx(es,{...f,...c,ref:h})},"AlertDialogCancel")),kC=Object.defineProperty,jC=(n,r)=>kC(n,"name",{value:r,configurable:!0});function Nd(n){const[r,i]=m.useState(void 0);return wt(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});let l=0;const c=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{let h,v;if("borderBoxSize"in f){const g=f.borderBoxSize,y=Array.isArray(g)?g[0]:g;h=y.inlineSize,v=y.blockSize}else h=n.offsetWidth,v=n.offsetHeight;i({width:h,height:v})})});return c.observe(n,{box:"border-box"}),()=>{window.cancelAnimationFrame(l),c.unobserve(n)}}else i(void 0)},[n]),r}jC(Nd,"useSize");var CC=Object.defineProperty,Bn=(n,r)=>CC(n,"name",{value:r,configurable:!0}),Rd="Checkbox",[SC,J2]=an(Rd),[EC,Pd]=SC(Rd);function jx(n){const{__scopeCheckbox:r,checked:i,children:l,defaultChecked:c,disabled:u,form:f,name:h,onCheckedChange:v,required:g,value:y="on",internal_do_not_use_render:x}=n,[b,j]=qo({prop:i,defaultProp:c??!1,onChange:v,caller:Rd}),[k,S]=m.useState(null),[C,E]=m.useState(null),[D,T]=m.useState(null),P=k?!!f||!!k.closest("form"):!0,R={checked:b,disabled:u,setChecked:j,control:k,setControl:S,name:h,form:f,value:y,userClick:D,onUserClick:T,required:g,defaultChecked:qt(c)?!1:c,isFormControl:P,bubbleInput:C,setBubbleInput:E};return s.jsx(EC,{scope:r,...R,children:Cx(x)?x(R):l})}Bn(jx,"CheckboxProvider");var _C="CheckboxTrigger",NC=m.forwardRef(Bn(function({__scopeCheckbox:r,onKeyDown:i,onClick:l,...c},u){const{control:f,value:h,disabled:v,checked:g,required:y,setControl:x,setChecked:b,onUserClick:j,isFormControl:k,bubbleInput:S}=Pd(_C,r),C=Ie(u,x),E=m.useRef(g);return m.useEffect(()=>{const D=f==null?void 0:f.form;if(D){const T=Bn(()=>b(E.current),"reset");return D.addEventListener("reset",T),()=>D.removeEventListener("reset",T)}},[f,b]),s.jsx(ze.button,{type:"button",role:"checkbox","aria-checked":qt(g)?"mixed":g,"aria-required":y,"data-state":Dd(g),"data-disabled":v?"":void 0,disabled:v,value:h,...c,ref:C,onKeyDown:je(i,D=>{D.key==="Enter"&&D.preventDefault()}),onClick:je(l,D=>{const T=D.isPropagationStopped();j({requestedChecked:qt(g)?!0:!g,hasConsumerStoppedPropagation:T}),b(P=>qt(P)?!0:!P),S&&k&&(T||D.stopPropagation())})})},"CheckboxTrigger")),RC=m.forwardRef(Bn(function(r,i){const{__scopeCheckbox:l,name:c,checked:u,defaultChecked:f,required:h,disabled:v,value:g,onCheckedChange:y,form:x,...b}=r;return s.jsx(jx,{__scopeCheckbox:l,checked:u,defaultChecked:f,disabled:v,required:h,onCheckedChange:y,name:c,form:x,value:g,internal_do_not_use_render:({isFormControl:j})=>s.jsxs(s.Fragment,{children:[s.jsx(NC,{...b,ref:i,__scopeCheckbox:l}),j&&s.jsx(OC,{__scopeCheckbox:l})]})})},"Checkbox")),PC="CheckboxIndicator",DC=m.forwardRef(Bn(function(r,i){const{__scopeCheckbox:l,forceMount:c,...u}=r,f=Pd(PC,l);return s.jsx(Gn,{present:c||qt(f.checked)||f.checked===!0,children:s.jsx(ze.span,{"data-state":Dd(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),TC="CheckboxBubbleInput",OC=m.forwardRef(Bn(function({__scopeCheckbox:r,onClick:i,...l},c){const{control:u,userClick:f,checked:h,defaultChecked:v,required:g,disabled:y,name:x,value:b,form:j,bubbleInput:k,setBubbleInput:S}=Pd(TC,r),C=Ie(c,S),E=Nd(u),D=m.useRef(!1),T=m.useRef(h),P=m.useRef(f),R=m.useRef(null);m.useEffect(()=>{const I=k;if(!I)return;const L=window.HTMLInputElement.prototype,ee=Object.getOwnPropertyDescriptor(L,"checked").set;if(!ee)return;const J=T.current!==h;T.current=h;const ne=f!==null&&f!==P.current;if(P.current=f,ne)R.current=J?null:f,J&&(I.indeterminate=qt(h),ee.call(I,qt(h)?!1:h)),I.dispatchEvent(new Event("click",{bubbles:!f.hasConsumerStoppedPropagation}));else if(J){const de=R.current;R.current=null;const re=(de==null?void 0:de.requestedChecked)===h;D.current=!0,I.indeterminate=qt(h),ee.call(I,qt(h)?!1:h),I.dispatchEvent(new Event("click",{bubbles:!(re&&de.hasConsumerStoppedPropagation)})),D.current=!1}},[k,h,f]);const N=m.useRef(qt(h)?!1:h);return s.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??N.current,required:g,disabled:y,name:x,value:b,form:j,...l,tabIndex:-1,ref:C,onClick:je(i,I=>{D.current&&I.stopPropagation()}),style:{...l.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Cx(n){return typeof n=="function"}Bn(Cx,"isFunction");function qt(n){return n==="indeterminate"}Bn(qt,"isIndeterminate");function Dd(n){return qt(n)?"indeterminate":n?"checked":"unchecked"}Bn(Dd,"getState");const MC=["top","right","bottom","left"],_r=Math.min,In=Math.max,Ll=Math.round,jl=Math.floor,Ln=n=>({x:n,y:n}),AC={left:"right",right:"left",bottom:"top",top:"bottom"};function Sx(n,r,i){return In(n,_r(r,i))}function Wn(n,r){return typeof n=="function"?n(r):n}function Nr(n){return n.split("-")[0]}function Xo(n){return n.split("-")[1]}function Td(n){return n==="x"?"y":"x"}function Od(n){return n==="y"?"height":"width"}function xn(n){const r=n[0];return r==="t"||r==="b"?"y":"x"}function Md(n){return Td(xn(n))}function IC(n,r,i){i===void 0&&(i=!1);const l=Xo(n),c=Md(n),u=Od(c);let f=c==="x"?l===(i?"end":"start")?"right":"left":l==="start"?"bottom":"top";return r.reference[u]>r.floating[u]&&(f=zl(f)),[f,zl(f)]}function LC(n){const r=zl(n);return[Bu(n),r,Bu(r)]}function Bu(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Fm=["left","right"],$m=["right","left"],zC=["top","bottom"],FC=["bottom","top"];function $C(n,r,i){switch(n){case"top":case"bottom":return i?r?$m:Fm:r?Fm:$m;case"left":case"right":return r?zC:FC;default:return[]}}function UC(n,r,i,l){const c=Xo(n);let u=$C(Nr(n),i==="start",l);return c&&(u=u.map(f=>f+"-"+c),r&&(u=u.concat(u.map(Bu)))),u}function zl(n){const r=Nr(n);return AC[r]+n.slice(r.length)}function BC(n){var r,i,l,c;return{top:(r=n.top)!=null?r:0,right:(i=n.right)!=null?i:0,bottom:(l=n.bottom)!=null?l:0,left:(c=n.left)!=null?c:0}}function Ex(n){return typeof n!="number"?BC(n):{top:n,right:n,bottom:n,left:n}}function Fl(n){const{x:r,y:i,width:l,height:c}=n;return{width:l,height:c,top:i,left:r,right:r+l,bottom:i+c,x:r,y:i}}function Um(n,r,i){let{reference:l,floating:c}=n;const u=xn(r),f=Md(r),h=Od(f),v=Nr(r),g=u==="y",y=l.x+l.width/2-c.width/2,x=l.y+l.height/2-c.height/2,b=l[h]/2-c[h]/2;let j;switch(v){case"top":j={x:y,y:l.y-c.height};break;case"bottom":j={x:y,y:l.y+l.height};break;case"right":j={x:l.x+l.width,y:x};break;case"left":j={x:l.x-c.width,y:x};break;default:j={x:l.x,y:l.y}}const k=Xo(r);return k&&(j[f]+=b*(k==="end"?1:-1)*(i&&g?-1:1)),j}async function WC(n,r){var i;r===void 0&&(r={});const{x:l,y:c,platform:u,rects:f,elements:h,strategy:v}=n,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:x="floating",altBoundary:b=!1,padding:j=0}=Wn(r,n),k=Ex(j),C=h[b?x==="floating"?"reference":"floating":x],E=Fl(await u.getClippingRect({element:(i=await(u.isElement==null?void 0:u.isElement(C)))==null||i?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(h.floating)),boundary:g,rootBoundary:y,strategy:v})),D=x==="floating"?{x:l,y:c,width:f.floating.width,height:f.floating.height}:f.reference,T=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h.floating)),P=await(u.isElement==null?void 0:u.isElement(T))&&await(u.getScale==null?void 0:u.getScale(T))||{x:1,y:1},R=Fl(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:D,offsetParent:T,strategy:v}):D);return{top:(E.top-R.top+k.top)/P.y,bottom:(R.bottom-E.bottom+k.bottom)/P.y,left:(E.left-R.left+k.left)/P.x,right:(R.right-E.right+k.right)/P.x}}const VC=50,HC=async(n,r,i)=>{const{placement:l="bottom",strategy:c="absolute",middleware:u=[],platform:f}=i,h=f.detectOverflow?f:{...f,detectOverflow:WC},v=await(f.isRTL==null?void 0:f.isRTL(r));let g=await f.getElementRects({reference:n,floating:r,strategy:c}),{x:y,y:x}=Um(g,l,v),b=l,j=0;const k={};for(let S=0;S({name:"arrow",options:n,async fn(r){const{x:i,y:l,placement:c,rects:u,platform:f,elements:h,middlewareData:v}=r,{element:g,padding:y=0}=Wn(n,r)||{};if(g==null)return{};const x=Ex(y),b={x:i,y:l},j=Md(c),k=Od(j),S=await f.getDimensions(g),C=j==="y",E=C?"top":"left",D=C?"bottom":"right",T=C?"clientHeight":"clientWidth",P=u.reference[k]+u.reference[j]-b[j]-u.floating[k],R=b[j]-u.reference[j],N=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let I=N?N[T]:0;(!I||!await(f.isElement==null?void 0:f.isElement(N)))&&(I=h.floating[T]||u.floating[k]);const L=P/2-R/2,Q=I/2-S[k]/2-1,ee=_r(x[E],Q),J=_r(x[D],Q),ne=I-S[k]-J,de=I/2-S[k]/2+L,re=Sx(ee,de,ne),ie=!v.arrow&&Xo(c)!=null&&de!==re&&u.reference[k]/2-(dere<=0)){var J,ne;const re=(((J=u.flip)==null?void 0:J.index)||0)+1,ie=I[re];if(ie&&(!(x==="alignment"?D!==xn(ie):!1)||ee.every(W=>xn(W.placement)===D?W.overflows[0]>0:!0)))return{data:{index:re,overflows:ee},reset:{placement:ie}};let B=(ne=ee.filter(Z=>Z.overflows[0]<=0).sort((Z,W)=>Z.overflows[1]-W.overflows[1])[0])==null?void 0:ne.placement;if(!B)switch(j){case"bestFit":{var de;const Z=(de=ee.filter(W=>{if(N){const q=xn(W.placement);return q===D||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,F)=>q+F,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:de[0];Z&&(B=Z);break}case"initialPlacement":B=h;break}if(c!==B)return{reset:{placement:B}}}return{}}}};function Bm(n,r){return{top:n.top-r.height,right:n.right-r.width,bottom:n.bottom-r.height,left:n.left-r.width}}function Wm(n){return MC.some(r=>n[r]>=0)}const QC=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(r){const{rects:i,platform:l}=r,{strategy:c="referenceHidden",...u}=Wn(n,r);switch(c){case"referenceHidden":{const f=await l.detectOverflow(r,{...u,elementContext:"reference"}),h=Bm(f,i.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:Wm(h)}}}case"escaped":{const f=await l.detectOverflow(r,{...u,altBoundary:!0}),h=Bm(f,i.floating);return{data:{escapedOffsets:h,escaped:Wm(h)}}}default:return{}}}}},_x=new Set(["left","top"]);async function YC(n,r){const{placement:i,platform:l,elements:c}=n,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Nr(i),h=Xo(i),v=xn(i)==="y",g=_x.has(f)?-1:1,y=u&&v?-1:1,x=Wn(r,n);let{mainAxis:b,crossAxis:j,alignmentAxis:k}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return h&&typeof k=="number"&&(j=h==="end"?k*-1:k),v?{x:j*y,y:b*g}:{x:b*g,y:j*y}}const qC=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var i,l;const{x:c,y:u,placement:f,middlewareData:h}=r,v=await YC(r,n);return f===((i=h.offset)==null?void 0:i.placement)&&(l=h.arrow)!=null&&l.alignmentOffset?{}:{x:c+v.x,y:u+v.y,data:{...v,placement:f}}}}},XC=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:i,y:l,placement:c,platform:u}=r,{mainAxis:f=!0,crossAxis:h=!1,limiter:v={fn:D=>{let{x:T,y:P}=D;return{x:T,y:P}}},...g}=Wn(n,r),y={x:i,y:l},x=await u.detectOverflow(r,g),b=xn(c),j=Td(b);let k=y[j],S=y[b];const C=(D,T)=>Sx(T+x[D==="y"?"top":"left"],T,T-x[D==="y"?"bottom":"right"]);f&&(k=C(j,k)),h&&(S=C(b,S));const E=v.fn({...r,[j]:k,[b]:S});return{...E,data:{x:E.x-i,y:E.y-l,enabled:{[j]:f,[b]:h}}}}}},JC=function(n){return n===void 0&&(n={}),{options:n,fn(r){var i,l;const{x:c,y:u,placement:f,rects:h,middlewareData:v}=r,{offset:g=0,mainAxis:y=!0,crossAxis:x=!0}=Wn(n,r),b={x:c,y:u},j=xn(f),k=Td(j);let S=b[k],C=b[j];const E=Wn(g,r),D=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(i=E.mainAxis)!=null?i:0,crossAxis:(l=E.crossAxis)!=null?l:0};if(y){const R=k==="y"?"height":"width",N=h.reference[k]-h.floating[R]+D.mainAxis,I=h.reference[k]+h.reference[R]-D.mainAxis;SI&&(S=I)}if(x){var T,P;const R=k==="y"?"width":"height",N=_x.has(Nr(f)),I=h.reference[j]-h.floating[R]+(N&&((T=v.offset)==null?void 0:T[j])||0)+(N?0:D.crossAxis),L=h.reference[j]+h.reference[R]+(N?0:((P=v.offset)==null?void 0:P[j])||0)-(N?D.crossAxis:0);CL&&(C=L)}return{[k]:S,[j]:C}}}},ZC=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){const{placement:i,rects:l,platform:c,elements:u}=r,{apply:f=()=>{},...h}=Wn(n,r),v=await c.detectOverflow(r,h),g=Nr(i),y=Xo(i),x=xn(i)==="y",{width:b,height:j}=l.floating;let k,S;g==="top"||g==="bottom"?(k=g,S=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(S=g,k=y==="end"?"top":"bottom");const C=j-v.top-v.bottom,E=b-v.left-v.right,D=_r(j-v[k],C),T=_r(b-v[S],E),P=r.middlewareData.shift,R=!P;let N=D,I=T;P!=null&&P.enabled.x&&(I=E),P!=null&&P.enabled.y&&(N=C),R&&!y&&(x?I=b-2*In(v.left,v.right):N=j-2*In(v.top,v.bottom)),await f({...r,availableWidth:I,availableHeight:N});const L=await c.getDimensions(u.floating);return b!==L.width||j!==L.height?{reset:{rects:!0}}:{}}}};function ta(){return typeof window<"u"}function Jo(n){return Nx(n)?(n.nodeName||"").toLowerCase():"#document"}function Ot(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function Yn(n){var r;return(r=(Nx(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Nx(n){return ta()?n instanceof Node||n instanceof Ot(n).Node:!1}function bn(n){return ta()?n instanceof Element||n instanceof Ot(n).Element:!1}function Or(n){return ta()?n instanceof HTMLElement||n instanceof Ot(n).HTMLElement:!1}function Vm(n){return!ta()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ot(n).ShadowRoot}function na(n){const{overflow:r,overflowX:i,overflowY:l,display:c}=kn(n);return/auto|scroll|overlay|hidden|clip/.test(r+l+i)&&c!=="inline"&&c!=="contents"}function eS(n){return/^(table|td|th)$/.test(Jo(n))}function ra(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const tS=/transform|translate|scale|rotate|perspective|filter/,nS=/paint|layout|strict|content/,qr=n=>!!n&&n!=="none";let gu;function Ad(n){const r=bn(n)?kn(n):n;return qr(r.transform)||qr(r.translate)||qr(r.scale)||qr(r.rotate)||qr(r.perspective)||!Id()&&(qr(r.backdropFilter)||qr(r.filter))||tS.test(r.willChange||"")||nS.test(r.contain||"")}function rS(n){let r=Zr(n);for(;Or(r)&&!Qi(r);){if(Ad(r))return r;if(ra(r))return null;r=Zr(r)}return null}function Id(){return gu==null&&(gu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gu}function Qi(n){return/^(html|body|#document)$/.test(Jo(n))}function kn(n){return Ot(n).getComputedStyle(n)}function oa(n){return bn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Zr(n){if(Jo(n)==="html")return n;const r=n.assignedSlot||n.parentNode||Vm(n)&&n.host||Yn(n);return Vm(r)?r.host:r}function Rx(n){const r=Zr(n);return Qi(r)?(n.ownerDocument||n).body:Or(r)&&na(r)?r:Rx(r)}function Yi(n,r,i){var l;r===void 0&&(r=[]),i===void 0&&(i=!0);const c=Rx(n),u=c===((l=n.ownerDocument)==null?void 0:l.body),f=Ot(c);if(u){const h=Wu(f);return r.concat(f,f.visualViewport||[],na(c)?c:[],h&&i?Yi(h):[])}else return r.concat(c,Yi(c,[],i))}function Wu(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Px(n){const r=kn(n);let i=parseFloat(r.width)||0,l=parseFloat(r.height)||0;const c=Or(n),u=c?n.offsetWidth:i,f=c?n.offsetHeight:l,h=Ll(i)!==u||Ll(l)!==f;return h&&(i=u,l=f),{width:i,height:l,$:h}}function Ld(n){return bn(n)?n:n.contextElement}function Wo(n){const r=Ld(n);if(!Or(r))return Ln(1);const i=r.getBoundingClientRect(),{width:l,height:c,$:u}=Px(r);let f=(u?Ll(i.width):i.width)/l,h=(u?Ll(i.height):i.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const oS=Ln(0);function Dx(n){const r=Ot(n);return!Id()||!r.visualViewport?oS:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function iS(n,r,i){return r===void 0&&(r=!1),!!i&&r&&i===Ot(n)}function eo(n,r,i,l){r===void 0&&(r=!1),i===void 0&&(i=!1);const c=n.getBoundingClientRect(),u=Ld(n);let f=Ln(1);r&&(l?bn(l)&&(f=Wo(l)):f=Wo(n));const h=iS(u,i,l)?Dx(u):Ln(0);let v=(c.left+h.x)/f.x,g=(c.top+h.y)/f.y,y=c.width/f.x,x=c.height/f.y;if(u&&l){const b=Ot(u),j=bn(l)?Ot(l):l;let k=b,S=Wu(k);for(;S&&j!==k;){const C=Wo(S),E=S.getBoundingClientRect(),D=kn(S),T=E.left+(S.clientLeft+parseFloat(D.paddingLeft))*C.x,P=E.top+(S.clientTop+parseFloat(D.paddingTop))*C.y;v*=C.x,g*=C.y,y*=C.x,x*=C.y,v+=T,g+=P,k=Ot(S),S=Wu(k)}}return Fl({width:y,height:x,x:v,y:g})}function ia(n,r){const i=oa(n).scrollLeft;return r?r.left+i:eo(Yn(n)).left+i}function Tx(n,r){const i=n.getBoundingClientRect(),l=i.left+r.scrollLeft-ia(n,i),c=i.top+r.scrollTop;return{x:l,y:c}}function sS(n){let{elements:r,rect:i,offsetParent:l,strategy:c}=n;const u=c==="fixed",f=Yn(l),h=r?ra(r.floating):!1;if(l===f||h&&u)return i;let v={scrollLeft:0,scrollTop:0},g=Ln(1);const y=Ln(0),x=Or(l);if((x||!u)&&((Jo(l)!=="body"||na(f))&&(v=oa(l)),x)){const j=eo(l);g=Wo(l),y.x=j.x+l.clientLeft,y.y=j.y+l.clientTop}const b=f&&!x&&!u?Tx(f,v):Ln(0);return{width:i.width*g.x,height:i.height*g.y,x:i.x*g.x-v.scrollLeft*g.x+y.x+b.x,y:i.y*g.y-v.scrollTop*g.y+y.y+b.y}}function lS(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function aS(n){const r=oa(n),i=n.ownerDocument.body,l=In(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),c=In(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let u=-r.scrollLeft+ia(n);const f=-r.scrollTop;return kn(i).direction==="rtl"&&(u+=In(n.clientWidth,i.clientWidth)-l),{width:l,height:c,x:u,y:f}}const cS=25;function uS(n,r,i){i===void 0&&(i="viewport");const l=i==="layoutViewport",c=Ot(n),u=Yn(n),f=c.visualViewport;let h=u.clientWidth,v=u.clientHeight,g=0,y=0;if(f){const b=!Id()||r==="fixed";l?b||(g=-f.offsetLeft,y=-f.offsetTop):(h=f.width,v=f.height,b&&(g=f.offsetLeft,y=f.offsetTop))}if(ia(u)<=0){const b=u.ownerDocument,j=b.body,k=getComputedStyle(j),S=b.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,C=Math.abs(u.clientWidth-j.clientWidth-S),E=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;E<=cS&&(h-=E)}return{width:h,height:v,x:g,y}}function dS(n,r){const i=eo(n,!0,r==="fixed"),l=i.top+n.clientTop,c=i.left+n.clientLeft,u=Wo(n),f=n.clientWidth*u.x,h=n.clientHeight*u.y,v=c*u.x,g=l*u.y;return{width:f,height:h,x:v,y:g}}function Hm(n,r,i){let l;if(r==="viewport"||r==="layoutViewport")l=uS(n,i,r);else if(r==="document")l=aS(Yn(n));else if(bn(r))l=dS(r,i);else{const c=Dx(n);l={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return Fl(l)}function fS(n,r){const i=r.get(n);if(i)return i;let l=Yi(n,[],!1).filter(h=>bn(h)&&Jo(h)!=="body"),c=null;const u=kn(n).position==="fixed";let f=u?Zr(n):n;for(;bn(f)&&!Qi(f);){const h=kn(f),v=Ad(f),g=c?c.position:u?"fixed":"";!v&&(g==="fixed"||g==="absolute"&&h.position==="static")?l=l.filter(x=>x!==f):c=h,f=Zr(f)}return r.set(n,l),l}function pS(n){let{element:r,boundary:i,rootBoundary:l,strategy:c}=n;const f=[...i==="clippingAncestors"?ra(r)?[]:fS(r,this._c):[].concat(i),l],h=Hm(r,f[0],c);let v=h.top,g=h.right,y=h.bottom,x=h.left;for(let b=1;b{h(!1,1e-7)},1e3)}I=!1}try{l=new IntersectionObserver(L,{...N,root:u.ownerDocument})}catch{l=new IntersectionObserver(L,N)}l.observe(n)}const v=Ot(n),g=()=>h(i);return v.addEventListener("resize",g),h(!0),()=>{v.removeEventListener("resize",g),f()}}function wS(n,r,i,l){l===void 0&&(l={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:v=!1}=l,g=Ld(n),y=c||u?[...g?Yi(g):[],...r?Yi(r):[]]:[];y.forEach(E=>{c&&E.addEventListener("scroll",i),u&&E.addEventListener("resize",i)});const x=g&&h?yS(g,i,u):null;let b=-1,j=null;f&&(j=new ResizeObserver(E=>{let[D]=E;D&&D.target===g&&j&&r&&(j.unobserve(r),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var T;(T=j)==null||T.observe(r)})),i()}),g&&!v&&j.observe(g),r&&j.observe(r));let k,S=v?eo(n):null;v&&C();function C(){const E=eo(n);S&&!Mx(S,E)&&i(),S=E,k=requestAnimationFrame(C)}return i(),()=>{var E;y.forEach(D=>{c&&D.removeEventListener("scroll",i),u&&D.removeEventListener("resize",i)}),x==null||x(),(E=j)==null||E.disconnect(),j=null,v&&cancelAnimationFrame(k)}}const bS=qC,kS=XC,jS=KC,CS=ZC,SS=QC,Km=GC,ES=JC,_S=(n,r,i)=>{const l=new Map,c=i??{},u={...xS,...c.platform,_c:l};return HC(n,r,{...c,platform:u})};var NS=typeof document<"u",RS=function(){},Dl=NS?m.useLayoutEffect:RS;function $l(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let i,l,c;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==r.length)return!1;for(l=i;l--!==0;)if(!$l(n[l],r[l]))return!1;return!0}if(c=Object.keys(n),i=c.length,i!==Object.keys(r).length)return!1;for(l=i;l--!==0;)if(!{}.hasOwnProperty.call(r,c[l]))return!1;for(l=i;l--!==0;){const u=c[l];if(!(u==="_owner"&&n.$$typeof)&&!$l(n[u],r[u]))return!1}return!0}return n!==n&&r!==r}function Ax(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Qm(n,r){const i=Ax(n);return Math.round(r*i)/i}function xu(n){const r=m.useRef(n);return Dl(()=>{r.current=n}),r}function PS(n){n===void 0&&(n={});const{placement:r="bottom",strategy:i="absolute",middleware:l=[],platform:c,elements:{reference:u,floating:f}={},transform:h=!0,whileElementsMounted:v,open:g}=n,[y,x]=m.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[b,j]=m.useState(l);$l(b,l)||j(l);const[k,S]=m.useState(null),[C,E]=m.useState(null),D=m.useCallback(W=>{W!==N.current&&(N.current=W,S(W))},[]),T=m.useCallback(W=>{W!==I.current&&(I.current=W,E(W))},[]),P=u||k,R=f||C,N=m.useRef(null),I=m.useRef(null),L=m.useRef(y),Q=v!=null,ee=xu(v),J=xu(c),ne=xu(g),de=m.useCallback(()=>{if(!N.current||!I.current)return;const W={placement:r,strategy:i,middleware:b};J.current&&(W.platform=J.current),_S(N.current,I.current,W).then(q=>{const F={...q,isPositioned:ne.current!==!1};re.current&&!$l(L.current,F)&&(L.current=F,ed.flushSync(()=>{x(F)}))})},[b,r,i,J,ne]);Dl(()=>{g===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,x(W=>({...W,isPositioned:!1})))},[g]);const re=m.useRef(!1);Dl(()=>(re.current=!0,()=>{re.current=!1}),[]),Dl(()=>{if(P&&(N.current=P),R&&(I.current=R),P&&R){if(ee.current)return ee.current(P,R,de);de()}},[P,R,de,ee,Q]);const ie=m.useMemo(()=>({reference:N,floating:I,setReference:D,setFloating:T}),[D,T]),B=m.useMemo(()=>({reference:P,floating:R}),[P,R]),Z=m.useMemo(()=>{const W={position:i,left:0,top:0};if(!B.floating)return W;const q=Qm(B.floating,y.x),F=Qm(B.floating,y.y);return h?{...W,transform:"translate("+q+"px, "+F+"px)",...Ax(B.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:q,top:F}},[i,h,B.floating,y.x,y.y]);return m.useMemo(()=>({...y,update:de,refs:ie,elements:B,floatingStyles:Z}),[y,de,ie,B,Z])}const DS=n=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:n,fn(i){const{element:l,padding:c}=typeof n=="function"?n(i):n;return l&&r(l)?l.current!=null?Km({element:l.current,padding:c}).fn(i):{}:l?Km({element:l,padding:c}).fn(i):{}}}},TS=(n,r)=>{const i=bS(n);return{name:i.name,fn:i.fn,options:[n,r]}},OS=(n,r)=>{const i=kS(n);return{name:i.name,fn:i.fn,options:[n,r]}},MS=(n,r)=>({fn:ES(n).fn,options:[n,r]}),AS=(n,r)=>{const i=jS(n);return{name:i.name,fn:i.fn,options:[n,r]}},IS=(n,r)=>{const i=CS(n);return{name:i.name,fn:i.fn,options:[n,r]}},LS=(n,r)=>{const i=SS(n);return{name:i.name,fn:i.fn,options:[n,r]}},zS=(n,r)=>{const i=DS(n);return{name:i.name,fn:i.fn,options:[n,r]}};var FS=Object.defineProperty,$S=(n,r)=>FS(n,"name",{value:r,configurable:!0}),US=m.forwardRef($S(function(r,i){const{children:l,width:c=10,height:u=5,...f}=r;return s.jsx(ze.svg,{...f,ref:i,width:c,height:u,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:s.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),BS=Object.defineProperty,zn=(n,r)=>BS(n,"name",{value:r,configurable:!0}),Ym={Partial:"partial"},qm={Optimized:"optimized",Always:"always"},Ix="Popper",[Lx,sa]=an(Ix),[WS,zx]=Lx(Ix),Fx=zn(n=>{const{__scopePopper:r,children:i}=n,[l,c]=m.useState(null),[u,f]=m.useState(void 0);return s.jsx(WS,{scope:r,anchor:l,onAnchorChange:c,placementState:u,setPlacementState:f,children:i})},"Popper"),VS="PopperAnchor",$x=m.forwardRef(zn(function(r,i){const{__scopePopper:l,virtualRef:c,...u}=r,f=zx(VS,l),h=m.useRef(null),v=f.onAnchorChange,g=m.useCallback(S=>{h.current=S,S&&v(S)},[v]),y=Ie(i,g),x=m.useRef(null);m.useEffect(()=>{if(!c)return;const S=x.current;x.current=c.current,S!==x.current&&v(x.current)});const b=f.placementState&&la(f.placementState),j=b==null?void 0:b[0],k=b==null?void 0:b[1];return c?null:s.jsx(ze.div,{"data-radix-popper-side":j,"data-radix-popper-align":k,...u,ref:y})},"PopperAnchor")),Ux="PopperContent",[HS,GS]=Lx(Ux),Bx=m.forwardRef(zn(function(r,i){var me,Be,mt,It,ut,tt,Jn;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:f="center",alignOffset:h=0,arrowPadding:v=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:x=0,sticky:b=Ym.Partial,hideWhenDetached:j=!1,updatePositionStrategy:k=qm.Optimized,onPlaced:S,...C}=r,E=zx(Ux,l),[D,T]=m.useState(null),P=Ie(i,T),[R,N]=m.useState(null),I=Nd(R),L=(I==null?void 0:I.width)??0,Q=(I==null?void 0:I.height)??0,ee=c+(f!=="center"?"-"+f:""),J=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ne=Array.isArray(y)?y:[y],de=ne.length>0,re={padding:J,boundary:ne.filter(Wx),altBoundary:de},{refs:ie,floatingStyles:B,placement:Z,isPositioned:W,middlewareData:q}=PS({strategy:"fixed",placement:ee,whileElementsMounted:zn((...Cn)=>wS(...Cn,{animationFrame:k===qm.Always}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[TS({mainAxis:u+Q,alignmentAxis:h}),g&&OS({mainAxis:!0,crossAxis:!1,...b===Ym.Partial?{limiter:MS()}:{},...re}),g&&AS({...re}),IS({...re,apply:zn(({elements:Cn,rects:dt,availableWidth:is,availableHeight:ti})=>{const{width:Mr,height:Zn}=dt.reference,er=Cn.floating.style;er.setProperty("--radix-popper-available-width",`${is}px`),er.setProperty("--radix-popper-available-height",`${ti}px`),er.setProperty("--radix-popper-anchor-width",`${Mr}px`),er.setProperty("--radix-popper-anchor-height",`${Zn}px`)},"apply")}),R&&zS({element:R,padding:v}),qS({arrowWidth:L,arrowHeight:Q}),j&&LS(de?{strategy:"referenceHidden",...re}:{strategy:"referenceHidden",padding:re.padding,altBoundary:re.altBoundary})]}),F=E.setPlacementState;wt(()=>(F(Z),()=>{F(void 0)}),[Z,F]);const[M,V]=la(Z),he=wn(S);wt(()=>{W&&(he==null||he())},[W,he]);const be=(me=q.arrow)==null?void 0:me.x,pe=(Be=q.arrow)==null?void 0:Be.y,Y=((mt=q.arrow)==null?void 0:mt.centerOffset)!==0,[we,ke]=m.useState();return wt(()=>{D&&ke(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:ie.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:W?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(It=q.transformOrigin)==null?void 0:It.x,(ut=q.transformOrigin)==null?void 0:ut.y].join(" "),...((tt=q.hide)==null?void 0:tt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:s.jsx(HS,{scope:l,placedSide:M,placedAlign:V,onArrowChange:N,arrowX:be,arrowY:pe,shouldHideArrow:Y,children:s.jsx(ze.div,{"data-side":M,"data-align":V,...C,ref:P,style:{...C.style,animation:W?(Jn=C.style)==null?void 0:Jn.animation:"none"}})})})},"PopperContent")),KS="PopperArrow",QS={top:"bottom",right:"left",bottom:"top",left:"right"},YS=m.forwardRef(zn(function(r,i){const{__scopePopper:l,...c}=r,u=GS(KS,l),f=QS[u.placedSide];return s.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:s.jsx(US,{...c,ref:i,style:{...c.style,display:"block"}})})},"PopperArrow"));function Wx(n){return n!==null}zn(Wx,"isNotNull");var qS=zn(n=>({name:"transformOrigin",options:n,fn(r){var C,E,D;const{placement:i,rects:l,middlewareData:c}=r,f=((C=c.arrow)==null?void 0:C.centerOffset)!==0,h=f?0:n.arrowWidth,v=f?0:n.arrowHeight,[g,y]=la(i),x={start:"0%",center:"50%",end:"100%"}[y],b=(((E=c.arrow)==null?void 0:E.x)??0)+h/2,j=(((D=c.arrow)==null?void 0:D.y)??0)+v/2;let k="",S="";return g==="bottom"?(k=f?x:`${b}px`,S=`${-v}px`):g==="top"?(k=f?x:`${b}px`,S=`${l.floating.height+v}px`):g==="right"?(k=`${-v}px`,S=f?x:`${j}px`):g==="left"&&(k=`${l.floating.width+v}px`,S=f?x:`${j}px`),{data:{x:k,y:S}}}}),"transformOrigin");function la(n){const[r,i="center"]=n.split("-");return[r,i]}zn(la,"getSideAndAlignFromPlacement");var XS=Object.defineProperty,zd=(n,r)=>XS(n,"name",{value:r,configurable:!0}),yu=!1;function Vx(){const[n,r]=m.useState(yu);return m.useEffect(()=>{yu||(yu=!0,r(!0))},[]),n}zd(Vx,"useIsHydrated");var Hx=Rr[" useSyncExternalStore ".trim().toString()];function Gx(){return()=>{}}zd(Gx,"subscribe");function Kx(){return Hx(Gx,()=>!0,()=>!1)}zd(Kx,"useIsHydratedModern");var JS=typeof Hx=="function"?Kx:Vx,ZS=Object.defineProperty,so=(n,r)=>ZS(n,"name",{value:r,configurable:!0}),wu="rovingFocusGroup.onEntryFocus",eE={bubbles:!1,cancelable:!0},aa="RovingFocusGroup",[Vu,Qx,tE]=cd(aa),[nE,Yx]=an(aa,[tE]),Xm={Vertical:"vertical",Horizontal:"horizontal"},rE={RTL:"rtl"},[oE,iE]=nE(aa),sE=m.forwardRef(so(function(r,i){return s.jsx(Vu.Provider,{scope:r.__scopeRovingFocusGroup,children:s.jsx(Vu.Slot,{scope:r.__scopeRovingFocusGroup,children:s.jsx(lE,{...r,ref:i})})})},"RovingFocusGroup")),lE=m.forwardRef(so(function(r,i){const{__scopeRovingFocusGroup:l,orientation:c,loop:u=!1,dir:f,currentTabStopId:h,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:x=!1,...b}=r,j=m.useRef(null),k=Ie(i,j),S=dd(f),[C,E]=qo({prop:h,defaultProp:v??null,onChange:g,caller:aa}),[D,T]=m.useState(!1),P=wn(y),R=Qx(l),N=m.useRef(!1),[I,L]=m.useState(0);return m.useEffect(()=>{const Q=j.current;if(Q)return Q.addEventListener(wu,P),()=>Q.removeEventListener(wu,P)},[P]),s.jsx(oE,{scope:l,orientation:c,dir:S,loop:u,currentTabStopId:C,onItemFocus:m.useCallback(Q=>E(Q),[E]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>L(Q=>Q+1),[]),onFocusableItemRemove:m.useCallback(()=>L(Q=>Q-1),[]),children:s.jsx(ze.div,{tabIndex:D||I===0?-1:0,"data-orientation":c,...b,ref:k,style:{outline:"none",...r.style},onMouseDown:je(r.onMouseDown,()=>{N.current=!0}),onFocus:je(r.onFocus,Q=>{const ee=!N.current;if(Q.target===Q.currentTarget&&ee&&!D){const J=new CustomEvent(wu,eE);if(Q.currentTarget.dispatchEvent(J),!J.defaultPrevented){const ne=R().filter(Z=>Z.focusable),de=ne.find(Z=>Z.active),re=ne.find(Z=>Z.id===C),B=[de,re,...ne].filter(Boolean).map(Z=>Z.ref.current);Fd(B,x)}}N.current=!1}),onBlur:je(r.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),aE="RovingFocusGroupItem",cE=m.forwardRef(so(function(r,i){const{__scopeRovingFocusGroup:l,focusable:c=!0,active:u=!1,tabStopId:f,children:h,...v}=r,g=Sr(),y=f||g,x=iE(aE,l),b=x.currentTabStopId===y,j=Qx(l),{onFocusableItemAdd:k,onFocusableItemRemove:S,currentTabStopId:C}=x,E=JS();return wt(()=>{if(!(!E||!c))return k(),()=>S()},[E,c,k,S]),m.useEffect(()=>{if(!(E||!c))return k(),()=>S()},[E,c,k,S]),s.jsx(Vu.ItemSlot,{scope:l,id:y,focusable:c,active:u,children:s.jsx(ze.span,{tabIndex:b?0:-1,"data-orientation":x.orientation,...v,ref:i,onMouseDown:je(r.onMouseDown,D=>{c?x.onItemFocus(y):D.preventDefault()}),onFocus:je(r.onFocus,()=>x.onItemFocus(y)),onKeyDown:je(r.onKeyDown,D=>{if(D.key==="Tab"&&D.shiftKey){x.onItemShiftTab();return}if(D.target!==D.currentTarget)return;const T=Xx(D,x.orientation,x.dir);if(T!==void 0){if(D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;D.preventDefault();let R=j().filter(N=>N.focusable).map(N=>N.ref.current);if(T==="last")R.reverse();else if(T==="prev"||T==="next"){T==="prev"&&R.reverse();const N=R.indexOf(D.currentTarget);R=x.loop?Jx(R,N+1):R.slice(N+1)}setTimeout(()=>Fd(R))}}),children:typeof h=="function"?h({isCurrentTabStop:b,hasTabStop:C!=null}):h})})},"RovingFocusGroupItem")),uE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qx(n,r){return r!==rE.RTL?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}so(qx,"getDirectionAwareKey");function Xx(n,r,i){const l=qx(n.key,i);if(!(r===Xm.Vertical&&["ArrowLeft","ArrowRight"].includes(l))&&!(r===Xm.Horizontal&&["ArrowUp","ArrowDown"].includes(l)))return uE[l]}so(Xx,"getFocusIntent");function Fd(n,r=!1){const i=document.activeElement;for(const l of n)if(l===i||(l.focus({preventScroll:r}),document.activeElement!==i))return}so(Fd,"focusFirst");function Jx(n,r){return n.map((i,l)=>n[(r+l)%n.length])}so(Jx,"wrapArray");var dE=Object.defineProperty,Oe=(n,r)=>dE(n,"name",{value:r,configurable:!0}),fE=["Enter"," "],pE=["ArrowDown","PageUp","Home"],Zx=["ArrowUp","PageDown","End"],hE=[...pE,...Zx],ca="Menu",[Hu,mE,gE]=cd(ca),[lo,ey]=an(ca,[gE,sa,Yx]),$d=sa(),ty=Yx(),[vE,ts]=lo(ca),[xE,Ud]=lo(ca),yE=Oe(n=>{const{__scopeMenu:r,open:i=!1,children:l,dir:c,onOpenChange:u,modal:f=!0}=n,h=$d(r),[v,g]=m.useState(null),y=m.useRef(!1),x=wn(u),b=dd(c);return m.useEffect(()=>{const j=Oe(()=>{y.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},"handleKeyDown"),k=Oe(()=>y.current=!1,"handlePointer");return document.addEventListener("keydown",j,{capture:!0}),()=>{document.removeEventListener("keydown",j,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),m.useEffect(()=>{if(!i)return;const j=Oe(()=>x(!1),"handleBlur");return window.addEventListener("blur",j),()=>window.removeEventListener("blur",j)},[i,x]),s.jsx(Fx,{...h,children:s.jsx(vE,{scope:r,open:i,onOpenChange:x,content:v,onContentChange:g,children:s.jsx(xE,{scope:r,onClose:m.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:y,dir:b,modal:f,children:l})})})},"Menu"),wE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r,u=$d(l);return s.jsx($x,{...u,...c,ref:i})},"MenuAnchor")),ny="MenuPortal",[bE,kE]=lo(ny,{forceMount:void 0}),jE=Oe(n=>{const{__scopeMenu:r,forceMount:i,children:l,container:c}=n,u=ts(ny,r);return s.jsx(bE,{scope:r,forceMount:i,children:s.jsx(Gn,{present:i||u.open,children:s.jsx(xd,{asChild:!0,container:c,children:l})})})},"MenuPortal"),Er="MenuContent",[CE,ry]=lo(Er),SE=m.forwardRef(Oe(function(r,i){const l=kE(Er,r.__scopeMenu),{forceMount:c=l.forceMount,...u}=r,f=ts(Er,r.__scopeMenu),h=Ud(Er,r.__scopeMenu);return s.jsx(Hu.Provider,{scope:r.__scopeMenu,children:s.jsx(Gn,{present:c||f.open,children:s.jsx(Hu.Slot,{scope:r.__scopeMenu,children:h.modal?s.jsx(EE,{...u,ref:i}):s.jsx(_E,{...u,ref:i})})})})},"MenuContent")),EE=m.forwardRef(Oe(function(r,i){const l=ts(Er,r.__scopeMenu),c=m.useRef(null),u=Ie(i,c);return m.useEffect(()=>{const f=c.current;if(f)return gx(f)},[]),s.jsx(oy,{...r,ref:u,trapFocus:l.open,disableOutsidePointerEvents:l.open,disableOutsideScroll:!0,onFocusOutside:je(r.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>l.onOpenChange(!1)})},"MenuRootContentModal")),_E=m.forwardRef(Oe(function(r,i){const l=ts(Er,r.__scopeMenu);return s.jsx(oy,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>l.onOpenChange(!1)})},"MenuRootContentNonModal")),NE=$n("MenuContent.ScrollLock"),oy=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,loop:c=!1,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:h,disableOutsidePointerEvents:v,onEntryFocus:g,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:j,onDismiss:k,disableOutsideScroll:S,...C}=r,E=ts(Er,l),D=Ud(Er,l),T=$d(l),P=ty(l),R=mE(l),[N,I]=m.useState(null),L=m.useRef(null),[Q,ee]=m.useState(null);gd(Q);const{nodes:J,registry:ne}=md(),de=!!(u||S),re=Ie(i,L,E.onContentChange,ee),ie=m.useRef(0),B=m.useRef(""),Z=m.useRef(0),W=m.useRef(null),q=m.useRef("right"),F=m.useRef(0),M=m.useMemo(()=>S?[L,...J.map(Y=>({current:Y}))]:[],[L,J,S]),V=S?wd:m.Fragment,he=S?{as:NE,allowPinchZoom:!0,shards:M}:void 0,be=Oe(Y=>{var Jn,Cn;const we=B.current+Y,ke=R().filter(dt=>!dt.disabled),me=document.activeElement,Be=(Jn=ke.find(dt=>dt.ref.current===me))==null?void 0:Jn.textValue,mt=ke.map(dt=>dt.textValue),It=cy(mt,we,Be),ut=(Cn=ke.find(dt=>dt.textValue===It))==null?void 0:Cn.ref.current;function tt(dt){B.current=dt,window.clearTimeout(ie.current),dt!==""&&(ie.current=window.setTimeout(()=>tt(""),1e3))}Oe(tt,"updateSearch"),tt(we),ut&&setTimeout(()=>ut.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(ie.current),[]),Jl();const pe=m.useCallback(Y=>{var ke,me;return q.current===((ke=W.current)==null?void 0:ke.side)&&dy(Y,(me=W.current)==null?void 0:me.area)},[]);return s.jsx(CE,{scope:l,searchRef:B,onItemEnter:m.useCallback(Y=>{pe(Y)&&Y.preventDefault()},[pe]),onItemLeave:m.useCallback(Y=>{var we;pe(Y)||((we=L.current)==null||we.focus(),I(null))},[pe]),onTriggerLeave:m.useCallback(Y=>{pe(Y)&&Y.preventDefault()},[pe]),pointerGraceTimerRef:Z,onPointerGraceIntentChange:m.useCallback(Y=>{W.current=Y},[]),children:s.jsx(hd,{registry:de?ne:null,children:s.jsx(V,{...he,children:s.jsx(ex,{asChild:!0,trapped:u,branches:J,onMountAutoFocus:je(f,Y=>{var we;Y.preventDefault(),(we=L.current)==null||we.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:s.jsx(fd,{asChild:!0,disableOutsidePointerEvents:v,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:j,onDismiss:k,children:s.jsx(sE,{asChild:!0,...P,dir:D.dir,orientation:"vertical",loop:c,currentTabStopId:N,onCurrentTabStopIdChange:I,onEntryFocus:je(g,Y=>{D.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Bx,{role:"menu","aria-orientation":"vertical","data-state":sy(E.open),"data-radix-menu-content":"",dir:D.dir,...T,...C,ref:re,style:{outline:"none",...C.style},onKeyDown:je(C.onKeyDown,Y=>{const ke=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,me=Y.ctrlKey||Y.altKey||Y.metaKey,Be=Y.key.length===1;ke&&(Y.key==="Tab"&&Y.preventDefault(),!me&&Be&&be(Y.key));const mt=L.current;if(Y.target!==mt||!hE.includes(Y.key))return;Y.preventDefault();const ut=R().filter(tt=>!tt.disabled).map(tt=>tt.ref.current);Zx.includes(Y.key)&&ut.reverse(),ly(ut)}),onBlur:je(r.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(ie.current),B.current="")}),onPointerMove:je(r.onPointerMove,Ul(Y=>{const we=Y.target,ke=F.current!==Y.clientX;if(Y.currentTarget.contains(we)&&ke){const me=Y.clientX>F.current?"right":"left";q.current=me,F.current=Y.clientX}}))})})})})})})})},"MenuContentImpl")),RE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r;return s.jsx(ze.div,{role:"group",...c,ref:i})},"MenuGroup")),PE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r;return s.jsx(ze.div,{...c,ref:i})},"MenuLabel")),Gu="MenuItem",Jm="menu.itemSelect",DE=m.forwardRef(Oe(function(r,i){const{disabled:l=!1,onSelect:c,...u}=r,f=m.useRef(null),h=Ud(Gu,r.__scopeMenu),v=ry(Gu,r.__scopeMenu),g=Ie(i,f),y=m.useRef(!1),x=Oe(()=>{const b=f.current;if(!l&&b){const j=new CustomEvent(Jm,{bubbles:!0,cancelable:!0});b.addEventListener(Jm,k=>c==null?void 0:c(k),{once:!0}),ad(b,j),j.defaultPrevented?y.current=!1:h.onClose()}},"handleSelect");return s.jsx(TE,{...u,ref:g,disabled:l,onClick:je(r.onClick,x),onPointerDown:b=>{var j;(j=r.onPointerDown)==null||j.call(r,b),y.current=!0},onPointerUp:je(r.onPointerUp,b=>{var j;y.current||(j=b.currentTarget)==null||j.click()}),onKeyDown:je(r.onKeyDown,b=>{l||b.target!==b.currentTarget||v.searchRef.current!==""&&b.key===" "||fE.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),TE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,disabled:c=!1,textValue:u,...f}=r,h=ry(Gu,l),v=ty(l),g=m.useRef(null),y=Ie(i,g),[x,b]=m.useState(!1),[j,k]=m.useState("");return m.useEffect(()=>{const S=g.current;S&&k((S.textContent??"").trim())},[f.children]),s.jsx(Hu.ItemSlot,{scope:l,disabled:c,textValue:u??j,children:s.jsx(cE,{asChild:!0,...v,focusable:!c,children:s.jsx(ze.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:y,onPointerMove:je(r.onPointerMove,Ul(S=>{c?h.onItemLeave(S):(h.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(r.onPointerLeave,Ul(S=>h.onItemLeave(S))),onFocus:je(r.onFocus,()=>b(!0)),onBlur:je(r.onBlur,()=>b(!1))})})})},"MenuItemImpl")),OE="MenuRadioGroup",[ME,AE]=lo(OE,{value:void 0,onValueChange:Oe(()=>{},"onValueChange")}),IE=m.forwardRef(Oe(function(r,i){const{value:l,onValueChange:c,...u}=r,f=wn(c);return s.jsx(ME,{scope:r.__scopeMenu,value:l,onValueChange:f,children:s.jsx(RE,{...u,ref:i})})},"MenuRadioGroup")),LE="MenuRadioItem",zE=m.forwardRef(Oe(function(r,i){const{value:l,...c}=r,u=AE(LE,r.__scopeMenu),f=l===u.value;return s.jsx(FE,{scope:r.__scopeMenu,checked:f,children:s.jsx(DE,{role:"menuitemradio","aria-checked":f,...c,ref:i,"data-state":Wd(f),onSelect:je(c.onSelect,()=>{var h;return(h=u.onValueChange)==null?void 0:h.call(u,l)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),iy="MenuItemIndicator",[FE,$E]=lo(iy,{checked:!1}),UE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,forceMount:c,...u}=r,f=$E(iy,l);return s.jsx(Gn,{present:c||Bd(f.checked)||f.checked===!0,children:s.jsx(ze.span,{...u,ref:i,"data-state":Wd(f.checked)})})},"MenuItemIndicator")),BE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r;return s.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...c,ref:i})},"MenuSeparator")),WE="MenuSub",[Z2,eN]=lo(WE);function sy(n){return n?"open":"closed"}Oe(sy,"getOpenState");function Bd(n){return n==="indeterminate"}Oe(Bd,"isIndeterminate");function Wd(n){return Bd(n)?"indeterminate":n?"checked":"unchecked"}Oe(Wd,"getCheckedState");function ly(n){const r=document.activeElement;for(const i of n)if(i===r||(i.focus(),document.activeElement!==r))return}Oe(ly,"focusFirst");function ay(n,r){return n.map((i,l)=>n[(r+l)%n.length])}Oe(ay,"wrapArray");function cy(n,r,i){const c=r.length>1&&Array.from(r).every(g=>g===r[0])?r[0]:r,u=i?n.indexOf(i):-1;let f=ay(n,Math.max(u,0));c.length===1&&(f=f.filter(g=>g!==i));const v=f.find(g=>g.toLowerCase().startsWith(c.toLowerCase()));return v!==i?v:void 0}Oe(cy,"getNextMatch");function uy(n,r){const{x:i,y:l}=n;let c=!1;for(let u=0,f=r.length-1;ul!=b>l&&i<(x-g)*(l-y)/(b-y)+g&&(c=!c)}return c}Oe(uy,"isPointInPolygon");function dy(n,r){if(!r)return!1;const i={x:n.clientX,y:n.clientY};return uy(i,r)}Oe(dy,"isPointerInGraceArea");function Ul(n){return r=>r.pointerType==="mouse"?n(r):void 0}Oe(Ul,"whenMouse");var VE=Object.defineProperty,qn=(n,r)=>VE(n,"name",{value:r,configurable:!0}),Vd="DropdownMenu",[HE,tN]=an(Vd,[ey]),Xn=ey(),[GE,fy]=HE(Vd),KE=qn(n=>{const{__scopeDropdownMenu:r,children:i,dir:l,open:c,defaultOpen:u,onOpenChange:f,modal:h=!0}=n,v=Xn(r),g=m.useRef(null),[y,x]=qo({prop:c,defaultProp:u??!1,onChange:f,caller:Vd});return s.jsx(GE,{scope:r,triggerId:Sr(),triggerRef:g,contentId:Sr(),open:y,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(b=>!b),[x]),modal:h,children:s.jsx(yE,{...v,open:y,onOpenChange:x,dir:l,modal:h,children:i})})},"DropdownMenu"),QE="DropdownMenuTrigger",YE=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,disabled:c=!1,...u}=r,f=fy(QE,l),h=Xn(l),v=Ie(i,f.triggerRef);return s.jsx(wE,{asChild:!0,...h,children:s.jsx(ze.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:v,onPointerDown:je(r.onPointerDown,g=>{!c&&g.button===0&&g.ctrlKey===!1&&(f.onOpenToggle(),f.open||g.preventDefault())}),onKeyDown:je(r.onKeyDown,g=>{c||(["Enter"," "].includes(g.key)&&f.onOpenToggle(),g.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})},"DropdownMenuTrigger")),qE=qn(n=>{const{__scopeDropdownMenu:r,...i}=n,l=Xn(r);return s.jsx(jE,{...l,...i})},"DropdownMenuPortal"),XE="DropdownMenuContent",JE=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=fy(XE,l),f=Xn(l),h=m.useRef(!1);return s.jsx(SE,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:i,onCloseAutoFocus:je(r.onCloseAutoFocus,v=>{var g;h.current||(g=u.triggerRef.current)==null||g.focus(),h.current=!1,v.preventDefault()}),onInteractOutside:je(r.onInteractOutside,v=>{const g=v.detail.originalEvent,y=g.button===0&&g.ctrlKey===!0,x=g.button===2||y;(!u.modal||x)&&(h.current=!0)}),style:{...r.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)"}})},"DropdownMenuContent")),ZE=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(PE,{...u,...c,ref:i})},"DropdownMenuLabel")),e_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(IE,{...u,...c,ref:i})},"DropdownMenuRadioGroup")),t_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(zE,{...u,...c,ref:i})},"DropdownMenuRadioItem")),n_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(UE,{...u,...c,ref:i})},"DropdownMenuItemIndicator")),r_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(BE,{...u,...c,ref:i})},"DropdownMenuSeparator")),o_=Object.defineProperty,i_=(n,r)=>o_(n,"name",{value:r,configurable:!0}),s_=m.forwardRef(i_(function(r,i){return s.jsx(ze.label,{...r,ref:i,onMouseDown:l=>{var u;l.target.closest("button, input, select, textarea")||((u=r.onMouseDown)==null||u.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}})},"Label")),l_=Object.defineProperty,py=(n,r)=>l_(n,"name",{value:r,configurable:!0}),Hd={Horizontal:"horizontal",Vertical:"vertical"},Zm=Hd.Horizontal,a_=Object.values(Hd),c_=m.forwardRef(py(function(r,i){const{decorative:l,orientation:c=Zm,...u}=r,f=hy(c)?c:Zm,h=f===Hd.Vertical?f:void 0,v=l?{role:"none"}:{"aria-orientation":h,role:"separator"};return s.jsx(ze.div,{"data-orientation":f,...v,...u,ref:i})},"Separator"));function hy(n){return a_.includes(n)}py(hy,"isValidOrientation");var u_=Object.defineProperty,et=(n,r)=>u_(n,"name",{value:r,configurable:!0}),[Gd,nN]=an("Tooltip",[sa]),ua=sa(),d_="TooltipProvider",f_=700,Ku="tooltip.open",[p_,Kd]=Gd(d_),h_=et(n=>{const{__scopeTooltip:r,delayDuration:i=f_,skipDelayDuration:l=300,disableHoverableContent:c=!1,children:u}=n,f=m.useRef(!0),h=m.useRef(!1),v=m.useRef(0);return m.useEffect(()=>{const g=v.current;return()=>window.clearTimeout(g)},[]),s.jsx(p_,{scope:r,isOpenDelayedRef:f,delayDuration:i,onOpen:m.useCallback(()=>{l<=0||(window.clearTimeout(v.current),f.current=!1)},[l]),onClose:m.useCallback(()=>{l<=0||(window.clearTimeout(v.current),v.current=window.setTimeout(()=>f.current=!0,l))},[l]),isPointerInTransitRef:h,onPointerInTransitChange:m.useCallback(g=>{h.current=g},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),Qu="Tooltip",[m_,ns]=Gd(Qu),g_=et(n=>{const{__scopeTooltip:r,children:i,open:l,defaultOpen:c,onOpenChange:u,disableHoverableContent:f,delayDuration:h}=n,v=Kd(Qu,n.__scopeTooltip),g=ua(r),[y,x]=m.useState(null),[b,j]=m.useState(void 0),k=Sr(),S=m.useRef(0),C=f??v.disableHoverableContent,E=h??v.delayDuration,D=m.useRef(!1),[T,P]=qo({prop:l,defaultProp:c??!1,onChange:et(ee=>{ee?(v.onOpen(),document.dispatchEvent(new CustomEvent(Ku))):v.onClose(),u==null||u(ee)},"onChange"),caller:Qu}),R=m.useMemo(()=>T?D.current?"delayed-open":"instant-open":"closed",[T]),N=m.useCallback(()=>{window.clearTimeout(S.current),S.current=0,D.current=!1,P(!0)},[P]),I=m.useCallback(()=>{window.clearTimeout(S.current),S.current=0,P(!1)},[P]),L=m.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{D.current=!0,P(!0),S.current=0},E)},[E,P]);m.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const Q=b??k;return s.jsx(Fx,{...g,children:s.jsx(m_,{scope:r,contentId:Q,setContentId:j,open:T,stateAttribute:R,trigger:y,onTriggerChange:x,onTriggerEnter:m.useCallback(()=>{v.isOpenDelayedRef.current?L():N()},[v.isOpenDelayedRef,L,N]),onTriggerLeave:m.useCallback(()=>{C?I():(window.clearTimeout(S.current),S.current=0)},[I,C]),onOpen:N,onClose:I,disableHoverableContent:C,children:i})})},"Tooltip"),eg="TooltipTrigger",v_=m.forwardRef(et(function(r,i){const{__scopeTooltip:l,"aria-describedby":c,...u}=r,f=ns(eg,l),h=Kd(eg,l),v=ua(l),g=m.useRef(null),y=Ie(i,g,f.onTriggerChange),x=m.useRef(!1),b=m.useRef(!1),j=m.useCallback(()=>x.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",j),[j]),s.jsx($x,{asChild:!0,...v,children:s.jsx(ze.button,{"aria-describedby":f.open?jy(c,f.contentId):c,"data-state":f.stateAttribute,...u,ref:y,onPointerMove:je(r.onPointerMove,k=>{k.pointerType!=="touch"&&!b.current&&!h.isPointerInTransitRef.current&&(f.onTriggerEnter(),b.current=!0)}),onPointerLeave:je(r.onPointerLeave,()=>{f.onTriggerLeave(),b.current=!1}),onPointerDown:je(r.onPointerDown,()=>{f.open&&f.onClose(),x.current=!0,document.addEventListener("pointerup",j,{once:!0})}),onFocus:je(r.onFocus,()=>{x.current||f.onOpen()}),onBlur:je(r.onBlur,f.onClose),onClick:je(r.onClick,f.onClose)})})},"TooltipTrigger")),my="TooltipPortal",[x_,y_]=Gd(my,{forceMount:void 0}),w_=et(n=>{const{__scopeTooltip:r,forceMount:i,children:l,container:c}=n,u=ns(my,r);return s.jsx(x_,{scope:r,forceMount:i,children:s.jsx(Gn,{present:i||u.open,children:s.jsx(xd,{asChild:!0,container:c,children:l})})})},"TooltipPortal"),qi="TooltipContent",b_=m.forwardRef(et(function(r,i){const l=y_(qi,r.__scopeTooltip),{forceMount:c=l.forceMount,side:u="top",...f}=r,h=ns(qi,r.__scopeTooltip);return s.jsx(Gn,{present:c||h.open,children:h.disableHoverableContent?s.jsx(gy,{side:u,...f,ref:i}):s.jsx(k_,{side:u,...f,ref:i})})},"TooltipContent")),k_=m.forwardRef(et(function(r,i){const l=ns(qi,r.__scopeTooltip),c=Kd(qi,r.__scopeTooltip),u=m.useRef(null),f=Ie(i,u),[h,v]=m.useState(null),{trigger:g,onClose:y}=l,x=u.current,{onPointerInTransitChange:b}=c,j=m.useCallback(()=>{v(null),b(!1)},[b]),k=m.useCallback((S,C)=>{const E=S.currentTarget,D={x:S.clientX,y:S.clientY},T=vy(D,E.getBoundingClientRect()),P=xy(D,T),R=yy(C.getBoundingClientRect()),N=by([...P,...R]);v(N),b(!0)},[b]);return m.useEffect(()=>()=>j(),[j]),m.useEffect(()=>{if(g&&x){const S=et(E=>k(E,x),"handleTriggerLeave"),C=et(E=>k(E,g),"handleContentLeave");return g.addEventListener("pointerleave",S),x.addEventListener("pointerleave",C),()=>{g.removeEventListener("pointerleave",S),x.removeEventListener("pointerleave",C)}}},[g,x,k,j]),m.useEffect(()=>{if(h){const S=et(C=>{const E=C.target,D={x:C.clientX,y:C.clientY},T=(g==null?void 0:g.contains(E))||(x==null?void 0:x.contains(E)),P=!wy(D,h);T?j():P&&(j(),y())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[g,x,h,y,j]),s.jsx(gy,{...r,ref:f})},"TooltipContentHoverable")),j_=_v("TooltipContent"),gy=m.forwardRef(et(function(r,i){const{__scopeTooltip:l,children:c,"aria-label":u,id:f,onEscapeKeyDown:h,onPointerDownOutside:v,...g}=r,y=ns(qi,l),x=ua(l),{onClose:b}=y,[j,k]=m.useState(null),S=Ie(i,k);gd(j),m.useEffect(()=>(document.addEventListener(Ku,b),()=>document.removeEventListener(Ku,b)),[b]),m.useEffect(()=>{if(y.trigger){const E=et(D=>{D.target instanceof Node&&D.target.contains(y.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",E,{capture:!0}),()=>window.removeEventListener("scroll",E,{capture:!0})}},[y.trigger,b]);const{setContentId:C}=y;return wt(()=>(C(f),()=>{C(void 0)}),[f,C]),s.jsx(fd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:E=>E.preventDefault(),onDismiss:b,children:s.jsxs(Bx,{"data-state":y.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:y.contentId,...x,...g,ref:S,style:{...g.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(j_,{children:c}),u?s.jsx(Ak,{id:y.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl")),C_=m.forwardRef(et(function(r,i){const{__scopeTooltip:l,...c}=r,u=ua(l);return s.jsx(YS,{...u,...c,ref:i})},"TooltipArrow"));function vy(n,r){const i=Math.abs(r.top-n.y),l=Math.abs(r.bottom-n.y),c=Math.abs(r.right-n.x),u=Math.abs(r.left-n.x);switch(Math.min(i,l,c,u)){case u:return"left";case c:return"right";case i:return"top";case l:return"bottom";default:throw new Error("unreachable")}}et(vy,"getExitSideFromRect");function xy(n,r,i=5){const l=[];switch(r){case"top":l.push({x:n.x-i,y:n.y+i},{x:n.x+i,y:n.y+i});break;case"bottom":l.push({x:n.x-i,y:n.y-i},{x:n.x+i,y:n.y-i});break;case"left":l.push({x:n.x+i,y:n.y-i},{x:n.x+i,y:n.y+i});break;case"right":l.push({x:n.x-i,y:n.y-i},{x:n.x-i,y:n.y+i});break}return l}et(xy,"getPaddedExitPoints");function yy(n){const{top:r,right:i,bottom:l,left:c}=n;return[{x:c,y:r},{x:i,y:r},{x:i,y:l},{x:c,y:l}]}et(yy,"getPointsFromRect");function wy(n,r){const{x:i,y:l}=n;let c=!1;for(let u=0,f=r.length-1;ul!=b>l&&i<(x-g)*(l-y)/(b-y)+g&&(c=!c)}return c}et(wy,"isPointInPolygon");function by(n){const r=n.slice();return r.sort((i,l)=>i.xl.x?1:i.yl.y?1:0),ky(r)}et(by,"getHull");function ky(n){if(n.length<=1)return n.slice();const r=[];for(let l=0;l=2;){const u=r[r.length-1],f=r[r.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))r.pop();else break}r.push(c)}r.pop();const i=[];for(let l=n.length-1;l>=0;l--){const c=n[l];for(;i.length>=2;){const u=i[i.length-1],f=i[i.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))i.pop();else break}i.push(c)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}et(ky,"getHullPresorted");function jy(...n){const r=new Set;for(const i of n)if(typeof i=="string")for(const l of String(i).trim().split(/\s+/))l&&r.add(l);return r.size>0?Array.from(r).join(" "):void 0}et(jy,"concatAriaDescribedby");const S_=Xl("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ge({className:n,variant:r="default",size:i="default",asChild:l=!1,...c}){const u=l?sd:"button";return s.jsx(u,{"data-slot":"button","data-variant":r,"data-size":i,className:te(S_({variant:r,size:i,className:n})),...c})}function E_({...n}){return s.jsx(uC,{"data-slot":"alert-dialog",...n})}function __({...n}){return s.jsx(dC,{"data-slot":"alert-dialog-portal",...n})}function N_({className:n,...r}){return s.jsx(fC,{"data-slot":"alert-dialog-overlay",className:te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...r})}function R_({className:n,size:r="default",...i}){return s.jsxs(__,{children:[s.jsx(N_,{}),s.jsx(gC,{"data-slot":"alert-dialog-content","data-size":r,className:te("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",n),...i})]})}function P_({className:n,...r}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:te("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",n),...r})}function D_({className:n,...r}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:te("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",n),...r})}function T_({className:n,...r}){return s.jsx(vC,{"data-slot":"alert-dialog-title",className:te("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",n),...r})}function O_({className:n,...r}){return s.jsx(xC,{"data-slot":"alert-dialog-description",className:te("text-sm text-muted-foreground",n),...r})}function M_({className:n,variant:r="default",size:i="default",...l}){return s.jsx(ge,{variant:r,size:i,asChild:!0,children:s.jsx(yC,{"data-slot":"alert-dialog-action",className:te(n),...l})})}function A_({className:n,variant:r="outline",size:i="default",...l}){return s.jsx(ge,{variant:r,size:i,asChild:!0,children:s.jsx(bC,{"data-slot":"alert-dialog-cancel",className:te(n),...l})})}const I_=Xl("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function jn({className:n,variant:r="default",asChild:i=!1,...l}){const c=i?sd:"span";return s.jsx(c,{"data-slot":"badge","data-variant":r,className:te(I_({variant:r}),n),...l})}function Me({className:n,type:r,...i}){return s.jsx("input",{type:r,"data-slot":"input",className:te("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",n),...i})}function Cy({className:n,...r}){return s.jsx(s_,{"data-slot":"label",className:te("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...r})}function Vn({className:n,...r}){return s.jsx("div",{"data-slot":"card",className:te("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",n),...r})}function Bl({className:n,...r}){return s.jsx("div",{"data-slot":"card-header",className:te("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...r})}function Qd({className:n,...r}){return s.jsx("div",{"data-slot":"card-title",className:te("leading-none font-semibold",n),...r})}function Yd({className:n,...r}){return s.jsx("div",{"data-slot":"card-description",className:te("text-sm text-muted-foreground",n),...r})}function to({className:n,...r}){return s.jsx("div",{"data-slot":"card-content",className:te("px-6",n),...r})}function L_({className:n,...r}){return s.jsx("div",{"data-slot":"card-footer",className:te("flex items-center px-6 [.border-t]:pt-6",n),...r})}function Sy({...n}){return s.jsx(kd,{"data-slot":"sheet",...n})}function z_({...n}){return s.jsx(jd,{"data-slot":"sheet-portal",...n})}function F_({className:n,...r}){return s.jsx(Cd,{"data-slot":"sheet-overlay",className:te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...r})}function Ey({className:n,children:r,side:i="right",showCloseButton:l=!0,...c}){return s.jsxs(z_,{children:[s.jsx(F_,{}),s.jsxs(Sd,{"data-slot":"sheet-content",className:te("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",i==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",i==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",i==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",i==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",n),...c,children:[r,l&&s.jsxs(es,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(lv,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _y({className:n,...r}){return s.jsx("div",{"data-slot":"sheet-header",className:te("flex flex-col gap-1.5 p-4",n),...r})}function Ny({className:n,...r}){return s.jsx(Ed,{"data-slot":"sheet-title",className:te("font-semibold text-foreground",n),...r})}function Ry({className:n,...r}){return s.jsx(_d,{"data-slot":"sheet-description",className:te("text-sm text-muted-foreground",n),...r})}function rs({className:n,...r}){return s.jsx("textarea",{"data-slot":"textarea",className:te("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",n),...r})}const Py=m.createContext(()=>{}),St=()=>m.useContext(Py);function $_({children:n}){const[r,i]=m.useState(null),l=m.useRef(),c=m.useCallback((u,f=!1)=>{i(h=>({msg:u,err:f,n:((h==null?void 0:h.n)??0)+1})),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i(null),4e3)},[]);return s.jsxs(Py.Provider,{value:c,children:[n,s.jsx("div",{"aria-live":"polite",className:"pointer-events-none fixed right-4 bottom-4 left-4 z-50 flex justify-end sm:left-auto",children:r&&s.jsxs("div",{id:"toast",role:"status",className:te("pointer-events-auto flex max-w-md items-start gap-2 rounded-lg border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-lg animate-in fade-in slide-in-from-bottom-2",r.err&&"border-destructive/40"),children:[r.err?s.jsx(d1,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):s.jsx(u1,{className:"mt-0.5 size-4 shrink-0 text-success"}),s.jsx("span",{children:r.msg})]},r.n)})]})}const De=n=>n instanceof Error?n.message:String(n),Dy=m.createContext(async()=>!1),Zo=()=>m.useContext(Dy);function U_({children:n}){const[r,i]=m.useState(null),l=m.useRef(),c=m.useCallback(f=>(i(f),new Promise(h=>l.current=h)),[]),u=f=>{var h;(h=l.current)==null||h.call(l,f),i(null)};return s.jsxs(Dy.Provider,{value:c,children:[n,s.jsx(E_,{open:!!r,onOpenChange:f=>!f&&u(!1),children:s.jsxs(R_,{children:[s.jsxs(P_,{children:[s.jsx(T_,{children:r==null?void 0:r.title}),(r==null?void 0:r.description)&&s.jsx(O_,{children:r.description})]}),s.jsxs(D_,{children:[s.jsx(A_,{onClick:()=>u(!1),children:"Cancel"}),s.jsx(M_,{className:te((r==null?void 0:r.danger)&&"bg-destructive text-white hover:bg-destructive/90"),onClick:()=>u(!0),children:(r==null?void 0:r.action)??"Continue"})]})]})})]})}const Ty=m.createContext(null),ei=()=>m.useContext(Ty),Oy=m.createContext(()=>{}),qd=()=>m.useContext(Oy),Wl={hosts:"Multiple code hosts and bot identities",rules:"Group and pattern rules",learnings:"Team learnings",executors:"Docker and Kubernetes executors",budgets:"Token budgets",metrics:"Metrics and long history",audit:"Audit log",branch_sync:"Branch-sync skip",sso_rules:"SSO domain and group rules"};function ln(n){return ei().license.features.includes(n)}function da({feature:n,children:r}){return s.jsxs(Hi,{role:"note",className:"locked border-dashed border-primary/60",children:[s.jsx(Fg,{className:"text-primary"}),s.jsxs(kk,{className:"flex items-center gap-2",children:[Wl[n],s.jsx(jn,{variant:"secondary",children:"licensed"})]}),s.jsx(Gi,{children:s.jsxs("p",{children:[r??"This is part of the licensed Divmora console."," ",s.jsx(Ho,{className:"font-medium text-primary underline-offset-4 hover:underline",to:"/license",children:"Install a license"})," ","or contact"," ",s.jsx("a",{className:"font-medium text-primary underline-offset-4 hover:underline",href:"mailto:licensing@divmora.com",children:"licensing@divmora.com"}),"."]})})]})}function Tl({feature:n}){return ln(n)?null:s.jsxs("span",{className:"locknote block text-xs leading-snug text-warning",children:[s.jsx(Fg,{className:"mr-1 inline size-3 align-[-2px]"}),"Needs a license with ",Wl[n].toLowerCase()," ·"," ",s.jsx(Ho,{to:"/license",className:"underline underline-offset-2",children:"License"})]})}function ao({children:n,className:r}){return s.jsx(Vn,{className:te("gap-0 overflow-hidden py-0",r),children:n})}function Go({open:n,onClose:r,title:i,description:l,children:c,wide:u}){return s.jsx(Sy,{open:n,onOpenChange:f=>!f&&r(),children:s.jsxs(Ey,{className:te("w-full gap-0 overflow-y-auto sm:max-w-xl",u&&"sm:max-w-3xl"),children:[s.jsxs(_y,{className:"border-b pr-10",children:[s.jsx(Ny,{children:i}),l&&s.jsx(Ry,{children:l})]}),s.jsx("div",{className:"p-4",children:c})]})})}function no({children:n,className:r}){return s.jsx("div",{className:te("flex flex-wrap items-center gap-2",r),children:n})}function Jt({children:n,className:r}){return s.jsx("p",{className:te("max-w-4xl text-sm leading-relaxed text-muted-foreground",r),children:n})}function bt({children:n}){return s.jsx("div",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:n})}function Ce({label:n,children:r,hint:i,className:l}){return s.jsxs("div",{className:te("grid content-start gap-1.5",l),children:[s.jsx(Cy,{className:"text-xs font-medium text-muted-foreground",children:n}),r,i]})}function Xt({children:n,className:r}){return s.jsx("div",{className:te("grid gap-4 sm:grid-cols-2 lg:grid-cols-3",r),children:n})}function He({className:n,...r}){return s.jsx("select",{className:te("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",n),...r})}const B_={on:"border-transparent bg-success-soft text-success",off:"border-transparent bg-danger-soft text-destructive",idle:"border-transparent bg-muted text-muted-foreground",warn:"border-transparent bg-warning-soft text-warning"};function yn({kind:n,children:r}){return s.jsx(jn,{className:te("state",n,B_[n]),children:r})}function Yu({items:n,empty:r}){return n.length?s.jsx("span",{className:"flex flex-wrap gap-1",children:n.map(i=>s.jsx(jn,{variant:"outline",className:"chip font-normal text-muted-foreground",children:i},i))}):s.jsx("span",{className:"text-sm text-muted-foreground",children:r??"defaults"})}function Qe({children:n,className:r}){return s.jsx("div",{className:te("mt-0.5 text-xs text-muted-foreground",r),children:n})}function My(n={}){const r=[];return n.profile&&r.push(n.profile),n.max_comments&&r.push("max "+n.max_comments),n.min_severity&&r.push("≥ "+n.min_severity),n.model&&r.push("model "+n.model),n.auto_review===!1&&r.push("auto review off"),n.auto_review===!0&&r.push("auto review on"),n.drafts===!0&&r.push("drafts"),n.instructions&&r.push("instructions"),r}function Vl({value:n,onChange:r,on:i,off:l,inherit:c="Inherit",label:u,disabled:f}){const h=n==null?"":String(n);return s.jsxs(He,{"aria-label":u,value:h,disabled:f,onChange:v=>r(v.target.value===""?null:v.target.value==="true"),children:[s.jsx("option",{value:"",children:c}),s.jsx("option",{value:"true",children:i}),s.jsx("option",{value:"false",children:l})]})}function Xd({value:n,onSave:r,onCancel:i,extra:l,inheritModel:c="Server default",saveLabel:u="Save settings",danger:f}){const h=ei(),v=n??{},[g,y]=m.useState(v.profile??""),[x,b]=m.useState(v.max_comments?String(v.max_comments):""),[j,k]=m.useState(v.min_severity??""),[S,C]=m.useState(v.model??""),[E,D]=m.useState(v.auto_review??null),[T,P]=m.useState(v.drafts??null),[R,N]=m.useState(v.instructions??""),I=()=>{const L={};g&&(L.profile=g),x&&(L.max_comments=parseInt(x,10)),j&&(L.min_severity=j),S&&(L.model=S),E!==null&&(L.auto_review=E),T!==null&&(L.drafts=T),R.trim()&&(L.instructions=R.trim()),r(L)};return s.jsxs("div",{className:"grid gap-5",children:[l,s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Review profile",children:s.jsxs(He,{value:g,onChange:L=>y(L.target.value),children:[s.jsx("option",{value:"",children:"Inherit"}),s.jsx("option",{value:"chill",children:"Chill"}),s.jsx("option",{value:"balanced",children:"Balanced"}),s.jsx("option",{value:"assertive",children:"Assertive"})]})}),s.jsx(Ce,{label:"Max inline comments",children:s.jsx(Me,{type:"number",min:0,max:200,value:x,placeholder:"Inherit",onChange:L=>b(L.target.value)})}),s.jsx(Ce,{label:"Minimum severity",children:s.jsxs(He,{value:j,onChange:L=>k(L.target.value),children:[s.jsx("option",{value:"",children:"Inherit"}),s.jsx("option",{value:"critical",children:"Critical"}),s.jsx("option",{value:"major",children:"Major"}),s.jsx("option",{value:"minor",children:"Minor"}),s.jsx("option",{value:"nitpick",children:"Nitpick"})]})}),s.jsx(Ce,{label:"Model profile",children:s.jsxs(He,{value:S,onChange:L=>C(L.target.value),children:[s.jsx("option",{value:"",children:c}),h.profiles.map(L=>s.jsx("option",{value:L,children:L},L))]})}),s.jsx(Ce,{label:"Auto review on push",children:s.jsx(Vl,{value:E,onChange:D,on:"On",off:"Off"})}),s.jsx(Ce,{label:"Review draft PRs",children:s.jsx(Vl,{value:T,onChange:P,on:"On",off:"Off"})})]}),s.jsx(Ce,{label:"Extra review instructions",children:s.jsx(rs,{rows:4,maxLength:8e3,placeholder:"Appended to the repository's own instructions",value:R,onChange:L=>N(L.target.value)})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ge,{onClick:I,children:u}),i&&s.jsx(ge,{variant:"outline",onClick:i,children:"Cancel"}),s.jsx("span",{className:"flex-1"}),f]})]})}function W_({...n}){return s.jsx(KE,{"data-slot":"dropdown-menu",...n})}function V_({...n}){return s.jsx(YE,{"data-slot":"dropdown-menu-trigger",...n})}function H_({className:n,sideOffset:r=4,...i}){return s.jsx(qE,{children:s.jsx(JE,{"data-slot":"dropdown-menu-content",sideOffset:r,className:te("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n),...i})})}function G_({...n}){return s.jsx(e_,{"data-slot":"dropdown-menu-radio-group",...n})}function bu({className:n,children:r,...i}){return s.jsxs(t_,{"data-slot":"dropdown-menu-radio-item",className:te("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i,children:[s.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(n_,{children:s.jsx(Pg,{className:"size-2 fill-current"})})}),r]})}function K_({className:n,inset:r,...i}){return s.jsx(ZE,{"data-slot":"dropdown-menu-label","data-inset":r,className:te("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",n),...i})}function Q_({className:n,...r}){return s.jsx(r_,{"data-slot":"dropdown-menu-separator",className:te("-mx-1 my-1 h-px bg-border",n),...r})}function Jr({className:n,orientation:r="horizontal",decorative:i=!0,...l}){return s.jsx(c_,{"data-slot":"separator",decorative:i,orientation:r,className:te("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),...l})}const ku=768;function Y_(){const[n,r]=m.useState(void 0);return m.useEffect(()=>{const i=window.matchMedia(`(max-width: ${ku-1}px)`),l=()=>{r(window.innerWidthi.removeEventListener("change",l)},[]),!!n}function Ay({delayDuration:n=0,...r}){return s.jsx(h_,{"data-slot":"tooltip-provider",delayDuration:n,...r})}function q_({...n}){return s.jsx(g_,{"data-slot":"tooltip",...n})}function X_({...n}){return s.jsx(v_,{"data-slot":"tooltip-trigger",...n})}function J_({className:n,sideOffset:r=0,children:i,...l}){return s.jsx(w_,{children:s.jsxs(b_,{"data-slot":"tooltip-content",sideOffset:r,className:te("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...l,children:[i,s.jsx(C_,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Z_="sidebar_state",e2=3600*24*7,t2="16rem",n2="18rem",r2="3rem",o2="b",Iy=m.createContext(null);function os(){const n=m.useContext(Iy);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function i2({defaultOpen:n=!0,open:r,onOpenChange:i,className:l,style:c,children:u,...f}){const h=Y_(),[v,g]=m.useState(!1),[y,x]=m.useState(n),b=r??y,j=m.useCallback(E=>{const D=typeof E=="function"?E(b):E;i?i(D):x(D),document.cookie=`${Z_}=${D}; path=/; max-age=${e2}`},[i,b]),k=m.useCallback(()=>h?g(E=>!E):j(E=>!E),[h,j,g]);m.useEffect(()=>{const E=D=>{D.key===o2&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),k())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[k]);const S=b?"expanded":"collapsed",C=m.useMemo(()=>({state:S,open:b,setOpen:j,isMobile:h,openMobile:v,setOpenMobile:g,toggleSidebar:k}),[S,b,j,h,v,g,k]);return s.jsx(Iy.Provider,{value:C,children:s.jsx(Ay,{delayDuration:0,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":t2,"--sidebar-width-icon":r2,...c},className:te("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",l),...f,children:u})})})}function s2({side:n="left",variant:r="sidebar",collapsible:i="offcanvas",className:l,children:c,...u}){const{isMobile:f,state:h,openMobile:v,setOpenMobile:g}=os();return i==="none"?s.jsx("div",{"data-slot":"sidebar",className:te("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",l),...u,children:c}):f?s.jsx(Sy,{open:v,onOpenChange:g,...u,children:s.jsxs(Ey,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":n2},side:n,children:[s.jsxs(_y,{className:"sr-only",children:[s.jsx(Ny,{children:"Sidebar"}),s.jsx(Ry,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):s.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?i:"","data-variant":r,"data-side":n,"data-slot":"sidebar",children:[s.jsx("div",{"data-slot":"sidebar-gap",className:te("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{"data-slot":"sidebar-container",className:te("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",n==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"||r==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",l),...u,children:s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:c})})]})}function l2({className:n,onClick:r,...i}){const{toggleSidebar:l}=os();return s.jsxs(ge,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:te("size-7",n),onClick:c=>{r==null||r(c),l()},...i,children:[s.jsx(y1,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function a2({className:n,...r}){const{toggleSidebar:i}=os();return s.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:te("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",n),...r})}function c2({className:n,...r}){return s.jsx("main",{"data-slot":"sidebar-inset",className:te("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),...r})}function u2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:te("flex flex-col gap-2 p-2",n),...r})}function d2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:te("flex flex-col gap-2 p-2",n),...r})}function f2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:te("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...r})}function p2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:te("relative flex w-full min-w-0 flex-col p-2",n),...r})}function h2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:te("w-full text-sm",n),...r})}function tg({className:n,...r}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:te("flex w-full min-w-0 flex-col gap-1",n),...r})}function ng({className:n,...r}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:te("group/menu-item relative",n),...r})}const m2=Xl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function rg({asChild:n=!1,isActive:r=!1,variant:i="default",size:l="default",tooltip:c,className:u,...f}){const h=n?sd:"button",{isMobile:v,state:g}=os(),y=s.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":l,"data-active":r,className:te(m2({variant:i,size:l}),u),...f});return c?(typeof c=="string"&&(c={children:c}),s.jsxs(q_,{children:[s.jsx(X_,{asChild:!0,children:y}),s.jsx(J_,{side:"right",align:"center",hidden:g!=="collapsed"||v,...c})]})):y}function og({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:te("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n),...r})}function ro(n){if(!n||n.startsWith("0001-"))return"never";const r=Math.round((Date.now()-new Date(n).getTime())/1e3);return r<60?"just now":r<3600?Math.floor(r/60)+"m ago":r<86400?Math.floor(r/3600)+"h ago":Math.floor(r/86400)+"d ago"}function Tt(n){return n>=1e6?(n/1e6).toFixed(1)+"M":n>=1e4?Math.round(n/1e3)+"k":n>=1e3?(n/1e3).toFixed(1)+"k":String(n)}function ig(n){if(!n)return"—";const r=Math.round(n/1e3);return r<60?r+"s":Math.floor(r/60)+"m "+r%60+"s"}function sg(n){return new Date(n).toLocaleString()}function Jd({...n}){return s.jsx(kd,{"data-slot":"dialog",...n})}function g2({...n}){return s.jsx(jd,{"data-slot":"dialog-portal",...n})}function v2({className:n,...r}){return s.jsx(Cd,{"data-slot":"dialog-overlay",className:te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...r})}function Zd({className:n,children:r,showCloseButton:i=!0,...l}){return s.jsxs(g2,{"data-slot":"dialog-portal",children:[s.jsx(v2,{}),s.jsxs(Sd,{"data-slot":"dialog-content",className:te("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",n),...l,children:[r,i&&s.jsxs(es,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(lv,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ef({className:n,...r}){return s.jsx("div",{"data-slot":"dialog-header",className:te("flex flex-col gap-2 text-center sm:text-left",n),...r})}function tf({className:n,showCloseButton:r=!1,children:i,...l}){return s.jsxs("div",{"data-slot":"dialog-footer",className:te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...l,children:[i,r&&s.jsx(es,{asChild:!0,children:s.jsx(ge,{variant:"outline",children:"Close"})})]})}function nf({className:n,...r}){return s.jsx(Ed,{"data-slot":"dialog-title",className:te("text-lg leading-none font-semibold",n),...r})}function rf({className:n,...r}){return s.jsx(_d,{"data-slot":"dialog-description",className:te("text-sm text-muted-foreground",n),...r})}function co({className:n,...r}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:te("w-full caption-bottom text-sm",n),...r})})}function uo({className:n,...r}){return s.jsx("thead",{"data-slot":"table-header",className:te("[&_tr]:border-b",n),...r})}function fo({className:n,...r}){return s.jsx("tbody",{"data-slot":"table-body",className:te("[&_tr:last-child]:border-0",n),...r})}function Mt({className:n,...r}){return s.jsx("tr",{"data-slot":"table-row",className:te("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",n),...r})}function Se({className:n,...r}){return s.jsx("th",{"data-slot":"table-head",className:te("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r})}function Ee({className:n,...r}){return s.jsx("td",{"data-slot":"table-cell",className:te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r})}function x2(n){return n.source==="repository"?"set on this repository":n.source==="allowlist"?"no rule matches · allowlist default":n.source==="default"?"no rule matches · reviewed by default":"by "+n.source}function y2(){const n=ei(),r=St(),i=Zo(),[l,c]=m.useState(null),[u,f]=m.useState(""),[h,v]=m.useState("all"),[g,y]=m.useState(null),[x,b]=m.useState(!1),[j,k]=m.useState({platform:"github",host:"",path:"",mode:"enabled"}),S=()=>Ct("/admin/api/repos").then(c).catch(N=>r(De(N),!0));m.useEffect(()=>{S()},[]);const C=(N,I,L)=>oo("/admin/api/repos/"+N.id,{mode:I,settings:L}).then(Q=>(c(ee=>(ee||[]).map(J=>J.id===Q.id?Q:J)),r(Q.path+": reviews "+(Q.effective.enabled?"on":"off")+" ("+Q.effective.source+")"),Q)),E=()=>Fn("/admin/api/repos",{...j,host:j.host.trim(),path:j.path.trim()}).then(N=>{c(I=>(I||[]).filter(L=>L.id!==N.id).concat([N])),k({...j,path:""}),b(!1),r("Added "+N.path)}).catch(N=>r(De(N),!0)),D=async N=>{await i({title:"Remove "+N.path+"?",description:"It reappears, set to Inherit, if it sends another webhook.",action:"Remove",danger:!0})&&Ji("/admin/api/repos/"+N.id).then(()=>{c(I=>(I||[]).filter(L=>L.id!==N.id)),y(null),r("Removed "+N.path)}).catch(I=>r(De(I),!0))},T=(l||[]).filter(N=>h==="on"&&!N.effective.enabled||h==="off"&&N.effective.enabled?!1:!u||(N.host+"/"+N.path).toLowerCase().includes(u.toLowerCase())),P=(l||[]).filter(N=>N.effective.enabled).length,R=(l==null?void 0:l.find(N=>N.id===g))??null;return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(no,{children:[s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Filter repositories","aria-label":"Filter repositories",value:u,onChange:N=>f(N.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"Show",value:h,onChange:N=>v(N.target.value),children:[s.jsx("option",{value:"all",children:"All"}),s.jsx("option",{value:"on",children:"Reviewed"}),s.jsx("option",{value:"off",children:"Not reviewed"})]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:l&&P+" reviewed · "+(l.length-P)+" not reviewed"}),s.jsx("span",{className:"flex-1"}),s.jsxs(ge,{variant:"outline",onClick:()=>b(!0),children:[s.jsx(Xi,{})," Add repository"]})]}),s.jsx(ao,{children:l?T.length?s.jsxs(co,{children:[s.jsx(uo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Reviews"}),s.jsx(Se,{children:"Repository"}),s.jsx(Se,{children:"Last webhook"}),s.jsx(Se,{children:"Effective settings"}),s.jsx(Se,{children:"Last changed"}),s.jsx(Se,{})]})}),s.jsx(fo,{children:T.map(N=>{const I=N.effective,L=[I.require_reviewer&&"reviewer required",I.skip_branch_sync&&"skips branch syncs",I.score_labels&&"score labels",I.commit_status&&"commit status"].filter(Boolean);return s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"w-44 pl-4 align-top whitespace-normal",children:[s.jsxs(He,{"aria-label":"Reviews for "+N.path,value:N.mode,onChange:Q=>C(N,Q.target.value,N.settings||{}).catch(ee=>r(De(ee),!0)),children:[s.jsx("option",{value:"inherit",children:"Inherit"}),s.jsx("option",{value:"enabled",children:"Enabled"}),s.jsx("option",{value:"disabled",children:"Disabled"})]}),s.jsx("div",{className:"mt-1.5",children:s.jsx(yn,{kind:I.enabled?"on":"off",children:I.enabled?"Reviewed":"Not reviewed"})}),s.jsx(Qe,{children:x2(I)}),L.length>0&&s.jsx(Qe,{children:L.join(" · ")})]}),s.jsxs(Ee,{className:"align-top",children:[s.jsx("div",{className:"font-medium",children:N.path}),s.jsxs(Qe,{children:[N.platform," · ",N.host]})]}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:ro(N.last_seen)}),s.jsxs(Ee,{className:"align-top whitespace-normal",children:[s.jsx(Yu,{items:My(I.settings)}),(I.rules||[]).length>0&&JSON.stringify(I.settings)!==JSON.stringify(N.settings||{})&&s.jsx(Qe,{children:"includes rule settings"})]}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:N.updated_by?N.updated_by+" · "+ro(N.updated_at):"—"}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:s.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>y(N.id),children:[s.jsx(S1,{})," Settings"]})})]},N.id)})})]}):s.jsx(bt,{children:l.length?"No repositories match.":"No repositories yet. They appear when they send their first webhook, or add one above."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Repositories appear here automatically when they send their first webhook, set to ",s.jsx("b",{children:"Inherit"}),": they follow the most specific group or pattern rule, and otherwise the default (",n.allowlist?"not reviewed, because the allowlist is on":"reviewed, because the allowlist is off","). Choosing Enabled or Disabled here overrides every rule. Settings here override the rules' settings and the repository's own ",s.jsx("code",{children:".codereview.yaml"}),"."]}),n.require_reviewer&&s.jsxs(Jt,{children:[s.jsx("b",{children:"Reviewer required:"})," even in an enabled repository, a merge request is reviewed only when the bot user is one of its reviewers. Adding the bot as a reviewer starts a review; ",s.jsx("code",{children:"@bot review"})," comments still work."]}),s.jsx(Go,{open:!!R,onClose:()=>y(null),title:(R==null?void 0:R.path)??"",description:R?`${R.platform} · ${R.host} · review settings for this repository`:void 0,children:R&&s.jsx(Xd,{value:R.settings,onSave:N=>C(R,R.mode,N).then(()=>y(null)).catch(I=>r(De(I),!0)),onCancel:()=>y(null),danger:s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>D(R),children:"Remove"})},R.id)}),s.jsx(Jd,{open:x,onOpenChange:b,children:s.jsxs(Zd,{className:"sm:max-w-lg",children:[s.jsxs(ef,{children:[s.jsx(nf,{children:"Add repository"}),s.jsx(rf,{children:"Repositories also appear by themselves when they send their first webhook."})]}),s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{value:j.platform,onChange:N=>k({...j,platform:N.target.value}),children:[s.jsx("option",{value:"github",children:"GitHub"}),s.jsx("option",{value:"gitlab",children:"GitLab"})]})}),s.jsx(Ce,{label:"Host",children:s.jsx(Me,{placeholder:"github.com",value:j.host,onChange:N=>k({...j,host:N.target.value})})}),s.jsx(Ce,{label:"Repository path",className:"sm:col-span-2",children:s.jsx(Me,{placeholder:"owner/repo or group/sub/project",value:j.path,onChange:N=>k({...j,path:N.target.value})})}),s.jsx(Ce,{label:"Reviews",children:s.jsxs(He,{value:j.mode,onChange:N=>k({...j,mode:N.target.value}),children:[s.jsx("option",{value:"enabled",children:"Enabled"}),s.jsx("option",{value:"disabled",children:"Disabled"}),s.jsx("option",{value:"inherit",children:"Inherit from rules"})]})})]}),s.jsxs(tf,{children:[s.jsx(ge,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),s.jsx(ge,{onClick:E,children:"Add"})]})]})})]})}const qu=[["done","Reviewed","--st-done"],["skipped","Skipped","--st-skip"],["failed","Failed","--st-fail"]];function lg(n,r,i=!1){const l=new Date(n);return r==="hour"?i?l.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):l.toLocaleTimeString([],{hour:"2-digit"}):r==="month"?l.toLocaleDateString([],{month:"short",year:i?"numeric":"2-digit"}):l.toLocaleDateString([],{month:"short",day:"numeric"})}const br=(n,r)=>typeof n[r]=="number"?n[r]:0;function w2({points:n,granularity:r}){const i=m.useRef(null),[l,c]=m.useState(900),[u,f]=m.useState(null);m.useEffect(()=>{const N=i.current;if(!N)return;const I=new ResizeObserver(()=>c(Math.max(320,N.clientWidth||900)));return I.observe(N),()=>I.disconnect()},[]);const h=l,v=200,g=34,y=8,x=8,b=24;let j=0;n.forEach(N=>j=Math.max(j,br(N,"done")+br(N,"skipped")+br(N,"failed")));const k=j<=4?4:Math.pow(10,Math.floor(Math.log10(j))),S=Math.ceil(j/k)*k||4,C=(h-g-y)/Math.max(1,n.length),E=Math.min(24,Math.max(2,C*.7)),D=N=>x+(v-x-b)*(1-N/S),T=Math.ceil(n.length/Math.max(2,Math.floor((h-g-y)/70))),P=u!==null?n[u]:null,R=u!==null?Math.min(h-170,Math.max(0,g+C*u+C/2+12)):0;return s.jsxs("div",{className:"chart relative w-full",ref:i,children:[s.jsxs("svg",{className:"block h-auto w-full",viewBox:`0 0 ${h} ${v}`,role:"img","aria-label":`Jobs per ${r}: reviewed, skipped and failed`,children:[n.map((N,I)=>s.jsx("rect",{x:g+C*I,y:x,width:C,height:v-x-b,fill:u===I?"var(--muted)":"transparent",fillOpacity:.5,tabIndex:0,onMouseEnter:()=>f(I),onMouseLeave:()=>f(null),onFocus:()=>f(I),onBlur:()=>f(null)},"h"+I)),[0,S/2,S].map(N=>s.jsxs("g",{pointerEvents:"none",children:[s.jsx("line",{x1:g,x2:h-y,y1:D(N),y2:D(N),stroke:"var(--grid)",strokeWidth:1}),s.jsx("text",{x:g-6,y:D(N)+4,textAnchor:"end",fontSize:11,fill:"var(--muted-foreground)",children:Tt(N)})]},"g"+N)),n.map((N,I)=>{const L=g+C*I+(C-E)/2,Q=qu.map(([J,,ne])=>[br(N,J),ne]).filter(([J])=>J>0);let ee=0;return s.jsxs("g",{pointerEvents:"none",children:[Q.map(([J,ne],de)=>{let re=D(ee+J);const ie=D(ee)-(de>0?2:0);ie-re<1&&(re=ie-1);const B=de===Q.length-1?Math.min(4,E/2,ie-re):0;ee+=J;const Z=`M${L},${ie}V${re+B}Q${L},${re} ${L+B},${re}H${L+E-B}Q${L+E},${re} ${L+E},${re+B}V${ie}Z`;return s.jsx("path",{d:Z,fill:`var(${ne})`},de)}),I%T===0&&s.jsx("text",{x:g+C*I+C/2,y:v-b+16,textAnchor:"middle",fontSize:11,fill:"var(--muted-foreground)",children:lg(N.bucket,r)})]},"b"+I)}),s.jsx("line",{x1:g,x2:h-y,y1:v-b,y2:v-b,stroke:"var(--grid)",strokeWidth:1,pointerEvents:"none"})]}),s.jsx("div",{className:"tip pointer-events-none absolute z-10 w-40 rounded-md border bg-popover p-2.5 text-xs text-popover-foreground shadow-md [&>div]:flex [&>div]:justify-between [&>div]:gap-3 [&>div>span:first-child]:text-muted-foreground "+(P?"show block":"hidden"),id:"mTip",ref:N=>N&&(N.style.left=R+"px",N.style.top="28px"),children:P&&s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"mb-1 block font-semibold",children:lg(P.bucket,r,!0)}),qu.map(([N,I])=>s.jsxs("div",{children:[s.jsx("span",{children:I}),s.jsx("span",{children:br(P,N)})]},N)),s.jsxs("div",{children:[s.jsx("span",{children:"Comments"}),s.jsx("span",{children:br(P,"comments")})]}),s.jsxs("div",{children:[s.jsx("span",{children:"Tokens"}),s.jsx("span",{children:Tt(br(P,"tokens_in")+br(P,"tokens_out"))})]})]})})]})}function b2({className:n,...r}){return s.jsx(RC,{"data-slot":"checkbox",className:te("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",n),...r,children:s.jsx(DC,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:s.jsx(Ql,{className:"size-3.5"})})})}function k2(n){const r=[],i={};n.points.forEach(h=>i[new Date(h.bucket).toISOString()]=h);const l=new Date(n.to),c=new Date(n.from);if(n.granularity==="month"){let h=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth(),1));for(;h{Ct("/admin/api/reviews/"+n.id).then(c).catch(h=>i(De(h),!0))},[n.id]),!l)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"});let u=null;try{u=l.result?typeof l.result=="string"?JSON.parse(l.result):l.result:null}catch{u=null}const f=u==null?void 0:u.verification;return s.jsxs("div",{className:"grid gap-5 text-sm",children:[l.error&&s.jsxs("div",{className:"rounded-md border border-destructive/40 bg-danger-soft p-3",children:[s.jsx("div",{className:"mb-1 font-medium text-destructive",children:"Error"}),s.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap text-destructive",children:l.error})]}),u?s.jsxs(s.Fragment,{children:[u.summary&&s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 font-semibold",children:"Summary"}),s.jsx("p",{className:"leading-relaxed text-muted-foreground",children:u.summary})]}),u.scores&&s.jsx("div",{className:"grid grid-cols-3 gap-2",children:["quality","security","maintainability"].map(h=>s.jsxs("div",{className:"rounded-md border p-2.5",children:[s.jsx("div",{className:"text-lg font-semibold",children:u.scores[h]}),s.jsx("div",{className:"text-xs text-muted-foreground capitalize",children:h})]},h))}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-2 font-semibold",children:(u.findings||[]).length?`Findings (${u.findings.length})`:"No findings"}),s.jsx("div",{className:"grid gap-2",children:(u.findings||[]).map((h,v)=>s.jsxs("div",{className:"finding rounded-md border p-3",children:[s.jsx("div",{className:"font-medium",children:(h.kind==="question"?"❓ ":"")+h.title}),s.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(yn,{kind:j2[h.severity]??"idle",children:h.severity}),s.jsx(jn,{variant:"outline",className:"font-normal",children:h.category}),s.jsxs("span",{className:"font-mono",children:[h.path,":",h.end_line]})]})]},v))})]}),(f==null?void 0:f.ran)&&s.jsxs("p",{className:"text-muted-foreground",children:["Verification (",f.model,"): ",f.confirmed||0," confirmed · ",f.false_positives||0," removed · ",f.questions||0," questions"]}),((f==null?void 0:f.removed)||[]).length>0&&s.jsx("div",{className:"grid gap-1.5",children:f.removed.map((h,v)=>s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Removed: ",s.jsx("span",{className:"text-foreground",children:h.title})," — ",h.reason]},"r"+v))})]}):!l.error&&s.jsx("p",{className:"text-muted-foreground",children:l.note||"No review result stored for this job."}),s.jsx(Jr,{}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Model ",l.model||"—"," · ",l.comments," comments · ",l.files," files"]}),n.kind.includes("review")&&s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{variant:"outline",onClick:()=>r(!1),children:"Re-run (new changes)"}),s.jsx(ge,{variant:"outline",onClick:()=>r(!0),children:"Re-run full review"})]})]})}function S2(){const n=St(),[r,i]=m.useState("day"),[l,c]=m.useState(null),[u,f]=m.useState([]),[h,v]=m.useState({host:"",repo:"",state:"",kind:"",trigger:"",from:"",to:""}),[g,y]=m.useState(""),[x,b]=m.useState(null),[j,k]=m.useState(!1),[S,C]=m.useState(null),[E,D]=m.useState(""),[T,P]=m.useState(!1);m.useEffect(()=>{Ct("/admin/api/hosts").then(B=>f(B.hosts||[])).catch(()=>{})},[]);const R=ln("metrics"),N=ei();m.useEffect(()=>{R&&Ct("/admin/api/metrics"+Pu({granularity:r,host:h.host})).then(c).catch(B=>n(De(B),!0))},[r,h.host,R]),m.useEffect(()=>{const B=window.setTimeout(()=>v(Z=>({...Z,repo:g.trim()})),300);return()=>window.clearTimeout(B)},[g]);const I=B=>Ct("/admin/api/reviews"+Pu({limit:100,...h,before:B})).then(Z=>{b(W=>B?(W||[]).concat(Z.reviews):Z.reviews),k(Z.reviews.length>=100)}).catch(Z=>n(De(Z),!0));m.useEffect(()=>{I()},[h]);const L=()=>{if(!E.trim())return n("Paste a pull request or merge request URL",!0);Fn("/admin/api/reviews",{url:E.trim(),full:T}).then(B=>{D(""),n("Queued "+B.pr+" — it appears here when it finishes")}).catch(B=>n(De(B),!0))},Q=(B,Z)=>Fn(`/admin/api/reviews/${B.id}/rerun`,{full:Z}).then(W=>n("Queued "+W.pr)).catch(W=>n(De(W),!0)),ee=l?k2(l):[],J={jobs:0,done:0,skipped:0,failed:0,comments:0,tokens_in:0,tokens_out:0,duration_ms:0};ee.forEach(B=>Object.keys(J).forEach(Z=>J[Z]+=B[Z]||0));const ne=J.done+J.failed,de=[["Jobs",Tt(J.jobs)],["Reviewed",Tt(J.done)],["Skipped",Tt(J.skipped)],["Failed",Tt(J.failed)+(ne?" · "+Math.round(100*J.failed/ne)+"%":"")],["Comments posted",Tt(J.comments)],["Tokens in / out",Tt(J.tokens_in)+" / "+Tt(J.tokens_out)],["Avg time",ig(ne?J.duration_ms/Math.max(1,J.jobs):0)],["Tokens today (UTC)",Tt((l==null?void 0:l.today_tokens)||0)+(l!=null&&l.daily_token_budget?" of "+Tt(l.daily_token_budget):"")]],re=B=>Z=>v({...h,[B]:Z.target.value}),ie=(x==null?void 0:x.find(B=>B.id===S))??null;return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(no,{children:[R&&s.jsxs(He,{className:"w-auto","aria-label":"Period",value:r,onChange:B=>i(B.target.value),children:[s.jsx("option",{value:"hour",children:"Last 48 hours"}),s.jsx("option",{value:"day",children:"Last 30 days"}),s.jsx("option",{value:"month",children:"Last 12 months"})]}),s.jsx("span",{className:"flex-1"}),s.jsx(Me,{type:"url",className:"rn-url w-full sm:w-80",placeholder:"Paste a PR/MR URL to review it now","aria-label":"Pull request URL",value:E,onChange:B=>D(B.target.value),onKeyDown:B=>B.key==="Enter"&&L()}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(b2,{id:"rnFull",checked:T,onCheckedChange:B=>P(B===!0)}),s.jsx(Cy,{htmlFor:"rnFull",className:"text-sm font-normal text-muted-foreground",children:"Full"})]}),s.jsxs(ge,{onClick:L,children:[s.jsx(w1,{})," Review now"]})]}),!R&&s.jsxs(da,{feature:"metrics",children:["Totals, charts and token use, and history kept longer than ",N.free_retention_days," days, are part of the licensed console. Every review is listed below."]}),R&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"tiles grid grid-cols-2 gap-3 md:grid-cols-4",children:de.map(([B,Z])=>s.jsx(Vn,{className:"tile gap-1 py-4",children:s.jsxs(to,{className:"px-4",children:[s.jsx("div",{className:"text-xl font-semibold tabular-nums",children:Z}),s.jsx("div",{className:"text-xs text-muted-foreground",children:B})]})},B))}),s.jsx(Vn,{className:"py-4",children:s.jsxs(to,{className:"grid gap-3 px-4",children:[s.jsx("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:qu.map(([B,Z,W])=>s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2.5 rounded-sm",ref:q=>q==null?void 0:q.style.setProperty("background",`var(${W})`)}),Z," ",Tt(J[B]||0)]},B))}),l&&s.jsx(w2,{points:ee,granularity:l.granularity})]})})]}),s.jsxs(no,{children:[s.jsxs(He,{className:"w-auto","aria-label":"Host",value:h.host,onChange:re("host"),children:[s.jsx("option",{value:"",children:"All hosts"}),u.map(B=>s.jsx("option",{value:B.host,children:B.name},B.host))]}),s.jsxs("div",{className:"relative w-full sm:w-52",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Repository","aria-label":"Repository",value:g,onChange:B=>y(B.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"State",value:h.state,onChange:re("state"),children:[s.jsx("option",{value:"",children:"Any state"}),s.jsx("option",{value:"done",children:"Done"}),s.jsx("option",{value:"skipped",children:"Skipped"}),s.jsx("option",{value:"failed",children:"Failed"})]}),s.jsxs(He,{className:"w-auto","aria-label":"Kind",value:h.kind,onChange:re("kind"),children:[s.jsx("option",{value:"",children:"Any kind"}),s.jsx("option",{value:"review",children:"Review"}),s.jsx("option",{value:"full review",children:"Full review"}),s.jsx("option",{value:"answer",children:"Answer"}),s.jsx("option",{value:"help",children:"Help"}),s.jsx("option",{value:"learn",children:"Learn"}),s.jsx("option",{value:"remember",children:"Remember"})]}),s.jsxs(He,{className:"w-auto","aria-label":"Trigger",value:h.trigger,onChange:re("trigger"),children:[s.jsx("option",{value:"",children:"Any trigger"}),s.jsx("option",{value:"push",children:"Push"}),s.jsx("option",{value:"command",children:"Command"}),s.jsx("option",{value:"reply",children:"Reply"}),s.jsx("option",{value:"ui",children:"Admin panel"})]}),s.jsx(Me,{type:"date",className:"w-auto","aria-label":"From",value:h.from,onChange:re("from")}),s.jsx(Me,{type:"date",className:"w-auto","aria-label":"To",value:h.to,onChange:re("to")})]}),s.jsx(ao,{children:x?x.length?s.jsxs(co,{children:[s.jsx(uo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Finished"}),s.jsx(Se,{children:"Pull request"}),s.jsx(Se,{children:"Job"}),s.jsx(Se,{children:"State"}),s.jsx(Se,{className:"text-right",children:"Comments / files"}),s.jsx(Se,{className:"text-right",children:"Tokens in / out"}),s.jsx(Se,{className:"text-right",children:"Took"}),s.jsx(Se,{})]})}),s.jsx(fo,{children:x.map(B=>{const Z=B.started&&!B.started.startsWith("0001-")?new Date(B.finished).getTime()-new Date(B.started).getTime():0;return s.jsxs(Mt,{className:"cursor-pointer",onClick:()=>C(B.id),children:[s.jsx(Ee,{className:"pl-4 text-muted-foreground",title:new Date(B.finished).toLocaleString(),children:ro(B.finished)}),s.jsxs(Ee,{children:[s.jsx("div",{className:"font-medium",children:B.url?s.jsxs("a",{className:"inline-flex items-center gap-1 hover:underline",href:B.url,target:"_blank",rel:"noopener noreferrer",onClick:W=>W.stopPropagation(),children:[B.repo," #",B.number," ",s.jsx(Og,{className:"size-3 text-muted-foreground"})]}):`${B.repo} #${B.number}`}),s.jsxs(Qe,{children:[B.platform," · ",B.host]})]}),s.jsxs(Ee,{children:[s.jsx("div",{children:B.kind}),s.jsx(Qe,{children:B.trigger+(B.requested_by?" · "+B.requested_by:"")})]}),s.jsxs(Ee,{className:"max-w-64 whitespace-normal",children:[s.jsx(yn,{kind:B.state==="done"?"on":B.state==="failed"?"off":"idle",children:B.state}),(B.error||B.note)&&s.jsx(Qe,{className:"line-clamp-2",children:B.error?B.error.slice(0,120):B.note})]}),s.jsxs(Ee,{className:"text-right tabular-nums",children:[B.comments," / ",B.files]}),s.jsxs(Ee,{className:"text-right text-muted-foreground tabular-nums",children:[Tt(B.tokens_in)," / ",Tt(B.tokens_out)]}),s.jsx(Ee,{className:"text-right text-muted-foreground tabular-nums",children:ig(Z)}),s.jsx(Ee,{className:"pr-4 text-right",children:s.jsx(ge,{variant:"ghost",size:"sm",onClick:W=>(W.stopPropagation(),C(B.id)),children:"Details"})})]},B.id)})})]}):s.jsx(bt,{children:"No reviews match."}):s.jsx(bt,{children:"Loading…"})}),j&&s.jsx("div",{children:s.jsx(ge,{variant:"outline",onClick:()=>x&&I(x[x.length-1].id),children:"Load older"})}),s.jsx(Jt,{children:"Every finished review, answer, help and learning job. Charts read hourly, daily and monthly rollups that are updated as each job finishes. Reviews are kept for the retention set in Settings; hourly detail for 3 days, daily and monthly totals for good."}),s.jsx(Go,{wide:!0,open:!!ie,onClose:()=>C(null),title:ie?`${ie.repo} #${ie.number}`:"",description:ie?`${ie.kind} · ${ie.trigger} · ${ie.state} · ${ro(ie.finished)}`:void 0,children:ie&&s.jsx(C2,{job:ie,onRerun:B=>Q(ie,B)},ie.id)})]})}const E2={reply:"from a reply",command:"@bot remember",manual:"added here"};function _2({l:n,onSave:r,onCancel:i,onDelete:l}){const[c,u]=m.useState(n.scope),[f,h]=m.useState(n.path),[v,g]=m.useState(n.text);return s.jsxs("div",{className:"grid gap-4",children:[s.jsx(Ce,{label:"Applies to",children:s.jsx(Me,{value:c,placeholder:"empty = whole host · group · group/repo",onChange:y=>u(y.target.value)})}),s.jsx(Ce,{label:"Only files matching",children:s.jsx(Me,{value:f,placeholder:"optional glob",onChange:y=>h(y.target.value)})}),s.jsx(Ce,{label:"Learning",children:s.jsx(rs,{rows:5,maxLength:600,value:v,onChange:y=>g(y.target.value)})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{onClick:()=>r({scope:c.trim(),path:f.trim(),text:v.trim()}),children:"Save"}),s.jsx(ge,{variant:"outline",onClick:i,children:"Cancel"}),s.jsx("span",{className:"flex-1"}),s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:l,children:"Delete"})]})]})}function N2(){const n=St(),r=Zo(),i=ln("learnings"),[l,c]=m.useState(null),[u,f]=m.useState(""),[h,v]=m.useState(""),[g,y]=m.useState(null),[x,b]=m.useState(!1),[j,k]=m.useState({platform:"gitlab",host:"",scope:"",path:"",text:""});m.useEffect(()=>{Ct("/admin/api/learnings").then(R=>c(R.learnings||[])).catch(R=>n(De(R),!0))},[]);const S=(R,N)=>oo("/admin/api/learnings/"+R.id,{scope:R.scope,text:R.text,path:R.path,status:R.status,...N}).then(I=>(c(L=>(L||[]).map(Q=>Q.id===I.id?I:Q)),I)),C=()=>Fn("/admin/api/learnings",j).then(R=>{c(N=>(N||[]).concat([R])),k({...j,text:""}),b(!1),n("Learning added")}).catch(R=>n(De(R),!0)),E=async R=>{await r({title:"Delete this learning?",description:R.text,action:"Delete",danger:!0})&&Ji("/admin/api/learnings/"+R.id).then(()=>{c(N=>(N||[]).filter(I=>I.id!==R.id)),y(null),n("Deleted")}).catch(N=>n(De(N),!0))},D={active:0,pending:0,disabled:0};(l||[]).forEach(R=>D[R.status]+=1);const T=(l||[]).filter(R=>(!h||R.status===h)&&(!u||(R.text+" "+R.scope+" "+R.host+" "+R.path).toLowerCase().includes(u.toLowerCase()))),P=(l==null?void 0:l.find(R=>R.id===g))??null;return s.jsxs("section",{className:"grid gap-4",children:[!i&&s.jsxs(da,{feature:"learnings",children:["Capturing team decisions from review replies, ",s.jsx("code",{children:"@bot remember"}),", and applying them to reviews are part of the licensed console. Without a license nothing new is learned and existing learnings are not applied."]}),s.jsxs(no,{children:[s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Search learnings","aria-label":"Search learnings",value:u,onChange:R=>f(R.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"Status",value:h,onChange:R=>v(R.target.value),children:[s.jsx("option",{value:"",children:"Any status"}),s.jsx("option",{value:"active",children:"Active"}),s.jsx("option",{value:"pending",children:"Waiting for approval"}),s.jsx("option",{value:"disabled",children:"Disabled"})]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:l&&`${D.active} active · ${D.pending} waiting · ${D.disabled} disabled`}),s.jsx("span",{className:"flex-1"}),i&&s.jsxs(ge,{variant:"outline",onClick:()=>b(!0),children:[s.jsx(Xi,{})," Add learning"]})]}),s.jsx(ao,{children:l?T.length?s.jsxs(co,{children:[s.jsx(uo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Applies to"}),s.jsx(Se,{children:"Learning"}),s.jsx(Se,{children:"Status"}),s.jsx(Se,{children:"Source"}),s.jsx(Se,{})]})}),s.jsx(fo,{children:T.map(R=>s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"pl-4 align-top",children:[s.jsx("div",{children:R.scope?s.jsx("code",{children:R.scope}):s.jsx("b",{children:"Whole host"})}),s.jsxs(Qe,{children:[R.platform," · ",R.host]})]}),s.jsxs(Ee,{className:"min-w-64 align-top whitespace-normal",children:[s.jsx("div",{children:R.text}),R.path&&s.jsxs(jn,{variant:"outline",className:"mt-1 font-normal text-muted-foreground",children:["files: ",R.path]})]}),s.jsx(Ee,{className:"w-36 align-top",children:s.jsxs(He,{"aria-label":"Status",value:R.status,disabled:!i,onChange:N=>S(R,{status:N.target.value}).then(I=>n("Learning "+I.status)).catch(I=>n(De(I),!0)),children:[s.jsx("option",{value:"active",children:"Active"}),s.jsx("option",{value:"pending",children:"Waiting"}),s.jsx("option",{value:"disabled",children:"Disabled"})]})}),s.jsxs(Ee,{className:"align-top text-muted-foreground",children:[s.jsx("div",{children:(E2[R.source]||R.source)+(R.source_author?" · "+R.source_author:"")}),R.source_url&&s.jsxs("a",{className:"inline-flex items-center gap-1 text-xs hover:text-foreground hover:underline",href:R.source_url,target:"_blank",rel:"noopener noreferrer",children:["open PR ",s.jsx(Og,{className:"size-3"})]}),s.jsx(Qe,{children:ro(R.updated_at)})]}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:i?s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>y(R.id),children:"Edit"}):s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>E(R),children:"Delete"})})]},R.id))})]}):s.jsx(bt,{children:l.length?"No learnings match.":"No learnings yet. Reply to one of the bot's comments with a team decision, or use @bot remember."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Learnings are team decisions from review discussions. When someone replies to one of the bot's comments, the bot reacts 👀, asks the model whether the reply states a rule for future reviews, and if so saves it here (✅ on GitLab, 🎉 on GitHub). ",s.jsx("code",{children:"@bot remember "})," saves one directly. Each starts scoped to its repository; widen ",s.jsx("b",{children:"Applies to"})," to a group or the whole host so one standard covers many repositories. Matching active learnings go with every review: the reviewer follows them and the verifier drops findings they rule out."]}),s.jsx(Go,{open:!!P,onClose:()=>y(null),title:"Edit learning",description:P?`${P.platform} · ${P.host}`:void 0,children:P&&s.jsx(_2,{l:P,onCancel:()=>y(null),onDelete:()=>E(P),onSave:R=>S(P,R).then(()=>{y(null),n("Saved")}).catch(N=>n(De(N),!0))},P.id)}),s.jsx(Jd,{open:x,onOpenChange:b,children:s.jsxs(Zd,{className:"sm:max-w-xl",children:[s.jsxs(ef,{children:[s.jsx(nf,{children:"Add learning"}),s.jsx(rf,{children:"A rule future reviews should follow."})]}),s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{value:j.platform,onChange:R=>k({...j,platform:R.target.value}),children:[s.jsx("option",{value:"gitlab",children:"GitLab"}),s.jsx("option",{value:"github",children:"GitHub"}),s.jsx("option",{value:"bitbucket",children:"Bitbucket"})]})}),s.jsx(Ce,{label:"Host",children:s.jsx(Me,{placeholder:"gitlab.example.com",value:j.host,onChange:R=>k({...j,host:R.target.value})})}),s.jsx(Ce,{label:"Applies to",children:s.jsx(Me,{placeholder:"empty = whole host · group · group/repo",value:j.scope,onChange:R=>k({...j,scope:R.target.value})})}),s.jsx(Ce,{label:"Only files matching",children:s.jsx(Me,{placeholder:"optional glob, e.g. api/legacy/**",value:j.path,onChange:R=>k({...j,path:R.target.value})})})]}),s.jsx(Ce,{label:"Learning",children:s.jsx(rs,{rows:4,maxLength:600,placeholder:"e.g. Account numbers are compared without leading zeros on purpose.",value:j.text,onChange:R=>k({...j,text:R.target.value})})}),s.jsxs(tf,{children:[s.jsx(ge,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),s.jsx(ge,{onClick:C,children:"Add learning"})]})]})})]})}const Xu={github:"GitHub",gitlab:"GitLab",bitbucket:"Bitbucket"},R2={github:"https://api.github.com",gitlab:"https://gitlab.com",bitbucket:"https://api.bitbucket.org/2.0"},Cl=n=>n.split(` -`).map(r=>r.trim()).filter(Boolean);function kr({label:n,set:r,multi:i,list:l,help:c,value:u,onChange:f}){const h=r?"Set ✓ — leave blank to keep":l?"one per line":"";return s.jsx(Ce,{label:n+(c?" — "+c:""),children:i?s.jsx(rs,{rows:3,className:"font-mono text-xs",placeholder:h,autoComplete:"off",spellCheck:!1,value:u,onChange:v=>f(v.target.value)}):s.jsx(Me,{type:"password",placeholder:h,autoComplete:"new-password",value:u,onChange:v=>f(v.target.value)})})}function of({text:n,label:r="Copy"}){const i=St(),[l,c]=m.useState(!1),u=()=>navigator.clipboard.writeText(n).then(()=>{c(!0),setTimeout(()=>c(!1),1500)}).catch(()=>i("Copy failed: select the text and copy it",!0));return s.jsxs(ge,{variant:"ghost",size:"sm",onClick:u,"aria-label":r,children:[l?s.jsx(Ql,{}):s.jsx(f1,{})," ",r]})}function Ly({secret:n,platform:r,onDone:i}){const l=r==="gitlab"?"GitLab's Secret token field":"the webhook's Secret field";return s.jsxs("div",{className:"grid gap-2 rounded-lg border border-warning/40 bg-warning-soft p-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"Copy the secret now: it is not shown again."}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs",children:n}),s.jsx(of,{text:n})]}),s.jsxs(Qe,{children:["Paste it into ",l,", together with the URL."]}),s.jsx("div",{children:s.jsx(ge,{size:"sm",variant:"outline",onClick:i,children:"I've copied it"})})]})}function P2({hook:n,platform:r,onChanged:i}){const l=St(),c=Zo(),[u,f]=m.useState(""),[h,v]=m.useState(n.name),[g,y]=m.useState(""),x=(k,S)=>oo("/admin/api/webhooks/"+n.id,k).then(C=>{l(S),C.secret&&f(C.secret),i()}).catch(C=>l(De(C),!0)),b=async()=>{await c({title:"Replace the secret of "+n.name+"?",description:"Deliveries signed with the old secret are rejected until you paste the new one into the code host.",action:"Replace secret",danger:!0})&&x({regenerate_secret:!0},"New secret for "+n.name)},j=async()=>{await c({title:"Delete "+n.name+"?",description:"Its URL stops working at once. Remove the webhook from the code host too.",action:"Delete webhook",danger:!0})&&Ji("/admin/api/webhooks/"+n.id).then(()=>{l("Deleted "+n.name),i()}).catch(k=>l(De(k),!0))};return s.jsxs("div",{className:"grid gap-3 rounded-lg border p-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Me,{className:"h-8 max-w-64",value:h,onChange:k=>v(k.target.value),onBlur:()=>h.trim()!==n.name&&x({name:h},"Renamed")}),s.jsx(yn,{kind:n.enabled?"on":"idle",children:n.enabled?"Enabled":"Disabled"}),r==="gitlab"&&n.secrets.signing_tokens>0&&s.jsx(jn,{variant:"outline",className:"font-normal text-muted-foreground",children:"signing token ✓"}),s.jsx("span",{className:"flex-1"}),s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>x({enabled:!n.enabled},n.enabled?"Disabled "+n.name:"Enabled "+n.name),children:n.enabled?"Disable":"Enable"}),s.jsx(ge,{variant:"ghost",size:"sm",onClick:b,children:"New secret"}),s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:j,children:"Delete"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"hosturl min-w-0 flex-1 break-all",children:n.url}),s.jsx(of,{text:n.url,label:"Copy URL"})]}),u&&s.jsx(Ly,{secret:u,platform:r,onDone:()=>f("")}),r==="gitlab"&&s.jsx(Ce,{label:"Signing token (whsec_…) — GitLab 19.0+, "+(n.secrets.signing_tokens?"set ✓, paste to replace":"optional: copy it from the webhook in GitLab"),children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Me,{type:"password",autoComplete:"off",value:g,placeholder:n.secrets.signing_tokens?"Set ✓":"",onChange:k=>y(k.target.value)}),s.jsx(ge,{variant:"outline",size:"sm",disabled:!g.trim(),onClick:()=>x({signing_tokens:[g.trim()]},"Saved signing token").then(()=>y("")),children:"Save"}),n.secrets.signing_tokens>0&&s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>x({signing_tokens:[]},"Removed signing token"),children:"Remove"})]})}),s.jsxs(Qe,{children:["Added ",new Date(n.created_at).toLocaleDateString(),n.created_by?" by "+n.created_by:""]})]})}function D2({text:n}){return s.jsx("div",{role:"status",className:"rounded-lg border border-warning/40 bg-warning-soft p-3 text-sm text-warning",children:n})}function T2({host:n,managed:r,onChanged:i}){const l=St(),[c,u]=m.useState(""),[f,h]=m.useState(null),v=()=>Fn(`/admin/api/hosts/${n.id}/webhooks`,{name:c.trim()}).then(y=>{u(""),h({id:y.webhook.id,secret:y.secret}),l("Added "+y.webhook.name),i()}).catch(y=>l(De(y),!0)),g=n.secrets.webhook_secrets>0||n.secrets.signing_tokens>0;return s.jsxs("div",{className:"grid gap-6",children:[n.comment_warning&&s.jsx(D2,{text:n.comment_warning}),r&&s.jsxs(Xr,{title:"Add a webhook",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Me,{className:"max-w-80",value:c,placeholder:n.platform==="gitlab"?"e.g. the group it's for":"e.g. where it's set up",onChange:y=>u(y.target.value)}),s.jsxs(ge,{onClick:v,children:[s.jsx(Xi,{})," Add webhook"]})]}),s.jsxs(Qe,{children:["The console generates a URL and a secret. Set the code host's webhook to them, with these events: ",n.events.join(", "),".",n.platform==="gitlab"&&" A system hook alone isn't enough: it doesn't send comments, so @bot commands need a group or project webhook with Comments."]})]}),s.jsx(Xr,{title:`Webhooks (${n.webhooks.length})`,children:n.webhooks.length?n.webhooks.map(y=>s.jsxs("div",{className:"grid gap-2",children:[(f==null?void 0:f.id)===y.id&&s.jsx(Ly,{secret:f.secret,platform:n.platform,onDone:()=>h(null)}),s.jsx(P2,{hook:y,platform:n.platform,onChanged:i})]},y.id)):s.jsxs(Qe,{children:["No webhooks yet",r?": add one above.":"."]})}),s.jsx(Jr,{}),s.jsxs(Xr,{title:"Shared URL",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"hosturl min-w-0 flex-1 break-all",children:n.webhook_url}),s.jsx(of,{text:n.webhook_url,label:"Copy URL"})]}),s.jsx(Qe,{children:g?"Still accepted for existing hooks. It is shared by every "+Xu[n.platform]+" host and checked with the secrets in the host's settings. Move hooks to their own URL above when you can.":"Shared by every "+Xu[n.platform]+" host. This host has no secrets of its own for it, so only the webhooks above work."})]})]})}function Xr({title:n,children:r}){return s.jsxs("div",{className:"grid gap-3",children:[s.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:n}),r]})}function O2({host:n,onSaved:r,onCancel:i}){const l=St(),c=ln("hosts"),u=(n==null?void 0:n.settings)??{},f=(n==null?void 0:n.secrets)??{token:!1,app_private_key:!1,api_token:!1,webhook_secrets:0,signing_tokens:0},[h,v]=m.useState((n==null?void 0:n.platform)??"gitlab"),[g,y]=m.useState({base:(n==null?void 0:n.base_url)??"",name:(n==null?void 0:n.name)??"",enabled:n?n.enabled:!0,token:"",appID:u.app_id?String(u.app_id):"",appKey:"",email:u.email??"",apiToken:"",secrets:"",signing:"",reqSig:!!u.require_signature,skipTLS:!!u.skip_tls_verify,bot:u.bot_name??"",reviewer:u.reviewer??""}),x=j=>k=>y({...g,[j]:typeof k=="object"&&(k!=null&&k.target)?k.target.value:k}),b=()=>{const j={platform:h,base_url:g.base.trim(),name:g.name.trim(),enabled:g.enabled,settings:{bot_name:g.bot.trim(),reviewer:g.reviewer.trim()}};h==="github"&&(j.settings.app_id=parseInt(g.appID||"0",10)),h==="gitlab"&&Object.assign(j.settings,{skip_tls_verify:g.skipTLS,require_signature:g.reqSig}),h==="bitbucket"&&(j.settings.email=g.email.trim()),g.token.trim()&&(j.token=g.token.trim()),g.appKey.trim()&&(j.app_private_key=g.appKey),g.apiToken.trim()&&(j.api_token=g.apiToken.trim()),Cl(g.secrets).length&&(j.webhook_secrets=Cl(g.secrets)),Cl(g.signing).length&&(j.signing_tokens=Cl(g.signing)),(n?oo("/admin/api/hosts/"+n.id,j):Fn("/admin/api/hosts",j)).then(k=>{l("Saved "+k.name),r(k)}).catch(k=>l(De(k),!0))};return s.jsxs("div",{className:"grid gap-6",children:[s.jsx(Xr,{title:"Host",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{id:"hPlat",value:h,disabled:!!n,onChange:j=>v(j.target.value),children:[s.jsx("option",{value:"gitlab",children:"GitLab"}),s.jsx("option",{value:"github",children:"GitHub"}),s.jsx("option",{value:"bitbucket",children:"Bitbucket Cloud"})]})}),s.jsx(Ce,{label:"Status",children:s.jsxs(He,{value:String(g.enabled),onChange:j=>y({...g,enabled:j.target.value==="true"}),children:[s.jsx("option",{value:"true",children:"Enabled"}),s.jsx("option",{value:"false",children:"Disabled"})]})}),s.jsx(Ce,{label:h==="gitlab"?"Instance URL":"API URL",children:s.jsx(Me,{value:g.base,placeholder:R2[h],onChange:x("base")})}),s.jsx(Ce,{label:"Name",children:s.jsx(Me,{value:g.name,placeholder:"shown in the console",onChange:x("name")})})]})}),s.jsx(Jr,{}),s.jsx(Xr,{title:"API access",children:s.jsxs("div",{className:"grid gap-4",children:[h==="github"&&s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Token",help:"or use a GitHub App below",set:f.token,value:g.token,onChange:x("token")}),s.jsx(Ce,{label:"GitHub App ID",children:s.jsx(Me,{type:"number",value:g.appID,onChange:x("appID")})}),s.jsx(kr,{label:"GitHub App private key (PEM)",set:f.app_private_key,multi:!0,value:g.appKey,onChange:x("appKey")})]}),h==="gitlab"&&s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Access token (api scope)",set:f.token,value:g.token,onChange:x("token")}),s.jsx(Ce,{label:"TLS",children:s.jsxs(He,{value:String(g.skipTLS),onChange:j=>y({...g,skipTLS:j.target.value==="true"}),children:[s.jsx("option",{value:"false",children:"Verify certificates"}),s.jsx("option",{value:"true",children:"Skip verification (self-signed)"})]})})]}),h==="bitbucket"&&s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Access token",help:"repository or workspace token",set:f.token,value:g.token,onChange:x("token")}),s.jsx(Ce,{label:"Account email",children:s.jsx(Me,{value:g.email,placeholder:"with an API token instead",onChange:x("email")})}),s.jsx(kr,{label:"Atlassian API token",set:f.api_token,value:g.apiToken,onChange:x("apiToken")})]})]})}),s.jsx(Jr,{}),s.jsxs(Xr,{title:"Shared URL secrets (optional)",children:[s.jsxs(Qe,{children:["Only for hooks on the shared ","/webhooks/"+h," URL. Webhooks added under Webhooks have their own URL and secret."]}),s.jsx("div",{className:"grid gap-4",children:h==="gitlab"?s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Signing tokens (whsec_…)",multi:!0,list:!0,set:f.signing_tokens>0,help:f.signing_tokens?f.signing_tokens+" set":"GitLab 19.0+, recommended",value:g.signing,onChange:x("signing")}),s.jsx(kr,{label:"Secret tokens",multi:!0,list:!0,set:f.webhook_secrets>0,help:f.webhook_secrets?f.webhook_secrets+" set":"older hooks",value:g.secrets,onChange:x("secrets")}),s.jsx(Ce,{label:"Unsigned webhooks",children:s.jsxs(He,{value:String(g.reqSig),onChange:j=>y({...g,reqSig:j.target.value==="true"}),children:[s.jsx("option",{value:"false",children:"Accept with a secret token"}),s.jsx("option",{value:"true",children:"Reject"})]})})]}):s.jsx(kr,{label:"Webhook secrets",multi:!0,list:!0,set:f.webhook_secrets>0,help:f.webhook_secrets?f.webhook_secrets+" set":"one per hook",value:g.secrets,onChange:x("secrets")})})]}),s.jsx(Jr,{}),s.jsx(Xr,{title:"Bot identity",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Mention name",hint:s.jsx(Tl,{feature:"hosts"}),children:s.jsx(Me,{value:g.bot,placeholder:"default: the token's user",disabled:!c&&!g.bot,onChange:x("bot")})}),s.jsx(Ce,{label:"Reviewer username",children:s.jsx(Me,{value:g.reviewer,placeholder:"default: the token's user",disabled:!c&&!g.reviewer,onChange:x("reviewer")})})]})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{onClick:b,children:n?"Save host":"Add host"}),s.jsx(ge,{variant:"outline",onClick:i,children:"Cancel"})]})]})}function M2(){const n=St(),r=Zo(),i=ln("hosts"),[l,c]=m.useState(null),[u,f]=m.useState(null),[h,v]=m.useState(null),[g,y]=m.useState({}),x=()=>Ct("/admin/api/hosts").then(c).catch(E=>n(De(E),!0));m.useEffect(()=>{x()},[]);const b=E=>{y(D=>({...D,[E.id]:{pending:!0}})),Fn(`/admin/api/hosts/${E.id}/test`).then(D=>y(T=>({...T,[E.id]:D}))).catch(D=>y(T=>({...T,[E.id]:{ok:!1,message:De(D)}})))},j=async E=>{await r({title:"Delete "+E.name+"?",description:"Webhooks from it will be rejected and its stored tokens removed.",action:"Delete host",danger:!0})&&Ji("/admin/api/hosts/"+E.id).then(()=>{n("Deleted "+E.name),x()}).catch(D=>n(De(D),!0))},k=(l==null?void 0:l.mode)==="database",S=u?(l==null?void 0:l.hosts.find(E=>E.id===u))??null:null,C=h?(l==null?void 0:l.hosts.find(E=>E.id===h))??null:null;return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(no,{children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[l&&(k?"Managed here; stored encrypted in the database.":`Hosts come from the config file (read-only). Set ${l.key_env||"CODEREVIEW_CONSOLE_SECRET_KEY"} to manage them here.`),l&&!i&&" Free: one host per platform."]}),s.jsx("span",{className:"flex-1"}),k&&s.jsxs(ge,{variant:"outline",onClick:()=>f(0),children:[s.jsx(Xi,{})," Add host"]})]}),s.jsx(ao,{children:l?l.hosts.length?s.jsxs(co,{children:[s.jsx(uo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Host"}),s.jsx(Se,{children:"Credentials"}),s.jsx(Se,{children:"Webhooks"}),s.jsx(Se,{children:"Check"}),s.jsx(Se,{})]})}),s.jsx(fo,{children:l.hosts.map(E=>{const D=E.secrets,T=[D.token&&"token ✓",E.settings.app_id&&`App ${E.settings.app_id}${D.app_private_key?" ✓":" (no key)"}`,D.api_token&&"API token ✓",D.signing_tokens&&`${D.signing_tokens} signing token${D.signing_tokens>1?"s":""}`,D.webhook_secrets&&`${D.webhook_secrets} webhook secret${D.webhook_secrets>1?"s":""}`].filter(Boolean),P=g[E.id];return s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"pl-4 align-top",children:[s.jsx("div",{className:"font-medium",children:E.name}),s.jsxs(Qe,{children:[Xu[E.platform]," · ",E.host]}),s.jsx("div",{className:"mt-1.5",children:E.licensed?s.jsx(yn,{kind:E.enabled?"on":"idle",children:E.enabled?"Enabled":"Disabled"}):s.jsx(yn,{kind:"warn",children:"Inactive: needs a license"})})]}),s.jsxs(Ee,{className:"align-top whitespace-normal",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:T.map(R=>s.jsx(jn,{variant:"outline",className:"font-normal text-muted-foreground",children:R},R))}),s.jsxs(Qe,{children:["mention: ",E.settings.bot_name?"@"+E.settings.bot_name:"token user",E.settings.reviewer?" · reviewer: "+E.settings.reviewer:""]})]}),s.jsxs(Ee,{className:"max-w-80 align-top whitespace-normal",children:[E.webhooks.length?s.jsx("div",{className:"grid gap-0.5 text-sm",children:E.webhooks.map(R=>s.jsx("div",{className:R.enabled?"":"text-muted-foreground line-through",children:R.name},R.id))}):s.jsx(Qe,{children:E.secrets.webhook_secrets||E.secrets.signing_tokens?"Shared URL only":"None yet"}),E.comment_warning&&s.jsx("div",{className:"mt-1.5",children:s.jsx(yn,{kind:"warn",children:"No comment events"})}),s.jsxs(ge,{variant:"link",size:"sm",className:"h-auto px-0",onClick:()=>v(E.id),children:[s.jsx(iv,{})," ",k?"Manage webhooks":"Show URLs"]})]}),s.jsx(Ee,{className:"max-w-56 align-top whitespace-normal",children:P&&(P.pending?s.jsx("span",{className:"text-sm text-muted-foreground",children:"testing…"}):s.jsx(yn,{kind:P.ok?"on":"off",children:P.message}))}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>b(E),children:[s.jsx(b1,{})," Test"]}),k&&s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>f(E.id),children:"Edit"}),s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>j(E),children:"Delete"})]})]})})]},E.id)})})]}):s.jsx(bt,{children:"No code hosts yet. Add GitHub, GitLab or Bitbucket."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Each host is a GitHub (github.com or Enterprise), GitLab (gitlab.com or self-managed) or Bitbucket Cloud account the console reviews for. Tokens and webhook secrets are encrypted with ",s.jsx("code",{children:"CODEREVIEW_CONSOLE_SECRET_KEY"})," before they are stored and are never shown again: leave a secret blank to keep it. Under ",s.jsx("b",{children:"Manage webhooks"}),", add one webhook per hook you set up (a GitLab system hook, each group hook): each gets its own URL and secret, so one can be replaced or removed without touching the others."]}),s.jsx(Go,{open:C!==null,onClose:()=>v(null),title:C?"Webhooks: "+C.name:"",description:"Each webhook has its own URL and secret.",wide:!0,children:C&&s.jsx(T2,{host:C,managed:k,onChanged:x},C.id)}),s.jsx(Go,{open:u!==null,onClose:()=>f(null),title:S?"Edit "+S.name:"New host",description:"Credentials are encrypted before they are stored.",children:u!==null&&s.jsx(O2,{host:S,onCancel:()=>f(null),onSaved:E=>{f(null),x().then(()=>b(E))}},u)})]})}const Ju=[["enabled","Reviews","Enabled","Disabled"],["require_reviewer","Reviewer required","On","Off"],["skip_branch_sync","Branch syncs","Skip","Review"],["score_labels","Score labels","On","Off"],["commit_status","Commit status","On","Off"]],Bi=n=>n.pattern||"Whole host";function A2({rule:n,onSave:r,onDelete:i}){const[l,c]=m.useState(()=>Object.fromEntries(Ju.map(([u])=>[u,n[u]??null])));return s.jsx(Xd,{value:n.settings,inheritModel:"Inherit",onSave:u=>r({...l,settings:u}),danger:s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:i,children:"Delete rule"}),extra:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3",children:[s.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Settings for this level"}),s.jsx(Xt,{className:"lg:grid-cols-2",children:Ju.map(([u,f,h,v])=>s.jsx(Ce,{label:f,children:s.jsx(Vl,{value:l[u],on:h,off:v,onChange:g=>c({...l,[u]:g})})},u))})]}),s.jsx(Jr,{}),s.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Review settings"})]})})}function I2(){const n=St(),r=Zo(),i=ln("rules"),[l,c]=m.useState(null),[u,f]=m.useState([]),[h,v]=m.useState(null),[g,y]=m.useState(!1),[x,b]=m.useState({platform:"gitlab",host:"",pattern:"",enabled:null}),j=()=>Ct("/admin/api/repos").then(P=>f(P||[]));m.useEffect(()=>{Ct("/admin/api/rules").then(P=>c(P||[])).catch(P=>n(De(P),!0)),j().catch(()=>{})},[]);const k=P=>{const R=P.pattern?P.pattern:"host "+P.host;return u.filter(N=>(N.effective.rules||[]).includes(R)&&N.platform===P.platform&&N.host===P.host).length},S=()=>{const P={platform:x.platform,host:x.host.trim(),pattern:x.pattern.trim()};x.enabled!==null&&(P.enabled=x.enabled),Fn("/admin/api/rules",P).then(R=>(c(N=>(N||[]).filter(I=>I.id!==R.id).concat([R])),b({...x,pattern:""}),y(!1),v(R.id),n("Saved rule "+Bi(R)+" — set its options"),j())).catch(R=>n(De(R),!0))},C=(P,R)=>oo("/admin/api/rules/"+P.id,R).then(N=>(c(I=>(I||[]).map(L=>L.id===N.id?N:L)),v(null),n("Saved "+Bi(N)),j())).catch(N=>n(De(N),!0)),E=async P=>{await r({title:"Delete the rule for "+Bi(P)+"?",description:"On "+P.host+". Repositories fall back to the level above.",action:"Delete rule",danger:!0})&&Ji("/admin/api/rules/"+P.id).then(()=>(c(R=>(R||[]).filter(N=>N.id!==P.id)),v(null),n("Deleted rule "+Bi(P)),j())).catch(R=>n(De(R),!0))},D=(l||[]).slice().sort((P,R)=>(P.platform+P.host).localeCompare(R.platform+R.host)||(P.pattern?1:0)-(R.pattern?1:0)||P.pattern.localeCompare(R.pattern)),T=(l==null?void 0:l.find(P=>P.id===h))??null;return s.jsxs("section",{className:"grid gap-4",children:[!i&&s.jsx(da,{feature:"rules",children:"Settings for a whole host, a group or a name pattern are part of the licensed console. Without a license, repositories follow the global settings and their own mode; any rules below are kept but ignored."}),s.jsxs(no,{children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Settings for a whole host, or for a group, organisation or name pattern on a host."}),s.jsx("span",{className:"flex-1"}),i&&s.jsxs(ge,{variant:"outline",onClick:()=>y(!0),children:[s.jsx(Xi,{})," Add rule"]})]}),s.jsx(ao,{children:l?l.length?s.jsxs(co,{children:[s.jsx(uo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Scope"}),s.jsx(Se,{children:"Sets"}),s.jsx(Se,{children:"Covers"}),s.jsx(Se,{children:"Last changed"}),s.jsx(Se,{})]})}),s.jsx(fo,{children:D.map(P=>{const R=k(P),N=Ju.filter(([I])=>P[I]!==null&&P[I]!==void 0).map(([I,L,Q,ee])=>L+": "+(P[I]?Q:ee));return s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"pl-4 align-top",children:[s.jsx("div",{children:P.pattern?s.jsx("code",{children:P.pattern}):s.jsx("b",{children:"Whole host"})}),s.jsxs(Qe,{children:[P.platform," · ",P.host]})]}),s.jsxs(Ee,{className:"align-top whitespace-normal",children:[s.jsx(Yu,{items:N,empty:"inherits everything"}),s.jsx("div",{className:"mt-1",children:s.jsx(Yu,{items:My(P.settings)})})]}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:R+(R===1?" known repository":" known repositories")}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:P.updated_by?P.updated_by+" · "+ro(P.updated_at):"—"}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:i?s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>v(P.id),children:"Edit"}):s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>E(P),children:"Delete"})})]},P.id)})})]}):s.jsx(bt,{children:"No rules yet. Add one for a whole host, a group or a name pattern."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Levels, broadest first: ",s.jsx("b",{children:"Settings"})," (everything) → ",s.jsx("b",{children:"whole host"})," (empty pattern) → ",s.jsx("b",{children:"group or owner"})," (",s.jsx("code",{children:"acme"}),", ",s.jsx("code",{children:"acme/platform"}),", subgroups included) or ",s.jsx("b",{children:"pattern"})," (",s.jsx("code",{children:"acme/svc-*"}),"; ",s.jsx("code",{children:"*"})," stays within one level) → ",s.jsx("b",{children:"repository"}),". For each setting the most specific level that sets it wins; ",s.jsx("b",{children:"Inherit"}),' means "use the level above". Review settings add up the same way. Hosts are separate: a rule for ',s.jsx("code",{children:"acme"})," on one host never touches ",s.jsx("code",{children:"acme"})," on another."]}),s.jsx(Go,{open:!!T,onClose:()=>v(null),title:T?Bi(T):"",description:T?`${T.platform} · ${T.host}`:void 0,children:T&&s.jsx(A2,{rule:T,onSave:P=>C(T,P),onDelete:()=>E(T)},T.id)}),s.jsx(Jd,{open:g,onOpenChange:y,children:s.jsxs(Zd,{className:"sm:max-w-lg",children:[s.jsxs(ef,{children:[s.jsx(nf,{children:"Add rule"}),s.jsx(rf,{children:"After adding it, set its options."})]}),s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{value:x.platform,onChange:P=>b({...x,platform:P.target.value}),children:[s.jsx("option",{value:"gitlab",children:"GitLab"}),s.jsx("option",{value:"github",children:"GitHub"})]})}),s.jsx(Ce,{label:"Host",children:s.jsx(Me,{placeholder:"gitlab.com",value:x.host,onChange:P=>b({...x,host:P.target.value})})}),s.jsx(Ce,{label:"Group, owner or pattern",className:"sm:col-span-2",children:s.jsx(Me,{placeholder:"empty = whole host · acme · acme/svc-*",value:x.pattern,onChange:P=>b({...x,pattern:P.target.value})})}),s.jsx(Ce,{label:"Reviews",children:s.jsx(Vl,{value:x.enabled,on:"Enabled",off:"Disabled",onChange:P=>b({...x,enabled:P})})})]}),s.jsxs(tf,{children:[s.jsx(ge,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),s.jsx(ge,{onClick:S,children:"Add rule"})]})]})})]})}const ag=["queued","ignored","duplicate","rejected","error"],L2=n=>({queued:"on",rejected:"off",error:"off"})[n]||"idle";function z2(){const n=St(),[r,i]=m.useState(null),[l,c]=m.useState({}),[u,f]=m.useState(!1),[h,v]=m.useState(""),[g,y]=m.useState(""),[x,b]=m.useState({});m.useEffect(()=>{Ct("/admin/api/hosts").then(k=>b(Object.fromEntries(k.hosts.flatMap(S=>(S.webhooks||[]).map(C=>[C.id,C.name]))))).catch(()=>{})},[]);const j=k=>{const S=k&&(r!=null&&r.length)?r[r.length-1].id:void 0;Ct("/admin/api/webhooks"+Pu({limit:100,project:h.trim(),outcome:g,before:S})).then(C=>{i(E=>k?(E||[]).concat(C.events):C.events),c(C.counts_24h||{}),f(C.events.length>=100)}).catch(C=>n(De(C),!0))};return m.useEffect(()=>{const k=window.setTimeout(()=>j(),h?250:0);return()=>window.clearTimeout(k)},[h,g]),s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(no,{children:[s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Filter by project","aria-label":"Filter webhooks by project",value:h,onChange:k=>v(k.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"Outcome",value:g,onChange:k=>y(k.target.value),children:[s.jsx("option",{value:"",children:"All outcomes"}),ag.map(k=>s.jsx("option",{value:k,children:k[0].toUpperCase()+k.slice(1)},k))]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last 24 h: ",ag.map(k=>(l[k]||0)+" "+k).join(" · ")]}),s.jsx("span",{className:"flex-1"}),s.jsxs(ge,{variant:"outline",onClick:()=>j(),children:[s.jsx(Yg,{})," Refresh"]})]}),s.jsx(ao,{children:r?r.length?s.jsxs(co,{children:[s.jsx(uo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"When"}),s.jsx(Se,{children:"Project"}),s.jsx(Se,{children:"Event"}),s.jsx(Se,{children:"Outcome"}),s.jsx(Se,{children:"Reason"}),s.jsx(Se,{className:"pr-4",children:"Via"})]})}),s.jsx(fo,{children:r.map(k=>{const S=[k.kind||k.event,k.action].filter(Boolean).join(" · ")+(k.number?" · !"+k.number:"");return s.jsxs(Mt,{children:[s.jsx(Ee,{className:"pl-4 align-top text-muted-foreground",title:new Date(k.received_at).toLocaleString(),children:ro(k.received_at)}),s.jsxs(Ee,{className:"align-top",children:[s.jsx("div",{className:"font-medium",children:k.project||"—"}),s.jsx(Qe,{children:k.platform+(k.host?" · "+k.host:"")})]}),s.jsxs(Ee,{className:"align-top",children:[s.jsx("div",{children:S||"—"}),s.jsx(Qe,{children:k.event+(k.sender?" · by "+k.sender:"")})]}),s.jsx(Ee,{className:"align-top",children:s.jsx(yn,{kind:L2(k.outcome),children:k.outcome})}),s.jsx(Ee,{className:"reason min-w-64 align-top text-sm whitespace-normal text-muted-foreground",children:k.reason}),s.jsxs(Ee,{className:"pr-4 align-top text-muted-foreground",children:[s.jsx("div",{children:k.endpoint?x[k.endpoint]||"unknown webhook":"shared URL"}),s.jsx(Qe,{children:k.auth})]})]},k.id)})})]}):s.jsx(bt,{children:"No webhook deliveries match."}):s.jsx(bt,{children:"Loading…"})}),u&&s.jsx("div",{children:s.jsx(ge,{variant:"outline",onClick:()=>j(!0),children:"Load older"})}),s.jsxs(Jt,{children:["Every webhook delivery and what the console did with it. ",s.jsx("b",{children:"Ignored"})," is normal for events that should not start a review (approvals, label or reviewer changes, edits without new commits) and for repositories that are not enabled. ",s.jsx("b",{children:"Rejected"})," means the signature or token did not match. History is kept for the days set in Settings (14 by default)."]})]})}function Mn({label:n,value:r,onChange:i,yes:l,no:c,disabled:u,note:f}){return s.jsx(Ce,{label:n,hint:f,children:s.jsxs(He,{value:String(r),disabled:u,onChange:h=>i(h.target.value==="true"),children:[s.jsx("option",{value:"true",children:l}),s.jsx("option",{value:"false",children:c})]})})}function Sl({label:n,value:r,onChange:i,note:l,...c}){return s.jsx(Ce,{label:n,hint:l,children:s.jsx(Me,{type:"number",value:r||"",...c,onChange:u=>i(parseInt(u.target.value||"0",10))})})}function $o({title:n,description:r,children:i}){return s.jsxs(Vn,{children:[s.jsxs(Bl,{children:[s.jsx(Qd,{className:"h2",children:n}),r&&s.jsx(Yd,{children:r})]}),s.jsx(to,{children:i})]})}function F2(){const n=St(),r=qd(),i=ei(),l={learnings:ln("learnings"),budgets:ln("budgets"),sync:ln("branch_sync"),metrics:ln("metrics")},[c,u]=m.useState(null),[f,h]=m.useState(null),[v,g]=m.useState(""),[y,x]=m.useState(0),b=C=>{u(C),h(C),g((C.sync_source_branches||[]).join(", "))};if(m.useEffect(()=>{Ct("/admin/api/settings").then(b).catch(C=>n(De(C),!0))},[]),!c||!f)return s.jsx(bt,{children:"Loading…"});const j=C=>E=>h({...f,[C]:E}),k=C=>{const{source:E,...D}={...f,review_defaults:C,dashboard_title:f.dashboard_title.trim(),sync_source_branches:v.split(",").map(T=>T.trim()).filter(Boolean)};oo("/admin/api/settings",D).then(T=>{b(T),x(P=>P+1),r(),n("Settings saved")}).catch(T=>n(De(T),!0))},S=Object.keys(c.source||{}).filter(C=>c.source[C]==="config");return s.jsxs("section",{className:"grid gap-4",children:[s.jsx($o,{title:"Repository access",description:"Which repositories are reviewed, and when.",children:s.jsxs(Xt,{children:[s.jsx(Mn,{label:"Repositories no rule matches",value:f.allowlist,onChange:j("allowlist"),yes:"Not reviewed (allowlist on)",no:"Reviewed (allowlist off)"}),s.jsx(Mn,{label:"Who asks for a review",value:f.require_reviewer,onChange:j("require_reviewer"),yes:"Only when the bot is a reviewer",no:"Any opened MR or push"}),s.jsx(Mn,{label:"Branch syncs (source is the default branch)",value:f.skip_branch_sync,onChange:j("skip_branch_sync"),yes:"Skip",no:"Review",disabled:!l.sync,note:s.jsx(Tl,{feature:"branch_sync"})}),s.jsx(Ce,{label:"Also treat these source branches as syncs",children:s.jsx(Me,{placeholder:"develop, release/*",value:v,disabled:!l.sync,onChange:C=>g(C.target.value)})}),s.jsx(Mn,{label:"Score labels on MRs/PRs",value:f.score_labels,onChange:j("score_labels"),yes:"On",no:"Off"}),s.jsx(Mn,{label:"Commit status on the reviewed commit",value:f.commit_status,onChange:j("commit_status"),yes:"On",no:"Off"})]})}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx($o,{title:"Learnings",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Mn,{label:"Learn from replies to the bot",value:f.learnings_enabled,onChange:j("learnings_enabled"),yes:"On",no:"Off",disabled:!l.learnings,note:s.jsx(Tl,{feature:"learnings"})}),s.jsx(Mn,{label:"New learnings",value:f.learnings_auto_activate,onChange:j("learnings_auto_activate"),yes:"Apply at once",no:"Wait for an admin's approval",disabled:!l.learnings})]})}),s.jsx($o,{title:"Budgets",description:'Input plus output tokens of finished jobs in the current UTC day. When a budget is used up, automatic reviews and chat commands wait until the next day; "Review now" and re-runs from this panel still run.',children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Sl,{label:"Daily tokens, all repositories",min:0,step:1e4,placeholder:"0 = no limit",value:f.daily_token_budget,onChange:j("daily_token_budget"),disabled:!l.budgets,note:s.jsx(Tl,{feature:"budgets"})}),s.jsx(Sl,{label:"Daily tokens per repository",min:0,step:1e4,placeholder:"0 = no limit",value:f.repo_daily_token_budget,onChange:j("repo_daily_token_budget"),disabled:!l.budgets})]})}),s.jsx($o,{title:"History",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Sl,{label:"Keep reviews (days)",min:1,max:3650,value:f.review_retention_days,onChange:j("review_retention_days"),note:!l.metrics&&f.review_retention_days>i.free_retention_days?s.jsxs("span",{className:"locknote text-xs text-warning",children:["Without a license with metrics and long history, reviews are kept ",i.free_retention_days," days."]}):null}),s.jsx(Sl,{label:"Keep webhook deliveries (days)",min:1,max:3650,value:f.webhook_retention_days,onChange:j("webhook_retention_days")})]})}),s.jsx($o,{title:"Status dashboard",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Mn,{label:"Dashboard",value:f.dashboard_enabled,onChange:j("dashboard_enabled"),yes:"On",no:"Off"}),s.jsx(Mn,{label:"Repository names",value:!f.hide_repos,onChange:C=>j("hide_repos")(!C),yes:"Shown",no:"Hidden"}),s.jsx(Ce,{label:"Title",className:"sm:col-span-2",children:s.jsx(Me,{maxLength:120,value:f.dashboard_title,onChange:C=>j("dashboard_title")(C.target.value)})})]})})]}),s.jsx(Vn,{className:"py-4",children:s.jsxs(L_,{className:"flex flex-wrap items-center gap-3",children:[s.jsx(ge,{onClick:()=>k(c.review_defaults),children:"Save settings"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:S.length?"Not saved yet (from the config file): "+S.join(", "):""})]})}),s.jsx($o,{title:"Default review settings",description:"Apply to every repository. Group and pattern rules, then repository settings, override them.",children:s.jsx(Xd,{value:c.review_defaults,onSave:k,saveLabel:"Save default review settings"},y)}),s.jsx(Jt,{children:"The config file is the initial configuration: on first start its values are copied here, and from then on these settings are kept in the database. Editing the config file later does not change them; the server log notes any difference. Every change is in the audit log."})]})}function $2(){const n=St(),[r,i]=m.useState(null),l=ln("audit");return m.useEffect(()=>{l&&Ct("/admin/api/audit").then(c=>i(c||[])).catch(c=>n(De(c),!0))},[l]),l?s.jsx("section",{className:"grid gap-4",children:s.jsx(ao,{children:r?r.length?s.jsxs(co,{children:[s.jsx(uo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"When"}),s.jsx(Se,{children:"Who"}),s.jsx(Se,{children:"Action"}),s.jsx(Se,{children:"Target"}),s.jsx(Se,{className:"pr-4",children:"Details"})]})}),s.jsx(fo,{children:r.map((c,u)=>s.jsxs(Mt,{children:[s.jsx(Ee,{className:"pl-4 align-top text-muted-foreground",children:new Date(c.at).toLocaleString()}),s.jsx(Ee,{className:"align-top",children:c.actor}),s.jsx(Ee,{className:"align-top",children:s.jsx("code",{children:c.action})}),s.jsx(Ee,{className:"align-top",children:c.target}),s.jsx(Ee,{className:"max-w-xl pr-4 align-top whitespace-normal",children:s.jsx("pre",{className:"detail max-h-40 overflow-auto rounded-md bg-muted p-2 font-mono text-xs whitespace-pre-wrap break-all",children:JSON.stringify(c.detail)})})]},c.id??u))})]}):s.jsx(bt,{children:"No admin activity yet."}):s.jsx(bt,{children:"Loading…"})})}):s.jsx("section",{children:s.jsx(da,{feature:"audit",children:"Every admin change is still recorded; viewing the audit log is part of the licensed console."})})}const U2={none:["Free core","idle"],active:["Active","on"],grace:["Expired — grace period","warn"],expired:["Expired","off"],invalid:["Not valid","off"]};function B2(){const n=ei(),r=qd(),i=St(),l=Zo(),c=n.license,[u,f]=m.useState(""),[h,v]=U2[c.state],g=x=>oo("/admin/api/license",{key:x}).then(()=>{f(""),r(),i(x?"License installed":"License removed")}).catch(b=>i(De(b),!0)),y=async()=>{await l({title:"Remove the license?",description:"Paid features turn off at once.",action:"Remove license",danger:!0})&&g("")};return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(Vn,{children:[s.jsx(Bl,{children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(yn,{kind:v,children:h}),c.customer&&s.jsxs("span",{className:"text-sm",children:[s.jsx("b",{children:c.customer})," · ",c.plan]}),s.jsx("span",{className:"flex-1"}),c.expires_at&&s.jsxs("span",{className:"text-sm text-muted-foreground",children:["expires ",sg(c.expires_at)]})]})}),s.jsxs(to,{className:"grid gap-4",children:[c.error&&s.jsx(Hi,{variant:"destructive",className:"banner bad",children:s.jsx(Gi,{children:c.error})}),c.state==="grace"&&s.jsx(Hi,{className:"banner border-warning/40 bg-warning-soft",children:s.jsxs(Gi,{className:"text-warning",children:["The license has expired. Paid features keep working until ",sg(c.grace_until),"; renew it to keep them."]})}),s.jsxs("div",{children:[s.jsx("h2",{className:"h2 mb-3 text-sm font-semibold",children:"Features"}),s.jsx("ul",{className:"feats grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:Object.keys(Wl).map(x=>{const b=c.features.includes(x);return s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx("span",{className:"flex size-5 items-center justify-center rounded-full "+(b?"bg-success-soft text-success":"bg-muted text-muted-foreground"),children:b?s.jsx(Ql,{className:"size-3"}):s.jsx(g1,{className:"size-3"})}),s.jsx("span",{className:b?"":"text-muted-foreground",children:Wl[x]}),s.jsx("span",{className:"sr-only",children:b?"on":"off"})]},x)})})]}),s.jsxs(Jt,{children:["Free without a license: reviews for one GitHub, GitLab and Bitbucket host each, the local executor, repository on/off, ",s.jsx("code",{children:"@bot"})," commands, review history for ",n.free_retention_days," days, the status dashboard and admin sign-in by email."]})]})]}),s.jsxs(Vn,{children:[s.jsxs(Bl,{children:[s.jsxs(Qd,{className:"flex items-center gap-2",children:[s.jsx(Ig,{className:"size-4"}),c.state==="none"?"Install a license":"Replace the license"]}),s.jsx(Yd,{children:"Keys are verified offline; the console never calls home."})]}),s.jsx(to,{className:"grid gap-4",children:c.managed?s.jsxs("p",{className:"text-sm text-muted-foreground",children:["This license comes from ",c.source==="env"?s.jsx("code",{children:"CODEREVIEW_CONSOLE_LICENSE"}):s.jsx("code",{children:"license.file"}),"; change it there and restart the console."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ce,{label:"License key",children:s.jsx(rs,{className:"key min-h-28 font-mono text-xs",placeholder:"DIV1.… or the -----BEGIN DIVMORA LICENSE KEY----- block",autoComplete:"off",spellCheck:!1,value:u,onChange:x=>f(x.target.value)})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{disabled:!u.trim(),onClick:()=>g(u.trim()),children:"Install"}),c.source==="database"&&s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:y,children:"Remove license"})]}),s.jsx(Jt,{children:"A pasted key is stored in the database and applies at once, except the executor, which is chosen when the console starts."})]})})]}),s.jsxs(Jt,{children:["Every use of a paid feature needs a license from Divmora, in development, CI and production alike. For a license or a trial, contact"," ",s.jsx("a",{className:"text-primary underline-offset-4 hover:underline",href:"mailto:licensing@divmora.com",children:"licensing@divmora.com"}),"."]})]})}const W2={"/license":"Open License","/hosts":"Open Code hosts","/webhooks":"Open Webhooks","/settings":"Open Settings","/repositories":"Open Repositories","/reviews":"Open Reviews"};function V2(){const n=St(),r=qd(),[i,l]=m.useState(null),c=m.useRef(""),u=()=>Ct("/admin/api/setup").then(v=>{l(v);const g=v.done+"/"+v.complete;c.current!==g&&(c.current!==""&&r(),c.current=g)}).catch(v=>n(De(v),!0));if(m.useEffect(()=>{u();const v=window.setInterval(u,15e3);return()=>window.clearInterval(v)},[]),!i)return s.jsx(bt,{children:"Loading…"});const f=i.steps.find(v=>!v.done&&!v.optional),h=i.total?Math.round(i.done/i.total*100):100;return s.jsxs("section",{className:"grid max-w-3xl gap-4",children:[s.jsxs(Vn,{children:[s.jsxs(Bl,{children:[s.jsx(Qd,{className:"h2",children:i.complete?"All set":"Get your first review"}),s.jsx(Yd,{children:i.complete?"Everything needed for reviews is in place. This page stays here for when you add more.":`${i.done} of ${i.total} steps done. Each step is checked against what is configured right now.`})]}),s.jsxs(to,{className:"grid gap-3",children:[s.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Setup progress",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:h+"%"}})}),s.jsx("div",{children:s.jsxs(ge,{variant:"outline",size:"sm",onClick:u,children:[s.jsx(Yg,{})," Check again"]})})]})]}),s.jsx("ol",{className:"grid gap-3",children:i.steps.map((v,g)=>{const y=(f==null?void 0:f.id)===v.id;return s.jsx("li",{children:s.jsx(Vn,{className:te("gap-3 py-4",y&&"border-primary ring-1 ring-primary/40"),children:s.jsxs(to,{className:"flex gap-3 px-4",children:[s.jsx("div",{className:te("mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",v.done?"border-success bg-success-soft text-success":y?"border-primary text-primary":"text-muted-foreground"),"aria-hidden":!0,children:v.done?s.jsx(Ql,{className:"size-4"}):y?g+1:s.jsx(Pg,{className:"size-3"})}),s.jsxs("div",{className:"grid min-w-0 flex-1 gap-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-medium",children:v.title}),v.optional&&s.jsx(jn,{variant:"outline",className:"font-normal text-muted-foreground",children:"optional"}),y&&s.jsx(jn,{children:"next"}),s.jsx("span",{className:"sr-only",children:v.done?"done":"not done"})]}),v.detail&&s.jsx("div",{className:te("text-sm",v.done?"text-success":/rejected|failed|expired|not valid|won't work/.test(v.detail)?"text-destructive":"text-muted-foreground"),children:v.detail}),(!v.done||y)&&s.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:v.help}),v.link&&!v.done&&s.jsx("div",{children:s.jsx(ge,{asChild:!0,size:"sm",variant:y?"default":"outline",children:s.jsxs(Ho,{to:v.link,children:[W2[v.link]||"Open"," ",s.jsx(l1,{})]})})})]})]})})},v.id)})}),s.jsx(Jt,{children:"Steps update on their own every 15 seconds while this page is open, so you can set up the webhook on the code host and watch it turn green."})]})}const sf=[{path:"setup",title:"Setup",icon:k1,el:s.jsx(V2,{})},{path:"repositories",title:"Repositories",icon:p1,el:s.jsx(y2,{})},{path:"reviews",title:"Reviews",icon:c1,el:s.jsx(S2,{})},{path:"learnings",title:"Learnings",icon:a1,el:s.jsx(N2,{}),paid:"learnings"},{path:"hosts",title:"Code hosts",icon:C1,el:s.jsx(M2,{})},{path:"rules",title:"Rules",icon:h1,el:s.jsx(I2,{}),paid:"rules"},{path:"webhooks",title:"Webhooks",icon:iv,el:s.jsx(z2,{})},{path:"settings",title:"Settings",icon:_1,el:s.jsx(F2,{})},{path:"audit",title:"Audit log",icon:j1,el:s.jsx($2,{}),paid:"audit"},{path:"license",title:"License",icon:Ig,el:s.jsx(B2,{})}];function H2({me:n}){const r=n.license;return r.state==="grace"?s.jsx(Hi,{role:"status",className:"banner border-warning/40 bg-warning-soft text-warning",children:s.jsx(Gi,{className:"text-warning",children:s.jsxs("p",{children:["The Divmora license expired on ",new Date(r.expires_at).toLocaleDateString(),". Paid features stop on ",new Date(r.grace_until).toLocaleDateString(),"."," ",s.jsx(Ho,{className:"font-semibold underline underline-offset-2",to:"/license",children:"Renew"})]})})}):r.state==="expired"||r.state==="invalid"?s.jsx(Hi,{role:"status",variant:"destructive",className:"banner bad",children:s.jsx(Gi,{children:s.jsxs("p",{children:[r.state==="expired"?"The Divmora license has expired":"The Divmora license is not valid",": paid features are off."," ",s.jsx(Ho,{className:"font-semibold underline underline-offset-2",to:"/license",children:"License"})]})})}):null}function G2(){const[n,r]=m.useState(()=>{try{return localStorage.getItem("crc-theme")||"system"}catch{return"system"}}),i=c=>{r(c);try{localStorage.setItem("crc-theme",c)}catch{}const u=window.__crcApplyTheme;u?u():document.documentElement.classList.toggle("dark",c==="dark")},l=n==="light"?N1:n==="dark"?x1:v1;return s.jsxs(W_,{children:[s.jsx(V_,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"icon",id:"theme","aria-label":"Theme",children:s.jsx(l,{})})}),s.jsxs(H_,{align:"end",children:[s.jsx(K_,{children:"Theme"}),s.jsx(Q_,{}),s.jsxs(G_,{value:n,onValueChange:i,children:[s.jsx(bu,{value:"system",children:"System"}),s.jsx(bu,{value:"light",children:"Light"}),s.jsx(bu,{value:"dark",children:"Dark"})]})]})]})}function zy(n){return sf.find(r=>n.startsWith("/"+r.path))}function K2({me:n}){const r=Dr(),{setOpenMobile:i}=os(),l=()=>Fn("/admin/logout").finally(()=>location.href="/admin/login");return s.jsxs(s2,{collapsible:"icon",children:[s.jsx(u2,{children:s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[s.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:s.jsx(E1,{className:"size-4"})}),s.jsxs("div",{className:"grid leading-tight group-data-[collapsible=icon]:hidden",children:[s.jsx("span",{className:"truncate text-sm font-semibold",children:"Code review"}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Divmora console"})]})]})}),s.jsx(f2,{children:s.jsx(p2,{children:s.jsx(h2,{children:s.jsx(tg,{className:"side","aria-label":"Sections",children:sf.map(c=>{var h;const u=c.paid&&!n.license.features.includes(c.paid),f=((h=zy(r.pathname))==null?void 0:h.path)===c.path;return s.jsxs(ng,{children:[s.jsx(rg,{asChild:!0,isActive:f,tooltip:c.title,children:s.jsxs(Hb,{to:"/"+c.path,className:f?"on":"",onClick:()=>i(!1),children:[s.jsx(c.icon,{}),s.jsx("span",{children:c.title})]})}),c.path==="setup"&&n.setup&&!n.setup.complete&&s.jsxs(og,{className:"text-[10px] font-normal text-muted-foreground",title:"Setup steps done",children:[n.setup.done,"/",n.setup.total]}),u&&s.jsx(og,{className:"paid text-[10px] font-normal text-muted-foreground",title:"Needs a license",children:"licensed"})]},c.path)})})})})}),s.jsxs(d2,{children:[s.jsxs("div",{className:"grid gap-1 px-2 pb-1 text-xs text-muted-foreground group-data-[collapsible=icon]:hidden",children:[s.jsxs("span",{className:"truncate",children:["Signed in as ",n.name||n.email]}),s.jsx("a",{className:"underline-offset-2 hover:text-foreground hover:underline",href:"/dashboard",children:"Status dashboard"}),n.version&&s.jsxs("span",{children:["Version ",n.version]})]}),s.jsx(tg,{children:s.jsx(ng,{children:s.jsxs(rg,{id:"logout",onClick:l,tooltip:"Sign out",children:[s.jsx(m1,{}),s.jsx("span",{children:"Sign out"})]})})})]}),s.jsx(a2,{})]})}function Q2({me:n}){const r=Dr(),i=zy(r.pathname),l=(i==null?void 0:i.title)??"Repositories";return m.useEffect(()=>{document.title=l+" · Code review admin"},[l]),s.jsxs("header",{className:"sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 border-b bg-background/80 px-4 backdrop-blur",children:[s.jsx(l2,{className:"-ml-1"}),s.jsx(Jr,{orientation:"vertical",className:"mr-1 data-[orientation=vertical]:h-4"}),s.jsx("h1",{id:"pageTitle",className:"text-base font-semibold",children:l}),(i==null?void 0:i.paid)&&!n.license.features.includes(i.paid)&&s.jsx(jn,{variant:"secondary",children:"licensed"}),s.jsx("span",{className:"flex-1"}),s.jsx(G2,{})]})}function Y2(){const[n,r]=m.useState(null),[i,l]=m.useState(""),c=()=>Ct("/admin/api/me").then(u=>{R1(u.csrf),r(u)}).catch(u=>l(String(u.message||u)));return m.useEffect(()=>{c()},[]),n?s.jsx(Ty.Provider,{value:n,children:s.jsx(Oy.Provider,{value:c,children:s.jsx(Ay,{delayDuration:300,children:s.jsx($_,{children:s.jsx(U_,{children:s.jsxs(i2,{children:[s.jsx(K2,{me:n}),s.jsxs(c2,{className:"min-w-0",children:[s.jsx(Q2,{me:n}),s.jsxs("div",{className:"mx-auto grid w-full max-w-7xl gap-4 p-4 md:p-6",children:[s.jsx(H2,{me:n}),s.jsxs(Mb,{children:[s.jsx(El,{path:"/",element:s.jsx(hm,{to:n.setup&&!n.setup.complete?"/setup":"/repositories",replace:!0})}),sf.map(u=>s.jsx(El,{path:"/"+u.path,element:u.el},u.path)),s.jsx(El,{path:"*",element:s.jsx(hm,{to:"/repositories",replace:!0})})]})]})]})]})})})})})}):s.jsx("div",{className:"grid min-h-svh place-items-center text-sm text-muted-foreground",children:i||"Loading…"})}var cg;const ju=(cg=document.querySelector('meta[name="csp-nonce"]'))==null?void 0:cg.content;ju&&!ju.startsWith("__")&&Yb(ju);H0.createRoot(document.getElementById("root")).render(s.jsx(m.StrictMode,{children:s.jsx(Bb,{basename:"/admin",children:s.jsx(Y2,{})})})); +`)},Vj=0,Fo=[];function Hj(n){var r=m.useRef([]),i=m.useRef([0,0]),l=m.useRef(),c=m.useState(Vj++)[0],u=m.useState(dx)[0],f=m.useRef(n);m.useEffect(function(){f.current=n},[n]),m.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var S=pj([n.lockRef.current],(n.shards||[]).map(zm),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var h=m.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!f.current.allowPinchZoom;var E=wl(S),D=i.current,T="deltaX"in S?S.deltaX:D[0]-E[0],P="deltaY"in S?S.deltaY:D[1]-E[1],R,N=S.target,I=Math.abs(T)>Math.abs(P)?"h":"v";if("touches"in S&&I==="h"&&N.type==="range")return!1;var L=window.getSelection(),Q=L&&L.anchorNode,ee=Q?Q===N||Q.contains(N):!1;if(ee)return!1;var J=Im(I,N);if(!J)return!0;if(J?R=I:(R=I==="v"?"h":"v",J=Im(I,N)),!J)return!1;if(!l.current&&"changedTouches"in S&&(T||P)&&(l.current=R),!R)return!0;var ne=l.current||R;return Uj(ne,C,S,ne==="h"?T:P)},[]),v=m.useCallback(function(S){var C=S;if(!(!Fo.length||Fo[Fo.length-1]!==u)){var E="deltaY"in C?Lm(C):wl(C),D=r.current.filter(function(R){return R.name===C.type&&(R.target===C.target||C.target===R.shadowParent)&&Bj(R.delta,E)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var T=(f.current.shards||[]).map(zm).filter(Boolean).filter(function(R){return R.contains(C.target)}),P=T.length>0?h(C,T[0]):!f.current.noIsolation;P&&C.cancelable&&C.preventDefault()}}},[]),g=m.useCallback(function(S,C,E,D){var T={name:S,delta:C,target:E,should:D,shadowParent:Gj(E)};r.current.push(T),setTimeout(function(){r.current=r.current.filter(function(P){return P!==T})},1)},[]),y=m.useCallback(function(S){i.current=wl(S),l.current=void 0},[]),x=m.useCallback(function(S){g(S.type,Lm(S),S.target,h(S,n.lockRef.current))},[]),b=m.useCallback(function(S){g(S.type,wl(S),S.target,h(S,n.lockRef.current))},[]);m.useEffect(function(){return Fo.push(u),n.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:b}),document.addEventListener("wheel",v,zo),document.addEventListener("touchmove",v,zo),document.addEventListener("touchstart",y,zo),function(){Fo=Fo.filter(function(S){return S!==u}),document.removeEventListener("wheel",v,zo),document.removeEventListener("touchmove",v,zo),document.removeEventListener("touchstart",y,zo)}},[]);var j=n.removeScrollBar,k=n.inert;return m.createElement(m.Fragment,null,k?m.createElement(u,{styles:Wj(c)}):null,j?m.createElement(Mj,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function Gj(n){for(var r=null;n!==null;)n instanceof ShadowRoot&&(r=n.host,n=n.host),n=n.parentNode;return r}const Kj=kj(ux,Hj);var wd=m.forwardRef(function(n,r){return m.createElement(Zl,vn({},n,{ref:r,sideCar:Kj}))});wd.classNames=Zl.classNames;var Qj=function(n){if(typeof document>"u")return null;var r=Array.isArray(n)?n[0]:n;return r.ownerDocument.body},$o=new WeakMap,bl=new WeakMap,kl={},mu=0,mx=function(n){return n&&(n.host||mx(n.parentNode))},Yj=function(n,r){return r.map(function(i){if(n.contains(i))return i;var l=mx(i);return l&&n.contains(l)?l:(console.error("aria-hidden",i,"in not contained inside",n,". Doing nothing"),null)}).filter(function(i){return!!i})},qj=function(n,r,i,l){var c=Yj(r,Array.isArray(n)?n:[n]);kl[i]||(kl[i]=new WeakMap);var u=kl[i],f=[],h=new Set,v=new Set(c),g=function(x){!x||h.has(x)||(h.add(x),g(x.parentNode))};c.forEach(g);var y=function(x){!x||v.has(x)||Array.prototype.forEach.call(x.children,function(b){if(h.has(b))y(b);else try{var j=b.getAttribute(l),k=j!==null&&j!=="false",S=($o.get(b)||0)+1,C=(u.get(b)||0)+1;$o.set(b,S),u.set(b,C),f.push(b),S===1&&k&&bl.set(b,!0),C===1&&b.setAttribute(i,"true"),k||b.setAttribute(l,"true")}catch(E){console.error("aria-hidden: cannot operate on ",b,E)}})};return y(r),h.clear(),mu++,function(){f.forEach(function(x){var b=$o.get(x)-1,j=u.get(x)-1;$o.set(x,b),u.set(x,j),b||(bl.has(x)||x.removeAttribute(l),bl.delete(x)),j||x.removeAttribute(i)}),mu--,mu||($o=new WeakMap,$o=new WeakMap,bl=new WeakMap,kl={})}},gx=function(n,r,i){i===void 0&&(i="data-aria-hidden");var l=Array.from(Array.isArray(n)?n:[n]),c=Qj(n);return c?(l.push.apply(l,Array.from(c.querySelectorAll("[aria-live], script"))),qj(l,c,i,"aria-hidden")):function(){return null}},Xj=Object.defineProperty,At=(n,r)=>Xj(n,"name",{value:r,configurable:!0}),bd="Dialog",[vx,xx]=an(bd),[Jj,cn]=vx(bd),kd=At(n=>{const{__scopeDialog:r,children:i,open:l,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,h=m.useRef(null),v=m.useRef(null),{nodes:g,registry:y}=md(),[x,b]=Jo({prop:l,defaultProp:c??!1,onChange:u,caller:bd}),[j,k]=m.useState(0),[S,C]=m.useState(0);return s.jsx(Jj,{scope:r,triggerRef:h,contentRef:v,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),titlePresent:j>0,descriptionPresent:S>0,setTitleCount:k,setDescriptionCount:C,open:x,onOpenChange:b,onOpenToggle:m.useCallback(()=>b(E=>!E),[b]),modal:f,branchNodes:g,branchRegistry:y,children:i})},"Dialog"),Zj="DialogTrigger",eC=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn(Zj,l),f=Ie(i,u.triggerRef);return s.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":ea(u.open),...c,ref:f,onClick:je(r.onClick,u.onOpenToggle)})},"DialogTrigger")),yx="DialogPortal",[tC,wx]=vx(yx,{forceMount:void 0}),jd=At(n=>{const{__scopeDialog:r,forceMount:i,children:l,container:c}=n,u=cn(yx,r);return s.jsx(tC,{scope:r,forceMount:i,children:m.Children.map(l,f=>s.jsx(Gn,{present:i||u.open,children:s.jsx(xd,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),Uu="DialogOverlay",Cd=m.forwardRef(At(function(r,i){const l=wx(Uu,r.__scopeDialog),{forceMount:c=l.forceMount,...u}=r,f=cn(Uu,r.__scopeDialog);return f.modal?s.jsx(Gn,{present:c||f.open,children:s.jsx(rC,{...u,ref:i})}):null},"DialogOverlay")),nC=$n("DialogOverlay.RemoveScroll"),rC=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn(Uu,l),f=Xv(),h=Ie(i,f);return s.jsx(wd,{as:nC,allowPinchZoom:!0,shards:m.useMemo(()=>[u.contentRef,...u.branchNodes.map(v=>({current:v}))],[u.contentRef,u.branchNodes]),children:s.jsx(ze.div,{"data-state":ea(u.open),...c,ref:h,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),Ki="DialogContent",Sd=m.forwardRef(At(function(r,i){const l=wx(Ki,r.__scopeDialog),{forceMount:c=l.forceMount,...u}=r,f=cn(Ki,r.__scopeDialog);return s.jsx(Gn,{present:c||f.open,children:f.modal?s.jsx(oC,{...u,ref:i}):s.jsx(iC,{...u,ref:i})})},"DialogContent")),oC=m.forwardRef(At(function(r,i){const l=cn(Ki,r.__scopeDialog),c=m.useRef(null),u=Ie(i,l.contentRef,c);return m.useEffect(()=>{const f=c.current;if(f)return gx(f)},[]),s.jsx(bx,{...r,ref:u,trapFocus:l.open,disableOutsidePointerEvents:l.open,onCloseAutoFocus:je(r.onCloseAutoFocus,f=>{var h;f.preventDefault(),(h=l.triggerRef.current)==null||h.focus()}),onPointerDownOutside:je(r.onPointerDownOutside,f=>{const h=f.detail.originalEvent,v=h.button===0&&h.ctrlKey===!0;(h.button===2||v)&&f.preventDefault()}),onFocusOutside:je(r.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),iC=m.forwardRef(At(function(r,i){const l=cn(Ki,r.__scopeDialog),c=m.useRef(!1),u=m.useRef(!1);return s.jsx(bx,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var h,v;(h=r.onCloseAutoFocus)==null||h.call(r,f),f.defaultPrevented||(c.current||(v=l.triggerRef.current)==null||v.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var g,y;(g=r.onInteractOutside)==null||g.call(r,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const h=f.target;((y=l.triggerRef.current)==null?void 0:y.contains(h))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),bx=m.forwardRef(At(function(r,i){const{__scopeDialog:l,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,"aria-describedby":h,children:v,...g}=r,y=cn(Ki,l);return Jl(),s.jsx(hd,{registry:y.branchRegistry,children:s.jsx(ex,{asChild:!0,loop:!0,trapped:c,branches:y.branchNodes,onMountAutoFocus:u,onUnmountAutoFocus:f,children:s.jsx(fd,{role:"dialog",id:y.contentId,"aria-labelledby":y.titlePresent?y.titleId:void 0,"aria-describedby":y.descriptionPresent?kx(h,y.descriptionId):h,"data-state":ea(y.open),...g,ref:i,deferPointerDownOutside:!0,onDismiss:()=>y.onOpenChange(!1),children:v})})})},"DialogContentImpl")),Ed=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn("DialogTitle",l),{setTitleCount:f}=u;return wt(()=>(f(h=>h+1),()=>f(h=>h-1)),[f]),s.jsx(ze.h2,{id:u.titleId,...c,ref:i})},"DialogTitle")),_d=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn("DialogDescription",l),{setDescriptionCount:f}=u;return wt(()=>(f(h=>h+1),()=>f(h=>h-1)),[f]),s.jsx(ze.p,{id:u.descriptionId,...c,ref:i})},"DialogDescription")),sC="DialogClose",es=m.forwardRef(At(function(r,i){const{__scopeDialog:l,...c}=r,u=cn(sC,l);return s.jsx(ze.button,{type:"button",...c,ref:i,onClick:je(r.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function kx(...n){const r=new Set;for(const i of n)if(typeof i=="string")for(const l of String(i).trim().split(/\s+/))l&&r.add(l);return r.size>0?Array.from(r).join(" "):void 0}At(kx,"concatAriaDescribedby");function ea(n){return n?"open":"closed"}At(ea,"getState");var lC=Object.defineProperty,Kn=(n,r)=>lC(n,"name",{value:r,configurable:!0}),aC="AlertDialog",[cC,X2]=an(aC,[xx]),Qn=xx(),uC=Kn(n=>{const{__scopeAlertDialog:r,...i}=n,l=Qn(r);return s.jsx(kd,{...l,...i,modal:!0})},"AlertDialog");m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(eC,{...u,...c,ref:i})},"AlertDialogTrigger"));var dC=Kn(n=>{const{__scopeAlertDialog:r,...i}=n,l=Qn(r);return s.jsx(jd,{...l,...i})},"AlertDialogPortal"),fC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(Cd,{...u,...c,ref:i})},"AlertDialogOverlay")),pC="AlertDialogContent",[hC,mC]=cC(pC),gC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,children:c,...u}=r,f=Qn(l),h=m.useRef(null),v=Ie(i,h),g=m.useRef(null);return s.jsx(hC,{scope:l,cancelRef:g,children:s.jsx(Sd,{role:"alertdialog",...f,...u,ref:v,onOpenAutoFocus:je(u.onOpenAutoFocus,y=>{var x;y.preventDefault(),(x=g.current)==null||x.focus({preventScroll:!0})}),onPointerDownOutside:y=>y.preventDefault(),onInteractOutside:y=>y.preventDefault(),children:c})})},"AlertDialogContent")),vC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(Ed,{...u,...c,ref:i})},"AlertDialogTitle")),xC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(_d,{...u,...c,ref:i})},"AlertDialogDescription")),yC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,u=Qn(l);return s.jsx(es,{...u,...c,ref:i})},"AlertDialogAction")),wC="AlertDialogCancel",bC=m.forwardRef(Kn(function(r,i){const{__scopeAlertDialog:l,...c}=r,{cancelRef:u}=mC(wC,l),f=Qn(l),h=Ie(i,u);return s.jsx(es,{...f,...c,ref:h})},"AlertDialogCancel")),kC=Object.defineProperty,jC=(n,r)=>kC(n,"name",{value:r,configurable:!0});function Nd(n){const[r,i]=m.useState(void 0);return wt(()=>{if(n){i({width:n.offsetWidth,height:n.offsetHeight});let l=0;const c=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];window.cancelAnimationFrame(l),l=window.requestAnimationFrame(()=>{let h,v;if("borderBoxSize"in f){const g=f.borderBoxSize,y=Array.isArray(g)?g[0]:g;h=y.inlineSize,v=y.blockSize}else h=n.offsetWidth,v=n.offsetHeight;i({width:h,height:v})})});return c.observe(n,{box:"border-box"}),()=>{window.cancelAnimationFrame(l),c.unobserve(n)}}else i(void 0)},[n]),r}jC(Nd,"useSize");var CC=Object.defineProperty,Bn=(n,r)=>CC(n,"name",{value:r,configurable:!0}),Rd="Checkbox",[SC,J2]=an(Rd),[EC,Pd]=SC(Rd);function jx(n){const{__scopeCheckbox:r,checked:i,children:l,defaultChecked:c,disabled:u,form:f,name:h,onCheckedChange:v,required:g,value:y="on",internal_do_not_use_render:x}=n,[b,j]=Jo({prop:i,defaultProp:c??!1,onChange:v,caller:Rd}),[k,S]=m.useState(null),[C,E]=m.useState(null),[D,T]=m.useState(null),P=k?!!f||!!k.closest("form"):!0,R={checked:b,disabled:u,setChecked:j,control:k,setControl:S,name:h,form:f,value:y,userClick:D,onUserClick:T,required:g,defaultChecked:qt(c)?!1:c,isFormControl:P,bubbleInput:C,setBubbleInput:E};return s.jsx(EC,{scope:r,...R,children:Cx(x)?x(R):l})}Bn(jx,"CheckboxProvider");var _C="CheckboxTrigger",NC=m.forwardRef(Bn(function({__scopeCheckbox:r,onKeyDown:i,onClick:l,...c},u){const{control:f,value:h,disabled:v,checked:g,required:y,setControl:x,setChecked:b,onUserClick:j,isFormControl:k,bubbleInput:S}=Pd(_C,r),C=Ie(u,x),E=m.useRef(g);return m.useEffect(()=>{const D=f==null?void 0:f.form;if(D){const T=Bn(()=>b(E.current),"reset");return D.addEventListener("reset",T),()=>D.removeEventListener("reset",T)}},[f,b]),s.jsx(ze.button,{type:"button",role:"checkbox","aria-checked":qt(g)?"mixed":g,"aria-required":y,"data-state":Dd(g),"data-disabled":v?"":void 0,disabled:v,value:h,...c,ref:C,onKeyDown:je(i,D=>{D.key==="Enter"&&D.preventDefault()}),onClick:je(l,D=>{const T=D.isPropagationStopped();j({requestedChecked:qt(g)?!0:!g,hasConsumerStoppedPropagation:T}),b(P=>qt(P)?!0:!P),S&&k&&(T||D.stopPropagation())})})},"CheckboxTrigger")),RC=m.forwardRef(Bn(function(r,i){const{__scopeCheckbox:l,name:c,checked:u,defaultChecked:f,required:h,disabled:v,value:g,onCheckedChange:y,form:x,...b}=r;return s.jsx(jx,{__scopeCheckbox:l,checked:u,defaultChecked:f,disabled:v,required:h,onCheckedChange:y,name:c,form:x,value:g,internal_do_not_use_render:({isFormControl:j})=>s.jsxs(s.Fragment,{children:[s.jsx(NC,{...b,ref:i,__scopeCheckbox:l}),j&&s.jsx(OC,{__scopeCheckbox:l})]})})},"Checkbox")),PC="CheckboxIndicator",DC=m.forwardRef(Bn(function(r,i){const{__scopeCheckbox:l,forceMount:c,...u}=r,f=Pd(PC,l);return s.jsx(Gn,{present:c||qt(f.checked)||f.checked===!0,children:s.jsx(ze.span,{"data-state":Dd(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),TC="CheckboxBubbleInput",OC=m.forwardRef(Bn(function({__scopeCheckbox:r,onClick:i,...l},c){const{control:u,userClick:f,checked:h,defaultChecked:v,required:g,disabled:y,name:x,value:b,form:j,bubbleInput:k,setBubbleInput:S}=Pd(TC,r),C=Ie(c,S),E=Nd(u),D=m.useRef(!1),T=m.useRef(h),P=m.useRef(f),R=m.useRef(null);m.useEffect(()=>{const I=k;if(!I)return;const L=window.HTMLInputElement.prototype,ee=Object.getOwnPropertyDescriptor(L,"checked").set;if(!ee)return;const J=T.current!==h;T.current=h;const ne=f!==null&&f!==P.current;if(P.current=f,ne)R.current=J?null:f,J&&(I.indeterminate=qt(h),ee.call(I,qt(h)?!1:h)),I.dispatchEvent(new Event("click",{bubbles:!f.hasConsumerStoppedPropagation}));else if(J){const de=R.current;R.current=null;const re=(de==null?void 0:de.requestedChecked)===h;D.current=!0,I.indeterminate=qt(h),ee.call(I,qt(h)?!1:h),I.dispatchEvent(new Event("click",{bubbles:!(re&&de.hasConsumerStoppedPropagation)})),D.current=!1}},[k,h,f]);const N=m.useRef(qt(h)?!1:h);return s.jsx(ze.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??N.current,required:g,disabled:y,name:x,value:b,form:j,...l,tabIndex:-1,ref:C,onClick:je(i,I=>{D.current&&I.stopPropagation()}),style:{...l.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function Cx(n){return typeof n=="function"}Bn(Cx,"isFunction");function qt(n){return n==="indeterminate"}Bn(qt,"isIndeterminate");function Dd(n){return qt(n)?"indeterminate":n?"checked":"unchecked"}Bn(Dd,"getState");const MC=["top","right","bottom","left"],_r=Math.min,In=Math.max,Ll=Math.round,jl=Math.floor,Ln=n=>({x:n,y:n}),AC={left:"right",right:"left",bottom:"top",top:"bottom"};function Sx(n,r,i){return In(n,_r(r,i))}function Wn(n,r){return typeof n=="function"?n(r):n}function Nr(n){return n.split("-")[0]}function Zo(n){return n.split("-")[1]}function Td(n){return n==="x"?"y":"x"}function Od(n){return n==="y"?"height":"width"}function xn(n){const r=n[0];return r==="t"||r==="b"?"y":"x"}function Md(n){return Td(xn(n))}function IC(n,r,i){i===void 0&&(i=!1);const l=Zo(n),c=Md(n),u=Od(c);let f=c==="x"?l===(i?"end":"start")?"right":"left":l==="start"?"bottom":"top";return r.reference[u]>r.floating[u]&&(f=zl(f)),[f,zl(f)]}function LC(n){const r=zl(n);return[Bu(n),r,Bu(r)]}function Bu(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const Fm=["left","right"],$m=["right","left"],zC=["top","bottom"],FC=["bottom","top"];function $C(n,r,i){switch(n){case"top":case"bottom":return i?r?$m:Fm:r?Fm:$m;case"left":case"right":return r?zC:FC;default:return[]}}function UC(n,r,i,l){const c=Zo(n);let u=$C(Nr(n),i==="start",l);return c&&(u=u.map(f=>f+"-"+c),r&&(u=u.concat(u.map(Bu)))),u}function zl(n){const r=Nr(n);return AC[r]+n.slice(r.length)}function BC(n){var r,i,l,c;return{top:(r=n.top)!=null?r:0,right:(i=n.right)!=null?i:0,bottom:(l=n.bottom)!=null?l:0,left:(c=n.left)!=null?c:0}}function Ex(n){return typeof n!="number"?BC(n):{top:n,right:n,bottom:n,left:n}}function Fl(n){const{x:r,y:i,width:l,height:c}=n;return{width:l,height:c,top:i,left:r,right:r+l,bottom:i+c,x:r,y:i}}function Um(n,r,i){let{reference:l,floating:c}=n;const u=xn(r),f=Md(r),h=Od(f),v=Nr(r),g=u==="y",y=l.x+l.width/2-c.width/2,x=l.y+l.height/2-c.height/2,b=l[h]/2-c[h]/2;let j;switch(v){case"top":j={x:y,y:l.y-c.height};break;case"bottom":j={x:y,y:l.y+l.height};break;case"right":j={x:l.x+l.width,y:x};break;case"left":j={x:l.x-c.width,y:x};break;default:j={x:l.x,y:l.y}}const k=Zo(r);return k&&(j[f]+=b*(k==="end"?1:-1)*(i&&g?-1:1)),j}async function WC(n,r){var i;r===void 0&&(r={});const{x:l,y:c,platform:u,rects:f,elements:h,strategy:v}=n,{boundary:g="clippingAncestors",rootBoundary:y="viewport",elementContext:x="floating",altBoundary:b=!1,padding:j=0}=Wn(r,n),k=Ex(j),C=h[b?x==="floating"?"reference":"floating":x],E=Fl(await u.getClippingRect({element:(i=await(u.isElement==null?void 0:u.isElement(C)))==null||i?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(h.floating)),boundary:g,rootBoundary:y,strategy:v})),D=x==="floating"?{x:l,y:c,width:f.floating.width,height:f.floating.height}:f.reference,T=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h.floating)),P=await(u.isElement==null?void 0:u.isElement(T))&&await(u.getScale==null?void 0:u.getScale(T))||{x:1,y:1},R=Fl(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:D,offsetParent:T,strategy:v}):D);return{top:(E.top-R.top+k.top)/P.y,bottom:(R.bottom-E.bottom+k.bottom)/P.y,left:(E.left-R.left+k.left)/P.x,right:(R.right-E.right+k.right)/P.x}}const VC=50,HC=async(n,r,i)=>{const{placement:l="bottom",strategy:c="absolute",middleware:u=[],platform:f}=i,h=f.detectOverflow?f:{...f,detectOverflow:WC},v=await(f.isRTL==null?void 0:f.isRTL(r));let g=await f.getElementRects({reference:n,floating:r,strategy:c}),{x:y,y:x}=Um(g,l,v),b=l,j=0;const k={};for(let S=0;S({name:"arrow",options:n,async fn(r){const{x:i,y:l,placement:c,rects:u,platform:f,elements:h,middlewareData:v}=r,{element:g,padding:y=0}=Wn(n,r)||{};if(g==null)return{};const x=Ex(y),b={x:i,y:l},j=Md(c),k=Od(j),S=await f.getDimensions(g),C=j==="y",E=C?"top":"left",D=C?"bottom":"right",T=C?"clientHeight":"clientWidth",P=u.reference[k]+u.reference[j]-b[j]-u.floating[k],R=b[j]-u.reference[j],N=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let I=N?N[T]:0;(!I||!await(f.isElement==null?void 0:f.isElement(N)))&&(I=h.floating[T]||u.floating[k]);const L=P/2-R/2,Q=I/2-S[k]/2-1,ee=_r(x[E],Q),J=_r(x[D],Q),ne=I-S[k]-J,de=I/2-S[k]/2+L,re=Sx(ee,de,ne),ie=!v.arrow&&Zo(c)!=null&&de!==re&&u.reference[k]/2-(dere<=0)){var J,ne;const re=(((J=u.flip)==null?void 0:J.index)||0)+1,ie=I[re];if(ie&&(!(x==="alignment"?D!==xn(ie):!1)||ee.every(W=>xn(W.placement)===D?W.overflows[0]>0:!0)))return{data:{index:re,overflows:ee},reset:{placement:ie}};let B=(ne=ee.filter(Z=>Z.overflows[0]<=0).sort((Z,W)=>Z.overflows[1]-W.overflows[1])[0])==null?void 0:ne.placement;if(!B)switch(j){case"bestFit":{var de;const Z=(de=ee.filter(W=>{if(N){const q=xn(W.placement);return q===D||q==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(q=>q>0).reduce((q,F)=>q+F,0)]).sort((W,q)=>W[1]-q[1])[0])==null?void 0:de[0];Z&&(B=Z);break}case"initialPlacement":B=h;break}if(c!==B)return{reset:{placement:B}}}return{}}}};function Bm(n,r){return{top:n.top-r.height,right:n.right-r.width,bottom:n.bottom-r.height,left:n.left-r.width}}function Wm(n){return MC.some(r=>n[r]>=0)}const QC=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(r){const{rects:i,platform:l}=r,{strategy:c="referenceHidden",...u}=Wn(n,r);switch(c){case"referenceHidden":{const f=await l.detectOverflow(r,{...u,elementContext:"reference"}),h=Bm(f,i.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:Wm(h)}}}case"escaped":{const f=await l.detectOverflow(r,{...u,altBoundary:!0}),h=Bm(f,i.floating);return{data:{escapedOffsets:h,escaped:Wm(h)}}}default:return{}}}}},_x=new Set(["left","top"]);async function YC(n,r){const{placement:i,platform:l,elements:c}=n,u=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Nr(i),h=Zo(i),v=xn(i)==="y",g=_x.has(f)?-1:1,y=u&&v?-1:1,x=Wn(r,n);let{mainAxis:b,crossAxis:j,alignmentAxis:k}=typeof x=="number"?{mainAxis:x,crossAxis:0,alignmentAxis:null}:{mainAxis:x.mainAxis||0,crossAxis:x.crossAxis||0,alignmentAxis:x.alignmentAxis};return h&&typeof k=="number"&&(j=h==="end"?k*-1:k),v?{x:j*y,y:b*g}:{x:b*g,y:j*y}}const qC=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(r){var i,l;const{x:c,y:u,placement:f,middlewareData:h}=r,v=await YC(r,n);return f===((i=h.offset)==null?void 0:i.placement)&&(l=h.arrow)!=null&&l.alignmentOffset?{}:{x:c+v.x,y:u+v.y,data:{...v,placement:f}}}}},XC=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(r){const{x:i,y:l,placement:c,platform:u}=r,{mainAxis:f=!0,crossAxis:h=!1,limiter:v={fn:D=>{let{x:T,y:P}=D;return{x:T,y:P}}},...g}=Wn(n,r),y={x:i,y:l},x=await u.detectOverflow(r,g),b=xn(c),j=Td(b);let k=y[j],S=y[b];const C=(D,T)=>Sx(T+x[D==="y"?"top":"left"],T,T-x[D==="y"?"bottom":"right"]);f&&(k=C(j,k)),h&&(S=C(b,S));const E=v.fn({...r,[j]:k,[b]:S});return{...E,data:{x:E.x-i,y:E.y-l,enabled:{[j]:f,[b]:h}}}}}},JC=function(n){return n===void 0&&(n={}),{options:n,fn(r){var i,l;const{x:c,y:u,placement:f,rects:h,middlewareData:v}=r,{offset:g=0,mainAxis:y=!0,crossAxis:x=!0}=Wn(n,r),b={x:c,y:u},j=xn(f),k=Td(j);let S=b[k],C=b[j];const E=Wn(g,r),D=typeof E=="number"?{mainAxis:E,crossAxis:0}:{mainAxis:(i=E.mainAxis)!=null?i:0,crossAxis:(l=E.crossAxis)!=null?l:0};if(y){const R=k==="y"?"height":"width",N=h.reference[k]-h.floating[R]+D.mainAxis,I=h.reference[k]+h.reference[R]-D.mainAxis;SI&&(S=I)}if(x){var T,P;const R=k==="y"?"width":"height",N=_x.has(Nr(f)),I=h.reference[j]-h.floating[R]+(N&&((T=v.offset)==null?void 0:T[j])||0)+(N?0:D.crossAxis),L=h.reference[j]+h.reference[R]+(N?0:((P=v.offset)==null?void 0:P[j])||0)-(N?D.crossAxis:0);CL&&(C=L)}return{[k]:S,[j]:C}}}},ZC=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(r){const{placement:i,rects:l,platform:c,elements:u}=r,{apply:f=()=>{},...h}=Wn(n,r),v=await c.detectOverflow(r,h),g=Nr(i),y=Zo(i),x=xn(i)==="y",{width:b,height:j}=l.floating;let k,S;g==="top"||g==="bottom"?(k=g,S=y===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(S=g,k=y==="end"?"top":"bottom");const C=j-v.top-v.bottom,E=b-v.left-v.right,D=_r(j-v[k],C),T=_r(b-v[S],E),P=r.middlewareData.shift,R=!P;let N=D,I=T;P!=null&&P.enabled.x&&(I=E),P!=null&&P.enabled.y&&(N=C),R&&!y&&(x?I=b-2*In(v.left,v.right):N=j-2*In(v.top,v.bottom)),await f({...r,availableWidth:I,availableHeight:N});const L=await c.getDimensions(u.floating);return b!==L.width||j!==L.height?{reset:{rects:!0}}:{}}}};function ta(){return typeof window<"u"}function ei(n){return Nx(n)?(n.nodeName||"").toLowerCase():"#document"}function Ot(n){var r;return(n==null||(r=n.ownerDocument)==null?void 0:r.defaultView)||window}function Yn(n){var r;return(r=(Nx(n)?n.ownerDocument:n.document)||window.document)==null?void 0:r.documentElement}function Nx(n){return ta()?n instanceof Node||n instanceof Ot(n).Node:!1}function bn(n){return ta()?n instanceof Element||n instanceof Ot(n).Element:!1}function Or(n){return ta()?n instanceof HTMLElement||n instanceof Ot(n).HTMLElement:!1}function Vm(n){return!ta()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Ot(n).ShadowRoot}function na(n){const{overflow:r,overflowX:i,overflowY:l,display:c}=kn(n);return/auto|scroll|overlay|hidden|clip/.test(r+l+i)&&c!=="inline"&&c!=="contents"}function eS(n){return/^(table|td|th)$/.test(ei(n))}function ra(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const tS=/transform|translate|scale|rotate|perspective|filter/,nS=/paint|layout|strict|content/,qr=n=>!!n&&n!=="none";let gu;function Ad(n){const r=bn(n)?kn(n):n;return qr(r.transform)||qr(r.translate)||qr(r.scale)||qr(r.rotate)||qr(r.perspective)||!Id()&&(qr(r.backdropFilter)||qr(r.filter))||tS.test(r.willChange||"")||nS.test(r.contain||"")}function rS(n){let r=eo(n);for(;Or(r)&&!Qi(r);){if(Ad(r))return r;if(ra(r))return null;r=eo(r)}return null}function Id(){return gu==null&&(gu=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gu}function Qi(n){return/^(html|body|#document)$/.test(ei(n))}function kn(n){return Ot(n).getComputedStyle(n)}function oa(n){return bn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function eo(n){if(ei(n)==="html")return n;const r=n.assignedSlot||n.parentNode||Vm(n)&&n.host||Yn(n);return Vm(r)?r.host:r}function Rx(n){const r=eo(n);return Qi(r)?(n.ownerDocument||n).body:Or(r)&&na(r)?r:Rx(r)}function Yi(n,r,i){var l;r===void 0&&(r=[]),i===void 0&&(i=!0);const c=Rx(n),u=c===((l=n.ownerDocument)==null?void 0:l.body),f=Ot(c);if(u){const h=Wu(f);return r.concat(f,f.visualViewport||[],na(c)?c:[],h&&i?Yi(h):[])}else return r.concat(c,Yi(c,[],i))}function Wu(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Px(n){const r=kn(n);let i=parseFloat(r.width)||0,l=parseFloat(r.height)||0;const c=Or(n),u=c?n.offsetWidth:i,f=c?n.offsetHeight:l,h=Ll(i)!==u||Ll(l)!==f;return h&&(i=u,l=f),{width:i,height:l,$:h}}function Ld(n){return bn(n)?n:n.contextElement}function Go(n){const r=Ld(n);if(!Or(r))return Ln(1);const i=r.getBoundingClientRect(),{width:l,height:c,$:u}=Px(r);let f=(u?Ll(i.width):i.width)/l,h=(u?Ll(i.height):i.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const oS=Ln(0);function Dx(n){const r=Ot(n);return!Id()||!r.visualViewport?oS:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function iS(n,r,i){return r===void 0&&(r=!1),!!i&&r&&i===Ot(n)}function to(n,r,i,l){r===void 0&&(r=!1),i===void 0&&(i=!1);const c=n.getBoundingClientRect(),u=Ld(n);let f=Ln(1);r&&(l?bn(l)&&(f=Go(l)):f=Go(n));const h=iS(u,i,l)?Dx(u):Ln(0);let v=(c.left+h.x)/f.x,g=(c.top+h.y)/f.y,y=c.width/f.x,x=c.height/f.y;if(u&&l){const b=Ot(u),j=bn(l)?Ot(l):l;let k=b,S=Wu(k);for(;S&&j!==k;){const C=Go(S),E=S.getBoundingClientRect(),D=kn(S),T=E.left+(S.clientLeft+parseFloat(D.paddingLeft))*C.x,P=E.top+(S.clientTop+parseFloat(D.paddingTop))*C.y;v*=C.x,g*=C.y,y*=C.x,x*=C.y,v+=T,g+=P,k=Ot(S),S=Wu(k)}}return Fl({width:y,height:x,x:v,y:g})}function ia(n,r){const i=oa(n).scrollLeft;return r?r.left+i:to(Yn(n)).left+i}function Tx(n,r){const i=n.getBoundingClientRect(),l=i.left+r.scrollLeft-ia(n,i),c=i.top+r.scrollTop;return{x:l,y:c}}function sS(n){let{elements:r,rect:i,offsetParent:l,strategy:c}=n;const u=c==="fixed",f=Yn(l),h=r?ra(r.floating):!1;if(l===f||h&&u)return i;let v={scrollLeft:0,scrollTop:0},g=Ln(1);const y=Ln(0),x=Or(l);if((x||!u)&&((ei(l)!=="body"||na(f))&&(v=oa(l)),x)){const j=to(l);g=Go(l),y.x=j.x+l.clientLeft,y.y=j.y+l.clientTop}const b=f&&!x&&!u?Tx(f,v):Ln(0);return{width:i.width*g.x,height:i.height*g.y,x:i.x*g.x-v.scrollLeft*g.x+y.x+b.x,y:i.y*g.y-v.scrollTop*g.y+y.y+b.y}}function lS(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function aS(n){const r=oa(n),i=n.ownerDocument.body,l=In(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),c=In(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let u=-r.scrollLeft+ia(n);const f=-r.scrollTop;return kn(i).direction==="rtl"&&(u+=In(n.clientWidth,i.clientWidth)-l),{width:l,height:c,x:u,y:f}}const cS=25;function uS(n,r,i){i===void 0&&(i="viewport");const l=i==="layoutViewport",c=Ot(n),u=Yn(n),f=c.visualViewport;let h=u.clientWidth,v=u.clientHeight,g=0,y=0;if(f){const b=!Id()||r==="fixed";l?b||(g=-f.offsetLeft,y=-f.offsetTop):(h=f.width,v=f.height,b&&(g=f.offsetLeft,y=f.offsetTop))}if(ia(u)<=0){const b=u.ownerDocument,j=b.body,k=getComputedStyle(j),S=b.compatMode==="CSS1Compat"&&parseFloat(k.marginLeft)+parseFloat(k.marginRight)||0,C=Math.abs(u.clientWidth-j.clientWidth-S),E=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;E<=cS&&(h-=E)}return{width:h,height:v,x:g,y}}function dS(n,r){const i=to(n,!0,r==="fixed"),l=i.top+n.clientTop,c=i.left+n.clientLeft,u=Go(n),f=n.clientWidth*u.x,h=n.clientHeight*u.y,v=c*u.x,g=l*u.y;return{width:f,height:h,x:v,y:g}}function Hm(n,r,i){let l;if(r==="viewport"||r==="layoutViewport")l=uS(n,i,r);else if(r==="document")l=aS(Yn(n));else if(bn(r))l=dS(r,i);else{const c=Dx(n);l={x:r.x-c.x,y:r.y-c.y,width:r.width,height:r.height}}return Fl(l)}function fS(n,r){const i=r.get(n);if(i)return i;let l=Yi(n,[],!1).filter(h=>bn(h)&&ei(h)!=="body"),c=null;const u=kn(n).position==="fixed";let f=u?eo(n):n;for(;bn(f)&&!Qi(f);){const h=kn(f),v=Ad(f),g=c?c.position:u?"fixed":"";!v&&(g==="fixed"||g==="absolute"&&h.position==="static")?l=l.filter(x=>x!==f):c=h,f=eo(f)}return r.set(n,l),l}function pS(n){let{element:r,boundary:i,rootBoundary:l,strategy:c}=n;const f=[...i==="clippingAncestors"?ra(r)?[]:fS(r,this._c):[].concat(i),l],h=Hm(r,f[0],c);let v=h.top,g=h.right,y=h.bottom,x=h.left;for(let b=1;b{h(!1,1e-7)},1e3)}I=!1}try{l=new IntersectionObserver(L,{...N,root:u.ownerDocument})}catch{l=new IntersectionObserver(L,N)}l.observe(n)}const v=Ot(n),g=()=>h(i);return v.addEventListener("resize",g),h(!0),()=>{v.removeEventListener("resize",g),f()}}function wS(n,r,i,l){l===void 0&&(l={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:v=!1}=l,g=Ld(n),y=c||u?[...g?Yi(g):[],...r?Yi(r):[]]:[];y.forEach(E=>{c&&E.addEventListener("scroll",i),u&&E.addEventListener("resize",i)});const x=g&&h?yS(g,i,u):null;let b=-1,j=null;f&&(j=new ResizeObserver(E=>{let[D]=E;D&&D.target===g&&j&&r&&(j.unobserve(r),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var T;(T=j)==null||T.observe(r)})),i()}),g&&!v&&j.observe(g),r&&j.observe(r));let k,S=v?to(n):null;v&&C();function C(){const E=to(n);S&&!Mx(S,E)&&i(),S=E,k=requestAnimationFrame(C)}return i(),()=>{var E;y.forEach(D=>{c&&D.removeEventListener("scroll",i),u&&D.removeEventListener("resize",i)}),x==null||x(),(E=j)==null||E.disconnect(),j=null,v&&cancelAnimationFrame(k)}}const bS=qC,kS=XC,jS=KC,CS=ZC,SS=QC,Km=GC,ES=JC,_S=(n,r,i)=>{const l=new Map,c=i??{},u={...xS,...c.platform,_c:l};return HC(n,r,{...c,platform:u})};var NS=typeof document<"u",RS=function(){},Dl=NS?m.useLayoutEffect:RS;function $l(n,r){if(n===r)return!0;if(typeof n!=typeof r)return!1;if(typeof n=="function"&&n.toString()===r.toString())return!0;let i,l,c;if(n&&r&&typeof n=="object"){if(Array.isArray(n)){if(i=n.length,i!==r.length)return!1;for(l=i;l--!==0;)if(!$l(n[l],r[l]))return!1;return!0}if(c=Object.keys(n),i=c.length,i!==Object.keys(r).length)return!1;for(l=i;l--!==0;)if(!{}.hasOwnProperty.call(r,c[l]))return!1;for(l=i;l--!==0;){const u=c[l];if(!(u==="_owner"&&n.$$typeof)&&!$l(n[u],r[u]))return!1}return!0}return n!==n&&r!==r}function Ax(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Qm(n,r){const i=Ax(n);return Math.round(r*i)/i}function xu(n){const r=m.useRef(n);return Dl(()=>{r.current=n}),r}function PS(n){n===void 0&&(n={});const{placement:r="bottom",strategy:i="absolute",middleware:l=[],platform:c,elements:{reference:u,floating:f}={},transform:h=!0,whileElementsMounted:v,open:g}=n,[y,x]=m.useState({x:0,y:0,strategy:i,placement:r,middlewareData:{},isPositioned:!1}),[b,j]=m.useState(l);$l(b,l)||j(l);const[k,S]=m.useState(null),[C,E]=m.useState(null),D=m.useCallback(W=>{W!==N.current&&(N.current=W,S(W))},[]),T=m.useCallback(W=>{W!==I.current&&(I.current=W,E(W))},[]),P=u||k,R=f||C,N=m.useRef(null),I=m.useRef(null),L=m.useRef(y),Q=v!=null,ee=xu(v),J=xu(c),ne=xu(g),de=m.useCallback(()=>{if(!N.current||!I.current)return;const W={placement:r,strategy:i,middleware:b};J.current&&(W.platform=J.current),_S(N.current,I.current,W).then(q=>{const F={...q,isPositioned:ne.current!==!1};re.current&&!$l(L.current,F)&&(L.current=F,ed.flushSync(()=>{x(F)}))})},[b,r,i,J,ne]);Dl(()=>{g===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,x(W=>({...W,isPositioned:!1})))},[g]);const re=m.useRef(!1);Dl(()=>(re.current=!0,()=>{re.current=!1}),[]),Dl(()=>{if(P&&(N.current=P),R&&(I.current=R),P&&R){if(ee.current)return ee.current(P,R,de);de()}},[P,R,de,ee,Q]);const ie=m.useMemo(()=>({reference:N,floating:I,setReference:D,setFloating:T}),[D,T]),B=m.useMemo(()=>({reference:P,floating:R}),[P,R]),Z=m.useMemo(()=>{const W={position:i,left:0,top:0};if(!B.floating)return W;const q=Qm(B.floating,y.x),F=Qm(B.floating,y.y);return h?{...W,transform:"translate("+q+"px, "+F+"px)",...Ax(B.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:q,top:F}},[i,h,B.floating,y.x,y.y]);return m.useMemo(()=>({...y,update:de,refs:ie,elements:B,floatingStyles:Z}),[y,de,ie,B,Z])}const DS=n=>{function r(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:n,fn(i){const{element:l,padding:c}=typeof n=="function"?n(i):n;return l&&r(l)?l.current!=null?Km({element:l.current,padding:c}).fn(i):{}:l?Km({element:l,padding:c}).fn(i):{}}}},TS=(n,r)=>{const i=bS(n);return{name:i.name,fn:i.fn,options:[n,r]}},OS=(n,r)=>{const i=kS(n);return{name:i.name,fn:i.fn,options:[n,r]}},MS=(n,r)=>({fn:ES(n).fn,options:[n,r]}),AS=(n,r)=>{const i=jS(n);return{name:i.name,fn:i.fn,options:[n,r]}},IS=(n,r)=>{const i=CS(n);return{name:i.name,fn:i.fn,options:[n,r]}},LS=(n,r)=>{const i=SS(n);return{name:i.name,fn:i.fn,options:[n,r]}},zS=(n,r)=>{const i=DS(n);return{name:i.name,fn:i.fn,options:[n,r]}};var FS=Object.defineProperty,$S=(n,r)=>FS(n,"name",{value:r,configurable:!0}),US=m.forwardRef($S(function(r,i){const{children:l,width:c=10,height:u=5,...f}=r;return s.jsx(ze.svg,{...f,ref:i,width:c,height:u,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:s.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),BS=Object.defineProperty,zn=(n,r)=>BS(n,"name",{value:r,configurable:!0}),Ym={Partial:"partial"},qm={Optimized:"optimized",Always:"always"},Ix="Popper",[Lx,sa]=an(Ix),[WS,zx]=Lx(Ix),Fx=zn(n=>{const{__scopePopper:r,children:i}=n,[l,c]=m.useState(null),[u,f]=m.useState(void 0);return s.jsx(WS,{scope:r,anchor:l,onAnchorChange:c,placementState:u,setPlacementState:f,children:i})},"Popper"),VS="PopperAnchor",$x=m.forwardRef(zn(function(r,i){const{__scopePopper:l,virtualRef:c,...u}=r,f=zx(VS,l),h=m.useRef(null),v=f.onAnchorChange,g=m.useCallback(S=>{h.current=S,S&&v(S)},[v]),y=Ie(i,g),x=m.useRef(null);m.useEffect(()=>{if(!c)return;const S=x.current;x.current=c.current,S!==x.current&&v(x.current)});const b=f.placementState&&la(f.placementState),j=b==null?void 0:b[0],k=b==null?void 0:b[1];return c?null:s.jsx(ze.div,{"data-radix-popper-side":j,"data-radix-popper-align":k,...u,ref:y})},"PopperAnchor")),Ux="PopperContent",[HS,GS]=Lx(Ux),Bx=m.forwardRef(zn(function(r,i){var me,Be,mt,It,ut,tt,Jn;const{__scopePopper:l,side:c="bottom",sideOffset:u=0,align:f="center",alignOffset:h=0,arrowPadding:v=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:x=0,sticky:b=Ym.Partial,hideWhenDetached:j=!1,updatePositionStrategy:k=qm.Optimized,onPlaced:S,...C}=r,E=zx(Ux,l),[D,T]=m.useState(null),P=Ie(i,T),[R,N]=m.useState(null),I=Nd(R),L=(I==null?void 0:I.width)??0,Q=(I==null?void 0:I.height)??0,ee=c+(f!=="center"?"-"+f:""),J=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ne=Array.isArray(y)?y:[y],de=ne.length>0,re={padding:J,boundary:ne.filter(Wx),altBoundary:de},{refs:ie,floatingStyles:B,placement:Z,isPositioned:W,middlewareData:q}=PS({strategy:"fixed",placement:ee,whileElementsMounted:zn((...Cn)=>wS(...Cn,{animationFrame:k===qm.Always}),"whileElementsMounted"),elements:{reference:E.anchor},middleware:[TS({mainAxis:u+Q,alignmentAxis:h}),g&&OS({mainAxis:!0,crossAxis:!1,...b===Ym.Partial?{limiter:MS()}:{},...re}),g&&AS({...re}),IS({...re,apply:zn(({elements:Cn,rects:dt,availableWidth:is,availableHeight:ri})=>{const{width:Mr,height:Zn}=dt.reference,er=Cn.floating.style;er.setProperty("--radix-popper-available-width",`${is}px`),er.setProperty("--radix-popper-available-height",`${ri}px`),er.setProperty("--radix-popper-anchor-width",`${Mr}px`),er.setProperty("--radix-popper-anchor-height",`${Zn}px`)},"apply")}),R&&zS({element:R,padding:v}),qS({arrowWidth:L,arrowHeight:Q}),j&&LS(de?{strategy:"referenceHidden",...re}:{strategy:"referenceHidden",padding:re.padding,altBoundary:re.altBoundary})]}),F=E.setPlacementState;wt(()=>(F(Z),()=>{F(void 0)}),[Z,F]);const[M,V]=la(Z),he=wn(S);wt(()=>{W&&(he==null||he())},[W,he]);const be=(me=q.arrow)==null?void 0:me.x,pe=(Be=q.arrow)==null?void 0:Be.y,Y=((mt=q.arrow)==null?void 0:mt.centerOffset)!==0,[we,ke]=m.useState();return wt(()=>{D&&ke(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:ie.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:W?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:we,"--radix-popper-transform-origin":[(It=q.transformOrigin)==null?void 0:It.x,(ut=q.transformOrigin)==null?void 0:ut.y].join(" "),...((tt=q.hide)==null?void 0:tt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:s.jsx(HS,{scope:l,placedSide:M,placedAlign:V,onArrowChange:N,arrowX:be,arrowY:pe,shouldHideArrow:Y,children:s.jsx(ze.div,{"data-side":M,"data-align":V,...C,ref:P,style:{...C.style,animation:W?(Jn=C.style)==null?void 0:Jn.animation:"none"}})})})},"PopperContent")),KS="PopperArrow",QS={top:"bottom",right:"left",bottom:"top",left:"right"},YS=m.forwardRef(zn(function(r,i){const{__scopePopper:l,...c}=r,u=GS(KS,l),f=QS[u.placedSide];return s.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:s.jsx(US,{...c,ref:i,style:{...c.style,display:"block"}})})},"PopperArrow"));function Wx(n){return n!==null}zn(Wx,"isNotNull");var qS=zn(n=>({name:"transformOrigin",options:n,fn(r){var C,E,D;const{placement:i,rects:l,middlewareData:c}=r,f=((C=c.arrow)==null?void 0:C.centerOffset)!==0,h=f?0:n.arrowWidth,v=f?0:n.arrowHeight,[g,y]=la(i),x={start:"0%",center:"50%",end:"100%"}[y],b=(((E=c.arrow)==null?void 0:E.x)??0)+h/2,j=(((D=c.arrow)==null?void 0:D.y)??0)+v/2;let k="",S="";return g==="bottom"?(k=f?x:`${b}px`,S=`${-v}px`):g==="top"?(k=f?x:`${b}px`,S=`${l.floating.height+v}px`):g==="right"?(k=`${-v}px`,S=f?x:`${j}px`):g==="left"&&(k=`${l.floating.width+v}px`,S=f?x:`${j}px`),{data:{x:k,y:S}}}}),"transformOrigin");function la(n){const[r,i="center"]=n.split("-");return[r,i]}zn(la,"getSideAndAlignFromPlacement");var XS=Object.defineProperty,zd=(n,r)=>XS(n,"name",{value:r,configurable:!0}),yu=!1;function Vx(){const[n,r]=m.useState(yu);return m.useEffect(()=>{yu||(yu=!0,r(!0))},[]),n}zd(Vx,"useIsHydrated");var Hx=Rr[" useSyncExternalStore ".trim().toString()];function Gx(){return()=>{}}zd(Gx,"subscribe");function Kx(){return Hx(Gx,()=>!0,()=>!1)}zd(Kx,"useIsHydratedModern");var JS=typeof Hx=="function"?Kx:Vx,ZS=Object.defineProperty,lo=(n,r)=>ZS(n,"name",{value:r,configurable:!0}),wu="rovingFocusGroup.onEntryFocus",eE={bubbles:!1,cancelable:!0},aa="RovingFocusGroup",[Vu,Qx,tE]=cd(aa),[nE,Yx]=an(aa,[tE]),Xm={Vertical:"vertical",Horizontal:"horizontal"},rE={RTL:"rtl"},[oE,iE]=nE(aa),sE=m.forwardRef(lo(function(r,i){return s.jsx(Vu.Provider,{scope:r.__scopeRovingFocusGroup,children:s.jsx(Vu.Slot,{scope:r.__scopeRovingFocusGroup,children:s.jsx(lE,{...r,ref:i})})})},"RovingFocusGroup")),lE=m.forwardRef(lo(function(r,i){const{__scopeRovingFocusGroup:l,orientation:c,loop:u=!1,dir:f,currentTabStopId:h,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:g,onEntryFocus:y,preventScrollOnEntryFocus:x=!1,...b}=r,j=m.useRef(null),k=Ie(i,j),S=dd(f),[C,E]=Jo({prop:h,defaultProp:v??null,onChange:g,caller:aa}),[D,T]=m.useState(!1),P=wn(y),R=Qx(l),N=m.useRef(!1),[I,L]=m.useState(0);return m.useEffect(()=>{const Q=j.current;if(Q)return Q.addEventListener(wu,P),()=>Q.removeEventListener(wu,P)},[P]),s.jsx(oE,{scope:l,orientation:c,dir:S,loop:u,currentTabStopId:C,onItemFocus:m.useCallback(Q=>E(Q),[E]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>L(Q=>Q+1),[]),onFocusableItemRemove:m.useCallback(()=>L(Q=>Q-1),[]),children:s.jsx(ze.div,{tabIndex:D||I===0?-1:0,"data-orientation":c,...b,ref:k,style:{outline:"none",...r.style},onMouseDown:je(r.onMouseDown,()=>{N.current=!0}),onFocus:je(r.onFocus,Q=>{const ee=!N.current;if(Q.target===Q.currentTarget&&ee&&!D){const J=new CustomEvent(wu,eE);if(Q.currentTarget.dispatchEvent(J),!J.defaultPrevented){const ne=R().filter(Z=>Z.focusable),de=ne.find(Z=>Z.active),re=ne.find(Z=>Z.id===C),B=[de,re,...ne].filter(Boolean).map(Z=>Z.ref.current);Fd(B,x)}}N.current=!1}),onBlur:je(r.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),aE="RovingFocusGroupItem",cE=m.forwardRef(lo(function(r,i){const{__scopeRovingFocusGroup:l,focusable:c=!0,active:u=!1,tabStopId:f,children:h,...v}=r,g=Sr(),y=f||g,x=iE(aE,l),b=x.currentTabStopId===y,j=Qx(l),{onFocusableItemAdd:k,onFocusableItemRemove:S,currentTabStopId:C}=x,E=JS();return wt(()=>{if(!(!E||!c))return k(),()=>S()},[E,c,k,S]),m.useEffect(()=>{if(!(E||!c))return k(),()=>S()},[E,c,k,S]),s.jsx(Vu.ItemSlot,{scope:l,id:y,focusable:c,active:u,children:s.jsx(ze.span,{tabIndex:b?0:-1,"data-orientation":x.orientation,...v,ref:i,onMouseDown:je(r.onMouseDown,D=>{c?x.onItemFocus(y):D.preventDefault()}),onFocus:je(r.onFocus,()=>x.onItemFocus(y)),onKeyDown:je(r.onKeyDown,D=>{if(D.key==="Tab"&&D.shiftKey){x.onItemShiftTab();return}if(D.target!==D.currentTarget)return;const T=Xx(D,x.orientation,x.dir);if(T!==void 0){if(D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;D.preventDefault();let R=j().filter(N=>N.focusable).map(N=>N.ref.current);if(T==="last")R.reverse();else if(T==="prev"||T==="next"){T==="prev"&&R.reverse();const N=R.indexOf(D.currentTarget);R=x.loop?Jx(R,N+1):R.slice(N+1)}setTimeout(()=>Fd(R))}}),children:typeof h=="function"?h({isCurrentTabStop:b,hasTabStop:C!=null}):h})})},"RovingFocusGroupItem")),uE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qx(n,r){return r!==rE.RTL?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}lo(qx,"getDirectionAwareKey");function Xx(n,r,i){const l=qx(n.key,i);if(!(r===Xm.Vertical&&["ArrowLeft","ArrowRight"].includes(l))&&!(r===Xm.Horizontal&&["ArrowUp","ArrowDown"].includes(l)))return uE[l]}lo(Xx,"getFocusIntent");function Fd(n,r=!1){const i=document.activeElement;for(const l of n)if(l===i||(l.focus({preventScroll:r}),document.activeElement!==i))return}lo(Fd,"focusFirst");function Jx(n,r){return n.map((i,l)=>n[(r+l)%n.length])}lo(Jx,"wrapArray");var dE=Object.defineProperty,Oe=(n,r)=>dE(n,"name",{value:r,configurable:!0}),fE=["Enter"," "],pE=["ArrowDown","PageUp","Home"],Zx=["ArrowUp","PageDown","End"],hE=[...pE,...Zx],ca="Menu",[Hu,mE,gE]=cd(ca),[ao,ey]=an(ca,[gE,sa,Yx]),$d=sa(),ty=Yx(),[vE,ts]=ao(ca),[xE,Ud]=ao(ca),yE=Oe(n=>{const{__scopeMenu:r,open:i=!1,children:l,dir:c,onOpenChange:u,modal:f=!0}=n,h=$d(r),[v,g]=m.useState(null),y=m.useRef(!1),x=wn(u),b=dd(c);return m.useEffect(()=>{const j=Oe(()=>{y.current=!0,document.addEventListener("pointerdown",k,{capture:!0,once:!0}),document.addEventListener("pointermove",k,{capture:!0,once:!0})},"handleKeyDown"),k=Oe(()=>y.current=!1,"handlePointer");return document.addEventListener("keydown",j,{capture:!0}),()=>{document.removeEventListener("keydown",j,{capture:!0}),document.removeEventListener("pointerdown",k,{capture:!0}),document.removeEventListener("pointermove",k,{capture:!0})}},[]),m.useEffect(()=>{if(!i)return;const j=Oe(()=>x(!1),"handleBlur");return window.addEventListener("blur",j),()=>window.removeEventListener("blur",j)},[i,x]),s.jsx(Fx,{...h,children:s.jsx(vE,{scope:r,open:i,onOpenChange:x,content:v,onContentChange:g,children:s.jsx(xE,{scope:r,onClose:m.useCallback(()=>x(!1),[x]),isUsingKeyboardRef:y,dir:b,modal:f,children:l})})})},"Menu"),wE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r,u=$d(l);return s.jsx($x,{...u,...c,ref:i})},"MenuAnchor")),ny="MenuPortal",[bE,kE]=ao(ny,{forceMount:void 0}),jE=Oe(n=>{const{__scopeMenu:r,forceMount:i,children:l,container:c}=n,u=ts(ny,r);return s.jsx(bE,{scope:r,forceMount:i,children:s.jsx(Gn,{present:i||u.open,children:s.jsx(xd,{asChild:!0,container:c,children:l})})})},"MenuPortal"),Er="MenuContent",[CE,ry]=ao(Er),SE=m.forwardRef(Oe(function(r,i){const l=kE(Er,r.__scopeMenu),{forceMount:c=l.forceMount,...u}=r,f=ts(Er,r.__scopeMenu),h=Ud(Er,r.__scopeMenu);return s.jsx(Hu.Provider,{scope:r.__scopeMenu,children:s.jsx(Gn,{present:c||f.open,children:s.jsx(Hu.Slot,{scope:r.__scopeMenu,children:h.modal?s.jsx(EE,{...u,ref:i}):s.jsx(_E,{...u,ref:i})})})})},"MenuContent")),EE=m.forwardRef(Oe(function(r,i){const l=ts(Er,r.__scopeMenu),c=m.useRef(null),u=Ie(i,c);return m.useEffect(()=>{const f=c.current;if(f)return gx(f)},[]),s.jsx(oy,{...r,ref:u,trapFocus:l.open,disableOutsidePointerEvents:l.open,disableOutsideScroll:!0,onFocusOutside:je(r.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>l.onOpenChange(!1)})},"MenuRootContentModal")),_E=m.forwardRef(Oe(function(r,i){const l=ts(Er,r.__scopeMenu);return s.jsx(oy,{...r,ref:i,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>l.onOpenChange(!1)})},"MenuRootContentNonModal")),NE=$n("MenuContent.ScrollLock"),oy=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,loop:c=!1,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:h,disableOutsidePointerEvents:v,onEntryFocus:g,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:j,onDismiss:k,disableOutsideScroll:S,...C}=r,E=ts(Er,l),D=Ud(Er,l),T=$d(l),P=ty(l),R=mE(l),[N,I]=m.useState(null),L=m.useRef(null),[Q,ee]=m.useState(null);gd(Q);const{nodes:J,registry:ne}=md(),de=!!(u||S),re=Ie(i,L,E.onContentChange,ee),ie=m.useRef(0),B=m.useRef(""),Z=m.useRef(0),W=m.useRef(null),q=m.useRef("right"),F=m.useRef(0),M=m.useMemo(()=>S?[L,...J.map(Y=>({current:Y}))]:[],[L,J,S]),V=S?wd:m.Fragment,he=S?{as:NE,allowPinchZoom:!0,shards:M}:void 0,be=Oe(Y=>{var Jn,Cn;const we=B.current+Y,ke=R().filter(dt=>!dt.disabled),me=document.activeElement,Be=(Jn=ke.find(dt=>dt.ref.current===me))==null?void 0:Jn.textValue,mt=ke.map(dt=>dt.textValue),It=cy(mt,we,Be),ut=(Cn=ke.find(dt=>dt.textValue===It))==null?void 0:Cn.ref.current;function tt(dt){B.current=dt,window.clearTimeout(ie.current),dt!==""&&(ie.current=window.setTimeout(()=>tt(""),1e3))}Oe(tt,"updateSearch"),tt(we),ut&&setTimeout(()=>ut.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(ie.current),[]),Jl();const pe=m.useCallback(Y=>{var ke,me;return q.current===((ke=W.current)==null?void 0:ke.side)&&dy(Y,(me=W.current)==null?void 0:me.area)},[]);return s.jsx(CE,{scope:l,searchRef:B,onItemEnter:m.useCallback(Y=>{pe(Y)&&Y.preventDefault()},[pe]),onItemLeave:m.useCallback(Y=>{var we;pe(Y)||((we=L.current)==null||we.focus(),I(null))},[pe]),onTriggerLeave:m.useCallback(Y=>{pe(Y)&&Y.preventDefault()},[pe]),pointerGraceTimerRef:Z,onPointerGraceIntentChange:m.useCallback(Y=>{W.current=Y},[]),children:s.jsx(hd,{registry:de?ne:null,children:s.jsx(V,{...he,children:s.jsx(ex,{asChild:!0,trapped:u,branches:J,onMountAutoFocus:je(f,Y=>{var we;Y.preventDefault(),(we=L.current)==null||we.focus({preventScroll:!0})}),onUnmountAutoFocus:h,children:s.jsx(fd,{asChild:!0,disableOutsidePointerEvents:v,onEscapeKeyDown:y,onPointerDownOutside:x,onFocusOutside:b,onInteractOutside:j,onDismiss:k,children:s.jsx(sE,{asChild:!0,...P,dir:D.dir,orientation:"vertical",loop:c,currentTabStopId:N,onCurrentTabStopIdChange:I,onEntryFocus:je(g,Y=>{D.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Bx,{role:"menu","aria-orientation":"vertical","data-state":sy(E.open),"data-radix-menu-content":"",dir:D.dir,...T,...C,ref:re,style:{outline:"none",...C.style},onKeyDown:je(C.onKeyDown,Y=>{const ke=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,me=Y.ctrlKey||Y.altKey||Y.metaKey,Be=Y.key.length===1;ke&&(Y.key==="Tab"&&Y.preventDefault(),!me&&Be&&be(Y.key));const mt=L.current;if(Y.target!==mt||!hE.includes(Y.key))return;Y.preventDefault();const ut=R().filter(tt=>!tt.disabled).map(tt=>tt.ref.current);Zx.includes(Y.key)&&ut.reverse(),ly(ut)}),onBlur:je(r.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(ie.current),B.current="")}),onPointerMove:je(r.onPointerMove,Ul(Y=>{const we=Y.target,ke=F.current!==Y.clientX;if(Y.currentTarget.contains(we)&&ke){const me=Y.clientX>F.current?"right":"left";q.current=me,F.current=Y.clientX}}))})})})})})})})},"MenuContentImpl")),RE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r;return s.jsx(ze.div,{role:"group",...c,ref:i})},"MenuGroup")),PE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r;return s.jsx(ze.div,{...c,ref:i})},"MenuLabel")),Gu="MenuItem",Jm="menu.itemSelect",DE=m.forwardRef(Oe(function(r,i){const{disabled:l=!1,onSelect:c,...u}=r,f=m.useRef(null),h=Ud(Gu,r.__scopeMenu),v=ry(Gu,r.__scopeMenu),g=Ie(i,f),y=m.useRef(!1),x=Oe(()=>{const b=f.current;if(!l&&b){const j=new CustomEvent(Jm,{bubbles:!0,cancelable:!0});b.addEventListener(Jm,k=>c==null?void 0:c(k),{once:!0}),ad(b,j),j.defaultPrevented?y.current=!1:h.onClose()}},"handleSelect");return s.jsx(TE,{...u,ref:g,disabled:l,onClick:je(r.onClick,x),onPointerDown:b=>{var j;(j=r.onPointerDown)==null||j.call(r,b),y.current=!0},onPointerUp:je(r.onPointerUp,b=>{var j;y.current||(j=b.currentTarget)==null||j.click()}),onKeyDown:je(r.onKeyDown,b=>{l||b.target!==b.currentTarget||v.searchRef.current!==""&&b.key===" "||fE.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),TE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,disabled:c=!1,textValue:u,...f}=r,h=ry(Gu,l),v=ty(l),g=m.useRef(null),y=Ie(i,g),[x,b]=m.useState(!1),[j,k]=m.useState("");return m.useEffect(()=>{const S=g.current;S&&k((S.textContent??"").trim())},[f.children]),s.jsx(Hu.ItemSlot,{scope:l,disabled:c,textValue:u??j,children:s.jsx(cE,{asChild:!0,...v,focusable:!c,children:s.jsx(ze.div,{role:"menuitem","data-highlighted":x?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:y,onPointerMove:je(r.onPointerMove,Ul(S=>{c?h.onItemLeave(S):(h.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(r.onPointerLeave,Ul(S=>h.onItemLeave(S))),onFocus:je(r.onFocus,()=>b(!0)),onBlur:je(r.onBlur,()=>b(!1))})})})},"MenuItemImpl")),OE="MenuRadioGroup",[ME,AE]=ao(OE,{value:void 0,onValueChange:Oe(()=>{},"onValueChange")}),IE=m.forwardRef(Oe(function(r,i){const{value:l,onValueChange:c,...u}=r,f=wn(c);return s.jsx(ME,{scope:r.__scopeMenu,value:l,onValueChange:f,children:s.jsx(RE,{...u,ref:i})})},"MenuRadioGroup")),LE="MenuRadioItem",zE=m.forwardRef(Oe(function(r,i){const{value:l,...c}=r,u=AE(LE,r.__scopeMenu),f=l===u.value;return s.jsx(FE,{scope:r.__scopeMenu,checked:f,children:s.jsx(DE,{role:"menuitemradio","aria-checked":f,...c,ref:i,"data-state":Wd(f),onSelect:je(c.onSelect,()=>{var h;return(h=u.onValueChange)==null?void 0:h.call(u,l)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),iy="MenuItemIndicator",[FE,$E]=ao(iy,{checked:!1}),UE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,forceMount:c,...u}=r,f=$E(iy,l);return s.jsx(Gn,{present:c||Bd(f.checked)||f.checked===!0,children:s.jsx(ze.span,{...u,ref:i,"data-state":Wd(f.checked)})})},"MenuItemIndicator")),BE=m.forwardRef(Oe(function(r,i){const{__scopeMenu:l,...c}=r;return s.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...c,ref:i})},"MenuSeparator")),WE="MenuSub",[Z2,eN]=ao(WE);function sy(n){return n?"open":"closed"}Oe(sy,"getOpenState");function Bd(n){return n==="indeterminate"}Oe(Bd,"isIndeterminate");function Wd(n){return Bd(n)?"indeterminate":n?"checked":"unchecked"}Oe(Wd,"getCheckedState");function ly(n){const r=document.activeElement;for(const i of n)if(i===r||(i.focus(),document.activeElement!==r))return}Oe(ly,"focusFirst");function ay(n,r){return n.map((i,l)=>n[(r+l)%n.length])}Oe(ay,"wrapArray");function cy(n,r,i){const c=r.length>1&&Array.from(r).every(g=>g===r[0])?r[0]:r,u=i?n.indexOf(i):-1;let f=ay(n,Math.max(u,0));c.length===1&&(f=f.filter(g=>g!==i));const v=f.find(g=>g.toLowerCase().startsWith(c.toLowerCase()));return v!==i?v:void 0}Oe(cy,"getNextMatch");function uy(n,r){const{x:i,y:l}=n;let c=!1;for(let u=0,f=r.length-1;ul!=b>l&&i<(x-g)*(l-y)/(b-y)+g&&(c=!c)}return c}Oe(uy,"isPointInPolygon");function dy(n,r){if(!r)return!1;const i={x:n.clientX,y:n.clientY};return uy(i,r)}Oe(dy,"isPointerInGraceArea");function Ul(n){return r=>r.pointerType==="mouse"?n(r):void 0}Oe(Ul,"whenMouse");var VE=Object.defineProperty,qn=(n,r)=>VE(n,"name",{value:r,configurable:!0}),Vd="DropdownMenu",[HE,tN]=an(Vd,[ey]),Xn=ey(),[GE,fy]=HE(Vd),KE=qn(n=>{const{__scopeDropdownMenu:r,children:i,dir:l,open:c,defaultOpen:u,onOpenChange:f,modal:h=!0}=n,v=Xn(r),g=m.useRef(null),[y,x]=Jo({prop:c,defaultProp:u??!1,onChange:f,caller:Vd});return s.jsx(GE,{scope:r,triggerId:Sr(),triggerRef:g,contentId:Sr(),open:y,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(b=>!b),[x]),modal:h,children:s.jsx(yE,{...v,open:y,onOpenChange:x,dir:l,modal:h,children:i})})},"DropdownMenu"),QE="DropdownMenuTrigger",YE=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,disabled:c=!1,...u}=r,f=fy(QE,l),h=Xn(l),v=Ie(i,f.triggerRef);return s.jsx(wE,{asChild:!0,...h,children:s.jsx(ze.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:v,onPointerDown:je(r.onPointerDown,g=>{!c&&g.button===0&&g.ctrlKey===!1&&(f.onOpenToggle(),f.open||g.preventDefault())}),onKeyDown:je(r.onKeyDown,g=>{c||(["Enter"," "].includes(g.key)&&f.onOpenToggle(),g.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})},"DropdownMenuTrigger")),qE=qn(n=>{const{__scopeDropdownMenu:r,...i}=n,l=Xn(r);return s.jsx(jE,{...l,...i})},"DropdownMenuPortal"),XE="DropdownMenuContent",JE=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=fy(XE,l),f=Xn(l),h=m.useRef(!1);return s.jsx(SE,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:i,onCloseAutoFocus:je(r.onCloseAutoFocus,v=>{var g;h.current||(g=u.triggerRef.current)==null||g.focus(),h.current=!1,v.preventDefault()}),onInteractOutside:je(r.onInteractOutside,v=>{const g=v.detail.originalEvent,y=g.button===0&&g.ctrlKey===!0,x=g.button===2||y;(!u.modal||x)&&(h.current=!0)}),style:{...r.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)"}})},"DropdownMenuContent")),ZE=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(PE,{...u,...c,ref:i})},"DropdownMenuLabel")),e_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(IE,{...u,...c,ref:i})},"DropdownMenuRadioGroup")),t_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(zE,{...u,...c,ref:i})},"DropdownMenuRadioItem")),n_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(UE,{...u,...c,ref:i})},"DropdownMenuItemIndicator")),r_=m.forwardRef(qn(function(r,i){const{__scopeDropdownMenu:l,...c}=r,u=Xn(l);return s.jsx(BE,{...u,...c,ref:i})},"DropdownMenuSeparator")),o_=Object.defineProperty,i_=(n,r)=>o_(n,"name",{value:r,configurable:!0}),s_=m.forwardRef(i_(function(r,i){return s.jsx(ze.label,{...r,ref:i,onMouseDown:l=>{var u;l.target.closest("button, input, select, textarea")||((u=r.onMouseDown)==null||u.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}})},"Label")),l_=Object.defineProperty,py=(n,r)=>l_(n,"name",{value:r,configurable:!0}),Hd={Horizontal:"horizontal",Vertical:"vertical"},Zm=Hd.Horizontal,a_=Object.values(Hd),c_=m.forwardRef(py(function(r,i){const{decorative:l,orientation:c=Zm,...u}=r,f=hy(c)?c:Zm,h=f===Hd.Vertical?f:void 0,v=l?{role:"none"}:{"aria-orientation":h,role:"separator"};return s.jsx(ze.div,{"data-orientation":f,...v,...u,ref:i})},"Separator"));function hy(n){return a_.includes(n)}py(hy,"isValidOrientation");var u_=Object.defineProperty,et=(n,r)=>u_(n,"name",{value:r,configurable:!0}),[Gd,nN]=an("Tooltip",[sa]),ua=sa(),d_="TooltipProvider",f_=700,Ku="tooltip.open",[p_,Kd]=Gd(d_),h_=et(n=>{const{__scopeTooltip:r,delayDuration:i=f_,skipDelayDuration:l=300,disableHoverableContent:c=!1,children:u}=n,f=m.useRef(!0),h=m.useRef(!1),v=m.useRef(0);return m.useEffect(()=>{const g=v.current;return()=>window.clearTimeout(g)},[]),s.jsx(p_,{scope:r,isOpenDelayedRef:f,delayDuration:i,onOpen:m.useCallback(()=>{l<=0||(window.clearTimeout(v.current),f.current=!1)},[l]),onClose:m.useCallback(()=>{l<=0||(window.clearTimeout(v.current),v.current=window.setTimeout(()=>f.current=!0,l))},[l]),isPointerInTransitRef:h,onPointerInTransitChange:m.useCallback(g=>{h.current=g},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),Qu="Tooltip",[m_,ns]=Gd(Qu),g_=et(n=>{const{__scopeTooltip:r,children:i,open:l,defaultOpen:c,onOpenChange:u,disableHoverableContent:f,delayDuration:h}=n,v=Kd(Qu,n.__scopeTooltip),g=ua(r),[y,x]=m.useState(null),[b,j]=m.useState(void 0),k=Sr(),S=m.useRef(0),C=f??v.disableHoverableContent,E=h??v.delayDuration,D=m.useRef(!1),[T,P]=Jo({prop:l,defaultProp:c??!1,onChange:et(ee=>{ee?(v.onOpen(),document.dispatchEvent(new CustomEvent(Ku))):v.onClose(),u==null||u(ee)},"onChange"),caller:Qu}),R=m.useMemo(()=>T?D.current?"delayed-open":"instant-open":"closed",[T]),N=m.useCallback(()=>{window.clearTimeout(S.current),S.current=0,D.current=!1,P(!0)},[P]),I=m.useCallback(()=>{window.clearTimeout(S.current),S.current=0,P(!1)},[P]),L=m.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{D.current=!0,P(!0),S.current=0},E)},[E,P]);m.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]);const Q=b??k;return s.jsx(Fx,{...g,children:s.jsx(m_,{scope:r,contentId:Q,setContentId:j,open:T,stateAttribute:R,trigger:y,onTriggerChange:x,onTriggerEnter:m.useCallback(()=>{v.isOpenDelayedRef.current?L():N()},[v.isOpenDelayedRef,L,N]),onTriggerLeave:m.useCallback(()=>{C?I():(window.clearTimeout(S.current),S.current=0)},[I,C]),onOpen:N,onClose:I,disableHoverableContent:C,children:i})})},"Tooltip"),eg="TooltipTrigger",v_=m.forwardRef(et(function(r,i){const{__scopeTooltip:l,"aria-describedby":c,...u}=r,f=ns(eg,l),h=Kd(eg,l),v=ua(l),g=m.useRef(null),y=Ie(i,g,f.onTriggerChange),x=m.useRef(!1),b=m.useRef(!1),j=m.useCallback(()=>x.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",j),[j]),s.jsx($x,{asChild:!0,...v,children:s.jsx(ze.button,{"aria-describedby":f.open?jy(c,f.contentId):c,"data-state":f.stateAttribute,...u,ref:y,onPointerMove:je(r.onPointerMove,k=>{k.pointerType!=="touch"&&!b.current&&!h.isPointerInTransitRef.current&&(f.onTriggerEnter(),b.current=!0)}),onPointerLeave:je(r.onPointerLeave,()=>{f.onTriggerLeave(),b.current=!1}),onPointerDown:je(r.onPointerDown,()=>{f.open&&f.onClose(),x.current=!0,document.addEventListener("pointerup",j,{once:!0})}),onFocus:je(r.onFocus,()=>{x.current||f.onOpen()}),onBlur:je(r.onBlur,f.onClose),onClick:je(r.onClick,f.onClose)})})},"TooltipTrigger")),my="TooltipPortal",[x_,y_]=Gd(my,{forceMount:void 0}),w_=et(n=>{const{__scopeTooltip:r,forceMount:i,children:l,container:c}=n,u=ns(my,r);return s.jsx(x_,{scope:r,forceMount:i,children:s.jsx(Gn,{present:i||u.open,children:s.jsx(xd,{asChild:!0,container:c,children:l})})})},"TooltipPortal"),qi="TooltipContent",b_=m.forwardRef(et(function(r,i){const l=y_(qi,r.__scopeTooltip),{forceMount:c=l.forceMount,side:u="top",...f}=r,h=ns(qi,r.__scopeTooltip);return s.jsx(Gn,{present:c||h.open,children:h.disableHoverableContent?s.jsx(gy,{side:u,...f,ref:i}):s.jsx(k_,{side:u,...f,ref:i})})},"TooltipContent")),k_=m.forwardRef(et(function(r,i){const l=ns(qi,r.__scopeTooltip),c=Kd(qi,r.__scopeTooltip),u=m.useRef(null),f=Ie(i,u),[h,v]=m.useState(null),{trigger:g,onClose:y}=l,x=u.current,{onPointerInTransitChange:b}=c,j=m.useCallback(()=>{v(null),b(!1)},[b]),k=m.useCallback((S,C)=>{const E=S.currentTarget,D={x:S.clientX,y:S.clientY},T=vy(D,E.getBoundingClientRect()),P=xy(D,T),R=yy(C.getBoundingClientRect()),N=by([...P,...R]);v(N),b(!0)},[b]);return m.useEffect(()=>()=>j(),[j]),m.useEffect(()=>{if(g&&x){const S=et(E=>k(E,x),"handleTriggerLeave"),C=et(E=>k(E,g),"handleContentLeave");return g.addEventListener("pointerleave",S),x.addEventListener("pointerleave",C),()=>{g.removeEventListener("pointerleave",S),x.removeEventListener("pointerleave",C)}}},[g,x,k,j]),m.useEffect(()=>{if(h){const S=et(C=>{const E=C.target,D={x:C.clientX,y:C.clientY},T=(g==null?void 0:g.contains(E))||(x==null?void 0:x.contains(E)),P=!wy(D,h);T?j():P&&(j(),y())},"handleTrackPointerGrace");return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[g,x,h,y,j]),s.jsx(gy,{...r,ref:f})},"TooltipContentHoverable")),j_=_v("TooltipContent"),gy=m.forwardRef(et(function(r,i){const{__scopeTooltip:l,children:c,"aria-label":u,id:f,onEscapeKeyDown:h,onPointerDownOutside:v,...g}=r,y=ns(qi,l),x=ua(l),{onClose:b}=y,[j,k]=m.useState(null),S=Ie(i,k);gd(j),m.useEffect(()=>(document.addEventListener(Ku,b),()=>document.removeEventListener(Ku,b)),[b]),m.useEffect(()=>{if(y.trigger){const E=et(D=>{D.target instanceof Node&&D.target.contains(y.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",E,{capture:!0}),()=>window.removeEventListener("scroll",E,{capture:!0})}},[y.trigger,b]);const{setContentId:C}=y;return wt(()=>(C(f),()=>{C(void 0)}),[f,C]),s.jsx(fd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:E=>E.preventDefault(),onDismiss:b,children:s.jsxs(Bx,{"data-state":y.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:y.contentId,...x,...g,ref:S,style:{...g.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(j_,{children:c}),u?s.jsx(Ak,{id:y.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl")),C_=m.forwardRef(et(function(r,i){const{__scopeTooltip:l,...c}=r,u=ua(l);return s.jsx(YS,{...u,...c,ref:i})},"TooltipArrow"));function vy(n,r){const i=Math.abs(r.top-n.y),l=Math.abs(r.bottom-n.y),c=Math.abs(r.right-n.x),u=Math.abs(r.left-n.x);switch(Math.min(i,l,c,u)){case u:return"left";case c:return"right";case i:return"top";case l:return"bottom";default:throw new Error("unreachable")}}et(vy,"getExitSideFromRect");function xy(n,r,i=5){const l=[];switch(r){case"top":l.push({x:n.x-i,y:n.y+i},{x:n.x+i,y:n.y+i});break;case"bottom":l.push({x:n.x-i,y:n.y-i},{x:n.x+i,y:n.y-i});break;case"left":l.push({x:n.x+i,y:n.y-i},{x:n.x+i,y:n.y+i});break;case"right":l.push({x:n.x-i,y:n.y-i},{x:n.x-i,y:n.y+i});break}return l}et(xy,"getPaddedExitPoints");function yy(n){const{top:r,right:i,bottom:l,left:c}=n;return[{x:c,y:r},{x:i,y:r},{x:i,y:l},{x:c,y:l}]}et(yy,"getPointsFromRect");function wy(n,r){const{x:i,y:l}=n;let c=!1;for(let u=0,f=r.length-1;ul!=b>l&&i<(x-g)*(l-y)/(b-y)+g&&(c=!c)}return c}et(wy,"isPointInPolygon");function by(n){const r=n.slice();return r.sort((i,l)=>i.xl.x?1:i.yl.y?1:0),ky(r)}et(by,"getHull");function ky(n){if(n.length<=1)return n.slice();const r=[];for(let l=0;l=2;){const u=r[r.length-1],f=r[r.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))r.pop();else break}r.push(c)}r.pop();const i=[];for(let l=n.length-1;l>=0;l--){const c=n[l];for(;i.length>=2;){const u=i[i.length-1],f=i[i.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))i.pop();else break}i.push(c)}return i.pop(),r.length===1&&i.length===1&&r[0].x===i[0].x&&r[0].y===i[0].y?r:r.concat(i)}et(ky,"getHullPresorted");function jy(...n){const r=new Set;for(const i of n)if(typeof i=="string")for(const l of String(i).trim().split(/\s+/))l&&r.add(l);return r.size>0?Array.from(r).join(" "):void 0}et(jy,"concatAriaDescribedby");const S_=Xl("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function ge({className:n,variant:r="default",size:i="default",asChild:l=!1,...c}){const u=l?sd:"button";return s.jsx(u,{"data-slot":"button","data-variant":r,"data-size":i,className:te(S_({variant:r,size:i,className:n})),...c})}function E_({...n}){return s.jsx(uC,{"data-slot":"alert-dialog",...n})}function __({...n}){return s.jsx(dC,{"data-slot":"alert-dialog-portal",...n})}function N_({className:n,...r}){return s.jsx(fC,{"data-slot":"alert-dialog-overlay",className:te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...r})}function R_({className:n,size:r="default",...i}){return s.jsxs(__,{children:[s.jsx(N_,{}),s.jsx(gC,{"data-slot":"alert-dialog-content","data-size":r,className:te("group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",n),...i})]})}function P_({className:n,...r}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:te("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",n),...r})}function D_({className:n,...r}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:te("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",n),...r})}function T_({className:n,...r}){return s.jsx(vC,{"data-slot":"alert-dialog-title",className:te("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",n),...r})}function O_({className:n,...r}){return s.jsx(xC,{"data-slot":"alert-dialog-description",className:te("text-sm text-muted-foreground",n),...r})}function M_({className:n,variant:r="default",size:i="default",...l}){return s.jsx(ge,{variant:r,size:i,asChild:!0,children:s.jsx(yC,{"data-slot":"alert-dialog-action",className:te(n),...l})})}function A_({className:n,variant:r="outline",size:i="default",...l}){return s.jsx(ge,{variant:r,size:i,asChild:!0,children:s.jsx(bC,{"data-slot":"alert-dialog-cancel",className:te(n),...l})})}const I_=Xl("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function jn({className:n,variant:r="default",asChild:i=!1,...l}){const c=i?sd:"span";return s.jsx(c,{"data-slot":"badge","data-variant":r,className:te(I_({variant:r}),n),...l})}function Me({className:n,type:r,...i}){return s.jsx("input",{type:r,"data-slot":"input",className:te("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",n),...i})}function Cy({className:n,...r}){return s.jsx(s_,{"data-slot":"label",className:te("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),...r})}function Vn({className:n,...r}){return s.jsx("div",{"data-slot":"card",className:te("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",n),...r})}function Bl({className:n,...r}){return s.jsx("div",{"data-slot":"card-header",className:te("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...r})}function Qd({className:n,...r}){return s.jsx("div",{"data-slot":"card-title",className:te("leading-none font-semibold",n),...r})}function Yd({className:n,...r}){return s.jsx("div",{"data-slot":"card-description",className:te("text-sm text-muted-foreground",n),...r})}function no({className:n,...r}){return s.jsx("div",{"data-slot":"card-content",className:te("px-6",n),...r})}function L_({className:n,...r}){return s.jsx("div",{"data-slot":"card-footer",className:te("flex items-center px-6 [.border-t]:pt-6",n),...r})}function Sy({...n}){return s.jsx(kd,{"data-slot":"sheet",...n})}function z_({...n}){return s.jsx(jd,{"data-slot":"sheet-portal",...n})}function F_({className:n,...r}){return s.jsx(Cd,{"data-slot":"sheet-overlay",className:te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...r})}function Ey({className:n,children:r,side:i="right",showCloseButton:l=!0,...c}){return s.jsxs(z_,{children:[s.jsx(F_,{}),s.jsxs(Sd,{"data-slot":"sheet-content",className:te("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",i==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",i==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",i==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",i==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",n),...c,children:[r,l&&s.jsxs(es,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(lv,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _y({className:n,...r}){return s.jsx("div",{"data-slot":"sheet-header",className:te("flex flex-col gap-1.5 p-4",n),...r})}function Ny({className:n,...r}){return s.jsx(Ed,{"data-slot":"sheet-title",className:te("font-semibold text-foreground",n),...r})}function Ry({className:n,...r}){return s.jsx(_d,{"data-slot":"sheet-description",className:te("text-sm text-muted-foreground",n),...r})}function rs({className:n,...r}){return s.jsx("textarea",{"data-slot":"textarea",className:te("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",n),...r})}const Py=m.createContext(()=>{}),St=()=>m.useContext(Py);function $_({children:n}){const[r,i]=m.useState(null),l=m.useRef(),c=m.useCallback((u,f=!1)=>{i(h=>({msg:u,err:f,n:((h==null?void 0:h.n)??0)+1})),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i(null),4e3)},[]);return s.jsxs(Py.Provider,{value:c,children:[n,s.jsx("div",{"aria-live":"polite",className:"pointer-events-none fixed right-4 bottom-4 left-4 z-50 flex justify-end sm:left-auto",children:r&&s.jsxs("div",{id:"toast",role:"status",className:te("pointer-events-auto flex max-w-md items-start gap-2 rounded-lg border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-lg animate-in fade-in slide-in-from-bottom-2",r.err&&"border-destructive/40"),children:[r.err?s.jsx(d1,{className:"mt-0.5 size-4 shrink-0 text-destructive"}):s.jsx(u1,{className:"mt-0.5 size-4 shrink-0 text-success"}),s.jsx("span",{children:r.msg})]},r.n)})]})}const De=n=>n instanceof Error?n.message:String(n),Dy=m.createContext(async()=>!1),ti=()=>m.useContext(Dy);function U_({children:n}){const[r,i]=m.useState(null),l=m.useRef(),c=m.useCallback(f=>(i(f),new Promise(h=>l.current=h)),[]),u=f=>{var h;(h=l.current)==null||h.call(l,f),i(null)};return s.jsxs(Dy.Provider,{value:c,children:[n,s.jsx(E_,{open:!!r,onOpenChange:f=>!f&&u(!1),children:s.jsxs(R_,{children:[s.jsxs(P_,{children:[s.jsx(T_,{children:r==null?void 0:r.title}),(r==null?void 0:r.description)&&s.jsx(O_,{children:r.description})]}),s.jsxs(D_,{children:[s.jsx(A_,{onClick:()=>u(!1),children:"Cancel"}),s.jsx(M_,{className:te((r==null?void 0:r.danger)&&"bg-destructive text-white hover:bg-destructive/90"),onClick:()=>u(!0),children:(r==null?void 0:r.action)??"Continue"})]})]})})]})}const Ty=m.createContext(null),ni=()=>m.useContext(Ty),Oy=m.createContext(()=>{}),qd=()=>m.useContext(Oy),Wl={hosts:"Multiple code hosts and bot identities",rules:"Group and pattern rules",learnings:"Team learnings",executors:"Docker and Kubernetes executors",budgets:"Token budgets",metrics:"Metrics and long history",audit:"Audit log",branch_sync:"Branch-sync skip",sso_rules:"SSO domain and group rules"};function ln(n){return ni().license.features.includes(n)}function da({feature:n,children:r}){return s.jsxs(Wo,{role:"note",className:"locked border-dashed border-primary/60",children:[s.jsx(Fg,{className:"text-primary"}),s.jsxs(kk,{className:"flex items-center gap-2",children:[Wl[n],s.jsx(jn,{variant:"secondary",children:"licensed"})]}),s.jsx(Vo,{children:s.jsxs("p",{children:[r??"This is part of the licensed Divmora console."," ",s.jsx(Jr,{className:"font-medium text-primary underline-offset-4 hover:underline",to:"/license",children:"Install a license"})," ","or contact"," ",s.jsx("a",{className:"font-medium text-primary underline-offset-4 hover:underline",href:"mailto:licensing@divmora.com",children:"licensing@divmora.com"}),"."]})})]})}function Tl({feature:n}){return ln(n)?null:s.jsxs("span",{className:"locknote block text-xs leading-snug text-warning",children:[s.jsx(Fg,{className:"mr-1 inline size-3 align-[-2px]"}),"Needs a license with ",Wl[n].toLowerCase()," ·"," ",s.jsx(Jr,{to:"/license",className:"underline underline-offset-2",children:"License"})]})}function co({children:n,className:r}){return s.jsx(Vn,{className:te("gap-0 overflow-hidden py-0",r),children:n})}function Qo({open:n,onClose:r,title:i,description:l,children:c,wide:u}){return s.jsx(Sy,{open:n,onOpenChange:f=>!f&&r(),children:s.jsxs(Ey,{className:te("w-full gap-0 overflow-y-auto sm:max-w-xl",u&&"sm:max-w-3xl"),children:[s.jsxs(_y,{className:"border-b pr-10",children:[s.jsx(Ny,{children:i}),l&&s.jsx(Ry,{children:l})]}),s.jsx("div",{className:"p-4",children:c})]})})}function ro({children:n,className:r}){return s.jsx("div",{className:te("flex flex-wrap items-center gap-2",r),children:n})}function Jt({children:n,className:r}){return s.jsx("p",{className:te("max-w-4xl text-sm leading-relaxed text-muted-foreground",r),children:n})}function bt({children:n}){return s.jsx("div",{className:"px-4 py-10 text-center text-sm text-muted-foreground",children:n})}function Ce({label:n,children:r,hint:i,className:l}){return s.jsxs("div",{className:te("grid content-start gap-1.5",l),children:[s.jsx(Cy,{className:"text-xs font-medium text-muted-foreground",children:n}),r,i]})}function Xt({children:n,className:r}){return s.jsx("div",{className:te("grid gap-4 sm:grid-cols-2 lg:grid-cols-3",r),children:n})}function He({className:n,...r}){return s.jsx("select",{className:te("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",n),...r})}const B_={on:"border-transparent bg-success-soft text-success",off:"border-transparent bg-danger-soft text-destructive",idle:"border-transparent bg-muted text-muted-foreground",warn:"border-transparent bg-warning-soft text-warning"};function yn({kind:n,children:r}){return s.jsx(jn,{className:te("state",n,B_[n]),children:r})}function Yu({items:n,empty:r}){return n.length?s.jsx("span",{className:"flex flex-wrap gap-1",children:n.map(i=>s.jsx(jn,{variant:"outline",className:"chip font-normal text-muted-foreground",children:i},i))}):s.jsx("span",{className:"text-sm text-muted-foreground",children:r??"defaults"})}function Qe({children:n,className:r}){return s.jsx("div",{className:te("mt-0.5 text-xs text-muted-foreground",r),children:n})}function My(n={}){const r=[];return n.profile&&r.push(n.profile),n.max_comments&&r.push("max "+n.max_comments),n.min_severity&&r.push("≥ "+n.min_severity),n.model&&r.push("model "+n.model),n.auto_review===!1&&r.push("auto review off"),n.auto_review===!0&&r.push("auto review on"),n.drafts===!0&&r.push("drafts"),n.instructions&&r.push("instructions"),r}function Vl({value:n,onChange:r,on:i,off:l,inherit:c="Inherit",label:u,disabled:f}){const h=n==null?"":String(n);return s.jsxs(He,{"aria-label":u,value:h,disabled:f,onChange:v=>r(v.target.value===""?null:v.target.value==="true"),children:[s.jsx("option",{value:"",children:c}),s.jsx("option",{value:"true",children:i}),s.jsx("option",{value:"false",children:l})]})}function Xd({value:n,onSave:r,onCancel:i,extra:l,inheritModel:c="Server default",saveLabel:u="Save settings",danger:f}){const h=ni(),v=n??{},[g,y]=m.useState(v.profile??""),[x,b]=m.useState(v.max_comments?String(v.max_comments):""),[j,k]=m.useState(v.min_severity??""),[S,C]=m.useState(v.model??""),[E,D]=m.useState(v.auto_review??null),[T,P]=m.useState(v.drafts??null),[R,N]=m.useState(v.instructions??""),I=()=>{const L={};g&&(L.profile=g),x&&(L.max_comments=parseInt(x,10)),j&&(L.min_severity=j),S&&(L.model=S),E!==null&&(L.auto_review=E),T!==null&&(L.drafts=T),R.trim()&&(L.instructions=R.trim()),r(L)};return s.jsxs("div",{className:"grid gap-5",children:[l,s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Review profile",children:s.jsxs(He,{value:g,onChange:L=>y(L.target.value),children:[s.jsx("option",{value:"",children:"Inherit"}),s.jsx("option",{value:"chill",children:"Chill"}),s.jsx("option",{value:"balanced",children:"Balanced"}),s.jsx("option",{value:"assertive",children:"Assertive"})]})}),s.jsx(Ce,{label:"Max inline comments",children:s.jsx(Me,{type:"number",min:0,max:200,value:x,placeholder:"Inherit",onChange:L=>b(L.target.value)})}),s.jsx(Ce,{label:"Minimum severity",children:s.jsxs(He,{value:j,onChange:L=>k(L.target.value),children:[s.jsx("option",{value:"",children:"Inherit"}),s.jsx("option",{value:"critical",children:"Critical"}),s.jsx("option",{value:"major",children:"Major"}),s.jsx("option",{value:"minor",children:"Minor"}),s.jsx("option",{value:"nitpick",children:"Nitpick"})]})}),s.jsx(Ce,{label:"Model profile",children:s.jsxs(He,{value:S,onChange:L=>C(L.target.value),children:[s.jsx("option",{value:"",children:c}),h.profiles.map(L=>s.jsx("option",{value:L,children:L},L))]})}),s.jsx(Ce,{label:"Auto review on push",children:s.jsx(Vl,{value:E,onChange:D,on:"On",off:"Off"})}),s.jsx(Ce,{label:"Review draft PRs",children:s.jsx(Vl,{value:T,onChange:P,on:"On",off:"Off"})})]}),s.jsx(Ce,{label:"Extra review instructions",children:s.jsx(rs,{rows:4,maxLength:8e3,placeholder:"Appended to the repository's own instructions",value:R,onChange:L=>N(L.target.value)})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ge,{onClick:I,children:u}),i&&s.jsx(ge,{variant:"outline",onClick:i,children:"Cancel"}),s.jsx("span",{className:"flex-1"}),f]})]})}function W_({...n}){return s.jsx(KE,{"data-slot":"dropdown-menu",...n})}function V_({...n}){return s.jsx(YE,{"data-slot":"dropdown-menu-trigger",...n})}function H_({className:n,sideOffset:r=4,...i}){return s.jsx(qE,{children:s.jsx(JE,{"data-slot":"dropdown-menu-content",sideOffset:r,className:te("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n),...i})})}function G_({...n}){return s.jsx(e_,{"data-slot":"dropdown-menu-radio-group",...n})}function bu({className:n,children:r,...i}){return s.jsxs(t_,{"data-slot":"dropdown-menu-radio-item",className:te("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...i,children:[s.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:s.jsx(n_,{children:s.jsx(Pg,{className:"size-2 fill-current"})})}),r]})}function K_({className:n,inset:r,...i}){return s.jsx(ZE,{"data-slot":"dropdown-menu-label","data-inset":r,className:te("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",n),...i})}function Q_({className:n,...r}){return s.jsx(r_,{"data-slot":"dropdown-menu-separator",className:te("-mx-1 my-1 h-px bg-border",n),...r})}function Zr({className:n,orientation:r="horizontal",decorative:i=!0,...l}){return s.jsx(c_,{"data-slot":"separator",decorative:i,orientation:r,className:te("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",n),...l})}const ku=768;function Y_(){const[n,r]=m.useState(void 0);return m.useEffect(()=>{const i=window.matchMedia(`(max-width: ${ku-1}px)`),l=()=>{r(window.innerWidthi.removeEventListener("change",l)},[]),!!n}function Ay({delayDuration:n=0,...r}){return s.jsx(h_,{"data-slot":"tooltip-provider",delayDuration:n,...r})}function q_({...n}){return s.jsx(g_,{"data-slot":"tooltip",...n})}function X_({...n}){return s.jsx(v_,{"data-slot":"tooltip-trigger",...n})}function J_({className:n,sideOffset:r=0,children:i,...l}){return s.jsx(w_,{children:s.jsxs(b_,{"data-slot":"tooltip-content",sideOffset:r,className:te("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",n),...l,children:[i,s.jsx(C_,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Z_="sidebar_state",e2=3600*24*7,t2="16rem",n2="18rem",r2="3rem",o2="b",Iy=m.createContext(null);function os(){const n=m.useContext(Iy);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function i2({defaultOpen:n=!0,open:r,onOpenChange:i,className:l,style:c,children:u,...f}){const h=Y_(),[v,g]=m.useState(!1),[y,x]=m.useState(n),b=r??y,j=m.useCallback(E=>{const D=typeof E=="function"?E(b):E;i?i(D):x(D),document.cookie=`${Z_}=${D}; path=/; max-age=${e2}`},[i,b]),k=m.useCallback(()=>h?g(E=>!E):j(E=>!E),[h,j,g]);m.useEffect(()=>{const E=D=>{D.key===o2&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),k())};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[k]);const S=b?"expanded":"collapsed",C=m.useMemo(()=>({state:S,open:b,setOpen:j,isMobile:h,openMobile:v,setOpenMobile:g,toggleSidebar:k}),[S,b,j,h,v,g,k]);return s.jsx(Iy.Provider,{value:C,children:s.jsx(Ay,{delayDuration:0,children:s.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":t2,"--sidebar-width-icon":r2,...c},className:te("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",l),...f,children:u})})})}function s2({side:n="left",variant:r="sidebar",collapsible:i="offcanvas",className:l,children:c,...u}){const{isMobile:f,state:h,openMobile:v,setOpenMobile:g}=os();return i==="none"?s.jsx("div",{"data-slot":"sidebar",className:te("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",l),...u,children:c}):f?s.jsx(Sy,{open:v,onOpenChange:g,...u,children:s.jsxs(Ey,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":n2},side:n,children:[s.jsxs(_y,{className:"sr-only",children:[s.jsx(Ny,{children:"Sidebar"}),s.jsx(Ry,{children:"Displays the mobile sidebar."})]}),s.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):s.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?i:"","data-variant":r,"data-side":n,"data-slot":"sidebar",children:[s.jsx("div",{"data-slot":"sidebar-gap",className:te("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),s.jsx("div",{"data-slot":"sidebar-container",className:te("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",n==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",r==="floating"||r==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",l),...u,children:s.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",children:c})})]})}function l2({className:n,onClick:r,...i}){const{toggleSidebar:l}=os();return s.jsxs(ge,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:te("size-7",n),onClick:c=>{r==null||r(c),l()},...i,children:[s.jsx(y1,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function a2({className:n,...r}){const{toggleSidebar:i}=os();return s.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:i,title:"Toggle Sidebar",className:te("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",n),...r})}function c2({className:n,...r}){return s.jsx("main",{"data-slot":"sidebar-inset",className:te("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",n),...r})}function u2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:te("flex flex-col gap-2 p-2",n),...r})}function d2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:te("flex flex-col gap-2 p-2",n),...r})}function f2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:te("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...r})}function p2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:te("relative flex w-full min-w-0 flex-col p-2",n),...r})}function h2({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:te("w-full text-sm",n),...r})}function tg({className:n,...r}){return s.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:te("flex w-full min-w-0 flex-col gap-1",n),...r})}function ng({className:n,...r}){return s.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:te("group/menu-item relative",n),...r})}const m2=Xl("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function rg({asChild:n=!1,isActive:r=!1,variant:i="default",size:l="default",tooltip:c,className:u,...f}){const h=n?sd:"button",{isMobile:v,state:g}=os(),y=s.jsx(h,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":l,"data-active":r,className:te(m2({variant:i,size:l}),u),...f});return c?(typeof c=="string"&&(c={children:c}),s.jsxs(q_,{children:[s.jsx(X_,{asChild:!0,children:y}),s.jsx(J_,{side:"right",align:"center",hidden:g!=="collapsed"||v,...c})]})):y}function og({className:n,...r}){return s.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:te("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n),...r})}function oo(n){if(!n||n.startsWith("0001-"))return"never";const r=Math.round((Date.now()-new Date(n).getTime())/1e3);return r<60?"just now":r<3600?Math.floor(r/60)+"m ago":r<86400?Math.floor(r/3600)+"h ago":Math.floor(r/86400)+"d ago"}function Tt(n){return n>=1e6?(n/1e6).toFixed(1)+"M":n>=1e4?Math.round(n/1e3)+"k":n>=1e3?(n/1e3).toFixed(1)+"k":String(n)}function ig(n){if(!n)return"—";const r=Math.round(n/1e3);return r<60?r+"s":Math.floor(r/60)+"m "+r%60+"s"}function sg(n){return new Date(n).toLocaleString()}function Jd({...n}){return s.jsx(kd,{"data-slot":"dialog",...n})}function g2({...n}){return s.jsx(jd,{"data-slot":"dialog-portal",...n})}function v2({className:n,...r}){return s.jsx(Cd,{"data-slot":"dialog-overlay",className:te("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",n),...r})}function Zd({className:n,children:r,showCloseButton:i=!0,...l}){return s.jsxs(g2,{"data-slot":"dialog-portal",children:[s.jsx(v2,{}),s.jsxs(Sd,{"data-slot":"dialog-content",className:te("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",n),...l,children:[r,i&&s.jsxs(es,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(lv,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ef({className:n,...r}){return s.jsx("div",{"data-slot":"dialog-header",className:te("flex flex-col gap-2 text-center sm:text-left",n),...r})}function tf({className:n,showCloseButton:r=!1,children:i,...l}){return s.jsxs("div",{"data-slot":"dialog-footer",className:te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...l,children:[i,r&&s.jsx(es,{asChild:!0,children:s.jsx(ge,{variant:"outline",children:"Close"})})]})}function nf({className:n,...r}){return s.jsx(Ed,{"data-slot":"dialog-title",className:te("text-lg leading-none font-semibold",n),...r})}function rf({className:n,...r}){return s.jsx(_d,{"data-slot":"dialog-description",className:te("text-sm text-muted-foreground",n),...r})}function uo({className:n,...r}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:te("w-full caption-bottom text-sm",n),...r})})}function fo({className:n,...r}){return s.jsx("thead",{"data-slot":"table-header",className:te("[&_tr]:border-b",n),...r})}function po({className:n,...r}){return s.jsx("tbody",{"data-slot":"table-body",className:te("[&_tr:last-child]:border-0",n),...r})}function Mt({className:n,...r}){return s.jsx("tr",{"data-slot":"table-row",className:te("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",n),...r})}function Se({className:n,...r}){return s.jsx("th",{"data-slot":"table-head",className:te("h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r})}function Ee({className:n,...r}){return s.jsx("td",{"data-slot":"table-cell",className:te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n),...r})}function x2(n){return n.source==="repository"?"set on this repository":n.source==="allowlist"?"no rule matches · allowlist default":n.source==="default"?"no rule matches · reviewed by default":"by "+n.source}function y2(){const n=ni(),r=St(),i=ti(),[l,c]=m.useState(null),[u,f]=m.useState(""),[h,v]=m.useState("all"),[g,y]=m.useState(null),[x,b]=m.useState(!1),[j,k]=m.useState({platform:"github",host:"",path:"",mode:"enabled"}),S=()=>Ct("/admin/api/repos").then(c).catch(N=>r(De(N),!0));m.useEffect(()=>{S()},[]);const C=(N,I,L)=>io("/admin/api/repos/"+N.id,{mode:I,settings:L}).then(Q=>(c(ee=>(ee||[]).map(J=>J.id===Q.id?Q:J)),r(Q.path+": reviews "+(Q.effective.enabled?"on":"off")+" ("+Q.effective.source+")"),Q)),E=()=>Fn("/admin/api/repos",{...j,host:j.host.trim(),path:j.path.trim()}).then(N=>{c(I=>(I||[]).filter(L=>L.id!==N.id).concat([N])),k({...j,path:""}),b(!1),r("Added "+N.path)}).catch(N=>r(De(N),!0)),D=async N=>{await i({title:"Remove "+N.path+"?",description:"It reappears, set to Inherit, if it sends another webhook.",action:"Remove",danger:!0})&&Ji("/admin/api/repos/"+N.id).then(()=>{c(I=>(I||[]).filter(L=>L.id!==N.id)),y(null),r("Removed "+N.path)}).catch(I=>r(De(I),!0))},T=(l||[]).filter(N=>h==="on"&&!N.effective.enabled||h==="off"&&N.effective.enabled?!1:!u||(N.host+"/"+N.path).toLowerCase().includes(u.toLowerCase())),P=(l||[]).filter(N=>N.effective.enabled).length,R=(l==null?void 0:l.find(N=>N.id===g))??null;return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(ro,{children:[s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Filter repositories","aria-label":"Filter repositories",value:u,onChange:N=>f(N.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"Show",value:h,onChange:N=>v(N.target.value),children:[s.jsx("option",{value:"all",children:"All"}),s.jsx("option",{value:"on",children:"Reviewed"}),s.jsx("option",{value:"off",children:"Not reviewed"})]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:l&&P+" reviewed · "+(l.length-P)+" not reviewed"}),s.jsx("span",{className:"flex-1"}),s.jsxs(ge,{variant:"outline",onClick:()=>b(!0),children:[s.jsx(Xi,{})," Add repository"]})]}),s.jsx(co,{children:l?T.length?s.jsxs(uo,{children:[s.jsx(fo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Reviews"}),s.jsx(Se,{children:"Repository"}),s.jsx(Se,{children:"Last webhook"}),s.jsx(Se,{children:"Effective settings"}),s.jsx(Se,{children:"Last changed"}),s.jsx(Se,{})]})}),s.jsx(po,{children:T.map(N=>{const I=N.effective,L=[I.require_reviewer&&"reviewer required",I.skip_branch_sync&&"skips branch syncs",I.score_labels&&"score labels",I.commit_status&&"commit status"].filter(Boolean);return s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"w-44 pl-4 align-top whitespace-normal",children:[s.jsxs(He,{"aria-label":"Reviews for "+N.path,value:N.mode,onChange:Q=>C(N,Q.target.value,N.settings||{}).catch(ee=>r(De(ee),!0)),children:[s.jsx("option",{value:"inherit",children:"Inherit"}),s.jsx("option",{value:"enabled",children:"Enabled"}),s.jsx("option",{value:"disabled",children:"Disabled"})]}),s.jsx("div",{className:"mt-1.5",children:s.jsx(yn,{kind:I.enabled?"on":"off",children:I.enabled?"Reviewed":"Not reviewed"})}),s.jsx(Qe,{children:x2(I)}),L.length>0&&s.jsx(Qe,{children:L.join(" · ")})]}),s.jsxs(Ee,{className:"align-top",children:[s.jsx("div",{className:"font-medium",children:N.path}),s.jsxs(Qe,{children:[N.platform," · ",N.host]})]}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:oo(N.last_seen)}),s.jsxs(Ee,{className:"align-top whitespace-normal",children:[s.jsx(Yu,{items:My(I.settings)}),(I.rules||[]).length>0&&JSON.stringify(I.settings)!==JSON.stringify(N.settings||{})&&s.jsx(Qe,{children:"includes rule settings"})]}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:N.updated_by?N.updated_by+" · "+oo(N.updated_at):"—"}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:s.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>y(N.id),children:[s.jsx(S1,{})," Settings"]})})]},N.id)})})]}):s.jsx(bt,{children:l.length?"No repositories match.":"No repositories yet. They appear when they send their first webhook, or add one above."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Repositories appear here automatically when they send their first webhook, set to ",s.jsx("b",{children:"Inherit"}),": they follow the most specific group or pattern rule, and otherwise the default (",n.allowlist?"not reviewed, because the allowlist is on":"reviewed, because the allowlist is off","). Choosing Enabled or Disabled here overrides every rule. Settings here override the rules' settings and the repository's own ",s.jsx("code",{children:".codereview.yaml"}),"."]}),n.require_reviewer&&s.jsxs(Jt,{children:[s.jsx("b",{children:"Reviewer required:"})," even in an enabled repository, a merge request is reviewed only when the bot user is one of its reviewers. Adding the bot as a reviewer starts a review; ",s.jsx("code",{children:"@bot review"})," comments still work."]}),s.jsx(Qo,{open:!!R,onClose:()=>y(null),title:(R==null?void 0:R.path)??"",description:R?`${R.platform} · ${R.host} · review settings for this repository`:void 0,children:R&&s.jsx(Xd,{value:R.settings,onSave:N=>C(R,R.mode,N).then(()=>y(null)).catch(I=>r(De(I),!0)),onCancel:()=>y(null),danger:s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:()=>D(R),children:"Remove"})},R.id)}),s.jsx(Jd,{open:x,onOpenChange:b,children:s.jsxs(Zd,{className:"sm:max-w-lg",children:[s.jsxs(ef,{children:[s.jsx(nf,{children:"Add repository"}),s.jsx(rf,{children:"Repositories also appear by themselves when they send their first webhook."})]}),s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{value:j.platform,onChange:N=>k({...j,platform:N.target.value}),children:[s.jsx("option",{value:"github",children:"GitHub"}),s.jsx("option",{value:"gitlab",children:"GitLab"})]})}),s.jsx(Ce,{label:"Host",children:s.jsx(Me,{placeholder:"github.com",value:j.host,onChange:N=>k({...j,host:N.target.value})})}),s.jsx(Ce,{label:"Repository path",className:"sm:col-span-2",children:s.jsx(Me,{placeholder:"owner/repo or group/sub/project",value:j.path,onChange:N=>k({...j,path:N.target.value})})}),s.jsx(Ce,{label:"Reviews",children:s.jsxs(He,{value:j.mode,onChange:N=>k({...j,mode:N.target.value}),children:[s.jsx("option",{value:"enabled",children:"Enabled"}),s.jsx("option",{value:"disabled",children:"Disabled"}),s.jsx("option",{value:"inherit",children:"Inherit from rules"})]})})]}),s.jsxs(tf,{children:[s.jsx(ge,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),s.jsx(ge,{onClick:E,children:"Add"})]})]})})]})}const qu=[["done","Reviewed","--st-done"],["skipped","Skipped","--st-skip"],["failed","Failed","--st-fail"]];function lg(n,r,i=!1){const l=new Date(n);return r==="hour"?i?l.toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):l.toLocaleTimeString([],{hour:"2-digit"}):r==="month"?l.toLocaleDateString([],{month:"short",year:i?"numeric":"2-digit"}):l.toLocaleDateString([],{month:"short",day:"numeric"})}const br=(n,r)=>typeof n[r]=="number"?n[r]:0;function w2({points:n,granularity:r}){const i=m.useRef(null),[l,c]=m.useState(900),[u,f]=m.useState(null);m.useEffect(()=>{const N=i.current;if(!N)return;const I=new ResizeObserver(()=>c(Math.max(320,N.clientWidth||900)));return I.observe(N),()=>I.disconnect()},[]);const h=l,v=200,g=34,y=8,x=8,b=24;let j=0;n.forEach(N=>j=Math.max(j,br(N,"done")+br(N,"skipped")+br(N,"failed")));const k=j<=4?4:Math.pow(10,Math.floor(Math.log10(j))),S=Math.ceil(j/k)*k||4,C=(h-g-y)/Math.max(1,n.length),E=Math.min(24,Math.max(2,C*.7)),D=N=>x+(v-x-b)*(1-N/S),T=Math.ceil(n.length/Math.max(2,Math.floor((h-g-y)/70))),P=u!==null?n[u]:null,R=u!==null?Math.min(h-170,Math.max(0,g+C*u+C/2+12)):0;return s.jsxs("div",{className:"chart relative w-full",ref:i,children:[s.jsxs("svg",{className:"block h-auto w-full",viewBox:`0 0 ${h} ${v}`,role:"img","aria-label":`Jobs per ${r}: reviewed, skipped and failed`,children:[n.map((N,I)=>s.jsx("rect",{x:g+C*I,y:x,width:C,height:v-x-b,fill:u===I?"var(--muted)":"transparent",fillOpacity:.5,tabIndex:0,onMouseEnter:()=>f(I),onMouseLeave:()=>f(null),onFocus:()=>f(I),onBlur:()=>f(null)},"h"+I)),[0,S/2,S].map(N=>s.jsxs("g",{pointerEvents:"none",children:[s.jsx("line",{x1:g,x2:h-y,y1:D(N),y2:D(N),stroke:"var(--grid)",strokeWidth:1}),s.jsx("text",{x:g-6,y:D(N)+4,textAnchor:"end",fontSize:11,fill:"var(--muted-foreground)",children:Tt(N)})]},"g"+N)),n.map((N,I)=>{const L=g+C*I+(C-E)/2,Q=qu.map(([J,,ne])=>[br(N,J),ne]).filter(([J])=>J>0);let ee=0;return s.jsxs("g",{pointerEvents:"none",children:[Q.map(([J,ne],de)=>{let re=D(ee+J);const ie=D(ee)-(de>0?2:0);ie-re<1&&(re=ie-1);const B=de===Q.length-1?Math.min(4,E/2,ie-re):0;ee+=J;const Z=`M${L},${ie}V${re+B}Q${L},${re} ${L+B},${re}H${L+E-B}Q${L+E},${re} ${L+E},${re+B}V${ie}Z`;return s.jsx("path",{d:Z,fill:`var(${ne})`},de)}),I%T===0&&s.jsx("text",{x:g+C*I+C/2,y:v-b+16,textAnchor:"middle",fontSize:11,fill:"var(--muted-foreground)",children:lg(N.bucket,r)})]},"b"+I)}),s.jsx("line",{x1:g,x2:h-y,y1:v-b,y2:v-b,stroke:"var(--grid)",strokeWidth:1,pointerEvents:"none"})]}),s.jsx("div",{className:"tip pointer-events-none absolute z-10 w-40 rounded-md border bg-popover p-2.5 text-xs text-popover-foreground shadow-md [&>div]:flex [&>div]:justify-between [&>div]:gap-3 [&>div>span:first-child]:text-muted-foreground "+(P?"show block":"hidden"),id:"mTip",ref:N=>N&&(N.style.left=R+"px",N.style.top="28px"),children:P&&s.jsxs(s.Fragment,{children:[s.jsx("b",{className:"mb-1 block font-semibold",children:lg(P.bucket,r,!0)}),qu.map(([N,I])=>s.jsxs("div",{children:[s.jsx("span",{children:I}),s.jsx("span",{children:br(P,N)})]},N)),s.jsxs("div",{children:[s.jsx("span",{children:"Comments"}),s.jsx("span",{children:br(P,"comments")})]}),s.jsxs("div",{children:[s.jsx("span",{children:"Tokens"}),s.jsx("span",{children:Tt(br(P,"tokens_in")+br(P,"tokens_out"))})]})]})})]})}function b2({className:n,...r}){return s.jsx(RC,{"data-slot":"checkbox",className:te("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",n),...r,children:s.jsx(DC,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:s.jsx(Ql,{className:"size-3.5"})})})}function k2(n){const r=[],i={};n.points.forEach(h=>i[new Date(h.bucket).toISOString()]=h);const l=new Date(n.to),c=new Date(n.from);if(n.granularity==="month"){let h=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth(),1));for(;h{Ct("/admin/api/reviews/"+n.id).then(c).catch(h=>i(De(h),!0))},[n.id]),!l)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading…"});let u=null;try{u=l.result?typeof l.result=="string"?JSON.parse(l.result):l.result:null}catch{u=null}const f=u==null?void 0:u.verification;return s.jsxs("div",{className:"grid gap-5 text-sm",children:[l.error&&s.jsxs("div",{className:"rounded-md border border-destructive/40 bg-danger-soft p-3",children:[s.jsx("div",{className:"mb-1 font-medium text-destructive",children:"Error"}),s.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap text-destructive",children:l.error})]}),u?s.jsxs(s.Fragment,{children:[u.summary&&s.jsxs("div",{children:[s.jsx("h3",{className:"mb-1 font-semibold",children:"Summary"}),s.jsx("p",{className:"leading-relaxed text-muted-foreground",children:u.summary})]}),u.scores&&s.jsx("div",{className:"grid grid-cols-3 gap-2",children:["quality","security","maintainability"].map(h=>s.jsxs("div",{className:"rounded-md border p-2.5",children:[s.jsx("div",{className:"text-lg font-semibold",children:u.scores[h]}),s.jsx("div",{className:"text-xs text-muted-foreground capitalize",children:h})]},h))}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-2 font-semibold",children:(u.findings||[]).length?`Findings (${u.findings.length})`:"No findings"}),s.jsx("div",{className:"grid gap-2",children:(u.findings||[]).map((h,v)=>s.jsxs("div",{className:"finding rounded-md border p-3",children:[s.jsx("div",{className:"font-medium",children:(h.kind==="question"?"❓ ":"")+h.title}),s.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(yn,{kind:j2[h.severity]??"idle",children:h.severity}),s.jsx(jn,{variant:"outline",className:"font-normal",children:h.category}),s.jsxs("span",{className:"font-mono",children:[h.path,":",h.end_line]})]})]},v))})]}),(f==null?void 0:f.ran)&&s.jsxs("p",{className:"text-muted-foreground",children:["Verification (",f.model,"): ",f.confirmed||0," confirmed · ",f.false_positives||0," removed · ",f.questions||0," questions"]}),((f==null?void 0:f.removed)||[]).length>0&&s.jsx("div",{className:"grid gap-1.5",children:f.removed.map((h,v)=>s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Removed: ",s.jsx("span",{className:"text-foreground",children:h.title})," — ",h.reason]},"r"+v))})]}):!l.error&&s.jsx("p",{className:"text-muted-foreground",children:l.note||"No review result stored for this job."}),s.jsx(Zr,{}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Model ",l.model||"—"," · ",l.comments," comments · ",l.files," files"]}),n.kind.includes("review")&&s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{variant:"outline",onClick:()=>r(!1),children:"Re-run (new changes)"}),s.jsx(ge,{variant:"outline",onClick:()=>r(!0),children:"Re-run full review"})]})]})}function S2(){const n=St(),[r,i]=m.useState("day"),[l,c]=m.useState(null),[u,f]=m.useState([]),[h,v]=m.useState({host:"",repo:"",state:"",kind:"",trigger:"",from:"",to:""}),[g,y]=m.useState(""),[x,b]=m.useState(null),[j,k]=m.useState(!1),[S,C]=m.useState(null),[E,D]=m.useState(""),[T,P]=m.useState(!1);m.useEffect(()=>{Ct("/admin/api/hosts").then(B=>f(B.hosts||[])).catch(()=>{})},[]);const R=ln("metrics"),N=ni();m.useEffect(()=>{R&&Ct("/admin/api/metrics"+Pu({granularity:r,host:h.host})).then(c).catch(B=>n(De(B),!0))},[r,h.host,R]),m.useEffect(()=>{const B=window.setTimeout(()=>v(Z=>({...Z,repo:g.trim()})),300);return()=>window.clearTimeout(B)},[g]);const I=B=>Ct("/admin/api/reviews"+Pu({limit:100,...h,before:B})).then(Z=>{b(W=>B?(W||[]).concat(Z.reviews):Z.reviews),k(Z.reviews.length>=100)}).catch(Z=>n(De(Z),!0));m.useEffect(()=>{I()},[h]);const L=()=>{if(!E.trim())return n("Paste a pull request or merge request URL",!0);Fn("/admin/api/reviews",{url:E.trim(),full:T}).then(B=>{D(""),n("Queued "+B.pr+" — it appears here when it finishes")}).catch(B=>n(De(B),!0))},Q=(B,Z)=>Fn(`/admin/api/reviews/${B.id}/rerun`,{full:Z}).then(W=>n("Queued "+W.pr)).catch(W=>n(De(W),!0)),ee=l?k2(l):[],J={jobs:0,done:0,skipped:0,failed:0,comments:0,tokens_in:0,tokens_out:0,duration_ms:0};ee.forEach(B=>Object.keys(J).forEach(Z=>J[Z]+=B[Z]||0));const ne=J.done+J.failed,de=[["Jobs",Tt(J.jobs)],["Reviewed",Tt(J.done)],["Skipped",Tt(J.skipped)],["Failed",Tt(J.failed)+(ne?" · "+Math.round(100*J.failed/ne)+"%":"")],["Comments posted",Tt(J.comments)],["Tokens in / out",Tt(J.tokens_in)+" / "+Tt(J.tokens_out)],["Avg time",ig(ne?J.duration_ms/Math.max(1,J.jobs):0)],["Tokens today (UTC)",Tt((l==null?void 0:l.today_tokens)||0)+(l!=null&&l.daily_token_budget?" of "+Tt(l.daily_token_budget):"")]],re=B=>Z=>v({...h,[B]:Z.target.value}),ie=(x==null?void 0:x.find(B=>B.id===S))??null;return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(ro,{children:[R&&s.jsxs(He,{className:"w-auto","aria-label":"Period",value:r,onChange:B=>i(B.target.value),children:[s.jsx("option",{value:"hour",children:"Last 48 hours"}),s.jsx("option",{value:"day",children:"Last 30 days"}),s.jsx("option",{value:"month",children:"Last 12 months"})]}),s.jsx("span",{className:"flex-1"}),s.jsx(Me,{type:"url",className:"rn-url w-full sm:w-80",placeholder:"Paste a PR/MR URL to review it now","aria-label":"Pull request URL",value:E,onChange:B=>D(B.target.value),onKeyDown:B=>B.key==="Enter"&&L()}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(b2,{id:"rnFull",checked:T,onCheckedChange:B=>P(B===!0)}),s.jsx(Cy,{htmlFor:"rnFull",className:"text-sm font-normal text-muted-foreground",children:"Full"})]}),s.jsxs(ge,{onClick:L,children:[s.jsx(w1,{})," Review now"]})]}),!R&&s.jsxs(da,{feature:"metrics",children:["Totals, charts and token use, and history kept longer than ",N.free_retention_days," days, are part of the licensed console. Every review is listed below."]}),R&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"tiles grid grid-cols-2 gap-3 md:grid-cols-4",children:de.map(([B,Z])=>s.jsx(Vn,{className:"tile gap-1 py-4",children:s.jsxs(no,{className:"px-4",children:[s.jsx("div",{className:"text-xl font-semibold tabular-nums",children:Z}),s.jsx("div",{className:"text-xs text-muted-foreground",children:B})]})},B))}),s.jsx(Vn,{className:"py-4",children:s.jsxs(no,{className:"grid gap-3 px-4",children:[s.jsx("div",{className:"flex flex-wrap gap-4 text-xs text-muted-foreground",children:qu.map(([B,Z,W])=>s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"size-2.5 rounded-sm",ref:q=>q==null?void 0:q.style.setProperty("background",`var(${W})`)}),Z," ",Tt(J[B]||0)]},B))}),l&&s.jsx(w2,{points:ee,granularity:l.granularity})]})})]}),s.jsxs(ro,{children:[s.jsxs(He,{className:"w-auto","aria-label":"Host",value:h.host,onChange:re("host"),children:[s.jsx("option",{value:"",children:"All hosts"}),u.map(B=>s.jsx("option",{value:B.host,children:B.name},B.host))]}),s.jsxs("div",{className:"relative w-full sm:w-52",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Repository","aria-label":"Repository",value:g,onChange:B=>y(B.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"State",value:h.state,onChange:re("state"),children:[s.jsx("option",{value:"",children:"Any state"}),s.jsx("option",{value:"done",children:"Done"}),s.jsx("option",{value:"skipped",children:"Skipped"}),s.jsx("option",{value:"failed",children:"Failed"})]}),s.jsxs(He,{className:"w-auto","aria-label":"Kind",value:h.kind,onChange:re("kind"),children:[s.jsx("option",{value:"",children:"Any kind"}),s.jsx("option",{value:"review",children:"Review"}),s.jsx("option",{value:"full review",children:"Full review"}),s.jsx("option",{value:"answer",children:"Answer"}),s.jsx("option",{value:"help",children:"Help"}),s.jsx("option",{value:"learn",children:"Learn"}),s.jsx("option",{value:"remember",children:"Remember"})]}),s.jsxs(He,{className:"w-auto","aria-label":"Trigger",value:h.trigger,onChange:re("trigger"),children:[s.jsx("option",{value:"",children:"Any trigger"}),s.jsx("option",{value:"push",children:"Push"}),s.jsx("option",{value:"command",children:"Command"}),s.jsx("option",{value:"reply",children:"Reply"}),s.jsx("option",{value:"ui",children:"Admin panel"})]}),s.jsx(Me,{type:"date",className:"w-auto","aria-label":"From",value:h.from,onChange:re("from")}),s.jsx(Me,{type:"date",className:"w-auto","aria-label":"To",value:h.to,onChange:re("to")})]}),s.jsx(co,{children:x?x.length?s.jsxs(uo,{children:[s.jsx(fo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Finished"}),s.jsx(Se,{children:"Pull request"}),s.jsx(Se,{children:"Job"}),s.jsx(Se,{children:"State"}),s.jsx(Se,{className:"text-right",children:"Comments / files"}),s.jsx(Se,{className:"text-right",children:"Tokens in / out"}),s.jsx(Se,{className:"text-right",children:"Took"}),s.jsx(Se,{})]})}),s.jsx(po,{children:x.map(B=>{const Z=B.started&&!B.started.startsWith("0001-")?new Date(B.finished).getTime()-new Date(B.started).getTime():0;return s.jsxs(Mt,{className:"cursor-pointer",onClick:()=>C(B.id),children:[s.jsx(Ee,{className:"pl-4 text-muted-foreground",title:new Date(B.finished).toLocaleString(),children:oo(B.finished)}),s.jsxs(Ee,{children:[s.jsx("div",{className:"font-medium",children:B.url?s.jsxs("a",{className:"inline-flex items-center gap-1 hover:underline",href:B.url,target:"_blank",rel:"noopener noreferrer",onClick:W=>W.stopPropagation(),children:[B.repo," #",B.number," ",s.jsx(Og,{className:"size-3 text-muted-foreground"})]}):`${B.repo} #${B.number}`}),s.jsxs(Qe,{children:[B.platform," · ",B.host]})]}),s.jsxs(Ee,{children:[s.jsx("div",{children:B.kind}),s.jsx(Qe,{children:B.trigger+(B.requested_by?" · "+B.requested_by:"")})]}),s.jsxs(Ee,{className:"max-w-64 whitespace-normal",children:[s.jsx(yn,{kind:B.state==="done"?"on":B.state==="failed"?"off":"idle",children:B.state}),(B.error||B.note)&&s.jsx(Qe,{className:"line-clamp-2",children:B.error?B.error.slice(0,120):B.note})]}),s.jsxs(Ee,{className:"text-right tabular-nums",children:[B.comments," / ",B.files]}),s.jsxs(Ee,{className:"text-right text-muted-foreground tabular-nums",children:[Tt(B.tokens_in)," / ",Tt(B.tokens_out)]}),s.jsx(Ee,{className:"text-right text-muted-foreground tabular-nums",children:ig(Z)}),s.jsx(Ee,{className:"pr-4 text-right",children:s.jsx(ge,{variant:"ghost",size:"sm",onClick:W=>(W.stopPropagation(),C(B.id)),children:"Details"})})]},B.id)})})]}):s.jsx(bt,{children:"No reviews match."}):s.jsx(bt,{children:"Loading…"})}),j&&s.jsx("div",{children:s.jsx(ge,{variant:"outline",onClick:()=>x&&I(x[x.length-1].id),children:"Load older"})}),s.jsx(Jt,{children:"Every finished review, answer, help and learning job. Charts read hourly, daily and monthly rollups that are updated as each job finishes. Reviews are kept for the retention set in Settings; hourly detail for 3 days, daily and monthly totals for good."}),s.jsx(Qo,{wide:!0,open:!!ie,onClose:()=>C(null),title:ie?`${ie.repo} #${ie.number}`:"",description:ie?`${ie.kind} · ${ie.trigger} · ${ie.state} · ${oo(ie.finished)}`:void 0,children:ie&&s.jsx(C2,{job:ie,onRerun:B=>Q(ie,B)},ie.id)})]})}const E2={reply:"from a reply",command:"@bot remember",manual:"added here"};function _2({l:n,onSave:r,onCancel:i,onDelete:l}){const[c,u]=m.useState(n.scope),[f,h]=m.useState(n.path),[v,g]=m.useState(n.text);return s.jsxs("div",{className:"grid gap-4",children:[s.jsx(Ce,{label:"Applies to",children:s.jsx(Me,{value:c,placeholder:"empty = whole host · group · group/repo",onChange:y=>u(y.target.value)})}),s.jsx(Ce,{label:"Only files matching",children:s.jsx(Me,{value:f,placeholder:"optional glob",onChange:y=>h(y.target.value)})}),s.jsx(Ce,{label:"Learning",children:s.jsx(rs,{rows:5,maxLength:600,value:v,onChange:y=>g(y.target.value)})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{onClick:()=>r({scope:c.trim(),path:f.trim(),text:v.trim()}),children:"Save"}),s.jsx(ge,{variant:"outline",onClick:i,children:"Cancel"}),s.jsx("span",{className:"flex-1"}),s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:l,children:"Delete"})]})]})}function N2(){const n=St(),r=ti(),i=ln("learnings"),[l,c]=m.useState(null),[u,f]=m.useState(""),[h,v]=m.useState(""),[g,y]=m.useState(null),[x,b]=m.useState(!1),[j,k]=m.useState({platform:"gitlab",host:"",scope:"",path:"",text:""});m.useEffect(()=>{Ct("/admin/api/learnings").then(R=>c(R.learnings||[])).catch(R=>n(De(R),!0))},[]);const S=(R,N)=>io("/admin/api/learnings/"+R.id,{scope:R.scope,text:R.text,path:R.path,status:R.status,...N}).then(I=>(c(L=>(L||[]).map(Q=>Q.id===I.id?I:Q)),I)),C=()=>Fn("/admin/api/learnings",j).then(R=>{c(N=>(N||[]).concat([R])),k({...j,text:""}),b(!1),n("Learning added")}).catch(R=>n(De(R),!0)),E=async R=>{await r({title:"Delete this learning?",description:R.text,action:"Delete",danger:!0})&&Ji("/admin/api/learnings/"+R.id).then(()=>{c(N=>(N||[]).filter(I=>I.id!==R.id)),y(null),n("Deleted")}).catch(N=>n(De(N),!0))},D={active:0,pending:0,disabled:0};(l||[]).forEach(R=>D[R.status]+=1);const T=(l||[]).filter(R=>(!h||R.status===h)&&(!u||(R.text+" "+R.scope+" "+R.host+" "+R.path).toLowerCase().includes(u.toLowerCase()))),P=(l==null?void 0:l.find(R=>R.id===g))??null;return s.jsxs("section",{className:"grid gap-4",children:[!i&&s.jsxs(da,{feature:"learnings",children:["Capturing team decisions from review replies, ",s.jsx("code",{children:"@bot remember"}),", and applying them to reviews are part of the licensed console. Without a license nothing new is learned and existing learnings are not applied."]}),s.jsxs(ro,{children:[s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Search learnings","aria-label":"Search learnings",value:u,onChange:R=>f(R.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"Status",value:h,onChange:R=>v(R.target.value),children:[s.jsx("option",{value:"",children:"Any status"}),s.jsx("option",{value:"active",children:"Active"}),s.jsx("option",{value:"pending",children:"Waiting for approval"}),s.jsx("option",{value:"disabled",children:"Disabled"})]}),s.jsx("span",{className:"text-sm text-muted-foreground",children:l&&`${D.active} active · ${D.pending} waiting · ${D.disabled} disabled`}),s.jsx("span",{className:"flex-1"}),i&&s.jsxs(ge,{variant:"outline",onClick:()=>b(!0),children:[s.jsx(Xi,{})," Add learning"]})]}),s.jsx(co,{children:l?T.length?s.jsxs(uo,{children:[s.jsx(fo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Applies to"}),s.jsx(Se,{children:"Learning"}),s.jsx(Se,{children:"Status"}),s.jsx(Se,{children:"Source"}),s.jsx(Se,{})]})}),s.jsx(po,{children:T.map(R=>s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"pl-4 align-top",children:[s.jsx("div",{children:R.scope?s.jsx("code",{children:R.scope}):s.jsx("b",{children:"Whole host"})}),s.jsxs(Qe,{children:[R.platform," · ",R.host]})]}),s.jsxs(Ee,{className:"min-w-64 align-top whitespace-normal",children:[s.jsx("div",{children:R.text}),R.path&&s.jsxs(jn,{variant:"outline",className:"mt-1 font-normal text-muted-foreground",children:["files: ",R.path]})]}),s.jsx(Ee,{className:"w-36 align-top",children:s.jsxs(He,{"aria-label":"Status",value:R.status,disabled:!i,onChange:N=>S(R,{status:N.target.value}).then(I=>n("Learning "+I.status)).catch(I=>n(De(I),!0)),children:[s.jsx("option",{value:"active",children:"Active"}),s.jsx("option",{value:"pending",children:"Waiting"}),s.jsx("option",{value:"disabled",children:"Disabled"})]})}),s.jsxs(Ee,{className:"align-top text-muted-foreground",children:[s.jsx("div",{children:(E2[R.source]||R.source)+(R.source_author?" · "+R.source_author:"")}),R.source_url&&s.jsxs("a",{className:"inline-flex items-center gap-1 text-xs hover:text-foreground hover:underline",href:R.source_url,target:"_blank",rel:"noopener noreferrer",children:["open PR ",s.jsx(Og,{className:"size-3"})]}),s.jsx(Qe,{children:oo(R.updated_at)})]}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:i?s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>y(R.id),children:"Edit"}):s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>E(R),children:"Delete"})})]},R.id))})]}):s.jsx(bt,{children:l.length?"No learnings match.":"No learnings yet. Reply to one of the bot's comments with a team decision, or use @bot remember."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Learnings are team decisions from review discussions. When someone replies to one of the bot's comments, the bot reacts 👀, asks the model whether the reply states a rule for future reviews, and if so saves it here (✅ on GitLab, 🎉 on GitHub). ",s.jsx("code",{children:"@bot remember "})," saves one directly. Each starts scoped to its repository; widen ",s.jsx("b",{children:"Applies to"})," to a group or the whole host so one standard covers many repositories. Matching active learnings go with every review: the reviewer follows them and the verifier drops findings they rule out."]}),s.jsx(Qo,{open:!!P,onClose:()=>y(null),title:"Edit learning",description:P?`${P.platform} · ${P.host}`:void 0,children:P&&s.jsx(_2,{l:P,onCancel:()=>y(null),onDelete:()=>E(P),onSave:R=>S(P,R).then(()=>{y(null),n("Saved")}).catch(N=>n(De(N),!0))},P.id)}),s.jsx(Jd,{open:x,onOpenChange:b,children:s.jsxs(Zd,{className:"sm:max-w-xl",children:[s.jsxs(ef,{children:[s.jsx(nf,{children:"Add learning"}),s.jsx(rf,{children:"A rule future reviews should follow."})]}),s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{value:j.platform,onChange:R=>k({...j,platform:R.target.value}),children:[s.jsx("option",{value:"gitlab",children:"GitLab"}),s.jsx("option",{value:"github",children:"GitHub"}),s.jsx("option",{value:"bitbucket",children:"Bitbucket"})]})}),s.jsx(Ce,{label:"Host",children:s.jsx(Me,{placeholder:"gitlab.example.com",value:j.host,onChange:R=>k({...j,host:R.target.value})})}),s.jsx(Ce,{label:"Applies to",children:s.jsx(Me,{placeholder:"empty = whole host · group · group/repo",value:j.scope,onChange:R=>k({...j,scope:R.target.value})})}),s.jsx(Ce,{label:"Only files matching",children:s.jsx(Me,{placeholder:"optional glob, e.g. api/legacy/**",value:j.path,onChange:R=>k({...j,path:R.target.value})})})]}),s.jsx(Ce,{label:"Learning",children:s.jsx(rs,{rows:4,maxLength:600,placeholder:"e.g. Account numbers are compared without leading zeros on purpose.",value:j.text,onChange:R=>k({...j,text:R.target.value})})}),s.jsxs(tf,{children:[s.jsx(ge,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),s.jsx(ge,{onClick:C,children:"Add learning"})]})]})})]})}const Xu={github:"GitHub",gitlab:"GitLab",bitbucket:"Bitbucket"},R2={github:"https://api.github.com",gitlab:"https://gitlab.com",bitbucket:"https://api.bitbucket.org/2.0"},Cl=n=>n.split(` +`).map(r=>r.trim()).filter(Boolean);function kr({label:n,set:r,multi:i,list:l,help:c,value:u,onChange:f}){const h=r?"Set ✓ — leave blank to keep":l?"one per line":"";return s.jsx(Ce,{label:n+(c?" — "+c:""),children:i?s.jsx(rs,{rows:3,className:"font-mono text-xs",placeholder:h,autoComplete:"off",spellCheck:!1,value:u,onChange:v=>f(v.target.value)}):s.jsx(Me,{type:"password",placeholder:h,autoComplete:"new-password",value:u,onChange:v=>f(v.target.value)})})}function of({text:n,label:r="Copy"}){const i=St(),[l,c]=m.useState(!1),u=()=>navigator.clipboard.writeText(n).then(()=>{c(!0),setTimeout(()=>c(!1),1500)}).catch(()=>i("Copy failed: select the text and copy it",!0));return s.jsxs(ge,{variant:"ghost",size:"sm",onClick:u,"aria-label":r,children:[l?s.jsx(Ql,{}):s.jsx(f1,{})," ",r]})}function Ly({secret:n,platform:r,onDone:i}){const l=r==="gitlab"?"GitLab's Secret token field":"the webhook's Secret field";return s.jsxs("div",{className:"grid gap-2 rounded-lg border border-warning/40 bg-warning-soft p-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"Copy the secret now: it is not shown again."}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs",children:n}),s.jsx(of,{text:n})]}),s.jsxs(Qe,{children:["Paste it into ",l,", together with the URL."]}),s.jsx("div",{children:s.jsx(ge,{size:"sm",variant:"outline",onClick:i,children:"I've copied it"})})]})}function P2({hook:n,platform:r,onChanged:i}){const l=St(),c=ti(),[u,f]=m.useState(""),[h,v]=m.useState(n.name),[g,y]=m.useState(""),x=(k,S)=>io("/admin/api/webhooks/"+n.id,k).then(C=>{l(S),C.secret&&f(C.secret),i()}).catch(C=>l(De(C),!0)),b=async()=>{await c({title:"Replace the secret of "+n.name+"?",description:"Deliveries signed with the old secret are rejected until you paste the new one into the code host.",action:"Replace secret",danger:!0})&&x({regenerate_secret:!0},"New secret for "+n.name)},j=async()=>{await c({title:"Delete "+n.name+"?",description:"Its URL stops working at once. Remove the webhook from the code host too.",action:"Delete webhook",danger:!0})&&Ji("/admin/api/webhooks/"+n.id).then(()=>{l("Deleted "+n.name),i()}).catch(k=>l(De(k),!0))};return s.jsxs("div",{className:"grid gap-3 rounded-lg border p-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Me,{className:"h-8 max-w-64",value:h,onChange:k=>v(k.target.value),onBlur:()=>h.trim()!==n.name&&x({name:h},"Renamed")}),s.jsx(yn,{kind:n.enabled?"on":"idle",children:n.enabled?"Enabled":"Disabled"}),r==="gitlab"&&n.secrets.signing_tokens>0&&s.jsx(jn,{variant:"outline",className:"font-normal text-muted-foreground",children:"signing token ✓"}),s.jsx("span",{className:"flex-1"}),s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>x({enabled:!n.enabled},n.enabled?"Disabled "+n.name:"Enabled "+n.name),children:n.enabled?"Disable":"Enable"}),s.jsx(ge,{variant:"ghost",size:"sm",onClick:b,children:"New secret"}),s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:j,children:"Delete"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"hosturl min-w-0 flex-1 break-all",children:n.url}),s.jsx(of,{text:n.url,label:"Copy URL"})]}),u&&s.jsx(Ly,{secret:u,platform:r,onDone:()=>f("")}),r==="gitlab"&&s.jsx(Ce,{label:"Signing token (whsec_…) — GitLab 19.0+, "+(n.secrets.signing_tokens?"set ✓, paste to replace":"optional: copy it from the webhook in GitLab"),children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Me,{type:"password",autoComplete:"off",value:g,placeholder:n.secrets.signing_tokens?"Set ✓":"",onChange:k=>y(k.target.value)}),s.jsx(ge,{variant:"outline",size:"sm",disabled:!g.trim(),onClick:()=>x({signing_tokens:[g.trim()]},"Saved signing token").then(()=>y("")),children:"Save"}),n.secrets.signing_tokens>0&&s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>x({signing_tokens:[]},"Removed signing token"),children:"Remove"})]})}),s.jsxs(Qe,{children:["Added ",new Date(n.created_at).toLocaleDateString(),n.created_by?" by "+n.created_by:""]})]})}function D2({text:n}){return s.jsx("div",{role:"status",className:"rounded-lg border border-warning/40 bg-warning-soft p-3 text-sm text-warning",children:n})}function T2({host:n,managed:r,onChanged:i}){const l=St(),[c,u]=m.useState(""),[f,h]=m.useState(null),v=()=>Fn(`/admin/api/hosts/${n.id}/webhooks`,{name:c.trim()}).then(y=>{u(""),h({id:y.webhook.id,secret:y.secret}),l("Added "+y.webhook.name),i()}).catch(y=>l(De(y),!0)),g=n.secrets.webhook_secrets>0||n.secrets.signing_tokens>0;return s.jsxs("div",{className:"grid gap-6",children:[n.comment_warning&&s.jsx(D2,{text:n.comment_warning}),r&&s.jsxs(Xr,{title:"Add a webhook",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Me,{className:"max-w-80",value:c,placeholder:n.platform==="gitlab"?"e.g. the group it's for":"e.g. where it's set up",onChange:y=>u(y.target.value)}),s.jsxs(ge,{onClick:v,children:[s.jsx(Xi,{})," Add webhook"]})]}),s.jsxs(Qe,{children:["The console generates a URL and a secret. Set the code host's webhook to them, with these events: ",n.events.join(", "),".",n.platform==="gitlab"&&" A system hook alone isn't enough: it doesn't send comments, so @bot commands need a group or project webhook with Comments."]})]}),s.jsx(Xr,{title:`Webhooks (${n.webhooks.length})`,children:n.webhooks.length?n.webhooks.map(y=>s.jsxs("div",{className:"grid gap-2",children:[(f==null?void 0:f.id)===y.id&&s.jsx(Ly,{secret:f.secret,platform:n.platform,onDone:()=>h(null)}),s.jsx(P2,{hook:y,platform:n.platform,onChanged:i})]},y.id)):s.jsxs(Qe,{children:["No webhooks yet",r?": add one above.":"."]})}),s.jsx(Zr,{}),s.jsxs(Xr,{title:"Shared URL",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("code",{className:"hosturl min-w-0 flex-1 break-all",children:n.webhook_url}),s.jsx(of,{text:n.webhook_url,label:"Copy URL"})]}),s.jsx(Qe,{children:g?"Still accepted for existing hooks. It is shared by every "+Xu[n.platform]+" host and checked with the secrets in the host's settings. Move hooks to their own URL above when you can.":"Shared by every "+Xu[n.platform]+" host. This host has no secrets of its own for it, so only the webhooks above work."})]})]})}function Xr({title:n,children:r}){return s.jsxs("div",{className:"grid gap-3",children:[s.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:n}),r]})}function O2({host:n,onSaved:r,onCancel:i}){const l=St(),c=ln("hosts"),u=(n==null?void 0:n.settings)??{},f=(n==null?void 0:n.secrets)??{token:!1,app_private_key:!1,api_token:!1,webhook_secrets:0,signing_tokens:0},[h,v]=m.useState((n==null?void 0:n.platform)??"gitlab"),[g,y]=m.useState({base:(n==null?void 0:n.base_url)??"",name:(n==null?void 0:n.name)??"",enabled:n?n.enabled:!0,token:"",appID:u.app_id?String(u.app_id):"",appKey:"",email:u.email??"",apiToken:"",secrets:"",signing:"",reqSig:!!u.require_signature,skipTLS:!!u.skip_tls_verify,bot:u.bot_name??"",reviewer:u.reviewer??""}),x=j=>k=>y({...g,[j]:typeof k=="object"&&(k!=null&&k.target)?k.target.value:k}),b=()=>{const j={platform:h,base_url:g.base.trim(),name:g.name.trim(),enabled:g.enabled,settings:{bot_name:g.bot.trim(),reviewer:g.reviewer.trim()}};h==="github"&&(j.settings.app_id=parseInt(g.appID||"0",10)),h==="gitlab"&&Object.assign(j.settings,{skip_tls_verify:g.skipTLS,require_signature:g.reqSig}),h==="bitbucket"&&(j.settings.email=g.email.trim()),g.token.trim()&&(j.token=g.token.trim()),g.appKey.trim()&&(j.app_private_key=g.appKey),g.apiToken.trim()&&(j.api_token=g.apiToken.trim()),Cl(g.secrets).length&&(j.webhook_secrets=Cl(g.secrets)),Cl(g.signing).length&&(j.signing_tokens=Cl(g.signing)),(n?io("/admin/api/hosts/"+n.id,j):Fn("/admin/api/hosts",j)).then(k=>{l("Saved "+k.name),r(k)}).catch(k=>l(De(k),!0))};return s.jsxs("div",{className:"grid gap-6",children:[s.jsx(Xr,{title:"Host",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{id:"hPlat",value:h,disabled:!!n,onChange:j=>v(j.target.value),children:[s.jsx("option",{value:"gitlab",children:"GitLab"}),s.jsx("option",{value:"github",children:"GitHub"}),s.jsx("option",{value:"bitbucket",children:"Bitbucket Cloud"})]})}),s.jsx(Ce,{label:"Status",children:s.jsxs(He,{value:String(g.enabled),onChange:j=>y({...g,enabled:j.target.value==="true"}),children:[s.jsx("option",{value:"true",children:"Enabled"}),s.jsx("option",{value:"false",children:"Disabled"})]})}),s.jsx(Ce,{label:h==="gitlab"?"Instance URL":"API URL",children:s.jsx(Me,{value:g.base,placeholder:R2[h],onChange:x("base")})}),s.jsx(Ce,{label:"Name",children:s.jsx(Me,{value:g.name,placeholder:"shown in the console",onChange:x("name")})})]})}),s.jsx(Zr,{}),s.jsx(Xr,{title:"API access",children:s.jsxs("div",{className:"grid gap-4",children:[h==="github"&&s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Token",help:"or use a GitHub App below",set:f.token,value:g.token,onChange:x("token")}),s.jsx(Ce,{label:"GitHub App ID",children:s.jsx(Me,{type:"number",value:g.appID,onChange:x("appID")})}),s.jsx(kr,{label:"GitHub App private key (PEM)",set:f.app_private_key,multi:!0,value:g.appKey,onChange:x("appKey")})]}),h==="gitlab"&&s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Access token (api scope)",set:f.token,value:g.token,onChange:x("token")}),s.jsx(Ce,{label:"TLS",children:s.jsxs(He,{value:String(g.skipTLS),onChange:j=>y({...g,skipTLS:j.target.value==="true"}),children:[s.jsx("option",{value:"false",children:"Verify certificates"}),s.jsx("option",{value:"true",children:"Skip verification (self-signed)"})]})})]}),h==="bitbucket"&&s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Access token",help:"repository or workspace token",set:f.token,value:g.token,onChange:x("token")}),s.jsx(Ce,{label:"Account email",children:s.jsx(Me,{value:g.email,placeholder:"with an API token instead",onChange:x("email")})}),s.jsx(kr,{label:"Atlassian API token",set:f.api_token,value:g.apiToken,onChange:x("apiToken")})]})]})}),s.jsx(Zr,{}),s.jsxs(Xr,{title:"Shared URL secrets (optional)",children:[s.jsxs(Qe,{children:["Only for hooks on the shared ","/webhooks/"+h," URL. Webhooks added under Webhooks have their own URL and secret."]}),s.jsx("div",{className:"grid gap-4",children:h==="gitlab"?s.jsxs(s.Fragment,{children:[s.jsx(kr,{label:"Signing tokens (whsec_…)",multi:!0,list:!0,set:f.signing_tokens>0,help:f.signing_tokens?f.signing_tokens+" set":"GitLab 19.0+, recommended",value:g.signing,onChange:x("signing")}),s.jsx(kr,{label:"Secret tokens",multi:!0,list:!0,set:f.webhook_secrets>0,help:f.webhook_secrets?f.webhook_secrets+" set":"older hooks",value:g.secrets,onChange:x("secrets")}),s.jsx(Ce,{label:"Unsigned webhooks",children:s.jsxs(He,{value:String(g.reqSig),onChange:j=>y({...g,reqSig:j.target.value==="true"}),children:[s.jsx("option",{value:"false",children:"Accept with a secret token"}),s.jsx("option",{value:"true",children:"Reject"})]})})]}):s.jsx(kr,{label:"Webhook secrets",multi:!0,list:!0,set:f.webhook_secrets>0,help:f.webhook_secrets?f.webhook_secrets+" set":"one per hook",value:g.secrets,onChange:x("secrets")})})]}),s.jsx(Zr,{}),s.jsx(Xr,{title:"Bot identity",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Mention name",hint:s.jsx(Tl,{feature:"hosts"}),children:s.jsx(Me,{value:g.bot,placeholder:"default: the token's user",disabled:!c&&!g.bot,onChange:x("bot")})}),s.jsx(Ce,{label:"Reviewer username",children:s.jsx(Me,{value:g.reviewer,placeholder:"default: the token's user",disabled:!c&&!g.reviewer,onChange:x("reviewer")})})]})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{onClick:b,children:n?"Save host":"Add host"}),s.jsx(ge,{variant:"outline",onClick:i,children:"Cancel"})]})]})}function M2(){const n=St(),r=ti(),i=ln("hosts"),[l,c]=m.useState(null),[u,f]=m.useState(null),[h,v]=m.useState(null),[g,y]=m.useState({}),x=()=>Ct("/admin/api/hosts").then(c).catch(E=>n(De(E),!0));m.useEffect(()=>{x()},[]);const b=E=>{y(D=>({...D,[E.id]:{pending:!0}})),Fn(`/admin/api/hosts/${E.id}/test`).then(D=>y(T=>({...T,[E.id]:D}))).catch(D=>y(T=>({...T,[E.id]:{ok:!1,message:De(D)}})))},j=async E=>{await r({title:"Delete "+E.name+"?",description:"Webhooks from it will be rejected and its stored tokens removed.",action:"Delete host",danger:!0})&&Ji("/admin/api/hosts/"+E.id).then(()=>{n("Deleted "+E.name),x()}).catch(D=>n(De(D),!0))},k=(l==null?void 0:l.mode)==="database",S=u?(l==null?void 0:l.hosts.find(E=>E.id===u))??null:null,C=h?(l==null?void 0:l.hosts.find(E=>E.id===h))??null:null;return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(ro,{children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[l&&(k?"Managed here; stored encrypted in the database.":`Hosts come from the config file (read-only). Set ${l.key_env||"CODEREVIEW_CONSOLE_SECRET_KEY"} to manage them here.`),l&&!i&&" Free: one host per platform."]}),s.jsx("span",{className:"flex-1"}),k&&s.jsxs(ge,{variant:"outline",onClick:()=>f(0),children:[s.jsx(Xi,{})," Add host"]})]}),s.jsx(co,{children:l?l.hosts.length?s.jsxs(uo,{children:[s.jsx(fo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Host"}),s.jsx(Se,{children:"Credentials"}),s.jsx(Se,{children:"Webhooks"}),s.jsx(Se,{children:"Check"}),s.jsx(Se,{})]})}),s.jsx(po,{children:l.hosts.map(E=>{const D=E.secrets,T=[D.token&&"token ✓",E.settings.app_id&&`App ${E.settings.app_id}${D.app_private_key?" ✓":" (no key)"}`,D.api_token&&"API token ✓",D.signing_tokens&&`${D.signing_tokens} signing token${D.signing_tokens>1?"s":""}`,D.webhook_secrets&&`${D.webhook_secrets} webhook secret${D.webhook_secrets>1?"s":""}`].filter(Boolean),P=g[E.id];return s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"pl-4 align-top",children:[s.jsx("div",{className:"font-medium",children:E.name}),s.jsxs(Qe,{children:[Xu[E.platform]," · ",E.host]}),s.jsx("div",{className:"mt-1.5",children:E.licensed?s.jsx(yn,{kind:E.enabled?"on":"idle",children:E.enabled?"Enabled":"Disabled"}):s.jsx(yn,{kind:"warn",children:"Inactive: needs a license"})})]}),s.jsxs(Ee,{className:"align-top whitespace-normal",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:T.map(R=>s.jsx(jn,{variant:"outline",className:"font-normal text-muted-foreground",children:R},R))}),s.jsxs(Qe,{children:["mention: ",E.settings.bot_name?"@"+E.settings.bot_name:"token user",E.settings.reviewer?" · reviewer: "+E.settings.reviewer:""]})]}),s.jsxs(Ee,{className:"max-w-80 align-top whitespace-normal",children:[E.webhooks.length?s.jsx("div",{className:"grid gap-0.5 text-sm",children:E.webhooks.map(R=>s.jsx("div",{className:R.enabled?"":"text-muted-foreground line-through",children:R.name},R.id))}):s.jsx(Qe,{children:E.secrets.webhook_secrets||E.secrets.signing_tokens?"Shared URL only":"None yet"}),E.comment_warning&&s.jsx("div",{className:"mt-1.5",children:s.jsx(yn,{kind:"warn",children:"No comment events"})}),s.jsxs(ge,{variant:"link",size:"sm",className:"h-auto px-0",onClick:()=>v(E.id),children:[s.jsx(iv,{})," ",k?"Manage webhooks":"Show URLs"]})]}),s.jsx(Ee,{className:"max-w-56 align-top whitespace-normal",children:P&&(P.pending?s.jsx("span",{className:"text-sm text-muted-foreground",children:"testing…"}):s.jsx(yn,{kind:P.ok?"on":"off",children:P.message}))}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsxs(ge,{variant:"ghost",size:"sm",onClick:()=>b(E),children:[s.jsx(b1,{})," Test"]}),k&&s.jsxs(s.Fragment,{children:[s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>f(E.id),children:"Edit"}),s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>j(E),children:"Delete"})]})]})})]},E.id)})})]}):s.jsx(bt,{children:"No code hosts yet. Add GitHub, GitLab or Bitbucket."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Each host is a GitHub (github.com or Enterprise), GitLab (gitlab.com or self-managed) or Bitbucket Cloud account the console reviews for. Tokens and webhook secrets are encrypted with ",s.jsx("code",{children:"CODEREVIEW_CONSOLE_SECRET_KEY"})," before they are stored and are never shown again: leave a secret blank to keep it. Under ",s.jsx("b",{children:"Manage webhooks"}),", add one webhook per hook you set up (a GitLab system hook, each group hook): each gets its own URL and secret, so one can be replaced or removed without touching the others."]}),s.jsx(Qo,{open:C!==null,onClose:()=>v(null),title:C?"Webhooks: "+C.name:"",description:"Each webhook has its own URL and secret.",wide:!0,children:C&&s.jsx(T2,{host:C,managed:k,onChanged:x},C.id)}),s.jsx(Qo,{open:u!==null,onClose:()=>f(null),title:S?"Edit "+S.name:"New host",description:"Credentials are encrypted before they are stored.",children:u!==null&&s.jsx(O2,{host:S,onCancel:()=>f(null),onSaved:E=>{f(null),x().then(()=>b(E))}},u)})]})}const Ju=[["enabled","Reviews","Enabled","Disabled"],["require_reviewer","Reviewer required","On","Off"],["skip_branch_sync","Branch syncs","Skip","Review"],["score_labels","Score labels","On","Off"],["commit_status","Commit status","On","Off"]],Vi=n=>n.pattern||"Whole host";function A2({rule:n,onSave:r,onDelete:i}){const[l,c]=m.useState(()=>Object.fromEntries(Ju.map(([u])=>[u,n[u]??null])));return s.jsx(Xd,{value:n.settings,inheritModel:"Inherit",onSave:u=>r({...l,settings:u}),danger:s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:i,children:"Delete rule"}),extra:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3",children:[s.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Settings for this level"}),s.jsx(Xt,{className:"lg:grid-cols-2",children:Ju.map(([u,f,h,v])=>s.jsx(Ce,{label:f,children:s.jsx(Vl,{value:l[u],on:h,off:v,onChange:g=>c({...l,[u]:g})})},u))})]}),s.jsx(Zr,{}),s.jsx("h3",{className:"text-xs font-semibold tracking-wide text-muted-foreground uppercase",children:"Review settings"})]})})}function I2(){const n=St(),r=ti(),i=ln("rules"),[l,c]=m.useState(null),[u,f]=m.useState([]),[h,v]=m.useState(null),[g,y]=m.useState(!1),[x,b]=m.useState({platform:"gitlab",host:"",pattern:"",enabled:null}),j=()=>Ct("/admin/api/repos").then(P=>f(P||[]));m.useEffect(()=>{Ct("/admin/api/rules").then(P=>c(P||[])).catch(P=>n(De(P),!0)),j().catch(()=>{})},[]);const k=P=>{const R=P.pattern?P.pattern:"host "+P.host;return u.filter(N=>(N.effective.rules||[]).includes(R)&&N.platform===P.platform&&N.host===P.host).length},S=()=>{const P={platform:x.platform,host:x.host.trim(),pattern:x.pattern.trim()};x.enabled!==null&&(P.enabled=x.enabled),Fn("/admin/api/rules",P).then(R=>(c(N=>(N||[]).filter(I=>I.id!==R.id).concat([R])),b({...x,pattern:""}),y(!1),v(R.id),n("Saved rule "+Vi(R)+" — set its options"),j())).catch(R=>n(De(R),!0))},C=(P,R)=>io("/admin/api/rules/"+P.id,R).then(N=>(c(I=>(I||[]).map(L=>L.id===N.id?N:L)),v(null),n("Saved "+Vi(N)),j())).catch(N=>n(De(N),!0)),E=async P=>{await r({title:"Delete the rule for "+Vi(P)+"?",description:"On "+P.host+". Repositories fall back to the level above.",action:"Delete rule",danger:!0})&&Ji("/admin/api/rules/"+P.id).then(()=>(c(R=>(R||[]).filter(N=>N.id!==P.id)),v(null),n("Deleted rule "+Vi(P)),j())).catch(R=>n(De(R),!0))},D=(l||[]).slice().sort((P,R)=>(P.platform+P.host).localeCompare(R.platform+R.host)||(P.pattern?1:0)-(R.pattern?1:0)||P.pattern.localeCompare(R.pattern)),T=(l==null?void 0:l.find(P=>P.id===h))??null;return s.jsxs("section",{className:"grid gap-4",children:[!i&&s.jsx(da,{feature:"rules",children:"Settings for a whole host, a group or a name pattern are part of the licensed console. Without a license, repositories follow the global settings and their own mode; any rules below are kept but ignored."}),s.jsxs(ro,{children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Settings for a whole host, or for a group, organisation or name pattern on a host."}),s.jsx("span",{className:"flex-1"}),i&&s.jsxs(ge,{variant:"outline",onClick:()=>y(!0),children:[s.jsx(Xi,{})," Add rule"]})]}),s.jsx(co,{children:l?l.length?s.jsxs(uo,{children:[s.jsx(fo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"Scope"}),s.jsx(Se,{children:"Sets"}),s.jsx(Se,{children:"Covers"}),s.jsx(Se,{children:"Last changed"}),s.jsx(Se,{})]})}),s.jsx(po,{children:D.map(P=>{const R=k(P),N=Ju.filter(([I])=>P[I]!==null&&P[I]!==void 0).map(([I,L,Q,ee])=>L+": "+(P[I]?Q:ee));return s.jsxs(Mt,{children:[s.jsxs(Ee,{className:"pl-4 align-top",children:[s.jsx("div",{children:P.pattern?s.jsx("code",{children:P.pattern}):s.jsx("b",{children:"Whole host"})}),s.jsxs(Qe,{children:[P.platform," · ",P.host]})]}),s.jsxs(Ee,{className:"align-top whitespace-normal",children:[s.jsx(Yu,{items:N,empty:"inherits everything"}),s.jsx("div",{className:"mt-1",children:s.jsx(Yu,{items:My(P.settings)})})]}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:R+(R===1?" known repository":" known repositories")}),s.jsx(Ee,{className:"align-top text-muted-foreground",children:P.updated_by?P.updated_by+" · "+oo(P.updated_at):"—"}),s.jsx(Ee,{className:"pr-4 text-right align-top",children:i?s.jsx(ge,{variant:"ghost",size:"sm",onClick:()=>v(P.id),children:"Edit"}):s.jsx(ge,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>E(P),children:"Delete"})})]},P.id)})})]}):s.jsx(bt,{children:"No rules yet. Add one for a whole host, a group or a name pattern."}):s.jsx(bt,{children:"Loading…"})}),s.jsxs(Jt,{children:["Levels, broadest first: ",s.jsx("b",{children:"Settings"})," (everything) → ",s.jsx("b",{children:"whole host"})," (empty pattern) → ",s.jsx("b",{children:"group or owner"})," (",s.jsx("code",{children:"acme"}),", ",s.jsx("code",{children:"acme/platform"}),", subgroups included) or ",s.jsx("b",{children:"pattern"})," (",s.jsx("code",{children:"acme/svc-*"}),"; ",s.jsx("code",{children:"*"})," stays within one level) → ",s.jsx("b",{children:"repository"}),". For each setting the most specific level that sets it wins; ",s.jsx("b",{children:"Inherit"}),' means "use the level above". Review settings add up the same way. Hosts are separate: a rule for ',s.jsx("code",{children:"acme"})," on one host never touches ",s.jsx("code",{children:"acme"})," on another."]}),s.jsx(Qo,{open:!!T,onClose:()=>v(null),title:T?Vi(T):"",description:T?`${T.platform} · ${T.host}`:void 0,children:T&&s.jsx(A2,{rule:T,onSave:P=>C(T,P),onDelete:()=>E(T)},T.id)}),s.jsx(Jd,{open:g,onOpenChange:y,children:s.jsxs(Zd,{className:"sm:max-w-lg",children:[s.jsxs(ef,{children:[s.jsx(nf,{children:"Add rule"}),s.jsx(rf,{children:"After adding it, set its options."})]}),s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Ce,{label:"Platform",children:s.jsxs(He,{value:x.platform,onChange:P=>b({...x,platform:P.target.value}),children:[s.jsx("option",{value:"gitlab",children:"GitLab"}),s.jsx("option",{value:"github",children:"GitHub"})]})}),s.jsx(Ce,{label:"Host",children:s.jsx(Me,{placeholder:"gitlab.com",value:x.host,onChange:P=>b({...x,host:P.target.value})})}),s.jsx(Ce,{label:"Group, owner or pattern",className:"sm:col-span-2",children:s.jsx(Me,{placeholder:"empty = whole host · acme · acme/svc-*",value:x.pattern,onChange:P=>b({...x,pattern:P.target.value})})}),s.jsx(Ce,{label:"Reviews",children:s.jsx(Vl,{value:x.enabled,on:"Enabled",off:"Disabled",onChange:P=>b({...x,enabled:P})})})]}),s.jsxs(tf,{children:[s.jsx(ge,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),s.jsx(ge,{onClick:S,children:"Add rule"})]})]})})]})}const ag=["queued","ignored","duplicate","rejected","error"],L2=n=>({queued:"on",rejected:"off",error:"off"})[n]||"idle";function z2(){const n=St(),[r,i]=m.useState(null),[l,c]=m.useState({}),[u,f]=m.useState(!1),[h,v]=m.useState(""),[g,y]=m.useState(""),[x,b]=m.useState({});m.useEffect(()=>{Ct("/admin/api/hosts").then(k=>b(Object.fromEntries(k.hosts.flatMap(S=>(S.webhooks||[]).map(C=>[C.id,C.name]))))).catch(()=>{})},[]);const j=k=>{const S=k&&(r!=null&&r.length)?r[r.length-1].id:void 0;Ct("/admin/api/webhooks"+Pu({limit:100,project:h.trim(),outcome:g,before:S})).then(C=>{i(E=>k?(E||[]).concat(C.events):C.events),c(C.counts_24h||{}),f(C.events.length>=100)}).catch(C=>n(De(C),!0))};return m.useEffect(()=>{const k=window.setTimeout(()=>j(),h?250:0);return()=>window.clearTimeout(k)},[h,g]),s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(ro,{children:[s.jsxs("div",{className:"relative w-full sm:w-64",children:[s.jsx(Yl,{className:"pointer-events-none absolute top-2.5 left-2.5 size-4 text-muted-foreground"}),s.jsx(Me,{type:"search",className:"pl-8",placeholder:"Filter by project","aria-label":"Filter webhooks by project",value:h,onChange:k=>v(k.target.value)})]}),s.jsxs(He,{className:"w-auto","aria-label":"Outcome",value:g,onChange:k=>y(k.target.value),children:[s.jsx("option",{value:"",children:"All outcomes"}),ag.map(k=>s.jsx("option",{value:k,children:k[0].toUpperCase()+k.slice(1)},k))]}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:["Last 24 h: ",ag.map(k=>(l[k]||0)+" "+k).join(" · ")]}),s.jsx("span",{className:"flex-1"}),s.jsxs(ge,{variant:"outline",onClick:()=>j(),children:[s.jsx(Yg,{})," Refresh"]})]}),s.jsx(co,{children:r?r.length?s.jsxs(uo,{children:[s.jsx(fo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"When"}),s.jsx(Se,{children:"Project"}),s.jsx(Se,{children:"Event"}),s.jsx(Se,{children:"Outcome"}),s.jsx(Se,{children:"Reason"}),s.jsx(Se,{className:"pr-4",children:"Via"})]})}),s.jsx(po,{children:r.map(k=>{const S=[k.kind||k.event,k.action].filter(Boolean).join(" · ")+(k.number?" · !"+k.number:"");return s.jsxs(Mt,{children:[s.jsx(Ee,{className:"pl-4 align-top text-muted-foreground",title:new Date(k.received_at).toLocaleString(),children:oo(k.received_at)}),s.jsxs(Ee,{className:"align-top",children:[s.jsx("div",{className:"font-medium",children:k.project||"—"}),s.jsx(Qe,{children:k.platform+(k.host?" · "+k.host:"")})]}),s.jsxs(Ee,{className:"align-top",children:[s.jsx("div",{children:S||"—"}),s.jsx(Qe,{children:k.event+(k.sender?" · by "+k.sender:"")})]}),s.jsx(Ee,{className:"align-top",children:s.jsx(yn,{kind:L2(k.outcome),children:k.outcome})}),s.jsx(Ee,{className:"reason min-w-64 align-top text-sm whitespace-normal text-muted-foreground",children:k.reason}),s.jsxs(Ee,{className:"pr-4 align-top text-muted-foreground",children:[s.jsx("div",{children:k.endpoint?x[k.endpoint]||"unknown webhook":"shared URL"}),s.jsx(Qe,{children:k.auth})]})]},k.id)})})]}):s.jsx(bt,{children:"No webhook deliveries match."}):s.jsx(bt,{children:"Loading…"})}),u&&s.jsx("div",{children:s.jsx(ge,{variant:"outline",onClick:()=>j(!0),children:"Load older"})}),s.jsxs(Jt,{children:["Every webhook delivery and what the console did with it. ",s.jsx("b",{children:"Ignored"})," is normal for events that should not start a review (approvals, label or reviewer changes, edits without new commits) and for repositories that are not enabled. ",s.jsx("b",{children:"Rejected"})," means the signature or token did not match. History is kept for the days set in Settings (14 by default)."]})]})}function Mn({label:n,value:r,onChange:i,yes:l,no:c,disabled:u,note:f}){return s.jsx(Ce,{label:n,hint:f,children:s.jsxs(He,{value:String(r),disabled:u,onChange:h=>i(h.target.value==="true"),children:[s.jsx("option",{value:"true",children:l}),s.jsx("option",{value:"false",children:c})]})})}function Sl({label:n,value:r,onChange:i,note:l,...c}){return s.jsx(Ce,{label:n,hint:l,children:s.jsx(Me,{type:"number",value:r||"",...c,onChange:u=>i(parseInt(u.target.value||"0",10))})})}function Uo({title:n,description:r,children:i}){return s.jsxs(Vn,{children:[s.jsxs(Bl,{children:[s.jsx(Qd,{className:"h2",children:n}),r&&s.jsx(Yd,{children:r})]}),s.jsx(no,{children:i})]})}function F2(){const n=St(),r=qd(),i=ni(),l={learnings:ln("learnings"),budgets:ln("budgets"),sync:ln("branch_sync"),metrics:ln("metrics")},[c,u]=m.useState(null),[f,h]=m.useState(null),[v,g]=m.useState(""),[y,x]=m.useState(0),b=C=>{u(C),h(C),g((C.sync_source_branches||[]).join(", "))};if(m.useEffect(()=>{Ct("/admin/api/settings").then(b).catch(C=>n(De(C),!0))},[]),!c||!f)return s.jsx(bt,{children:"Loading…"});const j=C=>E=>h({...f,[C]:E}),k=C=>{const{source:E,...D}={...f,review_defaults:C,dashboard_title:f.dashboard_title.trim(),sync_source_branches:v.split(",").map(T=>T.trim()).filter(Boolean)};io("/admin/api/settings",D).then(T=>{b(T),x(P=>P+1),r(),n("Settings saved")}).catch(T=>n(De(T),!0))},S=Object.keys(c.source||{}).filter(C=>c.source[C]==="config");return s.jsxs("section",{className:"grid gap-4",children:[s.jsx(Uo,{title:"Repository access",description:"Which repositories are reviewed, and when.",children:s.jsxs(Xt,{children:[s.jsx(Mn,{label:"Repositories no rule matches",value:f.allowlist,onChange:j("allowlist"),yes:"Not reviewed (allowlist on)",no:"Reviewed (allowlist off)"}),s.jsx(Mn,{label:"Who asks for a review",value:f.require_reviewer,onChange:j("require_reviewer"),yes:"Only when the bot is a reviewer",no:"Any opened MR or push"}),s.jsx(Mn,{label:"Branch syncs (source is the default branch)",value:f.skip_branch_sync,onChange:j("skip_branch_sync"),yes:"Skip",no:"Review",disabled:!l.sync,note:s.jsx(Tl,{feature:"branch_sync"})}),s.jsx(Ce,{label:"Also treat these source branches as syncs",children:s.jsx(Me,{placeholder:"develop, release/*",value:v,disabled:!l.sync,onChange:C=>g(C.target.value)})}),s.jsx(Mn,{label:"Score labels on MRs/PRs",value:f.score_labels,onChange:j("score_labels"),yes:"On",no:"Off"}),s.jsx(Mn,{label:"Commit status on the reviewed commit",value:f.commit_status,onChange:j("commit_status"),yes:"On",no:"Off"})]})}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[s.jsx(Uo,{title:"Learnings",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Mn,{label:"Learn from replies to the bot",value:f.learnings_enabled,onChange:j("learnings_enabled"),yes:"On",no:"Off",disabled:!l.learnings,note:s.jsx(Tl,{feature:"learnings"})}),s.jsx(Mn,{label:"New learnings",value:f.learnings_auto_activate,onChange:j("learnings_auto_activate"),yes:"Apply at once",no:"Wait for an admin's approval",disabled:!l.learnings})]})}),s.jsx(Uo,{title:"Budgets",description:'Input plus output tokens of finished jobs in the current UTC day. When a budget is used up, automatic reviews and chat commands wait until the next day; "Review now" and re-runs from this panel still run.',children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Sl,{label:"Daily tokens, all repositories",min:0,step:1e4,placeholder:"0 = no limit",value:f.daily_token_budget,onChange:j("daily_token_budget"),disabled:!l.budgets,note:s.jsx(Tl,{feature:"budgets"})}),s.jsx(Sl,{label:"Daily tokens per repository",min:0,step:1e4,placeholder:"0 = no limit",value:f.repo_daily_token_budget,onChange:j("repo_daily_token_budget"),disabled:!l.budgets})]})}),s.jsx(Uo,{title:"History",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Sl,{label:"Keep reviews (days)",min:1,max:3650,value:f.review_retention_days,onChange:j("review_retention_days"),note:!l.metrics&&f.review_retention_days>i.free_retention_days?s.jsxs("span",{className:"locknote text-xs text-warning",children:["Without a license with metrics and long history, reviews are kept ",i.free_retention_days," days."]}):null}),s.jsx(Sl,{label:"Keep webhook deliveries (days)",min:1,max:3650,value:f.webhook_retention_days,onChange:j("webhook_retention_days")})]})}),s.jsx(Uo,{title:"Status dashboard",children:s.jsxs(Xt,{className:"lg:grid-cols-2",children:[s.jsx(Mn,{label:"Dashboard",value:f.dashboard_enabled,onChange:j("dashboard_enabled"),yes:"On",no:"Off"}),s.jsx(Mn,{label:"Repository names",value:!f.hide_repos,onChange:C=>j("hide_repos")(!C),yes:"Shown",no:"Hidden"}),s.jsx(Ce,{label:"Title",className:"sm:col-span-2",children:s.jsx(Me,{maxLength:120,value:f.dashboard_title,onChange:C=>j("dashboard_title")(C.target.value)})})]})})]}),s.jsx(Vn,{className:"py-4",children:s.jsxs(L_,{className:"flex flex-wrap items-center gap-3",children:[s.jsx(ge,{onClick:()=>k(c.review_defaults),children:"Save settings"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:S.length?"Not saved yet (from the config file): "+S.join(", "):""})]})}),s.jsx(Uo,{title:"Default review settings",description:"Apply to every repository. Group and pattern rules, then repository settings, override them.",children:s.jsx(Xd,{value:c.review_defaults,onSave:k,saveLabel:"Save default review settings"},y)}),s.jsx(Jt,{children:"The config file is the initial configuration: on first start its values are copied here, and from then on these settings are kept in the database. Editing the config file later does not change them; the server log notes any difference. Every change is in the audit log."})]})}function $2(){const n=St(),[r,i]=m.useState(null),l=ln("audit");return m.useEffect(()=>{l&&Ct("/admin/api/audit").then(c=>i(c||[])).catch(c=>n(De(c),!0))},[l]),l?s.jsx("section",{className:"grid gap-4",children:s.jsx(co,{children:r?r.length?s.jsxs(uo,{children:[s.jsx(fo,{children:s.jsxs(Mt,{children:[s.jsx(Se,{className:"pl-4",children:"When"}),s.jsx(Se,{children:"Who"}),s.jsx(Se,{children:"Action"}),s.jsx(Se,{children:"Target"}),s.jsx(Se,{className:"pr-4",children:"Details"})]})}),s.jsx(po,{children:r.map((c,u)=>s.jsxs(Mt,{children:[s.jsx(Ee,{className:"pl-4 align-top text-muted-foreground",children:new Date(c.at).toLocaleString()}),s.jsx(Ee,{className:"align-top",children:c.actor}),s.jsx(Ee,{className:"align-top",children:s.jsx("code",{children:c.action})}),s.jsx(Ee,{className:"align-top",children:c.target}),s.jsx(Ee,{className:"max-w-xl pr-4 align-top whitespace-normal",children:s.jsx("pre",{className:"detail max-h-40 overflow-auto rounded-md bg-muted p-2 font-mono text-xs whitespace-pre-wrap break-all",children:JSON.stringify(c.detail)})})]},c.id??u))})]}):s.jsx(bt,{children:"No admin activity yet."}):s.jsx(bt,{children:"Loading…"})})}):s.jsx("section",{children:s.jsx(da,{feature:"audit",children:"Every admin change is still recorded; viewing the audit log is part of the licensed console."})})}const U2={none:["Free core","idle"],active:["Active","on"],grace:["Expired — grace period","warn"],expired:["Expired","off"],invalid:["Not valid","off"]};function B2(){const n=ni(),r=qd(),i=St(),l=ti(),c=n.license,[u,f]=m.useState(""),[h,v]=U2[c.state],g=x=>io("/admin/api/license",{key:x}).then(()=>{f(""),r(),i(x?"License installed":"License removed")}).catch(b=>i(De(b),!0)),y=async()=>{await l({title:"Remove the license?",description:"Paid features turn off at once.",action:"Remove license",danger:!0})&&g("")};return s.jsxs("section",{className:"grid gap-4",children:[s.jsxs(Vn,{children:[s.jsx(Bl,{children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(yn,{kind:v,children:h}),c.customer&&s.jsxs("span",{className:"text-sm",children:[s.jsx("b",{children:c.customer})," · ",c.plan]}),s.jsx("span",{className:"flex-1"}),c.expires_at&&s.jsxs("span",{className:"text-sm text-muted-foreground",children:["expires ",sg(c.expires_at)]})]})}),s.jsxs(no,{className:"grid gap-4",children:[c.error&&s.jsx(Wo,{variant:"destructive",className:"banner bad",children:s.jsx(Vo,{children:c.error})}),c.state==="grace"&&s.jsx(Wo,{className:"banner border-warning/40 bg-warning-soft",children:s.jsxs(Vo,{className:"text-warning",children:["The license has expired. Paid features keep working until ",sg(c.grace_until),"; renew it to keep them."]})}),s.jsxs("div",{children:[s.jsx("h2",{className:"h2 mb-3 text-sm font-semibold",children:"Features"}),s.jsx("ul",{className:"feats grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:Object.keys(Wl).map(x=>{const b=c.features.includes(x);return s.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[s.jsx("span",{className:"flex size-5 items-center justify-center rounded-full "+(b?"bg-success-soft text-success":"bg-muted text-muted-foreground"),children:b?s.jsx(Ql,{className:"size-3"}):s.jsx(g1,{className:"size-3"})}),s.jsx("span",{className:b?"":"text-muted-foreground",children:Wl[x]}),s.jsx("span",{className:"sr-only",children:b?"on":"off"})]},x)})})]}),s.jsxs(Jt,{children:["Free without a license: reviews for one GitHub, GitLab and Bitbucket host each, the local executor, repository on/off, ",s.jsx("code",{children:"@bot"})," commands, review history for ",n.free_retention_days," days, the status dashboard and admin sign-in by email."]})]})]}),s.jsxs(Vn,{children:[s.jsxs(Bl,{children:[s.jsxs(Qd,{className:"flex items-center gap-2",children:[s.jsx(Ig,{className:"size-4"}),c.state==="none"?"Install a license":"Replace the license"]}),s.jsx(Yd,{children:"Keys are verified offline; the console never calls home."})]}),s.jsx(no,{className:"grid gap-4",children:c.managed?s.jsx("p",{className:"text-sm text-muted-foreground",children:c.source==="env"?s.jsxs(s.Fragment,{children:["This license comes from ",s.jsx("code",{children:"CODEREVIEW_CONSOLE_LICENSE"}),", which overrides the one managed here. Remove the variable and restart to manage the license here."]}):s.jsxs(s.Fragment,{children:["This license comes from ",s.jsx("code",{children:"license.file"})," because the console has no database. With ",s.jsx("code",{children:"database.url"})," set, the key is copied into the database and managed here."]})}):s.jsxs(s.Fragment,{children:[s.jsx(Ce,{label:"License key",children:s.jsx(rs,{className:"key min-h-28 font-mono text-xs",placeholder:"DIV1.… or the -----BEGIN DIVMORA LICENSE KEY----- block",autoComplete:"off",spellCheck:!1,value:u,onChange:x=>f(x.target.value)})}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ge,{disabled:!u.trim(),onClick:()=>g(u.trim()),children:"Install"}),c.source==="database"&&s.jsx(ge,{variant:"ghost",className:"text-destructive hover:text-destructive",onClick:y,children:"Remove license"})]}),s.jsx(Jt,{children:"A pasted key is stored in the database and applies at once, except the executor, which is chosen when the console starts."})]})})]}),s.jsxs(Jt,{children:["Every use of a paid feature needs a license from Divmora, in development, CI and production alike. For a license or a trial, contact"," ",s.jsx("a",{className:"text-primary underline-offset-4 hover:underline",href:"mailto:licensing@divmora.com",children:"licensing@divmora.com"}),"."]})]})}const W2={"/license":"Open License","/hosts":"Open Code hosts","/webhooks":"Open Webhooks","/settings":"Open Settings","/repositories":"Open Repositories","/reviews":"Open Reviews"};function V2(){const n=St(),r=qd(),[i,l]=m.useState(null),c=m.useRef(""),u=()=>Ct("/admin/api/setup").then(v=>{l(v);const g=v.done+"/"+v.complete;c.current!==g&&(c.current!==""&&r(),c.current=g)}).catch(v=>n(De(v),!0));if(m.useEffect(()=>{u();const v=window.setInterval(u,15e3);return()=>window.clearInterval(v)},[]),!i)return s.jsx(bt,{children:"Loading…"});const f=i.steps.find(v=>!v.done&&!v.optional),h=i.total?Math.round(i.done/i.total*100):100;return s.jsxs("section",{className:"grid max-w-3xl gap-4",children:[s.jsxs(Vn,{children:[s.jsxs(Bl,{children:[s.jsx(Qd,{className:"h2",children:i.complete?"All set":"Get your first review"}),s.jsx(Yd,{children:i.complete?"Everything needed for reviews is in place. This page stays here for when you add more.":`${i.done} of ${i.total} steps done. Each step is checked against what is configured right now.`})]}),s.jsxs(no,{className:"grid gap-3",children:[s.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Setup progress",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:h+"%"}})}),s.jsx("div",{children:s.jsxs(ge,{variant:"outline",size:"sm",onClick:u,children:[s.jsx(Yg,{})," Check again"]})})]})]}),s.jsx("ol",{className:"grid gap-3",children:i.steps.map((v,g)=>{const y=(f==null?void 0:f.id)===v.id;return s.jsx("li",{children:s.jsx(Vn,{className:te("gap-3 py-4",y&&"border-primary ring-1 ring-primary/40"),children:s.jsxs(no,{className:"flex gap-3 px-4",children:[s.jsx("div",{className:te("mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-full border text-xs font-semibold",v.done?"border-success bg-success-soft text-success":y?"border-primary text-primary":"text-muted-foreground"),"aria-hidden":!0,children:v.done?s.jsx(Ql,{className:"size-4"}):y?g+1:s.jsx(Pg,{className:"size-3"})}),s.jsxs("div",{className:"grid min-w-0 flex-1 gap-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-medium",children:v.title}),v.optional&&s.jsx(jn,{variant:"outline",className:"font-normal text-muted-foreground",children:"optional"}),y&&s.jsx(jn,{children:"next"}),s.jsx("span",{className:"sr-only",children:v.done?"done":"not done"})]}),v.detail&&s.jsx("div",{className:te("text-sm",v.done?"text-success":/rejected|failed|expired|not valid|won't work/.test(v.detail)?"text-destructive":"text-muted-foreground"),children:v.detail}),(!v.done||y)&&s.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:v.help}),v.link&&!v.done&&s.jsx("div",{children:s.jsx(ge,{asChild:!0,size:"sm",variant:y?"default":"outline",children:s.jsxs(Jr,{to:v.link,children:[W2[v.link]||"Open"," ",s.jsx(l1,{})]})})})]})]})})},v.id)})}),s.jsx(Jt,{children:"Steps update on their own every 15 seconds while this page is open, so you can set up the webhook on the code host and watch it turn green."})]})}const sf=[{path:"setup",title:"Setup",icon:k1,el:s.jsx(V2,{})},{path:"repositories",title:"Repositories",icon:p1,el:s.jsx(y2,{})},{path:"reviews",title:"Reviews",icon:c1,el:s.jsx(S2,{})},{path:"learnings",title:"Learnings",icon:a1,el:s.jsx(N2,{}),paid:"learnings"},{path:"hosts",title:"Code hosts",icon:C1,el:s.jsx(M2,{})},{path:"rules",title:"Rules",icon:h1,el:s.jsx(I2,{}),paid:"rules"},{path:"webhooks",title:"Webhooks",icon:iv,el:s.jsx(z2,{})},{path:"settings",title:"Settings",icon:_1,el:s.jsx(F2,{})},{path:"audit",title:"Audit log",icon:j1,el:s.jsx($2,{}),paid:"audit"},{path:"license",title:"License",icon:Ig,el:s.jsx(B2,{})}];function H2({me:n}){const r=n.license;return n.reviews_paused?s.jsx(Wo,{role:"status",variant:"destructive",className:"banner bad",children:s.jsx(Vo,{children:s.jsxs("p",{children:[n.reviews_paused[0].toUpperCase()+n.reviews_paused.slice(1),"."," ",s.jsx(Jr,{className:"font-semibold underline underline-offset-2",to:"/license",children:"Add a license"})]})})}):r.state==="grace"?s.jsx(Wo,{role:"status",className:"banner border-warning/40 bg-warning-soft text-warning",children:s.jsx(Vo,{className:"text-warning",children:s.jsxs("p",{children:["The Divmora license expired on ",new Date(r.expires_at).toLocaleDateString(),". Paid features stop on ",new Date(r.grace_until).toLocaleDateString(),"."," ",s.jsx(Jr,{className:"font-semibold underline underline-offset-2",to:"/license",children:"Renew"})]})})}):r.state==="expired"||r.state==="invalid"?s.jsx(Wo,{role:"status",variant:"destructive",className:"banner bad",children:s.jsx(Vo,{children:s.jsxs("p",{children:[r.state==="expired"?"The Divmora license has expired":"The Divmora license is not valid",": paid features are off."," ",s.jsx(Jr,{className:"font-semibold underline underline-offset-2",to:"/license",children:"License"})]})})}):null}function G2(){const[n,r]=m.useState(()=>{try{return localStorage.getItem("crc-theme")||"system"}catch{return"system"}}),i=c=>{r(c);try{localStorage.setItem("crc-theme",c)}catch{}const u=window.__crcApplyTheme;u?u():document.documentElement.classList.toggle("dark",c==="dark")},l=n==="light"?N1:n==="dark"?x1:v1;return s.jsxs(W_,{children:[s.jsx(V_,{asChild:!0,children:s.jsx(ge,{variant:"ghost",size:"icon",id:"theme","aria-label":"Theme",children:s.jsx(l,{})})}),s.jsxs(H_,{align:"end",children:[s.jsx(K_,{children:"Theme"}),s.jsx(Q_,{}),s.jsxs(G_,{value:n,onValueChange:i,children:[s.jsx(bu,{value:"system",children:"System"}),s.jsx(bu,{value:"light",children:"Light"}),s.jsx(bu,{value:"dark",children:"Dark"})]})]})]})}function zy(n){return sf.find(r=>n.startsWith("/"+r.path))}function K2({me:n}){const r=Dr(),{setOpenMobile:i}=os(),l=()=>Fn("/admin/logout").finally(()=>location.href="/admin/login");return s.jsxs(s2,{collapsible:"icon",children:[s.jsx(u2,{children:s.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[s.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:s.jsx(E1,{className:"size-4"})}),s.jsxs("div",{className:"grid leading-tight group-data-[collapsible=icon]:hidden",children:[s.jsx("span",{className:"truncate text-sm font-semibold",children:"Code review"}),s.jsx("span",{className:"truncate text-xs text-muted-foreground",children:"Divmora console"})]})]})}),s.jsx(f2,{children:s.jsx(p2,{children:s.jsx(h2,{children:s.jsx(tg,{className:"side","aria-label":"Sections",children:sf.map(c=>{var h;const u=c.paid&&!n.license.features.includes(c.paid),f=((h=zy(r.pathname))==null?void 0:h.path)===c.path;return s.jsxs(ng,{children:[s.jsx(rg,{asChild:!0,isActive:f,tooltip:c.title,children:s.jsxs(Hb,{to:"/"+c.path,className:f?"on":"",onClick:()=>i(!1),children:[s.jsx(c.icon,{}),s.jsx("span",{children:c.title})]})}),c.path==="setup"&&n.setup&&!n.setup.complete&&s.jsxs(og,{className:"text-[10px] font-normal text-muted-foreground",title:"Setup steps done",children:[n.setup.done,"/",n.setup.total]}),u&&s.jsx(og,{className:"paid text-[10px] font-normal text-muted-foreground",title:"Needs a license",children:"licensed"})]},c.path)})})})})}),s.jsxs(d2,{children:[s.jsxs("div",{className:"grid gap-1 px-2 pb-1 text-xs text-muted-foreground group-data-[collapsible=icon]:hidden",children:[s.jsxs("span",{className:"truncate",children:["Signed in as ",n.name||n.email]}),s.jsx("a",{className:"underline-offset-2 hover:text-foreground hover:underline",href:"/dashboard",children:"Status dashboard"}),n.version&&s.jsxs("span",{children:["Version ",n.version]})]}),s.jsx(tg,{children:s.jsx(ng,{children:s.jsxs(rg,{id:"logout",onClick:l,tooltip:"Sign out",children:[s.jsx(m1,{}),s.jsx("span",{children:"Sign out"})]})})})]}),s.jsx(a2,{})]})}function Q2({me:n}){const r=Dr(),i=zy(r.pathname),l=(i==null?void 0:i.title)??"Repositories";return m.useEffect(()=>{document.title=l+" · Code review admin"},[l]),s.jsxs("header",{className:"sticky top-0 z-10 flex h-14 shrink-0 items-center gap-2 border-b bg-background/80 px-4 backdrop-blur",children:[s.jsx(l2,{className:"-ml-1"}),s.jsx(Zr,{orientation:"vertical",className:"mr-1 data-[orientation=vertical]:h-4"}),s.jsx("h1",{id:"pageTitle",className:"text-base font-semibold",children:l}),(i==null?void 0:i.paid)&&!n.license.features.includes(i.paid)&&s.jsx(jn,{variant:"secondary",children:"licensed"}),s.jsx("span",{className:"flex-1"}),s.jsx(G2,{})]})}function Y2(){const[n,r]=m.useState(null),[i,l]=m.useState(""),c=()=>Ct("/admin/api/me").then(u=>{R1(u.csrf),r(u)}).catch(u=>l(String(u.message||u)));return m.useEffect(()=>{c()},[]),n?s.jsx(Ty.Provider,{value:n,children:s.jsx(Oy.Provider,{value:c,children:s.jsx(Ay,{delayDuration:300,children:s.jsx($_,{children:s.jsx(U_,{children:s.jsxs(i2,{children:[s.jsx(K2,{me:n}),s.jsxs(c2,{className:"min-w-0",children:[s.jsx(Q2,{me:n}),s.jsxs("div",{className:"mx-auto grid w-full max-w-7xl gap-4 p-4 md:p-6",children:[s.jsx(H2,{me:n}),s.jsxs(Mb,{children:[s.jsx(El,{path:"/",element:s.jsx(hm,{to:n.setup&&!n.setup.complete?"/setup":"/repositories",replace:!0})}),sf.map(u=>s.jsx(El,{path:"/"+u.path,element:u.el},u.path)),s.jsx(El,{path:"*",element:s.jsx(hm,{to:"/repositories",replace:!0})})]})]})]})]})})})})})}):s.jsx("div",{className:"grid min-h-svh place-items-center text-sm text-muted-foreground",children:i||"Loading…"})}var cg;const ju=(cg=document.querySelector('meta[name="csp-nonce"]'))==null?void 0:cg.content;ju&&!ju.startsWith("__")&&Yb(ju);H0.createRoot(document.getElementById("root")).render(s.jsx(m.StrictMode,{children:s.jsx(Bb,{basename:"/admin",children:s.jsx(Y2,{})})})); diff --git a/internal/admin/ui/index.html b/internal/admin/ui/index.html index 6ab8a4c..209c1f1 100644 --- a/internal/admin/ui/index.html +++ b/internal/admin/ui/index.html @@ -8,7 +8,7 @@ - + diff --git a/web/src/App.tsx b/web/src/App.tsx index ddb4fb2..148938f 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -81,6 +81,19 @@ const sections: { path: string; title: string; icon: LucideIcon; el: JSX.Element // not valid (a missing license is the normal free core: no banner). function LicenseBanner({ me }: { me: Me }) { const l = me.license; + if (me.reviews_paused) + return ( + + +

+ {me.reviews_paused[0].toUpperCase() + me.reviews_paused.slice(1)}.{" "} + + Add a license + +

+
+
+ ); if (l.state === "grace") return ( diff --git a/web/src/pages/License.tsx b/web/src/pages/License.tsx index 167bc97..ba41dac 100644 --- a/web/src/pages/License.tsx +++ b/web/src/pages/License.tsx @@ -96,7 +96,15 @@ export default function License() { {lic.managed ? (

- This license comes from {lic.source === "env" ? CODEREVIEW_CONSOLE_LICENSE : license.file}; change it there and restart the console. + {lic.source === "env" ? ( + <> + This license comes from CODEREVIEW_CONSOLE_LICENSE, which overrides the one managed here. Remove the variable and restart to manage the license here. + + ) : ( + <> + This license comes from license.file because the console has no database. With database.url set, the key is copied into the database and managed here. + + )}

) : ( <> diff --git a/web/src/types.ts b/web/src/types.ts index 3e93fb1..f69cb39 100644 --- a/web/src/types.ts +++ b/web/src/types.ts @@ -37,6 +37,8 @@ export type Me = { free_retention_days: number; // Guided setup progress (required steps). setup?: { complete: boolean; done?: number; total?: number }; + // Why reviews can't run with the current license ("" = they can). + reviews_paused?: string; }; export type Access = {