From dafdb18234b8be4445ebe05ff96e4cf86cd9e06f Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Sun, 27 Sep 2026 15:34:19 +0200 Subject: [PATCH] feat(10-01): harden the admin cookie session and prefix boot guards - refresh and logout read the Bearer header first, then the summer_admin cookie; a cookie refresh rotates the cookie without a token in the body and logout always expires the cookie - backend.cookie_secure (default true) may drop Secure outside production only - activation rejects controller vendor segments api, assets, login, settings - BuildRouter rejects non-cabana routes at or under the admin prefix - SPA single-flights refresh on 401, replays once, and refreshes proactively at 80 percent of expires_in; dist rebuilt - scripts/check-admin-dist.sh rebuilds the SPA and fails on dist drift - tests: TestPhase10CookieAuth, TestPhase10CSRF, TestPhase10Prefix, TestPhase10AdminPrefixCollision, boardwalk serving and header tests --- admin/src/api/client.ts | 70 ++++- admin/src/state/useAuth.ts | 28 +- admin/tests/smoke/tracer.smoke.test.ts | 105 ++++++- boardwalk/boardwalk_test.go | 317 +++++++++++++++++++++ boardwalk/dist/assets/index-BD2QIjGC.js | 1 + boardwalk/dist/assets/index-ZNCn30hM.js | 1 - boardwalk/dist/index.html | 2 +- cabana/auth.go | 65 ++++- cabana/http.go | 12 + cabana/phase10_auth_test.go | 352 ++++++++++++++++++++++++ cabana/phase10_csrf_test.go | 154 +++++++++++ cabana/registry.go | 16 ++ scripts/check-admin-dist.sh | 26 ++ surf/admin_prefix_test.go | 132 +++++++++ surf/router.go | 20 ++ 15 files changed, 1283 insertions(+), 18 deletions(-) create mode 100644 boardwalk/boardwalk_test.go create mode 100644 boardwalk/dist/assets/index-BD2QIjGC.js delete mode 100644 boardwalk/dist/assets/index-ZNCn30hM.js create mode 100644 cabana/phase10_auth_test.go create mode 100644 cabana/phase10_csrf_test.go create mode 100755 scripts/check-admin-dist.sh create mode 100644 surf/admin_prefix_test.go diff --git a/admin/src/api/client.ts b/admin/src/api/client.ts index f0489c2..b833b0d 100644 --- a/admin/src/api/client.ts +++ b/admin/src/api/client.ts @@ -2,6 +2,11 @@ // paths (D-15). Every request carries X-Requested-With (the CSRF header the // admin API requires on state-changing cookie requests, D-19) and same-origin // credentials; the JWT lives in an HttpOnly cookie the SPA never reads. +// +// A 401 on any call other than login and refresh starts one shared refresh +// (concurrent 401s wait for the same one); on success the original request is +// replayed once from a clone taken before it was sent. A failed refresh or a +// second 401 reports the session as gone. import createClient, { type Middleware } from 'openapi-fetch' import type { paths } from './schema' import { runtime } from '../app/runtime' @@ -9,28 +14,81 @@ import { runtime } from '../app/runtime' export const REQUESTED_WITH = 'XMLHttpRequest' type UnauthorizedHandler = () => void +type RefreshedHandler = (expiresIn: number | null) => void let unauthorizedHandler: UnauthorizedHandler | null = null +let refreshedHandler: RefreshedHandler | null = null +let inflight: Promise | null = null +const replays = new WeakMap() -/** Registers what happens when an API call other than login returns 401. */ +/** Registers what happens when the session cannot be recovered after a 401. */ export function onUnauthorized(handler: UnauthorizedHandler | null): void { unauthorizedHandler = handler } -function isLoginRequest(request: Request): boolean { - return new URL(request.url, 'http://local').pathname.endsWith('/auth/login') +/** Registers a listener for successful refreshes (the new access lifetime). */ +export function onRefreshed(handler: RefreshedHandler | null): void { + refreshedHandler = handler +} + +function pathOf(request: Request): string { + return new URL(request.url, 'http://local').pathname +} + +function isAuthEndpoint(request: Request): boolean { + const path = pathOf(request) + return path.endsWith('/auth/login') || path.endsWith('/auth/refresh') +} + +/** + * Refreshes the cookie session. Concurrent callers share one request; the + * promise resolves to whether the server issued a new session. + */ +export function refreshSession(): Promise { + if (inflight) { + return inflight + } + inflight = (async () => { + try { + const { data, response } = await api.POST('/auth/refresh') + if (!response.ok || !data) { + return false + } + const expiresIn = data.data.expires_in + refreshedHandler?.(typeof expiresIn === 'number' ? expiresIn : null) + return true + } catch { + return false + } finally { + inflight = null + } + })() + return inflight } export const transport: Middleware = { onRequest({ request }) { request.headers.set('X-Requested-With', REQUESTED_WITH) + if (!isAuthEndpoint(request)) { + replays.set(request, request.clone()) + } return request }, - onResponse({ request, response }) { - if (response.status === 401 && !isLoginRequest(request)) { + async onResponse({ request, response }) { + if (response.status !== 401 || isAuthEndpoint(request)) { + return response + } + const replay = replays.get(request) + replays.delete(request) + if (!replay || !(await refreshSession())) { + unauthorizedHandler?.() + return response + } + const retried = await globalThis.fetch(replay) + if (retried.status === 401) { unauthorizedHandler?.() } - return response + return retried }, } diff --git a/admin/src/state/useAuth.ts b/admin/src/state/useAuth.ts index cf7b4ce..dd9e8f6 100644 --- a/admin/src/state/useAuth.ts +++ b/admin/src/state/useAuth.ts @@ -1,11 +1,34 @@ // Admin session state. The JWT travels in an HttpOnly cookie (D-19): the SPA // keeps only the profile and the access lifetime, never a token. import { readonly, ref } from 'vue' -import { api } from '../api/client' +import { api, onRefreshed, refreshSession } from '../api/client' import type { AdminProfile } from '../api/types' const user = ref(null) const expiresIn = ref(null) +let refreshTimer: ReturnType | null = null + +/** Refreshes proactively at 80 percent of the access token lifetime. */ +function scheduleRefresh(seconds: number | null): void { + cancelRefresh() + expiresIn.value = seconds + if (seconds === null || seconds <= 0) { + return + } + refreshTimer = setTimeout(() => { + refreshTimer = null + void refreshSession() + }, seconds * 800) +} + +function cancelRefresh(): void { + if (refreshTimer !== null) { + clearTimeout(refreshTimer) + refreshTimer = null + } +} + +onRefreshed(scheduleRefresh) export const currentUser = readonly(user) @@ -17,7 +40,7 @@ export async function login(identifier: string, password: string): Promise { } export function clearUser(): void { + cancelRefresh() user.value = null expiresIn.value = null } diff --git a/admin/tests/smoke/tracer.smoke.test.ts b/admin/tests/smoke/tracer.smoke.test.ts index 95916fb..a3ab9f3 100644 --- a/admin/tests/smoke/tracer.smoke.test.ts +++ b/admin/tests/smoke/tracer.smoke.test.ts @@ -5,7 +5,7 @@ import App from '../../src/App.vue' import LoginView from '../../src/views/LoginView.vue' import { createAdminRouter, safeRedirect } from '../../src/app/router' import { runtime } from '../../src/app/runtime' -import { onUnauthorized } from '../../src/api/client' +import { api, onUnauthorized } from '../../src/api/client' import { clearUser, me, useAuth } from '../../src/state/useAuth' import { loadNavigation, setNavigation } from '../../src/state/useNavigation' import navigation from '../fixtures/navigation.json' @@ -197,3 +197,106 @@ describe('navigation shell and list', () => { ]) }) }) + +describe('session refresh', () => { + function json(status: number, body: unknown): Response { + return new Response(JSON.stringify(body), { status, headers: { 'Content-Type': 'application/json' } }) + } + const unauthenticated = { error: { code: 'unauthenticated', message: 'Unauthenticated', details: {} } } + + it('single-flights one refresh for concurrent 401s and replays each request once', async () => { + let refreshed = false + const seen: Request[] = [] + vi.spyOn(globalThis, 'fetch').mockImplementation(async (input: RequestInfo | URL) => { + const request = input as Request + seen.push(request) + const path = pathOf(request) + if (path === `${API}/auth/refresh`) { + await new Promise((resolve) => setTimeout(resolve, 5)) + refreshed = true + return json(200, { data: { token_type: 'cookie', expires_in: 3600 }, meta: {} }) + } + if (!refreshed) { + return json(401, unauthenticated) + } + if (path === `${API}/navigation`) { + return json(200, navigation) + } + return json(200, profile) + }) + const handler = vi.fn() + onUnauthorized(handler) + + const [nav, who] = await Promise.all([api.GET('/navigation'), api.GET('/auth/me')]) + + expect(nav.response.status).toBe(200) + expect(who.response.status).toBe(200) + expect(nav.data?.data).toHaveLength(3) + expect(who.data?.data.login).toBe('dev') + const refreshes = seen.filter((request) => pathOf(request) === `${API}/auth/refresh`) + expect(refreshes).toHaveLength(1) + expect(refreshes[0]!.method).toBe('POST') + expect(refreshes[0]!.headers.get('X-Requested-With')).toBe('XMLHttpRequest') + expect(seen.filter((request) => pathOf(request) === `${API}/navigation`)).toHaveLength(2) + expect(seen.filter((request) => pathOf(request) === `${API}/auth/me`)).toHaveLength(2) + expect(handler).not.toHaveBeenCalled() + }) + + it('goes to login when the refresh fails and never replays twice', async () => { + const seen: Request[] = [] + vi.spyOn(globalThis, 'fetch').mockImplementation(async (input: RequestInfo | URL) => { + const request = input as Request + seen.push(request) + return json(401, unauthenticated) + }) + const handler = vi.fn() + onUnauthorized(handler) + + const result = await api.GET('/navigation') + + expect(result.response.status).toBe(401) + expect(seen.filter((request) => pathOf(request) === `${API}/auth/refresh`)).toHaveLength(1) + expect(seen.filter((request) => pathOf(request) === `${API}/navigation`)).toHaveLength(1) + expect(handler).toHaveBeenCalledTimes(1) + }) + + it('goes to login when the replay is still unauthorized', async () => { + const seen: Request[] = [] + vi.spyOn(globalThis, 'fetch').mockImplementation(async (input: RequestInfo | URL) => { + const request = input as Request + seen.push(request) + if (pathOf(request) === `${API}/auth/refresh`) { + return json(200, { data: { token_type: 'cookie', expires_in: 3600 }, meta: {} }) + } + return json(401, unauthenticated) + }) + const handler = vi.fn() + onUnauthorized(handler) + + const result = await api.GET('/navigation') + + expect(result.response.status).toBe(401) + expect(seen.filter((request) => pathOf(request) === `${API}/navigation`)).toHaveLength(2) + expect(handler).toHaveBeenCalledTimes(1) + }) + + it('schedules a proactive refresh at 80 percent of expires_in', async () => { + vi.useFakeTimers() + try { + const calls = mockApi({ + [`POST ${API}/auth/login`]: { body: { data: { token_type: 'cookie', expires_in: 100 }, meta: {} } }, + [`POST ${API}/auth/refresh`]: { body: { data: { token_type: 'cookie', expires_in: 100 }, meta: {} } }, + }) + expect(await useAuth().login('dev', 'secret')).toBe(true) + await vi.advanceTimersByTimeAsync(79_000) + expect(calls.filter((request) => pathOf(request) === `${API}/auth/refresh`)).toHaveLength(0) + await vi.advanceTimersByTimeAsync(2_000) + expect(calls.filter((request) => pathOf(request) === `${API}/auth/refresh`)).toHaveLength(1) + clearUser() + await vi.advanceTimersByTimeAsync(200_000) + expect(calls.filter((request) => pathOf(request) === `${API}/auth/refresh`)).toHaveLength(1) + } finally { + vi.useRealTimers() + } + }) +}) diff --git a/boardwalk/boardwalk_test.go b/boardwalk/boardwalk_test.go new file mode 100644 index 0000000..e635911 --- /dev/null +++ b/boardwalk/boardwalk_test.go @@ -0,0 +1,317 @@ +package boardwalk + +import ( + "io/fs" + "net/http" + "net/http/httptest" + "path" + "regexp" + "strings" + "testing" + "testing/fstest" +) + +const testPrefix = "/acme-admin" + +var ( + assetRef = regexp.MustCompile(`(?:src|href)="([^"]+)"`) + scriptTag = regexp.MustCompile(`]*>`) +) + +type apiSpy struct{ calls int } + +func (s *apiSpy) ServeHTTP(w http.ResponseWriter, _ *http.Request) { + s.calls++ + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusNotFound) + _, _ = w.Write([]byte(`{"error":{"code":"not_found","message":"Not found","details":{}}}`)) +} + +func newTestHandler(t *testing.T) (http.Handler, *apiSpy) { + t.Helper() + spy := &apiSpy{} + h, err := Handler(testPrefix, spy) + if err != nil { + t.Fatal(err) + } + return h, spy +} + +func get(h http.Handler, target string) *httptest.ResponseRecorder { + rec := httptest.NewRecorder() + h.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, target, nil)) + return rec +} + +func TestIndexRewrite(t *testing.T) { + h, _ := newTestHandler(t) + for _, target := range []string{testPrefix, testPrefix + "/", testPrefix + "/index.html"} { + rec := get(h, target) + body := rec.Body.String() + if rec.Code != http.StatusOK { + t.Fatalf("%s status=%d", target, rec.Code) + } + if !strings.Contains(body, ``), testPrefix); err == nil { + t.Fatal("index without the base token was accepted") + } + root := fstest.MapFS{"index.html": &fstest.MapFile{Data: []byte("")}} + if _, err := newHandler(root, testPrefix, &apiSpy{}); err == nil || !strings.Contains(err.Error(), BaseToken) { + t.Fatalf("stale dist accepted: %v", err) + } + if _, err := newHandler(fstest.MapFS{}, testPrefix, &apiSpy{}); err == nil { + t.Fatal("dist without index.html accepted") + } + if _, err := Handler(testPrefix, nil); err == nil { + t.Fatal("nil API not-found handler accepted") + } + if _, err := Handler("acme-admin", &apiSpy{}); err == nil { + t.Fatal("prefix without a leading slash accepted") + } +} + +func TestRewriteIndexEscapesPrefix(t *testing.T) { + out, err := RewriteIndex([]byte(``), `/a"b`) + if err != nil { + t.Fatal(err) + } + if strings.Contains(string(out), `"/a"b`) || !strings.Contains(string(out), `/a"b`) { + t.Fatalf("prefix not escaped: %s", out) + } +} + +func TestEveryReferencedAssetIsEmbedded(t *testing.T) { + root, err := Dist() + if err != nil { + t.Fatal(err) + } + raw, err := fs.ReadFile(root, "index.html") + if err != nil { + t.Fatal(err) + } + index, err := RewriteIndex(raw, testPrefix) + if err != nil { + t.Fatal(err) + } + refs := assetRef.FindAllStringSubmatch(string(index), -1) + if len(refs) == 0 { + t.Fatal("index references no assets") + } + h, _ := newTestHandler(t) + for _, ref := range refs { + target := ref[1] + if !strings.HasPrefix(target, testPrefix+"/") { + t.Fatalf("reference %q is not under the prefix", target) + } + name := strings.TrimPrefix(target, testPrefix+"/") + if _, err := fs.Stat(root, name); err != nil { + t.Fatalf("index references %s, missing from the embedded dist: %v", name, err) + } + if rec := get(h, target); rec.Code != http.StatusOK { + t.Fatalf("GET %s status=%d", target, rec.Code) + } + } +} + +func TestNoInlineScript(t *testing.T) { + root, err := Dist() + if err != nil { + t.Fatal(err) + } + raw, err := fs.ReadFile(root, "index.html") + if err != nil { + t.Fatal(err) + } + tags := scriptTag.FindAllString(string(raw), -1) + if len(tags) == 0 { + t.Fatal("index has no module script") + } + for _, tag := range tags { + if !strings.Contains(tag, " src=") { + t.Fatalf("inline script in index.html: %s", tag) + } + } + if strings.Contains(strings.ToLower(string(raw)), "javascript:") { + t.Fatal("index.html contains a javascript: URL") + } +} + +func TestAPIPathsAreDelegated(t *testing.T) { + h, spy := newTestHandler(t) + for _, target := range []string{testPrefix + "/api", testPrefix + "/api/", testPrefix + "/api/v1/nope", testPrefix + "/api/v1/auth/login"} { + before := spy.calls + rec := get(h, target) + if spy.calls != before+1 || rec.Code != http.StatusNotFound || strings.Contains(rec.Body.String(), "`)}, + "assets/app.js": &fstest.MapFile{Data: []byte("console.log(1)")}, + } + h, err := newHandler(root, testPrefix, &apiSpy{}) + if err != nil { + t.Fatal(err) + } + for _, target := range []string{ + testPrefix + "/../../../go.mod", + testPrefix + "/assets/../../boardwalk.go", + testPrefix + "/%2e%2e/%2e%2e/etc/passwd.txt", + } { + req := httptest.NewRequest(http.MethodGet, "/", nil) + req.URL.Path = target + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if rec.Code != http.StatusNotFound || strings.Contains(rec.Body.String(), "module ") || strings.Contains(rec.Body.String(), "package ") { + t.Fatalf("%s status=%d body=%s", target, rec.Code, rec.Body.String()) + } + } + req := httptest.NewRequest(http.MethodGet, "/", nil) + req.URL.Path = testPrefix + "/assets/../index.html" + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + if rec.Code != http.StatusOK || strings.Contains(rec.Body.String(), BaseToken) { + t.Fatalf("cleaned index path served the raw index: %d %s", rec.Code, rec.Body.String()) + } +} + +func TestDirectoryIsNeverListed(t *testing.T) { + h, _ := newTestHandler(t) + root, err := Dist() + if err != nil { + t.Fatal(err) + } + entries, err := fs.ReadDir(root, "assets") + if err != nil || len(entries) == 0 { + t.Fatalf("embedded assets: %v", err) + } + for _, target := range []string{testPrefix + "/assets", testPrefix + "/assets/"} { + rec := get(h, target) + body := rec.Body.String() + if strings.Contains(body, entries[0].Name()) || !strings.Contains(body, "summer-admin-base") { + t.Fatalf("%s listed the directory or skipped the shell: %s", target, body) + } + } +} + +func TestContentTypesAndCaching(t *testing.T) { + h, _ := newTestHandler(t) + root, err := Dist() + if err != nil { + t.Fatal(err) + } + want := map[string]string{ + ".js": "text/javascript; charset=utf-8", + ".css": "text/css; charset=utf-8", + ".woff2": "font/woff2", + ".woff": "font/woff", + } + seen := map[string]bool{} + err = fs.WalkDir(root, "assets", func(name string, d fs.DirEntry, err error) error { + if err != nil || d.IsDir() { + return err + } + ext := path.Ext(name) + ct, ok := want[ext] + if !ok || seen[ext] { + return nil + } + seen[ext] = true + rec := get(h, testPrefix+"/"+name) + if rec.Code != http.StatusOK || rec.Header().Get("Content-Type") != ct { + t.Fatalf("%s status=%d type=%q, want %q", name, rec.Code, rec.Header().Get("Content-Type"), ct) + } + if cc := rec.Header().Get("Cache-Control"); cc != "public, max-age=31536000, immutable" { + t.Fatalf("%s Cache-Control=%q", name, cc) + } + return nil + }) + if err != nil { + t.Fatal(err) + } + for ext := range want { + if !seen[ext] { + t.Fatalf("embedded dist has no %s asset", ext) + } + } + index := get(h, testPrefix) + if index.Header().Get("Cache-Control") != "no-store" || !strings.HasPrefix(index.Header().Get("Content-Type"), "text/html") { + t.Fatalf("index headers = %v", index.Header()) + } + if got := contentType("x.svg"); got != "image/svg+xml" { + t.Fatalf("svg type %q", got) + } + if got := contentType("x.json"); got != "application/json" { + t.Fatalf("json type %q", got) + } + if got := contentType("x.unknown-ext"); got != "application/octet-stream" { + t.Fatalf("unknown type %q", got) + } +} + +func TestSecurityHeadersOnEveryResponse(t *testing.T) { + h, _ := newTestHandler(t) + root, err := Dist() + if err != nil { + t.Fatal(err) + } + entries, err := fs.ReadDir(root, "assets") + if err != nil || len(entries) == 0 { + t.Fatalf("embedded assets: %v", err) + } + for _, target := range []string{ + testPrefix, + testPrefix + "/acme/demo/widgets", + testPrefix + "/assets/" + entries[0].Name(), + testPrefix + "/missing.js", + testPrefix + "/api/v1/nope", + } { + rec := get(h, target) + for header, want := range map[string]string{ + "X-Content-Type-Options": "nosniff", + "Referrer-Policy": "same-origin", + "X-Frame-Options": "DENY", + "Content-Security-Policy": "frame-ancestors 'none'; base-uri 'none'; object-src 'none'; script-src 'self'", + "X-Robots-Tag": "noindex, nofollow", + } { + if got := rec.Header().Get(header); got != want { + t.Fatalf("%s %s=%q, want %q", target, header, got, want) + } + } + } +} diff --git a/boardwalk/dist/assets/index-BD2QIjGC.js b/boardwalk/dist/assets/index-BD2QIjGC.js new file mode 100644 index 0000000..99bdf6d --- /dev/null +++ b/boardwalk/dist/assets/index-BD2QIjGC.js @@ -0,0 +1 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Or(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const re={},Dt=[],it=()=>{},yo=()=>!1,Dn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Fn=e=>e.startsWith("onUpdate:"),Ee=Object.assign,jr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},tl=Object.prototype.hasOwnProperty,Y=(e,t)=>tl.call(e,t),F=Array.isArray,Ft=e=>vn(e)==="[object Map]",_o=e=>vn(e)==="[object Set]",ls=e=>vn(e)==="[object Date]",U=e=>typeof e=="function",ae=e=>typeof e=="string",Ke=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",vo=e=>(Z(e)||U(e))&&U(e.then)&&U(e.catch),bo=Object.prototype.toString,vn=e=>bo.call(e),nl=e=>vn(e).slice(8,-1),xo=e=>vn(e)==="[object Object]",Nr=e=>ae(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,nn=Or(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Hn=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},rl=/-\w/g,$e=Hn(e=>e.replace(rl,t=>t.slice(1).toUpperCase())),sl=/\B([A-Z])/g,Mt=Hn(e=>e.replace(sl,"-$1").toLowerCase()),Un=Hn(e=>e.charAt(0).toUpperCase()+e.slice(1)),er=Hn(e=>e?`on${Un(e)}`:""),ot=(e,t)=>!Object.is(e,t),Rn=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ir=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let cs;const Vn=()=>cs||(cs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Lr(e){if(F(e)){const t={};for(let n=0;n{if(n){const r=n.split(il);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function wt(e){let t="";if(ae(e))t=e;else if(F(e))for(let n=0;n!!(e&&e.__v_isRef===!0),de=e=>ae(e)?e:e==null?"":F(e)||Z(e)&&(e.toString===bo||!U(e.toString))?Eo(e)?de(e.value):JSON.stringify(e,Ro,2):String(e),Ro=(e,t)=>Eo(t)?Ro(e,t.value):Ft(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[tr(r,o)+" =>"]=s,n),{})}:_o(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>tr(n))}:Ke(t)?tr(t):Z(t)&&!F(t)&&!xo(t)?String(t):t,tr=(e,t="")=>{var n;return Ke(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let xe;class dl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xe&&(xe.active?(this.parent=xe,this.index=(xe.scopes||(xe.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(xe===this)xe=this.prevScope;else{let t=xe;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n0)return;if(sn){let t=sn;for(sn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rn;){let t=rn;for(rn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Po(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function To(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Ur(r),pl(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function mr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Mo(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Mo(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===dn)||(e.globalVersion=dn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!mr(e))))return;e.flags|=2;const t=e.dep,n=ie,r=Be;ie=e,Be=!0;try{Po(e);const s=e.fn(e._value);(t.version===0||ot(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ie=n,Be=r,To(e),e.flags&=-3}}function Ur(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Ur(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function pl(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Be=!0;const $o=[];function pt(){$o.push(Be),Be=!1}function gt(){const e=$o.pop();Be=e===void 0?!0:e}function as(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ie;ie=void 0;try{t()}finally{ie=n}}}let dn=0;class gl{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Vr{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ie||!Be||ie===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ie)n=this.activeLink=new gl(ie,this),ie.deps?(n.prevDep=ie.depsTail,ie.depsTail.nextDep=n,ie.depsTail=n):ie.deps=ie.depsTail=n,Oo(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ie.depsTail,n.nextDep=void 0,ie.depsTail.nextDep=n,ie.depsTail=n,ie.deps===n&&(ie.deps=r)}return n}trigger(t){this.version++,dn++,this.notify(t)}notify(t){Fr();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Hr()}}}function Oo(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Oo(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const yr=new WeakMap,At=Symbol(""),_r=Symbol(""),hn=Symbol("");function Re(e,t,n){if(Be&&ie){let r=yr.get(e);r||yr.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Vr),s.map=r,s.key=n),s.track()}}function dt(e,t,n,r,s,o){const i=yr.get(e);if(!i){dn++;return}const l=c=>{c&&c.trigger()};if(Fr(),t==="clear")i.forEach(l);else{const c=F(e),f=c&&Nr(n);if(c&&n==="length"){const u=Number(r);i.forEach((h,p)=>{(p==="length"||p===hn||!Ke(p)&&p>=u)&&l(h)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),f&&l(i.get(hn)),t){case"add":c?f&&l(i.get("length")):(l(i.get(At)),Ft(e)&&l(i.get(_r)));break;case"delete":c||(l(i.get(At)),Ft(e)&&l(i.get(_r)));break;case"set":Ft(e)&&l(i.get(At));break}}Hr()}function $t(e){const t=J(e);return t===e?t:(Re(t,"iterate",hn),ze(e)?t:t.map(We))}function zn(e){return Re(e=J(e),"iterate",hn),e}function rt(e,t){return mt(e)?zt(Pt(e)?We(t):t):We(t)}const ml={__proto__:null,[Symbol.iterator](){return rr(this,Symbol.iterator,e=>rt(this,e))},concat(...e){return $t(this).concat(...e.map(t=>F(t)?$t(t):t))},entries(){return rr(this,"entries",e=>(e[1]=rt(this,e[1]),e))},every(e,t){return ct(this,"every",e,t,void 0,arguments)},filter(e,t){return ct(this,"filter",e,t,n=>n.map(r=>rt(this,r)),arguments)},find(e,t){return ct(this,"find",e,t,n=>rt(this,n),arguments)},findIndex(e,t){return ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ct(this,"findLast",e,t,n=>rt(this,n),arguments)},findLastIndex(e,t){return ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return sr(this,"includes",e)},indexOf(...e){return sr(this,"indexOf",e)},join(e){return $t(this).join(e)},lastIndexOf(...e){return sr(this,"lastIndexOf",e)},map(e,t){return ct(this,"map",e,t,void 0,arguments)},pop(){return Qt(this,"pop")},push(...e){return Qt(this,"push",e)},reduce(e,...t){return us(this,"reduce",e,t)},reduceRight(e,...t){return us(this,"reduceRight",e,t)},shift(){return Qt(this,"shift")},some(e,t){return ct(this,"some",e,t,void 0,arguments)},splice(...e){return Qt(this,"splice",e)},toReversed(){return $t(this).toReversed()},toSorted(e){return $t(this).toSorted(e)},toSpliced(...e){return $t(this).toSpliced(...e)},unshift(...e){return Qt(this,"unshift",e)},values(){return rr(this,"values",e=>rt(this,e))}};function rr(e,t,n){const r=zn(e),s=r[t]();return r!==e&&!ze(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const yl=Array.prototype;function ct(e,t,n,r,s,o){const i=zn(e),l=i!==e&&!ze(e),c=i[t];if(c!==yl[t]){const h=c.apply(e,o);return l?We(h):h}let f=n;i!==e&&(l?f=function(h,p){return n.call(this,rt(e,h),p,e)}:n.length>2&&(f=function(h,p){return n.call(this,h,p,e)}));const u=c.call(i,f,r);return l&&s?s(u):u}function us(e,t,n,r){const s=zn(e),o=s!==e&&!ze(e);let i=n,l=!1;s!==e&&(o?(l=r.length===0,i=function(f,u,h){return l&&(l=!1,f=rt(e,f)),n.call(this,f,rt(e,u),h,e)}):n.length>3&&(i=function(f,u,h){return n.call(this,f,u,h,e)}));const c=s[t](i,...r);return l?rt(e,c):c}function sr(e,t,n){const r=J(e);Re(r,"iterate",hn);const s=r[t](...n);return(s===-1||s===!1)&&Br(n[0])?(n[0]=J(n[0]),r[t](...n)):s}function Qt(e,t,n=[]){pt(),Fr();const r=J(e)[t].apply(e,n);return Hr(),gt(),r}const _l=Or("__proto__,__v_isRef,__isVue"),jo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ke));function vl(e){Ke(e)||(e=String(e));const t=J(this);return Re(t,"has",e),t.hasOwnProperty(e)}class No{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Pl:Fo:o?Do:Lo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=F(t);if(!s){let c;if(i&&(c=ml[n]))return c;if(n==="hasOwnProperty")return vl}const l=Reflect.get(t,n,ke(t)?t:r);if((Ke(n)?jo.has(n):_l(n))||(s||Re(t,"get",n),o))return l;if(ke(l)){const c=i&&Nr(n)?l:l.value;return s&&Z(c)?An(c):c}return Z(l)?s?An(l):qn(l):l}}class Io extends No{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=F(t)&&Nr(n);if(!this._isShallow){const f=mt(o);if(!ze(r)&&!mt(r)&&(o=J(o),r=J(r)),!i&&ke(o)&&!ke(r))return f||(o.value=r),!0}const l=i?Number(n)e,wn=e=>Reflect.getPrototypeOf(e);function El(e,t,n){return function(...r){const s=this.__v_raw,o=J(s),i=Ft(o),l=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,f=s[e](...r),u=n?vr:t?zt:We;return!t&&Re(o,"iterate",c?_r:At),Ee(Object.create(f),{next(){const{value:h,done:p}=f.next();return p?{value:h,done:p}:{value:l?[u(h[0]),u(h[1])]:u(h),done:p}}})}}function Sn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Rl(e,t){const n={get(s){const o=this.__v_raw,i=J(o),l=J(s);e||(ot(s,l)&&Re(i,"get",s),Re(i,"get",l));const{has:c}=wn(i),f=t?vr:e?zt:We;if(c.call(i,s))return f(o.get(s));if(c.call(i,l))return f(o.get(l));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Re(J(s),"iterate",At),s.size},has(s){const o=this.__v_raw,i=J(o),l=J(s);return e||(ot(s,l)&&Re(i,"has",s),Re(i,"has",l)),s===l?o.has(s):o.has(s)||o.has(l)},forEach(s,o){const i=this,l=i.__v_raw,c=J(l),f=t?vr:e?zt:We;return!e&&Re(c,"iterate",At),l.forEach((u,h)=>s.call(o,f(u),f(h),i))}};return Ee(n,e?{add:Sn("add"),set:Sn("set"),delete:Sn("delete"),clear:Sn("clear")}:{add(s){const o=J(this),i=wn(o),l=J(s),c=!t&&!ze(s)&&!mt(s)?l:s;return i.has.call(o,c)||ot(s,c)&&i.has.call(o,s)||ot(l,c)&&i.has.call(o,l)||(o.add(c),dt(o,"add",c,c)),this},set(s,o){!t&&!ze(o)&&!mt(o)&&(o=J(o));const i=J(this),{has:l,get:c}=wn(i);let f=l.call(i,s);f||(s=J(s),f=l.call(i,s));const u=c.call(i,s);return i.set(s,o),f?ot(o,u)&&dt(i,"set",s,o):dt(i,"add",s,o),this},delete(s){const o=J(this),{has:i,get:l}=wn(o);let c=i.call(o,s);c||(s=J(s),c=i.call(o,s)),l&&l.call(o,s);const f=o.delete(s);return c&&dt(o,"delete",s,void 0),f},clear(){const s=J(this),o=s.size!==0,i=s.clear();return o&&dt(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=El(s,e,t)}),n}function zr(e,t){const n=Rl(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(Y(n,s)&&s in r?n:r,s,o)}const Cl={get:zr(!1,!1)},kl={get:zr(!1,!0)},Al={get:zr(!0,!1)};const Lo=new WeakMap,Do=new WeakMap,Fo=new WeakMap,Pl=new WeakMap;function Tl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qn(e){return mt(e)?e:qr(e,!1,xl,Cl,Lo)}function Ho(e){return qr(e,!1,Sl,kl,Do)}function An(e){return qr(e,!0,wl,Al,Fo)}function qr(e,t,n,r,s){if(!Z(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=s.get(e);if(o)return o;const i=Tl(nl(e));if(i===0)return e;const l=new Proxy(e,i===2?r:n);return s.set(e,l),l}function Pt(e){return mt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function mt(e){return!!(e&&e.__v_isReadonly)}function ze(e){return!!(e&&e.__v_isShallow)}function Br(e){return e?!!e.__v_raw:!1}function J(e){const t=e&&e.__v_raw;return t?J(t):e}function Ml(e){return!Y(e,"__v_skip")&&Object.isExtensible(e)&&wo(e,"__v_skip",!0),e}const We=e=>Z(e)?qn(e):e,zt=e=>Z(e)?An(e):e;function ke(e){return e?e.__v_isRef===!0:!1}function Ie(e){return Uo(e,!1)}function $l(e){return Uo(e,!0)}function Uo(e,t){return ke(e)?e:new Ol(e,t)}class Ol{constructor(t,n){this.dep=new Vr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:J(t),this._value=n?t:We(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||ze(t)||mt(t);t=r?t:J(t),ot(t,n)&&(this._rawValue=t,this._value=r?t:We(t),this.dep.trigger())}}function X(e){return ke(e)?e.value:e}const jl={get:(e,t,n)=>t==="__v_raw"?e:X(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return ke(s)&&!ke(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Vo(e){return Pt(e)?e:new Proxy(e,jl)}class Nl{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Vr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=dn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ie!==this)return Ao(this,!0),!0}get value(){const t=this.dep.track();return Mo(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Il(e,t,n=!1){let r,s;return U(e)?r=e:(r=e.get,s=e.set),new Nl(r,s,n)}const En={},Pn=new WeakMap;let Ct;function Ll(e,t=!1,n=Ct){if(n){let r=Pn.get(n);r||Pn.set(n,r=[]),r.push(e)}}function Dl(e,t,n=re){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:l,call:c}=n,f=$=>s?$:ze($)||s===!1||s===0?ht($,1):ht($);let u,h,p,g,R=!1,w=!1;if(ke(e)?(h=()=>e.value,R=ze(e)):Pt(e)?(h=()=>f(e),R=!0):F(e)?(w=!0,R=e.some($=>Pt($)||ze($)),h=()=>e.map($=>{if(ke($))return $.value;if(Pt($))return f($);if(U($))return c?c($,2):$()})):U(e)?t?h=c?()=>c(e,2):e:h=()=>{if(p){pt();try{p()}finally{gt()}}const $=Ct;Ct=u;try{return c?c(e,3,[g]):e(g)}finally{Ct=$}}:h=it,t&&s){const $=h,G=s===!0?1/0:s;h=()=>ht($(),G)}const I=hl(),O=()=>{u.stop(),I&&I.active&&jr(I.effects,u)};if(o&&t){const $=t;t=(...G)=>{$(...G),O()}}let k=w?new Array(e.length).fill(En):En;const M=$=>{if(!(!(u.flags&1)||!u.dirty&&!$))if(t){const G=u.run();if(s||R||(w?G.some((me,se)=>ot(me,k[se])):ot(G,k))){p&&p();const me=Ct;Ct=u;try{const se=[G,k===En?void 0:w&&k[0]===En?[]:k,g];k=G,c?c(t,3,se):t(...se)}finally{Ct=me}}}else u.run()};return l&&l(M),u=new Co(h),u.scheduler=i?()=>i(M,!1):M,g=$=>Ll($,!1,u),p=u.onStop=()=>{const $=Pn.get(u);if($){if(c)c($,4);else for(const G of $)G();Pn.delete(u)}},t?r?M(!0):k=u.run():i?i(M.bind(null,!0),!0):u.run(),O.pause=u.pause.bind(u),O.resume=u.resume.bind(u),O.stop=O,O}function ht(e,t=1/0,n){if(t<=0||!Z(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ke(e))ht(e.value,t,n);else if(F(e))for(let r=0;r{ht(r,t,n)});else if(xo(e)){for(const r in e)ht(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ht(e[r],t,n)}return e}function bn(e,t,n,r){try{return r?e(...r):e()}catch(s){Bn(s,t,n)}}function Ge(e,t,n,r){if(U(e)){const s=bn(e,t,n,r);return s&&vo(s)&&s.catch(o=>{Bn(o,t,n)}),s}if(F(e)){const s=[];for(let o=0;o>>1,s=Me[r],o=pn(s);o=pn(n)?Me.push(e):Me.splice(Hl(t),0,e),e.flags|=1,Bo()}}function Bo(){Tn||(Tn=zo.then(Wo))}function Ul(e){F(e)?Ht.push(...e):bt&&e.id===-1?bt.splice(jt+1,0,e):e.flags&1||(Ht.push(e),e.flags|=1),Bo()}function fs(e,t,n=nt+1){for(;npn(n)-pn(r));if(Ht.length=0,bt){bt.push(...t);return}for(bt=t,jt=0;jte.id==null?e.flags&2?-1:1/0:e.id;function Wo(e){try{for(nt=0;nt{r._d&&jn(-1);const o=Mn(t);let i;try{i=e(...s)}finally{Mn(o),r._d&&jn(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function ds(e,t){if(Se===null)return e;const n=Jn(Se),r=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&U(t)?t.call(r&&r.proxy):t}}const Vl=Symbol.for("v-scx"),zl=()=>qe(Vl);function on(e,t,n){return Qo(e,t,n)}function Qo(e,t,n=re){const{immediate:r,deep:s,flush:o,once:i}=n,l=Ee({},n),c=t&&r||!t&&o!=="post";let f;if(yn){if(o==="sync"){const g=zl();f=g.__watcherHandles||(g.__watcherHandles=[])}else if(!c){const g=()=>{};return g.stop=it,g.resume=it,g.pause=it,g}}const u=Ce;l.call=(g,R,w)=>Ge(g,u,R,w);let h=!1;o==="post"?l.scheduler=g=>{Ne(g,u&&u.suspense)}:o!=="sync"&&(h=!0,l.scheduler=(g,R)=>{R?g():Kr(g)}),l.augmentJob=g=>{t&&(g.flags|=4),h&&(g.flags|=2,u&&(g.id=u.uid,g.i=u))};const p=Dl(e,t,l);return yn&&(f?f.push(p):c&&p()),p}function ql(e,t,n){const r=this.proxy,s=ae(e)?e.includes(".")?Jo(r,e):()=>r[e]:e.bind(r,r);let o;U(t)?o=t:(o=t.handler,n=t);const i=xn(this),l=Qo(s,o.bind(r),n);return i(),l}function Jo(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;se.__isTeleport,or=Symbol("_leaveCb");function Wr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Wr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function lt(e,t){return U(e)?Ee({name:e.name},t,{setup:e}):e}function Yo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function hs(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const $n=new WeakMap;function ln(e,t,n,r,s=!1){if(F(e)){e.forEach((w,I)=>ln(w,t&&(F(t)?t[I]:t),n,r,s));return}if(Ut(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ln(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Jn(r.component):r.el,i=s?null:o,{i:l,r:c}=e,f=t&&t.r,u=l.refs===re?l.refs={}:l.refs,h=l.setupState,p=J(h),g=h===re?yo:w=>hs(u,w)?!1:Y(p,w),R=(w,I)=>!(I&&hs(u,I));if(f!=null&&f!==c){if(ps(t),ae(f))u[f]=null,g(f)&&(h[f]=null);else if(ke(f)){const w=t;R(f,w.k)&&(f.value=null),w.k&&(u[w.k]=null)}}if(U(c))bn(c,l,12,[i,u]);else{const w=ae(c),I=ke(c);if(w||I){const O=()=>{if(e.f){const k=w?g(c)?h[c]:u[c]:R()||!e.k?c.value:u[e.k];if(s)F(k)&&jr(k,o);else if(F(k))k.includes(o)||k.push(o);else if(w)u[c]=[o],g(c)&&(h[c]=u[c]);else{const M=[o];R(c,e.k)&&(c.value=M),e.k&&(u[e.k]=M)}}else w?(u[c]=i,g(c)&&(h[c]=i)):I&&(R(c,e.k)&&(c.value=i),e.k&&(u[e.k]=i))};if(i){const k=()=>{O(),$n.delete(e)};k.id=-1,$n.set(e,k),Ne(k,n)}else ps(e),O()}}}function ps(e){const t=$n.get(e);t&&(t.flags|=8,$n.delete(e))}Vn().requestIdleCallback;Vn().cancelIdleCallback;const Ut=e=>!!e.type.__asyncLoader,Xo=e=>e.type.__isKeepAlive;function Wl(e,t){Zo(e,"a",t)}function Gl(e,t){Zo(e,"da",t)}function Zo(e,t,n=Ce){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Wn(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Xo(s.parent.vnode)&&Ql(r,t,n,s),s=s.parent}}function Ql(e,t,n,r){const s=Wn(t,e,r,!0);ei(()=>{jr(r[t],s)},n)}function Wn(e,t,n=Ce,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{pt();const l=xn(n),c=Ge(t,n,e,i);return l(),gt(),c});return r?s.unshift(o):s.push(o),o}}const _t=e=>(t,n=Ce)=>{(!yn||e==="sp")&&Wn(e,(...r)=>t(...r),n)},Jl=_t("bm"),Yl=_t("m"),Xl=_t("bu"),Zl=_t("u"),ec=_t("bum"),ei=_t("um"),tc=_t("sp"),nc=_t("rtg"),rc=_t("rtc");function sc(e,t=Ce){Wn("ec",e,t)}const oc="components",ti=Symbol.for("v-ndc");function ni(e){return ae(e)?ic(oc,e,!1)||e:e||ti}function ic(e,t,n=!0,r=!1){const s=Se||Ce;if(s){const o=s.type;{const l=Kc(o,!1);if(l&&(l===t||l===$e(t)||l===Un($e(t))))return o}const i=gs(s[e]||o[e],t)||gs(s.appContext[e],t);return!i&&r?o:i}}function gs(e,t){return e&&(e[t]||e[$e(t)]||e[Un($e(t))])}function kt(e,t,n,r){let s;const o=n,i=F(e);if(i||ae(e)){const l=i&&Pt(e);let c=!1,f=!1;l&&(c=!ze(e),f=mt(e),e=zn(e)),s=new Array(e.length);for(let u=0,h=e.length;ut(l,c,void 0,o));else{const l=Object.keys(e);s=new Array(l.length);for(let c=0,f=l.length;c0;return z(),Qe(fe,null,[ge("slot",n,r)],f?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),z();const i=o&&ri(o(n)),l=n.key||i&&i.key,c=Qe(fe,{key:(l&&!Ke(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),o&&o._c&&(o._d=!0),c}function ri(e){return e.some(t=>mn(t)?!(t.type===yt||t.type===fe&&!ri(t.children)):!0)?e:null}const br=e=>e?Ei(e)?Jn(e):br(e.parent):null,cn=Ee(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>br(e.parent),$root:e=>br(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oi(e),$forceUpdate:e=>e.f||(e.f=()=>{Kr(e.update)}),$nextTick:e=>e.n||(e.n=qo.bind(e.proxy)),$watch:e=>ql.bind(e)}),ir=(e,t)=>e!==re&&!e.__isScriptSetup&&Y(e,t),cc={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:l,appContext:c}=e;if(t[0]!=="$"){const p=i[t];if(p!==void 0)switch(p){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(ir(r,t))return i[t]=1,r[t];if(s!==re&&Y(s,t))return i[t]=2,s[t];if(Y(o,t))return i[t]=3,o[t];if(n!==re&&Y(n,t))return i[t]=4,n[t];xr&&(i[t]=0)}}const f=cn[t];let u,h;if(f)return t==="$attrs"&&Re(e.attrs,"get",""),f(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==re&&Y(n,t))return i[t]=4,n[t];if(h=c.config.globalProperties,Y(h,t))return h[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return ir(s,t)?(s[t]=n,!0):r!==re&&Y(r,t)?(r[t]=n,!0):Y(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},l){let c;return!!(n[l]||e!==re&&l[0]!=="$"&&Y(e,l)||ir(t,l)||Y(o,l)||Y(r,l)||Y(cn,l)||Y(s.config.globalProperties,l)||(c=i.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Y(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ms(e){return F(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xr=!0;function ac(e){const t=oi(e),n=e.proxy,r=e.ctx;xr=!1,t.beforeCreate&&ys(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:l,provide:c,inject:f,created:u,beforeMount:h,mounted:p,beforeUpdate:g,updated:R,activated:w,deactivated:I,beforeDestroy:O,beforeUnmount:k,destroyed:M,unmounted:$,render:G,renderTracked:me,renderTriggered:se,errorCaptured:He,serverPrefetch:Ue,expose:Oe,inheritAttrs:Ve,components:Ye,directives:je,filters:St}=t;if(f&&uc(f,r,null),i)for(const K in i){const q=i[K];U(q)&&(r[K]=q.bind(n))}if(s){const K=s.call(n,n);Z(K)&&(e.data=qn(K))}if(xr=!0,o)for(const K in o){const q=o[K],ye=U(q)?q.bind(n,n):U(q.get)?q.get.bind(n,n):it,ee=!U(q)&&U(q.set)?q.set.bind(n):it,Le=ce({get:ye,set:ee});Object.defineProperty(r,K,{enumerable:!0,configurable:!0,get:()=>Le.value,set:_e=>Le.value=_e})}if(l)for(const K in l)si(l[K],r,n,K);if(c){const K=U(c)?c.call(n):c;Reflect.ownKeys(K).forEach(q=>{Cn(q,K[q])})}u&&ys(u,e,"c");function he(K,q){F(q)?q.forEach(ye=>K(ye.bind(n))):q&&K(q.bind(n))}if(he(Jl,h),he(Yl,p),he(Xl,g),he(Zl,R),he(Wl,w),he(Gl,I),he(sc,He),he(rc,me),he(nc,se),he(ec,k),he(ei,$),he(tc,Ue),F(Oe))if(Oe.length){const K=e.exposed||(e.exposed={});Oe.forEach(q=>{Object.defineProperty(K,q,{get:()=>n[q],set:ye=>n[q]=ye,enumerable:!0})})}else e.exposed||(e.exposed={});G&&e.render===it&&(e.render=G),Ve!=null&&(e.inheritAttrs=Ve),Ye&&(e.components=Ye),je&&(e.directives=je),Ue&&Yo(e)}function uc(e,t,n=it){F(e)&&(e=wr(e));for(const r in e){const s=e[r];let o;Z(s)?"default"in s?o=qe(s.from||r,s.default,!0):o=qe(s.from||r):o=qe(s),ke(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ys(e,t,n){Ge(F(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function si(e,t,n,r){let s=r.includes(".")?Jo(n,r):()=>n[r];if(ae(e)){const o=t[e];U(o)&&on(s,o)}else if(U(e))on(s,e.bind(n));else if(Z(e))if(F(e))e.forEach(o=>si(o,t,n,r));else{const o=U(e.handler)?e.handler.bind(n):t[e.handler];U(o)&&on(s,o,e)}}function oi(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let c;return l?c=l:!s.length&&!n&&!r?c=t:(c={},s.length&&s.forEach(f=>On(c,f,i,!0)),On(c,t,i)),Z(t)&&o.set(t,c),c}function On(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&On(e,o,n,!0),s&&s.forEach(i=>On(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const l=fc[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const fc={data:_s,props:vs,emits:vs,methods:Zt,computed:Zt,beforeCreate:Te,created:Te,beforeMount:Te,mounted:Te,beforeUpdate:Te,updated:Te,beforeDestroy:Te,beforeUnmount:Te,destroyed:Te,unmounted:Te,activated:Te,deactivated:Te,errorCaptured:Te,serverPrefetch:Te,components:Zt,directives:Zt,watch:hc,provide:_s,inject:dc};function _s(e,t){return t?e?function(){return Ee(U(e)?e.call(this,this):e,U(t)?t.call(this,this):t)}:t:e}function dc(e,t){return Zt(wr(e),wr(t))}function wr(e){if(F(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${$e(t)}Modifiers`]||e[`${Mt(t)}Modifiers`];function yc(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||re;let s=n;const o=t.startsWith("update:"),i=o&&mc(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>ae(u)?u.trim():u)),i.number&&(s=n.map(Ir)));let l,c=r[l=er(t)]||r[l=er($e(t))];!c&&o&&(c=r[l=er(Mt(t))]),c&&Ge(c,e,6,s);const f=r[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ge(f,e,6,s)}}const _c=new WeakMap;function li(e,t,n=!1){const r=n?_c:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},l=!1;if(!U(e)){const c=f=>{const u=li(f,t,!0);u&&(l=!0,Ee(i,u))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!l?(Z(e)&&r.set(e,null),null):(F(o)?o.forEach(c=>i[c]=null):Ee(i,o),Z(e)&&r.set(e,i),i)}function Gn(e,t){return!e||!Dn(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,Mt(t))||Y(e,t))}function bs(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:l,emit:c,render:f,renderCache:u,props:h,data:p,setupState:g,ctx:R,inheritAttrs:w}=e,I=Mn(e);let O,k;try{if(n.shapeFlag&4){const $=s||r,G=$;O=st(f.call(G,$,u,h,g,p,R)),k=l}else{const $=t;O=st($.length>1?$(h,{attrs:l,slots:i,emit:c}):$(h,null)),k=t.props?l:vc(l)}}catch($){an.length=0,Bn($,e,1),O=ge(yt)}let M=O;if(k&&w!==!1){const $=Object.keys(k),{shapeFlag:G}=M;$.length&&G&7&&(o&&$.some(Fn)&&(k=bc(k,o)),M=qt(M,k,!1,!0))}return n.dirs&&(M=qt(M,null,!1,!0),M.dirs=M.dirs?M.dirs.concat(n.dirs):n.dirs),n.transition&&Wr(M,n.transition),O=M,Mn(I),O}const vc=e=>{let t;for(const n in e)(n==="class"||n==="style"||Dn(n))&&((t||(t={}))[n]=e[n]);return t},bc=(e,t)=>{const n={};for(const r in e)(!Fn(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function xc(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:l,patchFlag:c}=t,f=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?xs(r,i,f):!!i;if(c&8){const u=t.dynamicProps;for(let h=0;hObject.create(ai),fi=e=>Object.getPrototypeOf(e)===ai;function Sc(e,t,n,r=!1){const s={},o=ui();e.propsDefaults=Object.create(null),di(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Ho(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Ec(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,l=J(s),[c]=e.propsOptions;let f=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[p,g]=hi(h,t,!0);Ee(i,p),g&&l.push(...g)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!c)return Z(e)&&r.set(e,Dt),Dt;if(F(o))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",Qr=e=>F(e)?e.map(st):[st(e)],Cc=(e,t,n)=>{if(t._n)return t;const r=Kn((...s)=>Qr(t(...s)),n);return r._c=!1,r},pi=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Gr(s))continue;const o=e[s];if(U(o))t[s]=Cc(s,o,r);else if(o!=null){const i=Qr(o);t[s]=()=>i}}},gi=(e,t)=>{const n=Qr(t);e.slots.default=()=>n},mi=(e,t,n)=>{for(const r in t)(n||!Gr(r))&&(e[r]=t[r])},kc=(e,t,n)=>{const r=e.slots=ui();if(e.vnode.shapeFlag&32){const s=t._;s?(mi(r,t,n),n&&wo(r,"_",s,!0)):pi(t,r)}else t&&gi(e,t)},Ac=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=re;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:mi(s,t,n):(o=!t.$stable,pi(t,s)),i=t}else t&&(gi(e,t),i={default:1});if(o)for(const l in s)!Gr(l)&&i[l]==null&&delete s[l]},Ne=Oc;function Pc(e){return Tc(e)}function Tc(e,t){const n=Vn();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:l,createComment:c,setText:f,setElementText:u,parentNode:h,nextSibling:p,setScopeId:g=it,insertStaticContent:R}=e,w=(a,d,m,v=null,b=null,_=null,C=void 0,E=null,S=!!d.dynamicChildren)=>{if(a===d)return;a&&!Jt(a,d)&&(v=y(a),_e(a,b,_,!0),a=null),d.patchFlag===-2&&(S=!1,d.dynamicChildren=null);const{type:x,ref:L,shapeFlag:P}=d;switch(x){case Qn:I(a,d,m,v);break;case yt:O(a,d,m,v);break;case cr:a==null&&k(d,m,v,C);break;case fe:Ye(a,d,m,v,b,_,C,E,S);break;default:P&1?G(a,d,m,v,b,_,C,E,S):P&6?je(a,d,m,v,b,_,C,E,S):(P&64||P&128)&&x.process(a,d,m,v,b,_,C,E,S,j)}L!=null&&b?ln(L,a&&a.ref,_,d||a,!d):L==null&&a&&a.ref!=null&&ln(a.ref,null,_,a,!0)},I=(a,d,m,v)=>{if(a==null)r(d.el=l(d.children),m,v);else{const b=d.el=a.el;d.children!==a.children&&f(b,d.children)}},O=(a,d,m,v)=>{a==null?r(d.el=c(d.children||""),m,v):d.el=a.el},k=(a,d,m,v)=>{[a.el,a.anchor]=R(a.children,d,m,v,a.el,a.anchor)},M=({el:a,anchor:d},m,v)=>{let b;for(;a&&a!==d;)b=p(a),r(a,m,v),a=b;r(d,m,v)},$=({el:a,anchor:d})=>{let m;for(;a&&a!==d;)m=p(a),s(a),a=m;s(d)},G=(a,d,m,v,b,_,C,E,S)=>{if(d.type==="svg"?C="svg":d.type==="math"&&(C="mathml"),a==null)me(d,m,v,b,_,C,E,S);else{const x=a.el&&a.el._isVueCE?a.el:null;try{x&&x._beginPatch(),Ue(a,d,b,_,C,E,S)}finally{x&&x._endPatch()}}},me=(a,d,m,v,b,_,C,E)=>{let S,x;const{props:L,shapeFlag:P,transition:N,dirs:D}=a;if(S=a.el=i(a.type,_,L&&L.is,L),P&8?u(S,a.children):P&16&&He(a.children,S,null,v,b,lr(a,_),C,E),D&&Et(a,null,v,"created"),se(S,a,a.scopeId,C,v),L){for(const ne in L)ne!=="value"&&!nn(ne)&&o(S,ne,null,L[ne],_,v);"value"in L&&o(S,"value",null,L.value,_),(x=L.onVnodeBeforeMount)&&tt(x,v,a)}D&&Et(a,null,v,"beforeMount");const W=Mc(b,N);W&&N.beforeEnter(S),r(S,d,m),((x=L&&L.onVnodeMounted)||W||D)&&Ne(()=>{x&&tt(x,v,a),W&&N.enter(S),D&&Et(a,null,v,"mounted")},b)},se=(a,d,m,v,b)=>{if(m&&g(a,m),v)for(let _=0;_{for(let x=S;x{const E=d.el=a.el;let{patchFlag:S,dynamicChildren:x,dirs:L}=d;S|=a.patchFlag&16;const P=a.props||re,N=d.props||re;let D;if(m&&Rt(m,!1),(D=N.onVnodeBeforeUpdate)&&tt(D,m,d,a),L&&Et(d,a,m,"beforeUpdate"),m&&Rt(m,!0),(P.innerHTML&&N.innerHTML==null||P.textContent&&N.textContent==null)&&u(E,""),x?Oe(a.dynamicChildren,x,E,m,v,lr(d,b),_):C||q(a,d,E,null,m,v,lr(d,b),_,!1),S>0){if(S&16)Ve(E,P,N,m,b);else if(S&2&&P.class!==N.class&&o(E,"class",null,N.class,b),S&4&&o(E,"style",P.style,N.style,b),S&8){const W=d.dynamicProps;for(let ne=0;ne{D&&tt(D,m,d,a),L&&Et(d,a,m,"updated")},v)},Oe=(a,d,m,v,b,_,C)=>{for(let E=0;E{if(d!==m){if(d!==re)for(const _ in d)!nn(_)&&!(_ in m)&&o(a,_,d[_],null,b,v);for(const _ in m){if(nn(_))continue;const C=m[_],E=d[_];C!==E&&_!=="value"&&o(a,_,E,C,b,v)}"value"in m&&o(a,"value",d.value,m.value,b)}},Ye=(a,d,m,v,b,_,C,E,S)=>{const x=d.el=a?a.el:l(""),L=d.anchor=a?a.anchor:l("");let{patchFlag:P,dynamicChildren:N,slotScopeIds:D}=d;D&&(E=E?E.concat(D):D),a==null?(r(x,m,v),r(L,m,v),He(d.children||[],m,L,b,_,C,E,S)):P>0&&P&64&&N&&a.dynamicChildren&&a.dynamicChildren.length===N.length?(Oe(a.dynamicChildren,N,m,b,_,C,E),(d.key!=null||b&&d===b.subTree)&&yi(a,d,!0)):q(a,d,m,L,b,_,C,E,S)},je=(a,d,m,v,b,_,C,E,S)=>{d.slotScopeIds=E,a==null?d.shapeFlag&512?b.ctx.activate(d,m,v,C,S):St(d,m,v,b,_,C,S):Ae(a,d,S)},St=(a,d,m,v,b,_,C)=>{const E=a.component=Hc(a,v,b);if(Xo(a)&&(E.ctx.renderer=j),Vc(E,!1,C),E.asyncDep){if(b&&b.registerDep(E,he,C),!a.el){const S=E.subTree=ge(yt);O(null,S,d,m),a.placeholder=S.el}}else he(E,a,d,m,b,_,C)},Ae=(a,d,m)=>{const v=d.component=a.component;if(xc(a,d,m))if(v.asyncDep&&!v.asyncResolved){K(v,d,m);return}else v.next=d,v.update();else d.el=a.el,v.vnode=d},he=(a,d,m,v,b,_,C)=>{const E=()=>{if(a.isMounted){let{next:P,bu:N,u:D,parent:W,vnode:ne}=a;{const Ze=_i(a);if(Ze){P&&(P.el=ne.el,K(a,P,C)),Ze.asyncDep.then(()=>{Ne(()=>{a.isUnmounted||x()},b)});return}}let te=P,pe;Rt(a,!1),P?(P.el=ne.el,K(a,P,C)):P=ne,N&&Rn(N),(pe=P.props&&P.props.onVnodeBeforeUpdate)&&tt(pe,W,P,ne),Rt(a,!0);const be=bs(a),Xe=a.subTree;a.subTree=be,w(Xe,be,h(Xe.el),y(Xe),a,b,_),P.el=be.el,te===null&&wc(a,be.el),D&&Ne(D,b),(pe=P.props&&P.props.onVnodeUpdated)&&Ne(()=>tt(pe,W,P,ne),b)}else{let P;const{el:N,props:D}=d,{bm:W,m:ne,parent:te,root:pe,type:be}=a,Xe=Ut(d);Rt(a,!1),W&&Rn(W),!Xe&&(P=D&&D.onVnodeBeforeMount)&&tt(P,te,d),Rt(a,!0);{pe.ce&&pe.ce._hasShadowRoot()&&pe.ce._injectChildStyle(be,a.parent?a.parent.type:void 0);const Ze=a.subTree=bs(a);w(null,Ze,m,v,a,b,_),d.el=Ze.el}if(ne&&Ne(ne,b),!Xe&&(P=D&&D.onVnodeMounted)){const Ze=d;Ne(()=>tt(P,te,Ze),b)}(d.shapeFlag&256||te&&Ut(te.vnode)&&te.vnode.shapeFlag&256)&&a.a&&Ne(a.a,b),a.isMounted=!0,d=m=v=null}};a.scope.on();const S=a.effect=new Co(E);a.scope.off();const x=a.update=S.run.bind(S),L=a.job=S.runIfDirty.bind(S);L.i=a,L.id=a.uid,S.scheduler=()=>Kr(L),Rt(a,!0),x()},K=(a,d,m)=>{d.component=a;const v=a.vnode.props;a.vnode=d,a.next=null,Ec(a,d.props,v,m),Ac(a,d.children,m),pt(),fs(a),gt()},q=(a,d,m,v,b,_,C,E,S=!1)=>{const x=a&&a.children,L=a?a.shapeFlag:0,P=d.children,{patchFlag:N,shapeFlag:D}=d;if(N>0){if(N&128){ee(x,P,m,v,b,_,C,E,S);return}else if(N&256){ye(x,P,m,v,b,_,C,E,S);return}}D&8?(L&16&&ve(x,b,_),P!==x&&u(m,P)):L&16?D&16?ee(x,P,m,v,b,_,C,E,S):ve(x,b,_,!0):(L&8&&u(m,""),D&16&&He(P,m,v,b,_,C,E,S))},ye=(a,d,m,v,b,_,C,E,S)=>{a=a||Dt,d=d||Dt;const x=a.length,L=d.length,P=Math.min(x,L);let N;for(N=0;NL?ve(a,b,_,!0,!1,P):He(d,m,v,b,_,C,E,S,P)},ee=(a,d,m,v,b,_,C,E,S)=>{let x=0;const L=d.length;let P=a.length-1,N=L-1;for(;x<=P&&x<=N;){const D=a[x],W=d[x]=S?ft(d[x]):st(d[x]);if(Jt(D,W))w(D,W,m,null,b,_,C,E,S);else break;x++}for(;x<=P&&x<=N;){const D=a[P],W=d[N]=S?ft(d[N]):st(d[N]);if(Jt(D,W))w(D,W,m,null,b,_,C,E,S);else break;P--,N--}if(x>P){if(x<=N){const D=N+1,W=DN)for(;x<=P;)_e(a[x],b,_,!0),x++;else{const D=x,W=x,ne=new Map;for(x=W;x<=N;x++){const De=d[x]=S?ft(d[x]):st(d[x]);De.key!=null&&ne.set(De.key,x)}let te,pe=0;const be=N-W+1;let Xe=!1,Ze=0;const Gt=new Array(be);for(x=0;x=be){_e(De,b,_,!0);continue}let et;if(De.key!=null)et=ne.get(De.key);else for(te=W;te<=N;te++)if(Gt[te-W]===0&&Jt(De,d[te])){et=te;break}et===void 0?_e(De,b,_,!0):(Gt[et-W]=x+1,et>=Ze?Ze=et:Xe=!0,w(De,d[et],m,null,b,_,C,E,S),pe++)}const ss=Xe?$c(Gt):Dt;for(te=ss.length-1,x=be-1;x>=0;x--){const De=W+x,et=d[De],os=d[De+1],is=De+1{const{el:_,type:C,transition:E,children:S,shapeFlag:x}=a;if(x&6){Le(a.component.subTree,d,m,v);return}if(x&128){a.suspense.move(d,m,v);return}if(x&64){C.move(a,d,m,j);return}if(C===fe){r(_,d,m);for(let P=0;PE.enter(_),b));else{const{leave:P,delayLeave:N,afterLeave:D}=E,W=()=>{a.ctx.isUnmounted?s(_):r(_,d,m)},ne=()=>{const te=_._isLeaving||!!_[or];_._isLeaving&&_[or](!0),E.persisted&&!te?W():P(_,()=>{W(),D&&D()})};N?N(_,W,ne):ne()}else r(_,d,m)},_e=(a,d,m,v=!1,b=!1)=>{const{type:_,props:C,ref:E,children:S,dynamicChildren:x,shapeFlag:L,patchFlag:P,dirs:N,cacheIndex:D,memo:W}=a;if(P===-2&&(b=!1),E!=null&&(pt(),ln(E,null,m,a,!0),gt()),D!=null&&(d.renderCache[D]=void 0),L&256){d.ctx.deactivate(a);return}const ne=L&1&&N,te=!Ut(a);let pe;if(te&&(pe=C&&C.onVnodeBeforeUnmount)&&tt(pe,d,a),L&6)Pe(a.component,m,v);else{if(L&128){a.suspense.unmount(m,v);return}ne&&Et(a,null,d,"beforeUnmount"),L&64?a.type.remove(a,d,m,j,v):x&&!x.hasOnce&&(_!==fe||P>0&&P&64)?ve(x,d,m,!1,!0):(_===fe&&P&384||!b&&L&16)&&ve(S,d,m),v&&ue(a)}const be=W!=null&&D==null;(te&&(pe=C&&C.onVnodeUnmounted)||ne||be)&&Ne(()=>{pe&&tt(pe,d,a),ne&&Et(a,null,d,"unmounted"),be&&(a.el=null)},m)},ue=a=>{const{type:d,el:m,anchor:v,transition:b}=a;if(d===fe){oe(m,v);return}if(d===cr){$(a);return}const _=()=>{s(m),b&&!b.persisted&&b.afterLeave&&b.afterLeave()};if(a.shapeFlag&1&&b&&!b.persisted){const{leave:C,delayLeave:E}=b,S=()=>C(m,_);E?E(a.el,_,S):S()}else _()},oe=(a,d)=>{let m;for(;a!==d;)m=p(a),s(a),a=m;s(d)},Pe=(a,d,m)=>{const{bum:v,scope:b,job:_,subTree:C,um:E,m:S,a:x}=a;Ss(S),Ss(x),v&&Rn(v),b.stop(),_&&(_.flags|=8,_e(C,a,d,m)),E&&Ne(E,d),Ne(()=>{a.isUnmounted=!0},d)},ve=(a,d,m,v=!1,b=!1,_=0)=>{for(let C=_;C{if(a.shapeFlag&6)return y(a.component.subTree);if(a.shapeFlag&128)return a.suspense.next();const d=p(a.anchor||a.el),m=d&&d[Bl];return m?p(m):d};let T=!1;const A=(a,d,m)=>{let v;a==null?d._vnode&&(_e(d._vnode,null,null,!0),v=d._vnode.component):w(d._vnode||null,a,d,null,null,null,m),d._vnode=a,T||(T=!0,fs(v),Ko(),T=!1)},j={p:w,um:_e,m:Le,r:ue,mt:St,mc:He,pc:q,pbc:Oe,n:y,o:e};return{render:A,hydrate:void 0,createApp:gc(A)}}function lr({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Rt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Mc(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function yi(e,t,n=!1){const r=e.children,s=t.children;if(F(r)&&F(s))for(let o=0;o>1,e[n[l]]0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function _i(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_i(t)}function Ss(e){if(e)for(let t=0;te.__isSuspense;function Oc(e,t){t&&t.pendingBranch?F(e)?t.effects.push(...e):t.effects.push(e):Ul(e)}const fe=Symbol.for("v-fgt"),Qn=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),cr=Symbol.for("v-stc"),an=[];let Fe=null;function z(e=!1){an.push(Fe=e?null:[])}function jc(){an.pop(),Fe=an[an.length-1]||null}let gn=1;function jn(e,t=!1){gn+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function xi(e){return e.dynamicChildren=gn>0?Fe||Dt:null,jc(),gn>0&&Fe&&Fe.push(e),e}function le(e,t,n,r,s,o){return xi(H(e,t,n,r,s,o,!0))}function Qe(e,t,n,r,s){return xi(ge(e,t,n,r,s,!0))}function mn(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const wi=({key:e})=>e??null,kn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ae(e)||ke(e)||U(e)?{i:Se,r:e,k:t,f:!!n}:e:null);function H(e,t=null,n=null,r=0,s=null,o=e===fe?0:1,i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&wi(t),ref:t&&kn(t),scopeId:Go,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Se};return l?(Jr(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=ae(n)?8:16),gn>0&&!i&&Fe&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&Fe.push(c),c}const ge=Nc;function Nc(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===ti)&&(e=yt),mn(e)){const l=qt(e,t,!0);return n&&Jr(l,n),gn>0&&!o&&Fe&&(l.shapeFlag&6?Fe[Fe.indexOf(e)]=l:Fe.push(l)),l.patchFlag=-2,l}if(Wc(e)&&(e=e.__vccOpts),t){t=Ic(t);let{class:l,style:c}=t;l&&!ae(l)&&(t.class=wt(l)),Z(c)&&(Br(c)&&!F(c)&&(c=Ee({},c)),t.style=Lr(c))}const i=ae(e)?1:bi(e)?128:Kl(e)?64:Z(e)?4:U(e)?2:0;return H(e,t,n,r,s,i,o,!0)}function Ic(e){return e?Br(e)||fi(e)?Ee({},e):e:null}function qt(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:l,transition:c}=e,f=t?Lc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&wi(f),ref:t&&t.ref?n&&o?F(o)?o.concat(kn(t)):[o,kn(t)]:kn(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==fe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&qt(e.ssContent),ssFallback:e.ssFallback&&qt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Wr(u,c.clone(u)),u}function Si(e=" ",t=0){return ge(Qn,null,e,t)}function Nt(e="",t=!1){return t?(z(),Qe(yt,null,e)):ge(yt,null,e)}function st(e){return e==null||typeof e=="boolean"?ge(yt):F(e)?ge(fe,null,e.slice()):mn(e)?ft(e):ge(Qn,null,String(e))}function ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:qt(e)}function Jr(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(F(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Jr(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!fi(t)?t._ctx=Se:s===3&&Se&&(Se.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else U(t)?(t={default:t,_ctx:Se},n=32):(t=String(t),r&64?(n=16,t=[Si(t)]):n=8);e.children=t,e.shapeFlag|=n}function Lc(...e){const t={};for(let n=0;nCe||Se;let Nn,Er;{const e=Vn(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Nn=t("__VUE_INSTANCE_SETTERS__",n=>Ce=n),Er=t("__VUE_SSR_SETTERS__",n=>yn=n)}const xn=e=>{const t=Ce;return Nn(e),e.scope.on(),()=>{e.scope.off(),Nn(t)}},Es=()=>{Ce&&Ce.scope.off(),Nn(null)};function Ei(e){return e.vnode.shapeFlag&4}let yn=!1;function Vc(e,t=!1,n=!1){t&&Er(t);const{props:r,children:s}=e.vnode,o=Ei(e);Sc(e,r,o,t),kc(e,s,n||t);const i=o?zc(e,t):void 0;return t&&Er(!1),i}function zc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,cc);const{setup:r}=n;if(r){pt();const s=e.setupContext=r.length>1?Bc(e):null,o=xn(e),i=bn(r,e,0,[e.props,s]),l=vo(i);if(gt(),o(),(l||e.sp)&&!Ut(e)&&Yo(e),l){if(i.then(Es,Es),t)return i.then(c=>{Rs(e,c)}).catch(c=>{Bn(c,e,0)});e.asyncDep=i}else Rs(e,i)}else Ri(e)}function Rs(e,t,n){U(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Z(t)&&(e.setupState=Vo(t)),Ri(e)}function Ri(e,t,n){const r=e.type;e.render||(e.render=r.render||it);{const s=xn(e);pt();try{ac(e)}finally{gt(),s()}}}const qc={get(e,t){return Re(e,"get",""),e[t]}};function Bc(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,qc),slots:e.slots,emit:e.emit,expose:t}}function Jn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Vo(Ml(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in cn)return cn[n](e)},has(t,n){return n in t||n in cn}})):e.proxy}function Kc(e,t=!0){return U(e)?e.displayName||e.name:e.name||t&&e.__name}function Wc(e){return U(e)&&"__vccOpts"in e}const ce=(e,t)=>Il(e,t,yn);function _n(e,t,n){try{jn(-1);const r=arguments.length;return r===2?Z(t)&&!F(t)?mn(t)?ge(e,null,[t]):ge(e,t):ge(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&mn(n)&&(n=[n]),ge(e,t,n))}finally{jn(1)}}const Gc="3.5.35";let Rr;const Cs=typeof window<"u"&&window.trustedTypes;if(Cs)try{Rr=Cs.createPolicy("vue",{createHTML:e=>e})}catch{}const Ci=Rr?e=>Rr.createHTML(e):e=>e,Qc="http://www.w3.org/2000/svg",Jc="http://www.w3.org/1998/Math/MathML",ut=typeof document<"u"?document:null,ks=ut&&ut.createElement("template"),Yc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?ut.createElementNS(Qc,e):t==="mathml"?ut.createElementNS(Jc,e):n?ut.createElement(e,{is:n}):ut.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>ut.createTextNode(e),createComment:e=>ut.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ut.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{ks.innerHTML=Ci(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=ks.content;if(r==="svg"||r==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Xc=Symbol("_vtc");function Zc(e,t,n){const r=e[Xc];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const As=Symbol("_vod"),ea=Symbol("_vsh"),ta=Symbol(""),na=/(?:^|;)\s*display\s*:/;function ra(e,t,n){const r=e.style,s=ae(n);let o=!1;if(n&&!s){if(t)if(ae(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&en(r,l,"")}else for(const i in t)n[i]==null&&en(r,i,"");for(const i in n){i==="display"&&(o=!0);const l=n[i];l!=null?oa(e,i,!ae(t)&&t?t[i]:void 0,l)||en(r,i,l):en(r,i,"")}}else if(s){if(t!==n){const i=r[ta];i&&(n+=";"+i),r.cssText=n,o=na.test(n)}}else t&&e.removeAttribute("style");As in e&&(e[As]=o?r.display:"",e[ea]&&(r.display="none"))}const Ps=/\s*!important$/;function en(e,t,n){if(F(n))n.forEach(r=>en(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=sa(e,t);Ps.test(n)?e.setProperty(Mt(r),n.replace(Ps,""),"important"):e[r]=n}}const Ts=["Webkit","Moz","ms"],ar={};function sa(e,t){const n=ar[t];if(n)return n;let r=$e(t);if(r!=="filter"&&r in e)return ar[t]=r;r=Un(r);for(let s=0;sur||(aa.then(()=>ur=0),ur=Date.now());function fa(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const s=n.value;if(F(s)){const o=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{o.call(r),r._stopped=!0};const i=s.slice(),l=[r];for(let c=0;ce.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,da=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?Zc(e,r,i):t==="style"?ra(e,n,r):Dn(t)?Fn(t)||la(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ha(e,t,r,i))?(Os(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&$s(e,t,r,i,o,t!=="value")):e._isVueCE&&(pa(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ae(r)))?Os(e,$e(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),$s(e,t,r,i))};function ha(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Is(t)&&U(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Is(t)&&ae(n)?!1:t in e}function pa(e,t){const n=e._def.props;if(!n)return!1;const r=$e(t);return Array.isArray(n)?n.some(s=>$e(s)===r):Object.keys(n).some(s=>$e(s)===r)}const Ls=e=>{const t=e.props["onUpdate:modelValue"]||!1;return F(t)?n=>Rn(t,n):t};function ga(e){e.target.composing=!0}function Ds(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const fr=Symbol("_assign");function Fs(e,t,n){return t&&(e=e.trim()),n&&(e=Ir(e)),e}const Hs={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[fr]=Ls(s);const o=r||s.props&&s.props.type==="number";It(e,t?"change":"input",i=>{i.target.composing||e[fr](Fs(e.value,n,o))}),(n||o)&&It(e,"change",()=>{e.value=Fs(e.value,n,o)}),t||(It(e,"compositionstart",ga),It(e,"compositionend",Ds),It(e,"change",Ds))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[fr]=Ls(i),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?Ir(e.value):e.value,c=t??"";if(l===c)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===c)||(e.value=c)}},ma=["ctrl","shift","alt","meta"],ya={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ma.some(n=>e[`${n}Key`]&&!t.includes(n))},_a=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i{const t=ba().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Sa(r);if(!s)return;const o=t._component;!U(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,wa(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function wa(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Sa(e){return ae(e)?document.querySelector(e):e}const Lt=typeof document<"u";function ki(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ea(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ki(e.default)}const Q=Object.assign;function dr(e,t){const n={};for(const r in t){const s=t[r];n[r]=Je(s)?s.map(e):e(s)}return n}const un=()=>{},Je=Array.isArray;function Vs(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Ai=Symbol("");function Bt(e,t){return Q(new Error,{type:e,[Ai]:!0},t)}function at(e,t){return e instanceof Error&&Ai in e&&(t==null||!!(e.type&t))}const Ra=Symbol(""),zs=Symbol(""),Yn=Symbol(""),Yr=Symbol(""),Cr=Symbol("");function Ca(){return qe(Yn)}function Wt(e){return qe(Yr)}const Pi=/#/g,ka=/&/g,Aa=/\//g,Pa=/=/g,Ta=/\?/g,Ti=/\+/g,Ma=/%5B/g,$a=/%5D/g,Mi=/%5E/g,Oa=/%60/g,$i=/%7B/g,ja=/%7C/g,Oi=/%7D/g,Na=/%20/g;function Xr(e){return e==null?"":encodeURI(""+e).replace(ja,"|").replace(Ma,"[").replace($a,"]")}function Ia(e){return Xr(e).replace($i,"{").replace(Oi,"}").replace(Mi,"^")}function kr(e){return Xr(e).replace(Ti,"%2B").replace(Na,"+").replace(Pi,"%23").replace(ka,"%26").replace(Oa,"`").replace($i,"{").replace(Oi,"}").replace(Mi,"^")}function La(e){return kr(e).replace(Pa,"%3D")}function Da(e){return Xr(e).replace(Pi,"%23").replace(Ta,"%3F")}function Fa(e){return Da(e).replace(Aa,"%2F")}function In(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ha=/\/$/,Ua=e=>e.replace(Ha,"");function hr(e,t,n="/"){let r,s={},o="",i="";const l=t.indexOf("#");let c=t.indexOf("?");return c=l>=0&&c>l?-1:c,c>=0&&(r=t.slice(0,c),o=t.slice(c,l>0?l:t.length),s=e(o.slice(1))),l>=0&&(r=r||t.slice(0,l),i=t.slice(l,t.length)),r=Ba(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:In(i)}}function Va(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function qs(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function za(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Kt(t.matched[r],n.matched[s])&&ji(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Kt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function ji(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!qa(e[n],t[n]))return!1;return!0}function qa(e,t){return Je(e)?Bs(e,t):Je(t)?Bs(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function Bs(e,t){return Je(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Ba(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,l;for(i=0;i1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const vt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};function Ka(e){if(!e)if(Lt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ua(e)}const Wa=/^[^#]+#/;function Ga(e,t){return e.replace(Wa,"#")+t}function Qa(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Xn=()=>({left:window.scrollX,top:window.scrollY});function Ja(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=Qa(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Ks(e,t){return(history.state?history.state.position-t:-1)+e}const Ar=new Map;function Ya(e,t){Ar.set(e,t)}function Xa(e){const t=Ar.get(e);return Ar.delete(e),t}function Za(e){return typeof e=="string"||e&&typeof e=="object"}function Ni(e){return typeof e=="string"||typeof e=="symbol"}function eu(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;rs&&kr(s)):[r&&kr(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function tu(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Je(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}function Yt(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function xt(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((l,c)=>{const f=p=>{p===!1?c(Bt(4,{from:n,to:t})):p instanceof Error?c(p):Za(p)?c(Bt(2,{from:t,to:p})):(i&&r.enterCallbacks[s]===i&&typeof p=="function"&&i.push(p),l())},u=o(()=>e.call(r&&r.instances[s],t,n,f));let h=Promise.resolve(u);e.length<3&&(h=h.then(f)),h.catch(p=>c(p))})}function pr(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const l in i.components){let c=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(ki(c)){const f=(c.__vccOpts||c)[t];f&&o.push(xt(f,n,r,i,l,s))}else{let f=c();o.push(()=>f.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const h=Ea(u)?u.default:u;i.mods[l]=u,i.components[l]=h;const p=(h.__vccOpts||h)[t];return p&&xt(p,n,r,i,l,s)()}))}}return o}function nu(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;iKt(f,l))?r.push(l):n.push(l));const c=e.matched[i];c&&(t.matched.find(f=>Kt(f,c))||s.push(c))}return[n,r,s]}let ru=()=>location.protocol+"//"+location.host;function Ii(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,l=s.slice(i);return l[0]!=="/"&&(l="/"+l),qs(l,"")}return qs(n,e)+r+s}function su(e,t,n,r){let s=[],o=[],i=null;const l=({state:p})=>{const g=Ii(e,location),R=n.value,w=t.value;let I=0;if(p){if(n.value=g,t.value=p,i&&i===R){i=null;return}I=w?p.position-w.position:0}else r(g);s.forEach(O=>{O(n.value,R,{delta:I,type:"pop",direction:I?I>0?"forward":"back":""})})};function c(){i=n.value}function f(p){s.push(p);const g=()=>{const R=s.indexOf(p);R>-1&&s.splice(R,1)};return o.push(g),g}function u(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(Q({},p.state,{scroll:Xn()}),"")}}function h(){for(const p of o)p();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:c,listen:f,destroy:h}}function Gs(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?Xn():null}}function ou(e){const{history:t,location:n}=window,r={value:Ii(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(c,f,u){const h=e.indexOf("#"),p=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+c:ru()+e+c;try{t[u?"replaceState":"pushState"](f,"",p),s.value=f}catch(g){console.error(g),n[u?"replace":"assign"](p)}}function i(c,f){o(c,Q({},t.state,Gs(s.value.back,c,s.value.forward,!0),f,{position:s.value.position}),!0),r.value=c}function l(c,f){const u=Q({},s.value,t.state,{forward:c,scroll:Xn()});o(u.current,u,!0),o(c,Q({},Gs(r.value,c,null),{position:u.position+1},f),!1),r.value=c}return{location:r,state:s,push:l,replace:i}}function iu(e){e=Ka(e);const t=ou(e),n=su(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=Q({location:"",base:e,go:r,createHref:Ga.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}const lu={type:0,value:""},cu=/[a-zA-Z0-9_]/;function au(e){if(!e)return[[]];if(e==="/")return[[lu]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${n})/"${f}": ${g}`)}let n=0,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let l=0,c,f="",u="";function h(){f&&(n===0?o.push({type:0,value:f}):n===1||n===2||n===3?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:f,regexp:u,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),f="")}function p(){f+=c}for(;lt.length?t.length===1&&t[0]===80?1:-1:0}function Li(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const pu={strict:!1,end:!0,sensitive:!1};function gu(e,t,n){const r=du(au(e.path),n),s=Q(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function mu(e,t){const n=[],r=new Map;t=Vs(pu,t);function s(h){return r.get(h)}function o(h,p,g){const R=!g,w=Xs(h);w.aliasOf=g&&g.record;const I=Vs(t,h),O=[w];if("alias"in h){const $=typeof h.alias=="string"?[h.alias]:h.alias;for(const G of $)O.push(Xs(Q({},w,{components:g?g.record.components:w.components,path:G,aliasOf:g?g.record:w})))}let k,M;for(const $ of O){const{path:G}=$;if(p&&G[0]!=="/"){const me=p.record.path,se=me[me.length-1]==="/"?"":"/";$.path=p.record.path+(G&&se+G)}if(k=gu($,p,I),g?g.alias.push(k):(M=M||k,M!==k&&M.alias.push(k),R&&h.name&&!Zs(k)&&i(h.name)),Di(k)&&c(k),w.children){const me=w.children;for(let se=0;se{i(M)}:un}function i(h){if(Ni(h)){const p=r.get(h);p&&(r.delete(h),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(h);p>-1&&(n.splice(p,1),h.record.name&&r.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function l(){return n}function c(h){const p=vu(h,n);n.splice(p,0,h),h.record.name&&!Zs(h)&&r.set(h.record.name,h)}function f(h,p){let g,R={},w,I;if("name"in h&&h.name){if(g=r.get(h.name),!g)throw Bt(1,{location:h});I=g.record.name,R=Q(Ys(p.params,g.keys.filter(M=>!M.optional).concat(g.parent?g.parent.keys.filter(M=>M.optional):[]).map(M=>M.name)),h.params&&Ys(h.params,g.keys.map(M=>M.name))),w=g.stringify(R)}else if(h.path!=null)w=h.path,g=n.find(M=>M.re.test(w)),g&&(R=g.parse(w),I=g.record.name,g.keys.forEach(M=>{M.optional&&!R[M.name]&&delete R[M.name]}));else{if(g=p.name?r.get(p.name):n.find(M=>M.re.test(p.path)),!g)throw Bt(1,{location:h,currentLocation:p});I=g.record.name,R=Q({},p.params,h.params),w=g.stringify(R)}const O=[];let k=g;for(;k;)O.unshift(k.record),k=k.parent;return{name:I,path:w,params:R,matched:O,meta:_u(O)}}e.forEach(h=>o(h));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:f,removeRoute:i,clearRoutes:u,getRoutes:l,getRecordMatcher:s}}function Ys(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Xs(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:yu(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function yu(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Zs(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _u(e){return e.reduce((t,n)=>Q(t,n.meta),{})}function vu(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Li(e,t[o])<0?r=o:n=o+1}const s=bu(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function bu(e){let t=e;for(;t=t.parent;)if(Di(t)&&Li(e,t)===0)return t}function Di({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function eo(e){const t=qe(Yn),n=qe(Yr),r=ce(()=>{const c=X(e.to);return t.resolve(c)}),s=ce(()=>{const{matched:c}=r.value,{length:f}=c,u=c[f-1],h=n.matched;if(!u||!h.length)return-1;const p=h.findIndex(Kt.bind(null,u));if(p>-1)return p;const g=to(c[f-2]);return f>1&&to(u)===g&&h[h.length-1].path!==g?h.findIndex(Kt.bind(null,c[f-2])):p}),o=ce(()=>s.value>-1&&Su(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&ji(n.params,r.value.params));function l(c={}){if(wu(c)){const f=t[X(e.replace)?"replace":"push"](X(e.to)).catch(un);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:l}}function xu(e){return e.length===1?e[0]:e}const Zr=lt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:eo,setup(e,{slots:t}){const n=qn(eo(e)),{options:r}=qe(Yn),s=ce(()=>({[no(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[no(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&xu(t.default(n));return e.custom?o:_n("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}});function wu(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Su(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Je(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function to(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const no=(e,t,n)=>e??t??n,Eu=lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=qe(Cr),s=ce(()=>e.route||r.value),o=qe(zs,0),i=ce(()=>{let f=X(o);const{matched:u}=s.value;let h;for(;(h=u[f])&&!h.components;)f++;return f}),l=ce(()=>s.value.matched[i.value]);Cn(zs,ce(()=>i.value+1)),Cn(Ra,l),Cn(Cr,s);const c=Ie();return on(()=>[c.value,l.value,e.name],([f,u,h],[p,g,R])=>{u&&(u.instances[h]=f,g&&g!==u&&f&&f===p&&(u.leaveGuards.size||(u.leaveGuards=g.leaveGuards),u.updateGuards.size||(u.updateGuards=g.updateGuards))),f&&u&&(!g||!Kt(u,g)||!p)&&(u.enterCallbacks[h]||[]).forEach(w=>w(f))},{flush:"post"}),()=>{const f=s.value,u=e.name,h=l.value,p=h&&h.components[u];if(!p)return ro(n.default,{Component:p,route:f});const g=h.props[u],R=g?g===!0?f.params:typeof g=="function"?g(f):g:null,I=_n(p,Q({},R,t,{onVnodeUnmounted:O=>{O.component.isUnmounted&&(h.instances[u]=null)},ref:c}));return ro(n.default,{Component:I,route:f})||I}}});function ro(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Pr=Eu;function Ru(e){const t=mu(e.routes,e),n=e.parseQuery||eu,r=e.stringifyQuery||Ws,s=e.history,o=Yt(),i=Yt(),l=Yt(),c=$l(vt);let f=vt;Lt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=dr.bind(null,y=>""+y),h=dr.bind(null,Fa),p=dr.bind(null,In);function g(y,T){let A,j;return Ni(y)?(A=t.getRecordMatcher(y),j=T):j=y,t.addRoute(j,A)}function R(y){const T=t.getRecordMatcher(y);T&&t.removeRoute(T)}function w(){return t.getRoutes().map(y=>y.record)}function I(y){return!!t.getRecordMatcher(y)}function O(y,T){if(T=Q({},T||c.value),typeof y=="string"){const m=hr(n,y,T.path),v=t.resolve({path:m.path},T),b=s.createHref(m.fullPath);return Q(m,v,{params:p(v.params),redirectedFrom:void 0,href:b})}let A;if(y.path!=null)A=Q({},y,{path:hr(n,y.path,T.path).path});else{const m=Q({},y.params);for(const v in m)m[v]==null&&delete m[v];A=Q({},y,{params:h(m)}),T.params=h(T.params)}const j=t.resolve(A,T),B=y.hash||"";j.params=u(p(j.params));const a=Va(r,Q({},y,{hash:Ia(B),path:j.path})),d=s.createHref(a);return Q({fullPath:a,hash:B,query:r===Ws?tu(y.query):y.query||{}},j,{redirectedFrom:void 0,href:d})}function k(y){return typeof y=="string"?hr(n,y,c.value.path):Q({},y)}function M(y,T){if(f!==y)return Bt(8,{from:T,to:y})}function $(y){return se(y)}function G(y){return $(Q(k(y),{replace:!0}))}function me(y,T){const A=y.matched[y.matched.length-1];if(A&&A.redirect){const{redirect:j}=A;let B=typeof j=="function"?j(y,T):j;return typeof B=="string"&&(B=B.includes("?")||B.includes("#")?B=k(B):{path:B},B.params={}),Q({query:y.query,hash:y.hash,params:B.path!=null?{}:y.params},B)}}function se(y,T){const A=f=O(y),j=c.value,B=y.state,a=y.force,d=y.replace===!0,m=me(A,j);if(m)return se(Q(k(m),{state:typeof m=="object"?Q({},B,m.state):B,force:a,replace:d}),T||A);const v=A;v.redirectedFrom=T;let b;return!a&&za(r,j,A)&&(b=Bt(16,{to:v,from:j}),Le(j,j,!0,!1)),(b?Promise.resolve(b):Oe(v,j)).catch(_=>at(_)?at(_,2)?_:ee(_):q(_,v,j)).then(_=>{if(_){if(at(_,2))return se(Q({replace:d},k(_.to),{state:typeof _.to=="object"?Q({},B,_.to.state):B,force:a}),T||v)}else _=Ye(v,j,!0,d,B);return Ve(v,j,_),_})}function He(y,T){const A=M(y,T);return A?Promise.reject(A):Promise.resolve()}function Ue(y){const T=oe.values().next().value;return T&&typeof T.runWithContext=="function"?T.runWithContext(y):y()}function Oe(y,T){let A;const[j,B,a]=nu(y,T);A=pr(j.reverse(),"beforeRouteLeave",y,T);for(const m of j)m.leaveGuards.forEach(v=>{A.push(xt(v,y,T))});const d=He.bind(null,y,T);return A.push(d),ve(A).then(()=>{A=[];for(const m of o.list())A.push(xt(m,y,T));return A.push(d),ve(A)}).then(()=>{A=pr(B,"beforeRouteUpdate",y,T);for(const m of B)m.updateGuards.forEach(v=>{A.push(xt(v,y,T))});return A.push(d),ve(A)}).then(()=>{A=[];for(const m of a)if(m.beforeEnter)if(Je(m.beforeEnter))for(const v of m.beforeEnter)A.push(xt(v,y,T));else A.push(xt(m.beforeEnter,y,T));return A.push(d),ve(A)}).then(()=>(y.matched.forEach(m=>m.enterCallbacks={}),A=pr(a,"beforeRouteEnter",y,T,Ue),A.push(d),ve(A))).then(()=>{A=[];for(const m of i.list())A.push(xt(m,y,T));return A.push(d),ve(A)}).catch(m=>at(m,8)?m:Promise.reject(m))}function Ve(y,T,A){l.list().forEach(j=>Ue(()=>j(y,T,A)))}function Ye(y,T,A,j,B){const a=M(y,T);if(a)return a;const d=T===vt,m=Lt?history.state:{};A&&(j||d?s.replace(y.fullPath,Q({scroll:d&&m&&m.scroll},B)):s.push(y.fullPath,B)),c.value=y,Le(y,T,A,d),ee()}let je;function St(){je||(je=s.listen((y,T,A)=>{if(!Pe.listening)return;const j=O(y),B=me(j,Pe.currentRoute.value);if(B){se(Q(B,{replace:!0,force:!0}),j).catch(un);return}f=j;const a=c.value;Lt&&Ya(Ks(a.fullPath,A.delta),Xn()),Oe(j,a).catch(d=>at(d,12)?d:at(d,2)?(se(Q(k(d.to),{force:!0}),j).then(m=>{at(m,20)&&!A.delta&&A.type==="pop"&&s.go(-1,!1)}).catch(un),Promise.reject()):(A.delta&&s.go(-A.delta,!1),q(d,j,a))).then(d=>{d=d||Ye(j,a,!1),d&&(A.delta&&!at(d,8)?s.go(-A.delta,!1):A.type==="pop"&&at(d,20)&&s.go(-1,!1)),Ve(j,a,d)}).catch(un)}))}let Ae=Yt(),he=Yt(),K;function q(y,T,A){ee(y);const j=he.list();return j.length?j.forEach(B=>B(y,T,A)):console.error(y),Promise.reject(y)}function ye(){return K&&c.value!==vt?Promise.resolve():new Promise((y,T)=>{Ae.add([y,T])})}function ee(y){return K||(K=!y,St(),Ae.list().forEach(([T,A])=>y?A(y):T()),Ae.reset()),y}function Le(y,T,A,j){const{scrollBehavior:B}=e;if(!Lt||!B)return Promise.resolve();const a=!A&&Xa(Ks(y.fullPath,0))||(j||!A)&&history.state&&history.state.scroll||null;return qo().then(()=>B(y,T,a)).then(d=>d&&Ja(d)).catch(d=>q(d,y,T))}const _e=y=>s.go(y);let ue;const oe=new Set,Pe={currentRoute:c,listening:!0,addRoute:g,removeRoute:R,clearRoutes:t.clearRoutes,hasRoute:I,getRoutes:w,resolve:O,options:e,push:$,replace:G,go:_e,back:()=>_e(-1),forward:()=>_e(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:he.add,isReady:ye,install(y){y.component("RouterLink",Zr),y.component("RouterView",Pr),y.config.globalProperties.$router=Pe,Object.defineProperty(y.config.globalProperties,"$route",{enumerable:!0,get:()=>X(c)}),Lt&&!ue&&c.value===vt&&(ue=!0,$(s.location).catch(j=>{}));const T={};for(const j in vt)Object.defineProperty(T,j,{get:()=>c.value[j],enumerable:!0});y.provide(Yn,Pe),y.provide(Yr,Ho(T)),y.provide(Cr,c);const A=y.unmount;oe.add(y),y.unmount=function(){oe.delete(y),oe.size<1&&(f=vt,je&&je(),je=null,c.value=vt,ue=!1,K=!1),A()}}};function ve(y){return y.reduce((T,A)=>T.then(()=>Ue(A)),Promise.resolve())}return Pe}const so=e=>e==="";const Cu=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const oo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ku=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const Au=e=>{const t=ku(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ot={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Pu=Symbol("lucide-icons");function Tu(){return qe(Pu,{})}const Mu=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":o,size:i,color:l,...c},{slots:f})=>{const{size:u,color:h,strokeWidth:p=2,absoluteStrokeWidth:g=!1,class:R=""}=Tu(),w=ce(()=>{const I=so(n)||so(r)||n===!0||r===!0||g===!0,O=s||o||p||Ot["stroke-width"];return I?Number(O)*24/Number(i??u??Ot.width):O});return _n("svg",{...Ot,...c,width:i??u??Ot.width,height:i??u??Ot.height,stroke:l??h??Ot.stroke,"stroke-width":w.value,class:Cu("lucide",R,...e?[`lucide-${oo(Au(e))}-icon`,`lucide-${oo(e)}`]:["lucide-icon"])},[...t.map(I=>_n(...I)),...f.default?[f.default()]:[]])};const V=(e,t)=>(n,{slots:r,attrs:s})=>_n(Mu,{...s,...n,iconNode:t,name:e},r.default?{default:r.default}:void 0);const $u=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ou=V("archive",$u);const ju=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Nu=V("arrow-down",ju);const Iu=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Lu=V("arrow-left",Iu);const Du=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Fu=V("arrow-right",Du);const Hu=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Uu=V("arrow-up-right",Hu);const Vu=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],zu=V("arrow-up",Vu);const qu=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],Bu=V("cassette-tape",qu);const Ku=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Wu=V("check",Ku);const Gu=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qu=V("chevron-down",Gu);const Ju=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Yu=V("chevron-left",Ju);const Xu=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fi=V("chevron-right",Xu);const Zu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Hi=V("circle-alert",Zu);const ef=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],tf=V("circle",ef);const nf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],rf=V("disc-3",nf);const sf=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],of=V("disc",sf);const lf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],cf=V("image",lf);const af=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],uf=V("library",af);const ff=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],df=V("list",ff);const hf=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],pf=V("log-out",hf);const gf=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],mf=V("mic-vocal",gf);const yf=[["path",{d:"M5 12h14",key:"1ays0h"}]],_f=V("minus",yf);const vf=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],bf=V("palette",vf);const xf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],wf=V("panel-left-close",xf);const Sf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Ef=V("panel-left-open",Sf);const Rf=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Cf=V("plus",Rf);const kf=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Af=V("puzzle",kf);const Pf=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Tf=V("search-x",Pf);const Mf=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],$f=V("search",Mf);const Of=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jf=V("settings",Of);const Nf=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],If=V("shield-check",Nf);const Lf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Df=V("square",Lf);const Ff=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],es=V("sun",Ff);const Hf=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],Uf=V("tags",Hf);const Vf=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],zf=V("trash-2",Vf);const qf=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Bf=V("user-minus",qf);const Kf=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Wf=V("user-plus",Kf);const Gf=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Qf=V("user",Gf);const Jf=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Yf=V("users-round",Jf);const Xf=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Zf=V("users",Xf);const ed=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],td=V("x",ed),nd=Ie({});function rd(e,t={}){const n=[];for(const[s,o]of Object.entries(t)){const i=s.replace(/^:/,"");if(i==="")continue;const l=String(o);n.push([`:${i.charAt(0).toUpperCase()}${i.slice(1)}`,l.charAt(0).toUpperCase()+l.slice(1)]),n.push([`:${i.toUpperCase()}`,l.toUpperCase()]),n.push([`:${i}`,l])}n.sort((s,o)=>o[0].length-s[0].length);let r=e;for(const[s,o]of n)r=r.split(s).join(o);return r}function we(e,t={}){const r=nd.value[e]?.other;return r===void 0?e:rd(r,t)}const io={archive:Ou,"arrow-down":Nu,"arrow-left":Lu,"arrow-right":Fu,"arrow-up":zu,"arrow-up-right":Uu,"cassette-tape":Bu,check:Wu,"chevron-down":Qu,"chevron-left":Yu,"chevron-right":Fi,circle:tf,"circle-alert":Hi,disc:of,"disc-3":rf,image:cf,library:uf,list:df,"log-out":pf,"mic-vocal":mf,minus:_f,palette:bf,"panel-left-close":wf,"panel-left-open":Ef,plus:Cf,puzzle:Af,search:$f,"search-x":Tf,settings:jf,"shield-check":If,sun:es,tags:Uf,"trash-2":zf,user:Qf,"user-minus":Bf,"user-plus":Wf,users:Zf,"users-round":Yf,x:td},sd={"icon-archive":"archive","icon-circle":"circle","icon-list-ul":"list","icon-tags":"tags","icon-user":"user","icon-search":"search","icon-cog":"settings","icon-users":"users"},lo=Df;function Ui(e){if(!e)return lo;const t=e.trim();return io[t]??io[sd[t]??""]??lo}const od=/\{[^{}]+\}/g,id=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function ld(){return Math.random().toString(36).slice(2,11)}function cd(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:s,bodySerializer:o,pathSerializer:i,headers:l,requestInitExt:c=void 0,...f}={...e};c=id()?c:void 0,t=uo(t);const u=[];async function h(p,g){const{baseUrl:R,fetch:w=r,Request:I=n,headers:O,params:k={},parseAs:M="json",querySerializer:$,bodySerializer:G=o??ud,pathSerializer:me,body:se,middleware:He=[],...Ue}=g||{};let Oe=t;R&&(Oe=uo(R)??t);let Ve=typeof s=="function"?s:co(s);$&&(Ve=typeof $=="function"?$:co({...typeof s=="object"?s:{},...$}));const Ye=me||i||ad,je=se===void 0?void 0:G(se,ao(l,O,k.header)),St=ao(je===void 0||je instanceof FormData?{}:{"Content-Type":"application/json"},l,O,k.header),Ae=[...u,...He],he={redirect:"follow",...f,...Ue,body:je,headers:St};let K,q,ye=new I(fd(p,{baseUrl:Oe,params:k,querySerializer:Ve,pathSerializer:Ye}),he),ee;for(const ue in Ue)ue in ye||(ye[ue]=Ue[ue]);if(Ae.length){K=ld(),q=Object.freeze({baseUrl:Oe,fetch:w,parseAs:M,querySerializer:Ve,bodySerializer:G,pathSerializer:Ye});for(const ue of Ae)if(ue&&typeof ue=="object"&&typeof ue.onRequest=="function"){const oe=await ue.onRequest({request:ye,schemaPath:p,params:k,options:q,id:K});if(oe)if(oe instanceof I)ye=oe;else if(oe instanceof Response){ee=oe;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!ee){try{ee=await w(ye,c)}catch(ue){let oe=ue;if(Ae.length)for(let Pe=Ae.length-1;Pe>=0;Pe--){const ve=Ae[Pe];if(ve&&typeof ve=="object"&&typeof ve.onError=="function"){const y=await ve.onError({request:ye,error:oe,schemaPath:p,params:k,options:q,id:K});if(y){if(y instanceof Response){oe=void 0,ee=y;break}if(y instanceof Error){oe=y;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(oe)throw oe}if(Ae.length)for(let ue=Ae.length-1;ue>=0;ue--){const oe=Ae[ue];if(oe&&typeof oe=="object"&&typeof oe.onResponse=="function"){const Pe=await oe.onResponse({request:ye,response:ee,schemaPath:p,params:k,options:q,id:K});if(Pe){if(!(Pe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");ee=Pe}}}}const Le=ee.headers.get("Content-Length");if(ee.status===204||ye.method==="HEAD"||Le==="0"&&!ee.headers.get("Transfer-Encoding")?.includes("chunked"))return ee.ok?{data:void 0,response:ee}:{error:void 0,response:ee};if(ee.ok)return{data:await(async()=>{if(M==="stream")return ee.body;if(M==="json"&&!Le){const oe=await ee.text();return oe?JSON.parse(oe):void 0}return await ee[M]()})(),response:ee};let _e=await ee.text();try{_e=JSON.parse(_e)}catch{}return{error:_e,response:ee}}return{request(p,g,R){return h(g,{...R,method:p.toUpperCase()})},GET(p,g){return h(p,{...g,method:"GET"})},PUT(p,g){return h(p,{...g,method:"PUT"})},POST(p,g){return h(p,{...g,method:"POST"})},DELETE(p,g){return h(p,{...g,method:"DELETE"})},OPTIONS(p,g){return h(p,{...g,method:"OPTIONS"})},HEAD(p,g){return h(p,{...g,method:"HEAD"})},PATCH(p,g){return h(p,{...g,method:"PATCH"})},TRACE(p,g){return h(p,{...g,method:"TRACE"})},use(...p){for(const g of p)if(g){if(typeof g!="object"||!("onRequest"in g||"onResponse"in g||"onError"in g))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(g)}},eject(...p){for(const g of p){const R=u.indexOf(g);R!==-1&&u.splice(R,1)}}}}function Zn(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function Vi(e,t,n){if(!t||typeof t!="object")return"";const r=[],s={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const l in t)r.push(l,n.allowReserved===!0?t[l]:encodeURIComponent(t[l]));const i=r.join(",");switch(n.style){case"form":return`${e}=${i}`;case"label":return`.${i}`;case"matrix":return`;${e}=${i}`;default:return i}}for(const i in t){const l=n.style==="deepObject"?`${e}[${i}]`:i;r.push(Zn(l,t[i],n))}const o=r.join(s);return n.style==="label"||n.style==="matrix"?`${s}${o}`:o}function zi(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",i=(n.allowReserved===!0?t:t.map(l=>encodeURIComponent(l))).join(o);switch(n.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${e}=${i}`;default:return`${e}=${i}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",s=[];for(const o of t)n.style==="simple"||n.style==="label"?s.push(n.allowReserved===!0?o:encodeURIComponent(o)):s.push(Zn(e,o,n));return n.style==="label"||n.style==="matrix"?`${r}${s.join(r)}`:s.join(r)}function co(e){return function(n){const r=[];if(n&&typeof n=="object")for(const s in n){const o=n[s];if(o!=null){if(Array.isArray(o)){if(o.length===0)continue;r.push(zi(s,o,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof o=="object"){r.push(Vi(s,o,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}r.push(Zn(s,o,e))}}return r.join("&")}}function ad(e,t){let n=e;for(const r of e.match(od)??[]){let s=r.substring(1,r.length-1),o=!1,i="simple";if(s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(i="label",s=s.substring(1)):s.startsWith(";")&&(i="matrix",s=s.substring(1)),!t||t[s]===void 0||t[s]===null)continue;const l=t[s];if(Array.isArray(l)){n=n.replace(r,zi(s,l,{style:i,explode:o}));continue}if(typeof l=="object"){n=n.replace(r,Vi(s,l,{style:i,explode:o}));continue}if(i==="matrix"){n=n.replace(r,`;${Zn(s,l)}`);continue}n=n.replace(r,i==="label"?`.${encodeURIComponent(l)}`:encodeURIComponent(l))}return n}function ud(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function fd(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function ao(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[s,o]of r)if(o===null)t.delete(s);else if(Array.isArray(o))for(const i of o)t.append(s,i);else o!==void 0&&t.set(s,o)}return t}function uo(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const fo="/backend",dd="__SUMMER_ADMIN_BASE__";function hd(e=document){const t=e.querySelector('meta[name="summer-admin-base"]')?.content.trim()??"";if(t===""||t===dd||!t.startsWith("/"))return fo;const n=t.replace(/\/+$/,"");return n===""?fo:n}const ho=hd(),qi={base:ho,api:`${ho}/api/v1`},pd="XMLHttpRequest";let Tr=null,Bi=null,Xt=null;const gr=new WeakMap;function gd(e){Tr=e}function md(e){Bi=e}function yd(e){return new URL(e.url,"http://local").pathname}function po(e){const t=yd(e);return t.endsWith("/auth/login")||t.endsWith("/auth/refresh")}function Ki(){return Xt||(Xt=(async()=>{try{const{data:e,response:t}=await Tt.POST("/auth/refresh");if(!t.ok||!e)return!1;const n=e.data.expires_in;return Bi?.(typeof n=="number"?n:null),!0}catch{return!1}finally{Xt=null}})(),Xt)}const _d={onRequest({request:e}){return e.headers.set("X-Requested-With",pd),po(e)||gr.set(e,e.clone()),e},async onResponse({request:e,response:t}){if(t.status!==401||po(e))return t;const n=gr.get(e);if(gr.delete(e),!n||!await Ki())return Tr?.(),t;const r=await globalThis.fetch(n);return r.status===401&&Tr?.(),r}},Tt=cd({baseUrl:qi.api,credentials:"same-origin",fetch:e=>globalThis.fetch(e)});Tt.use(_d);const vd=/^[A-Za-z0-9_-]+$/;function ts(e){const t=e.split(".");if(t.length!==3||!t.every(o=>vd.test(o)))return null;const[n,r,s]=t;return{vendor:n,plugin:r,controller:s}}function Mr(e){const t=ts(e);return t?`/${t.vendor}/${t.plugin}/${t.controller}`:null}function bd(e){return`${e.vendor}.${e.plugin}.${e.controller}`}function Wi(e){const t=e.replace(/^\/+|\/+$/g,"").split("/");if(t.length<3)return null;const n=t.slice(0,3).join(".");return ts(n)?n:null}function go(e){const t=ts(e);return t?`${t.vendor}.${t.plugin}`:null}const $r=Ie([]);async function Gi(){const{data:e,response:t}=await Tt.GET("/navigation");return $r.value=t.ok&&e?e.data:[],$r.value}const ns=ce(()=>$r.value.filter(e=>e.sideMenu.length>0).map((e,t)=>({entry:e,index:t})).sort((e,t)=>e.entry.order-t.entry.order||e.index-t.index).map(({entry:e})=>e));function Qi(e){for(const t of e.sideMenu){const n=Mr(t.controller);if(n)return n}return Mr(e.controller)}function rs(e,t){const n=`${e}.${t}`;return ns.value.find(r=>go(r.controller)===n||r.sideMenu.some(s=>go(s.controller)===n))??null}function xd(){for(const e of ns.value){const t=Qi(e);if(t)return t}return null}const wd=["aria-label"],Sd={class:"mb-3.5 flex size-10 items-center justify-center rounded-inner bg-accent-soft",title:"SummerCMS"},Ed=lt({__name:"PluginRail",setup(e){const t=Wt(),n=ce(()=>rs(String(t.params.vendor??""),String(t.params.plugin??""))),r=ce(()=>ns.value.map(s=>({entry:s,to:Qi(s)??"/",icon:Ui(s.icon),current:n.value?.code===s.code})));return(s,o)=>(z(),le("nav",{"aria-label":X(we)("backend::lang.nav.plugins"),class:"flex w-rail shrink-0 flex-col items-center gap-1.5 border-r border-side-border bg-side pt-3.5 pb-3"},[H("span",Sd,[ge(X(es),{size:22,class:"text-accent","aria-hidden":"true"})]),(z(!0),le(fe,null,kt(r.value,i=>(z(),Qe(X(Zr),{key:i.entry.code,to:i.to,"aria-current":i.current?"page":void 0,class:wt([i.current?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[68px] flex-col items-center gap-1 rounded-inner px-1.5 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline"])},{default:Kn(()=>[(z(),Qe(ni(i.icon),{size:20,"aria-hidden":"true"})),H("span",null,de(i.entry.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],8,wd))}}),Rd=["aria-label"],Cd={class:"mb-3.5 flex h-10 items-center px-2"},kd={class:"text-[16px] font-bold"},Ad=lt({__name:"SectionPanel",props:{entry:{}},setup(e){const t=e,n=Wt(),r=ce(()=>Wi(n.path)),s=ce(()=>t.entry.sideMenu.flatMap(o=>{const i=Mr(o.controller);return i?[{item:o,to:i,icon:Ui(o.icon),current:r.value===o.controller}]:[]}));return(o,i)=>(z(),le("aside",{"aria-label":X(we)("backend::lang.nav.sections"),class:"flex w-panel shrink-0 flex-col gap-0.5 border-r border-border bg-surface px-3 py-3.5"},[H("div",Cd,[H("span",kd,de(e.entry.label),1)]),(z(!0),le(fe,null,kt(s.value,l=>(z(),Qe(X(Zr),{key:l.item.code,to:l.to,"aria-current":l.current?"page":void 0,class:wt([l.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline"])},{default:Kn(()=>[(z(),Qe(ni(l.icon),{size:18,"aria-hidden":"true"})),H("span",null,de(l.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],8,Rd))}}),Ln=Ie(null),Ji=Ie(null);let fn=null;function Yi(e){Xi(),Ji.value=e,!(e===null||e<=0)&&(fn=setTimeout(()=>{fn=null,Ki()},e*800))}function Xi(){fn!==null&&(clearTimeout(fn),fn=null)}md(Yi);const tn=An(Ln);async function Pd(e,t){const{data:n,response:r}=await Tt.POST("/auth/login",{body:{login:e,password:t}});return!r.ok||!n?!1:(Yi(typeof n.data.expires_in=="number"?n.data.expires_in:null),!0)}async function Zi(){const{data:e,response:t}=await Tt.GET("/auth/me");return Ln.value=t.ok&&e?e.data:null,Ln.value}function Td(){Xi(),Ln.value=null,Ji.value=null}const Md={class:"flex min-h-screen bg-bg text-text"},$d={class:"flex min-w-0 flex-1 flex-col"},Od={class:"flex h-header shrink-0 items-center justify-between border-b border-border bg-surface pr-6 pl-8"},jd=["aria-label"],Nd={class:"font-semibold","aria-current":"page"},Id={key:0,class:"flex h-input items-center gap-2.5 rounded-inner px-2"},Ld={class:"flex size-[34px] items-center justify-center rounded-full bg-accent text-[13px] font-bold text-on-accent","aria-hidden":"true"},Dd={class:"flex flex-col leading-tight"},Fd={class:"font-semibold"},Hd={key:0,class:"text-[12px] text-muted"},Ud={class:"min-w-0 flex-1 px-8 py-7"},Vd=lt({__name:"AppShell",setup(e){const t=Wt(),n=ce(()=>rs(String(t.params.vendor??""),String(t.params.plugin??""))),r=ce(()=>{const i=Wi(t.path);return n.value?.sideMenu.find(l=>l.controller===i)??null}),s=ce(()=>{const i=tn.value;if(!i)return"";const l=`${i.first_name} ${i.last_name}`.trim();return l===""?i.login:l}),o=ce(()=>s.value.split(/\s+/).filter(Boolean).slice(0,2).map(i=>i.charAt(0).toUpperCase()).join(""));return(i,l)=>(z(),le("div",Md,[ge(Ed),n.value?(z(),Qe(Ad,{key:0,entry:n.value},null,8,["entry"])):Nt("",!0),H("div",$d,[H("header",Od,[H("nav",{"aria-label":X(we)("backend::lang.nav.breadcrumbs"),class:"flex items-center gap-2"},[n.value?(z(),le(fe,{key:0},[H("span",{class:wt(r.value?"text-muted":"font-semibold")},de(n.value.label),3),r.value?(z(),le(fe,{key:0},[ge(X(Fi),{size:14,class:"text-muted","aria-hidden":"true"}),H("span",Nd,de(r.value.label),1)],64)):Nt("",!0)],64)):Nt("",!0)],8,jd),X(tn)?(z(),le("div",Id,[H("span",Ld,de(o.value),1),H("span",Dd,[H("span",Fd,de(s.value),1),X(tn).role?(z(),le("span",Hd,de(X(tn).role.name),1)):Nt("",!0)])])):Nt("",!0)]),H("main",Ud,[lc(i.$slots,"default")])])]))}}),zd=lt({__name:"App",setup(e){const t=Wt(),n=ce(()=>t.meta.shell===!0);return(r,s)=>n.value?(z(),Qe(Vd,{key:0},{default:Kn(()=>[ge(X(Pr))]),_:1})):(z(),Qe(X(Pr),{key:1}))}}),qd={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},Bd={class:"flex w-full max-w-[400px] flex-col gap-6"},Kd={class:"flex items-center justify-center gap-3"},Wd={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},Gd={class:"text-[22px] font-bold tracking-[-0.02em]"},Qd={class:"flex flex-col gap-1.5"},Jd={class:"font-semibold"},Yd={class:"flex flex-col gap-1.5"},Xd={class:"font-semibold"},Zd=["aria-invalid"],eh={key:0,role:"alert",class:"flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]"},th=["disabled"],nh=lt({__name:"LoginView",setup(e){const t=Wt(),n=Ca(),r=Ie(""),s=Ie(""),o=Ie(!1),i=Ie(!1);async function l(){if(!i.value){i.value=!0,o.value=!1;try{if(!await Pd(r.value.trim(),s.value)||!await Zi()){o.value=!0;return}s.value="",await Gi(),await n.replace(el(t.query.redirect)??"/")}finally{i.value=!1}}}return(c,f)=>(z(),le("main",qd,[H("div",Bd,[H("div",Kd,[H("span",Wd,[ge(X(es),{size:20,class:"text-accent","aria-hidden":"true"})]),f[2]||(f[2]=H("span",{class:"text-[18px] font-bold text-white"},[Si("Summer"),H("span",{class:"text-accent"},"CMS")],-1))]),H("form",{class:"flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",novalidate:"",onSubmit:_a(l,["prevent"])},[H("h1",Gd,de(X(we)("backend::lang.auth.title")),1),H("label",Qd,[H("span",Jd,de(X(we)("backend::lang.auth.login")),1),ds(H("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>r.value=u),name:"login",type:"text",autocomplete:"username",required:"",class:"h-input rounded-control border border-[#d2d8e2] bg-white px-3.5"},null,512),[[Hs,r.value]])]),H("label",Yd,[H("span",Xd,de(X(we)("backend::lang.auth.password")),1),ds(H("input",{"onUpdate:modelValue":f[1]||(f[1]=u=>s.value=u),name:"password",type:"password",autocomplete:"current-password",required:"","aria-invalid":o.value?"true":void 0,class:wt([o.value?"border-[#c62828]":"border-[#d2d8e2]","h-input rounded-control border bg-white px-3.5"])},null,10,Zd),[[Hs,s.value]])]),o.value?(z(),le("div",eh,[ge(X(Hi),{size:18,"aria-hidden":"true"}),H("span",null,de(X(we)("backend::lang.auth.invalid")),1)])):Nt("",!0),H("button",{type:"submit",disabled:i.value,class:"h-input rounded-control bg-[#22304d] font-semibold text-white disabled:opacity-60"},de(X(we)("backend::lang.auth.submit")),9,th)],32)])]))}}),rh={class:"overflow-x-auto"},sh={class:"w-full min-w-[640px] border-collapse text-left"},oh={class:"h-row-head border-y border-border bg-subtle"},ih=["aria-busy"],lh={key:1},ch=["colspan"],ah=lt({__name:"DataTable",props:{columns:{},rows:{},loading:{type:Boolean},emptyText:{}},setup(e){function t(s,o){return n(s[o.key])}function n(s){if(s==null||s==="")return"—";if(Array.isArray(s)){const o=s.map(n).filter(i=>i!=="—");return o.length===0?"—":o.join(", ")}return typeof s=="boolean"?we(s?"backend::lang.list.column_switch_true":"backend::lang.list.column_switch_false"):typeof s=="object"?"—":String(s)}function r(s,o){const i=s.id;return typeof i=="number"||typeof i=="string"?String(i):`row-${o}`}return(s,o)=>(z(),le("div",rh,[H("table",sh,[H("thead",null,[H("tr",oh,[(z(!0),le(fe,null,kt(e.columns,i=>(z(),le("th",{key:i.key,scope:"col",class:"px-3.5 text-[12px] font-semibold text-muted first:pl-5 last:pr-5"},de(i.label),1))),128))])]),H("tbody",{"aria-busy":e.loading?"true":void 0},[e.loading?(z(),le(fe,{key:0},kt(8,i=>H("tr",{key:`skeleton-${i}`,class:"h-row border-b border-border"},[(z(!0),le(fe,null,kt(e.columns,l=>(z(),le("td",{key:l.key,class:"px-3.5 first:pl-5 last:pr-5"},[...o[0]||(o[0]=[H("span",{class:"block h-3 w-3/5 rounded-[6px] bg-skel"},null,-1)])]))),128))])),64)):e.rows.length===0?(z(),le("tr",lh,[H("td",{colspan:Math.max(e.columns.length,1),class:"px-5 py-20 text-center text-muted"},de(e.emptyText??X(we)("backend::lang.list.no_records")),9,ch)])):(z(!0),le(fe,{key:2},kt(e.rows,(i,l)=>(z(),le("tr",{key:r(i,l),class:"h-row border-b border-border"},[(z(!0),le(fe,null,kt(e.columns,(c,f)=>(z(),le("td",{key:c.key,class:wt([f===0?"font-semibold":"text-muted","px-3.5 first:pl-5 last:pr-5"])},de(t(i,c)),3))),128))]))),128))],8,ih)])]))}}),uh={class:"flex flex-col gap-5"},fh={class:"text-[26px] font-bold tracking-[-0.02em]"},dh={class:"overflow-hidden rounded-card border border-border bg-surface shadow-card"},hh={key:0,role:"alert",class:"px-5 py-4 text-danger"},ph={class:"border-t border-border px-5 py-3.5 text-[13px] text-muted"},gh=lt({__name:"ListView",setup(e){const t=Wt(),n=ce(()=>({vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")})),r=Ie(null),s=Ie([]),o=Ie(null),i=Ie(!0),l=Ie(!1),c=ce(()=>{if(r.value?.title)return r.value.title;const p=bd(n.value);return rs(n.value.vendor,n.value.plugin)?.sideMenu.find(R=>R.controller===p)?.label??p}),f=ce(()=>{const p=o.value;if(!p||p.total===0)return we("backend::lang.list.no_results");const g=(p.page-1)*p.per_page+1,R=Math.min(p.page*p.per_page,p.total);return we("backend::lang.list.pagination_range",{from:g,to:R,total:p.total})});let u=0;async function h(){const p=++u;i.value=!0,l.value=!1;const g={path:n.value},[R,w]=await Promise.all([Tt.GET("/{vendor}/{plugin}/{controller}/schema/list",{params:g}),Tt.GET("/{vendor}/{plugin}/{controller}",{params:g})]);p===u&&(r.value=R.data?.data??null,s.value=w.data?.data??[],o.value=w.data?.meta??null,l.value=!R.data||!w.data,i.value=!1)}return on(n,h,{immediate:!0,deep:!0}),(p,g)=>(z(),le("section",uh,[H("header",null,[H("h1",fh,de(c.value),1)]),H("div",dh,[l.value&&!i.value?(z(),le("p",hh,de(X(we)("backend::lang.list.load_failed")),1)):(z(),Qe(ah,{key:1,columns:r.value?.columns??[],rows:s.value,loading:i.value,"empty-text":r.value?.noRecordsMessage},null,8,["columns","rows","loading","empty-text"])),H("footer",ph,de(i.value?X(we)("backend::lang.list.loading"):f.value),1)])]))}}),mh={class:"flex flex-col items-center gap-2 py-20 text-center"},yh={class:"text-[17px] font-bold"},mo=lt({__name:"NotFoundView",props:{home:{type:Boolean}},setup(e){return(t,n)=>(z(),le("section",mh,[H("h1",yh,de(e.home?X(we)("backend::lang.nav.empty"):X(we)("backend::lang.page.not_found")),1)]))}});function el(e){return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\")?null:e}function _h(e=iu(qi.base)){const t=Ru({history:e,routes:[{path:"/login",name:"login",component:nh,meta:{public:!0}},{path:"/",name:"home",component:mo,props:{home:!0},meta:{shell:!0},beforeEnter:()=>xd()??!0},{path:"/:vendor/:plugin/:controller",name:"list",component:gh,meta:{shell:!0}},{path:"/:pathMatch(.*)*",name:"not-found",component:mo,meta:{shell:!0}}]});return t.beforeEach(n=>{const r=tn.value!==null;return n.meta.public?r&&n.name==="login"?el(n.query.redirect)??"/":!0:r?!0:{name:"login",query:{redirect:n.fullPath}}}),t}async function vh(){await Zi().catch(()=>null)&&await Gi().catch(()=>[]);const t=_h();gd(()=>{Td();const r=t.currentRoute.value;r.name!=="login"&&t.push({name:"login",query:{redirect:r.fullPath}})});const n=xa(zd);n.use(t),await t.isReady(),n.mount("#app")}vh(); diff --git a/boardwalk/dist/assets/index-ZNCn30hM.js b/boardwalk/dist/assets/index-ZNCn30hM.js deleted file mode 100644 index f674cd4..0000000 --- a/boardwalk/dist/assets/index-ZNCn30hM.js +++ /dev/null @@ -1 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Pr(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const re={},Lt=[],it=()=>{},fo=()=>!1,In=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ln=e=>e.startsWith("onUpdate:"),Ee=Object.assign,Tr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Wi=Object.prototype.hasOwnProperty,Y=(e,t)=>Wi.call(e,t),F=Array.isArray,Dt=e=>yn(e)==="[object Map]",ho=e=>yn(e)==="[object Set]",rs=e=>yn(e)==="[object Date]",U=e=>typeof e=="function",ae=e=>typeof e=="string",Ke=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",po=e=>(Z(e)||U(e))&&U(e.then)&&U(e.catch),go=Object.prototype.toString,yn=e=>go.call(e),Gi=e=>yn(e).slice(8,-1),mo=e=>yn(e)==="[object Object]",Mr=e=>ae(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,tn=Pr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Dn=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Qi=/-\w/g,$e=Dn(e=>e.replace(Qi,t=>t.slice(1).toUpperCase())),Ji=/\B([A-Z])/g,Tt=Dn(e=>e.replace(Ji,"-$1").toLowerCase()),Fn=Dn(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xn=Dn(e=>e?`on${Fn(e)}`:""),ot=(e,t)=>!Object.is(e,t),Sn=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},$r=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let ss;const Hn=()=>ss||(ss=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Or(e){if(F(e)){const t={};for(let n=0;n{if(n){const r=n.split(Xi);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function wt(e){let t="";if(ae(e))t=e;else if(F(e))for(let n=0;n!!(e&&e.__v_isRef===!0),de=e=>ae(e)?e:e==null?"":F(e)||Z(e)&&(e.toString===go||!U(e.toString))?vo(e)?de(e.value):JSON.stringify(e,bo,2):String(e),bo=(e,t)=>vo(t)?bo(e,t.value):Dt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Zn(r,o)+" =>"]=s,n),{})}:ho(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Zn(n))}:Ke(t)?Zn(t):Z(t)&&!F(t)&&!mo(t)?String(t):t,Zn=(e,t="")=>{var n;return Ke(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let xe;class sl{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xe&&(xe.active?(this.parent=xe,this.index=(xe.scopes||(xe.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(xe===this)xe=this.prevScope;else{let t=xe;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n0)return;if(rn){let t=rn;for(rn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;nn;){let t=nn;for(nn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Eo(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ro(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Lr(r),il(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function hr(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Co(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Co(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===un)||(e.globalVersion=un,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!hr(e))))return;e.flags|=2;const t=e.dep,n=ie,r=Be;ie=e,Be=!0;try{Eo(e);const s=e.fn(e._value);(t.version===0||ot(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{ie=n,Be=r,Ro(e),e.flags&=-3}}function Lr(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)Lr(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function il(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Be=!0;const ko=[];function pt(){ko.push(Be),Be=!1}function gt(){const e=ko.pop();Be=e===void 0?!0:e}function os(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=ie;ie=void 0;try{t()}finally{ie=n}}}let un=0;class ll{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Dr{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!ie||!Be||ie===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==ie)n=this.activeLink=new ll(ie,this),ie.deps?(n.prevDep=ie.depsTail,ie.depsTail.nextDep=n,ie.depsTail=n):ie.deps=ie.depsTail=n,Ao(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=ie.depsTail,n.nextDep=void 0,ie.depsTail.nextDep=n,ie.depsTail=n,ie.deps===n&&(ie.deps=r)}return n}trigger(t){this.version++,un++,this.notify(t)}notify(t){Nr();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ir()}}}function Ao(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Ao(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const pr=new WeakMap,At=Symbol(""),gr=Symbol(""),fn=Symbol("");function Re(e,t,n){if(Be&&ie){let r=pr.get(e);r||pr.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Dr),s.map=r,s.key=n),s.track()}}function dt(e,t,n,r,s,o){const i=pr.get(e);if(!i){un++;return}const l=c=>{c&&c.trigger()};if(Nr(),t==="clear")i.forEach(l);else{const c=F(e),f=c&&Mr(n);if(c&&n==="length"){const u=Number(r);i.forEach((h,p)=>{(p==="length"||p===fn||!Ke(p)&&p>=u)&&l(h)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),f&&l(i.get(fn)),t){case"add":c?f&&l(i.get("length")):(l(i.get(At)),Dt(e)&&l(i.get(gr)));break;case"delete":c||(l(i.get(At)),Dt(e)&&l(i.get(gr)));break;case"set":Dt(e)&&l(i.get(At));break}}Ir()}function Mt(e){const t=J(e);return t===e?t:(Re(t,"iterate",fn),Ve(e)?t:t.map(We))}function Un(e){return Re(e=J(e),"iterate",fn),e}function rt(e,t){return mt(e)?qt(Pt(e)?We(t):t):We(t)}const cl={__proto__:null,[Symbol.iterator](){return tr(this,Symbol.iterator,e=>rt(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>F(t)?Mt(t):t))},entries(){return tr(this,"entries",e=>(e[1]=rt(this,e[1]),e))},every(e,t){return ct(this,"every",e,t,void 0,arguments)},filter(e,t){return ct(this,"filter",e,t,n=>n.map(r=>rt(this,r)),arguments)},find(e,t){return ct(this,"find",e,t,n=>rt(this,n),arguments)},findIndex(e,t){return ct(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ct(this,"findLast",e,t,n=>rt(this,n),arguments)},findLastIndex(e,t){return ct(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ct(this,"forEach",e,t,void 0,arguments)},includes(...e){return nr(this,"includes",e)},indexOf(...e){return nr(this,"indexOf",e)},join(e){return Mt(this).join(e)},lastIndexOf(...e){return nr(this,"lastIndexOf",e)},map(e,t){return ct(this,"map",e,t,void 0,arguments)},pop(){return Qt(this,"pop")},push(...e){return Qt(this,"push",e)},reduce(e,...t){return is(this,"reduce",e,t)},reduceRight(e,...t){return is(this,"reduceRight",e,t)},shift(){return Qt(this,"shift")},some(e,t){return ct(this,"some",e,t,void 0,arguments)},splice(...e){return Qt(this,"splice",e)},toReversed(){return Mt(this).toReversed()},toSorted(e){return Mt(this).toSorted(e)},toSpliced(...e){return Mt(this).toSpliced(...e)},unshift(...e){return Qt(this,"unshift",e)},values(){return tr(this,"values",e=>rt(this,e))}};function tr(e,t,n){const r=Un(e),s=r[t]();return r!==e&&!Ve(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const al=Array.prototype;function ct(e,t,n,r,s,o){const i=Un(e),l=i!==e&&!Ve(e),c=i[t];if(c!==al[t]){const h=c.apply(e,o);return l?We(h):h}let f=n;i!==e&&(l?f=function(h,p){return n.call(this,rt(e,h),p,e)}:n.length>2&&(f=function(h,p){return n.call(this,h,p,e)}));const u=c.call(i,f,r);return l&&s?s(u):u}function is(e,t,n,r){const s=Un(e),o=s!==e&&!Ve(e);let i=n,l=!1;s!==e&&(o?(l=r.length===0,i=function(f,u,h){return l&&(l=!1,f=rt(e,f)),n.call(this,f,rt(e,u),h,e)}):n.length>3&&(i=function(f,u,h){return n.call(this,f,u,h,e)}));const c=s[t](i,...r);return l?rt(e,c):c}function nr(e,t,n){const r=J(e);Re(r,"iterate",fn);const s=r[t](...n);return(s===-1||s===!1)&&Ur(n[0])?(n[0]=J(n[0]),r[t](...n)):s}function Qt(e,t,n=[]){pt(),Nr();const r=J(e)[t].apply(e,n);return Ir(),gt(),r}const ul=Pr("__proto__,__v_isRef,__isVue"),Po=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ke));function fl(e){Ke(e)||(e=String(e));const t=J(this);return Re(t,"has",e),t.hasOwnProperty(e)}class To{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?xl:jo:o?Oo:$o).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=F(t);if(!s){let c;if(i&&(c=cl[n]))return c;if(n==="hasOwnProperty")return fl}const l=Reflect.get(t,n,ke(t)?t:r);if((Ke(n)?Po.has(n):ul(n))||(s||Re(t,"get",n),o))return l;if(ke(l)){const c=i&&Mr(n)?l:l.value;return s&&Z(c)?Cn(c):c}return Z(l)?s?Cn(l):qn(l):l}}class Mo extends To{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=F(t)&&Mr(n);if(!this._isShallow){const f=mt(o);if(!Ve(r)&&!mt(r)&&(o=J(o),r=J(r)),!i&&ke(o)&&!ke(r))return f||(o.value=r),!0}const l=i?Number(n)e,bn=e=>Reflect.getPrototypeOf(e);function ml(e,t,n){return function(...r){const s=this.__v_raw,o=J(s),i=Dt(o),l=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,f=s[e](...r),u=n?mr:t?qt:We;return!t&&Re(o,"iterate",c?gr:At),Ee(Object.create(f),{next(){const{value:h,done:p}=f.next();return p?{value:h,done:p}:{value:l?[u(h[0]),u(h[1])]:u(h),done:p}}})}}function xn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function yl(e,t){const n={get(s){const o=this.__v_raw,i=J(o),l=J(s);e||(ot(s,l)&&Re(i,"get",s),Re(i,"get",l));const{has:c}=bn(i),f=t?mr:e?qt:We;if(c.call(i,s))return f(o.get(s));if(c.call(i,l))return f(o.get(l));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&Re(J(s),"iterate",At),s.size},has(s){const o=this.__v_raw,i=J(o),l=J(s);return e||(ot(s,l)&&Re(i,"has",s),Re(i,"has",l)),s===l?o.has(s):o.has(s)||o.has(l)},forEach(s,o){const i=this,l=i.__v_raw,c=J(l),f=t?mr:e?qt:We;return!e&&Re(c,"iterate",At),l.forEach((u,h)=>s.call(o,f(u),f(h),i))}};return Ee(n,e?{add:xn("add"),set:xn("set"),delete:xn("delete"),clear:xn("clear")}:{add(s){const o=J(this),i=bn(o),l=J(s),c=!t&&!Ve(s)&&!mt(s)?l:s;return i.has.call(o,c)||ot(s,c)&&i.has.call(o,s)||ot(l,c)&&i.has.call(o,l)||(o.add(c),dt(o,"add",c,c)),this},set(s,o){!t&&!Ve(o)&&!mt(o)&&(o=J(o));const i=J(this),{has:l,get:c}=bn(i);let f=l.call(i,s);f||(s=J(s),f=l.call(i,s));const u=c.call(i,s);return i.set(s,o),f?ot(o,u)&&dt(i,"set",s,o):dt(i,"add",s,o),this},delete(s){const o=J(this),{has:i,get:l}=bn(o);let c=i.call(o,s);c||(s=J(s),c=i.call(o,s)),l&&l.call(o,s);const f=o.delete(s);return c&&dt(o,"delete",s,void 0),f},clear(){const s=J(this),o=s.size!==0,i=s.clear();return o&&dt(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=ml(s,e,t)}),n}function Fr(e,t){const n=yl(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(Y(n,s)&&s in r?n:r,s,o)}const _l={get:Fr(!1,!1)},vl={get:Fr(!1,!0)},bl={get:Fr(!0,!1)};const $o=new WeakMap,Oo=new WeakMap,jo=new WeakMap,xl=new WeakMap;function wl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function qn(e){return mt(e)?e:Hr(e,!1,hl,_l,$o)}function No(e){return Hr(e,!1,gl,vl,Oo)}function Cn(e){return Hr(e,!0,pl,bl,jo)}function Hr(e,t,n,r,s){if(!Z(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=s.get(e);if(o)return o;const i=wl(Gi(e));if(i===0)return e;const l=new Proxy(e,i===2?r:n);return s.set(e,l),l}function Pt(e){return mt(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function mt(e){return!!(e&&e.__v_isReadonly)}function Ve(e){return!!(e&&e.__v_isShallow)}function Ur(e){return e?!!e.__v_raw:!1}function J(e){const t=e&&e.__v_raw;return t?J(t):e}function Sl(e){return!Y(e,"__v_skip")&&Object.isExtensible(e)&&yo(e,"__v_skip",!0),e}const We=e=>Z(e)?qn(e):e,qt=e=>Z(e)?Cn(e):e;function ke(e){return e?e.__v_isRef===!0:!1}function Ie(e){return Io(e,!1)}function El(e){return Io(e,!0)}function Io(e,t){return ke(e)?e:new Rl(e,t)}class Rl{constructor(t,n){this.dep=new Dr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:J(t),this._value=n?t:We(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ve(t)||mt(t);t=r?t:J(t),ot(t,n)&&(this._rawValue=t,this._value=r?t:We(t),this.dep.trigger())}}function X(e){return ke(e)?e.value:e}const Cl={get:(e,t,n)=>t==="__v_raw"?e:X(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return ke(s)&&!ke(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Lo(e){return Pt(e)?e:new Proxy(e,Cl)}class kl{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Dr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=un-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ie!==this)return So(this,!0),!0}get value(){const t=this.dep.track();return Co(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Al(e,t,n=!1){let r,s;return U(e)?r=e:(r=e.get,s=e.set),new kl(r,s,n)}const wn={},kn=new WeakMap;let Ct;function Pl(e,t=!1,n=Ct){if(n){let r=kn.get(n);r||kn.set(n,r=[]),r.push(e)}}function Tl(e,t,n=re){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:l,call:c}=n,f=$=>s?$:Ve($)||s===!1||s===0?ht($,1):ht($);let u,h,p,g,R=!1,w=!1;if(ke(e)?(h=()=>e.value,R=Ve(e)):Pt(e)?(h=()=>f(e),R=!0):F(e)?(w=!0,R=e.some($=>Pt($)||Ve($)),h=()=>e.map($=>{if(ke($))return $.value;if(Pt($))return f($);if(U($))return c?c($,2):$()})):U(e)?t?h=c?()=>c(e,2):e:h=()=>{if(p){pt();try{p()}finally{gt()}}const $=Ct;Ct=u;try{return c?c(e,3,[g]):e(g)}finally{Ct=$}}:h=it,t&&s){const $=h,G=s===!0?1/0:s;h=()=>ht($(),G)}const I=ol(),O=()=>{u.stop(),I&&I.active&&Tr(I.effects,u)};if(o&&t){const $=t;t=(...G)=>{$(...G),O()}}let k=w?new Array(e.length).fill(wn):wn;const M=$=>{if(!(!(u.flags&1)||!u.dirty&&!$))if(t){const G=u.run();if(s||R||(w?G.some((me,se)=>ot(me,k[se])):ot(G,k))){p&&p();const me=Ct;Ct=u;try{const se=[G,k===wn?void 0:w&&k[0]===wn?[]:k,g];k=G,c?c(t,3,se):t(...se)}finally{Ct=me}}}else u.run()};return l&&l(M),u=new xo(h),u.scheduler=i?()=>i(M,!1):M,g=$=>Pl($,!1,u),p=u.onStop=()=>{const $=kn.get(u);if($){if(c)c($,4);else for(const G of $)G();kn.delete(u)}},t?r?M(!0):k=u.run():i?i(M.bind(null,!0),!0):u.run(),O.pause=u.pause.bind(u),O.resume=u.resume.bind(u),O.stop=O,O}function ht(e,t=1/0,n){if(t<=0||!Z(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,ke(e))ht(e.value,t,n);else if(F(e))for(let r=0;r{ht(r,t,n)});else if(mo(e)){for(const r in e)ht(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&ht(e[r],t,n)}return e}function _n(e,t,n,r){try{return r?e(...r):e()}catch(s){Vn(s,t,n)}}function Ge(e,t,n,r){if(U(e)){const s=_n(e,t,n,r);return s&&po(s)&&s.catch(o=>{Vn(o,t,n)}),s}if(F(e)){const s=[];for(let o=0;o>>1,s=Me[r],o=dn(s);o=dn(n)?Me.push(e):Me.splice($l(t),0,e),e.flags|=1,Ho()}}function Ho(){An||(An=Do.then(qo))}function Ol(e){F(e)?Ft.push(...e):bt&&e.id===-1?bt.splice(Ot+1,0,e):e.flags&1||(Ft.push(e),e.flags|=1),Ho()}function ls(e,t,n=nt+1){for(;ndn(n)-dn(r));if(Ft.length=0,bt){bt.push(...t);return}for(bt=t,Ot=0;Ote.id==null?e.flags&2?-1:1/0:e.id;function qo(e){try{for(nt=0;nt{r._d&&$n(-1);const o=Pn(t);let i;try{i=e(...s)}finally{Pn(o),r._d&&$n(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function cs(e,t){if(Se===null)return e;const n=Gn(Se),r=e.dirs||(e.dirs=[]);for(let s=0;s1)return n&&U(t)?t.call(r&&r.proxy):t}}const jl=Symbol.for("v-scx"),Nl=()=>ze(jl);function sn(e,t,n){return zo(e,t,n)}function zo(e,t,n=re){const{immediate:r,deep:s,flush:o,once:i}=n,l=Ee({},n),c=t&&r||!t&&o!=="post";let f;if(gn){if(o==="sync"){const g=Nl();f=g.__watcherHandles||(g.__watcherHandles=[])}else if(!c){const g=()=>{};return g.stop=it,g.resume=it,g.pause=it,g}}const u=Ce;l.call=(g,R,w)=>Ge(g,u,R,w);let h=!1;o==="post"?l.scheduler=g=>{Ne(g,u&&u.suspense)}:o!=="sync"&&(h=!0,l.scheduler=(g,R)=>{R?g():qr(g)}),l.augmentJob=g=>{t&&(g.flags|=4),h&&(g.flags|=2,u&&(g.id=u.uid,g.i=u))};const p=Tl(e,t,l);return gn&&(f?f.push(p):c&&p()),p}function Il(e,t,n){const r=this.proxy,s=ae(e)?e.includes(".")?Bo(r,e):()=>r[e]:e.bind(r,r);let o;U(t)?o=t:(o=t.handler,n=t);const i=vn(this),l=zo(s,o.bind(r),n);return i(),l}function Bo(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;se.__isTeleport,rr=Symbol("_leaveCb");function Vr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Vr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function lt(e,t){return U(e)?Ee({name:e.name},t,{setup:e}):e}function Ko(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function as(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Tn=new WeakMap;function on(e,t,n,r,s=!1){if(F(e)){e.forEach((w,I)=>on(w,t&&(F(t)?t[I]:t),n,r,s));return}if(Ht(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&on(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Gn(r.component):r.el,i=s?null:o,{i:l,r:c}=e,f=t&&t.r,u=l.refs===re?l.refs={}:l.refs,h=l.setupState,p=J(h),g=h===re?fo:w=>as(u,w)?!1:Y(p,w),R=(w,I)=>!(I&&as(u,I));if(f!=null&&f!==c){if(us(t),ae(f))u[f]=null,g(f)&&(h[f]=null);else if(ke(f)){const w=t;R(f,w.k)&&(f.value=null),w.k&&(u[w.k]=null)}}if(U(c))_n(c,l,12,[i,u]);else{const w=ae(c),I=ke(c);if(w||I){const O=()=>{if(e.f){const k=w?g(c)?h[c]:u[c]:R()||!e.k?c.value:u[e.k];if(s)F(k)&&Tr(k,o);else if(F(k))k.includes(o)||k.push(o);else if(w)u[c]=[o],g(c)&&(h[c]=u[c]);else{const M=[o];R(c,e.k)&&(c.value=M),e.k&&(u[e.k]=M)}}else w?(u[c]=i,g(c)&&(h[c]=i)):I&&(R(c,e.k)&&(c.value=i),e.k&&(u[e.k]=i))};if(i){const k=()=>{O(),Tn.delete(e)};k.id=-1,Tn.set(e,k),Ne(k,n)}else us(e),O()}}}function us(e){const t=Tn.get(e);t&&(t.flags|=8,Tn.delete(e))}Hn().requestIdleCallback;Hn().cancelIdleCallback;const Ht=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function Fl(e,t){Go(e,"a",t)}function Hl(e,t){Go(e,"da",t)}function Go(e,t,n=Ce){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Bn(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Wo(s.parent.vnode)&&Ul(r,t,n,s),s=s.parent}}function Ul(e,t,n,r){const s=Bn(t,e,r,!0);Qo(()=>{Tr(r[t],s)},n)}function Bn(e,t,n=Ce,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{pt();const l=vn(n),c=Ge(t,n,e,i);return l(),gt(),c});return r?s.unshift(o):s.push(o),o}}const _t=e=>(t,n=Ce)=>{(!gn||e==="sp")&&Bn(e,(...r)=>t(...r),n)},ql=_t("bm"),Vl=_t("m"),zl=_t("bu"),Bl=_t("u"),Kl=_t("bum"),Qo=_t("um"),Wl=_t("sp"),Gl=_t("rtg"),Ql=_t("rtc");function Jl(e,t=Ce){Bn("ec",e,t)}const Yl="components",Jo=Symbol.for("v-ndc");function Yo(e){return ae(e)?Xl(Yl,e,!1)||e:e||Jo}function Xl(e,t,n=!0,r=!1){const s=Se||Ce;if(s){const o=s.type;{const l=Dc(o,!1);if(l&&(l===t||l===$e(t)||l===Fn($e(t))))return o}const i=fs(s[e]||o[e],t)||fs(s.appContext[e],t);return!i&&r?o:i}}function fs(e,t){return e&&(e[t]||e[$e(t)]||e[Fn($e(t))])}function kt(e,t,n,r){let s;const o=n,i=F(e);if(i||ae(e)){const l=i&&Pt(e);let c=!1,f=!1;l&&(c=!Ve(e),f=mt(e),e=Un(e)),s=new Array(e.length);for(let u=0,h=e.length;ut(l,c,void 0,o));else{const l=Object.keys(e);s=new Array(l.length);for(let c=0,f=l.length;c0;return V(),Qe(fe,null,[ge("slot",n,r)],f?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),V();const i=o&&Xo(o(n)),l=n.key||i&&i.key,c=Qe(fe,{key:(l&&!Ke(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),o&&o._c&&(o._d=!0),c}function Xo(e){return e.some(t=>pn(t)?!(t.type===yt||t.type===fe&&!Xo(t.children)):!0)?e:null}const yr=e=>e?vi(e)?Gn(e):yr(e.parent):null,ln=Ee(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>yr(e.parent),$root:e=>yr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ei(e),$forceUpdate:e=>e.f||(e.f=()=>{qr(e.update)}),$nextTick:e=>e.n||(e.n=Fo.bind(e.proxy)),$watch:e=>Il.bind(e)}),sr=(e,t)=>e!==re&&!e.__isScriptSetup&&Y(e,t),ec={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:l,appContext:c}=e;if(t[0]!=="$"){const p=i[t];if(p!==void 0)switch(p){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(sr(r,t))return i[t]=1,r[t];if(s!==re&&Y(s,t))return i[t]=2,s[t];if(Y(o,t))return i[t]=3,o[t];if(n!==re&&Y(n,t))return i[t]=4,n[t];_r&&(i[t]=0)}}const f=ln[t];let u,h;if(f)return t==="$attrs"&&Re(e.attrs,"get",""),f(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(n!==re&&Y(n,t))return i[t]=4,n[t];if(h=c.config.globalProperties,Y(h,t))return h[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return sr(s,t)?(s[t]=n,!0):r!==re&&Y(r,t)?(r[t]=n,!0):Y(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:s,props:o,type:i}},l){let c;return!!(n[l]||e!==re&&l[0]!=="$"&&Y(e,l)||sr(t,l)||Y(o,l)||Y(r,l)||Y(ln,l)||Y(s.config.globalProperties,l)||(c=i.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Y(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ds(e){return F(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let _r=!0;function tc(e){const t=ei(e),n=e.proxy,r=e.ctx;_r=!1,t.beforeCreate&&hs(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:l,provide:c,inject:f,created:u,beforeMount:h,mounted:p,beforeUpdate:g,updated:R,activated:w,deactivated:I,beforeDestroy:O,beforeUnmount:k,destroyed:M,unmounted:$,render:G,renderTracked:me,renderTriggered:se,errorCaptured:He,serverPrefetch:Ue,expose:Oe,inheritAttrs:qe,components:Ye,directives:je,filters:St}=t;if(f&&nc(f,r,null),i)for(const K in i){const z=i[K];U(z)&&(r[K]=z.bind(n))}if(s){const K=s.call(n,n);Z(K)&&(e.data=qn(K))}if(_r=!0,o)for(const K in o){const z=o[K],ye=U(z)?z.bind(n,n):U(z.get)?z.get.bind(n,n):it,ee=!U(z)&&U(z.set)?z.set.bind(n):it,Le=ce({get:ye,set:ee});Object.defineProperty(r,K,{enumerable:!0,configurable:!0,get:()=>Le.value,set:_e=>Le.value=_e})}if(l)for(const K in l)Zo(l[K],r,n,K);if(c){const K=U(c)?c.call(n):c;Reflect.ownKeys(K).forEach(z=>{En(z,K[z])})}u&&hs(u,e,"c");function he(K,z){F(z)?z.forEach(ye=>K(ye.bind(n))):z&&K(z.bind(n))}if(he(ql,h),he(Vl,p),he(zl,g),he(Bl,R),he(Fl,w),he(Hl,I),he(Jl,He),he(Ql,me),he(Gl,se),he(Kl,k),he(Qo,$),he(Wl,Ue),F(Oe))if(Oe.length){const K=e.exposed||(e.exposed={});Oe.forEach(z=>{Object.defineProperty(K,z,{get:()=>n[z],set:ye=>n[z]=ye,enumerable:!0})})}else e.exposed||(e.exposed={});G&&e.render===it&&(e.render=G),qe!=null&&(e.inheritAttrs=qe),Ye&&(e.components=Ye),je&&(e.directives=je),Ue&&Ko(e)}function nc(e,t,n=it){F(e)&&(e=vr(e));for(const r in e){const s=e[r];let o;Z(s)?"default"in s?o=ze(s.from||r,s.default,!0):o=ze(s.from||r):o=ze(s),ke(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function hs(e,t,n){Ge(F(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Zo(e,t,n,r){let s=r.includes(".")?Bo(n,r):()=>n[r];if(ae(e)){const o=t[e];U(o)&&sn(s,o)}else if(U(e))sn(s,e.bind(n));else if(Z(e))if(F(e))e.forEach(o=>Zo(o,t,n,r));else{const o=U(e.handler)?e.handler.bind(n):t[e.handler];U(o)&&sn(s,o,e)}}function ei(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let c;return l?c=l:!s.length&&!n&&!r?c=t:(c={},s.length&&s.forEach(f=>Mn(c,f,i,!0)),Mn(c,t,i)),Z(t)&&o.set(t,c),c}function Mn(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Mn(e,o,n,!0),s&&s.forEach(i=>Mn(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const l=rc[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const rc={data:ps,props:gs,emits:gs,methods:Xt,computed:Xt,beforeCreate:Te,created:Te,beforeMount:Te,mounted:Te,beforeUpdate:Te,updated:Te,beforeDestroy:Te,beforeUnmount:Te,destroyed:Te,unmounted:Te,activated:Te,deactivated:Te,errorCaptured:Te,serverPrefetch:Te,components:Xt,directives:Xt,watch:oc,provide:ps,inject:sc};function ps(e,t){return t?e?function(){return Ee(U(e)?e.call(this,this):e,U(t)?t.call(this,this):t)}:t:e}function sc(e,t){return Xt(vr(e),vr(t))}function vr(e){if(F(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${$e(t)}Modifiers`]||e[`${Tt(t)}Modifiers`];function ac(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||re;let s=n;const o=t.startsWith("update:"),i=o&&cc(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>ae(u)?u.trim():u)),i.number&&(s=n.map($r)));let l,c=r[l=Xn(t)]||r[l=Xn($e(t))];!c&&o&&(c=r[l=Xn(Tt(t))]),c&&Ge(c,e,6,s);const f=r[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Ge(f,e,6,s)}}const uc=new WeakMap;function ni(e,t,n=!1){const r=n?uc:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},l=!1;if(!U(e)){const c=f=>{const u=ni(f,t,!0);u&&(l=!0,Ee(i,u))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!l?(Z(e)&&r.set(e,null),null):(F(o)?o.forEach(c=>i[c]=null):Ee(i,o),Z(e)&&r.set(e,i),i)}function Kn(e,t){return!e||!In(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,Tt(t))||Y(e,t))}function ms(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:l,emit:c,render:f,renderCache:u,props:h,data:p,setupState:g,ctx:R,inheritAttrs:w}=e,I=Pn(e);let O,k;try{if(n.shapeFlag&4){const $=s||r,G=$;O=st(f.call(G,$,u,h,g,p,R)),k=l}else{const $=t;O=st($.length>1?$(h,{attrs:l,slots:i,emit:c}):$(h,null)),k=t.props?l:fc(l)}}catch($){cn.length=0,Vn($,e,1),O=ge(yt)}let M=O;if(k&&w!==!1){const $=Object.keys(k),{shapeFlag:G}=M;$.length&&G&7&&(o&&$.some(Ln)&&(k=dc(k,o)),M=Vt(M,k,!1,!0))}return n.dirs&&(M=Vt(M,null,!1,!0),M.dirs=M.dirs?M.dirs.concat(n.dirs):n.dirs),n.transition&&Vr(M,n.transition),O=M,Pn(I),O}const fc=e=>{let t;for(const n in e)(n==="class"||n==="style"||In(n))&&((t||(t={}))[n]=e[n]);return t},dc=(e,t)=>{const n={};for(const r in e)(!Ln(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function hc(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:l,patchFlag:c}=t,f=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?ys(r,i,f):!!i;if(c&8){const u=t.dynamicProps;for(let h=0;hObject.create(si),ii=e=>Object.getPrototypeOf(e)===si;function gc(e,t,n,r=!1){const s={},o=oi();e.propsDefaults=Object.create(null),li(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:No(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function mc(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,l=J(s),[c]=e.propsOptions;let f=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let h=0;h{c=!0;const[p,g]=ci(h,t,!0);Ee(i,p),g&&l.push(...g)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!c)return Z(e)&&r.set(e,Lt),Lt;if(F(o))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",Br=e=>F(e)?e.map(st):[st(e)],_c=(e,t,n)=>{if(t._n)return t;const r=zn((...s)=>Br(t(...s)),n);return r._c=!1,r},ai=(e,t,n)=>{const r=e._ctx;for(const s in e){if(zr(s))continue;const o=e[s];if(U(o))t[s]=_c(s,o,r);else if(o!=null){const i=Br(o);t[s]=()=>i}}},ui=(e,t)=>{const n=Br(t);e.slots.default=()=>n},fi=(e,t,n)=>{for(const r in t)(n||!zr(r))&&(e[r]=t[r])},vc=(e,t,n)=>{const r=e.slots=oi();if(e.vnode.shapeFlag&32){const s=t._;s?(fi(r,t,n),n&&yo(r,"_",s,!0)):ai(t,r)}else t&&ui(e,t)},bc=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=re;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:fi(s,t,n):(o=!t.$stable,ai(t,s)),i=t}else t&&(ui(e,t),i={default:1});if(o)for(const l in s)!zr(l)&&i[l]==null&&delete s[l]},Ne=Rc;function xc(e){return wc(e)}function wc(e,t){const n=Hn();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:l,createComment:c,setText:f,setElementText:u,parentNode:h,nextSibling:p,setScopeId:g=it,insertStaticContent:R}=e,w=(a,d,m,v=null,b=null,_=null,C=void 0,E=null,S=!!d.dynamicChildren)=>{if(a===d)return;a&&!Jt(a,d)&&(v=y(a),_e(a,b,_,!0),a=null),d.patchFlag===-2&&(S=!1,d.dynamicChildren=null);const{type:x,ref:L,shapeFlag:P}=d;switch(x){case Wn:I(a,d,m,v);break;case yt:O(a,d,m,v);break;case ir:a==null&&k(d,m,v,C);break;case fe:Ye(a,d,m,v,b,_,C,E,S);break;default:P&1?G(a,d,m,v,b,_,C,E,S):P&6?je(a,d,m,v,b,_,C,E,S):(P&64||P&128)&&x.process(a,d,m,v,b,_,C,E,S,j)}L!=null&&b?on(L,a&&a.ref,_,d||a,!d):L==null&&a&&a.ref!=null&&on(a.ref,null,_,a,!0)},I=(a,d,m,v)=>{if(a==null)r(d.el=l(d.children),m,v);else{const b=d.el=a.el;d.children!==a.children&&f(b,d.children)}},O=(a,d,m,v)=>{a==null?r(d.el=c(d.children||""),m,v):d.el=a.el},k=(a,d,m,v)=>{[a.el,a.anchor]=R(a.children,d,m,v,a.el,a.anchor)},M=({el:a,anchor:d},m,v)=>{let b;for(;a&&a!==d;)b=p(a),r(a,m,v),a=b;r(d,m,v)},$=({el:a,anchor:d})=>{let m;for(;a&&a!==d;)m=p(a),s(a),a=m;s(d)},G=(a,d,m,v,b,_,C,E,S)=>{if(d.type==="svg"?C="svg":d.type==="math"&&(C="mathml"),a==null)me(d,m,v,b,_,C,E,S);else{const x=a.el&&a.el._isVueCE?a.el:null;try{x&&x._beginPatch(),Ue(a,d,b,_,C,E,S)}finally{x&&x._endPatch()}}},me=(a,d,m,v,b,_,C,E)=>{let S,x;const{props:L,shapeFlag:P,transition:N,dirs:D}=a;if(S=a.el=i(a.type,_,L&&L.is,L),P&8?u(S,a.children):P&16&&He(a.children,S,null,v,b,or(a,_),C,E),D&&Et(a,null,v,"created"),se(S,a,a.scopeId,C,v),L){for(const ne in L)ne!=="value"&&!tn(ne)&&o(S,ne,null,L[ne],_,v);"value"in L&&o(S,"value",null,L.value,_),(x=L.onVnodeBeforeMount)&&tt(x,v,a)}D&&Et(a,null,v,"beforeMount");const W=Sc(b,N);W&&N.beforeEnter(S),r(S,d,m),((x=L&&L.onVnodeMounted)||W||D)&&Ne(()=>{x&&tt(x,v,a),W&&N.enter(S),D&&Et(a,null,v,"mounted")},b)},se=(a,d,m,v,b)=>{if(m&&g(a,m),v)for(let _=0;_{for(let x=S;x{const E=d.el=a.el;let{patchFlag:S,dynamicChildren:x,dirs:L}=d;S|=a.patchFlag&16;const P=a.props||re,N=d.props||re;let D;if(m&&Rt(m,!1),(D=N.onVnodeBeforeUpdate)&&tt(D,m,d,a),L&&Et(d,a,m,"beforeUpdate"),m&&Rt(m,!0),(P.innerHTML&&N.innerHTML==null||P.textContent&&N.textContent==null)&&u(E,""),x?Oe(a.dynamicChildren,x,E,m,v,or(d,b),_):C||z(a,d,E,null,m,v,or(d,b),_,!1),S>0){if(S&16)qe(E,P,N,m,b);else if(S&2&&P.class!==N.class&&o(E,"class",null,N.class,b),S&4&&o(E,"style",P.style,N.style,b),S&8){const W=d.dynamicProps;for(let ne=0;ne{D&&tt(D,m,d,a),L&&Et(d,a,m,"updated")},v)},Oe=(a,d,m,v,b,_,C)=>{for(let E=0;E{if(d!==m){if(d!==re)for(const _ in d)!tn(_)&&!(_ in m)&&o(a,_,d[_],null,b,v);for(const _ in m){if(tn(_))continue;const C=m[_],E=d[_];C!==E&&_!=="value"&&o(a,_,E,C,b,v)}"value"in m&&o(a,"value",d.value,m.value,b)}},Ye=(a,d,m,v,b,_,C,E,S)=>{const x=d.el=a?a.el:l(""),L=d.anchor=a?a.anchor:l("");let{patchFlag:P,dynamicChildren:N,slotScopeIds:D}=d;D&&(E=E?E.concat(D):D),a==null?(r(x,m,v),r(L,m,v),He(d.children||[],m,L,b,_,C,E,S)):P>0&&P&64&&N&&a.dynamicChildren&&a.dynamicChildren.length===N.length?(Oe(a.dynamicChildren,N,m,b,_,C,E),(d.key!=null||b&&d===b.subTree)&&di(a,d,!0)):z(a,d,m,L,b,_,C,E,S)},je=(a,d,m,v,b,_,C,E,S)=>{d.slotScopeIds=E,a==null?d.shapeFlag&512?b.ctx.activate(d,m,v,C,S):St(d,m,v,b,_,C,S):Ae(a,d,S)},St=(a,d,m,v,b,_,C)=>{const E=a.component=$c(a,v,b);if(Wo(a)&&(E.ctx.renderer=j),jc(E,!1,C),E.asyncDep){if(b&&b.registerDep(E,he,C),!a.el){const S=E.subTree=ge(yt);O(null,S,d,m),a.placeholder=S.el}}else he(E,a,d,m,b,_,C)},Ae=(a,d,m)=>{const v=d.component=a.component;if(hc(a,d,m))if(v.asyncDep&&!v.asyncResolved){K(v,d,m);return}else v.next=d,v.update();else d.el=a.el,v.vnode=d},he=(a,d,m,v,b,_,C)=>{const E=()=>{if(a.isMounted){let{next:P,bu:N,u:D,parent:W,vnode:ne}=a;{const Ze=hi(a);if(Ze){P&&(P.el=ne.el,K(a,P,C)),Ze.asyncDep.then(()=>{Ne(()=>{a.isUnmounted||x()},b)});return}}let te=P,pe;Rt(a,!1),P?(P.el=ne.el,K(a,P,C)):P=ne,N&&Sn(N),(pe=P.props&&P.props.onVnodeBeforeUpdate)&&tt(pe,W,P,ne),Rt(a,!0);const be=ms(a),Xe=a.subTree;a.subTree=be,w(Xe,be,h(Xe.el),y(Xe),a,b,_),P.el=be.el,te===null&&pc(a,be.el),D&&Ne(D,b),(pe=P.props&&P.props.onVnodeUpdated)&&Ne(()=>tt(pe,W,P,ne),b)}else{let P;const{el:N,props:D}=d,{bm:W,m:ne,parent:te,root:pe,type:be}=a,Xe=Ht(d);Rt(a,!1),W&&Sn(W),!Xe&&(P=D&&D.onVnodeBeforeMount)&&tt(P,te,d),Rt(a,!0);{pe.ce&&pe.ce._hasShadowRoot()&&pe.ce._injectChildStyle(be,a.parent?a.parent.type:void 0);const Ze=a.subTree=ms(a);w(null,Ze,m,v,a,b,_),d.el=Ze.el}if(ne&&Ne(ne,b),!Xe&&(P=D&&D.onVnodeMounted)){const Ze=d;Ne(()=>tt(P,te,Ze),b)}(d.shapeFlag&256||te&&Ht(te.vnode)&&te.vnode.shapeFlag&256)&&a.a&&Ne(a.a,b),a.isMounted=!0,d=m=v=null}};a.scope.on();const S=a.effect=new xo(E);a.scope.off();const x=a.update=S.run.bind(S),L=a.job=S.runIfDirty.bind(S);L.i=a,L.id=a.uid,S.scheduler=()=>qr(L),Rt(a,!0),x()},K=(a,d,m)=>{d.component=a;const v=a.vnode.props;a.vnode=d,a.next=null,mc(a,d.props,v,m),bc(a,d.children,m),pt(),ls(a),gt()},z=(a,d,m,v,b,_,C,E,S=!1)=>{const x=a&&a.children,L=a?a.shapeFlag:0,P=d.children,{patchFlag:N,shapeFlag:D}=d;if(N>0){if(N&128){ee(x,P,m,v,b,_,C,E,S);return}else if(N&256){ye(x,P,m,v,b,_,C,E,S);return}}D&8?(L&16&&ve(x,b,_),P!==x&&u(m,P)):L&16?D&16?ee(x,P,m,v,b,_,C,E,S):ve(x,b,_,!0):(L&8&&u(m,""),D&16&&He(P,m,v,b,_,C,E,S))},ye=(a,d,m,v,b,_,C,E,S)=>{a=a||Lt,d=d||Lt;const x=a.length,L=d.length,P=Math.min(x,L);let N;for(N=0;NL?ve(a,b,_,!0,!1,P):He(d,m,v,b,_,C,E,S,P)},ee=(a,d,m,v,b,_,C,E,S)=>{let x=0;const L=d.length;let P=a.length-1,N=L-1;for(;x<=P&&x<=N;){const D=a[x],W=d[x]=S?ft(d[x]):st(d[x]);if(Jt(D,W))w(D,W,m,null,b,_,C,E,S);else break;x++}for(;x<=P&&x<=N;){const D=a[P],W=d[N]=S?ft(d[N]):st(d[N]);if(Jt(D,W))w(D,W,m,null,b,_,C,E,S);else break;P--,N--}if(x>P){if(x<=N){const D=N+1,W=DN)for(;x<=P;)_e(a[x],b,_,!0),x++;else{const D=x,W=x,ne=new Map;for(x=W;x<=N;x++){const De=d[x]=S?ft(d[x]):st(d[x]);De.key!=null&&ne.set(De.key,x)}let te,pe=0;const be=N-W+1;let Xe=!1,Ze=0;const Gt=new Array(be);for(x=0;x=be){_e(De,b,_,!0);continue}let et;if(De.key!=null)et=ne.get(De.key);else for(te=W;te<=N;te++)if(Gt[te-W]===0&&Jt(De,d[te])){et=te;break}et===void 0?_e(De,b,_,!0):(Gt[et-W]=x+1,et>=Ze?Ze=et:Xe=!0,w(De,d[et],m,null,b,_,C,E,S),pe++)}const es=Xe?Ec(Gt):Lt;for(te=es.length-1,x=be-1;x>=0;x--){const De=W+x,et=d[De],ts=d[De+1],ns=De+1{const{el:_,type:C,transition:E,children:S,shapeFlag:x}=a;if(x&6){Le(a.component.subTree,d,m,v);return}if(x&128){a.suspense.move(d,m,v);return}if(x&64){C.move(a,d,m,j);return}if(C===fe){r(_,d,m);for(let P=0;PE.enter(_),b));else{const{leave:P,delayLeave:N,afterLeave:D}=E,W=()=>{a.ctx.isUnmounted?s(_):r(_,d,m)},ne=()=>{const te=_._isLeaving||!!_[rr];_._isLeaving&&_[rr](!0),E.persisted&&!te?W():P(_,()=>{W(),D&&D()})};N?N(_,W,ne):ne()}else r(_,d,m)},_e=(a,d,m,v=!1,b=!1)=>{const{type:_,props:C,ref:E,children:S,dynamicChildren:x,shapeFlag:L,patchFlag:P,dirs:N,cacheIndex:D,memo:W}=a;if(P===-2&&(b=!1),E!=null&&(pt(),on(E,null,m,a,!0),gt()),D!=null&&(d.renderCache[D]=void 0),L&256){d.ctx.deactivate(a);return}const ne=L&1&&N,te=!Ht(a);let pe;if(te&&(pe=C&&C.onVnodeBeforeUnmount)&&tt(pe,d,a),L&6)Pe(a.component,m,v);else{if(L&128){a.suspense.unmount(m,v);return}ne&&Et(a,null,d,"beforeUnmount"),L&64?a.type.remove(a,d,m,j,v):x&&!x.hasOnce&&(_!==fe||P>0&&P&64)?ve(x,d,m,!1,!0):(_===fe&&P&384||!b&&L&16)&&ve(S,d,m),v&&ue(a)}const be=W!=null&&D==null;(te&&(pe=C&&C.onVnodeUnmounted)||ne||be)&&Ne(()=>{pe&&tt(pe,d,a),ne&&Et(a,null,d,"unmounted"),be&&(a.el=null)},m)},ue=a=>{const{type:d,el:m,anchor:v,transition:b}=a;if(d===fe){oe(m,v);return}if(d===ir){$(a);return}const _=()=>{s(m),b&&!b.persisted&&b.afterLeave&&b.afterLeave()};if(a.shapeFlag&1&&b&&!b.persisted){const{leave:C,delayLeave:E}=b,S=()=>C(m,_);E?E(a.el,_,S):S()}else _()},oe=(a,d)=>{let m;for(;a!==d;)m=p(a),s(a),a=m;s(d)},Pe=(a,d,m)=>{const{bum:v,scope:b,job:_,subTree:C,um:E,m:S,a:x}=a;vs(S),vs(x),v&&Sn(v),b.stop(),_&&(_.flags|=8,_e(C,a,d,m)),E&&Ne(E,d),Ne(()=>{a.isUnmounted=!0},d)},ve=(a,d,m,v=!1,b=!1,_=0)=>{for(let C=_;C{if(a.shapeFlag&6)return y(a.component.subTree);if(a.shapeFlag&128)return a.suspense.next();const d=p(a.anchor||a.el),m=d&&d[Ll];return m?p(m):d};let T=!1;const A=(a,d,m)=>{let v;a==null?d._vnode&&(_e(d._vnode,null,null,!0),v=d._vnode.component):w(d._vnode||null,a,d,null,null,null,m),d._vnode=a,T||(T=!0,ls(v),Uo(),T=!1)},j={p:w,um:_e,m:Le,r:ue,mt:St,mc:He,pc:z,pbc:Oe,n:y,o:e};return{render:A,hydrate:void 0,createApp:lc(A)}}function or({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Rt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Sc(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function di(e,t,n=!1){const r=e.children,s=t.children;if(F(r)&&F(s))for(let o=0;o>1,e[n[l]]0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function hi(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:hi(t)}function vs(e){if(e)for(let t=0;te.__isSuspense;function Rc(e,t){t&&t.pendingBranch?F(e)?t.effects.push(...e):t.effects.push(e):Ol(e)}const fe=Symbol.for("v-fgt"),Wn=Symbol.for("v-txt"),yt=Symbol.for("v-cmt"),ir=Symbol.for("v-stc"),cn=[];let Fe=null;function V(e=!1){cn.push(Fe=e?null:[])}function Cc(){cn.pop(),Fe=cn[cn.length-1]||null}let hn=1;function $n(e,t=!1){hn+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function mi(e){return e.dynamicChildren=hn>0?Fe||Lt:null,Cc(),hn>0&&Fe&&Fe.push(e),e}function le(e,t,n,r,s,o){return mi(H(e,t,n,r,s,o,!0))}function Qe(e,t,n,r,s){return mi(ge(e,t,n,r,s,!0))}function pn(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const yi=({key:e})=>e??null,Rn=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ae(e)||ke(e)||U(e)?{i:Se,r:e,k:t,f:!!n}:e:null);function H(e,t=null,n=null,r=0,s=null,o=e===fe?0:1,i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&yi(t),ref:t&&Rn(t),scopeId:Vo,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Se};return l?(Kr(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=ae(n)?8:16),hn>0&&!i&&Fe&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&Fe.push(c),c}const ge=kc;function kc(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Jo)&&(e=yt),pn(e)){const l=Vt(e,t,!0);return n&&Kr(l,n),hn>0&&!o&&Fe&&(l.shapeFlag&6?Fe[Fe.indexOf(e)]=l:Fe.push(l)),l.patchFlag=-2,l}if(Fc(e)&&(e=e.__vccOpts),t){t=Ac(t);let{class:l,style:c}=t;l&&!ae(l)&&(t.class=wt(l)),Z(c)&&(Ur(c)&&!F(c)&&(c=Ee({},c)),t.style=Or(c))}const i=ae(e)?1:gi(e)?128:Dl(e)?64:Z(e)?4:U(e)?2:0;return H(e,t,n,r,s,i,o,!0)}function Ac(e){return e?Ur(e)||ii(e)?Ee({},e):e:null}function Vt(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:l,transition:c}=e,f=t?Pc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&yi(f),ref:t&&t.ref?n&&o?F(o)?o.concat(Rn(t)):[o,Rn(t)]:Rn(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==fe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vt(e.ssContent),ssFallback:e.ssFallback&&Vt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Vr(u,c.clone(u)),u}function _i(e=" ",t=0){return ge(Wn,null,e,t)}function jt(e="",t=!1){return t?(V(),Qe(yt,null,e)):ge(yt,null,e)}function st(e){return e==null||typeof e=="boolean"?ge(yt):F(e)?ge(fe,null,e.slice()):pn(e)?ft(e):ge(Wn,null,String(e))}function ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function Kr(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(F(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Kr(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!ii(t)?t._ctx=Se:s===3&&Se&&(Se.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else U(t)?(t={default:t,_ctx:Se},n=32):(t=String(t),r&64?(n=16,t=[_i(t)]):n=8);e.children=t,e.shapeFlag|=n}function Pc(...e){const t={};for(let n=0;nCe||Se;let On,xr;{const e=Hn(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};On=t("__VUE_INSTANCE_SETTERS__",n=>Ce=n),xr=t("__VUE_SSR_SETTERS__",n=>gn=n)}const vn=e=>{const t=Ce;return On(e),e.scope.on(),()=>{e.scope.off(),On(t)}},bs=()=>{Ce&&Ce.scope.off(),On(null)};function vi(e){return e.vnode.shapeFlag&4}let gn=!1;function jc(e,t=!1,n=!1){t&&xr(t);const{props:r,children:s}=e.vnode,o=vi(e);gc(e,r,o,t),vc(e,s,n||t);const i=o?Nc(e,t):void 0;return t&&xr(!1),i}function Nc(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ec);const{setup:r}=n;if(r){pt();const s=e.setupContext=r.length>1?Lc(e):null,o=vn(e),i=_n(r,e,0,[e.props,s]),l=po(i);if(gt(),o(),(l||e.sp)&&!Ht(e)&&Ko(e),l){if(i.then(bs,bs),t)return i.then(c=>{xs(e,c)}).catch(c=>{Vn(c,e,0)});e.asyncDep=i}else xs(e,i)}else bi(e)}function xs(e,t,n){U(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Z(t)&&(e.setupState=Lo(t)),bi(e)}function bi(e,t,n){const r=e.type;e.render||(e.render=r.render||it);{const s=vn(e);pt();try{tc(e)}finally{gt(),s()}}}const Ic={get(e,t){return Re(e,"get",""),e[t]}};function Lc(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Ic),slots:e.slots,emit:e.emit,expose:t}}function Gn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Lo(Sl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ln)return ln[n](e)},has(t,n){return n in t||n in ln}})):e.proxy}function Dc(e,t=!0){return U(e)?e.displayName||e.name:e.name||t&&e.__name}function Fc(e){return U(e)&&"__vccOpts"in e}const ce=(e,t)=>Al(e,t,gn);function mn(e,t,n){try{$n(-1);const r=arguments.length;return r===2?Z(t)&&!F(t)?pn(t)?ge(e,null,[t]):ge(e,t):ge(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&pn(n)&&(n=[n]),ge(e,t,n))}finally{$n(1)}}const Hc="3.5.35";let wr;const ws=typeof window<"u"&&window.trustedTypes;if(ws)try{wr=ws.createPolicy("vue",{createHTML:e=>e})}catch{}const xi=wr?e=>wr.createHTML(e):e=>e,Uc="http://www.w3.org/2000/svg",qc="http://www.w3.org/1998/Math/MathML",ut=typeof document<"u"?document:null,Ss=ut&&ut.createElement("template"),Vc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?ut.createElementNS(Uc,e):t==="mathml"?ut.createElementNS(qc,e):n?ut.createElement(e,{is:n}):ut.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>ut.createTextNode(e),createComment:e=>ut.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ut.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{Ss.innerHTML=xi(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=Ss.content;if(r==="svg"||r==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},zc=Symbol("_vtc");function Bc(e,t,n){const r=e[zc];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Es=Symbol("_vod"),Kc=Symbol("_vsh"),Wc=Symbol(""),Gc=/(?:^|;)\s*display\s*:/;function Qc(e,t,n){const r=e.style,s=ae(n);let o=!1;if(n&&!s){if(t)if(ae(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&Zt(r,l,"")}else for(const i in t)n[i]==null&&Zt(r,i,"");for(const i in n){i==="display"&&(o=!0);const l=n[i];l!=null?Yc(e,i,!ae(t)&&t?t[i]:void 0,l)||Zt(r,i,l):Zt(r,i,"")}}else if(s){if(t!==n){const i=r[Wc];i&&(n+=";"+i),r.cssText=n,o=Gc.test(n)}}else t&&e.removeAttribute("style");Es in e&&(e[Es]=o?r.display:"",e[Kc]&&(r.display="none"))}const Rs=/\s*!important$/;function Zt(e,t,n){if(F(n))n.forEach(r=>Zt(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Jc(e,t);Rs.test(n)?e.setProperty(Tt(r),n.replace(Rs,""),"important"):e[r]=n}}const Cs=["Webkit","Moz","ms"],lr={};function Jc(e,t){const n=lr[t];if(n)return n;let r=$e(t);if(r!=="filter"&&r in e)return lr[t]=r;r=Fn(r);for(let s=0;scr||(ta.then(()=>cr=0),cr=Date.now());function ra(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const s=n.value;if(F(s)){const o=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{o.call(r),r._stopped=!0};const i=s.slice(),l=[r];for(let c=0;ce.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,sa=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?Bc(e,r,i):t==="style"?Qc(e,n,r):In(t)?Ln(t)||Zc(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):oa(e,t,r,i))?(Ps(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&As(e,t,r,i,o,t!=="value")):e._isVueCE&&(ia(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!ae(r)))?Ps(e,$e(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),As(e,t,r,i))};function oa(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&$s(t)&&U(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return $s(t)&&ae(n)?!1:t in e}function ia(e,t){const n=e._def.props;if(!n)return!1;const r=$e(t);return Array.isArray(n)?n.some(s=>$e(s)===r):Object.keys(n).some(s=>$e(s)===r)}const Os=e=>{const t=e.props["onUpdate:modelValue"]||!1;return F(t)?n=>Sn(t,n):t};function la(e){e.target.composing=!0}function js(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ar=Symbol("_assign");function Ns(e,t,n){return t&&(e=e.trim()),n&&(e=$r(e)),e}const Is={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[ar]=Os(s);const o=r||s.props&&s.props.type==="number";Nt(e,t?"change":"input",i=>{i.target.composing||e[ar](Ns(e.value,n,o))}),(n||o)&&Nt(e,"change",()=>{e.value=Ns(e.value,n,o)}),t||(Nt(e,"compositionstart",la),Nt(e,"compositionend",js),Nt(e,"change",js))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[ar]=Os(i),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?$r(e.value):e.value,c=t??"";if(l===c)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===c)||(e.value=c)}},ca=["ctrl","shift","alt","meta"],aa={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ca.some(n=>e[`${n}Key`]&&!t.includes(n))},ua=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i{const t=da().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=ga(r);if(!s)return;const o=t._component;!U(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,pa(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function pa(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ga(e){return ae(e)?document.querySelector(e):e}const It=typeof document<"u";function wi(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function ma(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&wi(e.default)}const Q=Object.assign;function ur(e,t){const n={};for(const r in t){const s=t[r];n[r]=Je(s)?s.map(e):e(s)}return n}const an=()=>{},Je=Array.isArray;function Ds(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Si=Symbol("");function zt(e,t){return Q(new Error,{type:e,[Si]:!0},t)}function at(e,t){return e instanceof Error&&Si in e&&(t==null||!!(e.type&t))}const ya=Symbol(""),Fs=Symbol(""),Qn=Symbol(""),Wr=Symbol(""),Sr=Symbol("");function _a(){return ze(Qn)}function Wt(e){return ze(Wr)}const Ei=/#/g,va=/&/g,ba=/\//g,xa=/=/g,wa=/\?/g,Ri=/\+/g,Sa=/%5B/g,Ea=/%5D/g,Ci=/%5E/g,Ra=/%60/g,ki=/%7B/g,Ca=/%7C/g,Ai=/%7D/g,ka=/%20/g;function Gr(e){return e==null?"":encodeURI(""+e).replace(Ca,"|").replace(Sa,"[").replace(Ea,"]")}function Aa(e){return Gr(e).replace(ki,"{").replace(Ai,"}").replace(Ci,"^")}function Er(e){return Gr(e).replace(Ri,"%2B").replace(ka,"+").replace(Ei,"%23").replace(va,"%26").replace(Ra,"`").replace(ki,"{").replace(Ai,"}").replace(Ci,"^")}function Pa(e){return Er(e).replace(xa,"%3D")}function Ta(e){return Gr(e).replace(Ei,"%23").replace(wa,"%3F")}function Ma(e){return Ta(e).replace(ba,"%2F")}function jn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const $a=/\/$/,Oa=e=>e.replace($a,"");function fr(e,t,n="/"){let r,s={},o="",i="";const l=t.indexOf("#");let c=t.indexOf("?");return c=l>=0&&c>l?-1:c,c>=0&&(r=t.slice(0,c),o=t.slice(c,l>0?l:t.length),s=e(o.slice(1))),l>=0&&(r=r||t.slice(0,l),i=t.slice(l,t.length)),r=La(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:jn(i)}}function ja(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Hs(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Na(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Bt(t.matched[r],n.matched[s])&&Pi(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Bt(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Pi(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Ia(e[n],t[n]))return!1;return!0}function Ia(e,t){return Je(e)?Us(e,t):Je(t)?Us(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function Us(e,t){return Je(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function La(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,l;for(i=0;i1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const vt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};function Da(e){if(!e)if(It){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Oa(e)}const Fa=/^[^#]+#/;function Ha(e,t){return e.replace(Fa,"#")+t}function Ua(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Jn=()=>({left:window.scrollX,top:window.scrollY});function qa(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=Ua(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function qs(e,t){return(history.state?history.state.position-t:-1)+e}const Rr=new Map;function Va(e,t){Rr.set(e,t)}function za(e){const t=Rr.get(e);return Rr.delete(e),t}function Ba(e){return typeof e=="string"||e&&typeof e=="object"}function Ti(e){return typeof e=="string"||typeof e=="symbol"}function Ka(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;rs&&Er(s)):[r&&Er(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function Wa(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Je(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}function Yt(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function xt(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((l,c)=>{const f=p=>{p===!1?c(zt(4,{from:n,to:t})):p instanceof Error?c(p):Ba(p)?c(zt(2,{from:t,to:p})):(i&&r.enterCallbacks[s]===i&&typeof p=="function"&&i.push(p),l())},u=o(()=>e.call(r&&r.instances[s],t,n,f));let h=Promise.resolve(u);e.length<3&&(h=h.then(f)),h.catch(p=>c(p))})}function dr(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const l in i.components){let c=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(wi(c)){const f=(c.__vccOpts||c)[t];f&&o.push(xt(f,n,r,i,l,s))}else{let f=c();o.push(()=>f.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const h=ma(u)?u.default:u;i.mods[l]=u,i.components[l]=h;const p=(h.__vccOpts||h)[t];return p&&xt(p,n,r,i,l,s)()}))}}return o}function Ga(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;iBt(f,l))?r.push(l):n.push(l));const c=e.matched[i];c&&(t.matched.find(f=>Bt(f,c))||s.push(c))}return[n,r,s]}let Qa=()=>location.protocol+"//"+location.host;function Mi(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,l=s.slice(i);return l[0]!=="/"&&(l="/"+l),Hs(l,"")}return Hs(n,e)+r+s}function Ja(e,t,n,r){let s=[],o=[],i=null;const l=({state:p})=>{const g=Mi(e,location),R=n.value,w=t.value;let I=0;if(p){if(n.value=g,t.value=p,i&&i===R){i=null;return}I=w?p.position-w.position:0}else r(g);s.forEach(O=>{O(n.value,R,{delta:I,type:"pop",direction:I?I>0?"forward":"back":""})})};function c(){i=n.value}function f(p){s.push(p);const g=()=>{const R=s.indexOf(p);R>-1&&s.splice(R,1)};return o.push(g),g}function u(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(Q({},p.state,{scroll:Jn()}),"")}}function h(){for(const p of o)p();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:c,listen:f,destroy:h}}function zs(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?Jn():null}}function Ya(e){const{history:t,location:n}=window,r={value:Mi(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(c,f,u){const h=e.indexOf("#"),p=h>-1?(n.host&&document.querySelector("base")?e:e.slice(h))+c:Qa()+e+c;try{t[u?"replaceState":"pushState"](f,"",p),s.value=f}catch(g){console.error(g),n[u?"replace":"assign"](p)}}function i(c,f){o(c,Q({},t.state,zs(s.value.back,c,s.value.forward,!0),f,{position:s.value.position}),!0),r.value=c}function l(c,f){const u=Q({},s.value,t.state,{forward:c,scroll:Jn()});o(u.current,u,!0),o(c,Q({},zs(r.value,c,null),{position:u.position+1},f),!1),r.value=c}return{location:r,state:s,push:l,replace:i}}function Xa(e){e=Da(e);const t=Ya(e),n=Ja(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=Q({location:"",base:e,go:r,createHref:Ha.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}const Za={type:0,value:""},eu=/[a-zA-Z0-9_]/;function tu(e){if(!e)return[[]];if(e==="/")return[[Za]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${n})/"${f}": ${g}`)}let n=0,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let l=0,c,f="",u="";function h(){f&&(n===0?o.push({type:0,value:f}):n===1||n===2||n===3?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:f,regexp:u,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),f="")}function p(){f+=c}for(;lt.length?t.length===1&&t[0]===80?1:-1:0}function $i(e,t){let n=0;const r=e.score,s=t.score;for(;n0&&t[t.length-1]<0}const iu={strict:!1,end:!0,sensitive:!1};function lu(e,t,n){const r=su(tu(e.path),n),s=Q(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function cu(e,t){const n=[],r=new Map;t=Ds(iu,t);function s(h){return r.get(h)}function o(h,p,g){const R=!g,w=Gs(h);w.aliasOf=g&&g.record;const I=Ds(t,h),O=[w];if("alias"in h){const $=typeof h.alias=="string"?[h.alias]:h.alias;for(const G of $)O.push(Gs(Q({},w,{components:g?g.record.components:w.components,path:G,aliasOf:g?g.record:w})))}let k,M;for(const $ of O){const{path:G}=$;if(p&&G[0]!=="/"){const me=p.record.path,se=me[me.length-1]==="/"?"":"/";$.path=p.record.path+(G&&se+G)}if(k=lu($,p,I),g?g.alias.push(k):(M=M||k,M!==k&&M.alias.push(k),R&&h.name&&!Qs(k)&&i(h.name)),Oi(k)&&c(k),w.children){const me=w.children;for(let se=0;se{i(M)}:an}function i(h){if(Ti(h)){const p=r.get(h);p&&(r.delete(h),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(h);p>-1&&(n.splice(p,1),h.record.name&&r.delete(h.record.name),h.children.forEach(i),h.alias.forEach(i))}}function l(){return n}function c(h){const p=fu(h,n);n.splice(p,0,h),h.record.name&&!Qs(h)&&r.set(h.record.name,h)}function f(h,p){let g,R={},w,I;if("name"in h&&h.name){if(g=r.get(h.name),!g)throw zt(1,{location:h});I=g.record.name,R=Q(Ws(p.params,g.keys.filter(M=>!M.optional).concat(g.parent?g.parent.keys.filter(M=>M.optional):[]).map(M=>M.name)),h.params&&Ws(h.params,g.keys.map(M=>M.name))),w=g.stringify(R)}else if(h.path!=null)w=h.path,g=n.find(M=>M.re.test(w)),g&&(R=g.parse(w),I=g.record.name,g.keys.forEach(M=>{M.optional&&!R[M.name]&&delete R[M.name]}));else{if(g=p.name?r.get(p.name):n.find(M=>M.re.test(p.path)),!g)throw zt(1,{location:h,currentLocation:p});I=g.record.name,R=Q({},p.params,h.params),w=g.stringify(R)}const O=[];let k=g;for(;k;)O.unshift(k.record),k=k.parent;return{name:I,path:w,params:R,matched:O,meta:uu(O)}}e.forEach(h=>o(h));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:f,removeRoute:i,clearRoutes:u,getRoutes:l,getRecordMatcher:s}}function Ws(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Gs(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:au(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function au(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Qs(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function uu(e){return e.reduce((t,n)=>Q(t,n.meta),{})}function fu(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;$i(e,t[o])<0?r=o:n=o+1}const s=du(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function du(e){let t=e;for(;t=t.parent;)if(Oi(t)&&$i(e,t)===0)return t}function Oi({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Js(e){const t=ze(Qn),n=ze(Wr),r=ce(()=>{const c=X(e.to);return t.resolve(c)}),s=ce(()=>{const{matched:c}=r.value,{length:f}=c,u=c[f-1],h=n.matched;if(!u||!h.length)return-1;const p=h.findIndex(Bt.bind(null,u));if(p>-1)return p;const g=Ys(c[f-2]);return f>1&&Ys(u)===g&&h[h.length-1].path!==g?h.findIndex(Bt.bind(null,c[f-2])):p}),o=ce(()=>s.value>-1&&gu(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Pi(n.params,r.value.params));function l(c={}){if(pu(c)){const f=t[X(e.replace)?"replace":"push"](X(e.to)).catch(an);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:l}}function hu(e){return e.length===1?e[0]:e}const Qr=lt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Js,setup(e,{slots:t}){const n=qn(Js(e)),{options:r}=ze(Qn),s=ce(()=>({[Xs(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Xs(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&hu(t.default(n));return e.custom?o:mn("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}});function pu(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function gu(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!Je(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Ys(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Xs=(e,t,n)=>e??t??n,mu=lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=ze(Sr),s=ce(()=>e.route||r.value),o=ze(Fs,0),i=ce(()=>{let f=X(o);const{matched:u}=s.value;let h;for(;(h=u[f])&&!h.components;)f++;return f}),l=ce(()=>s.value.matched[i.value]);En(Fs,ce(()=>i.value+1)),En(ya,l),En(Sr,s);const c=Ie();return sn(()=>[c.value,l.value,e.name],([f,u,h],[p,g,R])=>{u&&(u.instances[h]=f,g&&g!==u&&f&&f===p&&(u.leaveGuards.size||(u.leaveGuards=g.leaveGuards),u.updateGuards.size||(u.updateGuards=g.updateGuards))),f&&u&&(!g||!Bt(u,g)||!p)&&(u.enterCallbacks[h]||[]).forEach(w=>w(f))},{flush:"post"}),()=>{const f=s.value,u=e.name,h=l.value,p=h&&h.components[u];if(!p)return Zs(n.default,{Component:p,route:f});const g=h.props[u],R=g?g===!0?f.params:typeof g=="function"?g(f):g:null,I=mn(p,Q({},R,t,{onVnodeUnmounted:O=>{O.component.isUnmounted&&(h.instances[u]=null)},ref:c}));return Zs(n.default,{Component:I,route:f})||I}}});function Zs(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Cr=mu;function yu(e){const t=cu(e.routes,e),n=e.parseQuery||Ka,r=e.stringifyQuery||Vs,s=e.history,o=Yt(),i=Yt(),l=Yt(),c=El(vt);let f=vt;It&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=ur.bind(null,y=>""+y),h=ur.bind(null,Ma),p=ur.bind(null,jn);function g(y,T){let A,j;return Ti(y)?(A=t.getRecordMatcher(y),j=T):j=y,t.addRoute(j,A)}function R(y){const T=t.getRecordMatcher(y);T&&t.removeRoute(T)}function w(){return t.getRoutes().map(y=>y.record)}function I(y){return!!t.getRecordMatcher(y)}function O(y,T){if(T=Q({},T||c.value),typeof y=="string"){const m=fr(n,y,T.path),v=t.resolve({path:m.path},T),b=s.createHref(m.fullPath);return Q(m,v,{params:p(v.params),redirectedFrom:void 0,href:b})}let A;if(y.path!=null)A=Q({},y,{path:fr(n,y.path,T.path).path});else{const m=Q({},y.params);for(const v in m)m[v]==null&&delete m[v];A=Q({},y,{params:h(m)}),T.params=h(T.params)}const j=t.resolve(A,T),B=y.hash||"";j.params=u(p(j.params));const a=ja(r,Q({},y,{hash:Aa(B),path:j.path})),d=s.createHref(a);return Q({fullPath:a,hash:B,query:r===Vs?Wa(y.query):y.query||{}},j,{redirectedFrom:void 0,href:d})}function k(y){return typeof y=="string"?fr(n,y,c.value.path):Q({},y)}function M(y,T){if(f!==y)return zt(8,{from:T,to:y})}function $(y){return se(y)}function G(y){return $(Q(k(y),{replace:!0}))}function me(y,T){const A=y.matched[y.matched.length-1];if(A&&A.redirect){const{redirect:j}=A;let B=typeof j=="function"?j(y,T):j;return typeof B=="string"&&(B=B.includes("?")||B.includes("#")?B=k(B):{path:B},B.params={}),Q({query:y.query,hash:y.hash,params:B.path!=null?{}:y.params},B)}}function se(y,T){const A=f=O(y),j=c.value,B=y.state,a=y.force,d=y.replace===!0,m=me(A,j);if(m)return se(Q(k(m),{state:typeof m=="object"?Q({},B,m.state):B,force:a,replace:d}),T||A);const v=A;v.redirectedFrom=T;let b;return!a&&Na(r,j,A)&&(b=zt(16,{to:v,from:j}),Le(j,j,!0,!1)),(b?Promise.resolve(b):Oe(v,j)).catch(_=>at(_)?at(_,2)?_:ee(_):z(_,v,j)).then(_=>{if(_){if(at(_,2))return se(Q({replace:d},k(_.to),{state:typeof _.to=="object"?Q({},B,_.to.state):B,force:a}),T||v)}else _=Ye(v,j,!0,d,B);return qe(v,j,_),_})}function He(y,T){const A=M(y,T);return A?Promise.reject(A):Promise.resolve()}function Ue(y){const T=oe.values().next().value;return T&&typeof T.runWithContext=="function"?T.runWithContext(y):y()}function Oe(y,T){let A;const[j,B,a]=Ga(y,T);A=dr(j.reverse(),"beforeRouteLeave",y,T);for(const m of j)m.leaveGuards.forEach(v=>{A.push(xt(v,y,T))});const d=He.bind(null,y,T);return A.push(d),ve(A).then(()=>{A=[];for(const m of o.list())A.push(xt(m,y,T));return A.push(d),ve(A)}).then(()=>{A=dr(B,"beforeRouteUpdate",y,T);for(const m of B)m.updateGuards.forEach(v=>{A.push(xt(v,y,T))});return A.push(d),ve(A)}).then(()=>{A=[];for(const m of a)if(m.beforeEnter)if(Je(m.beforeEnter))for(const v of m.beforeEnter)A.push(xt(v,y,T));else A.push(xt(m.beforeEnter,y,T));return A.push(d),ve(A)}).then(()=>(y.matched.forEach(m=>m.enterCallbacks={}),A=dr(a,"beforeRouteEnter",y,T,Ue),A.push(d),ve(A))).then(()=>{A=[];for(const m of i.list())A.push(xt(m,y,T));return A.push(d),ve(A)}).catch(m=>at(m,8)?m:Promise.reject(m))}function qe(y,T,A){l.list().forEach(j=>Ue(()=>j(y,T,A)))}function Ye(y,T,A,j,B){const a=M(y,T);if(a)return a;const d=T===vt,m=It?history.state:{};A&&(j||d?s.replace(y.fullPath,Q({scroll:d&&m&&m.scroll},B)):s.push(y.fullPath,B)),c.value=y,Le(y,T,A,d),ee()}let je;function St(){je||(je=s.listen((y,T,A)=>{if(!Pe.listening)return;const j=O(y),B=me(j,Pe.currentRoute.value);if(B){se(Q(B,{replace:!0,force:!0}),j).catch(an);return}f=j;const a=c.value;It&&Va(qs(a.fullPath,A.delta),Jn()),Oe(j,a).catch(d=>at(d,12)?d:at(d,2)?(se(Q(k(d.to),{force:!0}),j).then(m=>{at(m,20)&&!A.delta&&A.type==="pop"&&s.go(-1,!1)}).catch(an),Promise.reject()):(A.delta&&s.go(-A.delta,!1),z(d,j,a))).then(d=>{d=d||Ye(j,a,!1),d&&(A.delta&&!at(d,8)?s.go(-A.delta,!1):A.type==="pop"&&at(d,20)&&s.go(-1,!1)),qe(j,a,d)}).catch(an)}))}let Ae=Yt(),he=Yt(),K;function z(y,T,A){ee(y);const j=he.list();return j.length?j.forEach(B=>B(y,T,A)):console.error(y),Promise.reject(y)}function ye(){return K&&c.value!==vt?Promise.resolve():new Promise((y,T)=>{Ae.add([y,T])})}function ee(y){return K||(K=!y,St(),Ae.list().forEach(([T,A])=>y?A(y):T()),Ae.reset()),y}function Le(y,T,A,j){const{scrollBehavior:B}=e;if(!It||!B)return Promise.resolve();const a=!A&&za(qs(y.fullPath,0))||(j||!A)&&history.state&&history.state.scroll||null;return Fo().then(()=>B(y,T,a)).then(d=>d&&qa(d)).catch(d=>z(d,y,T))}const _e=y=>s.go(y);let ue;const oe=new Set,Pe={currentRoute:c,listening:!0,addRoute:g,removeRoute:R,clearRoutes:t.clearRoutes,hasRoute:I,getRoutes:w,resolve:O,options:e,push:$,replace:G,go:_e,back:()=>_e(-1),forward:()=>_e(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:he.add,isReady:ye,install(y){y.component("RouterLink",Qr),y.component("RouterView",Cr),y.config.globalProperties.$router=Pe,Object.defineProperty(y.config.globalProperties,"$route",{enumerable:!0,get:()=>X(c)}),It&&!ue&&c.value===vt&&(ue=!0,$(s.location).catch(j=>{}));const T={};for(const j in vt)Object.defineProperty(T,j,{get:()=>c.value[j],enumerable:!0});y.provide(Qn,Pe),y.provide(Wr,No(T)),y.provide(Sr,c);const A=y.unmount;oe.add(y),y.unmount=function(){oe.delete(y),oe.size<1&&(f=vt,je&&je(),je=null,c.value=vt,ue=!1,K=!1),A()}}};function ve(y){return y.reduce((T,A)=>T.then(()=>Ue(A)),Promise.resolve())}return Pe}const eo=e=>e==="";const _u=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();const to=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const vu=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());const bu=e=>{const t=vu(e);return t.charAt(0).toUpperCase()+t.slice(1)};var $t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const xu=Symbol("lucide-icons");function wu(){return ze(xu,{})}const Su=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":r,strokeWidth:s,"stroke-width":o,size:i,color:l,...c},{slots:f})=>{const{size:u,color:h,strokeWidth:p=2,absoluteStrokeWidth:g=!1,class:R=""}=wu(),w=ce(()=>{const I=eo(n)||eo(r)||n===!0||r===!0||g===!0,O=s||o||p||$t["stroke-width"];return I?Number(O)*24/Number(i??u??$t.width):O});return mn("svg",{...$t,...c,width:i??u??$t.width,height:i??u??$t.height,stroke:l??h??$t.stroke,"stroke-width":w.value,class:_u("lucide",R,...e?[`lucide-${to(bu(e))}-icon`,`lucide-${to(e)}`]:["lucide-icon"])},[...t.map(I=>mn(...I)),...f.default?[f.default()]:[]])};const q=(e,t)=>(n,{slots:r,attrs:s})=>mn(Su,{...s,...n,iconNode:t,name:e},r.default?{default:r.default}:void 0);const Eu=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ru=q("archive",Eu);const Cu=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ku=q("arrow-down",Cu);const Au=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Pu=q("arrow-left",Au);const Tu=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Mu=q("arrow-right",Tu);const $u=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Ou=q("arrow-up-right",$u);const ju=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Nu=q("arrow-up",ju);const Iu=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],Lu=q("cassette-tape",Iu);const Du=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Fu=q("check",Du);const Hu=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Uu=q("chevron-down",Hu);const qu=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Vu=q("chevron-left",qu);const zu=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ji=q("chevron-right",zu);const Bu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Ni=q("circle-alert",Bu);const Ku=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Wu=q("circle",Ku);const Gu=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],Qu=q("disc-3",Gu);const Ju=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Yu=q("disc",Ju);const Xu=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Zu=q("image",Xu);const ef=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],tf=q("library",ef);const nf=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],rf=q("list",nf);const sf=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],of=q("log-out",sf);const lf=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],cf=q("mic-vocal",lf);const af=[["path",{d:"M5 12h14",key:"1ays0h"}]],uf=q("minus",af);const ff=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],df=q("palette",ff);const hf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],pf=q("panel-left-close",hf);const gf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],mf=q("panel-left-open",gf);const yf=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_f=q("plus",yf);const vf=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],bf=q("puzzle",vf);const xf=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],wf=q("search-x",xf);const Sf=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ef=q("search",Sf);const Rf=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cf=q("settings",Rf);const kf=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Af=q("shield-check",kf);const Pf=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Tf=q("square",Pf);const Mf=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Jr=q("sun",Mf);const $f=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],Of=q("tags",$f);const jf=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Nf=q("trash-2",jf);const If=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Lf=q("user-minus",If);const Df=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Ff=q("user-plus",Df);const Hf=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Uf=q("user",Hf);const qf=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Vf=q("users-round",qf);const zf=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Bf=q("users",zf);const Kf=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wf=q("x",Kf),Gf=Ie({});function Qf(e,t={}){const n=[];for(const[s,o]of Object.entries(t)){const i=s.replace(/^:/,"");if(i==="")continue;const l=String(o);n.push([`:${i.charAt(0).toUpperCase()}${i.slice(1)}`,l.charAt(0).toUpperCase()+l.slice(1)]),n.push([`:${i.toUpperCase()}`,l.toUpperCase()]),n.push([`:${i}`,l])}n.sort((s,o)=>o[0].length-s[0].length);let r=e;for(const[s,o]of n)r=r.split(s).join(o);return r}function we(e,t={}){const r=Gf.value[e]?.other;return r===void 0?e:Qf(r,t)}const no={archive:Ru,"arrow-down":ku,"arrow-left":Pu,"arrow-right":Mu,"arrow-up":Nu,"arrow-up-right":Ou,"cassette-tape":Lu,check:Fu,"chevron-down":Uu,"chevron-left":Vu,"chevron-right":ji,circle:Wu,"circle-alert":Ni,disc:Yu,"disc-3":Qu,image:Zu,library:tf,list:rf,"log-out":of,"mic-vocal":cf,minus:uf,palette:df,"panel-left-close":pf,"panel-left-open":mf,plus:_f,puzzle:bf,search:Ef,"search-x":wf,settings:Cf,"shield-check":Af,sun:Jr,tags:Of,"trash-2":Nf,user:Uf,"user-minus":Lf,"user-plus":Ff,users:Bf,"users-round":Vf,x:Wf},Jf={"icon-archive":"archive","icon-circle":"circle","icon-list-ul":"list","icon-tags":"tags","icon-user":"user","icon-search":"search","icon-cog":"settings","icon-users":"users"},ro=Tf;function Ii(e){if(!e)return ro;const t=e.trim();return no[t]??no[Jf[t]??""]??ro}const Yf=/\{[^{}]+\}/g,Xf=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function Zf(){return Math.random().toString(36).slice(2,11)}function ed(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:s,bodySerializer:o,pathSerializer:i,headers:l,requestInitExt:c=void 0,...f}={...e};c=Xf()?c:void 0,t=io(t);const u=[];async function h(p,g){const{baseUrl:R,fetch:w=r,Request:I=n,headers:O,params:k={},parseAs:M="json",querySerializer:$,bodySerializer:G=o??nd,pathSerializer:me,body:se,middleware:He=[],...Ue}=g||{};let Oe=t;R&&(Oe=io(R)??t);let qe=typeof s=="function"?s:so(s);$&&(qe=typeof $=="function"?$:so({...typeof s=="object"?s:{},...$}));const Ye=me||i||td,je=se===void 0?void 0:G(se,oo(l,O,k.header)),St=oo(je===void 0||je instanceof FormData?{}:{"Content-Type":"application/json"},l,O,k.header),Ae=[...u,...He],he={redirect:"follow",...f,...Ue,body:je,headers:St};let K,z,ye=new I(rd(p,{baseUrl:Oe,params:k,querySerializer:qe,pathSerializer:Ye}),he),ee;for(const ue in Ue)ue in ye||(ye[ue]=Ue[ue]);if(Ae.length){K=Zf(),z=Object.freeze({baseUrl:Oe,fetch:w,parseAs:M,querySerializer:qe,bodySerializer:G,pathSerializer:Ye});for(const ue of Ae)if(ue&&typeof ue=="object"&&typeof ue.onRequest=="function"){const oe=await ue.onRequest({request:ye,schemaPath:p,params:k,options:z,id:K});if(oe)if(oe instanceof I)ye=oe;else if(oe instanceof Response){ee=oe;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!ee){try{ee=await w(ye,c)}catch(ue){let oe=ue;if(Ae.length)for(let Pe=Ae.length-1;Pe>=0;Pe--){const ve=Ae[Pe];if(ve&&typeof ve=="object"&&typeof ve.onError=="function"){const y=await ve.onError({request:ye,error:oe,schemaPath:p,params:k,options:z,id:K});if(y){if(y instanceof Response){oe=void 0,ee=y;break}if(y instanceof Error){oe=y;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(oe)throw oe}if(Ae.length)for(let ue=Ae.length-1;ue>=0;ue--){const oe=Ae[ue];if(oe&&typeof oe=="object"&&typeof oe.onResponse=="function"){const Pe=await oe.onResponse({request:ye,response:ee,schemaPath:p,params:k,options:z,id:K});if(Pe){if(!(Pe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");ee=Pe}}}}const Le=ee.headers.get("Content-Length");if(ee.status===204||ye.method==="HEAD"||Le==="0"&&!ee.headers.get("Transfer-Encoding")?.includes("chunked"))return ee.ok?{data:void 0,response:ee}:{error:void 0,response:ee};if(ee.ok)return{data:await(async()=>{if(M==="stream")return ee.body;if(M==="json"&&!Le){const oe=await ee.text();return oe?JSON.parse(oe):void 0}return await ee[M]()})(),response:ee};let _e=await ee.text();try{_e=JSON.parse(_e)}catch{}return{error:_e,response:ee}}return{request(p,g,R){return h(g,{...R,method:p.toUpperCase()})},GET(p,g){return h(p,{...g,method:"GET"})},PUT(p,g){return h(p,{...g,method:"PUT"})},POST(p,g){return h(p,{...g,method:"POST"})},DELETE(p,g){return h(p,{...g,method:"DELETE"})},OPTIONS(p,g){return h(p,{...g,method:"OPTIONS"})},HEAD(p,g){return h(p,{...g,method:"HEAD"})},PATCH(p,g){return h(p,{...g,method:"PATCH"})},TRACE(p,g){return h(p,{...g,method:"TRACE"})},use(...p){for(const g of p)if(g){if(typeof g!="object"||!("onRequest"in g||"onResponse"in g||"onError"in g))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(g)}},eject(...p){for(const g of p){const R=u.indexOf(g);R!==-1&&u.splice(R,1)}}}}function Yn(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function Li(e,t,n){if(!t||typeof t!="object")return"";const r=[],s={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const l in t)r.push(l,n.allowReserved===!0?t[l]:encodeURIComponent(t[l]));const i=r.join(",");switch(n.style){case"form":return`${e}=${i}`;case"label":return`.${i}`;case"matrix":return`;${e}=${i}`;default:return i}}for(const i in t){const l=n.style==="deepObject"?`${e}[${i}]`:i;r.push(Yn(l,t[i],n))}const o=r.join(s);return n.style==="label"||n.style==="matrix"?`${s}${o}`:o}function Di(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",i=(n.allowReserved===!0?t:t.map(l=>encodeURIComponent(l))).join(o);switch(n.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${e}=${i}`;default:return`${e}=${i}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",s=[];for(const o of t)n.style==="simple"||n.style==="label"?s.push(n.allowReserved===!0?o:encodeURIComponent(o)):s.push(Yn(e,o,n));return n.style==="label"||n.style==="matrix"?`${r}${s.join(r)}`:s.join(r)}function so(e){return function(n){const r=[];if(n&&typeof n=="object")for(const s in n){const o=n[s];if(o!=null){if(Array.isArray(o)){if(o.length===0)continue;r.push(Di(s,o,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof o=="object"){r.push(Li(s,o,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}r.push(Yn(s,o,e))}}return r.join("&")}}function td(e,t){let n=e;for(const r of e.match(Yf)??[]){let s=r.substring(1,r.length-1),o=!1,i="simple";if(s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(i="label",s=s.substring(1)):s.startsWith(";")&&(i="matrix",s=s.substring(1)),!t||t[s]===void 0||t[s]===null)continue;const l=t[s];if(Array.isArray(l)){n=n.replace(r,Di(s,l,{style:i,explode:o}));continue}if(typeof l=="object"){n=n.replace(r,Li(s,l,{style:i,explode:o}));continue}if(i==="matrix"){n=n.replace(r,`;${Yn(s,l)}`);continue}n=n.replace(r,i==="label"?`.${encodeURIComponent(l)}`:encodeURIComponent(l))}return n}function nd(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function rd(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith("?")&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function oo(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[s,o]of r)if(o===null)t.delete(s);else if(Array.isArray(o))for(const i of o)t.append(s,i);else o!==void 0&&t.set(s,o)}return t}function io(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const lo="/backend",sd="__SUMMER_ADMIN_BASE__";function od(e=document){const t=e.querySelector('meta[name="summer-admin-base"]')?.content.trim()??"";if(t===""||t===sd||!t.startsWith("/"))return lo;const n=t.replace(/\/+$/,"");return n===""?lo:n}const co=od(),Fi={base:co,api:`${co}/api/v1`},id="XMLHttpRequest";let Hi=null;function ld(e){Hi=e}function cd(e){return new URL(e.url,"http://local").pathname.endsWith("/auth/login")}const ad={onRequest({request:e}){return e.headers.set("X-Requested-With",id),e},onResponse({request:e,response:t}){return t.status===401&&!cd(e)&&Hi?.(),t}},Kt=ed({baseUrl:Fi.api,credentials:"same-origin",fetch:e=>globalThis.fetch(e)});Kt.use(ad);const ud=/^[A-Za-z0-9_-]+$/;function Yr(e){const t=e.split(".");if(t.length!==3||!t.every(o=>ud.test(o)))return null;const[n,r,s]=t;return{vendor:n,plugin:r,controller:s}}function kr(e){const t=Yr(e);return t?`/${t.vendor}/${t.plugin}/${t.controller}`:null}function fd(e){return`${e.vendor}.${e.plugin}.${e.controller}`}function Ui(e){const t=e.replace(/^\/+|\/+$/g,"").split("/");if(t.length<3)return null;const n=t.slice(0,3).join(".");return Yr(n)?n:null}function ao(e){const t=Yr(e);return t?`${t.vendor}.${t.plugin}`:null}const Ar=Ie([]);async function qi(){const{data:e,response:t}=await Kt.GET("/navigation");return Ar.value=t.ok&&e?e.data:[],Ar.value}const Xr=ce(()=>Ar.value.filter(e=>e.sideMenu.length>0).map((e,t)=>({entry:e,index:t})).sort((e,t)=>e.entry.order-t.entry.order||e.index-t.index).map(({entry:e})=>e));function Vi(e){for(const t of e.sideMenu){const n=kr(t.controller);if(n)return n}return kr(e.controller)}function Zr(e,t){const n=`${e}.${t}`;return Xr.value.find(r=>ao(r.controller)===n||r.sideMenu.some(s=>ao(s.controller)===n))??null}function dd(){for(const e of Xr.value){const t=Vi(e);if(t)return t}return null}const hd=["aria-label"],pd={class:"mb-3.5 flex size-10 items-center justify-center rounded-inner bg-accent-soft",title:"SummerCMS"},gd=lt({__name:"PluginRail",setup(e){const t=Wt(),n=ce(()=>Zr(String(t.params.vendor??""),String(t.params.plugin??""))),r=ce(()=>Xr.value.map(s=>({entry:s,to:Vi(s)??"/",icon:Ii(s.icon),current:n.value?.code===s.code})));return(s,o)=>(V(),le("nav",{"aria-label":X(we)("backend::lang.nav.plugins"),class:"flex w-rail shrink-0 flex-col items-center gap-1.5 border-r border-side-border bg-side pt-3.5 pb-3"},[H("span",pd,[ge(X(Jr),{size:22,class:"text-accent","aria-hidden":"true"})]),(V(!0),le(fe,null,kt(r.value,i=>(V(),Qe(X(Qr),{key:i.entry.code,to:i.to,"aria-current":i.current?"page":void 0,class:wt([i.current?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[68px] flex-col items-center gap-1 rounded-inner px-1.5 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline"])},{default:zn(()=>[(V(),Qe(Yo(i.icon),{size:20,"aria-hidden":"true"})),H("span",null,de(i.entry.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],8,hd))}}),md=["aria-label"],yd={class:"mb-3.5 flex h-10 items-center px-2"},_d={class:"text-[16px] font-bold"},vd=lt({__name:"SectionPanel",props:{entry:{}},setup(e){const t=e,n=Wt(),r=ce(()=>Ui(n.path)),s=ce(()=>t.entry.sideMenu.flatMap(o=>{const i=kr(o.controller);return i?[{item:o,to:i,icon:Ii(o.icon),current:r.value===o.controller}]:[]}));return(o,i)=>(V(),le("aside",{"aria-label":X(we)("backend::lang.nav.sections"),class:"flex w-panel shrink-0 flex-col gap-0.5 border-r border-border bg-surface px-3 py-3.5"},[H("div",yd,[H("span",_d,de(e.entry.label),1)]),(V(!0),le(fe,null,kt(s.value,l=>(V(),Qe(X(Qr),{key:l.item.code,to:l.to,"aria-current":l.current?"page":void 0,class:wt([l.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline"])},{default:zn(()=>[(V(),Qe(Yo(l.icon),{size:18,"aria-hidden":"true"})),H("span",null,de(l.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],8,md))}}),Nn=Ie(null),zi=Ie(null),en=Cn(Nn);async function bd(e,t){const{data:n,response:r}=await Kt.POST("/auth/login",{body:{login:e,password:t}});return!r.ok||!n?!1:(zi.value=typeof n.data.expires_in=="number"?n.data.expires_in:null,!0)}async function Bi(){const{data:e,response:t}=await Kt.GET("/auth/me");return Nn.value=t.ok&&e?e.data:null,Nn.value}function xd(){Nn.value=null,zi.value=null}const wd={class:"flex min-h-screen bg-bg text-text"},Sd={class:"flex min-w-0 flex-1 flex-col"},Ed={class:"flex h-header shrink-0 items-center justify-between border-b border-border bg-surface pr-6 pl-8"},Rd=["aria-label"],Cd={class:"font-semibold","aria-current":"page"},kd={key:0,class:"flex h-input items-center gap-2.5 rounded-inner px-2"},Ad={class:"flex size-[34px] items-center justify-center rounded-full bg-accent text-[13px] font-bold text-on-accent","aria-hidden":"true"},Pd={class:"flex flex-col leading-tight"},Td={class:"font-semibold"},Md={key:0,class:"text-[12px] text-muted"},$d={class:"min-w-0 flex-1 px-8 py-7"},Od=lt({__name:"AppShell",setup(e){const t=Wt(),n=ce(()=>Zr(String(t.params.vendor??""),String(t.params.plugin??""))),r=ce(()=>{const i=Ui(t.path);return n.value?.sideMenu.find(l=>l.controller===i)??null}),s=ce(()=>{const i=en.value;if(!i)return"";const l=`${i.first_name} ${i.last_name}`.trim();return l===""?i.login:l}),o=ce(()=>s.value.split(/\s+/).filter(Boolean).slice(0,2).map(i=>i.charAt(0).toUpperCase()).join(""));return(i,l)=>(V(),le("div",wd,[ge(gd),n.value?(V(),Qe(vd,{key:0,entry:n.value},null,8,["entry"])):jt("",!0),H("div",Sd,[H("header",Ed,[H("nav",{"aria-label":X(we)("backend::lang.nav.breadcrumbs"),class:"flex items-center gap-2"},[n.value?(V(),le(fe,{key:0},[H("span",{class:wt(r.value?"text-muted":"font-semibold")},de(n.value.label),3),r.value?(V(),le(fe,{key:0},[ge(X(ji),{size:14,class:"text-muted","aria-hidden":"true"}),H("span",Cd,de(r.value.label),1)],64)):jt("",!0)],64)):jt("",!0)],8,Rd),X(en)?(V(),le("div",kd,[H("span",Ad,de(o.value),1),H("span",Pd,[H("span",Td,de(s.value),1),X(en).role?(V(),le("span",Md,de(X(en).role.name),1)):jt("",!0)])])):jt("",!0)]),H("main",$d,[Zl(i.$slots,"default")])])]))}}),jd=lt({__name:"App",setup(e){const t=Wt(),n=ce(()=>t.meta.shell===!0);return(r,s)=>n.value?(V(),Qe(Od,{key:0},{default:zn(()=>[ge(X(Cr))]),_:1})):(V(),Qe(X(Cr),{key:1}))}}),Nd={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},Id={class:"flex w-full max-w-[400px] flex-col gap-6"},Ld={class:"flex items-center justify-center gap-3"},Dd={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},Fd={class:"text-[22px] font-bold tracking-[-0.02em]"},Hd={class:"flex flex-col gap-1.5"},Ud={class:"font-semibold"},qd={class:"flex flex-col gap-1.5"},Vd={class:"font-semibold"},zd=["aria-invalid"],Bd={key:0,role:"alert",class:"flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]"},Kd=["disabled"],Wd=lt({__name:"LoginView",setup(e){const t=Wt(),n=_a(),r=Ie(""),s=Ie(""),o=Ie(!1),i=Ie(!1);async function l(){if(!i.value){i.value=!0,o.value=!1;try{if(!await bd(r.value.trim(),s.value)||!await Bi()){o.value=!0;return}s.value="",await qi(),await n.replace(Ki(t.query.redirect)??"/")}finally{i.value=!1}}}return(c,f)=>(V(),le("main",Nd,[H("div",Id,[H("div",Ld,[H("span",Dd,[ge(X(Jr),{size:20,class:"text-accent","aria-hidden":"true"})]),f[2]||(f[2]=H("span",{class:"text-[18px] font-bold text-white"},[_i("Summer"),H("span",{class:"text-accent"},"CMS")],-1))]),H("form",{class:"flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",novalidate:"",onSubmit:ua(l,["prevent"])},[H("h1",Fd,de(X(we)("backend::lang.auth.title")),1),H("label",Hd,[H("span",Ud,de(X(we)("backend::lang.auth.login")),1),cs(H("input",{"onUpdate:modelValue":f[0]||(f[0]=u=>r.value=u),name:"login",type:"text",autocomplete:"username",required:"",class:"h-input rounded-control border border-[#d2d8e2] bg-white px-3.5"},null,512),[[Is,r.value]])]),H("label",qd,[H("span",Vd,de(X(we)("backend::lang.auth.password")),1),cs(H("input",{"onUpdate:modelValue":f[1]||(f[1]=u=>s.value=u),name:"password",type:"password",autocomplete:"current-password",required:"","aria-invalid":o.value?"true":void 0,class:wt([o.value?"border-[#c62828]":"border-[#d2d8e2]","h-input rounded-control border bg-white px-3.5"])},null,10,zd),[[Is,s.value]])]),o.value?(V(),le("div",Bd,[ge(X(Ni),{size:18,"aria-hidden":"true"}),H("span",null,de(X(we)("backend::lang.auth.invalid")),1)])):jt("",!0),H("button",{type:"submit",disabled:i.value,class:"h-input rounded-control bg-[#22304d] font-semibold text-white disabled:opacity-60"},de(X(we)("backend::lang.auth.submit")),9,Kd)],32)])]))}}),Gd={class:"overflow-x-auto"},Qd={class:"w-full min-w-[640px] border-collapse text-left"},Jd={class:"h-row-head border-y border-border bg-subtle"},Yd=["aria-busy"],Xd={key:1},Zd=["colspan"],eh=lt({__name:"DataTable",props:{columns:{},rows:{},loading:{type:Boolean},emptyText:{}},setup(e){function t(s,o){return n(s[o.key])}function n(s){if(s==null||s==="")return"—";if(Array.isArray(s)){const o=s.map(n).filter(i=>i!=="—");return o.length===0?"—":o.join(", ")}return typeof s=="boolean"?we(s?"backend::lang.list.column_switch_true":"backend::lang.list.column_switch_false"):typeof s=="object"?"—":String(s)}function r(s,o){const i=s.id;return typeof i=="number"||typeof i=="string"?String(i):`row-${o}`}return(s,o)=>(V(),le("div",Gd,[H("table",Qd,[H("thead",null,[H("tr",Jd,[(V(!0),le(fe,null,kt(e.columns,i=>(V(),le("th",{key:i.key,scope:"col",class:"px-3.5 text-[12px] font-semibold text-muted first:pl-5 last:pr-5"},de(i.label),1))),128))])]),H("tbody",{"aria-busy":e.loading?"true":void 0},[e.loading?(V(),le(fe,{key:0},kt(8,i=>H("tr",{key:`skeleton-${i}`,class:"h-row border-b border-border"},[(V(!0),le(fe,null,kt(e.columns,l=>(V(),le("td",{key:l.key,class:"px-3.5 first:pl-5 last:pr-5"},[...o[0]||(o[0]=[H("span",{class:"block h-3 w-3/5 rounded-[6px] bg-skel"},null,-1)])]))),128))])),64)):e.rows.length===0?(V(),le("tr",Xd,[H("td",{colspan:Math.max(e.columns.length,1),class:"px-5 py-20 text-center text-muted"},de(e.emptyText??X(we)("backend::lang.list.no_records")),9,Zd)])):(V(!0),le(fe,{key:2},kt(e.rows,(i,l)=>(V(),le("tr",{key:r(i,l),class:"h-row border-b border-border"},[(V(!0),le(fe,null,kt(e.columns,(c,f)=>(V(),le("td",{key:c.key,class:wt([f===0?"font-semibold":"text-muted","px-3.5 first:pl-5 last:pr-5"])},de(t(i,c)),3))),128))]))),128))],8,Yd)])]))}}),th={class:"flex flex-col gap-5"},nh={class:"text-[26px] font-bold tracking-[-0.02em]"},rh={class:"overflow-hidden rounded-card border border-border bg-surface shadow-card"},sh={key:0,role:"alert",class:"px-5 py-4 text-danger"},oh={class:"border-t border-border px-5 py-3.5 text-[13px] text-muted"},ih=lt({__name:"ListView",setup(e){const t=Wt(),n=ce(()=>({vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")})),r=Ie(null),s=Ie([]),o=Ie(null),i=Ie(!0),l=Ie(!1),c=ce(()=>{if(r.value?.title)return r.value.title;const p=fd(n.value);return Zr(n.value.vendor,n.value.plugin)?.sideMenu.find(R=>R.controller===p)?.label??p}),f=ce(()=>{const p=o.value;if(!p||p.total===0)return we("backend::lang.list.no_results");const g=(p.page-1)*p.per_page+1,R=Math.min(p.page*p.per_page,p.total);return we("backend::lang.list.pagination_range",{from:g,to:R,total:p.total})});let u=0;async function h(){const p=++u;i.value=!0,l.value=!1;const g={path:n.value},[R,w]=await Promise.all([Kt.GET("/{vendor}/{plugin}/{controller}/schema/list",{params:g}),Kt.GET("/{vendor}/{plugin}/{controller}",{params:g})]);p===u&&(r.value=R.data?.data??null,s.value=w.data?.data??[],o.value=w.data?.meta??null,l.value=!R.data||!w.data,i.value=!1)}return sn(n,h,{immediate:!0,deep:!0}),(p,g)=>(V(),le("section",th,[H("header",null,[H("h1",nh,de(c.value),1)]),H("div",rh,[l.value&&!i.value?(V(),le("p",sh,de(X(we)("backend::lang.list.load_failed")),1)):(V(),Qe(eh,{key:1,columns:r.value?.columns??[],rows:s.value,loading:i.value,"empty-text":r.value?.noRecordsMessage},null,8,["columns","rows","loading","empty-text"])),H("footer",oh,de(i.value?X(we)("backend::lang.list.loading"):f.value),1)])]))}}),lh={class:"flex flex-col items-center gap-2 py-20 text-center"},ch={class:"text-[17px] font-bold"},uo=lt({__name:"NotFoundView",props:{home:{type:Boolean}},setup(e){return(t,n)=>(V(),le("section",lh,[H("h1",ch,de(e.home?X(we)("backend::lang.nav.empty"):X(we)("backend::lang.page.not_found")),1)]))}});function Ki(e){return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\")?null:e}function ah(e=Xa(Fi.base)){const t=yu({history:e,routes:[{path:"/login",name:"login",component:Wd,meta:{public:!0}},{path:"/",name:"home",component:uo,props:{home:!0},meta:{shell:!0},beforeEnter:()=>dd()??!0},{path:"/:vendor/:plugin/:controller",name:"list",component:ih,meta:{shell:!0}},{path:"/:pathMatch(.*)*",name:"not-found",component:uo,meta:{shell:!0}}]});return t.beforeEach(n=>{const r=en.value!==null;return n.meta.public?r&&n.name==="login"?Ki(n.query.redirect)??"/":!0:r?!0:{name:"login",query:{redirect:n.fullPath}}}),t}async function uh(){await Bi().catch(()=>null)&&await qi().catch(()=>[]);const t=ah();ld(()=>{xd();const r=t.currentRoute.value;r.name!=="login"&&t.push({name:"login",query:{redirect:r.fullPath}})});const n=ha(jd);n.use(t),await t.isReady(),n.mount("#app")}uh(); diff --git a/boardwalk/dist/index.html b/boardwalk/dist/index.html index 9ea91a2..84e98a3 100644 --- a/boardwalk/dist/index.html +++ b/boardwalk/dist/index.html @@ -6,7 +6,7 @@ SummerCMS - + diff --git a/cabana/auth.go b/cabana/auth.go index 2a0e4df..3352d93 100644 --- a/cabana/auth.go +++ b/cabana/auth.go @@ -194,19 +194,28 @@ func cookieLoginData(ttl time.Duration) AdminLoginData { // Max-Age is the refresh window, because refresh accepts an expired access // token until iat plus refresh_ttl. func (s *service) writeSessionCookie(w http.ResponseWriter, token string) { - http.SetCookie(w, &http.Cookie{ + http.SetCookie(w, s.sessionCookie(token, int(s.refreshTTL/time.Second))) +} + +// expireSessionCookie tells the browser to drop the admin cookie. +func (s *service) expireSessionCookie(w http.ResponseWriter) { + http.SetCookie(w, s.sessionCookie("", -1)) +} + +func (s *service) sessionCookie(value string, maxAge int) *http.Cookie { + return &http.Cookie{ Name: AdminCookieName, - Value: token, + Value: value, Path: s.adminPrefix(), - MaxAge: int(s.refreshTTL / time.Second), + MaxAge: maxAge, HttpOnly: true, - Secure: true, + Secure: !s.insecureCookie, SameSite: http.SameSiteStrictMode, - }) + } } func (s *service) refresh(w http.ResponseWriter, r *http.Request) { - raw := bearerToken(r) + raw, fromCookie := sessionToken(r) if raw == "" { s.logAuth(r, "failed", 0) WriteError(w, http.StatusUnauthorized, "unauthenticated", msgUnauthenticated) @@ -219,14 +228,22 @@ func (s *service) refresh(w http.ResponseWriter, r *http.Request) { return } s.logAuth(r, "success", 0) + if fromCookie { + // A cookie-authenticated request never receives a token in its body. + s.writeSessionCookie(w, next) + WriteData(w, http.StatusOK, cookieLoginData(s.ttl), map[string]any{}) + return + } WriteData(w, http.StatusOK, map[string]string{ "access_token": next, "token_type": "bearer", }, map[string]any{}) } +// logout blacklists the presented token's jti and always expires the admin +// cookie, so a browser session ends even when only the Bearer was revoked. func (s *service) logout(w http.ResponseWriter, r *http.Request) { - raw := bearerToken(r) + raw, _ := sessionToken(r) _, iat, exp, jti, err := bouncer.VerifyClaimsAudience(raw, s.secret, bouncer.AudienceBackend) if err != nil || jti == "" { WriteError(w, http.StatusUnauthorized, "unauthenticated", msgUnauthenticated) @@ -247,9 +264,27 @@ func (s *service) logout(w http.ResponseWriter, r *http.Request) { id = principal.ID } s.logAuth(r, "success", id) + s.expireSessionCookie(w) WriteData(w, http.StatusOK, map[string]any{"status": "logged_out"}, map[string]any{}) } +// sessionToken returns the admin JWT the same way the backend guard reads it: +// the Authorization Bearer header first, then the summer_admin cookie. +func sessionToken(r *http.Request) (token string, fromCookie bool) { + if raw := bearerToken(r); raw != "" { + return raw, false + } + if r == nil { + return "", false + } + if c, err := r.Cookie(AdminCookieName); err == nil { + if raw := strings.TrimSpace(c.Value); raw != "" { + return raw, true + } + } + return "", false +} + func (s *service) me(w http.ResponseWriter, r *http.Request) { principal, ok := bouncer.User(r.Context()) if !ok || principal == nil { @@ -425,6 +460,22 @@ func adminLoginWindow(app *backpack.App) (int, int) { return maxAttempts, decayMinutes } +// adminCookieSecure reads backend.cookie_secure (default true). false drops +// the Secure attribute for plain-http development and is refused in the +// production environment. +func adminCookieSecure(app *backpack.App) (bool, error) { + if app == nil || app.Config == nil || !app.Config.Has("backend.cookie_secure") { + return true, nil + } + if app.Config.Bool("backend.cookie_secure") { + return true, nil + } + if strings.EqualFold(strings.TrimSpace(app.Config.Environment()), "production") { + return false, errors.New("cabana: backend.cookie_secure: false is not allowed in the production environment") + } + return false, nil +} + // adminIssuer is app.url plus the admin API login path. JWT verification does // not check iss, so tokens minted under an earlier prefix stay valid until // they expire. diff --git a/cabana/http.go b/cabana/http.go index c5044eb..99b1c38 100644 --- a/cabana/http.go +++ b/cabana/http.go @@ -43,6 +43,9 @@ type service struct { bl bouncer.BlacklistStore prefix string spa http.Handler + // insecureCookie drops Secure from the admin cookie (backend.cookie_secure + // false, development only); the zero value keeps the cookie Secure. + insecureCookie bool } // adminPrefix returns the mount path; a zero service uses the default. @@ -68,6 +71,9 @@ func Activate(app *backpack.App, plugins []party.Plugin) (*Routes, error) { if len(items) == 0 { return nil, nil } + if err := checkReservedSegments(items); err != nil { + return nil, err + } secret, err := adminSecret(app) if err != nil { return nil, err @@ -76,6 +82,10 @@ func Activate(app *backpack.App, plugins []party.Plugin) (*Routes, error) { if err != nil { return nil, err } + secureCookie, err := adminCookieSecure(app) + if err != nil { + return nil, err + } reg, err := compileRegistry(items) if err != nil { return nil, err @@ -118,6 +128,8 @@ func Activate(app *backpack.App, plugins []party.Plugin) (*Routes, error) { issuer: adminIssuer(app, prefix), bl: bl, prefix: prefix, + + insecureCookie: !secureCookie, } spa, err := boardwalk.Handler(prefix, http.HandlerFunc(writeNotFound)) if err != nil { diff --git a/cabana/phase10_auth_test.go b/cabana/phase10_auth_test.go new file mode 100644 index 0000000..0da1218 --- /dev/null +++ b/cabana/phase10_auth_test.go @@ -0,0 +1,352 @@ +package cabana_test + +import ( + "bytes" + "encoding/json" + "fmt" + "io/fs" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "strings" + "testing" + "testing/fstest" + + "git.golem15.com/golem15/summercms/backpack" + "git.golem15.com/golem15/summercms/cabana" + "git.golem15.com/golem15/summercms/compass" + "git.golem15.com/golem15/summercms/pact" + "git.golem15.com/golem15/summercms/party" +) + +// TestPhase10CookieAuth pins the D-19 session transport: cookie login and +// refresh never put the JWT in a body, Bearer clients keep the Phase 9 body, +// a cookie refresh needs the CSRF header, and logout blacklists the jti and +// expires the cookie. +func TestPhase10CookieAuth(t *testing.T) { + gdb := adminGorm(t) + h := adminHandler(t, gdb, nil) + insertAdmin(t, gdb, "p10cookie", "p10cookie@example.test", adminTestPassword, true, false) + creds := map[string]string{"login": "p10cookie", "password": adminTestPassword} + + login := phase10Send(t, h, http.MethodPost, adminAPI("/auth/login"), creds, nil, true) + if login.Code != http.StatusOK { + t.Fatalf("cookie login status=%d body=%s", login.Code, login.Body.String()) + } + first := phase10Cookie(t, login, cabana.DefaultAdminPrefix) + phase10AssertCookieBody(t, login, first.Value) + + bearer := phase10Send(t, h, http.MethodPost, adminAPI("/auth/login"), creds, nil, false) + if bearer.Code != http.StatusOK { + t.Fatalf("bearer login status=%d body=%s", bearer.Code, bearer.Body.String()) + } + phase10AssertBearerBody(t, bearer) + if got := bearer.Header().Values("Set-Cookie"); len(got) != 0 { + t.Fatalf("bearer login set cookies: %q", got) + } + bearerToken := accessToken(t, bearer.Body.Bytes()) + + noHeader := phase10Send(t, h, http.MethodPost, adminAPI("/auth/refresh"), nil, first, false) + if noHeader.Code != http.StatusForbidden || phase10ErrorCode(t, noHeader) != "forbidden" { + t.Fatalf("cookie refresh without header status=%d body=%s", noHeader.Code, noHeader.Body.String()) + } + if got := noHeader.Header().Values("Set-Cookie"); len(got) != 0 { + t.Fatalf("refused refresh set cookies: %q", got) + } + + refreshed := phase10Send(t, h, http.MethodPost, adminAPI("/auth/refresh"), nil, first, true) + if refreshed.Code != http.StatusOK { + t.Fatalf("cookie refresh status=%d body=%s", refreshed.Code, refreshed.Body.String()) + } + second := phase10Cookie(t, refreshed, cabana.DefaultAdminPrefix) + if second.Value == first.Value { + t.Fatal("cookie refresh did not rotate the token") + } + phase10AssertCookieBody(t, refreshed, second.Value) + if stale := phase10Send(t, h, http.MethodGet, adminAPI("/auth/me"), nil, first, true); stale.Code != http.StatusUnauthorized { + t.Fatalf("rotated-out cookie status=%d body=%s", stale.Code, stale.Body.String()) + } + if me := phase10Send(t, h, http.MethodGet, adminAPI("/auth/me"), nil, second, true); me.Code != http.StatusOK { + t.Fatalf("rotated cookie /auth/me status=%d body=%s", me.Code, me.Body.String()) + } + + bearerRefresh := postAuth(t, h, http.MethodPost, adminAPI("/auth/refresh"), bearerToken, nil) + if bearerRefresh.Code != http.StatusOK { + t.Fatalf("bearer refresh status=%d body=%s", bearerRefresh.Code, bearerRefresh.Body.String()) + } + phase10AssertBearerBody(t, bearerRefresh) + if got := bearerRefresh.Header().Values("Set-Cookie"); len(got) != 0 { + t.Fatalf("bearer refresh set cookies: %q", got) + } + + logout := phase10Send(t, h, http.MethodPost, adminAPI("/auth/logout"), nil, second, true) + if logout.Code != http.StatusOK { + t.Fatalf("cookie logout status=%d body=%s", logout.Code, logout.Body.String()) + } + var expired *http.Cookie + for _, c := range logout.Result().Cookies() { + if c.Name == cabana.AdminCookieName { + expired = c + } + } + if expired == nil || expired.MaxAge >= 0 || expired.Value != "" || expired.Path != cabana.DefaultAdminPrefix { + t.Fatalf("logout cookie = %+v, want an expiring %s with Path %s", expired, cabana.AdminCookieName, cabana.DefaultAdminPrefix) + } + if after := phase10Send(t, h, http.MethodGet, adminAPI("/auth/me"), nil, second, true); after.Code != http.StatusUnauthorized { + t.Fatalf("logged-out cookie status=%d body=%s", after.Code, after.Body.String()) + } +} + +// TestPhase10Prefix pins backend.uri normalization and validation, moves the +// whole admin surface with a custom prefix, rejects reserved controller +// vendor segments and refuses an insecure admin cookie in production. +func TestPhase10Prefix(t *testing.T) { + t.Run("normalization", func(t *testing.T) { + for raw, want := range map[string]string{ + " /acme-admin/ ": "/acme-admin", + "": "/backend", + "acme": "/acme", + "/a/b_c/": "/a/b_c", + } { + got, err := cabana.AdminPrefix(phase10App(t, "development", map[string]any{"backend.uri": raw})) + if err != nil || got != want { + t.Fatalf("AdminPrefix(%q) = %q, %v; want %q", raw, got, err, want) + } + } + }) + + t.Run("invalid values fail activation", func(t *testing.T) { + for _, raw := range []string{"/", "/Admin", "/a b", "/../x", "//", "/-x"} { + app := phase10App(t, "development", map[string]any{"backend.uri": raw}) + _, err := cabana.Activate(app, []party.Plugin{demoPlugin{fsys: demoFS()}}) + if err == nil || !strings.Contains(err.Error(), "backend.uri") { + t.Fatalf("backend.uri %q: err=%v, want an activation error naming backend.uri", raw, err) + } + } + }) + + t.Run("custom prefix moves the surface", func(t *testing.T) { + gdb := adminGorm(t) + h := adminHandler(t, gdb, func(cfg *compass.Config) { + phase10Set(t, cfg, "backend.uri", "/acme-admin") + phase10Set(t, cfg, "app.url", "https://app.test") + }) + insertAdmin(t, gdb, "p10prefix", "p10prefix@example.test", adminTestPassword, true, false) + creds := map[string]string{"login": "p10prefix", "password": adminTestPassword} + api := "/acme-admin/api/v1" + + login := phase10Send(t, h, http.MethodPost, api+"/auth/login", creds, nil, true) + if login.Code != http.StatusOK { + t.Fatalf("custom prefix login status=%d body=%s", login.Code, login.Body.String()) + } + phase10Cookie(t, login, "/acme-admin") + + bearer := phase10Send(t, h, http.MethodPost, api+"/auth/login", creds, nil, false) + token := accessToken(t, bearer.Body.Bytes()) + if iss, _ := jwtClaims(t, token)["iss"].(string); iss != "https://app.test/acme-admin/api/v1/auth/login" { + t.Fatalf("issuer = %q", iss) + } + if me := getAuth(t, h, api+"/auth/me", token); me.Code != http.StatusOK { + t.Fatalf("custom prefix /auth/me status=%d", me.Code) + } + + shell := getAuth(t, h, "/acme-admin", "") + if shell.Code != http.StatusOK || !strings.Contains(shell.Body.String(), `content="/acme-admin"`) { + t.Fatalf("custom prefix shell status=%d body=%s", shell.Code, shell.Body.String()) + } + deep := getAuth(t, h, "/acme-admin/acme/demo/widgets", "") + if deep.Code != http.StatusOK || !strings.Contains(deep.Body.String(), `content="/acme-admin"`) { + t.Fatalf("custom prefix deep link status=%d", deep.Code) + } + missing := getAuth(t, h, api+"/nope", "") + if missing.Code != http.StatusNotFound || phase10ErrorCode(t, missing) != "not_found" { + t.Fatalf("custom prefix API miss status=%d body=%s", missing.Code, missing.Body.String()) + } + old := phase10Send(t, h, http.MethodPost, adminAPI("/auth/login"), creds, nil, false) + if old.Code == http.StatusOK { + t.Fatalf("default prefix still answers under a custom backend.uri: %s", old.Body.String()) + } + if shell := getAuth(t, h, cabana.DefaultAdminPrefix, ""); shell.Code == http.StatusOK { + t.Fatal("default prefix still serves the SPA under a custom backend.uri") + } + }) + + t.Run("reserved controller vendor segments", func(t *testing.T) { + for _, vendor := range []string{"api", "assets", "login", "settings"} { + app := phase10App(t, "development", nil) + _, err := cabana.Activate(app, []party.Plugin{reservedPlugin{vendor: vendor}}) + if err == nil || !strings.Contains(err.Error(), vendor+".demo.widgets") || !strings.Contains(err.Error(), "reserved") { + t.Fatalf("vendor %q: err=%v, want a reserved-segment activation error", vendor, err) + } + } + }) + + t.Run("cookie_secure", func(t *testing.T) { + prod := phase10App(t, "production", map[string]any{"backend.cookie_secure": false}) + if _, err := cabana.Activate(prod, []party.Plugin{demoPlugin{fsys: demoFS()}}); err == nil || !strings.Contains(err.Error(), "backend.cookie_secure") { + t.Fatalf("production cookie_secure=false: err=%v", err) + } + if _, err := cabana.Activate(phase10App(t, "production", nil), []party.Plugin{demoPlugin{fsys: demoFS()}}); err != nil { + t.Fatalf("production default cookie_secure: %v", err) + } + + gdb := adminGorm(t) + h := adminHandler(t, gdb, func(cfg *compass.Config) { + phase10Set(t, cfg, "backend.cookie_secure", false) + }) + insertAdmin(t, gdb, "p10insecure", "p10insecure@example.test", adminTestPassword, true, false) + login := phase10Send(t, h, http.MethodPost, adminAPI("/auth/login"), map[string]string{"login": "p10insecure", "password": adminTestPassword}, nil, true) + if login.Code != http.StatusOK { + t.Fatalf("insecure-cookie login status=%d body=%s", login.Code, login.Body.String()) + } + for _, c := range login.Result().Cookies() { + if c.Name == cabana.AdminCookieName && (c.Secure || !c.HttpOnly || c.SameSite != http.SameSiteStrictMode) { + t.Fatalf("development cookie_secure=false cookie = %+v, want HttpOnly SameSite=Strict without Secure", c) + } + } + }) +} + +func phase10Send(t *testing.T, h http.Handler, method, path string, body any, cookie *http.Cookie, ajax bool) *httptest.ResponseRecorder { + t.Helper() + var reader *bytes.Reader + if body != nil { + raw, err := json.Marshal(body) + if err != nil { + t.Fatal(err) + } + reader = bytes.NewReader(raw) + } else { + reader = bytes.NewReader(nil) + } + req := httptest.NewRequest(method, path, reader) + if body != nil { + req.Header.Set("Content-Type", "application/json") + } + if ajax { + req.Header.Set("X-Requested-With", "XMLHttpRequest") + } + if cookie != nil { + req.AddCookie(&http.Cookie{Name: cookie.Name, Value: cookie.Value}) + } + rec := httptest.NewRecorder() + h.ServeHTTP(rec, req) + return rec +} + +func phase10Cookie(t *testing.T, rec *httptest.ResponseRecorder, path string) *http.Cookie { + t.Helper() + for _, c := range rec.Result().Cookies() { + if c.Name != cabana.AdminCookieName { + continue + } + if c.Value == "" || !c.HttpOnly || !c.Secure || c.SameSite != http.SameSiteStrictMode || c.Path != path || c.MaxAge <= 0 { + t.Fatalf("session cookie = %+v, want HttpOnly Secure SameSite=Strict Path=%s with a Max-Age", c, path) + } + return c + } + t.Fatalf("no %s cookie; Set-Cookie=%q body=%s", cabana.AdminCookieName, rec.Header().Values("Set-Cookie"), rec.Body.String()) + return nil +} + +func phase10AssertCookieBody(t *testing.T, rec *httptest.ResponseRecorder, token string) { + t.Helper() + var body struct { + Data map[string]any `json:"data"` + } + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatal(err) + } + if body.Data["token_type"] != "cookie" { + t.Fatalf("cookie body = %s", rec.Body.String()) + } + if n, ok := body.Data["expires_in"].(float64); !ok || n <= 0 { + t.Fatalf("cookie body expires_in = %v", body.Data["expires_in"]) + } + if _, ok := body.Data["access_token"]; ok || strings.Contains(rec.Body.String(), token) || strings.Contains(rec.Body.String(), "eyJ") { + t.Fatalf("cookie body carries a token: %s", rec.Body.String()) + } +} + +func phase10AssertBearerBody(t *testing.T, rec *httptest.ResponseRecorder) { + t.Helper() + var body struct { + Data map[string]any `json:"data"` + Meta map[string]any `json:"meta"` + } + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatal(err) + } + token, _ := body.Data["access_token"].(string) + if len(body.Data) != 2 || token == "" || body.Data["token_type"] != "bearer" || len(body.Meta) != 0 { + t.Fatalf("bearer body = %s, want the Phase 9 {access_token, token_type: bearer} shape", rec.Body.String()) + } +} + +func phase10ErrorCode(t *testing.T, rec *httptest.ResponseRecorder) string { + t.Helper() + var body struct { + Error struct { + Code string `json:"code"` + } `json:"error"` + } + if err := json.Unmarshal(rec.Body.Bytes(), &body); err != nil { + t.Fatalf("error json: %v body=%s", err, rec.Body.String()) + } + return body.Error.Code +} + +func phase10Set(t *testing.T, cfg *compass.Config, key string, value any) { + t.Helper() + if err := cfg.Set(key, value); err != nil { + t.Fatal(err) + } +} + +// phase10App is a database-free app for activation checks. +func phase10App(t *testing.T, env string, values map[string]any) *backpack.App { + t.Helper() + dir := t.TempDir() + if err := os.WriteFile(filepath.Join(dir, "app.yaml"), []byte("name: cabana-phase10\n"), 0o644); err != nil { + t.Fatal(err) + } + cfg, err := compass.Open(compass.Options{ + Dir: dir, + Environ: []string{ + "SUMMER_ENV=" + env, + "SUMMER_ADMIN__JWT__SECRET=" + adminTestSecret, + }, + }) + if err != nil { + t.Fatal(err) + } + for key, value := range values { + phase10Set(t, cfg, key, value) + } + return backpack.New(cfg) +} + +// reservedPlugin owns a controller whose vendor segment collides with an SPA +// or API segment under the admin prefix. +type reservedPlugin struct{ vendor string } + +func (p reservedPlugin) ID() string { return p.vendor + ".demo" } +func (p reservedPlugin) Requires() []string { return nil } +func (p reservedPlugin) Register(*backpack.App) error { return nil } +func (p reservedPlugin) Boot(*backpack.App) error { return nil } +func (p reservedPlugin) AdminControllers() []pact.AdminController { + return []pact.AdminController{reservedController{vendor: p.vendor}} +} +func (p reservedPlugin) AdminFS() fs.FS { + return fstest.MapFS{ + "controllers/widgets/config_list.yaml": &fstest.MapFile{Data: []byte(fmt.Sprintf("list: ~/plugins/%s/demo/models/widget/columns.yaml\nmodelClass: Widget\nrecordsPerPage: 20\n", p.vendor))}, + "models/widget/columns.yaml": &fstest.MapFile{Data: []byte("columns:\n name:\n label: Name\n")}, + } +} + +type reservedController struct{ vendor string } + +func (c reservedController) ID() string { return c.vendor + ".demo.widgets" } +func (reservedController) ModelName() string { return "Widget" } +func (reservedController) ConfigDir() string { return "controllers/widgets" } diff --git a/cabana/phase10_csrf_test.go b/cabana/phase10_csrf_test.go new file mode 100644 index 0000000..c8cfa0f --- /dev/null +++ b/cabana/phase10_csrf_test.go @@ -0,0 +1,154 @@ +package cabana + +import ( + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "git.golem15.com/golem15/summercms/bouncer" + "git.golem15.com/golem15/summercms/pact" +) + +// TestPhase10CSRF walks every state-changing route service.mount registers. +// Except login, a request carrying only the admin cookie and no +// X-Requested-With header is refused with 403 forbidden before the handler +// runs: the body spy is never read and the service, which has no database, +// never answers with a database error. The same call with the header or with +// a Bearer token reaches the handler. +func TestPhase10CSRF(t *testing.T) { + router := &handlerRouter{handlers: map[string]http.HandlerFunc{}} + svc := phase09DeniedService() + svc.mount(router) + super := &bouncer.Principal{ID: 1, Backend: true, IsSuperuser: true} + login := http.MethodPost + " " + adminAPI("/auth/login") + + unsafe := 0 + for _, key := range router.order { + method, path, _ := strings.Cut(key, " ") + if method != http.MethodPost && method != http.MethodPut && method != http.MethodDelete { + continue + } + if key == login { + continue + } + unsafe++ + handler := router.handlers[key] + t.Run(key, func(t *testing.T) { + refused, spy := csrfRequest(method, path, super) + refused.AddCookie(&http.Cookie{Name: AdminCookieName, Value: "cookie-only-session"}) + rec := httptest.NewRecorder() + handler(rec, refused) + if rec.Code != http.StatusForbidden { + t.Fatalf("cookie-only status=%d body=%s", rec.Code, rec.Body.String()) + } + assertErrorCode(t, rec.Body.Bytes(), "forbidden") + if spy.reads != 0 { + t.Fatalf("refused request body was read %d times", spy.reads) + } + + withHeader, _ := csrfRequest(method, path, super) + withHeader.AddCookie(&http.Cookie{Name: AdminCookieName, Value: "cookie-only-session"}) + withHeader.Header.Set("X-Requested-With", "XMLHttpRequest") + rec = httptest.NewRecorder() + handler(rec, withHeader) + if rec.Code == http.StatusForbidden { + t.Fatalf("request with X-Requested-With was refused: %s", rec.Body.String()) + } + + withBearer, _ := csrfRequest(method, path, super) + withBearer.Header.Set("Authorization", "Bearer not-a-real-token") + rec = httptest.NewRecorder() + handler(rec, withBearer) + if rec.Code == http.StatusForbidden { + t.Fatalf("Bearer request was refused: %s", rec.Body.String()) + } + }) + } + // refresh, logout, settings put, create, bulk-delete, update, delete, link, unlink + if unsafe != 9 { + t.Fatalf("walked %d state-changing routes, want 9: %v", unsafe, router.order) + } + + loginHandler := router.handlers[login] + req, _ := csrfRequest(http.MethodPost, adminAPI("/auth/login"), nil) + rec := httptest.NewRecorder() + loginHandler(rec, req) + if rec.Code == http.StatusForbidden { + t.Fatalf("login without the header was refused: %s", rec.Body.String()) + } +} + +type readSpy struct { + r io.Reader + reads int +} + +func (s *readSpy) Read(p []byte) (int, error) { + s.reads++ + return s.r.Read(p) +} + +func csrfRequest(method, path string, principal *bouncer.Principal) (*http.Request, *readSpy) { + spy := &readSpy{r: strings.NewReader(`{"ids":[1],"name":"csrf"}`)} + req := httptest.NewRequest(method, path, spy) + req.Header.Set("Content-Type", "application/json") + req.SetPathValue("vendor", "acme") + req.SetPathValue("plugin", "demo") + req.SetPathValue("controller", "widgets") + req.SetPathValue("id", "1") + req.SetPathValue("name", "editors") + req.SetPathValue("code", "demo") + if principal != nil { + req = req.WithContext(bouncer.WithUser(req.Context(), principal)) + } + return req, spy +} + +// handlerRouter records the handler mounted for every route, so tests can +// call exactly what service.mount registered. +type handlerRouter struct { + prefix string + handlers map[string]http.HandlerFunc + order []string +} + +func (h *handlerRouter) Group(prefix string, middleware []string, fn func(pact.Router)) { + h.GroupRaw(prefix, middleware, fn) +} + +func (h *handlerRouter) GroupRaw(prefix string, _ []string, fn func(pact.Router)) { + child := &handlerRouter{prefix: h.prefix + prefix, handlers: h.handlers} + fn(child) + h.order = append(h.order, child.order...) +} + +func (h *handlerRouter) Get(path string, fn http.HandlerFunc, _ ...string) { + h.add(http.MethodGet, path, fn) +} + +func (h *handlerRouter) Post(path string, fn http.HandlerFunc, _ ...string) { + h.add(http.MethodPost, path, fn) +} + +func (h *handlerRouter) Put(path string, fn http.HandlerFunc, _ ...string) { + h.add(http.MethodPut, path, fn) +} + +func (h *handlerRouter) Patch(path string, fn http.HandlerFunc, _ ...string) { + h.add(http.MethodPatch, path, fn) +} + +func (h *handlerRouter) Delete(path string, fn http.HandlerFunc, _ ...string) { + h.add(http.MethodDelete, path, fn) +} + +func (h *handlerRouter) Where(string, string) {} +func (h *handlerRouter) WhereIn(string, ...string) {} + +func (h *handlerRouter) add(method, path string, fn http.HandlerFunc) { + key := method + " " + h.prefix + path + h.handlers[key] = fn + h.order = append(h.order, key) +} diff --git a/cabana/registry.go b/cabana/registry.go index 2020f3a..303cb5f 100644 --- a/cabana/registry.go +++ b/cabana/registry.go @@ -34,6 +34,22 @@ func collectControllers(plugins []party.Plugin) ([]controllerRef, error) { return out, nil } +// reservedVendorSegments are the first path segments under the admin prefix +// that the SPA and API own. A controller ID maps to /{vendor}/{plugin}/..., so +// a vendor with one of these names would collide with them. +var reservedVendorSegments = map[string]bool{"api": true, "assets": true, "login": true, "settings": true} + +func checkReservedSegments(items []controllerRef) error { + for _, item := range items { + id := item.ctl.ID() + vendor, _, _ := strings.Cut(id, ".") + if reservedVendorSegments[vendor] { + return fmt.Errorf("cabana: controller %s uses the reserved admin path segment %q (reserved: api, assets, login, settings)", id, vendor) + } + } + return nil +} + func compileRegistry(items []controllerRef) (*Registry, error) { byID := make(map[string]*CompiledController, len(items)) for _, item := range items { diff --git a/scripts/check-admin-dist.sh b/scripts/check-admin-dist.sh new file mode 100755 index 0000000..552be65 --- /dev/null +++ b/scripts/check-admin-dist.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Drift gate for the committed admin SPA build (D-04). Rebuilds admin/ from +# the committed lockfile into a temporary directory and fails when the result +# differs from boardwalk/dist, the tree the Go binary embeds. After changing +# the SPA, rebuild with `npm --prefix admin run build` and commit the result. +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$ROOT" + +if [[ ! -d admin/node_modules ]]; then + npm --prefix admin ci +fi + +npm --prefix admin run typecheck + +TMP="$(mktemp -d)" +trap 'rm -rf "$TMP"' EXIT + +(cd admin && node_modules/.bin/vite build --outDir "$TMP/dist" --emptyOutDir --logLevel warn) + +if ! diff -r "$TMP/dist" boardwalk/dist; then + echo "check-admin-dist: boardwalk/dist is stale; run npm --prefix admin run build and commit boardwalk/dist" >&2 + exit 1 +fi +echo "check-admin-dist: boardwalk/dist matches a fresh build" diff --git a/surf/admin_prefix_test.go b/surf/admin_prefix_test.go new file mode 100644 index 0000000..b729074 --- /dev/null +++ b/surf/admin_prefix_test.go @@ -0,0 +1,132 @@ +package surf + +import ( + "io/fs" + "net/http" + "os" + "path/filepath" + "strings" + "testing" + "testing/fstest" + + "git.golem15.com/golem15/summercms/backpack" + "git.golem15.com/golem15/summercms/compass" + "git.golem15.com/golem15/summercms/pact" + "git.golem15.com/golem15/summercms/party" +) + +// TestPhase10AdminPrefixCollision fails boot when a plugin other than cabana +// registers a route at or under the admin prefix (backend.uri), which would +// otherwise shadow or be shadowed by the admin SPA and API. +func TestPhase10AdminPrefixCollision(t *testing.T) { + for _, tc := range []struct { + name string + method string + path string + raw bool + }{ + {"exact prefix", http.MethodGet, "/acme-admin", false}, + {"under prefix", http.MethodPost, "/acme-admin/hook", false}, + {"raw under api", http.MethodGet, "/acme-admin/api/v1/extra", true}, + } { + t.Run(tc.name, func(t *testing.T) { + app := adminPrefixApp(t) + plugins := []party.Plugin{ + adminPrefixPlugin{}, + prefixRoutePlugin{id: "acme.intruder", method: tc.method, path: tc.path, raw: tc.raw}, + } + _, err := BuildRouter(app, plugins) + if err == nil { + t.Fatalf("BuildRouter accepted %s %s under the admin prefix", tc.method, tc.path) + } + for _, want := range []string{tc.method, tc.path, "acme.intruder", "/acme-admin"} { + if !strings.Contains(err.Error(), want) { + t.Fatalf("error %q does not name %q", err, want) + } + } + }) + } + + t.Run("sibling path is allowed", func(t *testing.T) { + app := adminPrefixApp(t) + plugins := []party.Plugin{ + adminPrefixPlugin{}, + prefixRoutePlugin{id: "acme.neighbour", method: http.MethodGet, path: "/acme-adminx"}, + } + if _, err := BuildRouter(app, plugins); err != nil { + t.Fatalf("sibling path rejected: %v", err) + } + }) +} + +func adminPrefixApp(t *testing.T) *backpack.App { + t.Helper() + dir := t.TempDir() + if err := os.WriteFile(filepath.Join(dir, "app.yaml"), []byte("name: admin-prefix\n"), 0o644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(dir, "http.yaml"), []byte("body_limits:\n default_bytes: 1024\n upload_bytes: 1024\n"), 0o644); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(dir, "backend.yaml"), []byte("uri: /acme-admin\n"), 0o644); err != nil { + t.Fatal(err) + } + cfg, err := compass.Open(compass.Options{ + Dir: dir, + Environ: []string{"SUMMER_ENV=development", "SUMMER_ADMIN__JWT__SECRET=summercms-test-only-admin-hs256-secret"}, + }) + if err != nil { + t.Fatal(err) + } + return backpack.New(cfg) +} + +type adminPrefixPlugin struct{} + +func (adminPrefixPlugin) ID() string { return "acme.demo" } +func (adminPrefixPlugin) Requires() []string { return nil } +func (adminPrefixPlugin) Register(*backpack.App) error { return nil } +func (adminPrefixPlugin) Boot(*backpack.App) error { return nil } +func (adminPrefixPlugin) AdminControllers() []pact.AdminController { + return []pact.AdminController{adminPrefixController{}} +} +func (adminPrefixPlugin) AdminFS() fs.FS { + return fstest.MapFS{ + "controllers/widgets/config_list.yaml": &fstest.MapFile{Data: []byte("list: ~/plugins/acme/demo/models/widget/columns.yaml\nmodelClass: Widget\nrecordsPerPage: 20\n")}, + "models/widget/columns.yaml": &fstest.MapFile{Data: []byte("columns:\n name:\n label: Name\n")}, + } +} + +type adminPrefixController struct{} + +func (adminPrefixController) ID() string { return "acme.demo.widgets" } +func (adminPrefixController) ModelName() string { return "Widget" } +func (adminPrefixController) ConfigDir() string { return "controllers/widgets" } + +type prefixRoutePlugin struct { + id string + method string + path string + raw bool +} + +func (p prefixRoutePlugin) ID() string { return p.id } +func (p prefixRoutePlugin) Requires() []string { return nil } +func (p prefixRoutePlugin) Register(*backpack.App) error { return nil } +func (p prefixRoutePlugin) Boot(*backpack.App) error { return nil } +func (p prefixRoutePlugin) Routes(r pact.Router) error { + h := func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusNoContent) } + open := r.Group + if p.raw { + open = r.GroupRaw + } + open("", nil, func(g pact.Router) { + switch p.method { + case http.MethodPost: + g.Post(p.path, h) + default: + g.Get(p.path, h) + } + }) + return nil +} diff --git a/surf/router.go b/surf/router.go index d248528..02cfcc4 100644 --- a/surf/router.go +++ b/surf/router.go @@ -529,6 +529,9 @@ func BuildRouter(app *backpack.App, plugins []party.Plugin) (*Router, error) { } r.BindPlugin("summercms.cabana") admin.Mount(r) + if err := r.checkAdminPrefix(admin.Prefix); err != nil { + return nil, err + } } for _, rt := range r.routes { if _, err := r.wrap(rt); err != nil { @@ -538,6 +541,23 @@ func BuildRouter(app *backpack.App, plugins []party.Plugin) (*Router, error) { return r, nil } +// checkAdminPrefix fails boot when a plugin other than cabana owns a route at +// or under the admin prefix: the admin SPA and API own that whole subtree. +func (r *Router) checkAdminPrefix(prefix string) error { + if prefix == "" { + return nil + } + for _, rt := range r.routes { + if rt.pluginID == "summercms.cabana" { + continue + } + if rt.path == prefix || strings.HasPrefix(rt.path, prefix+"/") { + return fmt.Errorf("surf: route %s %s (plugin %q) is under the admin prefix backend.uri %s", rt.method, rt.path, rt.pluginID, prefix) + } + } + return nil +} + func requiredBytes(app *backpack.App, key string) (int64, error) { raw, ok := app.Config.Lookup(key) if !ok {