diff --git a/.gitea/scripts/install-trivy.sh b/.gitea/scripts/install-trivy.sh deleted file mode 100755 index 4823ab1..0000000 --- a/.gitea/scripts/install-trivy.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# Installs Trivy at a fixed version, checked against a fixed checksum, so a changed download fails the -# job instead of running. To update: take the version and the checksum of the Linux-64bit tarball from -# https://github.com/aquasecurity/trivy/releases (the checksums file of that release). -set -eu - -VERSION=0.77.0 -SHA256=c9504e6ff8184b91e8e7266c84ad8538f76347f1e5488e07cb083855883cd9a6 - -curl -fsSL -o /tmp/trivy.tar.gz "https://github.com/aquasecurity/trivy/releases/download/v${VERSION}/trivy_${VERSION}_Linux-64bit.tar.gz" -echo "${SHA256} /tmp/trivy.tar.gz" | sha256sum -c - -tar -xzf /tmp/trivy.tar.gz -C /usr/local/bin trivy -trivy --version diff --git a/.gitea/scripts/test_scripts.py b/.gitea/scripts/test_scripts.py index c5f51b7..ba35eda 100644 --- a/.gitea/scripts/test_scripts.py +++ b/.gitea/scripts/test_scripts.py @@ -167,6 +167,44 @@ class DependencyUpdates(unittest.TestCase): self.assertEqual(composer["require-dev"]["c/c"], "^3.0||^4.0") +class NpmUpdates(unittest.TestCase): + NOW = __import__("datetime").datetime(2026, 12, 8, 12, 0, tzinfo=__import__("datetime").timezone.utc) + + def published(self, ages): + import datetime + + return lambda name, version: None if (name, version) not in ages else self.NOW - datetime.timedelta(hours=ages[(name, version)]) + + def test_a_release_must_be_public_for_two_days(self): + outdated = {"vue": {"current": "3.5.0", "wanted": "3.5.9", "latest": "4.0.0"}} + # The newest is a day old: the newest one inside the range is taken instead. + targets = update_dependencies.npm_targets(outdated, self.published({("vue", "4.0.0"): 24, ("vue", "3.5.9"): 200}), self.NOW) + self.assertEqual(targets, {"vue": ("3.5.0", "3.5.9")}) + # Both too new: nothing this week. + self.assertEqual(update_dependencies.npm_targets(outdated, self.published({("vue", "4.0.0"): 24, ("vue", "3.5.9"): 47}), self.NOW), {}) + + def test_the_newest_is_taken_when_it_is_old_enough(self): + outdated = {"vite": {"current": "7.0.0", "wanted": "7.1.0", "latest": "8.0.0"}} + targets = update_dependencies.npm_targets(outdated, self.published({("vite", "8.0.0"): 49}), self.NOW) + self.assertEqual(targets["vite"], ("7.0.0", "8.0.0")) + + def test_a_held_back_package_stays_on_its_major(self): + outdated = {"typescript": {"current": "5.9.3", "wanted": "5.9.3", "latest": "7.0.2"}} + self.assertEqual(update_dependencies.npm_targets(outdated, self.published({("typescript", "7.0.2"): 999}), self.NOW), {}) + outdated["typescript"]["wanted"] = "5.9.9" + targets = update_dependencies.npm_targets(outdated, self.published({("typescript", "7.0.2"): 999, ("typescript", "5.9.9"): 999}), self.NOW) + self.assertEqual(targets, {"typescript": ("5.9.3", "5.9.9")}) + + def test_unknown_dates_prereleases_and_missing_installs_are_left_alone(self): + outdated = { + "a": {"current": "1.0.0", "wanted": "1.0.0", "latest": "2.0.0"}, + "b": {"current": "1.0.0", "wanted": "1.0.0", "latest": "2.0.0-beta.1"}, + "c": {"wanted": "1.0.0", "latest": "2.0.0"}, + } + ages = {("b", "2.0.0-beta.1"): 999, ("c", "2.0.0"): 999} + self.assertEqual(update_dependencies.npm_targets(outdated, self.published(ages), self.NOW), {}) + + class PackagistNotice(unittest.TestCase): def run_notice(self, answers): """Runs notify() with fake answers per endpoint (a status number, or an HTTP error code as a string).""" diff --git a/.gitea/scripts/update_dependencies.py b/.gitea/scripts/update_dependencies.py index 9d93eed..0192efc 100755 --- a/.gitea/scripts/update_dependencies.py +++ b/.gitea/scripts/update_dependencies.py @@ -11,8 +11,13 @@ it is not, so a red pull request is the signal that the package does not work wi Nothing happens when no release is open (start one first), when a pull request of this script is still open, or when nothing is outside its constraint. +The screens have their own dependencies (`ui/package.json`, with a lock file). `update_dependencies.py ui` moves +every npm package that has a newer release (a new major too) to it, but only to a release that has been public for +48 hours (a supply-chain guard: a hijacked release is usually pulled within days), rebuilds `resources/dist`, and opens +a pull request the same way. PR CI type-checks and builds it, so a red pull request is the signal. + Environment: GT_URL, GT_OWNER, GT_REPO, GT_TOKEN (the deploy bot: pushes a branch, opens a pull -request). Needs git and composer. Standard library only. +request). Needs git and composer (npm and node for `ui`). Standard library only. """ import datetime @@ -35,6 +40,10 @@ REPO = os.environ.get("GT_REPO", "") TOKEN = os.environ.get("GT_TOKEN", "") USER = "deploy-bot" BRANCH_PREFIX = "renovate/deps-" +UI_BRANCH_PREFIX = "renovate/ui-deps-" +MIN_AGE = datetime.timedelta(hours=48) +# npm packages held at a major until what depends on them works with the next one (remove the line then). +HELD = {"typescript": 5} # vue-tsc (the type check of the screens) does not run on TypeScript 7 yet SECTIONS = ("require", "require-dev") @@ -102,6 +111,140 @@ def widened(composer, outdated): return changes +def npm_targets(outdated, published, now): + """What each outdated npm package moves to: its newest release (or the newest inside its range) that is old enough. + + `outdated` is `npm outdated --json` (name -> current, wanted, latest); `published(name, version)` is the time that + release came out (a datetime, or None when unknown, which counts as too new). + """ + targets = {} + + for name, info in sorted(outdated.items()): + if not isinstance(info, dict) or not info.get("current"): + continue + + for candidate in (info.get("latest"), info.get("wanted")): + if not candidate or candidate == info["current"] or "-" in candidate: + continue + + if name in HELD and int(candidate.split(".")[0]) > HELD[name]: + continue + + when = published(name, candidate) + + if when is not None and now - when >= MIN_AGE: + targets[name] = (info["current"], candidate) + break + + return targets + + +def main_ui(): + """The same cycle for ui/: bump what is outdated and old enough, rebuild the bundle, open a pull request.""" + work, release, remote = prepare(UI_BRANCH_PREFIX) + ui = os.path.join(work, "ui") + + install = run(["npm", "ci", "--no-audit", "--no-fund", "--ignore-scripts"], ui, retries=3) + + if install.returncode != 0: + sys.exit(f"npm ci failed:\n{install.stderr[-2000:]}") + + listed = run(["npm", "outdated", "--json"], ui) # exit code 1 means "something is outdated" + outdated = json.loads(listed.stdout or "{}") + times = {} + + def published(name, version): + if name not in times: + view = run(["npm", "view", name, "time", "--json"], ui, retries=2) + try: + times[name] = json.loads(view.stdout or "{}") + except ValueError: + times[name] = {} + + stamp = times[name].get(version) if isinstance(times[name], dict) else None + + try: + return datetime.datetime.fromisoformat(stamp.replace("Z", "+00:00")) if stamp else None + except ValueError: + return None + + targets = npm_targets(outdated, published, datetime.datetime.now(datetime.timezone.utc)) + + if not targets: + print("Every npm package is up to date, or too new to adopt yet: nothing to do.") + return + + applied = {} + + for name, (old, new) in targets.items(): + result = run(["npm", "install", f"{name}@{new}", "--save-prefix=^", "--no-audit", "--no-fund", "--ignore-scripts"], ui) + + if result.returncode == 0: + applied[name] = (old, new) + else: + run(["git", "checkout", "--", "ui/package.json", "ui/package-lock.json"], work) + print(f"{name} {new} does not install: left as it was.") + + if not applied: + print("Nothing could be installed.") + return + + # A new bundle with the new dependencies; when it does not build the pull request still opens, red, with the old bundle. + if run(["npm", "run", "build"], ui).returncode != 0: + print("The build failed with the new packages: the pull request will be red.") + + publish(work, release, remote, UI_BRANCH_PREFIX, applied, "Update the dependencies of the screens", ["ui/package.json", "ui/package-lock.json", "resources/dist"]) + + +def prepare(prefix): + """Finds the open release, makes sure no pull request of this kind is open, and clones the release branch.""" + if not (URL and OWNER and REPO and TOKEN): + sys.exit("GT_URL, GT_OWNER, GT_REPO and GT_TOKEN are required.") + + branches = [item["name"] for item in api("GET", "branches?limit=50") or []] + tags = [item["name"] for item in api("GET", "tags?limit=50") or []] + release = open_release(branches, tags) + + if release is None: + print("No release is open: nothing to update. Start a release first.") + sys.exit(0) + + for pull in api("GET", "pulls?state=open&limit=50") or []: + if pull["head"]["ref"].startswith(prefix): + print(f"Pull request #{pull['number']} of this workflow is still open: not making another.") + sys.exit(0) + + remote = f"https://{USER}:{TOKEN}@{URL.split('://', 1)[1]}/{OWNER}/{REPO}.git" + work = os.path.join(tempfile.mkdtemp(), "repo") + clone = subprocess.run(["git", "clone", "--quiet", "--branch", release, remote, work], capture_output=True, text=True) + + if clone.returncode != 0: + sys.exit("git clone failed.") + + return work, release, remote + + +def publish(work, release, remote, prefix, changes, title, paths): + """Commits `paths`, pushes a branch and opens the pull request to the release.""" + branch = prefix + datetime.date.today().strftime("%Y%m%d") + + for command in ( + ["git", "config", "user.name", USER], + ["git", "config", "user.email", f"{USER}@iriks-it.nl"], + ["git", "checkout", "-b", branch], + ["git", "add", "--", *paths], + ["git", "commit", "-m", f"{title}: " + ", ".join(sorted(changes))], + ["git", "push", "--quiet", "origin", branch], + ): + result = subprocess.run(command, cwd=work, capture_output=True, text=True) + + if result.returncode != 0: + sys.exit(f"{' '.join(command[:2])} failed: {result.stderr.strip()}") + + pull = api("POST", "pulls", {"title": f"{title}: " + ", ".join(sorted(changes)), "head": branch, "base": release, "body": body(changes, release)}) + print(f"Pull request #{pull['number']} to {release}: {', '.join(sorted(changes))}.") + + def run(command, cwd, retries=1): for attempt in range(1, retries + 1): result = subprocess.run(command, cwd=cwd, capture_output=True, text=True) @@ -114,36 +257,15 @@ def run(command, cwd, retries=1): def body(changes, release): lines = "\n".join(f"- `{name}`: `{old}` → `{new}`" for name, (old, new) in sorted(changes.items())) - return f"""Automatic update of the version constraints, by the weekly workflow `Dependency updates`. + return f"""Automatic update of the dependencies, by the weekly workflow `Dependency updates`. {lines} -PR CI tests the package with the newer versions. It merges into `{release}` by itself when everything is green; when it is red, the package does not work with them yet.""" +PR CI tests the package with the newer versions (and rebuilds the screens when it is about npm). It merges into `{release}` by itself when everything is green; when it is red, the package does not work with them yet.""" def main(): - if not (URL and OWNER and REPO and TOKEN): - sys.exit("GT_URL, GT_OWNER, GT_REPO and GT_TOKEN are required.") - - branches = [item["name"] for item in api("GET", "branches?limit=50") or []] - tags = [item["name"] for item in api("GET", "tags?limit=50") or []] - release = open_release(branches, tags) - - if release is None: - print("No release is open: nothing to update. Start a release first.") - return - - for pull in api("GET", "pulls?state=open&limit=50") or []: - if pull["head"]["ref"].startswith(BRANCH_PREFIX): - print(f"Pull request #{pull['number']} of this workflow is still open: not making another.") - return - - remote = f"https://{USER}:{TOKEN}@{URL.split('://', 1)[1]}/{OWNER}/{REPO}.git" - work = os.path.join(tempfile.mkdtemp(), "repo") - clone = subprocess.run(["git", "clone", "--quiet", "--branch", release, remote, work], capture_output=True, text=True) - - if clone.returncode != 0: - sys.exit("git clone failed.") + work, release, remote = prepare(BRANCH_PREFIX) update = run(["composer", "update", "--prefer-stable", "--prefer-dist", "--no-scripts", "--no-interaction"], work, retries=3) @@ -165,23 +287,8 @@ def main(): json.dump(composer, file, indent=4, ensure_ascii=False) file.write("\n") - branch = BRANCH_PREFIX + datetime.date.today().strftime("%Y%m%d") - - for command in ( - ["git", "config", "user.name", USER], - ["git", "config", "user.email", f"{USER}@iriks-it.nl"], - ["git", "checkout", "-b", branch], - ["git", "commit", "-am", "Widen dependency constraints: " + ", ".join(sorted(changes))], - ["git", "push", "--quiet", "origin", branch], - ): - result = subprocess.run(command, cwd=work, capture_output=True, text=True) - - if result.returncode != 0: - sys.exit(f"{' '.join(command[:2])} failed: {result.stderr.strip()}") - - pull = api("POST", "pulls", {"title": "Dependency updates: " + ", ".join(sorted(changes)), "head": branch, "base": release, "body": body(changes, release)}) - print(f"Pull request #{pull['number']} to {release}: {', '.join(sorted(changes))}.") + publish(work, release, remote, BRANCH_PREFIX, changes, "Dependency updates", ["composer.json"]) if __name__ == "__main__": - main() + main_ui() if sys.argv[1:] == ["ui"] else main() diff --git a/.gitea/workflows/dependencies.yml b/.gitea/workflows/dependencies.yml index 3cba984..8a6cdf3 100644 --- a/.gitea/workflows/dependencies.yml +++ b/.gitea/workflows/dependencies.yml @@ -3,7 +3,9 @@ name: Dependency updates # A package has no composer.lock, so what goes stale is the range of versions it accepts. Every # Monday this looks for a direct dependency with a release outside its constraint (a new major) and # opens a pull request to the open release branch that accepts it as well; PR CI then tests it and the -# pull request merges by itself when it is green. Nothing happens while no release is open. +# pull request merges by itself when it is green. The second job does the same for the npm packages of the +# screens (ui/), to a release that has been public for 48 hours, and rebuilds resources/dist. Nothing happens +# while no release is open. on: schedule: - cron: '0 5 * * 1' @@ -34,3 +36,21 @@ jobs: GT_OWNER: iriks-it GT_REPO: laravel-manager GT_TOKEN: ${{ secrets.DEPLOY_TOKEN }} + + # The screens: npm packages that have a newer release (a new major too), once it has been public for 48 hours. + # The node image has git and python3; PR CI type-checks and builds the result. + ui: + runs-on: docker + container: + image: node:22-bookworm + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: update the packages of the screens + run: python3 .gitea/scripts/update_dependencies.py ui + env: + GT_URL: https://git.iriks.casa + GT_OWNER: iriks-it + GT_REPO: laravel-manager + GT_TOKEN: ${{ secrets.DEPLOY_TOKEN }} diff --git a/.gitea/workflows/pr-ci.yml b/.gitea/workflows/pr-ci.yml index b8d77c8..ead6043 100644 --- a/.gitea/workflows/pr-ci.yml +++ b/.gitea/workflows/pr-ci.yml @@ -151,15 +151,6 @@ jobs: - name: composer audit run: composer audit - - name: install trivy - run: .gitea/scripts/install-trivy.sh - - # Fails on HIGH and CRITICAL. vendor/ is left out of the secret and settings scan (it is other - # people's code); the lock file made above is what the vulnerability scan reads. - - name: trivy - run: | - trivy fs --no-progress --scanners vuln,secret,misconfig --severity HIGH,CRITICAL --exit-code 1 --skip-dirs vendor . - # Pull requests to a release branch merge by themselves when the check below is green. # Every job that checks out runs in an image with git: without git the checkout is the archive of the # repository, which leaves out what .gitattributes export-ignores (.gitea/ with these scripts). diff --git a/.gitea/workflows/scheduled.yml b/.gitea/workflows/scheduled.yml index 038cc7d..dce1c10 100644 --- a/.gitea/workflows/scheduled.yml +++ b/.gitea/workflows/scheduled.yml @@ -40,9 +40,3 @@ jobs: - name: composer audit run: composer audit - - name: install trivy - run: .gitea/scripts/install-trivy.sh - - - name: trivy - run: | - trivy fs --no-progress --scanners vuln,secret,misconfig --severity HIGH,CRITICAL --exit-code 1 --skip-dirs vendor . diff --git a/AGENTS.md b/AGENTS.md index 8cee59e..bf5dec2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,5 +20,5 @@ between lil-koneko.com, CarsHub, iriks-it.nl and bouwbedrijf.iriks-it.nl, as one ## Open decisions 1. Frontend: decided and built: the screens are in the package (`ui/`, built into `resources/dist`, committed; PR CI checks it is up to date). Still open: a theme editor in the manager, and a `host` mode that publishes the sources for a site to build itself. -2. Moving the rest from bouwbedrijf.iriks-it.nl: real pages and reviews (now skeletons) and revisions. Users, media, posts, audit log and statistics are done, with their screens. Leave out what is site-specific (the IriksIT API disk, the owner's simple screens, client names): this repo is public. -3. How the host's own `User` and a package `Group` relate when the host has its own roles. +2. Moving the rest from bouwbedrijf.iriks-it.nl: reviews (still a read-only list). Users, media, posts, pages with fields, resources, revisions, audit log and statistics are done, with their screens. Leave out what is site-specific (the IriksIT API disk, client names): this repo is public. Still open: two-factor login, cropping pictures, automated tests of the screens in CI. +3. Decided in 0.5.0: groups stay the default and the host's roles are added next to them (`manager.permissions`: `mode` groups, host or merge; `roles` or a `PermissionResolver`). A host that wants to replace the groups screens entirely is not planned. diff --git a/CHANGELOG.md b/CHANGELOG.md index a9684cc..09d0457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,40 @@ Every release has a section here, named after its version (for example `v0.1.0 - heading). The release pull request to `production` is stopped by PR CI when its section is missing, and the text of the section is the text of the release in Gitea. +## v0.5.0 - 2026-12-04 + +- Names that can move: `route_name` for the route-name prefix, `tables` for a table of its own per short name (on top of `table_prefix`), + `IriksIT\Manager\Support\Names` to ask for either. The defaults are the names of every earlier version. +- `manager:import posts|pages|reviews` copies the rows of a table of the site into the package (read-only on the source, repeatable, + `--dry-run`, column mapping). +- Server texts are translatable: menu, permission labels and sections, theme names, audit summaries and the main messages go through `__()`, + and the package ships `resources/lang/nl.json`. A site's own `lang/.json` wins. +- Fix: the audit log and the bot counter strip the configured route-name prefix, not a fixed `manager.`. +- Menu: sections, icons and order, changeable from `manager.menu` (items and links of the site's own). The old item shape stays valid. +- Simple view (`simple_view`, off by default): permissions `manager.full` and `manager.switch`, a remembered choice per account (new migration + adds `view` to the user settings) and a switch in the menu. +- Pages with fields: definitions in `manager.pages.definitions` (types text, textarea, markdown, lines, media, url, number, date, toggle, + select), `Page::contentFor($slug)` for the public site, and screens to edit them and to make free pages (new migration: `meta_description` + and `content` on the pages table). The field definitions (`Support\Fields`) and the form component are shared with what comes next. +- Lists without code: `manager.resources` makes a menu item, list, form, validation and permissions (`.view`, `.manage`) from field + definitions, kept in a model of the site or in the new `manager_records` table (new module `resources`, on by default, nothing registered + without definitions). +- Screens of the site's own: `manager.extensions` loads JavaScript modules next to the manager; `window.IriksManager` offers `register`, `api`, + `Vue` and the shared components, and `resources/dist/vue.js` maps `import 'vue'` to the Vue of the screens. A browser that opens a manager + address without a route of the package gets the screens (an HTML request only). +- History: a new module `revisions` (on by default, `MANAGER_REVISIONS`) keeps the state of every saved post and page with who and what changed, + shows it on the screens and puts an earlier state back (`revisions.view`, `revisions.restore`; new table `manager_revisions`). More models can + join with `manager.revisions.types`. +- Editor: Markdown fields get a toolbar, photos from the media library and a server-rendered preview (`POST /manager/markdown`); the media + library gets a click-to-set focus point with a square preview. (No cropping or rotating: the file stays as uploaded.) +- Statistics: `` puts the counting script (`/pulse/pulse.js`, no cookies, honours Do Not Track) in the public pages of a site. +- Login checks: `manager.login.checks` (contract `LoginCheck`, base class `BaseLoginCheck`) adds fields and checks before and after the password; + Cloudflare Turnstile is built in (two env keys). No two-factor login in the package itself. +- Roles of the host: `manager.permissions` (`mode` groups/host/merge, `roles` map or a `resolver` implementing `PermissionResolver`) lets a site + with its own roles say what an account may do; groups stay the default. +- CI: Trivy no longer runs in the jobs (the runner disk filled up with its database). `composer audit` stays in every pull request; Trivy scans production from the homelab (nightly, and after a deploy). +- `manager:doctor` has a `names` check: it warns when the site uses a route name or an address of the manager and says to set `route_name` or `path`. + ## v0.4.0 - 2026-12-04 - Screens in the package: a small Vue app on the JSON routes, built and served by the package (a site needs no Node). Login, logout and diff --git a/README.md b/README.md index af4287b..c32929d 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,51 @@ on the JSON routes. A browser that opens a manager address gets the page; anythi | `reviews` | Reviews | off | | `audit` | Audit log and address bans | off | | `statistics` | Visitor statistics | off | +| `resources` | Lists defined in config (`manager.resources`) | on (nothing without definitions) | +| `revisions` | History of posts and pages, with restore | on | Switch a part in `config/manager.php` (`modules`) or with `MANAGER_PAGES`, `MANAGER_POSTS`, -`MANAGER_REVIEWS`, `MANAGER_AUDIT`, `MANAGER_STATISTICS`. A module that is off has **no routes, no tables, no menu item and no permissions**: +`MANAGER_REVIEWS`, `MANAGER_AUDIT`, `MANAGER_STATISTICS`, `MANAGER_REVISIONS`. A module that is off has **no routes, no tables, no menu item and no permissions**: its migrations are not loaded at all. A module that needs another one (`requires()`) fails at boot when that one is off. +## Language + +The texts the server makes (menu, permission and section labels, theme names, audit summaries and the messages of the JSON routes) go through Laravel's `__()` with the English text as the key. The package ships `resources/lang/nl.json`; the screens follow `app()->getLocale()`. A site translates more, or words things differently, with its own `lang/.json`: that file wins over the package. Audit lines are written in the language of the request that made them. + +## The menu and the simple view + +A module's menu item is `['label' =>, 'route' =>, 'permission' =>]` and may add `section` (a heading), `icon` (`home`, `file`, `image`, `users`, `group`, `chart`, `shield`, `star`, `tag`, `link`, `cog`), `order` (lower first, default 100), `simple` and `new_tab`. A site changes the menu without code in `config/manager.php`: `menu.items` by route name without the prefix (`'posts.index' => ['order' => 10, 'section' => 'Content', 'hidden' => false]`) and `menu.links` for items of its own (`['label' => 'Leads', 'url' => '/manager/leads', 'permission' => null]`). + +`simple_view` (`MANAGER_SIMPLE_VIEW=true`) adds a simple face next to the full one, for an owner who only needs a few screens. Two permissions appear in the group form: `manager.full` (everything; super admins have it) and `manager.switch` (starts simple and may switch; the choice is remembered per account and the menu has a button for it). Every other account always gets the simple face: only the items marked `simple`. It limits the menu, not the access: the routes still check their own permissions. Turning it on makes accounts without `manager.full` or `manager.switch` see only the simple items, so give the groups what they need first. + +## Your own lists and screens + +**Lists without code.** `manager.resources` turns a definition into a menu item, a list, a form, validation and the permissions `.view` and `.manage`, for things like a menu, socials, services, testimonials or leads: + +```php +'resources' => [ + 'services' => [ + 'label' => 'Services', 'singular' => 'Service', + 'model' => App\Models\Service::class, // the records live in a model of the site; leave it out to use the package's own table + 'columns' => ['name', 'price'], 'order' => ['position', 'asc'], + 'fields' => ['name' => ['type' => 'text', 'required' => true], 'price' => ['type' => 'number'], 'photo' => ['type' => 'media']], + ], +], +``` + +The field keys are the attributes of the model (the definition is the whitelist: nothing else is written); without a model the values are kept as JSON in `manager_records`. Field types are the ones of the pages. Names that belong to a module (`posts`, `pages`, `media`, ...) are refused. + +**Screens of your own.** List a JavaScript module in `manager.extensions` (a path of your site, or https). The manager loads it before it shows anything and puts `window.IriksManager` in reach: `Vue`, `boot`, `api`, `t`, `flash`, `navigate`, `register` and the components `Link`, `FormFields`, `Icon` and `MediaPicker`. `register('^/leads$', Component, { data: true })` shows `Component` at `/manager/leads`, with the JSON of that same address (or of `source`) as props; an address of yours needs a route for the data, and a menu item through `manager.menu.links`. Build your bundle with `vue` left external (`build.rollupOptions.external: ['vue']`): the manager points `import 'vue'` at its own Vue, so your components share its reactivity. A browser that opens a manager address without a route of the package gets the screens (which show yours, or "no screen yet"); a request for data gets a plain 404. + +## A site with data and names of its own + +The package never maps its queries onto other tables: every screen assumes its own columns. What it does give you is room to coexist and a way to move data in. + +- `route_name` (default `manager`): the prefix of the route names. A site that already has `manager.*` routes sets, for example, `'route_name' => 'cms'`; the menu and the screens follow. Use `IriksIT\Manager\Support\Names::route('posts.index')` in code of your own. +- `table_prefix` (default `manager_`) and `tables` (`['media' => 'site_files']`): the names of the tables. Set them before the first `migrate`; the package does not rename a table that exists. +- `php artisan manager:import posts --table=articles --map=title=headline --map=body=content [--dry-run] [--connection=...] [--limit=...]` copies the rows of a table of the site into `posts`, `pages` or `reviews`. The source is only read, and running it again updates the rows it made (found by slug, or by author and text for reviews). `--map` is `package_column=source_column`. Put the settings in `manager.import.` (`table`, `connection`, `map`) to run it without options. Tags may be JSON or a comma separated list; a row without the required text is skipped and reported. + ## Your own module Implement `IriksIT\Manager\Contracts\Module` (or extend `Modules\BaseModule`), keep `routes.php` and a @@ -75,9 +114,25 @@ php artisan manager:create-user # the only way to make a super admin - `groups.manage` is a gate for super admins only, not a permission of a group. - The package defines one gate per permission and **no `Gate::before`**: it never answers for the abilities of your own app. +- **A site with roles of its own** (decided in 0.5.0: groups stay the default, the site's roles are added next to them). + `manager.permissions.mode` is `groups` (default), `host` (the groups are ignored) or `merge` (both). The site says what a role may do + with `roles` (`['editor' => ['posts.view', 'posts.write'], 'owner' => ['*']]`, read from the attribute `role_attribute`: a string, a + list or a relation with a `name`) or with a `resolver` class that implements `IriksIT\Manager\Contracts\PermissionResolver`. Values + that are no permission of an active module are ignored and what a permission needs is added. A super admin may always do everything. + The group screens still work in `host` mode but give nothing. - The migration adds `is_super_admin` to your users table (the table of `manager.user_model`). It promotes nobody. +## Checks on the login + +The login of the screens can ask for more. Write a class that extends `IriksIT\Manager\Support\Login\BaseLoginCheck` (the contract is `IriksIT\Manager\Contracts\LoginCheck`) and list it in `manager.login.checks`: + +- `fields()`: extra inputs on the form (`['name' => 'code', 'type' => 'text', 'label' => 'Code', 'autocomplete' => 'one-time-code']`); +- `before($request)`: runs before the password is looked at: a captcha; +- `after($request, $user)`: runs when the email and password are right and before anyone is logged in: a second factor. Refuse by throwing a `ValidationException`; the attempt then counts as a failed login, so the audit log and the bans see it. + +**Cloudflare Turnstile** is built in: set `MANAGER_TURNSTILE_SITE_KEY` and `MANAGER_TURNSTILE_SECRET` and the widget appears and is checked (a token that cannot be checked refuses the login). The widget loads a script from `challenges.cloudflare.com`; a strict Content-Security-Policy has to allow it. **There is no two-factor login in the package itself**: `after()` is the place for it, the code to make and keep the secrets is the site's. These checks belong to the login of the screens (`MANAGER_UI=package`); an app with its own login keeps its own. + ## Media module Files live on a Laravel filesystem disk (`manager.media.disk`); each row remembers its own disk. @@ -90,6 +145,20 @@ Files live on a Laravel filesystem disk (`manager.media.disk`); each row remembe `app(IriksIT\Manager\Support\MediaUsage::class)->register(fn () => $texts)`. Posts and Pages do. - No SVG: it can carry scripts. +## Pages module + +Pages are texts with keys, so the public site reads them and the owner edits them without code. Define a page in `config/manager.php`: + +```php +'pages' => ['definitions' => ['home' => ['title' => 'Home', 'fields' => [ + 'hero_title' => ['label' => 'Title on the photo', 'type' => 'text', 'default' => 'Welcome', 'max' => 120], + 'intro' => ['label' => 'Story', 'type' => 'markdown'], + 'photo' => ['label' => 'Photo', 'type' => 'media'], +]]]], +``` + +and read it with `IriksIT\Manager\Models\Page::contentFor('home')`: the stored values over the defaults, so a page that was never saved still has all its keys. Field types: `text`, `textarea`, `markdown`, `lines`, `media`, `url`, `number`, `date`, `toggle` and `select` (with `options`); `required`, `default`, `max`, `help` and `rules` work on all. The screens make the form, and the server validates and cleans every value by its type (a media or url value must be an address of the site or http(s)). A page without a definition is a free page with one Markdown text, a description for search engines and a publish switch; it can be made and removed in the screens. Permission: `pages.edit`. The definitions are shared code (`IriksIT\Manager\Support\Fields`), so other records can use them. + ## Posts module Posts written in Markdown, with drafts, scheduling, categories and tags. @@ -107,6 +176,14 @@ Posts written in Markdown, with drafts, scheduling, categories and tags. `app(IriksIT\Manager\Modules\Posts\PostLabels::class)->suggestCategories(fn () => $titles)`. - Covers and bodies count as use of a media file. +## The editor + +Texts in Markdown (posts, free pages and `markdown` fields) have a toolbar (bold, italic, heading, list, quote, link), a **Photo** button that puts a picture from the media library into the text, and a **Preview** that is rendered by the server the way the site renders it (raw HTML is escaped; `POST /manager/markdown`, not written in the audit log). In the media library a click on a picture sets its **focus point** (`focus_x`, `focus_y`, 0 to 1): the part that must stay in view when the site crops it, shown in a square preview. There is no cropping or rotating in the manager: the file is kept as it was uploaded, and the site crops with the focus point. + +## History module + +Every save of a post or a page keeps its state (`manager_revisions`, the newest 50 per record, `manager.revisions.keep`), with who saved it and which fields changed; saving the same state again keeps nothing. The post and page screens show the history, and `revisions.restore` puts an earlier state back, which is a save like any other (so what was there is in the history too). Whether a post is on the site (`published_at`) and whether a page is published is not part of the history: going back in time never publishes or hides anything. A live post can only be put back by someone who may publish. Permissions: `revisions.view` (and the permission to see that kind of text) and `revisions.restore` (and the permission to write it). A site adds its own models with `manager.revisions.types`, e.g. `'services' => ['model' => App\\Models\\Service::class, 'view' => 'services.view', 'restore' => 'services.manage']`. `MANAGER_REVISIONS=false` turns the module off. + ## Audit module Off by default: it stores IP addresses and browser lines, so a site switches it on knowingly and says so in its @@ -138,7 +215,8 @@ Off by default (`MANAGER_STATISTICS=true`). The site's own visitor statistics, w a visitor is a code made of the address, the browser and a random key that is deleted after a day (`manager:forget-visitor-keys`, scheduled daily), so a code cannot be traced back afterwards. A browser that sends `DNT` or `Sec-GPC` is not counted. -- **Reporting**: the pages of your site `POST` to `/pulse/view` (`{path, referrer, via, campaign}`, answers `{token}`) and, when the +- **The script**: put `` once in the layout of the public site (`:spa="true"` for a site with a client-side router). It loads `/pulse/pulse.js` (about 2 kB, plain JavaScript, no cookies or storage), reports the page and the time it was in view, and does nothing for a browser with Do Not Track or Global Privacy Control. With the module off the component prints nothing. Behind a Content-Security-Policy allow that one script address. +- **Reporting** (what the script does, for a site that wants to do it itself): the pages of your site `POST` to `/pulse/view` (`{path, referrer, via, campaign}`, answers `{token}`) and, when the visitor leaves, `/pulse/leave` (`{token, seconds}`). No session, rate limited (`manager.statistics.per_minute`). - **Which pages count**: only addresses you name, so nobody can fill the statistics with made-up ones: `manager.statistics.pages`, the posts under `manager.statistics.posts_path` (published ones only), and anything else through @@ -152,12 +230,14 @@ scheduled daily), so a code cannot be traced back afterwards. A browser that sen ## State of this version -Done: module registry and switches, permissions per module, users (accounts, groups, command), media (library and public file -route), posts (with categories and tags), the audit log with bans, the statistics, the built-in screens for all of these (with a -login and profile), themes, and the install and doctor commands for AI agents. `composer test` runs the tests. +Done: module registry and switches, permissions per module, users (accounts, groups, command, roles of the host), media (library and +public file route, focus point), posts (with categories and tags), pages with fields, lists defined in config, the history with restore, +the audit log with bans, the statistics (with the counting script), the built-in screens for all of these (with a login, checks on the +login, a profile and the simple view), an editor, themes, translations, a site's own bundle of screens, the import of existing data, and +the install and doctor commands for AI agents. `composer test` runs the tests. -Pages and reviews are still skeletons (a read-only list), and revisions are not ported yet. The answers of every action are JSON -in the shape the screens use, so an app can build its own screens with `MANAGER_UI=none`. +Reviews are still a read-only list. The answers of every action are JSON in the shape the screens use, so an app can build its own screens +with `MANAGER_UI=none`. Not in the package: two-factor login (the login checks are the place for it), cropping or rotating pictures, a theme editor. ## Development cycle @@ -180,10 +260,10 @@ Nobody opens a pull request to `develop`, and `production` and the release branc | When | What runs | |---|---| -| Pull request to a release branch or to production | *flow* (right branches, version above the latest tag, changelog section, tests of these scripts), *ledger* (`TOKENS.md`), *test* (Pint, Pest with the newest and the oldest dependencies, `composer validate`), *security* (`composer audit`, Trivy on the dependencies, secrets and settings). The check `PR CI / pr-ci` is green when all are. | +| Pull request to a release branch or to production | *flow* (right branches, version above the latest tag, changelog section, tests of these scripts), *ledger* (`TOKENS.md`), *test* (Pint, Pest with the newest and the oldest dependencies, `composer validate`), *security* (`composer audit`: the job fails on any advisory). The check `PR CI / pr-ci` is green when all are. | | Push to production | verify (Pest, audit), tag and release, Packagist, sync develop | -| Every Monday | `composer audit` and Trivy on production | -| Every Monday | *Dependency updates*: a direct dependency with a release outside its constraint (a new major) gets its constraint widened in a pull request `renovate/deps-DATE` to the open release branch; PR CI tests it and it merges when green. Nothing happens while no release is open. The central Trivy (every night 03:00 UTC) and Renovate (04:00 UTC) of the homelab also pass over this repo, but read a `composer.lock` and a package has none, so they find little here. | +| Every Monday | `composer audit` on production | +| Every Monday | *Dependency updates*: a direct dependency with a release outside its constraint (a new major) gets its constraint widened in a pull request `renovate/deps-DATE` to the open release branch; the npm packages of the screens (`ui/`) move to their newest release that has been public for 48 hours, with a rebuilt `resources/dist`, in `renovate/ui-deps-DATE`. PR CI tests them and they merge when green. Nothing happens while no release is open. The central Trivy (every night 03:00 UTC) and Renovate (04:00 UTC) of the homelab also pass over this repo, but read a `composer.lock` and a package has none, so they find little here. | | Every night | *Prune branches*: removes `feature/*` and `fix/*` branches whose last commit is over 30 days old and that have no open pull request (a branch of a pull request can be restored from it in Gitea) | Secrets of the repository for this: `DEPLOY_TOKEN` (the organisation has it), and `PACKAGIST_USERNAME` and diff --git a/TOKENS.md b/TOKENS.md index cd97b2c..87a5fa5 100644 --- a/TOKENS.md +++ b/TOKENS.md @@ -30,3 +30,18 @@ Per stuk werk een rij; zie `dev/token-usage.py`. | 2026-12-04 | De stappengids en de installatie verbeterd na de proef met een verse agent | - | claude-sonnet-5-5 | 25 | 21.844 | 50 | 35.997 | 6.551.164 | 0,10 | | 2026-12-04 | De stappengids en de installatie verbeterd na de proef met een verse agent | - | claude-haiku-5-5 | 11 | 8.233 | 22 | 51.184 | 444.805 | 0,00 | | 2026-12-04 | Changelog van v0.4.0, wiki en notitie in longterm-memory | - | claude-sonnet-5-5 | 7 | 3.891 | 14 | 5.215 | 1.999.583 | 0,01 | +| 2026-12-04 | De wekelijkse workflow werkt ook de npm-pakketten van de schermen bij, met 48 uur wachttijd en een nieuwe bundel | - | claude-sonnet-5-5 | 9 | 9.971 | 22 | 15.191 | 3.032.384 | 0,05 | +| 2026-12-04 | TypeScript 7 niet voorstellen zolang vue-tsc het niet draait, en de PR van de eerste run rechtgezet | - | claude-sonnet-5-5 | 10 | 4.340 | 26 | 4.489 | 3.503.406 | 0,05 | +| 2026-12-04 | Namen die kunnen verhuizen (route_name, tables) en manager:import voor bestaande gegevens | - | claude-sonnet-5-5 | 25 | 17.827 | 54 | 72.997 | 2.216.503 | 0,09 | +| 2026-12-04 | Namen die kunnen verhuizen (route_name, tables) en manager:import voor bestaande gegevens | - | claude-fable-5-2 | 1 | 5.062 | 61.001 | 0 | 0 | 0,00 | +| 2026-12-04 | Teksten van de server vertaalbaar met lang-bestanden en een Nederlandse vertaling | - | claude-sonnet-5-5 | 14 | 11.377 | 28 | 23.146 | 1.520.289 | 0,02 | +| 2026-12-04 | Menu met secties, iconen en volgorde, en de simpele weergave naast de volledige | - | claude-sonnet-5-5 | 23 | 20.663 | 46 | 31.486 | 3.202.624 | 0,05 | +| 2026-12-04 | Echte pagina's met velden, een veldenschema en het formulier in de schermen | - | claude-sonnet-5-5 | 17 | 20.944 | 34 | 31.958 | 2.886.715 | 0,07 | +| 2026-12-04 | Lijsten zonder code (resources) en een eigen bundel met schermen van de site | - | claude-sonnet-5-5 | 27 | 29.948 | 54 | 45.009 | 5.852.776 | 0,08 | +| 2026-12-04 | Revisies: geschiedenis van berichten en pagina's, met terugzetten | - | claude-sonnet-5-5 | 6 | 12.423 | 12 | 14.609 | 1.461.419 | 0,03 | +| 2026-12-04 | De editor: opmaakknoppen, foto's in de tekst, voorbeeld en een scherpstelpunt in de bibliotheek | - | claude-sonnet-5-5 | 15 | 18.397 | 30 | 28.742 | 3.931.230 | 0,07 | +| 2026-12-04 | Het telscript en de Blade-component voor de publieke pagina's van de statistieken | - | claude-sonnet-5-5 | 8 | 9.037 | 16 | 15.948 | 2.254.948 | 0,04 | +| 2026-12-04 | Loginhaken: eigen velden en controles, en Turnstile | - | claude-sonnet-5-5 | 4 | 9.009 | 8 | 9.515 | 1.178.544 | 0,02 | +| 2026-12-04 | Rollen van de site naast de groepen van het pakket | - | claude-sonnet-5-5 | 3 | 5.308 | 6 | 8.235 | 921.246 | 0,01 | +| 2026-12-04 | Controle op namen die de site al gebruikt, en de documenten van 0.5.0 rechtgezet | - | claude-sonnet-5-5 | 9 | 7.281 | 18 | 12.115 | 2.881.457 | 0,03 | +| 2026-12-04 | Trivy uit de PR-jobs (schijf van de runners vol), opruimen en wekelijkse prune | - | claude-sonnet-5-5 | 20 | 9.723 | 44 | 94.863 | 1.460.150 | 0,15 | diff --git a/config/manager.php b/config/manager.php index 9fcd393..a7e8319 100644 --- a/config/manager.php +++ b/config/manager.php @@ -52,6 +52,8 @@ return [ Modules\Reviews\ReviewsModule::class, Modules\Audit\AuditModule::class, Modules\Statistics\StatisticsModule::class, + Modules\Resources\ResourcesModule::class, + Modules\Revisions\RevisionsModule::class, ], /* @@ -67,6 +69,8 @@ return [ 'reviews' => env('MANAGER_REVIEWS', false), 'audit' => env('MANAGER_AUDIT', false), 'statistics' => env('MANAGER_STATISTICS', false), + 'resources' => true, + 'revisions' => env('MANAGER_REVISIONS', true), ], /* @@ -145,8 +149,98 @@ return [ 'count_bots' => (bool) env('MANAGER_STATISTICS_COUNT_BOTS', true), ], + /* + | Pages with fields (module `pages`): per slug a title and the fields the screens make a form of, and the + | public site reads with `IriksIT\Manager\Models\Page::contentFor('home')`: + | 'definitions' => ['home' => ['title' => 'Home', 'fields' => [ + | 'hero_title' => ['label' => 'Title on the photo', 'type' => 'text'], + | 'intro' => ['label' => 'Story', 'type' => 'markdown'], + | 'photo' => ['label' => 'Photo', 'type' => 'media'], + | ]]]. + | Types: text, textarea, markdown, lines, media, url, number, date, toggle, select (with `options`). + */ + 'pages' => ['definitions' => []], + + /* + | Lists the site manages without code of its own: a form, a list, permissions (`.view`, `.manage`) + | and a menu item for each. `model` keeps the records in a model of the site (the field keys are its + | attributes); without it they go into the package's own table. Fields: see `pages`. + | 'services' => ['label' => 'Services', 'singular' => 'Service', 'model' => App\Models\Service::class, + | 'columns' => ['name', 'price'], 'order' => ['position', 'asc'], 'fields' => ['name' => ['type' => 'text', 'required' => true], ...]] + */ + 'resources' => [], + + /* + | A bundle of the site's own screens: JavaScript modules (a path of the site, or https) the manager loads next to its own, + | after it has started. They add screens with `IriksManager.register('^/leads$', Component, { data: true })`, and may + | `import { ref } from 'vue'` when the build leaves `vue` external. See README, "Your own screens". + */ + 'extensions' => [], + + /* + | The history of posts and pages (module `revisions`): `keep` states per record, more `types` of the site's own + | (['services' => ['model' => App\Models\Service::class, 'view' => 'services.view', 'restore' => 'services.manage']]), + | and `skip` for model classes that should not have one. + */ + 'revisions' => ['keep' => 50, 'types' => [], 'skip' => []], + + /* + | More a login asks for. `checks`: classes that implement IriksIT\Manager\Contracts\LoginCheck (extend + | IriksIT\Manager\Support\Login\BaseLoginCheck): a field of the form, something to check before the password is + | tried (a captcha) or after it was right (a second factor). Cloudflare Turnstile is built in and turns itself on + | when both of its keys are set. These apply to the login of the manager's own screens. + */ + 'login' => [ + 'checks' => [], + 'turnstile' => ['site_key' => env('MANAGER_TURNSTILE_SITE_KEY'), 'secret' => env('MANAGER_TURNSTILE_SECRET')], + ], + + /* + | Who may do what. `groups` (default): the groups of the package. A site that has roles of its own can say it itself: + | `host` takes the permissions only from the site, `merge` adds them to what the groups give. The site's side is a + | `resolver` class (IriksIT\Manager\Contracts\PermissionResolver), or, simpler, `roles` per role name (`*` is + | everything) read from the attribute `role_attribute` of the account (a string, a list or a relation with a `name`). + | 'roles' => ['editor' => ['posts.view', 'posts.write'], 'owner' => ['*']]. A super admin may always do everything. + */ + 'permissions' => ['mode' => env('MANAGER_PERMISSIONS', 'groups'), 'resolver' => null, 'roles' => [], 'role_attribute' => 'role'], + + /* + | The menu. `items` changes what a module gives, by the route name without the prefix: + | 'posts.index' => ['order' => 10, 'section' => 'Content', 'icon' => 'file', 'simple' => true, 'hidden' => false]. + | `links` adds items of the site's own: ['label' => 'Leads', 'url' => '/manager/leads', 'permission' => null, + | 'section' => ..., 'icon' => ..., 'order' => ..., 'simple' => ..., 'new_tab' => ...]. + | Icons: home, file, image, users, group, chart, shield, star, tag, link, cog. + */ + 'menu' => ['items' => [], 'links' => []], + + /* + | A simple face of the manager next to the full one. With this on, the permissions `manager.full` and + | `manager.switch` exist: an account with the first (or a super admin) gets everything; one with the + | second starts simple and may switch; all others always get the simple face, which shows only the + | menu items marked `simple`. Off: everyone sees the whole menu. + */ + 'simple_view' => (bool) env('MANAGER_SIMPLE_VIEW', false), + /* | Prefix for the tables of the package. */ 'table_prefix' => 'manager_', + + /* + | A table with a name of its own, by short name (`posts`, `pages`, `media`, ...): wins over the prefix. + | Set it before the first migrate; the package never renames a table that exists. + */ + 'tables' => [], + + /* + | Prefix of the route names (`manager.posts.index`). Change it when the site already has `manager.*` + | routes; menu items and screens follow by themselves. + */ + 'route_name' => 'manager', + + /* + | Where `php artisan manager:import ` reads from, so it needs no options: + | 'posts' => ['table' => 'articles', 'connection' => null, 'map' => ['title' => 'headline']]. + */ + 'import' => [], ]; diff --git a/database/migrations/2026_12_05_000001_create_manager_user_settings.php b/database/migrations/2026_12_05_000001_create_manager_user_settings.php index 5b5ba25..6fd06c3 100644 --- a/database/migrations/2026_12_05_000001_create_manager_user_settings.php +++ b/database/migrations/2026_12_05_000001_create_manager_user_settings.php @@ -3,6 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; return new class extends Migration { @@ -10,7 +11,7 @@ return new class extends Migration { $users = (new (config('manager.user_model')))->getTable(); - Schema::create(config('manager.table_prefix').'user_settings', function (Blueprint $table) use ($users) { + Schema::create(Names::table('user_settings'), function (Blueprint $table) use ($users) { $table->id(); $table->foreignId('user_id')->unique()->constrained($users)->cascadeOnDelete(); $table->string('theme', 60)->nullable(); @@ -20,6 +21,6 @@ return new class extends Migration public function down(): void { - Schema::dropIfExists(config('manager.table_prefix').'user_settings'); + Schema::dropIfExists(Names::table('user_settings')); } }; diff --git a/database/migrations/2026_12_06_000001_add_view_to_manager_user_settings.php b/database/migrations/2026_12_06_000001_add_view_to_manager_user_settings.php new file mode 100644 index 0000000..df4cecb --- /dev/null +++ b/database/migrations/2026_12_06_000001_add_view_to_manager_user_settings.php @@ -0,0 +1,24 @@ +string('view', 10)->nullable()->after('theme'); + }); + } + + public function down(): void + { + Schema::table(Names::table('user_settings'), function (Blueprint $table) { + $table->dropColumn('view'); + }); + } +}; diff --git a/out/menu.png b/out/menu.png new file mode 100644 index 0000000..53fcbc9 Binary files /dev/null and b/out/menu.png differ diff --git a/out/page-form.png b/out/page-form.png new file mode 100644 index 0000000..4c1686a Binary files /dev/null and b/out/page-form.png differ diff --git a/resources/ai/INTEGRATION.md b/resources/ai/INTEGRATION.md index 3c5db6a..8f8e750 100644 --- a/resources/ai/INTEGRATION.md +++ b/resources/ai/INTEGRATION.md @@ -17,6 +17,14 @@ order and never edit files inside `vendor/`. Repeat until `"ok": true`. Facts that matter: +- A site that already has `manager.*` route names, `manager_*` tables or its own posts and pages: `manager:doctor` has a `names` check that says + so. Set `route_name`, `table_prefix` or `tables` in `config/manager.php` before the first `migrate`, then copy what exists with + `php artisan manager:import posts|pages|reviews --table= --map== --dry-run` (the source is only read). +- What the site's own content looks like is configuration, not code: `manager.pages.definitions` (texts with keys, read with `Page::contentFor('slug')`), + `manager.resources` (lists such as services or testimonials, in a model of the site or the package's table) and `manager.menu` (order, sections, + icons, own links). A screen that needs code is a JavaScript module in `manager.extensions`; it registers with `IriksManager.register`. +- Who may do what: the groups of the package, or the roles of the site (`manager.permissions`); more on the login: `manager.login.checks`, Turnstile + with two env keys. The public pages count visits with `` when `statistics` is on. - The screens are part of the package (`MANAGER_UI=package`, the default): open `/manager` in a browser. The app does not need a login of its own: when it has no route named `login`, the manager's own login at `/manager/login` is used. With `MANAGER_UI=none` there are only the JSON routes. diff --git a/resources/boost/guidelines/core.blade.php b/resources/boost/guidelines/core.blade.php index 6b6a276..59914dd 100644 --- a/resources/boost/guidelines/core.blade.php +++ b/resources/boost/guidelines/core.blade.php @@ -1,9 +1,10 @@ ## iriks-it/laravel-manager -A modular backend (users, media, pages, posts, reviews, audit, statistics) installed as a package. +A modular backend (users, media, pages, posts, reviews, audit, statistics, resources, revisions) installed as a package. - To integrate it, follow `vendor/iriks-it/laravel-manager/resources/ai/INTEGRATION.md` step by step. - Set it up with `php artisan manager:install --modules=... --user-model=...`, then `config:clear`, `migrate`, `storage:link`; verify in a new process with `php artisan manager:doctor --json` (non-zero exit on failure, every problem has a `fix`). - The screens come with the package (`MANAGER_UI`), including a login when the app has none; themes: `php artisan manager:make-theme`, `MANAGER_THEME`. - The user model needs the `HasManagerAccess` trait; `is_super_admin` is never mass assignable. The first super admin comes from `php artisan manager:create-user`. +- The site's content is configuration: `manager.pages.definitions`, `manager.resources`, `manager.menu`, `manager.permissions`, `manager.login.checks`; code only as a JavaScript module in `manager.extensions`. Existing data comes in with `php artisan manager:import`. - Switch parts with `MANAGER_=true|false`; never edit `vendor/`. Site-specific parts are your own `Module` class. diff --git a/resources/dist/manager.css b/resources/dist/manager.css index 8690a6e..919ccbb 100644 --- a/resources/dist/manager.css +++ b/resources/dist/manager.css @@ -1 +1,3 @@ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--color-emerald-500:oklch(69.6% .17 162.48);--color-black:#000;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-sm:.25rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.m-card{background:var(--m-panel);border:1px solid var(--m-line);border-radius:var(--m-radius,.5rem)}.m-btn{border-radius:var(--m-radius,.5rem);cursor:pointer;border:1px solid #0000;align-items:center;gap:.4rem;padding:.5rem .9rem;font-size:.875rem;font-weight:600;transition:filter .15s;display:inline-flex}.m-btn:disabled{opacity:.5;cursor:not-allowed}.m-btn-primary{background:var(--m-brand);color:#fff}.m-btn-primary:hover:not(:disabled){filter:brightness(1.1)}.m-btn-secondary{background:var(--m-panel-2);border-color:var(--m-line);color:var(--m-text)}.m-btn-secondary:hover:not(:disabled){filter:brightness(1.15)}.m-btn-danger{color:#ef4444;background:0 0;border-color:#ef444466}.m-label{color:var(--m-muted);margin-bottom:.25rem;font-size:.8rem;font-weight:600;display:block}.m-input{border-radius:var(--m-radius,.5rem);border:1px solid var(--m-line);background:var(--m-ink);width:100%;color:var(--m-text);padding:.5rem .7rem;font-size:.9rem}.m-input:focus{outline:2px solid var(--m-brand);outline-offset:1px}.m-error{color:#ef4444;margin-top:.25rem;font-size:.8rem}.m-help{color:var(--m-muted);margin-top:.25rem;font-size:.75rem}.m-badge{background:var(--m-panel-2);border:1px solid var(--m-line);border-radius:999px;padding:.1rem .55rem;font-size:.7rem;font-weight:600;display:inline-block}}@layer utilities{.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.fixed{position:fixed}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.right-5{right:calc(var(--spacing) * 5)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:0}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.max-h-\[85vh\]{max-height:85vh}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing) * 4)}.w-9{width:calc(var(--spacing) * 9)}.w-32{width:calc(var(--spacing) * 32)}.w-60{width:calc(var(--spacing) * 60)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[12rem\]{max-width:12rem}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-3{min-width:calc(var(--spacing) * 3)}.min-w-\[10rem\]{min-width:10rem}.min-w-px{min-width:1px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--m-line)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-brand{border-color:var(--m-brand)}.border-line{border-color:var(--m-line)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-brand,.bg-brand\/15{background-color:var(--m-brand)}@supports (color:color-mix(in lab,red,red)){.bg-brand\/15{background-color:color-mix(in oklab,var(--m-brand) 15%,transparent)}}.bg-panel{background-color:var(--m-panel)}.bg-panel-2{background-color:var(--m-panel-2)}.object-cover{object-fit:cover}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.pt-14{padding-top:calc(var(--spacing) * 14)}.pt-20{padding-top:calc(var(--spacing) * 20)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.text-left{text-align:left}.font-display{font-family:var(--m-font-display,var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif))}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.break-all{word-break:break-all}.text-emerald-500{color:var(--color-emerald-500)}.text-muted{color:var(--m-muted)}.text-red-500{color:var(--color-red-500)}.text-text{color:var(--m-text)}.underline{text-decoration-line:underline}.opacity-50{opacity:.5}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){:is(:where(.group):hover .group-hover\:text-brand){color:var(--m-brand)}.hover\:border-brand:hover{border-color:var(--m-brand)}.hover\:bg-text\/5:hover{background-color:var(--m-text)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-text\/5:hover{background-color:color-mix(in oklab,var(--m-text) 5%,transparent)}}.hover\:text-text:hover{color:var(--m-text)}}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:48rem){.md\:ml-60{margin-left:calc(var(--spacing) * 60)}.md\:flex{display:flex}.md\:hidden{display:none}.md\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:px-8{padding-inline:calc(var(--spacing) * 8)}.md\:pt-0{padding-top:0}.md\:pt-8{padding-top:calc(var(--spacing) * 8)}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}}html,body{background:var(--m-ink);color:var(--m-text);font-family:var(--font-sans)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000} +/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}@layer theme{:root,:host{--font-sans:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--color-emerald-500:oklch(69.6% .17 162.48);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--radius-sm:.25rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components{.m-card{background:var(--m-panel);border:1px solid var(--m-line);border-radius:var(--m-radius,.5rem)}.m-btn{border-radius:var(--m-radius,.5rem);cursor:pointer;border:1px solid #0000;align-items:center;gap:.4rem;padding:.5rem .9rem;font-size:.875rem;font-weight:600;transition:filter .15s;display:inline-flex}.m-btn:disabled{opacity:.5;cursor:not-allowed}.m-btn-primary{background:var(--m-brand);color:#fff}.m-btn-primary:hover:not(:disabled){filter:brightness(1.1)}.m-btn-secondary{background:var(--m-panel-2);border-color:var(--m-line);color:var(--m-text)}.m-btn-secondary:hover:not(:disabled){filter:brightness(1.15)}.m-btn-danger{color:#ef4444;background:0 0;border-color:#ef444466}.m-label{color:var(--m-muted);margin-bottom:.25rem;font-size:.8rem;font-weight:600;display:block}.m-input{border-radius:var(--m-radius,.5rem);border:1px solid var(--m-line);background:var(--m-ink);width:100%;color:var(--m-text);padding:.5rem .7rem;font-size:.9rem}.m-input:focus{outline:2px solid var(--m-brand);outline-offset:1px}.m-error{color:#ef4444;margin-top:.25rem;font-size:.8rem}.m-prose{overflow-wrap:anywhere;line-height:1.6}.m-prose>*+*{margin-top:.75rem}.m-prose h1,.m-prose h2,.m-prose h3{font-family:var(--m-font-display,inherit);font-weight:700;line-height:1.25}.m-prose h1{font-size:1.5rem}.m-prose h2{font-size:1.25rem}.m-prose h3{font-size:1.1rem}.m-prose ul{padding-left:1.25rem;list-style:outside}.m-prose ol{padding-left:1.25rem;list-style:decimal}.m-prose blockquote{border-left:3px solid var(--m-line);color:var(--m-muted);padding-left:.75rem}.m-prose a{text-decoration:underline}.m-prose img{border-radius:.5rem;max-width:100%;height:auto}.m-prose code{font-family:ui-monospace,monospace;font-size:.9em}.m-help{color:var(--m-muted);margin-top:.25rem;font-size:.75rem}.m-badge{background:var(--m-panel-2);border:1px solid var(--m-line);border-radius:999px;padding:.1rem .55rem;font-size:.7rem;font-weight:600;display:inline-block}}@layer utilities{.pointer-events-none{pointer-events:none}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.right-5{right:calc(var(--spacing) * 5)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:0}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-inline:auto}.my-3{margin-block:calc(var(--spacing) * 3)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-10{margin-top:calc(var(--spacing) * 10)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.max-h-\[85vh\]{max-height:85vh}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-screen{min-height:100vh}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-9{width:calc(var(--spacing) * 9)}.w-16{width:calc(var(--spacing) * 16)}.w-32{width:calc(var(--spacing) * 32)}.w-60{width:calc(var(--spacing) * 60)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[12rem\]{max-width:12rem}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-3{min-width:calc(var(--spacing) * 3)}.min-w-\[10rem\]{min-width:10rem}.min-w-px{min-width:1px}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.cursor-crosshair{cursor:crosshair}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line>:not(:last-child)){border-color:var(--m-line)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-brand{border-color:var(--m-brand)}.border-line{border-color:var(--m-line)}.border-white{border-color:var(--color-white)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-brand,.bg-brand\/15{background-color:var(--m-brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/15{background-color:color-mix(in oklab, var(--m-brand) 15%, transparent)}}.bg-brand\/60{background-color:var(--m-brand)}@supports (color:color-mix(in lab, red, red)){.bg-brand\/60{background-color:color-mix(in oklab, var(--m-brand) 60%, transparent)}}.bg-panel{background-color:var(--m-panel)}.bg-panel-2{background-color:var(--m-panel-2)}.object-cover{object-fit:cover}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.\!px-2{padding-inline:calc(var(--spacing) * 2)!important}.\!px-3{padding-inline:calc(var(--spacing) * 3)!important}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.\!py-1{padding-block:var(--spacing)!important}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-14{padding-top:calc(var(--spacing) * 14)}.pt-20{padding-top:calc(var(--spacing) * 20)}.pb-1{padding-bottom:var(--spacing)}.pb-16{padding-bottom:calc(var(--spacing) * 16)}.text-left{text-align:left}.font-display{font-family:var(--m-font-display,var(--m-font,ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif))}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-emerald-500{color:var(--color-emerald-500)}.text-muted{color:var(--m-muted)}.text-red-500{color:var(--color-red-500)}.text-text{color:var(--m-text)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.underline{text-decoration-line:underline}.opacity-50{opacity:.5}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){:is(:where(.group):hover .group-hover\:text-brand){color:var(--m-brand)}.hover\:border-brand:hover{border-color:var(--m-brand)}.hover\:bg-text\/5:hover{background-color:var(--m-text)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-text\/5:hover{background-color:color-mix(in oklab, var(--m-text) 5%, transparent)}}.hover\:text-text:hover{color:var(--m-text)}}@media (width>=40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:w-64{width:calc(var(--spacing) * 64)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[1fr_1fr_auto\]{grid-template-columns:1fr 1fr auto}.sm\:items-end{align-items:flex-end}}@media (width>=48rem){.md\:ml-60{margin-left:calc(var(--spacing) * 60)}.md\:flex{display:flex}.md\:hidden{display:none}.md\:translate-x-0{--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:px-8{padding-inline:calc(var(--spacing) * 8)}.md\:pt-0{padding-top:0}.md\:pt-8{padding-top:calc(var(--spacing) * 8)}}@media (width>=64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}}html,body{background:var(--m-ink);color:var(--m-text);font-family:var(--font-sans)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000} +/*$vite$:1*/ \ No newline at end of file diff --git a/resources/dist/manager.js b/resources/dist/manager.js index 2644916..3dcd625 100644 --- a/resources/dist/manager.js +++ b/resources/dist/manager.js @@ -1,2 +1,7 @@ -function xn(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const te={},Ot=[],st=()=>{},Ai=()=>!1,Is=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),js=e=>e.startsWith("onUpdate:"),de=Object.assign,wn=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},qo=Object.prototype.hasOwnProperty,X=(e,t)=>qo.call(e,t),U=Array.isArray,xt=e=>Ht(e)==="[object Map]",bt=e=>Ht(e)==="[object Set]",Kn=e=>Ht(e)==="[object Date]",F=e=>typeof e=="function",re=e=>typeof e=="string",Ke=e=>typeof e=="symbol",Q=e=>e!==null&&typeof e=="object",Ei=e=>(Q(e)||F(e))&&F(e.then)&&F(e.catch),Pi=Object.prototype.toString,Ht=e=>Pi.call(e),Go=e=>Ht(e).slice(8,-1),Oi=e=>Ht(e)==="[object Object]",$n=e=>re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=xn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zo=1e4,Ds=e=>{let t=Object.create(null),s=0;return(n=>{const i=t[n];return i!==void 0?i:(++s>zo&&(t=Object.create(null),s=1),t[n]=e(n))})},Jo=/-\w/g,Se=Ds(e=>e.replace(Jo,t=>t.slice(1).toUpperCase())),Xo=/\B([A-Z])/g,Vt=Ds(e=>e.replace(Xo,"-$1").toLowerCase()),Us=Ds(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xs=Ds(e=>e?`on${Us(e)}`:""),tt=(e,t)=>!Object.is(e,t),Ss=(e,...t)=>{for(let s=0;s{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},ds=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Wn;const Ls=()=>Wn||(Wn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function wt(e){if(U(e)){const t={};for(let s=0;ss.startsWith("/*")?"":s).split(Yo).forEach(s=>{if(s){const n=s.split(Zo);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ce(e){let t="";if(re(e))t=e;else if(U(e))for(let s=0;sWe(s,t))}function zn(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!="function"&&typeof e.valueOf!="function"?Ht(e):String(e)}const Ri=e=>!!(e&&e.__v_isRef===!0),p=e=>re(e)?e:e==null?"":U(e)||Q(e)&&(e.toString===Pi||!F(e.toString))?Ri(e)?p(e.value):JSON.stringify(e,Vi,2):String(e),Vi=(e,t)=>Ri(t)?Vi(e,t.value):xt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,i],o)=>(s[Ys(n,o)+" =>"]=i,s),{})}:bt(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Ys(s))}:Ke(t)?Ys(t):Q(t)&&!U(t)&&!Oi(t)?String(t):t,Ys=(e,t="")=>{var s;return Ke(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};let ue;class Ii{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&&ue&&(ue.active?(this.parent=ue,this.index=(ue.scopes||(ue.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes){const n=this.scopes.slice();for(t=0,s=n.length;t0&&--this._on===0){if(ue===this)ue=this.prevScope;else{let t=ue;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 s,n;for(s=0,n=this.effects.length;s0)return;if(es){let t=es;for(es=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Qt;){let t=Qt;for(Qt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function Fi(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Bi(e){let t,s=e.depsTail,n=s;for(;n;){const i=n.prevDep;n.version===-1?(n===s&&(s=i),Tn(n),rl(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=s}function un(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Hi(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Hi(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!un(e))))return;e.flags|=2;const t=e.dep,s=ne,n=He;ne=e,He=!0;try{Fi(e);const i=e.fn(e._value);(t.version===0||tt(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{ne=s,He=n,Bi(e),e.flags&=-3}}function Tn(e,t=!1){const{dep:s,prevSub:n,nextSub:i}=e;if(n&&(n.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let o=s.computed.deps;o;o=o.nextDep)Tn(o,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function rl(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let He=!0;const Ki=[];function nt(){Ki.push(He),He=!1}function it(){const e=Ki.pop();He=e===void 0?!0:e}function Jn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ne;ne=void 0;try{t()}finally{ne=s}}}let os=0;class al{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class An{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(!ne||!He||ne===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ne)s=this.activeLink=new al(ne,this),ne.deps?(s.prevDep=ne.depsTail,ne.depsTail.nextDep=s,ne.depsTail=s):ne.deps=ne.depsTail=s,Wi(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ne.depsTail,s.nextDep=void 0,ne.depsTail.nextDep=s,ne.depsTail=s,ne.deps===s&&(ne.deps=n)}return s}trigger(t){this.version++,os++,this.notify(t)}notify(t){kn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Cn()}}}function Wi(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Wi(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const dn=new WeakMap,Mt=Symbol(""),fn=Symbol(""),Lt=Symbol("");function me(e,t,s){if(He&&ne){let n=dn.get(e);n||dn.set(e,n=new Map);let i=n.get(s);i||(n.set(s,i=new An),i.map=n,i.key=s),i.track()}}function ft(e,t,s,n,i,o){const l=dn.get(e);if(!l){os++;return}const r=a=>{a&&a.trigger()};if(kn(),t==="clear")l.forEach(r);else{const a=U(e),d=a&&$n(s);if(a&&s==="length"){const h=Number(n);l.forEach((b,v)=>{(v==="length"||v===Lt||!Ke(v)&&v>=h)&&r(b)})}else switch((s!==void 0||l.has(void 0))&&r(l.get(s)),d&&r(l.get(Lt)),t){case"add":a?d&&r(l.get("length")):(r(l.get(Mt)),xt(e)&&r(l.get(fn)));break;case"delete":a||(r(l.get(Mt)),xt(e)&&r(l.get(fn)));break;case"set":xt(e)&&r(l.get(Mt));break}}Cn()}function It(e){const t=Y(e);return t===e||(me(t,"iterate",Lt),Me(e))?t:qe(e)?ht(e)?t.map(s=>$t(Ve(s))):t.map($t):t.map(Ve)}function Fs(e){return me(e=Y(e),"iterate",Lt),e}const cl=e=>$t(Ve(e));function ut(e){return qe(e)?ht(e)?cl:$t:Ve}const ul={__proto__:null,[Symbol.iterator](){return Qs(this,Symbol.iterator,ut(this))},concat(...e){return It(this).concat(...e.map(t=>U(t)?It(t):t))},entries(){const e=ut(this);return Qs(this,"entries",t=>(t[1]=e(t[1]),t))},every(e,t){return at(this,"every",e,t,void 0,arguments)},filter(e,t){return at(this,"filter",e,t,s=>s.map(ut(this)),arguments)},find(e,t){return at(this,"find",e,t,s=>ut(this)(s),arguments)},findIndex(e,t){return at(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return at(this,"findLast",e,t,s=>ut(this)(s),arguments)},findLastIndex(e,t){return at(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return at(this,"forEach",e,t,void 0,arguments)},includes(...e){return en(this,"includes",e)},indexOf(...e){return en(this,"indexOf",e)},join(e){return It(this).join(e)},lastIndexOf(...e){return en(this,"lastIndexOf",e)},map(e,t){return at(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Yn(this,"reduce",e,t)},reduceRight(e,...t){return Yn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return at(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return It(this).toReversed()},toSorted(e){return It(this).toSorted(e)},toSpliced(...e){return It(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Qs(this,"values",ut(this))}};function Qs(e,t,s){const n=Fs(e),i=n[t],o=i.call(n);if(n!==e&&!Me(e)){if(o[Symbol.toStringTag]==="Array Iterator"){const l=Object.create(Object.getPrototypeOf(o));return l.next=()=>Xn(o.next(),s),i!==qi[t]&&Object.defineProperties(l,{return:{get(){const r=o.return;return typeof r=="function"?r.bind(o):r}},throw:{get(){const r=o.throw;return typeof r=="function"?r.bind(o):r}}}),l}o._next=o.next,o.next=()=>Xn(o._next(),s)}return o}function Xn(e,t){return e.done||(e.value=t(e.value)),e}const qi=Array.prototype;function at(e,t,s,n,i,o){const l=Fs(e),r=l!==e&&!Me(e),a=l[t];if(a!==qi[t]){const b=a.apply(e,o);return r?Ve(b):b}let d=s;if(l!==e)if(r){const b=ut(e);d=function(v,R){return s.call(this,b(v),R,e)}}else s.length>2&&(d=function(b,v){return s.call(this,b,v,e)});const h=a.call(l,d,n);return r&&i?i(h):h}function Yn(e,t,s,n){const i=Fs(e),o=i!==e&&!Me(e);let l=s,r=!1;if(i!==e)if(o){const d=ut(e);r=n.length===0,l=function(h,b,v){return r&&(r=!1,h=d(h)),s.call(this,h,d(b),v,e)}}else s.length>3&&(l=function(d,h,b){return s.call(this,d,h,b,e)});const a=i[t](l,...n);return r?ut(e)(a):a}function en(e,t,s){const n=Y(e);me(n,"iterate",Lt);const i=n[t](...s);return(i===-1||i===!1)&&On(s[0])?(s[0]=Y(s[0]),n[t](...s)):i}function zt(e,t,s=[]){nt(),kn();const n=Y(e)[t].apply(e,s);return Cn(),it(),n}const dl=xn("__proto__,__v_isRef,__isVue"),Gi=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=Y(this);return me(t,"has",e),t.hasOwnProperty(e)}class zi{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(s==="__v_isReactive")return!i;if(s==="__v_isReadonly")return i;if(s==="__v_isShallow")return o;if(s==="__v_raw")return n===(i?o?wl:Zi:o?Yi:Xi).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const l=U(t);if(!i){let a;if(l&&(a=ul[s]))return a;if(s==="hasOwnProperty")return fl}const r=Reflect.get(t,s,fe(t)?t:n);if((Ke(s)?Gi.has(s):dl(s))||(i||me(t,"get",s),o))return r;if(fe(r)){const a=l&&$n(s)?r:r.value;return i&&Q(a)?hn(a):a}return Q(r)?i?hn(r):Kt(r):r}}class Ji extends zi{constructor(t=!1){super(!1,t)}set(t,s,n,i){let o=t[s];const l=U(t)&&$n(s);if(!this._isShallow){const d=qe(o);if(!Me(n)&&!qe(n)&&(o=Y(o),n=Y(n)),!l&&fe(o)&&!fe(n))return d||(o.value=n),!0}const r=l?Number(s)e,_s=e=>Reflect.getPrototypeOf(e);function bl(e,t,s){return function(...n){const i=this.__v_raw,o=Y(i),l=xt(o),r=e==="entries"||e===Symbol.iterator&&l,a=e==="keys"&&l,d=i[e](...n),h=s?pn:t?$t:Ve;return!t&&me(o,"iterate",a?fn:Mt),de(Object.create(d),{next(){const{value:b,done:v}=d.next();return v?{value:b,done:v}:{value:r?[h(b[0]),h(b[1])]:h(b),done:v}}})}}function ys(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function _l(e,t){const s={get(i){const o=this.__v_raw,l=Y(o),r=Y(i);e||(tt(i,r)&&me(l,"get",i),me(l,"get",r));const{has:a}=_s(l),d=t?pn:e?$t:Ve;if(a.call(l,i))return d(o.get(i));if(a.call(l,r))return d(o.get(r));o!==l&&o.get(i)},get size(){const i=this.__v_raw;return!e&&me(Y(i),"iterate",Mt),i.size},has(i){const o=this.__v_raw,l=Y(o),r=Y(i);return e||(tt(i,r)&&me(l,"has",i),me(l,"has",r)),i===r?o.has(i):o.has(i)||o.has(r)},forEach(i,o){const l=this,r=l.__v_raw,a=Y(r),d=t?pn:e?$t:Ve;return!e&&me(a,"iterate",Mt),r.forEach((h,b)=>i.call(o,d(h),d(b),l))}};return de(s,e?{add:ys("add"),set:ys("set"),delete:ys("delete"),clear:ys("clear")}:{add(i){const o=Y(this),l=_s(o),r=Y(i),a=!t&&!Me(i)&&!qe(i)?r:i;return l.has.call(o,a)||tt(i,a)&&l.has.call(o,i)||tt(r,a)&&l.has.call(o,r)||(o.add(a),ft(o,"add",a,a)),this},set(i,o){!t&&!Me(o)&&!qe(o)&&(o=Y(o));const l=Y(this),{has:r,get:a}=_s(l);let d=r.call(l,i);d||(i=Y(i),d=r.call(l,i));const h=a.call(l,i);return l.set(i,o),d?tt(o,h)&&ft(l,"set",i,o):ft(l,"add",i,o),this},delete(i){const o=Y(this),{has:l,get:r}=_s(o);let a=l.call(o,i);a||(i=Y(i),a=l.call(o,i)),r&&r.call(o,i);const d=o.delete(i);return a&&ft(o,"delete",i,void 0),d},clear(){const i=Y(this),o=i.size!==0,l=i.clear();return o&&ft(i,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(i=>{s[i]=bl(i,e,t)}),s}function En(e,t){const s=_l(e,t);return(n,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_isShallow"?t:i==="__v_raw"?n:Reflect.get(X(s,i)&&i in n?s:n,i,o)}const yl={get:En(!1,!1)},vl={get:En(!1,!0)},xl={get:En(!0,!1)};const Xi=new WeakMap,Yi=new WeakMap,Zi=new WeakMap,wl=new WeakMap;function $l(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Kt(e){return qe(e)?e:Pn(e,!1,hl,yl,Xi)}function Sl(e){return Pn(e,!1,gl,vl,Yi)}function hn(e){return Pn(e,!0,ml,xl,Zi)}function Pn(e,t,s,n,i){if(!Q(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=i.get(e);if(o)return o;const l=$l(Go(e));if(l===0)return e;const r=new Proxy(e,l===2?n:s);return i.set(e,r),r}function ht(e){return qe(e)?ht(e.__v_raw):!!(e&&e.__v_isReactive)}function qe(e){return!!(e&&e.__v_isReadonly)}function Me(e){return!!(e&&e.__v_isShallow)}function On(e){return e?!!e.__v_raw:!1}function Y(e){const t=e&&e.__v_raw;return t?Y(t):e}function kl(e){return!X(e,"__v_skip")&&Object.isExtensible(e)&&Mi(e,"__v_skip",!0),e}const Ve=e=>Q(e)?Kt(e):e,$t=e=>Q(e)?hn(e):e;function fe(e){return e?e.__v_isRef===!0:!1}function ot(e){return Cl(e,!1)}function Cl(e,t){return fe(e)?e:new Tl(e,t)}class Tl{constructor(t,s){this.dep=new An,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:Y(t),this._value=s?t:Ve(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Me(t)||qe(t);t=n?t:Y(t),tt(t,s)&&(this._rawValue=t,this._value=n?t:Ve(t),this.dep.trigger())}}function c(e){return fe(e)?e.value:e}const Al={get:(e,t,s)=>t==="__v_raw"?e:c(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const i=e[t];return fe(i)&&!fe(s)?(i.value=s,!0):Reflect.set(e,t,s,n)}};function Qi(e){return ht(e)?e:new Proxy(e,Al)}class El{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new An(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ne!==this)return Li(this,!0),!0}get value(){const t=this.dep.track();return Hi(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Pl(e,t,s=!1){let n,i;return F(e)?n=e:(n=e.get,i=e.set),new El(n,i,s)}const vs={},As=new WeakMap;let Pt;function Ol(e,t=!1,s=Pt){if(s){let n=As.get(s);n||As.set(s,n=[]),n.push(e)}}function Ml(e,t,s=te){const{immediate:n,deep:i,once:o,scheduler:l,augmentJob:r,call:a,onStop:d}=s,h=W=>i?W:Me(W)||i===!1||i===0?Ze(W,1):Ze(W);let b,v,R,N,C=!1,w=!1;if(fe(e)?(v=()=>e.value,C=Me(e)):ht(e)?(v=()=>h(e),C=!0):U(e)?(w=!0,C=e.some(W=>ht(W)||Me(W)),v=()=>e.map(W=>{if(fe(W))return W.value;if(ht(W))return h(W);if(F(W))return a?a(W,2):W()})):F(e)?t?v=a?()=>a(e,2):e:v=()=>{if(R){nt();try{R()}finally{it()}}const W=Pt;Pt=b;try{return a?a(e,3,[N]):e(N)}finally{Pt=W}}:v=st,t&&i){const W=v,pe=i===!0?1/0:i;v=()=>Ze(W(),w?pe+1:pe)}const z=ji(),K=()=>{b.stop(),z&&z.active&&wn(z.effects,b)};let oe=!1;if(o&&t){const W=t;t=(...pe)=>{oe=!0;try{return W(...pe)}finally{K()}}}let le=w?new Array(e.length).fill(vs):vs;const Te=W=>{if(!(oe||!(b.flags&1)||!b.dirty&&!W))if(t){const pe=b.run();if(W||i||C||(w?pe.some((je,lt)=>tt(je,le[lt])):tt(pe,le))){const je=Pt;nt();try{R&&R(),Pt=b;const lt=[pe,le===vs?void 0:w&&le[0]===vs?[]:le,N];le=pe,a?a(t,3,lt):t(...lt)}finally{Pt=je,it()}}}else b.run()};return r&&r(Te),b=new Di(v),b.scheduler=l?()=>l(Te,!1):Te,N=W=>Ol(W,!1,b),R=b.onStop=()=>{const W=As.get(b);if(W){if(a)a(W,4);else for(const pe of W)pe();As.delete(b)}},d&&(b.onStop=()=>{R(),d()}),t?n?Te(!0):le=b.run():l?l(Te.bind(null,!0),!0):b.run(),K.pause=b.pause.bind(b),K.resume=b.resume.bind(b),K.stop=K,K}function Ze(e,t=1/0,s){if(t<=0||!Q(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,fe(e))Ze(e.value,t,s);else if(U(e))if(ht(e)&&!qe(e)&&!Me(e)){const n=Y(e);me(n,"iterate",Lt);for(let i=0;i{Ze(n,t,s)});else if(Oi(e)){for(const i in e)Ze(e[i],t,s);const n=Y(e);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Ze(e[i],t,s)}return e}function fs(e,t,s,n){try{return n?e(...n):e()}catch(i){Bs(i,t,s)}}function Ge(e,t,s,n){if(F(e)){const i=fs(e,t,s,n);return i&&Ei(i)&&i.catch(o=>{Bs(o,t,s,void 0,!0)}),i}if(U(e)){const i=[];for(let o=0;o>>1,i=$e[n],o=ls(i);o=ls(s)?$e.push(e):$e.splice(Rl(t),0,e),e.flags|=1,so()}}function so(){Es||(Es=eo.then(oo))}function Vl(e){if(!U(e))yt&&e.id===-1?yt.splice(jt+1,0,e):e.flags&1||(Qe.push(e),e.flags|=1);else for(let t=0;t=t))continue;$e.splice(n,1),n=e?n-1:Be,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function io(e,t,s=0){if(Qe.length){let n=Qe,i=0;if(t){n=[];for(let l=0;lls(l)-ls(r));if(Qe.length=i,yt){for(let l=0;le.id==null?e.flags&2?-1:1/0:e.id;function oo(e){try{for(Be=0;Be<$e.length;Be++){const t=$e[Be];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),fs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Be<$e.length;Be++){const t=$e[Be];t&&(t.flags&=-2)}Be=-1,$e.length=0,io(),Es=null,($e.length||Qe.length)&&oo()}}let ge=null,lo=null;function Ps(e){const t=ge;return ge=e,lo=e&&e.type.__scopeId||null,t}function Ie(e,t=ge,s){if(!t||e._n)return e;const n=(...i)=>{n._d&&ui(-1);const o=Ps(t),l=mt.length;let r;try{r=e(...i)}finally{for(let a=mt.length;a>l;a--)In();Ps(o),n._d&&ui(1)}return r};return n._n=!0,n._c=!0,n._d=!0,n}function B(e,t){if(ge===null)return e;const s=Gs(ge),n=e.dirs||(e.dirs=[]);for(let i=0;i1)return s&&F(t)?t.call(n&&n.proxy):t}}const Dl=Symbol.for("v-scx"),Ul=()=>ks(Dl);function Cs(e,t,s){return ro(e,t,s)}function ro(e,t,s=te){const{immediate:n,deep:i,flush:o,once:l}=s,r=de({},s),a=t&&n||!t&&o!=="post";let d;if(us){if(o==="sync"){const N=Ul();d=N.__watcherHandles||(N.__watcherHandles=[])}else if(!a){const N=()=>{};return N.stop=st,N.resume=st,N.pause=st,N}}let h=ye,b;if(h&&ji()!==h.scope)if(h.scope.active){const N=h.scope.run(()=>new Ii);N.run(()=>ll(()=>Promise.resolve().then(()=>{h=null,b&&(b.i=null)}))),r.onStop=()=>N.stop()}else h=null;r.call=(N,C,w)=>Ge(N,h,C,w);let v=!1;o==="post"?r.scheduler=N=>{N.i=h,we(N,h&&h.suspense)}:o!=="sync"&&(v=!0,r.scheduler=(N,C)=>{C?N():Mn(N)}),r.augmentJob=N=>{b=N,t&&(N.flags|=4),v&&(N.flags|=2,h&&(N.id=h.uid,N.i=h))};const R=Ml(e,t,r);return us&&(d?d.push(R):a&&R()),R}function Ll(e,t,s){const n=this.proxy,i=re(e)?e.includes(".")?ao(n,e):()=>n[e]:e.bind(n,n);let o;F(t)?o=t:(o=t.handler,s=t);const l=ps(this),r=ro(i,o.bind(n),s);return l(),r}function ao(e,t){const s=t.split(".");return()=>{let n=e;for(let i=0;ie.__isTeleport,sn=Symbol("_leaveCb");function Bl(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==Ue){t=s;break}}return t}function co(e){if(!Nn(e))return Hs(e.type)&&e.children?Bl(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&F(s.default))return s.default()}}function ts(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const s=e.component.subTree;ts(Hs(s.type)&&co(s)||s,t)}else if(e.shapeFlag&128){const s=e.suspense;if(s){const n=s.isHydrating?s.pendingBranch:s.activeBranch;n&&ts(n,t.clone(n))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===V&&U(e.children)){const s=xo(e.children,!1);s&&ts(s,t)}}function mn(e){if(e.component)return mn(e.component.subTree);if(e.type===V){const t=U(e.children)&&xo(e.children,!1);return t?mn(t):void 0}if(e.type!==Ue)return e}function _e(e,t){return F(e)?de({name:e.name},t,{setup:e}):e}function uo(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Zn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Os=new WeakMap;function ss(e,t,s,n,i=!1){if(U(e)){e.forEach((C,w)=>ss(C,t&&(U(t)?t[w]:t),s,n,i));return}if(Dt(n)&&!i){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&ss(e,t,s,n.component.subTree);return}const o=n.shapeFlag&4?Gs(n.component):n.el,l=i?null:o,{i:r,r:a}=e,d=t&&t.r,h=r.refs===te?r.refs={}:r.refs,b=r.setupState,v=Y(b),R=b===te?Ai:C=>Zn(h,C)?!1:X(v,C),N=(C,w)=>!(w&&Zn(h,w));if(d!=null&&d!==a){if(Qn(t),re(d))h[d]=null,R(d)&&(b[d]=null);else if(fe(d)){const C=t;N(d,C.k)&&(d.value=null),C.k&&(h[C.k]=null)}}if(F(a))fs(a,r,12,[l,h]);else{const C=re(a),w=fe(a);if(C||w){const z=()=>{if(e.f){const K=C?R(a)?b[a]:h[a]:N()||!e.k?a.value:h[e.k];if(i)U(K)&&wn(K,o);else if(U(K))K.includes(o)||K.push(o);else if(C)h[a]=[o],R(a)&&(b[a]=h[a]);else{const oe=[o];N(a,e.k)&&(a.value=oe),e.k&&(h[e.k]=oe)}}else C?(h[a]=l,R(a)&&(b[a]=l)):w&&(N(a,e.k)&&(a.value=l),e.k&&(h[e.k]=l))};if(l){const K=()=>{z(),Os.delete(e)};K.id=-1,Os.set(e,K),we(K,s)}else Qn(e),z()}}}function Qn(e){const t=Os.get(e);t&&(t.flags|=8,Os.delete(e))}Ls().requestIdleCallback;Ls().cancelIdleCallback;const Dt=e=>!!e.type.__asyncLoader,Nn=e=>e.type.__isKeepAlive;function Hl(e,t){fo(e,"a",t)}function Kl(e,t){fo(e,"da",t)}function fo(e,t,s=ye){const n=e.__wdc||(e.__wdc=()=>{let i=s;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(rs(t,n,s),s){let i=s.parent;for(;i&&i.parent;)Nn(i.parent.vnode)&&Wl(n,t,s,i),i=i.parent}}function Wl(e,t,s,n){const i=rs(t,e,n,!0),o=rs("um",()=>wn(n[t],i),s);o.flags=16}function rs(e,t,s=ye,n=!1){if(s){const i=s[e]||(s[e]=[]),o=t.__weh||(t.__weh=(...l)=>{nt();const r=ps(s),a=Ge(t,s,e,l);return r(),it(),a});return n?i.unshift(o):i.push(o),o}}const _t=e=>(t,s=ye)=>{(!us||e==="sp")&&rs(e,(...n)=>t(...n),s)},ql=_t("bm"),po=_t("m"),Gl=_t("bu"),zl=_t("u"),Jl=_t("bum"),Xl=_t("um"),Yl=_t("sp"),Zl=_t("rtg"),Ql=_t("rtc");function er(e,t=ye){rs("ec",e,t)}const tr="components",ho=Symbol.for("v-ndc");function ei(e){return re(e)?sr(tr,e,!1)||e:e||ho}function sr(e,t,s=!0,n=!1){const i=ge||ye;if(i){const o=i.type;{const r=Lr(o,!1);if(r&&(r===t||r===Se(t)||r===Us(Se(t))))return o}const l=ti(i[e]||o[e],t)||ti(i.appContext[e],t);return!l&&n?o:l}}function ti(e,t){return e&&(e[t]||e[Se(t)]||e[Us(Se(t))])}function H(e,t,s,n){let i;const o=s,l=U(e);if(l||re(e)){const r=l&&ht(e);let a=!1,d=!1;r&&(a=!Me(e),d=qe(e),e=Fs(e)),i=new Array(e.length);for(let h=0,b=e.length;ht(r,a,void 0,o));else{const r=Object.keys(e);i=new Array(r.length);for(let a=0,d=r.length;a0;return g(),ke(V,null,[Ne("slot",d,n)],h?-2:64)}let l=e[t];l&&l._c&&(l._d=!1);const r=mt.length;g();let a;try{const d=l&&go(l(s)),h=s.key||o||d&&d.key;a=ke(V,{key:(h&&!Ke(h)?h:`_${t}`)+(!d&&n?"_fb":"")},d||(n?n():[]),d&&e._===1?64:-2)}catch(d){for(let h=mt.length;h>r;h--)In();throw d}finally{l&&l._c&&(l._d=!0)}return a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),a}function go(e){return e.some(t=>qs(t)?!(t.type===Ue||t.type===V&&!go(t.children)):!0)?e:null}const gn=e=>e?Do(e)?Gs(e):gn(e.parent):null,ns=de(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=>gn(e.parent),$root:e=>gn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>_o(e),$forceUpdate:e=>e.f||(e.f=()=>{Mn(e.update)}),$nextTick:e=>e.n||(e.n=to.bind(e.proxy)),$watch:e=>Ll.bind(e)}),nn=(e,t)=>e!==te&&!e.__isScriptSetup&&X(e,t),nr={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:i,props:o,accessCache:l,type:r,appContext:a}=e;if(t[0]!=="$"){const v=l[t];if(v!==void 0)switch(v){case 1:return n[t];case 2:return i[t];case 4:return s[t];case 3:return o[t]}else{if(nn(n,t))return l[t]=1,n[t];if(i!==te&&X(i,t))return l[t]=2,i[t];if(X(o,t))return l[t]=3,o[t];if(s!==te&&X(s,t))return l[t]=4,s[t];bn&&(l[t]=0)}}const d=ns[t];let h,b;if(d)return t==="$attrs"&&me(e.attrs,"get",""),d(e);if((h=r.__cssModules)&&(h=h[t]))return h;if(s!==te&&X(s,t))return l[t]=4,s[t];if(b=a.config.globalProperties,X(b,t))return b[t]},set({_:e},t,s){const{data:n,setupState:i,ctx:o}=e;return nn(i,t)?(i[t]=s,!0):n!==te&&X(n,t)?(n[t]=s,!0):X(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:i,props:o,type:l}},r){let a;return!!(s[r]||e!==te&&r[0]!=="$"&&X(e,r)||nn(t,r)||X(o,r)||X(n,r)||X(ns,r)||X(i.config.globalProperties,r)||(a=l.__cssModules)&&a[r])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:X(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function si(e){return U(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let bn=!0;function ir(e){const t=_o(e),s=e.proxy,n=e.ctx;bn=!1,t.beforeCreate&&ni(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:l,watch:r,provide:a,inject:d,created:h,beforeMount:b,mounted:v,beforeUpdate:R,updated:N,activated:C,deactivated:w,beforeDestroy:z,beforeUnmount:K,destroyed:oe,unmounted:le,render:Te,renderTracked:W,renderTriggered:pe,errorCaptured:je,serverPrefetch:lt,expose:kt,inheritAttrs:Wt,components:hs,directives:ms,filters:Js}=t;if(d&&or(d,n,null),l)for(const ae in l){const se=l[ae];F(se)&&(n[ae]=se.bind(s))}if(i){const ae=i.call(s,s);Q(ae)&&(e.data=Kt(ae))}if(bn=!0,o)for(const ae in o){const se=o[ae],Ct=F(se)?se.bind(s,s):F(se.get)?se.get.bind(s,s):st,gs=!F(se)&&F(se.set)?se.set.bind(s):st,Tt=vt({get:Ct,set:gs});Object.defineProperty(n,ae,{enumerable:!0,configurable:!0,get:()=>Tt.value,set:Le=>Tt.value=Le})}if(r)for(const ae in r)bo(r[ae],n,s,ae);if(a){const ae=F(a)?a.call(s):a;Reflect.ownKeys(ae).forEach(se=>{jl(se,ae[se])})}h&&ni(h,e,"c");function ve(ae,se){U(se)?se.forEach(Ct=>ae(Ct.bind(s))):se&&ae(se.bind(s))}if(ve(ql,b),ve(po,v),ve(Gl,R),ve(zl,N),ve(Hl,C),ve(Kl,w),ve(er,je),ve(Ql,W),ve(Zl,pe),ve(Jl,K),ve(Xl,le),ve(Yl,lt),U(kt))if(kt.length){const ae=e.exposed||(e.exposed={});kt.forEach(se=>{Object.defineProperty(ae,se,{get:()=>s[se],set:Ct=>s[se]=Ct,enumerable:!0})})}else e.exposed||(e.exposed={});Te&&e.render===st&&(e.render=Te),Wt!=null&&(e.inheritAttrs=Wt),hs&&(e.components=hs),ms&&(e.directives=ms),lt&&uo(e)}function or(e,t,s=st){U(e)&&(e=_n(e));for(const n in e){const i=e[n];let o;Q(i)?"default"in i?o=ks(i.from||n,i.default,!0):o=ks(i.from||n):o=ks(i),fe(o)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>o.value,set:l=>o.value=l}):t[n]=o}}function ni(e,t,s){Ge(U(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function bo(e,t,s,n){let i=n.includes(".")?ao(s,n):()=>s[n];if(re(e)){const o=t[e];F(o)&&Cs(i,o)}else if(F(e))Cs(i,e.bind(s));else if(Q(e))if(U(e))e.forEach(o=>bo(o,t,s,n));else{const o=F(e.handler)?e.handler.bind(s):t[e.handler];F(o)&&Cs(i,o,e)}}function _o(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:l}}=e.appContext,r=o.get(t);let a;return r?a=r:!i.length&&!s&&!n?a=t:(a={},i.length&&i.forEach(d=>Ms(a,d,l,!0)),Ms(a,t,l)),Q(t)&&o.set(t,a),a}function Ms(e,t,s,n=!1){const{mixins:i,extends:o}=t;o&&Ms(e,o,s,!0),i&&i.forEach(l=>Ms(e,l,s,!0));for(const l in t)if(!(n&&l==="expose")){const r=lr[l]||s&&s[l];e[l]=r?r(e[l],t[l]):t[l]}return e}const lr={data:ii,props:oi,emits:oi,methods:Xt,computed:Xt,beforeCreate:xe,created:xe,beforeMount:xe,mounted:xe,beforeUpdate:xe,updated:xe,beforeDestroy:xe,beforeUnmount:xe,destroyed:xe,unmounted:xe,activated:xe,deactivated:xe,errorCaptured:xe,serverPrefetch:xe,components:Xt,directives:Xt,watch:ar,provide:ii,inject:rr};function ii(e,t){return t?e?function(){return de(F(e)?e.call(this,this):e,F(t)?t.call(this,this):t)}:t:e}function rr(e,t){return Xt(_n(e),_n(t))}function _n(e){if(U(e)){const t={};for(let s=0;st==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Se(t)}Modifiers`]||e[`${Vt(t)}Modifiers`];function fr(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||te;let i=s;const o=t.startsWith("update:"),l=o&&dr(n,t.slice(7));l&&(l.trim&&(i=s.map(h=>re(h)?h.trim():h)),l.number&&(i=i.map(ds)));let r,a=n[r=Xs(t)]||n[r=Xs(Se(t))];!a&&o&&(a=n[r=Xs(Vt(t))]),a&&Ge(a,e,6,i);const d=n[r+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,Ge(d,e,6,i)}}const pr=new WeakMap;function vo(e,t,s=!1){const n=s?pr:t.emitsCache,i=n.get(e);if(i!==void 0)return i;const o=e.emits;let l={},r=!1;if(!F(e)){const a=d=>{const h=vo(d,t,!0);h&&(r=!0,de(l,h))};!s&&t.mixins.length&&t.mixins.forEach(a),e.extends&&a(e.extends),e.mixins&&e.mixins.forEach(a)}return!o&&!r?(Q(e)&&n.set(e,null),null):(U(o)?o.forEach(a=>l[a]=null):de(l,o),Q(e)&&n.set(e,l),l)}function Ks(e,t){return!e||!Is(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),X(e,t[0].toLowerCase()+t.slice(1))||X(e,Vt(t))||X(e,t))}function li(e){const{type:t,vnode:s,proxy:n,withProxy:i,propsOptions:[o],slots:l,attrs:r,emit:a,render:d,renderCache:h,props:b,data:v,setupState:R,ctx:N,inheritAttrs:C}=e,w=Ps(e);let z,K;try{if(s.shapeFlag&4){const le=i||n,Te=le;z=et(d.call(Te,le,h,b,R,v,N)),K=r}else{const le=t;z=et(le.length>1?le(b,{attrs:r,slots:l,emit:a}):le(b,null)),K=t.props?r:hr(r)}}catch(le){mt.length=0,Bs(le,e,1),z=Ne(Ue)}let oe=z;if(K&&C!==!1){const le=Object.keys(K),{shapeFlag:Te}=oe;le.length&&Te&7&&(o&&le.some(js)&&(K=mr(K,o)),oe=Ft(oe,K,!1,!0))}if(s.dirs&&(oe=Ft(oe,null,!1,!0),oe.dirs=oe.dirs?oe.dirs.concat(s.dirs):s.dirs),s.transition){const le=Hs(oe.type)&&co(oe)||oe;ts(le,s.transition)}return z=oe,Ps(w),z}function xo(e,t=!0){let s;for(let n=0;n{let t;for(const s in e)(s==="class"||s==="style"||Is(s))&&((t||(t={}))[s]=e[s]);return t},mr=(e,t)=>{const s={};for(const n in e)(!js(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function gr(e,t,s){const{props:n,children:i,component:o}=e,{props:l,children:r,patchFlag:a}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&a>=0){if(a&1024)return!0;if(a&16)return n?ri(n,l,d):!!l;if(a&8){const h=t.dynamicProps;for(let b=0;bObject.create($o),ko=e=>Object.getPrototypeOf(e)===$o;function _r(e,t,s,n=!1){const i={},o=So();e.propsDefaults=Object.create(null),Co(e,t,i,o);for(const l in e.propsOptions[0])l in i||(i[l]=void 0);s?e.props=n?i:Sl(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function yr(e,t,s,n){const{props:i,attrs:o,vnode:{patchFlag:l}}=e,r=Y(i),[a]=e.propsOptions;let d=!1;if((n||l>0)&&!(l&16)){if(l&8){const h=e.vnode.dynamicProps;for(let b=0;b{a=!0;const[v,R]=To(b,t,!0);de(l,v),R&&r.push(...R)};!s&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!o&&!a)return Q(e)&&n.set(e,Ot),Ot;if(U(o))for(let h=0;he==="_"||e==="_ctx"||e==="$stable",Vn=e=>U(e)?e.map(et):[et(e)],xr=(e,t,s)=>{if(t._n)return t;const n=Ie((...i)=>Vn(t(...i)),s);return n._c=!1,n},Ao=(e,t,s)=>{const n=e._ctx;for(const i in e){if(Rn(i))continue;const o=e[i];if(F(o))t[i]=xr(i,o,n);else if(o!=null){const l=Vn(o);t[i]=()=>l}}},Eo=(e,t)=>{const s=Vn(t);e.slots.default=()=>s},Po=(e,t,s)=>{for(const n in t)(s||!Rn(n))&&(e[n]=t[n])},wr=(e,t,s)=>{const n=e.slots=So();if(e.vnode.shapeFlag&32){const i=t._;i?(Po(n,t,s),s&&Mi(n,"_",i,!0)):Ao(t,n)}else t&&Eo(e,t)},$r=(e,t,s)=>{const{vnode:n,slots:i}=e;let o=!0,l=te;if(n.shapeFlag&32){const r=t._;r?s&&r===1?o=!1:Po(i,t,s):(o=!t.$stable,Ao(t,i)),l=t}else t&&(Eo(e,t),l={default:1});if(o)for(const r in i)!Rn(r)&&l[r]==null&&delete i[r]},we=Er;function Sr(e){return kr(e)}function kr(e,t){const s=Ls();s.__VUE__=!0;const{insert:n,remove:i,patchProp:o,createElement:l,createText:r,createComment:a,setText:d,setElementText:h,parentNode:b,nextSibling:v,setScopeId:R=st,insertStaticContent:N}=e,C=(f,m,x,T=null,$=null,k=null,P=void 0,E=null,A=!!m.dynamicChildren)=>{if(f===m)return;f&&!Jt(f,m)&&(T=bs(f),Le(f,$,k,!0),f=null),m.patchFlag===-2&&(A=!1,m.dynamicChildren=null),m.dynamicChildren&&f&&f.dynamicChildren&&f.dynamicChildren.hasOnce&&(m.dynamicChildren===Ot&&(m.dynamicChildren=[]),m.dynamicChildren.hasOnce=!0);const{type:S,ref:j,shapeFlag:O}=m;switch(S){case Ws:w(f,m,x,T);break;case Ue:z(f,m,x,T);break;case ln:f==null&&K(m,x,T,P);break;case V:hs(f,m,x,T,$,k,P,E,A);break;default:O&1?Te(f,m,x,T,$,k,P,E,A):O&6?ms(f,m,x,T,$,k,P,E,A):(O&64||O&128)&&S.process(f,m,x,T,$,k,P,E,A,Gt)}j!=null&&$?ss(j,f&&f.ref,k,m||f,!m):j==null&&f&&f.ref!=null&&ss(f.ref,null,k,f,!0)},w=(f,m,x,T)=>{if(f==null)n(m.el=r(m.children),x,T);else{const $=m.el=f.el;m.children!==f.children&&d($,m.children)}},z=(f,m,x,T)=>{f==null?n(m.el=a(m.children||""),x,T):m.el=f.el},K=(f,m,x,T)=>{[f.el,f.anchor]=N(f.children,m,x,T,f.el,f.anchor)},oe=({el:f,anchor:m},x,T)=>{let $;for(;f&&f!==m;)$=v(f),n(f,x,T),f=$;n(m,x,T)},le=({el:f,anchor:m})=>{let x;for(;f&&f!==m;)x=v(f),i(f),f=x;i(m)},Te=(f,m,x,T,$,k,P,E,A)=>{if(m.type==="svg"?P="svg":m.type==="math"&&(P="mathml"),f==null)W(m,x,T,$,k,P,E,A);else{const S=f.el&&f.el._isVueCE?f.el:null;try{S&&S._beginPatch(),lt(f,m,$,k,P,E,A)}finally{S&&S._endPatch()}}},W=(f,m,x,T,$,k,P,E)=>{let A,S;const{props:j,shapeFlag:O,transition:D,dirs:L}=f;if(A=f.el=l(f.type,k,j&&j.is,j),O&8?h(A,f.children):O&16&&je(f.children,A,null,T,$,on(f,k),P,E),L&&At(f,null,T,"created"),pe(A,f,f.scopeId,P,T),j){for(const ee in j)ee!=="value"&&!Zt(ee)&&o(A,ee,null,j[ee],k,T);"value"in j&&o(A,"value",null,j.value,k),(S=j.onVnodeBeforeMount)&&Ye(S,T,f)}L&&At(f,null,T,"beforeMount");const J=Cr($,D);J?D.beforeEnter(A):D&&!D.persisted&&(A[Ar]=!0),n(A,m,x),((S=j&&j.onVnodeMounted)||J||L)&&we(()=>{S&&Ye(S,T,f),J&&D.enter(A),L&&At(f,null,T,"mounted")},$)},pe=(f,m,x,T,$)=>{if(x&&R(f,x),T)for(let k=0;k{for(let S=A;S{const E=m.el=f.el;let{patchFlag:A,dynamicChildren:S,dirs:j}=m;A|=f.patchFlag&16;const O=f.props||te,D=m.props||te;let L;if(x&&Et(x,!1),(L=D.onVnodeBeforeUpdate)&&Ye(L,x,m,f),j&&At(m,f,x,"beforeUpdate"),x&&Et(x,!0),S&&(!f.dynamicChildren||f.dynamicChildren.length!==S.length)&&(A=0,P=!1,S=null),(O.innerHTML&&D.innerHTML==null||O.textContent&&D.textContent==null)&&h(E,""),S?kt(f.dynamicChildren,S,E,x,T,on(m,$),k):P||se(f,m,E,null,x,T,on(m,$),k,!1),A>0){if(A&16)Wt(E,O,D,x,$);else if(A&2&&O.class!==D.class&&o(E,"class",null,D.class,$),A&4&&o(E,"style",O.style,D.style,$),A&8){const J=m.dynamicProps;for(let ee=0;ee{L&&Ye(L,x,m,f),j&&At(m,f,x,"updated")},T)},kt=(f,m,x,T,$,k,P)=>{for(let E=0;E{if(m!==x){if(m!==te)for(const k in m)!Zt(k)&&!(k in x)&&o(f,k,m[k],null,$,T);for(const k in x){if(Zt(k))continue;const P=x[k],E=m[k];P!==E&&k!=="value"&&o(f,k,E,P,$,T)}"value"in x&&o(f,"value",m.value,x.value,$)}},hs=(f,m,x,T,$,k,P,E,A)=>{const S=m.el=f?f.el:r(""),j=m.anchor=f?f.anchor:r("");let{patchFlag:O,dynamicChildren:D,slotScopeIds:L}=m;L&&(E=E?E.concat(L):L),f==null?(n(S,x,T),n(j,x,T),je(m.children||[],x,j,$,k,P,E,A)):O>0&&O&64&&D&&f.dynamicChildren&&f.dynamicChildren.length===D.length?(kt(f.dynamicChildren,D,x,$,k,P,E),(m.key!=null||$&&m===$.subTree)&&Oo(f,m,!0)):se(f,m,x,j,$,k,P,E,A)},ms=(f,m,x,T,$,k,P,E,A)=>{m.slotScopeIds=E,f==null?m.shapeFlag&512?$.ctx.activate(m,x,T,P,A):Js(m,x,T,$,k,P,A):jn(f,m,A)},Js=(f,m,x,T,$,k,P)=>{const E=f.component=Rr(f,T,$);if(Nn(f)&&(E.ctx.renderer=Gt),Ir(E,!1,P),E.asyncDep){if($&&$.registerDep(E,ve,P,k),!f.el){const A=E.subTree=Ne(Ue);z(null,A,m,x),f.placeholder=A.el}}else ve(E,f,m,x,$,k,P)},jn=(f,m,x)=>{const T=m.component=f.component;if(gr(f,m,x))if(T.asyncDep&&!T.asyncResolved){m.el=f.el,m.placeholder=f.placeholder,ae(T,m,x);return}else T.next=m,T.update();else m.el=f.el,m.placeholder=f.placeholder,T.vnode=m},ve=(f,m,x,T,$,k,P)=>{const E=()=>{if(f.isMounted){let{next:O,bu:D,u:L,parent:J,vnode:ee}=f;{const Je=Mo(f);if(Je){O&&(O.el=ee.el,ae(f,O,P)),Je.asyncDep.then(()=>{const rt=()=>{f.job.flags&8||($&&$.pendingBranch?we(rt,$):S())};rt.flags=48,we(rt,$)});return}}let Z=O,ce;Et(f,!1),O?(O.el=ee.el,ae(f,O,P)):O=ee,D&&Ss(D),(ce=O.props&&O.props.onVnodeBeforeUpdate)&&Ye(ce,J,O,ee),Et(f,!0);const he=li(f),Fe=f.subTree;f.subTree=he,C(Fe,he,b(Fe.el||is(Fe)),bs(Fe),f,$,k),O.el=he.el,Z===null&&br(f,he.el),L&&we(L,$),(ce=O.props&&O.props.onVnodeUpdated)&&we(()=>Ye(ce,J,O,ee),$)}else{let O;const{el:D,props:L}=m,{bm:J,m:ee,parent:Z,root:ce,type:he}=f,Fe=Dt(m);Et(f,!1),J&&Ss(J),!Fe&&(O=L&&L.onVnodeBeforeMount)&&Ye(O,Z,m),Et(f,!0);{ce.ce&&ce.ce._hasShadowRoot()&&ce.ce._injectChildStyle(he,f.parent?f.parent.type:void 0);const Je=f.subTree=li(f);C(null,Je,x,T,f,$,k),m.el=Je.el}if(ee&&we(ee,$),!Fe&&(O=L&&L.onVnodeMounted)){const Je=m;we(()=>Ye(O,Z,Je),$)}(m.shapeFlag&256||Z&&Dt(Z.vnode)&&Z.vnode.shapeFlag&256)&&f.a&&we(f.a,$),f.isMounted=!0,m=x=T=null}};f.scope.on();const A=f.effect=new Di(E);f.scope.off();const S=f.update=A.run.bind(A),j=f.job=A.runIfDirty.bind(A);j.i=f,j.id=f.uid,A.scheduler=()=>Mn(j),Et(f,!0),S()},ae=(f,m,x)=>{m.component=f;const T=f.vnode.props;f.vnode=m,f.next=null,yr(f,m.props,T,x),$r(f,m.children,x),nt(),no(f),it()},se=(f,m,x,T,$,k,P,E,A=!1)=>{const S=f&&f.children,j=f?f.shapeFlag:0,O=m.children,{patchFlag:D,shapeFlag:L}=m;if(D>0){if(D&128){gs(S,O,x,T,$,k,P,E,A);return}else if(D&256){Ct(S,O,x,T,$,k,P,E,A);return}}L&8?(j&16&&qt(S,$,k),O!==S&&h(x,O)):j&16?L&16?gs(S,O,x,T,$,k,P,E,A):qt(S,$,k,!0):(j&8&&h(x,""),L&16&&je(O,x,T,$,k,P,E,A))},Ct=(f,m,x,T,$,k,P,E,A)=>{f=f||Ot,m=m||Ot;const S=f.length,j=m.length,O=Math.min(S,j);let D;for(D=0;Dj?qt(f,$,k,!0,!1,O):je(m,x,T,$,k,P,E,A,O)},gs=(f,m,x,T,$,k,P,E,A)=>{let S=0;const j=m.length;let O=f.length-1,D=j-1;for(;S<=O&&S<=D;){const L=f[S],J=m[S]=A?dt(m[S]):et(m[S]);if(Jt(L,J))C(L,J,x,null,$,k,P,E,A);else break;S++}for(;S<=O&&S<=D;){const L=f[O],J=m[D]=A?dt(m[D]):et(m[D]);if(Jt(L,J))C(L,J,x,null,$,k,P,E,A);else break;O--,D--}if(S>O){if(S<=D){const L=D+1,J=LD)for(;S<=O;)Le(f[S],$,k,!0),S++;else{const L=S,J=S,ee=new Map;for(S=J;S<=D;S++){const Ee=m[S]=A?dt(m[S]):et(m[S]);Ee.key!=null&&ee.set(Ee.key,S)}let Z,ce=0;const he=D-J+1;let Fe=!1,Je=0;const rt=new Array(he);for(S=0;S=he){Le(Ee,$,k,!0);continue}let Xe;if(Ee.key!=null)Xe=ee.get(Ee.key);else for(Z=J;Z<=D;Z++)if(rt[Z-J]===0&&Jt(Ee,m[Z])){Xe=Z;break}Xe===void 0?Le(Ee,$,k,!0):(rt[Xe-J]=S+1,Xe>=Je?Je=Xe:Fe=!0,C(Ee,m[Xe],x,null,$,k,P,E,A),ce++)}const Fn=Fe?Tr(rt):Ot;for(Z=Fn.length-1,S=he-1;S>=0;S--){const Ee=J+S,Xe=m[Ee],Bn=m[Ee+1],Hn=Ee+1{const{el:k,type:P,transition:E,children:A,shapeFlag:S}=f;if(S&6){Tt(f.component.subTree,m,x,T);return}if(S&128){f.suspense.move(m,x,T);return}if(S&64){P.move(f,m,x,Gt);return}if(P===V){n(k,m,x);for(let O=0;OE.enter(k),$));else{const{leave:O,delayLeave:D,afterLeave:L}=E,J=()=>{f.ctx.isUnmounted?i(k):n(k,m,x)},ee=()=>{const Z=k._isLeaving||!!k[sn];k._isLeaving&&k[sn](!0),E.persisted&&!Z?J():O(k,()=>{J(),L&&L()})};D?D(k,J,ee):ee()}else n(k,m,x)},Le=(f,m,x,T=!1,$=!1)=>{const{type:k,props:P,ref:E,children:A,dynamicChildren:S,shapeFlag:j,patchFlag:O,dirs:D,cacheIndex:L,memo:J}=f;if((O===-2||S&&S.hasOnce)&&($=!1),E!=null&&(nt(),ss(E,null,x,f,!0),it()),L!=null&&(!f.ctx||f.ctx===m)&&(m.renderCache[L]=void 0),j&256&&m.ctx.deactivate(f))return;const ee=j&1&&D,Z=!Dt(f);let ce;if(Z&&(ce=P&&P.onVnodeBeforeUnmount)&&Ye(ce,m,f),j&6)Wo(f.component,x,T);else{if(j&128){f.suspense.unmount(x,T);return}ee&&At(f,null,m,"beforeUnmount"),j&64?f.type.remove(f,m,x,Gt,T):S&&!S.hasOnce&&(k!==V||O>0&&O&64)?qt(S,m,x,!1,!0):(k===V&&O&384||!$&&j&16)&&qt(A,m,x),T&&Dn(f)}const he=J!=null&&L==null;(Z&&(ce=P&&P.onVnodeUnmounted)||ee||he)&&we(()=>{ce&&Ye(ce,m,f),ee&&At(f,null,m,"unmounted"),he&&(f.el=null)},x)},Dn=f=>{const{type:m,el:x,anchor:T,transition:$}=f,k=m===V;if(k&&!$){Un(x,T);return}if(m===ln){le(f),$&&!$.persisted&&$.afterLeave&&$.afterLeave();return}const P=k?mn(f):f,E=()=>{k?b(x)&&Un(x,T):i(x),$&&!$.persisted&&$.afterLeave&&$.afterLeave()};if(P&&P.shapeFlag&1&&$&&!$.persisted){const{leave:A,delayLeave:S}=$,j=P.el,O=()=>A(j,E);S?S(j,E,O):O()}else E()},Un=(f,m)=>{let x;for(;f!==m;)x=v(f),i(f),f=x;i(m)},Wo=(f,m,x)=>{const{bum:T,scope:$,job:k,subTree:P,um:E,m:A,a:S}=f;ci(A),ci(S),T&&Ss(T),$.stop(),k?(k.flags|=8,Le(P,f,m,x)):P&&(P.transition=f.vnode.transition,Le(P,f,m,x)),E&&we(E,m);const j=()=>{f.isUnmounted=!0};j.flags=16,we(j,m)},qt=(f,m,x,T=!1,$=!1,k=0)=>{for(let P=k;P{if(f.shapeFlag&6)return bs(f.component.subTree);if(f.shapeFlag&128)return f.suspense.next();const m=v(f.anchor||f.el),x=m&&m[Fl];return x?v(x):m},Ln=(f,m,x)=>{const T=f&&m._vnode?void 0:f&&f.component?f.component.uid:Nr();Il(()=>{f==null?m._vnode&&Le(m._vnode,null,null,!0):C(m._vnode||null,f,m,null,null,null,x),m._vnode=f},T)},Gt={p:C,um:Le,m:Tt,r:Dn,mt:Js,mc:je,pc:se,pbc:kt,n:bs,o:e};return{render:Ln,hydrate:void 0,createApp:ur(Ln)}}function on({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function Et({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Cr(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Oo(e,t,s=!1){const n=e.children,i=t.children;if(U(n)&&U(i))for(let o=0;o>1,e[s[r]]0&&(t[n]=s[o-1]),s[o]=n)}}for(o=s.length,l=s[o-1];o-- >0;)s[o]=l,l=t[l];return s}function Mo(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Mo(t)}function ci(e){if(e)for(let t=0;te.__isSuspense,Ar=Symbol("_deferredEnter");function Er(e,t){t&&t.pendingBranch?U(e)?t.effects.push(...e):t.effects.push(e):Vl(e)}const V=Symbol.for("v-fgt"),Ws=Symbol.for("v-txt"),Ue=Symbol.for("v-cmt"),ln=Symbol.for("v-stc"),mt=[];let Pe=null;function g(e=!1){mt.push(Pe=e?null:[])}function In(){mt.pop(),Pe=mt[mt.length-1]||null}let as=1;function ui(e,t=!1){as+=e,e<0&&Pe&&t&&(Pe.hasOnce=!0)}function Ro(e){return e.dynamicChildren=as>0?Pe||Ot:null,In(),as>0&&Pe&&Pe.push(e),e}function y(e,t,s,n,i,o){return Ro(u(e,t,s,n,i,o,!0))}function ke(e,t,s,n,i){return Ro(Ne(e,t,s,n,i,!0))}function qs(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const Vo=({key:e})=>e??null,Ts=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?re(e)||fe(e)||F(e)?{i:ge,r:e,k:t,f:!!s}:e:null);function u(e,t=null,s=null,n=0,i=null,o=e===V?0:1,l=!1,r=!1){const a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Vo(t),ref:t&&Ts(t),scopeId:lo,slotScopeIds:null,children:s,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:n,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ge};return r?(Ns(a,s),o&128&&e.normalize(a)):s&&(a.shapeFlag|=re(s)?8:16),as>0&&!l&&Pe&&(a.patchFlag>0||o&6)&&a.patchFlag!==32&&Pe.push(a),a}const Ne=Pr;function Pr(e,t=null,s=null,n=0,i=null,o=!1){if((!e||e===ho)&&(e=Ue),qs(e)){const r=Ft(e,t,!0);return s&&Ns(r,s),as>0&&!o&&Pe&&(r.shapeFlag&6?Pe[Pe.indexOf(e)]=r:Pe.push(r)),r.patchFlag=-2,r}if(Fr(e)&&(e=e.__vccOpts),t){t=Or(t);let{class:r,style:a}=t;r&&!re(r)&&(t.class=Ce(r)),Q(a)&&(On(a)&&!U(a)&&(a=de({},a)),t.style=wt(a))}const l=re(e)?1:No(e)?128:Hs(e)?64:Q(e)?4:F(e)?2:0;return u(e,t,s,n,i,l,o,!0)}function Or(e){return e?On(e)?de({},e):ko(e)?de({},e[Lo]||e):e:null}function Ft(e,t,s=!1,n=!1){const{props:i,ref:o,patchFlag:l,children:r,transition:a}=e,d=t?Io(i||{},t):i,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Vo(d),ref:t&&t.ref?s&&o?U(o)?o.concat(Ts(t)):[o,Ts(t)]:Ts(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==V?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ft(e.ssContent),ssFallback:e.ssFallback&&Ft(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return a&&n&&ts(h,a.clone(h)),h}function q(e=" ",t=0){return Ne(Ws,null,e,t)}function M(e="",t=!1){return t?(g(),ke(Ue,null,e)):Ne(Ue,null,e)}function et(e){return e==null||typeof e=="boolean"?Ne(Ue):U(e)?Ne(V,null,e.slice()):qs(e)?dt(e):Ne(Ws,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ft(e)}function Ns(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(U(t))s=16;else if(typeof t=="object")if(n&65){const i=t.default;i&&(i._c&&(i._d=!1),Ns(e,i()),i._c&&(i._d=!0));return}else{s=32;const i=t._;!i&&!ko(t)?t._ctx=ge:i===3&&ge&&(ge.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(F(t)){if(n&65){Ns(e,{default:t});return}t={default:t,_ctx:ge},s=32}else t=String(t),n&64?(s=16,t=[q(t)]):s=8;e.children=t,e.shapeFlag|=s}function Io(...e){const t={};for(let s=0;sye||ge;let Rs,cs;{const e=Ls(),t=(s,n)=>{let i;return(i=e[s])||(i=e[s]=[]),i.push(n),o=>{i.length>1?i.forEach(l=>l(o)):i[0](o)}};Rs=t("__VUE_INSTANCE_SETTERS__",s=>ye=s),cs=t("__VUE_SSR_SETTERS__",s=>us=s)}const ps=e=>{const t=ye;return Rs(e),e.scope.on(),()=>{e.scope.off(),Rs(t)}},di=()=>{ye&&ye.scope.off(),Rs(null)};function Do(e){return e.vnode.shapeFlag&4}let us=!1;function Ir(e,t=!1,s=!1){t&&cs(t);const{props:n,children:i}=e.vnode,o=Do(e);_r(e,n,o,t),wr(e,i,s||t);const l=o?jr(e,t):void 0;return t&&cs(!1),l}function jr(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,nr);const{setup:n}=s;if(n){nt();const i=e.setupContext=n.length>1?Ur(e):null,o=ps(e),l=fs(n,e,0,[e.props,i]),r=Ei(l);if(it(),o(),(r||e.sp)&&!Dt(e)&&uo(e),r){if(l.then(di,di),t)return l.then(a=>{cs(!0);try{fi(e,a,t)}finally{cs(!1)}}).catch(a=>{Bs(a,e,0,void 0,!0),e.ssrRender=(d,h)=>h("")});e.asyncDep=l}else fi(e,l)}else Uo(e)}function fi(e,t,s){F(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Q(t)&&(e.setupState=Qi(t)),Uo(e)}function Uo(e,t,s){const n=e.type;e.render||(e.render=n.render||st);{const i=ps(e);nt();try{ir(e)}finally{it(),i()}}}const Lo=Symbol(),Dr={get(e,t){return me(e,"get",""),t===Lo?e:e[t]}};function Ur(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Dr),slots:e.slots,emit:e.emit,expose:t}}function Gs(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Qi(kl(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in ns)return ns[s](e)},has(t,s){return s in t||s in ns}})):e.proxy}function Lr(e,t=!0){return F(e)?e.displayName||e.name:e.name||t&&e.__name}function Fr(e){return F(e)&&"__vccOpts"in e}const vt=(e,t)=>Pl(e,t,us),Br="3.5.47";let vn;const pi=typeof window<"u"&&window.trustedTypes;if(pi)try{vn=pi.createPolicy("vue",{createHTML:e=>e})}catch{}const Fo=vn?e=>vn.createHTML(e):e=>e,Hr="http://www.w3.org/2000/svg",Kr="http://www.w3.org/1998/Math/MathML",ct=typeof document<"u"?document:null,hi=ct&&ct.createElement("template"),Wr={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const i=t==="svg"?ct.createElementNS(Hr,e):t==="mathml"?ct.createElementNS(Kr,e):s?ct.createElement(e,{is:s}):ct.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>ct.createTextNode(e),createComment:e=>ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ct.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,i,o){const l=s?s.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),s),!(i===o||!(i=i.nextSibling)););else{hi.innerHTML=Fo(n==="svg"?`${e}`:n==="mathml"?`${e}`:e);const r=hi.content;if(n==="svg"||n==="mathml"){const a=r.firstChild;for(;a.firstChild;)r.appendChild(a.firstChild);r.removeChild(a)}t.insertBefore(r,s)}return[l?l.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},qr=Symbol("_vtc");function Gr(e,t,s){const n=e[qr];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const mi=Symbol("_vod"),zr=Symbol("_vsh"),Jr=Symbol(""),Xr=/(?:^|;)\s*display\s*:/;function Yr(e,t,s){const n=e.style,i=re(s);let o=!1;if(s&&!i){if(t)if(re(t))for(const l of t.split(";")){const r=l.slice(0,l.indexOf(":")).trim();s[r]==null&&Yt(n,r,"")}else for(const l in t)s[l]==null&&Yt(n,l,"");for(const l in s){l==="display"&&(o=!0);const r=s[l];r!=null?Qr(e,l,!re(t)&&t?t[l]:void 0,r)||Yt(n,l,r):Yt(n,l,"")}}else if(i){if(t!==s){const l=n[Jr];l&&(s+=";"+l),n.cssText=s,o=Xr.test(s)}}else t&&e.removeAttribute("style");mi in e&&((!i||t!==s)&&(e[mi]=o?n.display:""),e[zr]&&(n.display="none"))}const xs=/\s*!important$/;function Yt(e,t,s){if(U(s))s.forEach(n=>Yt(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))xs.test(s)?e.setProperty(t,s.replace(xs,""),"important"):e.setProperty(t,s);else{const n=Zr(e,t);xs.test(s)?e.setProperty(Vt(n),s.replace(xs,""),"important"):e[n]=s}}const gi=["Webkit","Moz","ms"],rn={};function Zr(e,t){const s=rn[t];if(s)return s;let n=Se(t);if(n!=="filter"&&n in e)return rn[t]=n;n=Us(n);for(let i=0;ian||(oa.then(()=>an=0),an=Date.now());function ra(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const i=s.value;if(U(i)){const o=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{o.call(n),n._stopped=!0};const l=i.slice(),r=[n];for(let a=0;ae.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,aa=(e,t,s,n,i,o)=>{const l=i==="svg";t==="class"?Gr(e,n,l):t==="style"?Yr(e,s,n):Is(t)?js(t)||ta(e,t,s,n,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ca(e,t,n,l))?(yi(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_i(e,t,n,l,o,t!=="value")):e._isVueCE&&(ua(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!re(n)))?yi(e,Se(t),n,o,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),_i(e,t,n,l))};function ca(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&xi(t)&&F(s));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 i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return xi(t)&&re(s)?!1:t in e}function ua(e,t){const s=e._def.props;if(!s)return!1;const n=Se(t);return Array.isArray(s)?s.some(i=>Se(i)===n):Object.keys(s).some(i=>Se(i)===n)}const St=e=>{const t=e.props["onUpdate:modelValue"]||!1;return U(t)?s=>Ss(t,s):t};function da(e){e.target.composing=!0}function wi(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Oe=Symbol("_assign"),ws=Symbol("_initialValue");function cn(e,t,s){return t&&(e=e.trim()),s&&(e=ds(e)),e}const G={created(e,{modifiers:{lazy:t,trim:s,number:n}},i){e.parentNode&&(e.type==="text"?e[ws]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[ws]=e.defaultValue.replace(/\r\n?/g,` -`))),e[Oe]=St(i);const o=n||i.props&&i.props.type==="number";pt(e,t?"change":"input",l=>{l.target.composing||e[Oe](cn(e.value,s,o))}),(s||o)&&pt(e,"change",()=>{e.value=cn(e.value,s,o)}),t||(pt(e,"compositionstart",da),pt(e,"compositionend",wi),pt(e,"change",wi))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const i=t??"",o=e[ws];delete e[ws],o!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==o?e[Oe](cn(e.value,s,n)):e.value=i},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:i,number:o}},l){if(e[Oe]=St(l),e.composing)return;const r=(o||e.type==="number")&&!/^0\d/.test(e.value)?ds(e.value):e.value,a=t??"";if(r===a)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(n&&t===s||i&&e.value.trim()===a)||(e.value=a)}},Nt={deep:!0,created(e,t,s){e[Oe]=St(s),pt(e,"change",()=>{const n=e._modelValue,i=Bt(e),o=e.checked,l=e[Oe];if(U(n)){const r=Sn(n,i),a=r!==-1;if(o&&!a)l(n.concat(i));else if(!o&&a){const d=[...n];d.splice(r,1),l(d)}}else if(bt(n)){const r=new Set(n);o?r.add(i):r.delete(i),l(r)}else l(Bo(e,o))})},mounted:$i,beforeUpdate(e,t,s){e[Oe]=St(s),$i(e,t,s)}};function $i(e,{value:t,oldValue:s},n){e._modelValue=t;let i;if(U(t))i=Sn(t,n.props.value)>-1;else if(bt(t))i=t.has(n.props.value);else{if(t===s)return;i=We(t,Bo(e,!0))}e.checked!==i&&(e.checked=i)}const fa={created(e,{value:t},s){e.checked=We(t,s.props.value),e[Oe]=St(s),pt(e,"change",()=>{e[Oe](Bt(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[Oe]=St(n),t!==s&&(e.checked=We(t,n.props.value))}},pa={deep:!0,created(e,{value:t,modifiers:{number:s}},n){e._modelValue=t,pt(e,"change",()=>{const i=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?ds(Bt(a)):Bt(a)),o=e.multiple,l=o?bt(e._modelValue)?new Set(i):i:i[0],r=e._pendingValue=[o,o?U(l)?i.slice():i:l];try{e[Oe](l)}finally{to(()=>{e._pendingValue===r&&(e._pendingValue=void 0)})}}),e[Oe]=St(n)},mounted(e,{value:t,modifiers:{number:s}}){Si(e,t,s)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[Oe]=St(s)},updated(e,{value:t,modifiers:{number:s}}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!ha(t,n[1],n[0]))&&Si(e,t,s)}};function ha(e,t,s){if(!s||U(e))return We(e,t);if(bt(e)){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}return!1}function Si(e,t,s=!1){const n=e.multiple,i=U(t);if(!(n&&!i&&!bt(t))){for(let o=0,l=e.options.length;oString(h)===String(a)):r.selected=Sn(t,a)>-1}else r.selected=t.has(a)||s&&typeof a=="string"&&t.has(ds(a));else if(We(Bt(r),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Bt(e){return"_value"in e?e._value:e.value}function Bo(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const ma=["ctrl","shift","alt","meta"],ga={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(s=>e[`${s}Key`]&&!t.includes(s))},De=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((i,...o)=>{for(let l=0;l{const t=_a().createApp(...e),{mount:s}=t;return t.mount=n=>{const i=xa(n);if(!i)return;const o=t._component;!F(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const l=s(i,!1,va(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),l},t});function va(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function xa(e){return re(e)?document.querySelector(e):e}class Rt extends Error{constructor(t,s){super(s?.message??`HTTP ${t}`),this.status=t,this.body=s}status;body;get errors(){return Object.fromEntries(Object.entries(this.body?.errors??{}).map(([t,s])=>[t,s[0]]))}}const I=JSON.parse(document.getElementById("manager-boot").textContent);function Ho(){const e=document.cookie.match(/(?:^|; )XSRF-TOKEN=([^;]+)/);return e?decodeURIComponent(e[1]):""}async function $s(e,t,s){const n=await fetch(t,{method:e,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":Ho(),...s===void 0?{}:{"Content-Type":"application/json"}},body:s===void 0?void 0:JSON.stringify(s)}),i=n.status===204?null:await n.json().catch(()=>null);if(!n.ok)throw new Rt(n.status,i);return i}async function wa(e,t){const s=await fetch(e,{method:"POST",credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest","X-XSRF-TOKEN":Ho()},body:t}),n=await s.json().catch(()=>null);if(!s.ok)throw new Rt(s.status,n);return n}const Re={get:e=>$s("GET",e),post:(e,t={})=>$s("POST",e,t),put:(e,t={})=>$s("PUT",e,t),delete:(e,t)=>$s("DELETE",e,t)};function gt(e){const t=Kt({values:{...e},errors:{},busy:!1,async send(s,n){t.busy=!0,t.errors={};try{return await Re[s](n,t.values)}catch(i){if(i instanceof Rt&&i.status===422)return t.errors=i.errors,null;throw i}finally{t.busy=!1}}});return t}const $a={Dashboard:"Dashboard","Log in":"Inloggen","Log out":"Uitloggen",Email:"E-mailadres",Password:"Wachtwoord","Keep me logged in":"Ingelogd blijven","Logging in…":"Bezig met inloggen…","Log in to manage the site.":"Log in om de site te beheren.","My account":"Mijn account",Name:"Naam","Email address":"E-mailadres","What you may do":"Wat je mag","Super admin: everything":"Super admin: alles","Not in a group yet":"Nog in geen groep","New password":"Nieuw wachtwoord","Leave empty to keep the password you have.":"Laat leeg om je wachtwoord te houden.","Current password":"Huidig wachtwoord","At least 12 characters.":"Minstens 12 tekens.","New password, once more":"Nieuw wachtwoord, nogmaals",Save:"Opslaan","Saving…":"Bezig met opslaan…","Saved.":"Opgeslagen.",Look:"Uiterlijk",Theme:"Thema",Posts:"Berichten","New post":"Nieuw bericht",Title:"Titel",Status:"Status",Category:"Categorie",Edit:"Bewerken",Delete:"Verwijderen","Put online":"Online zetten","Take offline":"Offline halen",Draft:"Concept",Scheduled:"Ingepland",Published:"Gepubliceerd","Are you sure?":"Weet je het zeker?","No posts yet.":"Nog geen berichten.","Address (slug)":"Adres (slug)",Summary:"Samenvatting","Text (Markdown)":"Tekst (Markdown)","Cover image":"Omslagafbeelding","Tags (comma separated)":"Tags (met komma's)",Featured:"Uitgelicht",Publish:"Publiceren","Publish at":"Publiceren op",Menu:"Menu","Loading…":"Laden…","You may not open this page.":"Je mag deze pagina niet openen.","Something went wrong. Try again.":"Er ging iets mis. Probeer het opnieuw.","This page has no screen in the manager yet.":"Deze pagina heeft nog geen scherm in de manager.","Go to the dashboard":"Naar het dashboard","The page expired. Reload it and try again.":"De pagina is verlopen. Laad hem opnieuw en probeer het nog eens.",Back:"Terug",Accounts:"Accounts","New account":"Nieuw account",you:"jij","Super admin":"Super admin",Groups:"Groepen",Cancel:"Annuleren","New group":"Nieuwe groep",Description:"Omschrijving",accounts:"accounts","Categories and tags":"Categorieën en tags",Categories:"Categorieën",Tags:"Tags",Add:"Toevoegen",Rename:"Hernoemen","New name":"Nieuwe naam",Pages:"Pagina's",Reviews:"Reviews","Nothing here yet.":"Hier is nog niets.",Previous:"Vorige",Next:"Volgende",Media:"Media","Choose an image":"Kies een afbeelding","No images yet.":"Nog geen afbeeldingen.","Uploaded.":"Geüpload.",Upload:"Uploaden","Uploading…":"Bezig met uploaden…","This file is in use. Delete it anyway?":"Dit bestand is in gebruik. Toch verwijderen?","Largest file":"Grootste bestand","Alternative text":"Alternatieve tekst",Used:"Gebruikt","No files yet.":"Nog geen bestanden.",Choose:"Kiezen","Audit log":"Auditlog","Addresses banned":"Geblokkeerde adressen","Logins (24 h)":"Logins (24 u)","Failed logins (24 h)":"Mislukte logins (24 u)","Refused (24 h)":"Geweigerd (24 u)",all:"alles",logins:"logins",failed:"mislukt",actions:"acties",viewed:"bekeken",refused:"geweigerd",bans:"blokkades",Search:"Zoeken",Account:"Account",Everyone:"Iedereen",Filter:"Filteren",Someone:"Iemand",banned:"geblokkeerd",Ban:"Blokkeren",Bans:"Blokkades","Minutes (0 = until lifted)":"Minuten (0 = tot opgeheven)",Reason:"Reden","Whole site":"Hele site","No bans.":"Geen blokkades.",automatic:"automatisch","whole site":"hele site",hits:"pogingen",Lift:"Opheffen",Rules:"Regels","until lifted":"tot opgeheven","Ban an address by itself after too many failed logins":"Een adres zelf blokkeren na te veel mislukte logins","Failed logins":"Mislukte logins","Within minutes":"Binnen minuten","Ban for minutes (0 = until lifted)":"Blokkeren voor minuten (0 = tot opgeheven)","Keep the log (days)":"Log bewaren (dagen)","Notes about addresses":"Notities over adressen",Group:"Groep",Note:"Notitie",Statistics:"Statistieken","compared with":"vergeleken met",Visitors:"Bezoekers",Visits:"Bezoeken","Page views":"Paginaweergaven","Average time":"Gemiddelde tijd","Bounce rate":"Bouncepercentage",Channels:"Kanalen",Sources:"Bronnen",Countries:"Landen",Devices:"Apparaten",Browsers:"Browsers",Systems:"Systemen",Direct:"Direct","When people visit":"Wanneer mensen komen",Programs:"Programma's",Download:"Downloaden",Open:"Openen","Created.":"Aangemaakt.","Deleted.":"Verwijderd."};let Ko={};function Sa(e){Ko=e.toLowerCase().startsWith("nl")?$a:{}}function _(e){return Ko[e]??e}const ka=["href"],ze=_e({__name:"Link",props:{href:{}},setup(e){function t(s,n){s.metaKey||s.ctrlKey||s.shiftKey||s.button!==0||(s.preventDefault(),zs(n))}return(s,n)=>(g(),y("a",{href:e.href,onClick:n[0]||(n[0]=i=>t(i,e.href))},[mo(s.$slots,"default")],8,ka))}}),Ca={class:"font-display mb-6 text-2xl font-bold"},Ta={class:"mb-4 text-muted"},Aa={class:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3"},Ea=_e({__name:"Dashboard",props:{navigation:{}},setup(e){return(t,s)=>(g(),y(V,null,[u("h1",Ca,p(c(_)("Dashboard")),1),u("p",Ta,p(c(I).user?.name),1),u("div",Aa,[(g(!0),y(V,null,H(e.navigation,n=>(g(),ke(ze,{key:n.href,href:n.href,class:"m-card block p-5 font-semibold transition hover:border-brand"},{default:Ie(()=>[q(p(c(_)(n.label)),1)]),_:2},1032,["href"]))),128))])],64))}}),Pa={class:"m-card max-w-xl p-6"},Oa={class:"text-sm"},Ma=_e({__name:"Fallback",setup(e){return(t,s)=>(g(),y("div",Pa,[u("p",Oa,p(c(_)("This page has no screen in the manager yet.")),1),Ne(ze,{href:c(I).base,class:"m-btn m-btn-secondary mt-4"},{default:Ie(()=>[q(p(c(_)("Go to the dashboard")),1)]),_:1},8,["href"])]))}}),Na={class:"grid min-h-screen place-items-center px-4"},Ra=["src"],Va={class:"font-display text-2xl font-bold"},Ia={class:"mt-1 text-sm text-muted"},ja={class:"mt-6"},Da={for:"email",class:"m-label"},Ua={key:0,class:"m-error"},La={class:"mt-4"},Fa={for:"password",class:"m-label"},Ba={key:0,class:"m-error"},Ha={class:"mt-4 flex items-center gap-2 text-sm text-muted"},Ka=["disabled"],Wa=_e({__name:"Login",setup(e){const t=gt({email:"",password:"",remember:!1});async function s(){const n=await t.send("post",I.base+"/login");n?window.location.assign(n.redirect):t.values.password=""}return(n,i)=>(g(),y("div",Na,[u("form",{class:"m-card w-full max-w-sm p-7",onSubmit:De(s,["prevent"])},[c(I).logo?(g(),y("img",{key:0,src:c(I).logo,alt:"",class:"mb-4 h-9 w-auto"},null,8,Ra)):M("",!0),u("h1",Va,p(c(I).name),1),u("p",Ia,p(c(_)("Log in to manage the site.")),1),u("div",ja,[u("label",Da,p(c(_)("Email")),1),B(u("input",{id:"email","onUpdate:modelValue":i[0]||(i[0]=o=>c(t).values.email=o),type:"email",autocomplete:"username",required:"",autofocus:"",class:"m-input"},null,512),[[G,c(t).values.email]]),c(t).errors.email?(g(),y("p",Ua,p(c(t).errors.email),1)):M("",!0)]),u("div",La,[u("label",Fa,p(c(_)("Password")),1),B(u("input",{id:"password","onUpdate:modelValue":i[1]||(i[1]=o=>c(t).values.password=o),type:"password",autocomplete:"current-password",required:"",class:"m-input"},null,512),[[G,c(t).values.password]]),c(t).errors.password?(g(),y("p",Ba,p(c(t).errors.password),1)):M("",!0)]),u("label",Ha,[B(u("input",{"onUpdate:modelValue":i[2]||(i[2]=o=>c(t).values.remember=o),type:"checkbox"},null,512),[[Nt,c(t).values.remember]]),q(" "+p(c(_)("Keep me logged in")),1)]),u("button",{type:"submit",class:"m-btn m-btn-primary mt-6 w-full justify-center",disabled:c(t).busy},p(c(t).busy?c(_)("Logging in…"):c(_)("Log in")),9,Ka)],32)]))}}),qa={class:"m-card max-h-[85vh] w-full max-w-3xl overflow-y-auto p-5",role:"dialog","aria-modal":"true"},Ga={class:"mb-4 flex items-center justify-between"},za={class:"font-display text-lg font-bold"},Ja={key:0,class:"text-sm text-muted"},Xa={key:1,class:"text-sm text-muted"},Ya={key:2,class:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4"},Za=["onClick"],Qa=["src","alt"],ec={class:"block truncate px-2 py-1 text-xs"},tc=_e({__name:"MediaPicker",emits:["pick","close"],setup(e,{emit:t}){const s=t,n=ot([]),i=ot(!0);return po(async()=>{try{n.value=(await Re.get(`${I.base}/media/items`)).items.filter(o=>o.is_image)}finally{i.value=!1}}),(o,l)=>(g(),y("div",{class:"fixed inset-0 z-50 grid place-items-center bg-black/60 p-4",onClick:l[1]||(l[1]=De(r=>s("close"),["self"]))},[u("div",qa,[u("div",Ga,[u("h2",za,p(c(_)("Choose an image")),1),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:l[0]||(l[0]=r=>s("close"))},p(c(_)("Cancel")),1)]),i.value?(g(),y("p",Ja,p(c(_)("Loading…")),1)):n.value.length?(g(),y("div",Ya,[(g(!0),y(V,null,H(n.value,r=>(g(),y("button",{key:r.id,type:"button",class:"overflow-hidden rounded-lg border border-line text-left hover:border-brand",onClick:a=>s("pick",r.url)},[u("img",{src:r.url,alt:r.name,loading:"lazy",class:"aspect-square w-full object-cover"},null,8,Qa),u("span",ec,p(r.name),1)],8,Za))),128))])):(g(),y("p",Xa,p(c(_)("No images yet.")),1))])]))}}),sc={class:"mb-6 flex items-center justify-between gap-3"},nc={class:"font-display text-2xl font-bold"},ic={for:"title",class:"m-label"},oc={key:0,class:"m-error"},lc={class:"grid gap-5 sm:grid-cols-2"},rc={for:"slug",class:"m-label"},ac={key:0,class:"m-error"},cc={for:"category",class:"m-label"},uc={id:"categories"},dc=["value"],fc={for:"excerpt",class:"m-label"},pc={key:0,class:"m-error"},hc={for:"body",class:"m-label"},mc={key:0,class:"m-error"},gc={class:"grid gap-5 sm:grid-cols-2"},bc={for:"cover",class:"m-label"},_c={class:"flex gap-2"},yc={for:"tags",class:"m-label"},vc={id:"known-tags"},xc=["value"],wc={class:"flex flex-wrap items-center gap-6"},$c={class:"flex items-center gap-2 text-sm"},Sc={key:0,class:"flex items-center gap-2 text-sm"},kc={key:1},Cc={for:"at",class:"m-label"},Tc=["disabled"],Ci=_e({__name:"PostForm",props:{post:{},categories:{},known_tags:{}},setup(e){const s=e.post,n=gt({title:s?.title??"",slug:s?.slug??"",excerpt:s?.excerpt??"",body:s?.body??"",cover_image:s?.cover_image??"",category:s?.category??"",tags:s?.tags??[],is_featured:s?.is_featured??!1,is_published:s?.is_published??!1,published_at:s?.published_at??""}),i=ot(!1);let o=(s?.tags??[]).join(", ");async function l(){n.values.tags=o.split(",").map(a=>a.trim()).filter(Boolean),(s?await n.send("put",`${I.base}/posts/${s.id}`):await n.send("post",`${I.base}/posts`))&&(be(_(s?"Saved.":"Created.")),zs(`${I.base}/posts`))}return(r,a)=>(g(),y(V,null,[u("div",sc,[u("h1",nc,p(c(s)?c(s).title:c(_)("New post")),1),Ne(ze,{href:c(I).base+"/posts",class:"m-btn m-btn-secondary"},{default:Ie(()=>[q(p(c(_)("Back")),1)]),_:1},8,["href"])]),u("form",{class:"m-card max-w-3xl space-y-5 p-5",onSubmit:De(l,["prevent"])},[u("div",null,[u("label",ic,p(c(_)("Title")),1),B(u("input",{id:"title","onUpdate:modelValue":a[0]||(a[0]=d=>c(n).values.title=d),required:"",maxlength:"255",class:"m-input"},null,512),[[G,c(n).values.title]]),c(n).errors.title?(g(),y("p",oc,p(c(n).errors.title),1)):M("",!0)]),u("div",lc,[u("div",null,[u("label",rc,p(c(_)("Address (slug)")),1),B(u("input",{id:"slug","onUpdate:modelValue":a[1]||(a[1]=d=>c(n).values.slug=d),maxlength:"255",class:"m-input"},null,512),[[G,c(n).values.slug]]),c(n).errors.slug?(g(),y("p",ac,p(c(n).errors.slug),1)):M("",!0)]),u("div",null,[u("label",cc,p(c(_)("Category")),1),B(u("input",{id:"category","onUpdate:modelValue":a[2]||(a[2]=d=>c(n).values.category=d),list:"categories",maxlength:"60",class:"m-input"},null,512),[[G,c(n).values.category]]),u("datalist",uc,[(g(!0),y(V,null,H(e.categories,d=>(g(),y("option",{key:d,value:d},null,8,dc))),128))])])]),u("div",null,[u("label",fc,p(c(_)("Summary")),1),B(u("textarea",{id:"excerpt","onUpdate:modelValue":a[3]||(a[3]=d=>c(n).values.excerpt=d),rows:"2",maxlength:"500",class:"m-input"},null,512),[[G,c(n).values.excerpt]]),c(n).errors.excerpt?(g(),y("p",pc,p(c(n).errors.excerpt),1)):M("",!0)]),u("div",null,[u("label",hc,p(c(_)("Text (Markdown)")),1),B(u("textarea",{id:"body","onUpdate:modelValue":a[4]||(a[4]=d=>c(n).values.body=d),rows:"14",required:"",class:"m-input font-mono"},null,512),[[G,c(n).values.body]]),c(n).errors.body?(g(),y("p",mc,p(c(n).errors.body),1)):M("",!0)]),u("div",gc,[u("div",null,[u("label",bc,p(c(_)("Cover image")),1),u("div",_c,[B(u("input",{id:"cover","onUpdate:modelValue":a[5]||(a[5]=d=>c(n).values.cover_image=d),maxlength:"2048",class:"m-input"},null,512),[[G,c(n).values.cover_image]]),c(I).permissions.includes("media.view")?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary shrink-0",onClick:a[6]||(a[6]=d=>i.value=!0)},p(c(_)("Choose")),1)):M("",!0)])]),u("div",null,[u("label",yc,p(c(_)("Tags (comma separated)")),1),B(u("input",{id:"tags","onUpdate:modelValue":a[7]||(a[7]=d=>fe(o)?o.value=d:o=d),list:"known-tags",class:"m-input"},null,512),[[G,c(o)]]),u("datalist",vc,[(g(!0),y(V,null,H(e.known_tags,d=>(g(),y("option",{key:d,value:d},null,8,xc))),128))])])]),u("div",wc,[u("label",$c,[B(u("input",{"onUpdate:modelValue":a[8]||(a[8]=d=>c(n).values.is_featured=d),type:"checkbox"},null,512),[[Nt,c(n).values.is_featured]]),q(" "+p(c(_)("Featured")),1)]),c(I).permissions.includes("posts.publish")?(g(),y("label",Sc,[B(u("input",{"onUpdate:modelValue":a[9]||(a[9]=d=>c(n).values.is_published=d),type:"checkbox"},null,512),[[Nt,c(n).values.is_published]]),q(" "+p(c(_)("Publish")),1)])):M("",!0),c(n).values.is_published?(g(),y("div",kc,[u("label",Cc,p(c(_)("Publish at")),1),B(u("input",{id:"at","onUpdate:modelValue":a[10]||(a[10]=d=>c(n).values.published_at=d),type:"datetime-local",class:"m-input"},null,512),[[G,c(n).values.published_at]])])):M("",!0)]),u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(n).busy},p(c(n).busy?c(_)("Saving…"):c(_)("Save")),9,Tc)],32),i.value?(g(),ke(tc,{key:0,onPick:a[11]||(a[11]=d=>{c(n).values.cover_image=d,i.value=!1}),onClose:a[12]||(a[12]=d=>i.value=!1)})):M("",!0)],64))}}),Ac={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},Ec={class:"font-display text-2xl font-bold"},Pc={key:0,class:"m-card p-5 text-sm text-muted"},Oc={key:1,class:"m-card divide-y divide-line"},Mc={class:"min-w-0"},Nc={class:"truncate font-semibold"},Rc={class:"mt-1 flex items-center gap-2 text-xs text-muted"},Vc={class:"m-badge"},Ic={key:0},jc={class:"flex gap-2"},Dc=["onClick"],Uc=["onClick"],Lc=_e({__name:"PostsIndex",props:{posts:{}},setup(e){const t={draft:"Draft",scheduled:"Scheduled",published:"Published"};async function s(i){await Re.put(`${I.base}/posts/${i.id}/online`,{online:i.status!=="published"}),await Ae()}async function n(i){window.confirm(_("Are you sure?"))&&(await Re.delete(`${I.base}/posts/${i.id}`),be(_("Deleted.")),await Ae())}return(i,o)=>(g(),y(V,null,[u("div",Ac,[u("h1",Ec,p(c(_)("Posts")),1),c(I).permissions.includes("posts.write")?(g(),ke(ze,{key:0,href:c(I).base+"/posts/create",class:"m-btn m-btn-primary"},{default:Ie(()=>[q(p(c(_)("New post")),1)]),_:1},8,["href"])):M("",!0)]),e.posts.length?(g(),y("ul",Oc,[(g(!0),y(V,null,H(e.posts,l=>(g(),y("li",{key:l.id,class:"flex flex-wrap items-center justify-between gap-3 p-4"},[u("div",Mc,[u("p",Nc,p(l.title),1),u("p",Rc,[u("span",Vc,p(c(_)(t[l.status])),1),l.category?(g(),y("span",Ic,p(l.category),1)):M("",!0)])]),u("div",jc,[c(I).permissions.includes("posts.publish")&&l.can_change?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:r=>s(l)},p(l.status==="published"?c(_)("Take offline"):c(_)("Put online")),9,Dc)):M("",!0),l.can_change?(g(),ke(ze,{key:1,href:`${c(I).base}/posts/${l.id}/edit`,class:"m-btn m-btn-secondary"},{default:Ie(()=>[q(p(c(_)("Edit")),1)]),_:1},8,["href"])):M("",!0),l.can_delete?(g(),y("button",{key:2,type:"button",class:"m-btn m-btn-danger",onClick:r=>n(l)},p(c(_)("Delete")),9,Uc)):M("",!0)])]))),128))])):(g(),y("p",Pc,p(c(_)("No posts yet.")),1))],64))}}),Fc={class:"font-display mb-6 text-2xl font-bold"},Bc={for:"name",class:"m-label"},Hc={key:0,class:"m-error"},Kc={class:"m-label"},Wc={class:"text-sm"},qc={class:"m-label"},Gc={class:"flex flex-wrap gap-1.5"},zc={key:0,class:"m-badge"},Jc={key:0,class:"m-badge"},Xc={key:0,class:"rounded-lg border border-line p-4"},Yc={class:"px-1.5 text-sm font-semibold"},Zc={class:"mt-1 flex flex-wrap gap-3"},Qc=["onUpdate:modelValue","value"],eu={class:"flex"},tu={key:0,class:"m-error"},su={class:"space-y-4 rounded-lg border border-line p-4"},nu={class:"px-1.5 text-sm font-semibold"},iu={class:"m-help"},ou={for:"current_password",class:"m-label"},lu={key:0,class:"m-error"},ru={for:"password",class:"m-label"},au={class:"m-help"},cu={key:0,class:"m-error"},uu={for:"password_confirmation",class:"m-label"},du=["disabled"],fu=_e({__name:"Profile",props:{profile:{}},setup(e){const t=e,s=gt({name:t.profile.name,theme:t.profile.theme,current_password:"",password:"",password_confirmation:""});async function n(){await s.send("put",I.base+"/profile")&&(be(_("Saved.")),s.values.theme!==I.theme&&window.location.reload(),s.values.current_password=s.values.password=s.values.password_confirmation="")}return(i,o)=>(g(),y(V,null,[u("h1",Fc,p(c(_)("My account")),1),u("form",{class:"m-card max-w-xl space-y-5 p-5",onSubmit:De(n,["prevent"])},[u("div",null,[u("label",Bc,p(c(_)("Name")),1),B(u("input",{id:"name","onUpdate:modelValue":o[0]||(o[0]=l=>c(s).values.name=l),type:"text",required:"",maxlength:"255",class:"m-input",autocomplete:"name"},null,512),[[G,c(s).values.name]]),c(s).errors.name?(g(),y("p",Hc,p(c(s).errors.name),1)):M("",!0)]),u("div",null,[u("span",Kc,p(c(_)("Email address")),1),u("p",Wc,p(e.profile.email),1)]),u("div",null,[u("span",qc,p(c(_)("What you may do")),1),u("p",Gc,[e.profile.is_super_admin?(g(),y("span",zc,p(c(_)("Super admin: everything")),1)):(g(),y(V,{key:1},[(g(!0),y(V,null,H(e.profile.groups,l=>(g(),y("span",{key:l,class:"m-badge"},p(l),1))),128)),e.profile.groups.length?M("",!0):(g(),y("span",Jc,p(c(_)("Not in a group yet")),1))],64))])]),e.profile.themes.length?(g(),y("fieldset",Xc,[u("legend",Yc,p(c(_)("Look")),1),u("div",Zc,[(g(!0),y(V,null,H(e.profile.themes,l=>(g(),y("label",{key:l.key,class:Ce(["flex cursor-pointer items-center gap-2 rounded-lg border px-3 py-2 text-sm",c(s).values.theme===l.key?"border-brand":"border-line"])},[B(u("input",{"onUpdate:modelValue":r=>c(s).values.theme=r,type:"radio",name:"theme",value:l.key,class:"sr-only"},null,8,Qc),[[fa,c(s).values.theme]]),u("span",eu,[(g(),y(V,null,H(["ink","panel","brand"],r=>u("span",{key:r,class:"h-4 w-4 border border-line",style:wt({background:l.colors[r]})},null,4)),64))]),q(" "+p(l.label),1)],2))),128))]),c(s).errors.theme?(g(),y("p",tu,p(c(s).errors.theme),1)):M("",!0)])):M("",!0),u("fieldset",su,[u("legend",nu,p(c(_)("New password")),1),u("p",iu,p(c(_)("Leave empty to keep the password you have.")),1),u("div",null,[u("label",ou,p(c(_)("Current password")),1),B(u("input",{id:"current_password","onUpdate:modelValue":o[1]||(o[1]=l=>c(s).values.current_password=l),type:"password",class:"m-input",autocomplete:"current-password"},null,512),[[G,c(s).values.current_password]]),c(s).errors.current_password?(g(),y("p",lu,p(c(s).errors.current_password),1)):M("",!0)]),u("div",null,[u("label",ru,p(c(_)("New password")),1),B(u("input",{id:"password","onUpdate:modelValue":o[2]||(o[2]=l=>c(s).values.password=l),type:"password",minlength:"12",maxlength:"200",class:"m-input",autocomplete:"new-password"},null,512),[[G,c(s).values.password]]),u("p",au,p(c(_)("At least 12 characters.")),1),c(s).errors.password?(g(),y("p",cu,p(c(s).errors.password),1)):M("",!0)]),u("div",null,[u("label",uu,p(c(_)("New password, once more")),1),B(u("input",{id:"password_confirmation","onUpdate:modelValue":o[3]||(o[3]=l=>c(s).values.password_confirmation=l),type:"password",maxlength:"200",class:"m-input",autocomplete:"new-password"},null,512),[[G,c(s).values.password_confirmation]])])]),u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(s).busy},p(c(s).busy?c(_)("Saving…"):c(_)("Save")),9,du)],32)],64))}}),pu={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},hu={class:"font-display text-2xl font-bold"},mu={class:"grid gap-4 sm:grid-cols-2"},gu={class:"m-label",for:"a-name"},bu={key:0,class:"m-error"},_u={class:"m-label",for:"a-email"},yu={key:0,class:"m-error"},vu={class:"m-label",for:"a-pass"},xu=["required"],wu={class:"m-help"},$u={key:0,class:"m-error"},Su={key:0},ku={class:"m-label"},Cu=["value","disabled"],Tu={class:"flex gap-2"},Au=["disabled"],Eu={class:"m-card divide-y divide-line"},Pu={class:"min-w-0"},Ou={class:"truncate font-semibold"},Mu={key:0,class:"text-xs font-normal text-muted"},Nu={class:"truncate text-xs text-muted"},Ru={class:"mt-1 flex flex-wrap gap-1"},Vu={key:0,class:"m-badge"},Iu={class:"flex gap-2"},ju=["onClick"],Du=["onClick"],Uu=_e({__name:"AccountsIndex",props:{accounts:{},groups:{}},setup(e){const t=ot(null),s=gt({name:"",email:"",password:"",groups:[]});function n(l){t.value=l,s.errors={},s.values.name=l==="new"?"":l.name,s.values.email=l==="new"?"":l.email,s.values.password="",s.values.groups=l==="new"?[]:l.groups.map(r=>r.id)}async function i(){const l=t.value;(l==="new"?await s.send("post",`${I.base}/accounts`):await s.send("put",`${I.base}/accounts/${l.id}`))&&(be(_("Saved.")),t.value=null,await Ae())}async function o(l){window.confirm(_("Are you sure?"))&&(await Re.delete(`${I.base}/accounts/${l.id}`),be(_("Deleted.")),await Ae())}return(l,r)=>(g(),y(V,null,[u("div",pu,[u("h1",hu,p(c(_)("Accounts")),1),u("button",{type:"button",class:"m-btn m-btn-primary",onClick:r[0]||(r[0]=a=>n("new"))},p(c(_)("New account")),1)]),t.value?(g(),y("form",{key:0,class:"m-card mb-6 max-w-2xl space-y-4 p-5",onSubmit:De(i,["prevent"])},[u("div",mu,[u("div",null,[u("label",gu,p(c(_)("Name")),1),B(u("input",{id:"a-name","onUpdate:modelValue":r[1]||(r[1]=a=>c(s).values.name=a),required:"",maxlength:"255",class:"m-input"},null,512),[[G,c(s).values.name]]),c(s).errors.name?(g(),y("p",bu,p(c(s).errors.name),1)):M("",!0)]),u("div",null,[u("label",_u,p(c(_)("Email address")),1),B(u("input",{id:"a-email","onUpdate:modelValue":r[2]||(r[2]=a=>c(s).values.email=a),type:"email",required:"",maxlength:"255",class:"m-input"},null,512),[[G,c(s).values.email]]),c(s).errors.email?(g(),y("p",yu,p(c(s).errors.email),1)):M("",!0)])]),u("div",null,[u("label",vu,p(c(_)("Password")),1),B(u("input",{id:"a-pass","onUpdate:modelValue":r[3]||(r[3]=a=>c(s).values.password=a),type:"password",minlength:"12",maxlength:"200",required:t.value==="new",class:"m-input",autocomplete:"new-password"},null,8,xu),[[G,c(s).values.password]]),u("p",wu,p(t.value==="new"?c(_)("At least 12 characters."):c(_)("Leave empty to keep the password you have.")),1),c(s).errors.password?(g(),y("p",$u,p(c(s).errors.password),1)):M("",!0)]),e.groups.length?(g(),y("fieldset",Su,[u("legend",ku,p(c(_)("Groups")),1),(g(!0),y(V,null,H(e.groups,a=>(g(),y("label",{key:a.id,class:Ce(["flex items-center gap-2 py-0.5 text-sm",a.can_give?"":"opacity-50"])},[B(u("input",{"onUpdate:modelValue":r[4]||(r[4]=d=>c(s).values.groups=d),type:"checkbox",value:a.id,disabled:!a.can_give},null,8,Cu),[[Nt,c(s).values.groups]]),q(" "+p(a.name),1)],2))),128))])):M("",!0),u("div",Tu,[u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(s).busy},p(c(s).busy?c(_)("Saving…"):c(_)("Save")),9,Au),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:r[5]||(r[5]=a=>t.value=null)},p(c(_)("Cancel")),1)])],32)):M("",!0),u("ul",Eu,[(g(!0),y(V,null,H(e.accounts,a=>(g(),y("li",{key:a.id,class:"flex flex-wrap items-center justify-between gap-3 p-4"},[u("div",Pu,[u("p",Ou,[q(p(a.name)+" ",1),a.is_you?(g(),y("span",Mu,"("+p(c(_)("you"))+")",1)):M("",!0)]),u("p",Nu,p(a.email),1),u("p",Ru,[a.is_super_admin?(g(),y("span",Vu,p(c(_)("Super admin")),1)):M("",!0),(g(!0),y(V,null,H(a.groups,d=>(g(),y("span",{key:d.id,class:"m-badge"},p(d.name),1))),128))])]),u("div",Iu,[a.can_change?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:d=>n(a)},p(c(_)("Edit")),9,ju)):M("",!0),a.can_delete?(g(),y("button",{key:1,type:"button",class:"m-btn m-btn-danger",onClick:d=>o(a)},p(c(_)("Delete")),9,Du)):M("",!0)])]))),128))])],64))}}),Lu={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},Fu={class:"font-display text-2xl font-bold"},Bu={class:"m-label",for:"g-name"},Hu={key:0,class:"m-error"},Ku={class:"m-label",for:"g-desc"},Wu={class:"px-1 text-sm font-semibold"},qu=["value","onChange"],Gu={class:"flex gap-2"},zu=["disabled"],Ju={key:1,class:"m-card p-5 text-sm text-muted"},Xu={key:2,class:"m-card divide-y divide-line"},Yu={class:"min-w-0"},Zu={class:"font-semibold"},Qu={class:"text-xs font-normal text-muted"},ed={key:0,class:"text-xs text-muted"},td={class:"flex gap-2"},sd=["onClick"],nd=["onClick"],id=_e({__name:"GroupsIndex",props:{groups:{},catalogue:{}},setup(e){const t=e,s=ot(null),n=gt({name:"",description:"",permissions:[]}),i=t.catalogue.flatMap(d=>d.permissions);function o(d){s.value=d,n.errors={},n.values.name=d==="new"?"":d.name,n.values.description=d==="new"?"":d.description??"",n.values.permissions=d==="new"?[]:[...d.permissions]}function l(d){n.values.permissions.includes(d.value)?n.values.permissions=[...new Set([...n.values.permissions,...d.needs])]:n.values.permissions=n.values.permissions.filter(h=>!i.find(b=>b.value===h)?.needs.includes(d.value))}async function r(){const d=s.value;(d==="new"?await n.send("post",`${I.base}/groups`):await n.send("put",`${I.base}/groups/${d.id}`))&&(be(_("Saved.")),s.value=null,await Ae())}async function a(d){window.confirm(_("Are you sure?"))&&(await Re.delete(`${I.base}/groups/${d.id}`),be(_("Deleted.")),await Ae())}return(d,h)=>(g(),y(V,null,[u("div",Lu,[u("h1",Fu,p(c(_)("Groups")),1),u("button",{type:"button",class:"m-btn m-btn-primary",onClick:h[0]||(h[0]=b=>o("new"))},p(c(_)("New group")),1)]),s.value?(g(),y("form",{key:0,class:"m-card mb-6 max-w-3xl space-y-4 p-5",onSubmit:De(r,["prevent"])},[u("div",null,[u("label",Bu,p(c(_)("Name")),1),B(u("input",{id:"g-name","onUpdate:modelValue":h[1]||(h[1]=b=>c(n).values.name=b),required:"",maxlength:"60",class:"m-input"},null,512),[[G,c(n).values.name]]),c(n).errors.name?(g(),y("p",Hu,p(c(n).errors.name),1)):M("",!0)]),u("div",null,[u("label",Ku,p(c(_)("Description")),1),B(u("textarea",{id:"g-desc","onUpdate:modelValue":h[2]||(h[2]=b=>c(n).values.description=b),rows:"2",maxlength:"500",class:"m-input"},null,512),[[G,c(n).values.description]])]),(g(!0),y(V,null,H(e.catalogue,b=>(g(),y("fieldset",{key:b.section,class:"rounded-lg border border-line p-3"},[u("legend",Wu,p(b.section),1),(g(!0),y(V,null,H(b.permissions,v=>(g(),y("label",{key:v.value,class:"flex items-center gap-2 py-0.5 text-sm"},[B(u("input",{"onUpdate:modelValue":h[3]||(h[3]=R=>c(n).values.permissions=R),type:"checkbox",value:v.value,onChange:R=>l(v)},null,40,qu),[[Nt,c(n).values.permissions]]),q(" "+p(v.label),1)]))),128))]))),128)),u("div",Gu,[u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(n).busy},p(c(n).busy?c(_)("Saving…"):c(_)("Save")),9,zu),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:h[4]||(h[4]=b=>s.value=null)},p(c(_)("Cancel")),1)])],32)):M("",!0),e.groups.length?(g(),y("ul",Xu,[(g(!0),y(V,null,H(e.groups,b=>(g(),y("li",{key:b.id,class:"flex flex-wrap items-center justify-between gap-3 p-4"},[u("div",Yu,[u("p",Zu,[q(p(b.name)+" ",1),u("span",Qu,"· "+p(b.accounts)+" "+p(c(_)("accounts")),1)]),b.description?(g(),y("p",ed,p(b.description),1)):M("",!0)]),u("div",td,[u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:v=>o(b)},p(c(_)("Edit")),9,sd),u("button",{type:"button",class:"m-btn m-btn-danger",onClick:v=>a(b)},p(c(_)("Delete")),9,nd)])]))),128))])):(g(),y("p",Ju,p(c(_)("Nothing here yet.")),1))],64))}}),od={class:"font-display mb-6 text-2xl font-bold"},ld={key:0,class:"m-error mb-4"},rd={class:"grid gap-6 md:grid-cols-2"},ad={class:"mb-3 font-semibold"},cd=["onSubmit"],ud=["onUpdate:modelValue","aria-label"],dd={type:"submit",class:"m-btn m-btn-primary"},fd={class:"divide-y divide-line"},pd={class:"min-w-0 truncate"},hd={class:"text-xs text-muted"},md={class:"flex gap-1"},gd=["onClick"],bd=["onClick"],_d=_e({__name:"LabelsIndex",props:{categories:{},tags:{}},setup(e){const t=[{type:"category",title:"Categories"},{type:"tag",title:"Tags"}],s=ot({category:"",tag:""}),n=ot("");async function i(a){n.value="";try{await a(),await Ae()}catch(d){if(d instanceof Rt&&d.status===422)n.value=Object.values(d.errors)[0]??d.message;else throw d}}const o=a=>i(async()=>{await Re.post(`${I.base}/labels`,{type:a,name:s.value[a]}),s.value[a]="",be(_("Created."))}),l=(a,d)=>{const h=window.prompt(_("New name"),d);return h&&h!==d?i(()=>Re.put(`${I.base}/labels`,{type:a,name:d,new_name:h})):void 0},r=(a,d)=>window.confirm(_("Are you sure?"))?i(()=>Re.delete(`${I.base}/labels`,{type:a,name:d})):void 0;return(a,d)=>(g(),y(V,null,[u("h1",od,p(c(_)("Categories and tags")),1),n.value?(g(),y("p",ld,p(n.value),1)):M("",!0),u("div",rd,[(g(),y(V,null,H(t,h=>u("section",{key:h.type,class:"m-card p-4"},[u("h2",ad,p(c(_)(h.title)),1),u("form",{class:"mb-3 flex gap-2",onSubmit:De(b=>o(h.type),["prevent"])},[B(u("input",{"onUpdate:modelValue":b=>s.value[h.type]=b,required:"",maxlength:"60",class:"m-input","aria-label":c(_)(h.title)},null,8,ud),[[G,s.value[h.type]]]),u("button",dd,p(c(_)("Add")),1)],40,cd),u("ul",fd,[(g(!0),y(V,null,H(h.type==="category"?e.categories:e.tags,b=>(g(),y("li",{key:b.name,class:"flex items-center justify-between gap-2 py-2 text-sm"},[u("span",pd,[q(p(b.name)+" ",1),u("span",hd,"· "+p(b.posts),1)]),u("span",md,[u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:v=>l(h.type,b.name)},p(c(_)("Rename")),9,gd),u("button",{type:"button",class:"m-btn m-btn-danger",onClick:v=>r(h.type,b.name)},p(c(_)("Delete")),9,bd)])]))),128))])])),64))])],64))}}),yd={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},vd={class:"font-display text-2xl font-bold"},xd=["accept","disabled"],wd=["title"],$d={class:"h-2 overflow-hidden rounded-full bg-panel-2"},Sd={class:"m-help"},kd=["src","alt"],Cd={class:"min-w-0 flex-1 space-y-3"},Td={class:"m-label",for:"m-name"},Ad=["disabled"],Ed={key:0,class:"m-error"},Pd={key:0},Od={class:"m-label",for:"m-alt"},Md=["disabled"],Nd={class:"m-help"},Rd={key:0},Vd={key:1},Id={class:"m-help break-all"},jd={class:"flex gap-2"},Dd=["disabled"],Ud={key:1,class:"m-card p-5 text-sm text-muted"},Ld={key:2,class:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5"},Fd=["onClick"],Bd=["src","alt"],Hd={key:1,class:"grid aspect-square w-full place-items-center text-xs text-muted"},Kd={class:"block truncate px-2 py-1.5 text-xs"},Wd=_e({__name:"MediaLibrary",props:{items:{},max_file_mb:{},extensions:{},storage:{}},setup(e){const t=h=>I.permissions.includes(h),s=ot(!1),n=ot(null),i=gt({name:"",alt:""}),o=h=>h>1e6?`${(h/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(h/1e3))} kB`;function l(h){n.value=h,i.errors={},i.values.name=h.name,i.values.alt=h.alt??""}async function r(h){const b=h.target;s.value=!0;try{for(const v of Array.from(b.files??[])){const R=new FormData;R.append("file",v),await wa(`${I.base}/media`,R)}be(_("Uploaded.")),await Ae()}catch(v){be(v instanceof Rt?Object.values(v.errors)[0]??v.message:_("Something went wrong. Try again."),!0)}finally{s.value=!1,b.value=""}}async function a(){n.value&&await i.send("put",`${I.base}/media/${n.value.id}`)&&(be(_("Saved.")),n.value=null,await Ae())}async function d(h){const b=h.usage_count>0?_("This file is in use. Delete it anyway?"):_("Are you sure?");window.confirm(b)&&(await Re.delete(`${I.base}/media/${h.id}`),n.value=null,be(_("Deleted.")),await Ae())}return(h,b)=>(g(),y(V,null,[u("div",yd,[u("h1",vd,p(c(_)("Media")),1),t("media.upload")?(g(),y("label",{key:0,class:Ce(["m-btn m-btn-primary cursor-pointer",s.value?"opacity-50":""])},[q(p(s.value?c(_)("Uploading…"):c(_)("Upload"))+" ",1),u("input",{type:"file",multiple:"",class:"sr-only",accept:e.extensions.map(v=>"."+v).join(","),disabled:s.value,onChange:r},null,40,xd)],2)):M("",!0)]),u("div",{class:"mb-6 max-w-md",title:`${o(e.storage.used)} / ${o(e.storage.limit)}`},[u("div",$d,[u("div",{class:"h-full bg-brand",style:wt({width:Math.min(100,e.storage.used/Math.max(1,e.storage.limit)*100)+"%"})},null,4)]),u("p",Sd,p(o(e.storage.used))+" / "+p(o(e.storage.limit))+" · "+p(c(_)("Largest file"))+": "+p(e.max_file_mb)+" MB",1)],8,wd),n.value?(g(),y("form",{key:0,class:"m-card mb-6 flex max-w-3xl flex-wrap gap-5 p-5",onSubmit:De(a,["prevent"])},[n.value.is_image?(g(),y("img",{key:0,src:n.value.url,alt:n.value.alt??"",class:"h-32 w-32 rounded-lg object-cover"},null,8,kd)):M("",!0),u("div",Cd,[u("div",null,[u("label",Td,p(c(_)("Name")),1),B(u("input",{id:"m-name","onUpdate:modelValue":b[0]||(b[0]=v=>c(i).values.name=v),required:"",maxlength:"250",class:"m-input",disabled:!t("media.edit")},null,8,Ad),[[G,c(i).values.name]]),c(i).errors.name?(g(),y("p",Ed,p(c(i).errors.name),1)):M("",!0)]),n.value.is_image?(g(),y("div",Pd,[u("label",Od,p(c(_)("Alternative text")),1),B(u("input",{id:"m-alt","onUpdate:modelValue":b[1]||(b[1]=v=>c(i).values.alt=v),maxlength:"500",class:"m-input",disabled:!t("media.edit")},null,8,Md),[[G,c(i).values.alt]])])):M("",!0),u("p",Nd,[q(p(n.value.mime_type)+" · "+p(o(n.value.size)),1),n.value.width?(g(),y("span",Rd," · "+p(n.value.width)+"×"+p(n.value.height),1)):M("",!0),q(" · "+p(c(_)("Used"))+": "+p(n.value.usage_count),1),n.value.uploaded_by?(g(),y("span",Vd," · "+p(n.value.uploaded_by),1)):M("",!0)]),u("p",Id,p(n.value.url),1),u("div",jd,[t("media.edit")?(g(),y("button",{key:0,type:"submit",class:"m-btn m-btn-primary",disabled:c(i).busy},p(c(_)("Save")),9,Dd)):M("",!0),t("media.delete")?(g(),y("button",{key:1,type:"button",class:"m-btn m-btn-danger",onClick:b[2]||(b[2]=v=>d(n.value))},p(c(_)("Delete")),1)):M("",!0),u("button",{type:"button",class:"m-btn m-btn-secondary",onClick:b[3]||(b[3]=v=>n.value=null)},p(c(_)("Cancel")),1)])])],32)):M("",!0),e.items.length?(g(),y("div",Ld,[(g(!0),y(V,null,H(e.items,v=>(g(),y("button",{key:v.id,type:"button",class:Ce(["m-card overflow-hidden text-left transition hover:border-brand",n.value?.id===v.id?"border-brand":""]),onClick:R=>l(v)},[v.is_image?(g(),y("img",{key:0,src:v.url,alt:v.alt??"",loading:"lazy",class:"aspect-square w-full object-cover"},null,8,Bd)):(g(),y("span",Hd,p(v.mime_type),1)),u("span",Kd,p(v.name),1)],10,Fd))),128))])):(g(),y("p",Ud,p(c(_)("No files yet.")),1))],64))}}),qd={class:"font-display mb-6 text-2xl font-bold"},Gd={class:"mb-6 grid grid-cols-2 gap-3 md:grid-cols-4"},zd={class:"text-2xl font-bold"},Jd={class:"m-help"},Xd={class:"mb-4 flex flex-wrap gap-2"},Yd=["onClick"],Zd=["placeholder","aria-label"],Qd=["aria-label"],ef={value:""},tf=["value"],sf={type:"submit",class:"m-btn m-btn-secondary"},nf={key:0,class:"m-card p-5 text-sm text-muted"},of={key:1,class:"m-card divide-y divide-line"},lf={class:"min-w-0"},rf={class:"font-semibold"},af={key:1},cf={class:"text-xs text-muted"},uf={class:"flex gap-2"},df={key:0,class:"m-badge"},ff=["onClick"],pf={key:2,class:"mt-4 flex items-center gap-2"},hf={class:"text-sm text-muted"},mf={class:"font-display mb-3 mt-10 text-xl font-bold"},gf={class:"m-label",for:"b-min"},bf={class:"min-w-[10rem] flex-1"},_f={class:"m-label",for:"b-why"},yf={key:0,class:"flex items-center gap-2 text-sm"},vf={type:"submit",class:"m-btn m-btn-danger"},xf={key:1,class:"m-error w-full"},wf={key:4,class:"text-sm text-muted"},$f={key:5,class:"m-card divide-y divide-line"},Sf={class:"font-semibold"},kf={key:0,class:"m-badge"},Cf={key:1,class:"m-badge"},Tf={class:"text-xs text-muted"},Af=["onClick"],Ef={class:"font-display mb-3 mt-10 text-xl font-bold"},Pf={class:"flex items-center gap-2 text-sm sm:col-span-2"},Of={class:"m-label",for:"r-max"},Mf={class:"m-label",for:"r-win"},Nf={class:"m-label",for:"r-ban"},Rf={class:"m-label",for:"r-keep"},Vf=["max"],If={class:"m-help"},jf={class:"sm:col-span-2"},Df=["disabled"],Uf={class:"font-display mb-3 mt-10 text-xl font-bold"},Lf={class:"m-label",for:"n-group"},Ff={class:"min-w-[10rem] flex-1"},Bf={class:"m-label",for:"n-note"},Hf={type:"submit",class:"m-btn m-btn-secondary"},Kf={key:0,class:"m-error w-full"},Wf={key:0,class:"m-card divide-y divide-line text-sm"},qf={key:0,class:"m-badge"},Gf=_e({__name:"AuditLog",props:{entries:{},pagination:{},filters:{},accounts:{},summary:{},bans:{},notes:{},settings:{},max_keep_days:{},can_manage:{type:Boolean},my_ip:{},never_banned:{},whole_site_bans:{type:Boolean}},setup(e){const t=e,s=["all","logins","failed","actions","viewed","refused","bans"],n=Kt({q:t.filters.q,ip:t.filters.ip,user:t.filters.user??""}),i=N=>new Date(N).toLocaleString();function o(N){const C=new URLSearchParams,w={show:t.filters.show,q:n.q,ip:n.ip,user:n.user,...N};for(const[z,K]of Object.entries(w))K!==""&&K!=="all"&&K!==1&&C.set(z,String(K));zs(`${I.base}/audit${C.size?"?"+C:""}`)}const l=gt({ip:"",minutes:1440,reason:"",whole_site:!1});async function r(N){N&&(l.values.ip=N);const C=await l.send("post",`${I.base}/audit/bans`);C&&(be(C.message),l.values.ip=l.values.reason="",await Ae())}async function a(N){be((await Re.delete(`${I.base}/audit/bans/${N.id}`)).message),await Ae()}const d=gt({...t.settings});async function h(){await d.send("put",`${I.base}/audit/settings`)&&(be(_("Saved.")),await Ae())}const b=gt({ip:"",group:"",note:""});async function v(){await b.send("put",`${I.base}/audit/notes`)&&(be(_("Saved.")),b.values.ip=b.values.group=b.values.note="",await Ae())}const R=N=>N.expires_at?i(N.expires_at):_("until lifted");return(N,C)=>(g(),y(V,null,[u("h1",qd,p(c(_)("Audit log")),1),u("div",Gd,[(g(!0),y(V,null,H(e.summary,(w,z)=>(g(),y("div",{key:z,class:"m-card p-4"},[u("p",zd,p(w),1),u("p",Jd,p(c(_)(z==="banned"?"Addresses banned":z==="logins"?"Logins (24 h)":z==="failed"?"Failed logins (24 h)":"Refused (24 h)")),1)]))),128))]),u("nav",Xd,[(g(),y(V,null,H(s,w=>u("button",{key:w,type:"button",class:Ce(["m-btn",e.filters.show===w?"m-btn-primary":"m-btn-secondary"]),onClick:z=>o({show:w,page:1})},p(c(_)(w)),11,Yd)),64))]),u("form",{class:"mb-4 flex flex-wrap gap-2",onSubmit:C[3]||(C[3]=De(w=>o({page:1}),["prevent"]))},[B(u("input",{"onUpdate:modelValue":C[0]||(C[0]=w=>n.q=w),class:"m-input max-w-xs",placeholder:c(_)("Search"),"aria-label":c(_)("Search")},null,8,Zd),[[G,n.q]]),B(u("input",{"onUpdate:modelValue":C[1]||(C[1]=w=>n.ip=w),class:"m-input max-w-[12rem]",placeholder:"IP","aria-label":"IP"},null,512),[[G,n.ip]]),B(u("select",{"onUpdate:modelValue":C[2]||(C[2]=w=>n.user=w),class:"m-input max-w-[12rem]","aria-label":c(_)("Account")},[u("option",ef,p(c(_)("Everyone")),1),(g(!0),y(V,null,H(e.accounts,w=>(g(),y("option",{key:w.id,value:w.id},p(w.name),9,tf))),128))],8,Qd),[[pa,n.user]]),u("button",sf,p(c(_)("Filter")),1)],32),e.entries.length?(g(),y("ul",of,[(g(!0),y(V,null,H(e.entries,w=>(g(),y("li",{key:w.id,class:"flex flex-wrap items-start justify-between gap-3 p-4 text-sm"},[u("div",lf,[u("p",rf,[q(p(w.summary)+" ",1),w.subject?(g(),y(V,{key:0},[C[19]||(C[19]=q(" · ",-1)),w.subject.url?(g(),ke(ze,{key:0,href:w.subject.url,class:"underline"},{default:Ie(()=>[q(p(w.subject.label),1)]),_:2},1032,["href"])):(g(),y("span",af,p(w.subject.label),1))],64)):M("",!0)]),u("p",cf,p(i(w.at))+" · "+p(w.who??w.email??c(_)("Someone"))+" · "+p(w.ip)+" · "+p(w.browser),1)]),u("span",uf,[w.banned?(g(),y("span",df,p(c(_)("banned")),1)):M("",!0),e.can_manage&&w.ip&&!w.banned&&!w.never_banned&&w.ip!==e.my_ip?(g(),y("button",{key:1,type:"button",class:"m-btn m-btn-danger",onClick:z=>r(w.ip)},p(c(_)("Ban")),9,ff)):M("",!0)])]))),128))])):(g(),y("p",nf,p(c(_)("Nothing here yet.")),1)),e.pagination.pages>1?(g(),y("nav",pf,[e.pagination.page>1?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:C[4]||(C[4]=w=>o({page:e.pagination.page-1}))},p(c(_)("Previous")),1)):M("",!0),u("span",hf,p(e.pagination.page)+" / "+p(e.pagination.pages),1),e.pagination.pageo({page:e.pagination.page+1}))},p(c(_)("Next")),1)):M("",!0)])):M("",!0),u("h2",mf,p(c(_)("Bans")),1),e.can_manage?(g(),y("form",{key:3,class:"m-card mb-4 flex max-w-3xl flex-wrap items-end gap-3 p-4",onSubmit:C[10]||(C[10]=De(w=>r(),["prevent"]))},[u("div",null,[C[20]||(C[20]=u("label",{class:"m-label",for:"b-ip"},"IP",-1)),B(u("input",{id:"b-ip","onUpdate:modelValue":C[6]||(C[6]=w=>c(l).values.ip=w),required:"",class:"m-input"},null,512),[[G,c(l).values.ip]])]),u("div",null,[u("label",gf,p(c(_)("Minutes (0 = until lifted)")),1),B(u("input",{id:"b-min","onUpdate:modelValue":C[7]||(C[7]=w=>c(l).values.minutes=w),type:"number",min:"0",class:"m-input w-32"},null,512),[[G,c(l).values.minutes,void 0,{number:!0}]])]),u("div",bf,[u("label",_f,p(c(_)("Reason")),1),B(u("input",{id:"b-why","onUpdate:modelValue":C[8]||(C[8]=w=>c(l).values.reason=w),maxlength:"200",class:"m-input"},null,512),[[G,c(l).values.reason]])]),e.whole_site_bans?(g(),y("label",yf,[B(u("input",{"onUpdate:modelValue":C[9]||(C[9]=w=>c(l).values.whole_site=w),type:"checkbox"},null,512),[[Nt,c(l).values.whole_site]]),q(" "+p(c(_)("Whole site")),1)])):M("",!0),u("button",vf,p(c(_)("Ban")),1),c(l).errors.ip?(g(),y("p",xf,p(c(l).errors.ip),1)):M("",!0)],32)):M("",!0),e.bans.length?(g(),y("ul",$f,[(g(!0),y(V,null,H(e.bans,w=>(g(),y("li",{key:w.id,class:Ce(["flex flex-wrap items-center justify-between gap-3 p-4 text-sm",w.active?"":"opacity-50"])},[u("div",null,[u("p",Sf,[q(p(w.ip)+" ",1),w.automatic?(g(),y("span",kf,p(c(_)("automatic")),1)):M("",!0),C[21]||(C[21]=q()),w.whole_site?(g(),y("span",Cf,p(c(_)("whole site")),1)):M("",!0)]),u("p",Tf,p(w.reason)+" · "+p(R(w))+" · "+p(w.hits)+" "+p(c(_)("hits")),1)]),e.can_manage&&w.active?(g(),y("button",{key:0,type:"button",class:"m-btn m-btn-secondary",onClick:z=>a(w)},p(c(_)("Lift")),9,Af)):M("",!0)],2))),128))])):(g(),y("p",wf,p(c(_)("No bans.")),1)),e.can_manage?(g(),y(V,{key:6},[u("h2",Ef,p(c(_)("Rules")),1),u("form",{class:"m-card grid max-w-3xl gap-4 p-5 sm:grid-cols-2",onSubmit:De(h,["prevent"])},[u("label",Pf,[B(u("input",{"onUpdate:modelValue":C[11]||(C[11]=w=>c(d).values.auto_ban=w),type:"checkbox"},null,512),[[Nt,c(d).values.auto_ban]]),q(" "+p(c(_)("Ban an address by itself after too many failed logins")),1)]),u("div",null,[u("label",Of,p(c(_)("Failed logins")),1),B(u("input",{id:"r-max","onUpdate:modelValue":C[12]||(C[12]=w=>c(d).values.max_failures=w),type:"number",min:"3",max:"100",class:"m-input"},null,512),[[G,c(d).values.max_failures,void 0,{number:!0}]])]),u("div",null,[u("label",Mf,p(c(_)("Within minutes")),1),B(u("input",{id:"r-win","onUpdate:modelValue":C[13]||(C[13]=w=>c(d).values.window_minutes=w),type:"number",min:"1",max:"1440",class:"m-input"},null,512),[[G,c(d).values.window_minutes,void 0,{number:!0}]])]),u("div",null,[u("label",Nf,p(c(_)("Ban for minutes (0 = until lifted)")),1),B(u("input",{id:"r-ban","onUpdate:modelValue":C[14]||(C[14]=w=>c(d).values.ban_minutes=w),type:"number",min:"0",class:"m-input"},null,512),[[G,c(d).values.ban_minutes,void 0,{number:!0}]])]),u("div",null,[u("label",Rf,p(c(_)("Keep the log (days)")),1),B(u("input",{id:"r-keep","onUpdate:modelValue":C[15]||(C[15]=w=>c(d).values.keep_days=w),type:"number",min:"7",max:e.max_keep_days,class:"m-input"},null,8,Vf),[[G,c(d).values.keep_days,void 0,{number:!0}]]),u("p",If,"≤ "+p(e.max_keep_days),1)]),u("div",jf,[u("button",{type:"submit",class:"m-btn m-btn-primary",disabled:c(d).busy},p(c(_)("Save")),9,Df)]),(g(!0),y(V,null,H(c(d).errors,(w,z)=>(g(),y("p",{key:z,class:"m-error sm:col-span-2"},p(w),1))),128))],32),u("h2",Uf,p(c(_)("Notes about addresses")),1),u("form",{class:"m-card mb-4 flex max-w-3xl flex-wrap items-end gap-3 p-4",onSubmit:De(v,["prevent"])},[u("div",null,[C[22]||(C[22]=u("label",{class:"m-label",for:"n-ip"},"IP",-1)),B(u("input",{id:"n-ip","onUpdate:modelValue":C[16]||(C[16]=w=>c(b).values.ip=w),required:"",class:"m-input"},null,512),[[G,c(b).values.ip]])]),u("div",null,[u("label",Lf,p(c(_)("Group")),1),B(u("input",{id:"n-group","onUpdate:modelValue":C[17]||(C[17]=w=>c(b).values.group=w),maxlength:"60",class:"m-input"},null,512),[[G,c(b).values.group]])]),u("div",Ff,[u("label",Bf,p(c(_)("Note")),1),B(u("input",{id:"n-note","onUpdate:modelValue":C[18]||(C[18]=w=>c(b).values.note=w),maxlength:"2000",class:"m-input"},null,512),[[G,c(b).values.note]])]),u("button",Hf,p(c(_)("Save")),1),c(b).errors.ip?(g(),y("p",Kf,p(c(b).errors.ip),1)):M("",!0)],32),e.notes.length?(g(),y("ul",Wf,[(g(!0),y(V,null,H(e.notes,w=>(g(),y("li",{key:w.ip,class:"p-3"},[u("b",null,p(w.ip),1),C[23]||(C[23]=q()),w.group?(g(),y("span",qf,p(w.group),1)):M("",!0),q(" "+p(w.note),1)]))),128))])):M("",!0)],64)):M("",!0)],64))}}),zf={class:"mb-6 flex flex-wrap items-center justify-between gap-3"},Jf={class:"font-display text-2xl font-bold"},Xf={class:"text-sm text-muted"},Yf={key:0},Zf={class:"mb-6 flex flex-wrap gap-2"},Qf={class:"mb-6 grid grid-cols-2 gap-3 md:grid-cols-5"},ep={class:"text-2xl font-bold"},tp={class:"m-help"},sp={class:"m-card mb-6 p-4"},np={class:"mb-3 font-semibold"},ip=["aria-label"],op=["title"],lp={class:"mb-6 grid gap-6 md:grid-cols-2"},rp={class:"m-card p-4"},ap={class:"mb-3 font-semibold"},cp={key:0,class:"text-sm text-muted"},up={class:"divide-y divide-line text-sm"},dp={class:"truncate"},fp={class:"text-muted"},pp={class:"m-card p-4"},hp={class:"mb-3 font-semibold"},mp={key:0,class:"text-sm text-muted"},gp={class:"divide-y divide-line text-sm"},bp={class:"truncate"},_p={class:"text-muted"},yp={class:"mb-3 font-semibold"},vp={key:0,class:"text-sm text-muted"},xp={class:"divide-y divide-line text-sm"},wp={class:"truncate"},$p={class:"text-muted"},Sp={class:"m-card mb-6 overflow-x-auto p-4"},kp={class:"mb-3 font-semibold"},Cp={class:"space-y-0.5 text-xs"},Tp={class:"w-9 shrink-0 text-muted"},Ap=["title"],Ep={class:"m-card mb-6 p-4"},Pp={class:"mb-3 font-semibold"},Op={class:"text-sm font-normal text-muted"},Mp={key:0,class:"text-sm text-muted"},Np={class:"divide-y divide-line text-sm"},Rp={class:"text-xs text-muted"},Vp={class:"text-muted"},Ip={class:"flex flex-wrap items-center gap-2 text-sm"},jp={class:"text-muted"},Dp=["href"],Up=_e({__name:"StatisticsReport",props:{range:{},ranges:{},exports:{},totals:{},previous:{},series:{},pages:{},posts:{},channels:{},sources:{},countries:{},devices:{},browsers:{},systems:{},heatmap:{},bots:{}},setup(e){const t=e,s=vt(()=>[["Visitors","visitors"],["Visits","visits"],["Page views","page_views"],["Average time","average_seconds"],["Bounce rate","bounce_rate"]]),n=(h,b)=>h==="average_seconds"?`${Math.floor(b/60)}:${String(b%60).padStart(2,"0")}`:h==="bounce_rate"?`${b}%`:b.toLocaleString(),i=h=>{const b=t.previous?.[h];return b?Math.round((t.totals[h]-b)/b*100):null},o=vt(()=>Math.max(1,...t.series.map(h=>h.visits))),l=vt(()=>Math.max(1,...t.heatmap.flatMap(h=>h.hours))),r=vt(()=>[["Channels",t.channels],["Sources",t.sources],["Countries",t.countries],["Devices",t.devices],["Browsers",t.browsers],["Systems",t.systems]]),a=h=>`${I.base}/statistics?range=${h}`,d=h=>`${I.base}/statistics/export?sheet=${h}&range=${new URLSearchParams(ie.path.split("?")[1]??"").get("range")??t.range.key}`;return(h,b)=>(g(),y(V,null,[u("div",zf,[u("h1",Jf,p(c(_)("Statistics")),1),u("p",Xf,[q(p(e.range.from)+" → "+p(e.range.to),1),e.range.compared_to?(g(),y("span",Yf," · "+p(c(_)("compared with"))+" "+p(e.range.compared_to),1)):M("",!0)])]),u("nav",Zf,[(g(!0),y(V,null,H(e.ranges,v=>(g(),ke(ze,{key:v.key,href:a(v.key),class:Ce(["m-btn",e.range.key===v.key?"m-btn-primary":"m-btn-secondary"])},{default:Ie(()=>[q(p(v.label),1)]),_:2},1032,["href","class"]))),128))]),u("div",Qf,[(g(!0),y(V,null,H(s.value,([v,R])=>(g(),y("div",{key:R,class:"m-card p-4"},[u("p",ep,p(n(R,e.totals[R])),1),u("p",tp,[q(p(c(_)(v)),1),i(R)!==null?(g(),y("span",{key:0,class:Ce((i(R)??0)>=0?"text-emerald-500":"text-red-500")},p((i(R)??0)>0?"+":"")+p(i(R))+"%",3)):M("",!0)])]))),128))]),u("section",sp,[u("h2",np,p(c(_)("Visits")),1),u("div",{class:"flex h-40 items-end gap-px",role:"img","aria-label":c(_)("Visits")},[(g(!0),y(V,null,H(e.series,v=>(g(),y("div",{key:v.key,class:"min-w-px flex-1 rounded-t bg-brand",style:wt({height:Math.max(2,v.visits/o.value*100)+"%"}),title:`${v.label}: ${v.visits}`},null,12,op))),128))],8,ip)]),u("div",lp,[u("section",rp,[u("h2",ap,p(c(_)("Pages")),1),e.pages.length?M("",!0):(g(),y("p",cp,p(c(_)("Nothing here yet.")),1)),u("ul",up,[(g(!0),y(V,null,H(e.pages,v=>(g(),y("li",{key:v.path,class:"flex justify-between gap-3 py-1.5"},[u("span",dp,p(v.title??v.path),1),u("span",fp,p(v.views),1)]))),128))])]),u("section",pp,[u("h2",hp,p(c(_)("Posts")),1),e.posts.length?M("",!0):(g(),y("p",mp,p(c(_)("Nothing here yet.")),1)),u("ul",gp,[(g(!0),y(V,null,H(e.posts,v=>(g(),y("li",{key:v.slug,class:"flex justify-between gap-3 py-1.5"},[u("span",bp,p(v.title),1),u("span",_p,p(v.views),1)]))),128))])]),(g(!0),y(V,null,H(r.value,([v,R])=>(g(),y("section",{key:v,class:"m-card p-4"},[u("h2",yp,p(c(_)(v)),1),R.length?M("",!0):(g(),y("p",vp,p(c(_)("Nothing here yet.")),1)),u("ul",xp,[(g(!0),y(V,null,H(R,N=>(g(),y("li",{key:N.name+(N.channel??""),class:"flex justify-between gap-3 py-1.5"},[u("span",wp,p(N.name||c(_)("Direct")),1),u("span",$p,p(N.visits),1)]))),128))])]))),128))]),u("section",Sp,[u("h2",kp,p(c(_)("When people visit")),1),u("div",Cp,[(g(!0),y(V,null,H(e.heatmap,v=>(g(),y("div",{key:v.day,class:"flex items-center gap-0.5"},[u("span",Tp,p(v.day),1),(g(!0),y(V,null,H(v.hours,(R,N)=>(g(),y("span",{key:N,class:"block h-5 min-w-3 flex-1 rounded-sm border border-line",title:`${v.day} ${N}:00 · ${R}`,style:wt({background:`color-mix(in srgb, var(--m-brand) ${Math.round(R/l.value*100)}%, var(--m-panel-2))`})},null,12,Ap))),128))]))),128))])]),u("section",Ep,[u("h2",Pp,[q(p(c(_)("Programs"))+" ",1),u("span",Op,"· "+p(e.bots.total),1)]),e.bots.names.length?M("",!0):(g(),y("p",Mp,p(c(_)("Nothing here yet.")),1)),u("ul",Np,[(g(!0),y(V,null,H(e.bots.names,v=>(g(),y("li",{key:v.name,class:"flex justify-between gap-3 py-1.5"},[u("span",null,[q(p(v.name)+" ",1),u("span",Rp,p(v.kind),1)]),u("span",Vp,p(v.hits),1)]))),128))])]),u("p",Ip,[u("span",jp,p(c(_)("Download"))+":",1),(g(!0),y(V,null,H(e.exports,(v,R)=>(g(),y("a",{key:R,href:d(String(R)),class:"m-btn m-btn-secondary"},p(v)+" (CSV)",9,Dp))),128))])],64))}}),Lp={class:"font-display mb-6 text-2xl font-bold"},Fp={key:0,class:"m-card p-5 text-sm text-muted"},Bp={key:1,class:"m-card divide-y divide-line"},Hp={class:"min-w-0"},Kp={class:"truncate font-semibold"},Wp={class:"truncate text-xs text-muted"},qp={class:"m-badge"},Gp={key:2,class:"mt-4 flex gap-2"},zp=_e({__name:"ListPage",props:{data:{},current_page:{},last_page:{},path:{}},setup(e){const t=e,s=vt(()=>ie.path.includes("/reviews")?"reviews":"pages"),n=vt(()=>s.value==="reviews"?"Reviews":"Pages"),i=a=>s.value==="reviews"?a.author:a.title,o=a=>s.value==="reviews"?a.rating?"★".repeat(a.rating):"":a.slug,l=a=>s.value==="reviews"?a.is_visible:a.is_published,r=a=>`${ie.path.split("?")[0]}?page=${a}`;return(a,d)=>(g(),y(V,null,[u("h1",Lp,p(c(_)(n.value)),1),t.data.length?(g(),y("ul",Bp,[(g(!0),y(V,null,H(t.data,h=>(g(),y("li",{key:h.id,class:"flex items-center justify-between gap-3 p-4"},[u("div",Hp,[u("p",Kp,p(i(h)),1),u("p",Wp,p(o(h)),1)]),u("span",qp,p(l(h)?c(_)("Published"):c(_)("Draft")),1)]))),128))])):(g(),y("p",Fp,p(c(_)("Nothing here yet.")),1)),t.last_page>1?(g(),y("nav",Gp,[t.current_page>1?(g(),ke(ze,{key:0,href:r(t.current_page-1),class:"m-btn m-btn-secondary"},{default:Ie(()=>[q(p(c(_)("Previous")),1)]),_:1},8,["href"])):M("",!0),t.current_page[q(p(c(_)("Next")),1)]),_:1},8,["href"])):M("",!0)])):M("",!0)],64))}}),Jp=[{pattern:/^\/?$/,component:Ea,data:!0},{pattern:/^\/login$/,component:Wa,guest:!0},{pattern:/^\/profile$/,component:fu,data:!0},{pattern:/^\/posts$/,component:Lc,data:!0},{pattern:/^\/posts\/create$/,component:Ci,data:!0},{pattern:/^\/posts\/\d+\/edit$/,component:Ci,data:!0},{pattern:/^\/media$/,component:Wd,data:!0,source:"/media/items"},{pattern:/^\/audit$/,component:Gf,data:!0},{pattern:/^\/statistics$/,component:Up,data:!0},{pattern:/^\/accounts$/,component:Uu,data:!0},{pattern:/^\/groups$/,component:id,data:!0},{pattern:/^\/labels$/,component:_d,data:!0},{pattern:/^\/(pages|reviews)$/,component:zp,data:!0}],ie=Kt({path:"",component:null,props:{},loading:!0,forbidden:!1,toast:null});let Ti;function be(e,t=!1){ie.toast={text:e,error:t},window.clearTimeout(Ti),Ti=window.setTimeout(()=>ie.toast=null,4e3)}function Xp(e){return e.split("?")[0].slice(I.base.length)||"/"}async function Vs(e){const t=Jp.find(s=>s.pattern.test(Xp(e)));if(!I.user&&!t?.guest){window.location.assign(I.base+"/login");return}if(I.user&&t?.guest)return zs(I.base,!0);ie.loading=!0,ie.forbidden=!1,ie.path=e,ie.component=t?.component??Ma,ie.props={};try{ie.props=t?.data?await Re.get(t.source?I.base+t.source:e):{}}catch(s){s instanceof Rt&&s.status===401?window.location.assign(I.base+"/login"):s instanceof Rt&&s.status===403?ie.forbidden=!0:be(_("Something went wrong. Try again."),!0)}finally{ie.loading=!1}}function zs(e,t=!1){return window.history[t?"replaceState":"pushState"]({},"",e),window.scrollTo(0,0),Vs(e)}function Ae(){return Vs(ie.path)}function Yp(){window.addEventListener("popstate",()=>Vs(window.location.pathname+window.location.search)),Vs(window.location.pathname+window.location.search)}const Zp={class:"min-h-screen"},Qp={class:"fixed inset-x-0 top-0 z-40 flex h-14 items-center justify-between border-b border-line bg-panel px-4 md:hidden"},eh={class:"font-display font-bold"},th=["aria-expanded"],sh={class:"hidden h-16 items-center gap-2 px-5 md:flex"},nh=["src"],ih={class:"font-display text-lg font-bold"},oh={class:"flex-1 space-y-0.5 overflow-y-auto px-3 py-3","aria-label":"Manager"},lh={class:"border-t border-line p-4"},rh={class:"truncate text-sm font-semibold group-hover:text-brand"},ah={class:"truncate text-xs text-muted"},ch={class:"px-4 pb-16 pt-20 md:ml-60 md:px-8 md:pt-8"},uh={class:"mx-auto max-w-5xl"},dh=_e({__name:"Layout",setup(e){const t=ot(!1),s=vt(()=>[{label:"Dashboard",href:I.base},...I.navigation]);function n(o){const l=ie.path.split("?")[0];return o===I.base?l===o:l===o||l.startsWith(o+"/")}async function i(){const{redirect:o}=await Re.post(I.base+"/logout");window.location.assign(o)}return Cs(()=>ie.path,()=>t.value=!1),(o,l)=>(g(),y("div",Zp,[u("header",Qp,[u("span",eh,p(c(I).name),1),u("button",{type:"button",class:"m-btn m-btn-secondary","aria-expanded":t.value,onClick:l[0]||(l[0]=r=>t.value=!t.value)},p(c(_)("Menu")),9,th)]),u("aside",{class:Ce(["fixed inset-y-0 left-0 z-30 flex w-60 flex-col border-r border-line bg-panel pt-14 transition-transform md:translate-x-0 md:pt-0",t.value?"translate-x-0":"-translate-x-full"])},[u("div",sh,[c(I).logo?(g(),y("img",{key:0,src:c(I).logo,alt:"",class:"h-7 w-auto"},null,8,nh)):M("",!0),u("span",ih,p(c(I).name),1)]),u("nav",oh,[(g(!0),y(V,null,H(s.value,r=>(g(),ke(ze,{key:r.href,href:r.href,class:Ce(["block rounded-lg px-3 py-2 text-sm font-medium transition",n(r.href)?"bg-brand/15 text-text":"text-muted hover:bg-text/5 hover:text-text"]),"aria-current":n(r.href)?"page":void 0},{default:Ie(()=>[q(p(c(_)(r.label)),1)]),_:2},1032,["href","class","aria-current"]))),128))]),u("div",lh,[Ne(ze,{href:c(I).base+"/profile",class:"group block"},{default:Ie(()=>[u("p",rh,p(c(I).user?.name),1),u("p",ah,p(c(I).user?.email),1)]),_:1},8,["href"]),u("button",{type:"button",class:"m-btn m-btn-secondary mt-3 w-full justify-center",onClick:i},p(c(_)("Log out")),1)])],2),t.value?(g(),y("div",{key:0,class:"fixed inset-0 z-20 bg-black/60 md:hidden",onClick:l[1]||(l[1]=r=>t.value=!1)})):M("",!0),u("main",ch,[u("div",uh,[mo(o.$slots,"default")])])]))}}),fh={key:0,class:"m-card p-5 text-sm"},ph={key:1,class:"text-sm text-muted"},hh=_e({__name:"App",setup(e){return(t,s)=>(g(),y(V,null,[c(ie).component&&!c(I).user?(g(),ke(ei(c(ie).component),{key:0})):c(ie).component?(g(),ke(dh,{key:1},{default:Ie(()=>[c(ie).forbidden?(g(),y("p",fh,p(c(_)("You may not open this page.")),1)):c(ie).loading?(g(),y("p",ph,p(c(_)("Loading…")),1)):(g(),ke(ei(c(ie).component),tl(Io({key:2},c(ie).props)),null,16))]),_:1})):M("",!0),c(ie).toast?(g(),y("div",{key:2,role:"status",class:Ce(["fixed bottom-5 right-5 z-50 rounded-lg border border-l-4 border-line bg-panel px-4 py-3 text-sm font-medium text-text shadow-xl",c(ie).toast.error?"border-l-red-500":"border-l-emerald-500"])},p(c(ie).toast.text),3)):M("",!0)],64))}});Sa(I.locale);ya(hh).mount("#manager");Yp(); +var e=Object.defineProperty,t=(t,n)=>{let r=Object.setPrototypeOf({},null);for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n&1||e(r,Symbol.toStringTag,{value:`Module`}),n&2?r:Object.preventExtensions(r)};function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>C(e)===`[object Map]`,h=e=>C(e)===`[object Set]`,g=e=>C(e)===`[object Date]`,_=e=>C(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),ee=Object.prototype.toString,C=e=>ee.call(e),te=e=>C(e).slice(8,-1),w=e=>C(e)===`[object Object]`,T=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,ne=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),re=1e4,ie=e=>{let t=Object.create(null),n=0;return(r=>{let i=t[r];return i===void 0?(++n>re&&(t=Object.create(null),n=1),t[r]=e(r)):i})},ae=/-\w/g,E=ie(e=>e.replace(ae,e=>e.slice(1).toUpperCase())),oe=/\B([A-Z])/g,se=ie(e=>e.replace(oe,`-$1`).toLowerCase()),ce=ie(e=>e.charAt(0).toUpperCase()+e.slice(1)),le=ie(e=>e?`on${ce(e)}`:``),D=(e,t)=>!Object.is(e,t),ue=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},fe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},pe=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},me,he=()=>me||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ge=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function _e(e){if(p(e)){let t={};for(let n=0;ne.startsWith(`/*`)?``:e).split(ve).forEach(e=>{if(e){let n=e.split(ye);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function O(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;nAe(e,t))}function Me(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!=`function`&&typeof e.valueOf!=`function`?C(e):String(e)}var Ne=e=>!!(e&&e.__v_isRef===!0),k=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===ee||!v(e.toString))?Ne(e)?k(e.value):JSON.stringify(e,Pe,2):String(e),Pe=(e,t)=>Ne(t)?Pe(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Fe(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Fe(e))}:b(t)?Fe(t):x(t)&&!p(t)&&!w(t)?String(t):t,Fe=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function Ie(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var Le,Re=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Le&&(Le.active?(this.parent=Le,this.index=(Le.scopes||(Le.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e0&&--this._on===0){if(Le===this)Le=this.prevScope;else{let e=Le;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t0)return;if(Ke){let e=Ke;for(Ke=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ge;){let t=Ge;for(Ge=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Xe(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ze(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),et(r),tt(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Qe(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&($e(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function $e(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===lt)||(e.globalVersion=lt,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Qe(e))))return;e.flags|=2;let t=e.dep,n=A,r=it;A=e,it=!0;try{Xe(e);let n=e.fn(e._value);(t.version===0||D(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{A=n,it=r,Ze(e),e.flags&=-3}}function et(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)et(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function tt(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function nt(e,t){e.effect instanceof Ue&&(e=e.effect.fn);let n=new Ue(e);t&&l(n,t);try{n.run()}catch(e){throw n.stop(),e}let r=n.run.bind(n);return r.effect=n,r}function rt(e){e.effect.stop()}var it=!0,at=[];function ot(){at.push(it),it=!1}function st(){let e=at.pop();it=e===void 0||e}function ct(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=A;A=void 0;try{t()}finally{A=e}}}var lt=0,ut=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},dt=class{constructor(e){this.computed=e,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(e){if(!A||!it||A===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==A)t=this.activeLink=new ut(A,this),A.deps?(t.prevDep=A.depsTail,A.depsTail.nextDep=t,A.depsTail=t):A.deps=A.depsTail=t,ft(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=A.depsTail,t.nextDep=void 0,A.depsTail.nextDep=t,A.depsTail=t,A.deps===t&&(A.deps=e)}return t}trigger(e){this.version++,lt++,this.notify(e)}notify(e){Je();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ye()}}};function ft(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)ft(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var pt=new WeakMap,mt=Symbol(``),ht=Symbol(``),gt=Symbol(``);function _t(e,t,n){if(it&&A){let t=pt.get(e);t||pt.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new dt),r.map=t,r.key=n),r.track()}}function vt(e,t,n,r,i,a){let o=pt.get(e);if(!o){lt++;return}let s=e=>{e&&e.trigger()};if(Je(),t===`clear`)o.forEach(s);else{let i=p(e),a=i&&T(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===gt||!b(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(gt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(mt)),m(e)&&s(o.get(ht)));break;case`delete`:i||(s(o.get(mt)),m(e)&&s(o.get(ht)));break;case`set`:m(e)&&s(o.get(mt))}}Ye()}function yt(e,t){let n=pt.get(e);return n&&n.get(t)}function bt(e){let t=j(e);return t===e||(_t(t,`iterate`,gt),dn(e))?t:un(e)?ln(e)?t.map(e=>hn(mn(e))):t.map(hn):t.map(mn)}function xt(e){return _t(e=j(e),`iterate`,gt),e}var St=e=>hn(mn(e));function Ct(e){return un(e)?ln(e)?St:hn:mn}var wt={__proto__:null,[Symbol.iterator](){return Tt(this,Symbol.iterator,Ct(this))},concat(...e){return bt(this).concat(...e.map(e=>p(e)?bt(e):e))},entries(){let e=Ct(this);return Tt(this,`entries`,t=>(t[1]=e(t[1]),t))},every(e,t){return Ot(this,`every`,e,t,void 0,arguments)},filter(e,t){return Ot(this,`filter`,e,t,e=>e.map(Ct(this)),arguments)},find(e,t){return Ot(this,`find`,e,t,e=>Ct(this)(e),arguments)},findIndex(e,t){return Ot(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Ot(this,`findLast`,e,t,e=>Ct(this)(e),arguments)},findLastIndex(e,t){return Ot(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Ot(this,`forEach`,e,t,void 0,arguments)},includes(...e){return At(this,`includes`,e)},indexOf(...e){return At(this,`indexOf`,e)},join(e){return bt(this).join(e)},lastIndexOf(...e){return At(this,`lastIndexOf`,e)},map(e,t){return Ot(this,`map`,e,t,void 0,arguments)},pop(){return jt(this,`pop`)},push(...e){return jt(this,`push`,e)},reduce(e,...t){return kt(this,`reduce`,e,t)},reduceRight(e,...t){return kt(this,`reduceRight`,e,t)},shift(){return jt(this,`shift`)},some(e,t){return Ot(this,`some`,e,t,void 0,arguments)},splice(...e){return jt(this,`splice`,e)},toReversed(){return bt(this).toReversed()},toSorted(e){return bt(this).toSorted(e)},toSpliced(...e){return bt(this).toSpliced(...e)},unshift(...e){return jt(this,`unshift`,e)},values(){return Tt(this,`values`,Ct(this))}};function Tt(e,t,n){let r=xt(e),i=r[t],a=i.call(r);if(r!==e&&!dn(e)){if(a[Symbol.toStringTag]===`Array Iterator`){let e=Object.create(Object.getPrototypeOf(a));return e.next=()=>Et(a.next(),n),i!==Dt[t]&&Object.defineProperties(e,{return:{get(){let e=a.return;return typeof e==`function`?e.bind(a):e}},throw:{get(){let e=a.throw;return typeof e==`function`?e.bind(a):e}}}),e}a._next=a.next,a.next=()=>Et(a._next(),n)}return a}function Et(e,t){return e.done||(e.value=t(e.value)),e}var Dt=Array.prototype;function Ot(e,t,n,r,i,a){let o=xt(e),s=o!==e&&!dn(e),c=o[t];if(c!==Dt[t]){let t=c.apply(e,a);return s?mn(t):t}let l=n;if(o!==e){if(s){let t=Ct(e);l=function(r,i){return n.call(this,t(r),i,e)}}else n.length>2&&(l=function(t,r){return n.call(this,t,r,e)})}let u=c.call(o,l,r);return s&&i?i(u):u}function kt(e,t,n,r){let i=xt(e),a=i!==e&&!dn(e),o=n,s=!1;if(i!==e){if(a){let t=Ct(e);s=r.length===0,o=function(r,i,a){return s&&(s=!1,r=t(r)),n.call(this,r,t(i),a,e)}}else n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)})}let c=i[t](o,...r);return s?Ct(e)(c):c}function At(e,t,n){let r=j(e);_t(r,`iterate`,gt);let i=r[t](...n);return(i===-1||i===!1)&&fn(n[0])?(n[0]=j(n[0]),r[t](...n)):i}function jt(e,t,n=[]){ot(),Je();let r=j(e)[t].apply(e,n);return Ye(),st(),r}var Mt=n(`__proto__,__v_isRef,__isVue`),Nt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(b));function Pt(e){b(e)||(e=String(e));let t=j(this);return _t(t,`has`,e),t.hasOwnProperty(e)}var Ft=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?tn:en:i?$t:Qt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=p(e);if(!r){let e;if(a&&(e=wt[t]))return e;if(t===`hasOwnProperty`)return Pt}let o=Reflect.get(e,t,M(e)?e:n);if((b(t)?Nt.has(t):Mt(t))||(r||_t(e,`get`,t),i))return o;if(M(o)){let e=a&&T(t)?o:o.value;return r&&x(e)?on(e):e}return x(o)?r?on(o):rn(o):o}},It=class extends Ft{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=p(e)&&T(t);if(!this._isShallow){let e=un(i);if(!dn(n)&&!un(n)&&(i=j(i),n=j(n)),!a&&M(i)&&!M(n))return e||(i.value=n),!0}let o=a?Number(t)e,Ut=e=>Reflect.getPrototypeOf(e);function Wt(e,t,n){return function(...r){let i=this.__v_raw,a=j(i),o=m(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,u=i[e](...r),d=n?Ht:t?hn:mn;return!t&&_t(a,`iterate`,c?ht:mt),l(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Gt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Kt(e,t){let n={get(n){let r=this.__v_raw,i=j(r),a=j(n);e||(D(n,a)&&_t(i,`get`,n),_t(i,`get`,a));let{has:o}=Ut(i),s=t?Ht:e?hn:mn;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&_t(j(t),`iterate`,mt),t.size},has(t){let n=this.__v_raw,r=j(n),i=j(t);return e||(D(t,i)&&_t(r,`has`,t),_t(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=j(a),s=t?Ht:e?hn:mn;return!e&&_t(o,`iterate`,mt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return l(n,e?{add:Gt(`add`),set:Gt(`set`),delete:Gt(`delete`),clear:Gt(`clear`)}:{add(e){let n=j(this),r=Ut(n),i=j(e),a=!t&&!dn(e)&&!un(e)?i:e;return r.has.call(n,a)||D(e,a)&&r.has.call(n,e)||D(i,a)&&r.has.call(n,i)||(n.add(a),vt(n,`add`,a,a)),this},set(e,n){t||dn(n)||un(n)||(n=j(n));let r=j(this),{has:i,get:a}=Ut(r),o=i.call(r,e);o||=(e=j(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?D(n,s)&&vt(r,`set`,e,n,s):vt(r,`add`,e,n),this},delete(e){let t=j(this),{has:n,get:r}=Ut(t),i=n.call(t,e);i||=(e=j(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&vt(t,`delete`,e,void 0,a),o},clear(){let e=j(this),t=e.size!==0,n=e.clear();return t&&vt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Wt(r,e,t)}),n}function qt(e,t){let n=Kt(e,t);return(r,i,a)=>i===`__v_isReactive`?!e:i===`__v_isReadonly`?e:i===`__v_isShallow`?t:i===`__v_raw`?r:Reflect.get(f(n,i)&&i in r?n:r,i,a)}var Jt={get:qt(!1,!1)},Yt={get:qt(!1,!0)},Xt={get:qt(!0,!1)},Zt={get:qt(!0,!0)},Qt=new WeakMap,$t=new WeakMap,en=new WeakMap,tn=new WeakMap;function nn(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function rn(e){return un(e)?e:cn(e,!1,Rt,Jt,Qt)}function an(e){return cn(e,!1,Bt,Yt,$t)}function on(e){return cn(e,!0,zt,Xt,en)}function sn(e){return cn(e,!0,Vt,Zt,tn)}function cn(e,t,n,r,i){if(!x(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=nn(te(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function ln(e){return un(e)?ln(e.__v_raw):!!(e&&e.__v_isReactive)}function un(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function fn(e){return e?!!e.__v_raw:!1}function j(e){let t=e&&e.__v_raw;return t?j(t):e}function pn(e){return!f(e,`__v_skip`)&&Object.isExtensible(e)&&de(e,`__v_skip`,!0),e}var mn=e=>x(e)?rn(e):e,hn=e=>x(e)?on(e):e;function M(e){return e?e.__v_isRef===!0:!1}function N(e){return _n(e,!1)}function gn(e){return _n(e,!0)}function _n(e,t){return M(e)?e:new vn(e,t)}var vn=class{constructor(e,t){this.dep=new dt,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:j(e),this._value=t?e:mn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||dn(e)||un(e);e=n?e:j(e),D(e,t)&&(this._rawValue=e,this._value=n?e:mn(e),this.dep.trigger())}};function yn(e){e.dep&&e.dep.trigger()}function P(e){return M(e)?e.value:e}function bn(e){return v(e)?e():P(e)}var xn={get:(e,t,n)=>t===`__v_raw`?e:P(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return M(i)&&!M(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Sn(e){return ln(e)?e:new Proxy(e,xn)}var Cn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new dt,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function wn(e){return new Cn(e)}function Tn(e){let t=p(e)?Array(e.length):{};for(let n in e)t[n]=kn(e,n);return t}var En=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=b(t)?t:String(t),this._raw=j(e);let r=!0,i=e;if(!p(e)||b(this._key)||!T(this._key))do r=!fn(i)||dn(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=P(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&M(this._raw[this._key])){let t=this._object[this._key];if(M(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return yt(this._raw,this._key)}},Dn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function On(e,t,n){return M(e)?e:v(e)?new Dn(e):x(e)&&arguments.length>1?kn(e,t,n):N(e)}function kn(e,t,n){return new En(e,t,n)}var An=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new dt(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=lt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&A!==this)return qe(this,!0),!0}get value(){let e=this.dep.track();return $e(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function jn(e,t,n=!1){let r,i;return v(e)?r=e:(r=e.get,i=e.set),new An(r,i,n)}var Mn={GET:`get`,HAS:`has`,ITERATE:`iterate`},Nn={SET:`set`,ADD:`add`,DELETE:`delete`,CLEAR:`clear`},Pn={},Fn=new WeakMap,In=void 0;function Ln(){return In}function Rn(e,t=!1,n=In){if(n){let t=Fn.get(n);t||Fn.set(n,t=[]),t.push(e)}}function zn(e,t,n=r){let{immediate:i,deep:o,once:s,scheduler:c,augmentJob:l,call:d,onStop:f}=n,m=e=>o?e:dn(e)||o===!1||o===0?Bn(e,1):Bn(e),h,g,_,y,b=!1,x=!1;if(M(e)?(g=()=>e.value,b=dn(e)):ln(e)?(g=()=>m(e),b=!0):p(e)?(x=!0,b=e.some(e=>ln(e)||dn(e)),g=()=>e.map(e=>{if(M(e))return e.value;if(ln(e))return m(e);if(v(e))return d?d(e,2):e()})):g=v(e)?t?d?()=>d(e,2):e:()=>{if(_){ot();try{_()}finally{st()}}let t=In;In=h;try{return d?d(e,3,[y]):e(y)}finally{In=t}}:a,t&&o){let e=g,t=o===!0?1/0:o;g=()=>Bn(e(),x?t+1:t)}let S=Be(),ee=()=>{h.stop(),S&&S.active&&u(S.effects,h)},C=!1;if(s&&t){let e=t;t=(...t)=>{C=!0;try{return e(...t)}finally{ee()}}}let te=x?Array(e.length).fill(Pn):Pn,w=e=>{if(!C&&h.flags&1&&(h.dirty||e)){if(t){let n=h.run();if(e||o||b||(x?n.some((e,t)=>D(e,te[t])):D(n,te))){let e=In;ot();try{_&&_(),In=h;let e=[n,te===Pn?void 0:x&&te[0]===Pn?[]:te,y];te=n,d?d(t,3,e):t(...e)}finally{In=e,st()}}}else h.run()}};return l&&l(w),h=new Ue(g),h.scheduler=c?()=>c(w,!1):w,y=e=>Rn(e,!1,h),_=h.onStop=()=>{let e=Fn.get(h);if(e){if(d)d(e,4);else for(let t of e)t();Fn.delete(h)}},f&&(h.onStop=()=>{_(),f()}),t?i?w(!0):te=h.run():c?c(w.bind(null,!0),!0):h.run(),ee.pause=h.pause.bind(h),ee.resume=h.resume.bind(h),ee.stop=ee,ee}function Bn(e,t=1/0,n){if(t<=0||!x(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,M(e))Bn(e.value,t,n);else if(p(e)){if(ln(e)&&!un(e)&&!dn(e)){let r=j(e);_t(r,`iterate`,gt);for(let e=0;e{Bn(e,t,n)});else if(w(e)){for(let r in e)Bn(e[r],t,n);let r=j(e);for(let i of Object.getOwnPropertySymbols(r))Object.prototype.propertyIsEnumerable.call(r,i)&&Bn(e[i],t,n)}return e}var Vn=[];function Hn(e){Vn.push(e)}function Un(){Vn.pop()}function Wn(e,t){}var Gn={SETUP_FUNCTION:0,0:`SETUP_FUNCTION`,RENDER_FUNCTION:1,1:`RENDER_FUNCTION`,NATIVE_EVENT_HANDLER:5,5:`NATIVE_EVENT_HANDLER`,COMPONENT_EVENT_HANDLER:6,6:`COMPONENT_EVENT_HANDLER`,VNODE_HOOK:7,7:`VNODE_HOOK`,DIRECTIVE_HOOK:8,8:`DIRECTIVE_HOOK`,TRANSITION_HOOK:9,9:`TRANSITION_HOOK`,APP_ERROR_HANDLER:10,10:`APP_ERROR_HANDLER`,APP_WARN_HANDLER:11,11:`APP_WARN_HANDLER`,FUNCTION_REF:12,12:`FUNCTION_REF`,ASYNC_COMPONENT_LOADER:13,13:`ASYNC_COMPONENT_LOADER`,SCHEDULER:14,14:`SCHEDULER`,COMPONENT_UPDATE:15,15:`COMPONENT_UPDATE`,APP_UNMOUNT_CLEANUP:16,16:`APP_UNMOUNT_CLEANUP`},Kn={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function qn(e,t,n,r){try{return r?e(...r):e()}catch(e){Yn(e,t,n)}}function Jn(e,t,n,r){if(v(e)){let i=qn(e,t,n,r);return i&&S(i)&&i.catch(e=>{Yn(e,t,n,void 0,!0)}),i}if(p(e)){let i=[];for(let a=0;a>>1,i=Zn[r],a=pr(i);a=pr(n)?Zn.push(e):Zn.splice(ar(t),0,e),e.flags|=1,sr()}}function sr(){rr||=nr.then(mr)}function cr(e){if(!p(e))er&&e.id===-1?er.splice(tr+1,0,e):e.flags&1||($n.push(e),e.flags|=1);else for(let t=0;t=t))continue;Zn.splice(r,1),r=e?r-1:Qn,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function ur(e,t,n=0){if($n.length){let e=$n,r=0;if(t){e=[];for(let i=0;i<$n.length;i++){let a=$n[i];(a.i===void 0?t.has(a):!a.i||a.i.uidpr(e)-pr(t));if($n.length=r,er){for(let e=0;ee.id==null?e.flags&2?-1:1/0:e.id;function mr(e){try{for(Qn=0;Qnhr.emit(e,...t)),gr=[]):typeof window<`u`&&window.HTMLElement&&!(window.navigator?.userAgent)?.includes(`jsdom`)?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(e=>{_r(e,t)}),setTimeout(()=>{hr||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,gr=[])},3e3)):gr=[]}var vr=null,yr=null;function br(e){let t=vr;return vr=e,yr=e&&e.type.__scopeId||null,t}function xr(e){yr=e}function Sr(){yr=null}var Cr=e=>F;function F(e,t=vr,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&Cs(-1);let i=br(t),a=ys.length,o;try{o=e(...n)}finally{for(let e=ys.length;e>a;e--)xs();br(i),r._d&&Cs(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function I(e,t){if(vr===null)return e;let n=cc(vr),i=e.dirs||=[];for(let e=0;e1)return n&&v(t)?t.call(r&&r.proxy):t}}function Dr(){return!!(Ws()||lo)}var Or=Symbol.for(`v-scx`),kr=()=>Er(Or);function Ar(e,t){return Pr(e,null,t)}function jr(e,t){return Pr(e,null,{flush:`post`})}function Mr(e,t){return Pr(e,null,{flush:`sync`})}function Nr(e,t,n){return Pr(e,t,n)}function Pr(e,t,n=r){let{immediate:i,deep:o,flush:s,once:c}=n,u=l({},n),d=t&&i||!t&&s!==`post`,f;if(Xs){if(s===`sync`){let e=kr();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=a,e.resume=a,e.pause=a,e}}let p=Us,m;if(p&&Be()!==p.scope){if(p.scope.active){let e=p.scope.run(()=>new Re);e.run(()=>Ve(()=>Promise.resolve().then(()=>{p=null,m&&(m.i=null)}))),u.onStop=()=>e.stop()}else p=null}u.call=(e,t,n)=>Jn(e,p,t,n);let h=!1;s===`post`?u.scheduler=e=>{e.i=p,z(e,p&&p.suspense)}:s!==`sync`&&(h=!0,u.scheduler=(e,t)=>{t?e():or(e)}),u.augmentJob=e=>{m=e,t&&(e.flags|=4),h&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let g=zn(e,t,u);return Xs&&(f?f.push(g):d&&g()),g}function Fr(e,t,n){let r=this.proxy,i=y(e)?e.includes(`.`)?Ir(r,e):()=>r[e]:e.bind(r,r),a;v(t)?a=t:(a=t.handler,n=t);let o=qs(this),s=Pr(i,a.bind(r),n);return o(),s}function Ir(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;ee.__isTeleport,Br=e=>e&&(e.disabled||e.disabled===``),Vr=e=>e&&(e.defer||e.defer===``),Hr=e=>typeof SVGElement<`u`&&e instanceof SVGElement,Ur=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,Wr=(e,t)=>{let n=e&&e.to;return y(n)?t?t(n):null:n},Gr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Br(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Br(e.props),r=e.target=Wr(e.props,m),a=Xr(r,e,h,p);r&&(o!==`svg`&&Hr(r)?o=`svg`:o!==`mathml`&&Ur(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),Yr(e,!1)))},S=e=>{let t=()=>{if(Lr.get(e)===t){if(Lr.delete(e),Br(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),Yr(e,!0)}x(e)}};Lr.set(e,t),z(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Vr(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),Yr(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Lr.get(e);if(u){u.flags|=8,Lr.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Br(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Hr(p)?o=`svg`:(o===`mathml`||Ur(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),Yo(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Kr(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=Wr(t.props,m);e&&(t.target=e,Kr(t,e,null,l,0))}else g&&Kr(t,p,h,l,1);Yr(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Br(f),m=a||!p,h=Lr.get(e);if(h&&(h.flags|=8,Lr.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e{e.isMounted=!0}),sa(()=>{e.isUnmounting=!0}),e}var ei=[Function,Array],ti={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ei,onEnter:ei,onAfterEnter:ei,onEnterCancelled:ei,onBeforeLeave:ei,onLeave:ei,onAfterLeave:ei,onLeaveCancelled:ei,onBeforeAppear:ei,onAppear:ei,onAfterAppear:ei,onAppearCancelled:ei},ni={name:`BaseTransition`,props:ti,setup(e,{slots:t}){let n=Ws(),r=$r();return()=>{let i=t.default&&ui(t.default(),!0),a=i&&i.length?ri(i):n.subTree?J():void 0;if(!a)return;let o=j(e),{mode:s}=o;if(r.isLeaving)return si(a);let c=ci(a);if(!c)return si(a);let l=oi(c,o,r,n);c.type!==V&&li(c,l);let u=n.subTree&&ci(n.subTree);if(u&&u.type!==V&&!Es(u,c)&&di(n.subTree)){let e=oi(u,o,r,n);if(li(u,e),s===`out-in`&&c.type!==V)return r.isLeaving=!0,e.afterLeave=()=>{if(r.isLeaving=!1,!(n.job.flags&8)){if(n.effect.flags&2){let e=()=>{n.job.flags&8||n.update()};e.i=n,or(e)}else n.update()}delete e.afterLeave,u=void 0},si(a);s===`in-out`&&c.type!==V?e.delayLeave=(t,n,i)=>{let a=ai(r,u);a[String(u.key)]=u,t[Zr]=()=>{n(),t[Zr]=void 0,delete l.delayedLeave,delete e.delayLeave,u=void 0},l.delayedLeave=()=>{i(),delete l.delayedLeave,delete e.delayLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function ri(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==V){t=n;break}}return t}var ii=ni;function ai(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function oi(e,t,n,r){let{appear:i,mode:a,persisted:o=!1,onBeforeEnter:s,onEnter:c,onAfterEnter:l,onEnterCancelled:u,onBeforeLeave:d,onLeave:f,onAfterLeave:m,onLeaveCancelled:h,onBeforeAppear:g,onAppear:_,onAfterAppear:v,onAppearCancelled:y}=t,b=String(e.key),x=ai(n,e),S=(e,t)=>{e&&Jn(e,r,9,t)},ee=(e,t)=>{let n=t[1];S(e,t),p(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},C={mode:a,persisted:o,beforeEnter(t){let r=s;if(!n.isMounted){if(i)r=g||s;else return}t[Zr]&&t[Zr](!0);let a=x[b];if(a&&Es(e,a)){let e=a.el[Zr];if(!e){let t=di(a);e=t&&t.el[Zr]}e&&e()}S(r,[t])},enter(e){if(e[Zr]){C.delayedLeave&&C.delayedLeave();return}let t=c,r=l,a=u;if(!n.isMounted){if(i)t=_||c,r=v||l,a=y||u;else return}let o=!1;e[Qr]=t=>{o||(o=!0,S(t?a:r,[e]),C.delayedLeave&&C.delayedLeave(),e[Qr]=void 0)};let s=e[Qr].bind(null,!1);t?ee(t,[e,s]):s()},leave(t,r){let i=String(e.key);if(t[Qr]&&t[Qr](!0),n.isUnmounting)return r();S(d,[t]);let a=!1;t[Zr]=n=>{a||(a=!0,r(),S(n?h:m,[t]),t[Zr]=void 0,x[i]===e&&delete x[i])};let o=t[Zr].bind(null,!1);x[i]=e,f?ee(f,[t,o]):o()},clone(e){let i=oi(e,t,n,r);return i.afterLeave=()=>{C.afterLeave&&C.afterLeave()},i.delayLeave=(e,t,n)=>{C.delayLeave?C.delayLeave(e,t,n):n()},i.delayedLeave=()=>{C.delayedLeave&&C.delayedLeave()},i}};return C}function si(e){if(Ki(e))return e=Ms(e),e.children=null,e}function ci(e){if(!Ki(e))return zr(e.type)&&e.children?ri(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&v(n.default))return n.default()}}function li(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;li(zr(n.type)&&ci(n)||n,t)}else if(e.shapeFlag&128){let n=e.suspense;if(n){let e=n.isHydrating?n.pendingBranch:n.activeBranch;e&&li(e,t.clone(e))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===B&&p(e.children)){let n=vo(e.children,!1);n&&li(n,t)}}function ui(e,t=!1,n){let r=[],i=0;for(let a=0;a1)for(let e=0;en.value,set:e=>n.value=e})}return n}function hi(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var gi=new WeakMap;function _i(e,t,n,i,a=!1){if(p(e)){e.forEach((e,r)=>_i(e,t&&(p(t)?t[r]:t),n,i,a));return}if(Ui(i)&&!a){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&_i(e,t,n,i.component.subTree);return}let s=i.shapeFlag&4?cc(i.component):i.el,c=a?null:s,{i:l,r:d}=e,m=t&&t.r,h=l.refs===r?l.refs={}:l.refs,g=l.setupState,_=j(g),b=g===r?o:e=>!hi(h,e)&&f(_,e),x=(e,t)=>!(t&&hi(h,t));if(m!=null&&m!==d){if(vi(t),y(m))h[m]=null,b(m)&&(g[m]=null);else if(M(m)){let e=t;x(m,e.k)&&(m.value=null),e.k&&(h[e.k]=null)}}if(v(d))qn(d,l,12,[c,h]);else{let t=y(d),r=M(d);if(t||r){let i=()=>{if(e.f){let n=t?b(d)?g[d]:h[d]:x(d)||!e.k?d.value:h[e.k];if(a)p(n)&&u(n,s);else if(p(n))n.includes(s)||n.push(s);else if(t)h[d]=[s],b(d)&&(g[d]=h[d]);else{let t=[s];x(d,e.k)&&(d.value=t),e.k&&(h[e.k]=t)}}else t?(h[d]=c,b(d)&&(g[d]=c)):r&&(x(d,e.k)&&(d.value=c),e.k&&(h[e.k]=c))};if(c){let t=()=>{i(),gi.delete(e)};t.id=-1,gi.set(e,t),z(t,n)}else vi(e),i()}}}function vi(e){let t=gi.get(e);t&&(t.flags|=8,gi.delete(e))}var yi=!1,bi=()=>{yi||=(console.error(`Hydration completed but contains mismatches.`),!0)},xi=e=>e.namespaceURI.includes(`svg`)&&e.tagName!==`foreignObject`,Si=e=>e.namespaceURI.includes(`MathML`),Ci=e=>{if(e.nodeType===1){if(xi(e))return`svg`;if(Si(e))return`mathml`}},wi=e=>e.nodeType===8;function Ti(e){let{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:a,parentNode:o,remove:c,insert:l,createComment:u}}=e,d=(e,t)=>{t.hasChildNodes()?(f(t.firstChild,e,null,null,null),ur(),t._vnode=e):(n(null,e,t),ur(),t._vnode=e)},f=(n,r,s,c,u,d=!1)=>{d||=!!r.dynamicChildren;let b=wi(n)&&n.data===`[`,x=()=>g(n,r,s,c,u,b),{type:S,ref:ee,shapeFlag:C,patchFlag:te}=r,w=n.nodeType;r.el=n,te===-2&&(d=!1,r.dynamicChildren=null);let T=null;switch(S){case _s:w===3?(n.data!==r.children&&(bi(),n.data=r.children),T=a(n)):r.children===``?(l(r.el=i(``),o(n),n),T=n):T=x();break;case V:y(n)?(T=a(n),v(r.el=n.content.firstChild,n,s)):T=w!==8||b?x():a(n);break;case vs:if(b&&(n=a(n),w=n.nodeType),w===1||w===3){T=n;let e=!r.children.length;for(let t=0;t{o||=!!t.dynamicChildren;let{type:l,dynamicProps:u,props:d,patchFlag:f,shapeFlag:p,dirs:h,transition:g}=t,_=l===`input`||l===`option`,b=!!u;if(_||b||f!==-1||g&&l!==`template`&&y(e)){h&&wr(t,null,n,`created`);let l=!1;if(y(e)){l=Jo(null,g)&&n&&n.vnode.props&&n.vnode.props.appear;let r=e.content.firstChild;if(l){let e=r.getAttribute(`class`);e&&(r.$cls=e),g.beforeEnter(r)}v(r,e,n),t.el=e=r}if(p&16&&!(d&&(d.innerHTML||d.textContent))){let r=m(e.firstChild,t,e,n,i,a,o);for(r&&!Ai(e,1)&&bi();r;){let e=r;r=r.nextSibling,c(e)}}else if(p&8){let n=t.children;n[0]===` +`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,` +`)&&(Ai(e,0)||bi(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!ne(a)||a[0]===`.`||t&&!ne(a)||u&&u.includes(a)){if(Di(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&ln(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Rs(x,n,t),h&&wr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&ms(()=>{x&&Rs(x,n,t),l&&g.enter(e),h&&wr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u,d)=>{u||=!!t.dynamicChildren;let p=t.children,m=p.length,h=t.type===B,g=!1;for(let t=0;t{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&wi(f)&&f.data===`]`?a(t.anchor=f):(bi(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(Mi(e,t)||bi(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,Ci(d),s),r&&r.vnode.el===e&&(r.vnode.el=t.el,wo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&wi(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var Ei=new Set([`src`,`srcset`,`href`,`poster`]);function Di(e,t,n){return Ei.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var Oi=`data-allow-mismatch`,ki={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function Ai(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(Oi);)e=e.parentElement;return ji(e&&e.getAttribute(Oi),t)}function ji(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(ki[t])}}function Mi(e,t){return Ai(e.parentElement,1)||Ni(e)||Pi(t)}function Ni(e){return e.nodeType===1&&ji(e.getAttribute(Oi),1)}function Pi({props:e}){let t=e&&e[Oi];return typeof t==`string`&&ji(t,1)}var Fi=he().requestIdleCallback||(e=>setTimeout(e,1)),Ii=he().cancelIdleCallback||(e=>clearTimeout(e)),Li=(e=1e4)=>t=>{let n=Fi(t,{timeout:e});return()=>Ii(n)};function Ri(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t0&&r0&&n0&&i(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e),i=e=>{if(Ri(e))return t(),r.disconnect(),!1;if(getComputedStyle(e).display===`contents`){for(let t=0;t{if(e instanceof Element)return i(e)}),()=>r.disconnect()},Bi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Vi=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Hi(e,t){if(wi(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(wi(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ui=e=>!!e.type.__asyncLoader;function Wi(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Hi(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Us;if(pi(e),u)return()=>Gi(u,e);let t=t=>{l=null,Yn(t,e,13,!r,!0)};if(s&&e.suspense||Xs)return p().then(t=>()=>Gi(t,e)).catch(e=>(t(e),()=>r?K(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return Ve(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ki(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return Gi(u,e);if(c.value&&r)return K(r,{error:c.value});if(n&&!d.value)return Gi(n,e)}}})}function Gi(e,t){let{ref:n,props:r,children:i,ce:a}=t.vnode,o=K(e,r,i);return o.ref=n,o.ce=a,delete t.vnode.ce,o}var Ki=e=>e.type.__isKeepAlive,qi={name:`KeepAlive`,__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){let n=Ws(),r=n.ctx;if(!r.renderer)return()=>{let e=t.default&&t.default();return e&&e.length===1?e[0]:e};let i=new Map,a=new Set,o=null,s=n.suspense,{renderer:{p:c,m:l,um:u,o:{createElement:d}}}=r,f=d(`div`);r.activate=(e,t,n,r,i)=>{let a=e.component;l(e,t,n,0,s),c(a.vnode,e,t,n,a,s,r,e.slotScopeIds,i),z(()=>{a.isDeactivated=!1,a.a&&ue(a.a);let t=e.props&&e.props.onVnodeMounted;t&&Rs(t,a.parent,e)},s)},r.deactivate=e=>{let t=i.get(e.key==null?e.type:e.key);if(!t||t.component!==e.component)return!1;let n=e.component;return Qo(n.m),Qo(n.a),l(e,f,null,1,s),z(()=>{n.da&&ue(n.da);let t=e.props&&e.props.onVnodeUnmounted;t&&Rs(t,n.parent,e),n.isDeactivated=!0},s),!0};function p(e){$i(e),u(e,n,s,!0)}function m(e){i.forEach((t,n)=>{let r=lc(Ui(t)?t.type.__asyncResolved||{}:t.type);r&&!e(r)&&h(n)})}function h(e){let t=i.get(e);t&&(!o||!Es(t,o))?p(t):o&&(o.key==null?o.type:o.key)===e&&($i(o),t&&$i(t)),i.delete(e),a.delete(e)}Nr(()=>[e.include,e.exclude],([e,t])=>{e&&m(t=>Ji(e,t)),t&&m(e=>!Ji(t,e))},{flush:`post`,deep:!0});let g=null,_=()=>{if(g!=null){if(es(n.subTree.type)){let e=()=>{let e=ea(n.subTree);e.component&&i.set(g,e)};n.subTree.suspense.pendingBranch?z(e,n.subTree.suspense):e()}else i.set(g,ea(n.subTree))}};return ia(_),oa(_),sa(()=>{i.forEach(e=>{let{subTree:t,suspense:r}=n,i=ea(t);if(e.type===i.type&&e.key===i.key){$i(i);let e=i.component.da;e&&z(e,r)}else p(e)})}),()=>{if(g=null,!t.default)return o=null;let n=t.default(),r=n[0];if(n.length>1)return o=null,n;if(!Ts(r)||!(r.shapeFlag&4)&&!(r.shapeFlag&128))return o=null,r;let s=ea(r);if(s.type===V)return o=null,s;let c=s.type,l=lc(Ui(s)?s.type.__asyncResolved||{}:c),{include:u,exclude:d,max:f}=e;if(u&&(!l||!Ji(u,l))||d&&l&&Ji(d,l))return s.shapeFlag&=-257,o=s,r;let p=s.key==null?c:s.key,m=i.get(p);return s.el&&(s=Ms(s),r.shapeFlag&128&&(r.ssContent=s)),g=p,m?(s.el=m.el,s.component=m.component,s.transition&&li(s,s.transition),s.shapeFlag|=512,a.delete(p),a.add(p)):(a.add(p),f&&a.size>parseInt(f,10)&&h(a.values().next().value)),s.shapeFlag|=256,o=s,es(r.type)?r:s}}};function Ji(e,t){return p(e)?e.some(e=>Ji(e,t)):y(e)?e.split(`,`).includes(t):_(e)?(e.lastIndex=0,e.test(t)):!1}function Yi(e,t){Zi(e,`a`,t)}function Xi(e,t){Zi(e,`da`,t)}function Zi(e,t,n=Us){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(ta(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Ki(e.parent.vnode)&&Qi(r,t,n,e),e=e.parent}}function Qi(e,t,n,r){let i=ta(t,e,r,!0),a=ta(`um`,()=>u(r[t],i),n);a.flags=16}function $i(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function ea(e){return e.shapeFlag&128?e.ssContent:e}function ta(e,t,n=Us,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{ot();let i=qs(n),a=Jn(t,n,e,r);return i(),st(),a};return r?i.unshift(a):i.push(a),a}}var na=e=>(t,n=Us)=>{Xs&&e!==`sp`||ta(e,(...e)=>t(...e),n)},ra=na(`bm`),ia=na(`m`),aa=na(`bu`),oa=na(`u`),sa=na(`bum`),ca=na(`um`),la=na(`sp`),ua=na(`rtg`),da=na(`rtc`);function fa(e,t=Us){ta(`ec`,e,t)}var pa=`components`,ma=`directives`;function ha(e,t){return ya(pa,e,!0,t)||e}var ga=Symbol.for(`v-ndc`);function _a(e){return y(e)?ya(pa,e,!1)||e:e||ga}function va(e){return ya(ma,e)}function ya(e,t,n=!0,r=!1){let i=vr||Us;if(i){let n=i.type;if(e===pa){let e=lc(n,!1);if(e&&(e===t||e===E(t)||e===ce(E(t))))return n}let a=ba(i[e]||n[e],t)||ba(i.appContext[e],t);return!a&&r?n:a}}function ba(e,t){return e&&(e[t]||e[E(t)]||e[ce(E(t))])}function R(e,t,n,r){let i,a=n&&n[r],o=p(e);if(o||y(e)){let n=o&&ln(e),r=!1,s=!1;n&&(r=!dn(e),s=un(e),e=xt(e)),i=Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r{let t=r.fn(...e);return t&&(t.key=r.key),t}:r.fn)}return e}function Sa(e,t,n,r,i,a){if(n??={},vr.ce||vr.parent&&Ui(vr.parent)&&vr.parent.ce){let e=a!=null&&n.key==null?l({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),H(),W(B,null,[K(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=ys.length;H();let c;try{let i=o&&Ca(o(n)),s=n.key||a||i&&i.key;c=W(B,{key:(s&&!b(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=ys.length;e>s;e--)xs();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function Ca(e){return e.some(e=>!Ts(e)||!(e.type===V||e.type===B&&!Ca(e.children)))?e:null}function wa(e,t){let n={};for(let r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:le(r)]=e[r];return n}var Ta=e=>e?Ys(e)?cc(e):Ta(e.parent):null,Ea=l(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=>Ta(e.parent),$root:e=>Ta(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Xa(e),$forceUpdate:e=>e.f||=()=>{or(e.update)},$nextTick:e=>e.n||=ir.bind(e.proxy),$watch:e=>Fr.bind(e)}),Da=(e,t)=>e!==r&&!e.__isScriptSetup&&f(e,t),Oa={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(t[0]!==`$`){let e=s[t];if(e!==void 0)switch(e){case 1:return i[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else if(Da(i,t))return s[t]=1,i[t];else if(a!==r&&f(a,t))return s[t]=2,a[t];else if(f(o,t))return s[t]=3,o[t];else if(n!==r&&f(n,t))return s[t]=4,n[t];else Ga&&(s[t]=0)}let u=Ea[t],d,p;if(u)return t===`$attrs`&&_t(e.attrs,`get`,``),u(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(n!==r&&f(n,t))return s[t]=4,n[t];if(p=l.config.globalProperties,f(p,t))return p[t]},set({_:e},t,n){let{data:i,setupState:a,ctx:o}=e;return Da(a,t)?(a[t]=n,!0):i!==r&&f(i,t)?(i[t]=n,!0):f(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(n[c]||e!==r&&c[0]!==`$`&&f(e,c)||Da(t,c)||f(o,c)||f(i,c)||f(Ea,c)||f(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?f(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}},ka=l({},Oa,{get(e,t){if(t!==Symbol.unscopables)return Oa.get(e,t,e)},has(e,t){return t[0]!==`_`&&!ge(t)}});function Aa(){return null}function ja(){return null}function Ma(e){}function Na(e){}function Pa(){return null}function Fa(){}function Ia(e,t){return null}function La(){return za(`useSlots`).slots}function Ra(){return za(`useAttrs`).attrs}function za(e){let t=Ws();return t.setupContext||=sc(t)}function Ba(e){return p(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Va(e,t){let n=Ba(e);for(let e in t){if(e.startsWith(`__skip`))continue;let r=n[e];r?p(r)||v(r)?r=n[e]={type:r,default:t[e]}:r.default=t[e]:r===null&&(r=n[e]={default:t[e]}),r&&t[`__skip_${e}`]&&(r.skipFactory=!0)}return n}function Ha(e,t){return!e||!t?e||t:p(e)&&p(t)?e.concat(t):l({},Ba(e),Ba(t))}function Ua(e,t){let n={};for(let r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function Wa(e){let t=Ws(),n=Xs,r=e();Js(),n&&Ks(!1);let i=()=>{qs(t),n&&Ks(!0)},a=()=>{Ws()!==t&&t.scope.off(),Js(),n&&Ks(!1)};return S(r)&&(r=r.catch(e=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(a)),e})),[r,()=>{i(),Promise.resolve().then(a)}]}var Ga=!0;function Ka(e){let t=Xa(e),n=e.proxy,r=e.ctx;Ga=!1,t.beforeCreate&&Ja(t.beforeCreate,e,`bc`);let{data:i,computed:o,methods:s,watch:c,provide:l,inject:u,created:d,beforeMount:f,mounted:m,beforeUpdate:h,updated:g,activated:_,deactivated:y,beforeDestroy:b,beforeUnmount:S,destroyed:ee,unmounted:C,render:te,renderTracked:w,renderTriggered:T,errorCaptured:ne,serverPrefetch:re,expose:ie,inheritAttrs:ae,components:E,directives:oe,filters:se}=t;if(u&&qa(u,r,null),s)for(let e in s){let t=s[e];v(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);x(t)&&(e.data=rn(t))}if(Ga=!0,o)for(let e in o){let t=o[e],i=dc({get:v(t)?t.bind(n,n):v(t.get)?t.get.bind(n,n):a,set:!v(t)&&v(t.set)?t.set.bind(n):a});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(c)for(let e in c)Ya(c[e],r,n,e);if(l){let e=v(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{Tr(t,e[t])})}d&&Ja(d,e,`c`);function ce(e,t){p(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(ce(ra,f),ce(ia,m),ce(aa,h),ce(oa,g),ce(Yi,_),ce(Xi,y),ce(fa,ne),ce(da,w),ce(ua,T),ce(sa,S),ce(ca,C),ce(la,re),p(ie)){if(ie.length){let t=e.exposed||={};ie.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}te&&e.render===a&&(e.render=te),ae!=null&&(e.inheritAttrs=ae),E&&(e.components=E),oe&&(e.directives=oe),re&&pi(e)}function qa(e,t,n=a){p(e)&&(e=to(e));for(let n in e){let r=e[n],i;i=x(r)?`default`in r?Er(r.from||n,r.default,!0):Er(r.from||n):Er(r),M(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function Ja(e,t,n){Jn(p(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ya(e,t,n,r){let i=r.includes(`.`)?Ir(n,r):()=>n[r];if(y(e)){let n=t[e];v(n)&&Nr(i,n)}else if(v(e))Nr(i,e.bind(n));else if(x(e)){if(p(e))e.forEach(e=>Ya(e,t,n,r));else{let r=v(e.handler)?e.handler.bind(n):t[e.handler];v(r)&&Nr(i,r,e)}}}function Xa(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Za(c,e,o,!0)),Za(c,t,o)),x(t)&&a.set(t,c),c}function Za(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Za(e,a,n,!0),i&&i.forEach(t=>Za(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=Qa[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Qa={data:$a,props:io,emits:io,methods:ro,computed:ro,beforeCreate:no,created:no,beforeMount:no,mounted:no,beforeUpdate:no,updated:no,beforeDestroy:no,beforeUnmount:no,destroyed:no,unmounted:no,activated:no,deactivated:no,errorCaptured:no,serverPrefetch:no,components:ro,directives:ro,watch:ao,provide:$a,inject:eo};function $a(e,t){return t?e?function(){return l(v(e)?e.call(this,this):e,v(t)?t.call(this,this):t)}:t:e}function eo(e,t){return ro(to(e),to(t))}function to(e){if(p(e)){let t={};for(let n=0;n{let l,u=r,d;return Mr(()=>{let t=e[a];D(l,t)&&(l=t,c())}),{get(){return s(),n.get?n.get(l):l},set(e){let s=n.set?n.set(e):e;if(!D(s,l)&&!(u!==r&&D(e,u)))return;let f=i.vnode.props,p=!!(f&&(t in f||a in f||o in f)&&(`onUpdate:${t}`in f||`onUpdate:${a}`in f||`onUpdate:${o}`in f));p||(l=e,c()),i.emit(`update:${t}`,s),D(e,u)&&(D(e,s)&&!D(s,d)||p&&u!==r&&!D(s,l))&&c(),u=e,d=s}}});return c[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?s||r:c,done:!1}:{done:!0}}}},c}var fo=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${E(t)}Modifiers`]||e[`${se(t)}Modifiers`];function po(e,t,...n){if(e.isUnmounted)return;let i=e.vnode.props||r,a=n,o=t.startsWith(`update:`),s=o&&fo(i,t.slice(7));s&&(s.trim&&(a=n.map(e=>y(e)?e.trim():e)),s.number&&(a=a.map(fe)));let c,l=i[c=le(t)]||i[c=le(E(t))];!l&&o&&(l=i[c=le(se(t))]),l&&Jn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,Jn(u,e,6,a)}}var mo=new WeakMap;function ho(e,t,n=!1){let r=n?mo:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!v(e)){let r=e=>{let n=ho(e,t,!0);n&&(s=!0,l(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(x(e)&&r.set(e,null),null):(p(a)?a.forEach(e=>o[e]=null):l(o,a),x(e)&&r.set(e,o),o)}function go(e,t){return!e||!s(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),f(e,t[0].toLowerCase()+t.slice(1))||f(e,se(t))||f(e,t))}function _o(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=br(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Ps(u.call(t,e,d,f,m,p,h)),y=s}else{let e=t;v=Ps(e.length>1?e(f,{attrs:s,slots:o,emit:l}):e(f,null)),y=t.props?s:yo(s)}}catch(t){ys.length=0,Yn(t,e,1),v=K(V)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(c)&&(y=bo(y,a)),b=Ms(b,y,!1,!0))}return n.dirs&&(b=Ms(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&li(zr(b.type)&&ci(b)||b,n.transition),v=b,br(_),v}function vo(e,t=!0){let n;for(let t=0;t{let t;for(let n in e)(n===`class`||n===`style`||s(n))&&((t||={})[n]=e[n]);return t},bo=(e,t)=>{let n={};for(let r in e)c(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function xo(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?So(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;tObject.create(To),Do=e=>Object.getPrototypeOf(e)===To;function Oo(e,t,n,r=!1){let i={},a=Eo();e.propsDefaults=Object.create(null),Ao(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:an(i):e.type.props?i:a,e.attrs=a}function ko(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=j(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r{d=!0;let[n,r]=No(e,t,!0);l(c,n),r&&u.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!s&&!d)return x(e)&&a.set(e,i),i;if(p(s))for(let e=0;ee===`_`||e===`_ctx`||e===`$stable`,Io=e=>p(e)?e.map(Ps):[Ps(e)],Lo=(e,t,n)=>{if(t._n)return t;let r=F((...e)=>Io(t(...e)),n);return r._c=!1,r},Ro=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Fo(n))continue;let i=e[n];if(v(i))t[n]=Lo(n,i,r);else if(i!=null){let e=Io(i);t[n]=()=>e}}},zo=(e,t)=>{let n=Io(t);e.slots.default=()=>n},Bo=(e,t,n)=>{for(let r in t)(n||!Fo(r))&&(e[r]=t[r])},Vo=(e,t,n)=>{let r=e.slots=Eo();if(e.vnode.shapeFlag&32){let e=t._;e?(Bo(r,t,n),n&&de(r,`_`,e,!0)):Ro(t,r)}else t&&zo(e,t)},Ho=(e,t,n)=>{let{vnode:i,slots:a}=e,o=!0,s=r;if(i.shapeFlag&32){let e=t._;e?n&&e===1?o=!1:Bo(a,t,n):(o=!t.$stable,Ro(t,a)),s=t}else t&&(zo(e,t),s={default:1});if(o)for(let e in a)!Fo(e)&&s[e]==null&&delete a[e]},z=ms;function Uo(e){return Go(e)}function Wo(e){return Go(e,Ti)}function Go(e,t){let n=he();n.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=a,insertStaticContent:_}=e,v=(e,t,n,r=null,a=null,o=null,s=void 0,c=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Es(e,t)&&(r=xe(e),ge(e,a,o,!0),e=null),t.patchFlag===-2&&(l=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===i&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:u,ref:d,shapeFlag:f}=t;switch(u){case _s:y(e,t,n,r);break;case V:b(e,t,n,r);break;case vs:e??x(t,n,r,s);break;case B:E(e,t,n,r,a,o,s,c,l);break;default:f&1?C(e,t,n,r,a,o,s,c,l):f&6?oe(e,t,n,r,a,o,s,c,l):(f&64||f&128)&&u.process(e,t,n,r,a,o,s,c,l,Se)}d!=null&&a?_i(d,e&&e.ref,o,t||e,!t):d==null&&e&&e.ref!=null&&_i(e.ref,null,o,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},ee=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},C=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)te(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),re(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},te=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&T(e.children,d,null,r,i,Ko(e,a),s,u),_&&wr(e,null,r,`created`),w(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!ne(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Rs(f,r,e)}_&&wr(e,null,r,`beforeMount`);let v=Jo(i,g);v?g.beforeEnter(d):g&&!g.persisted&&(d[ns]=!0),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&z(()=>{try{f&&Rs(f,r,e),v&&g.enter(d),_&&wr(e,null,r,`mounted`)}finally{}},i)},w=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t{for(let l=c;l{let l=t.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=t;u|=e.patchFlag&16;let m=e.props||r,h=t.props||r,g;if(n&&qo(n,!1),(g=h.onVnodeBeforeUpdate)&&Rs(g,n,t,e),f&&wr(t,e,n,`beforeUpdate`),n&&qo(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?ie(e.dynamicChildren,d,l,n,i,Ko(t,a),o):s||de(e,t,l,null,n,i,Ko(t,a),o,!1),u>0){if(u&16)ae(l,m,h,n,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=t.dynamicProps;for(let t=0;t{g&&Rs(g,n,t,e),f&&wr(t,e,n,`updated`)},i)},ie=(e,t,n,r,i,a,o)=>{for(let s=0;s{if(t!==n){if(t!==r)for(let r in t)!ne(r)&&!(r in n)&&c(e,r,t[r],null,a,i);for(let r in n){if(ne(r))continue;let o=n[r],s=t[r];o!==s&&r!==`value`&&c(e,r,s,o,a,i)}`value`in n&&c(e,`value`,t.value,n.value,a)}},E=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),T(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ie(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&Yo(e,t,!0)):de(e,t,n,f,i,a,s,c,l)},oe=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):se(t,n,r,i,a,o,c):ce(e,t,c)},se=(e,t,n,r,i,a,o)=>{let s=e.component=Hs(e,r,i);if(Ki(e)&&(s.ctx.renderer=Se),Zs(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,le,o,a),!e.el){let r=s.subTree=K(V);b(null,r,t,n),e.placeholder=r.el}}else le(s,e,t,n,i,a,o)},ce=(e,t,n)=>{let r=t.component=e.component;if(xo(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,t.placeholder=e.placeholder,D(r,t,n);return}r.next=t,r.update()}else t.el=e.el,t.placeholder=e.placeholder,r.vnode=t},le=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=Zo(e);if(n){t&&(t.el=c.el,D(e,t,o)),n.asyncDep.then(()=>{let t=()=>{e.job.flags&8||(i&&i.pendingBranch?z(t,i):l())};t.flags=48,z(t,i)});return}}let u=t,d;qo(e,!1),t?(t.el=c.el,D(e,t,o)):t=c,n&&ue(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Rs(d,s,t,c),qo(e,!0);let f=_o(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el||$o(p)),xe(p),e,i,a),t.el=f.el,u===null&&wo(e,f.el),r&&z(r,i),(d=t.props&&t.props.onVnodeUpdated)&&z(()=>Rs(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Ui(t);if(qo(e,!1),l&&ue(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Rs(o,d,t),qo(e,!0),s&&we){let t=()=>{e.subTree=_o(e),we(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=_o(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&z(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;z(()=>Rs(o,d,e),i)}(t.shapeFlag&256||d&&Ui(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&z(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Ue(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>or(u),qo(e,!0),l()},D=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,ko(e,t.props,r,n),Ho(e,t.children,n),ot(),lr(e),st()},de=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){pe(l,d,n,r,i,a,o,s,c);return}if(f&256){fe(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&be(l,i,a),d!==l&&p(n,d)):u&16?m&16?pe(l,d,n,r,i,a,o,s,c):be(l,i,a,!0):(u&8&&p(n,``),m&16&&T(d,n,r,i,a,o,s,c))},fe=(e,t,n,r,a,o,s,c,l)=>{e||=i,t||=i;let u=e.length,d=t.length,f=Math.min(u,d),p=0;for(;pd?be(e,a,o,!0,!1,f):T(t,n,r,a,o,s,c,l,f)},pe=(e,t,n,r,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let r=e[u],i=t[u]=l?Fs(t[u]):Ps(t[u]);if(Es(r,i))v(r,i,n,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let r=e[f],i=t[p]=l?Fs(t[p]):Ps(t[p]);if(Es(r,i))v(r,i,n,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,i=ep)for(;u<=f;)ge(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Fs(t[u]):Ps(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,ee=Array(b);for(u=0;u=b){ge(r,a,o,!0);continue}let i;if(r.key!=null)i=g.get(r.key);else for(_=h;_<=p;_++)if(ee[_-h]===0&&Es(r,t[_])){i=_;break}i===void 0?ge(r,a,o,!0):(ee[i-h]=u+1,i>=S?S=i:x=!0,v(r,t[i],n,null,a,o,s,c,l),y++)}let C=x?Xo(ee):i;for(_=C.length-1,u=b-1;u>=0;u--){let e=h+u,i=t[e],f=t[e+1],p=e+1{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)me(e.component.subTree,t,n,r);else if(d&128)e.suspense.move(t,n,r);else if(d&64)c.move(e,t,n,Se);else if(c===B){o(a,t,n);for(let e=0;el.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Zr];a._isLeaving&&a[Zr](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},ge=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(ot(),_i(s,null,n,e,!0),st()),p==null||e.ctx&&e.ctx!==t||(t.renderCache[p]=void 0),u&256&&t.ctx.deactivate(e))return;let h=u&1&&f,g=!Ui(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Rs(_,t,e),u&6)ye(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&wr(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Se,r):l&&!l.hasOnce&&(a!==B||d>0&&d&64)?be(l,t,n,!1,!0):(a===B&&d&384||!i&&u&16)&&be(c,t,n),r&&_e(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&z(()=>{_&&Rs(_,t,e),h&&wr(e,null,t,`unmounted`),v&&(e.el=null)},n)},_e=e=>{let{type:t,el:n,anchor:r,transition:i}=e,a=t===B;if(a&&!i){ve(n,r);return}if(t===vs){ee(e),i&&!i.persisted&&i.afterLeave&&i.afterLeave();return}let o=a?di(e):e,c=()=>{a?m(n)&&ve(n,r):s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(o&&o.shapeFlag&1&&i&&!i.persisted){let{leave:e,delayLeave:t}=i,n=o.el,r=()=>e(n,c);t?t(n,c,r):r()}else c()},ve=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},ye=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;Qo(c),Qo(l),r&&ue(r),i.stop(),a?(a.flags|=8,ge(o,e,t,n)):o&&(o.transition=e.vnode.transition,ge(o,e,t,n)),s&&z(s,t);let u=()=>{e.isUnmounted=!0};u.flags=16,z(u,t)},be=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o{if(e.shapeFlag&6)return xe(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Rr];return n?h(n):t},O=(e,t,n)=>{fr(()=>{e==null?t._vnode&&ge(t._vnode,null,null,!0):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e},e&&t._vnode?void 0:e&&e.component?e.component.uid:Vs())},Se={p:v,um:ge,m:me,r:_e,mt:se,mc:T,pc:de,pbc:ie,n:xe,o:e},Ce,we;return t&&([Ce,we]=t(Se)),{render:O,hydrate:Ce,createApp:co(O,Ce)}}function Ko({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 qo({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Jo(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Yo(e,t,n=!1){let r=e.children,i=t.children;if(p(r)&&p(i))for(let e=0;e>1,e[n[s]]0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function Zo(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Zo(t)}function Qo(e){if(e)for(let t=0;te.__isSuspense,ts=0,ns=Symbol(`_deferredEnter`),rs={name:`Suspense`,__isSuspense:!0,process(e,t,n,r,i,a,o,s,c,l){if(e==null)ss(t,n,r,i,a,o,s,c,l);else{let u=e.suspense;if(a&&a.deps>0&&!a.isHydrating){let n=u.parentComponent;if(n&&n.suspense===a&&n.suspenseId!==a.pendingId?a.pendingBranch&&!Es(t.ssContent,u.pendingBranch||u.activeBranch):!u.isInFallback){t.suspense=u,u.vnode=t,t.el=e.el;return}}cs(e,t,n,r,i,o,s,c,l)}},hydrate:us,normalize:ds};function is(e,t){let n=e.props&&e.props[t];v(n)&&n()}function as(e){let t=[];os(e,t,!0),t.length&&cr(t)}function os(e,t,n){let{el:r,transition:i,children:a,shapeFlag:o}=e;if(o&6)os(e.component.subTree,t,n);else if(!(o&192)&&(o&1&&(!n&&r&&r[ns]&&(r[ns]=void 0,i&&!i.persisted&&(i.beforeEnter(r),t.push(()=>i.enter(r)))),n=!1),o&16))for(let e=0;e0?(is(e,`onPending`),is(e,`onFallback`),l(null,e.ssFallback,t,n,r,null,a,o),hs(f,e.ssFallback)):f.resolve(!1,!0)}function cs(e,t,n,r,i,a,o,s,{p:c,um:l,o:{createElement:u}}){let d=t.suspense=e.suspense;d.vnode=t,t.el=e.el;let f=t.ssContent,p=t.ssFallback,{activeBranch:m,pendingBranch:h,isInFallback:g,isHydrating:_}=d;if(h)d.pendingBranch=f,Es(h,f)?(d.deps++,c(h,f,_?n:d.hiddenContainer,null,i,d,a,o,s),d.deps--,d.deps<=0?d.resolve():g&&!_&&!d.isFallbackMountPending&&(c(m,p,n,r,i,null,a,o,s),hs(d,p))):(d.pendingId=ts++,_?(d.isHydrating=!1,d.activeBranch=h):l(h,i,d),d.deps=0,ps(d),d.hiddenContainer=u(`div`),g?(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0?d.resolve():d.isFallbackMountPending||(c(m,p,n,r,i,null,a,o,s),hs(d,p))):m&&Es(m,f)?(c(m,f,n,r,i,d,a,o,s),d.resolve(!0),d.pendingId=ts++,d.deps=0):(c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0&&d.resolve()));else if(m&&Es(m,f))c(m,f,n,r,i,d,a,o,s),hs(d,f);else if(is(t,`onPending`),d.pendingBranch=f,d.pendingId=ts++,c(null,f,d.hiddenContainer,null,i,d,a,o,s),d.deps<=0)d.resolve();else{let{timeout:e}=d;e>0?d.timeoutTimer=setTimeout(()=>{d.timeoutTimer=void 0,d.fallback(d.vnode.ssFallback)},e):e===0&&d.fallback(p)}}function ls(e,t,n,r,i,a,o,s,c,l,u=!1){let{p:d,m:f,um:p,n:m,o:{parentNode:h,remove:g}}=l,_,v=gs(e);v&&t&&t.pendingBranch&&(_=t.pendingId,t.deps++);let y=e.props?pe(e.props.timeout):void 0,b=a,x={vnode:e,parent:t,parentComponent:n,namespace:o,container:r,hiddenContainer:i,deps:0,pendingId:ts++,timeout:typeof y==`number`?y:-1,timeoutTimer:void 0,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!u,isHydrating:u,isUnmounted:!1,effects:[],resolve(e=!1,n=!1){let{vnode:r,activeBranch:i,pendingBranch:o,pendingId:s,effects:c,parentComponent:l,container:u,isInFallback:d}=x,g=x.parent;for(;g&&!g.pendingBranch;)g=g.parent;let y=!1;if(x.isHydrating)x.isHydrating=!1;else if(!e){y=i&&o.transition&&o.transition.mode===`out-in`;let e=!1;y&&(i.transition.afterLeave=()=>{if(s===x.pendingId&&!x.isUnmounted){as(o),f(o,u,a===b&&!e?m(i):a,0);let t=!1;if(g){let e=u,n;for(;n=h(e);)e=n;t=e===g.hiddenContainer}t||cr(c),d&&r.ssFallback&&(r.ssFallback.el=null)}}),i&&!x.isFallbackMountPending&&(h(i.el||$o(i))===u&&(a=m(i),e=!0),p(i,l,x,!0),!y&&d&&r.ssFallback&&z(()=>r.ssFallback.el=null,x)),y||(as(o),f(o,u,a,0))}clearTimeout(x.timeoutTimer),x.timeoutTimer=void 0,x.isFallbackMountPending=!1,hs(x,o),x.pendingBranch=null,x.isInFallback=!1;let S=0;for(let e=0;e{if(x.isFallbackMountPending=!1,x.isUnmounted||!x.isInFallback)return;let e=x.vnode.ssFallback;d(null,e,i,o,r,null,a,s,c),hs(x,e)},u=e.transition&&e.transition.mode===`out-in`;u&&(x.isFallbackMountPending=!0,n.transition.afterLeave=l),x.isInFallback=!0,p(n,r,null,!0),u||l()},move(e,t,n){x.activeBranch&&f(x.activeBranch,e,t,n),x.container=e},next(){return x.activeBranch&&m(x.activeBranch)},registerDep(e,t,n,r){let i=!!x.pendingBranch;i&&x.deps++;let a=e.vnode.el,o=i=>{e.asyncResolved=!0;let{vnode:o}=e;$s(e,i,!1),a&&(o.el=a);let s=!a&&e.subTree.el;t(e,o,h(a||e.subTree.el),a?null:m(e.subTree),x,r,n),s&&(o.placeholder=null,g(s)),wo(e,o.el)};e.asyncDep.catch(t=>(e.scope.active&&Yn(t,e,0,!1,!0),()=>null)).then(t=>{if(e.isUnmounted||x.isUnmounted)return;let n=i&&x.pendingId===e.suspenseId;if(Js(),!e.scope.active)n&&--x.deps===0&&x.resolve();else if(!n&&x.pendingBranch){let n=()=>{e.isUnmounted||x.isUnmounted||!e.scope.active||(x.pendingBranch?ms(n,x):o(t))};n.flags=48,ms(n,x)}else o(t),n&&--x.deps===0&&x.resolve()})},unmount(e,t){if(x.isUnmounted=!0,clearTimeout(x.timeoutTimer),x.timeoutTimer=void 0,_!==void 0){let e=x.parent,t=_;_=void 0,cr(()=>{e.pendingId===t&&!e.isUnmounted&&--e.deps===0&&e.resolve()})}x.activeBranch&&p(x.activeBranch,n,e,t),x.pendingBranch&&(p(x.pendingBranch,n,x,t),ps(x))}};return x}function us(e,t,n,r,i,a,o,s,c){let l=t.suspense=ls(t,r,n,e.parentNode,document.createElement(`div`),null,i,a,o,s,!0),u=c(e,l.pendingBranch=t.ssContent,n,l,a,o);return l.deps===0&&l.resolve(!1,!0),u}function ds(e){let{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=fs(r?n.default:n),e.ssFallback=r?fs(n.fallback):K(V)}function fs(e){let t;if(v(e)){let n=Ss&&e._c;n&&(e._d=!1,H()),e=e(),n&&(e._d=!0,t=bs,xs())}return p(e)&&(e=vo(e)),e=Ps(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(t=>t!==e)),e}function ps(e){let{effects:t}=e;for(let e=0;e0?bs||i:null,xs(),Ss>0&&bs&&bs.push(e),e}function U(e,t,n,r,i,a){return ws(G(e,t,n,r,i,a,!0))}function W(e,t,n,r,i){return ws(K(e,t,n,r,i,!0))}function Ts(e){return e?e.__v_isVNode===!0:!1}function Es(e,t){return e.type===t.type&&e.key===t.key}function Ds(e){}var Os=({key:e})=>e??null,ks=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:y(e)||M(e)||v(e)?{i:vr,r:e,k:t,f:!!n}:e);function G(e,t=null,n=null,r=0,i=null,a=e===B?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Os(t),ref:t&&ks(t),scopeId:yr,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:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:vr};return s?(Is(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=y(n)?8:16),Ss>0&&!o&&bs&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&bs.push(c),c}var K=As;function As(e,t=null,n=null,r=0,i=null,a=!1){if(e&&e!==ga||(e=V),Ts(e)){let r=Ms(e,t,!0);return n&&Is(r,n),Ss>0&&!a&&bs&&(r.shapeFlag&6?bs[bs.indexOf(e)]=r:bs.push(r)),r.patchFlag=-2,r}if(uc(e)&&(e=e.__vccOpts),t){t=js(t);let{class:e,style:n}=t;e&&!y(e)&&(t.class=O(e)),x(n)&&(fn(n)&&!p(n)&&(n=l({},n)),t.style=_e(n))}let o=y(e)?1:es(e)?128:zr(e)?64:x(e)?4:v(e)?2:0;return G(e,t,n,r,i,o,a,!0)}function js(e){return e?fn(e)?l({},e):Do(e)?l({},e[ac]||e):e:null}function Ms(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Ls(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Os(l),ref:t&&t.ref?n&&a?p(a)?a.concat(ks(t)):[a,ks(t)]:ks(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==B?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ms(e.ssContent),ssFallback:e.ssFallback&&Ms(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&li(u,c.clone(u)),u}function q(e=` `,t=0){return K(_s,null,e,t)}function Ns(e,t){let n=K(vs,null,e);return n.staticCount=t,n}function J(e=``,t=!1){return t?(H(),W(V,null,e)):K(V,null,e)}function Ps(e){return e==null||typeof e==`boolean`?K(V):p(e)?K(B,null,e.slice()):Ts(e)?Fs(e):K(_s,null,String(e))}function Fs(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ms(e)}function Is(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(p(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Is(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Do(t)?t._ctx=vr:r===3&&vr&&(vr.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(v(t)){if(r&65){Is(e,{default:t});return}t={default:t,_ctx:vr},n=32}else t=String(t),r&64?(n=16,t=[q(t)]):n=8;e.children=t,e.shapeFlag|=n}function Ls(...e){let t={};for(let n=0;nUs||vr,Gs,Ks;{let e=he(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Gs=t(`__VUE_INSTANCE_SETTERS__`,e=>Us=e),Ks=t(`__VUE_SSR_SETTERS__`,e=>Xs=e)}var qs=e=>{let t=Us;return Gs(e),e.scope.on(),()=>{e.scope.off(),Gs(t)}},Js=()=>{Us&&Us.scope.off(),Gs(null)};function Ys(e){return e.vnode.shapeFlag&4}var Xs=!1;function Zs(e,t=!1,n=!1){t&&Ks(t);let{props:r,children:i}=e.vnode,a=Ys(e);Oo(e,r,a,t),Vo(e,i,n||t);let o=a?Qs(e,t):void 0;return t&&Ks(!1),o}function Qs(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Oa);let{setup:r}=n;if(r){ot();let n=e.setupContext=r.length>1?sc(e):null,i=qs(e),a=qn(r,e,0,[e.props,n]),o=S(a);if(st(),i(),(o||e.sp)&&!Ui(e)&&pi(e),o){if(a.then(Js,Js),t)return a.then(n=>{Ks(!0);try{$s(e,n,t)}finally{Ks(!1)}}).catch(t=>{Yn(t,e,0,void 0,!0),e.ssrRender=(e,t)=>t(``)});e.asyncDep=a}else $s(e,a,t)}else ic(e,t)}function $s(e,t,n){v(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:x(t)&&(e.setupState=Sn(t)),ic(e,n)}var ec,tc;function nc(e){ec=e,tc=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,ka))}}var rc=()=>!ec;function ic(e,t,n){let r=e.type;if(!e.render){if(!t&&ec&&!r.render){let t=r.template||Xa(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r,s=l(l({isCustomElement:n,delimiters:a},i),o);r.render=ec(t,s)}}e.render=r.render||a,tc&&tc(e)}{let t=qs(e);ot();try{Ka(e)}finally{st(),t()}}}var ac=Symbol(),oc={get(e,t){return _t(e,`get`,``),t===ac?e:e[t]}};function sc(e){return{attrs:new Proxy(e.attrs,oc),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function cc(e){return e.exposed?e.exposeProxy||=new Proxy(Sn(pn(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ea)return Ea[n](e)},has(e,t){return t in e||t in Ea}}):e.proxy}function lc(e,t=!0){return v(e)?e.displayName||e.name:e.name||t&&e.__name}function uc(e){return v(e)&&`__vccOpts`in e}var dc=(e,t)=>jn(e,t,Xs);function fc(e,t,n){try{Cs(-1);let r=arguments.length;return r===2?x(t)&&!p(t)?Ts(t)?K(e,null,[t]):K(e,t):K(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ts(n)&&(n=[n]),K(e,t,n))}finally{Cs(1)}}function pc(){}function mc(e,t,n,r){let i=n[r];if(i&&hc(i,e))return i;let a=t();return a.memo=e.slice(),a.cacheIndex=r,n[r]=a}function hc(e,t){let n=e.memo;if(n.length!=t.length)return!1;for(let e=0;e0&&bs&&bs.push(e),!0}var gc=`3.5.47`,_c=a,vc=Kn,yc=hr,bc=_r,xc={createComponentInstance:Hs,setupComponent:Zs,renderComponentRoot:_o,setCurrentRenderingInstance:br,isVNode:Ts,normalizeVNode:Ps,getComponentPublicInstance:cc,ensureValidVNode:Ca,pushWarningContext:Hn,popWarningContext:Un},Sc=void 0,Cc=typeof window<`u`&&window.trustedTypes;if(Cc)try{Sc=Cc.createPolicy(`vue`,{createHTML:e=>e})}catch{}var wc=Sc?e=>Sc.createHTML(e):e=>e,Tc=`http://www.w3.org/2000/svg`,Ec=`http://www.w3.org/1998/Math/MathML`,Dc=typeof document<`u`?document:null,Oc=Dc&&Dc.createElement(`template`),kc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?Dc.createElementNS(Tc,e):t===`mathml`?Dc.createElementNS(Ec,e):n?Dc.createElement(e,{is:n}):Dc.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>Dc.createTextNode(e),createComment:e=>Dc.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Dc.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Oc.innerHTML=wc(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=Oc.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ac=`transition`,jc=`animation`,Mc=Symbol(`_vtc`),Nc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Pc=l({},ti,Nc),Fc=(e=>(e.displayName=`Transition`,e.props=Pc,e))((e,{slots:t})=>fc(ii,Rc(e),t)),Ic=(e,t=[])=>{p(e)?e.forEach(e=>e(...t)):e&&e(...t)},Lc=e=>e?p(e)?e.some(e=>e.length>1):e.length>1:!1;function Rc(e){let t={};for(let n in e)n in Nc||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:u=o,appearToClass:d=s,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=zc(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:ee=v,onAppear:C=y,onAppearCancelled:te=b}=t,w=(e,t,n,r)=>{e._enterResolve=void 0,e._enterCancelled=r,Hc(e,t?d:s),Hc(e,t?u:o),n&&n()},T=(e,t)=>{e._leaveResolve=void 0,e._isLeaving=!1,Hc(e,f),Hc(e,m),Hc(e,p),t&&t()},ne=e=>(t,n)=>{let i=e?C:y,o=()=>{t._enterResolve===o&&w(t,e,n)};t._enterResolve=o,Ic(i,[t,o]),Uc(()=>{Hc(t,e?c:a),t._enterResolve===o&&(Vc(t,e?d:s),Lc(i)||Gc(t,r,g,o))})};return l(t,{onBeforeEnter(e){Ic(v,[e]),Vc(e,a),Vc(e,o)},onBeforeAppear(e){Ic(ee,[e]),Vc(e,c),Vc(e,u)},onEnter:ne(!1),onAppear:ne(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>{e._leaveResolve===n&&T(e,t)};e._leaveResolve=n,Vc(e,f),e._enterCancelled?(Vc(e,p),Yc(e)):(Yc(e),Vc(e,p)),Uc(()=>{e._leaveResolve===n&&(Hc(e,f),Vc(e,m),Lc(x)||Gc(e,r,_,n))}),Ic(x,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),Ic(b,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),Ic(te,[e])},onLeaveCancelled(e){T(e),Ic(S,[e])}})}function zc(e){if(e==null)return null;if(x(e))return[Bc(e.enter),Bc(e.leave)];{let t=Bc(e);return[t,t]}}function Bc(e){return pe(e)}function Vc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Mc]||(e[Mc]=new Set)).add(t)}function Hc(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Mc];n&&(n.delete(t),n.size||(e[Mc]=void 0))}function Uc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Wc=0;function Gc(e,t,n,r){let i=e._endId=++Wc,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Kc(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${Ac}Delay`),a=r(`${Ac}Duration`),o=qc(i,a),s=r(`${jc}Delay`),c=r(`${jc}Duration`),l=qc(s,c),u=null,d=0,f=0;t===Ac?o>0&&(u=Ac,d=o,f=a.length):t===jc?l>0&&(u=jc,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?Ac:jc:null,f=u?u===Ac?a.length:c.length:0);let p=u===Ac&&/\b(?:transform|all)(?:,|$)/.test(r(`${Ac}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function qc(e,t){for(;e.lengthJc(t)+Jc(e[n])))}function Jc(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Yc(e){return(e?e.ownerDocument:document).body.offsetHeight}function Xc(e,t,n){let r=e[Mc];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Zc=Symbol(`_vod`),Qc=Symbol(`_vsh`),$c={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Zc]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):el(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),el(e,!0),r.enter(e)):r.leave(e,()=>{el(e,!1)}):el(e,t))},beforeUnmount(e,{value:t}){el(e,t)}};function el(e,t){e.style.display=t?e[Zc]:`none`,e[Qc]=!t}function tl(){$c.getSSRProps=({value:e})=>{if(!e)return{style:{display:`none`}}}}var nl=Symbol(``);function rl(e){let t=Ws();if(!t)return;let n=(n=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(e=>ll(e,n))},r={uid:String(t.uid),update:n};Ve(()=>r.update=void 0),t.ut=(e,t)=>{e&&(e[il]=[t,r],ol(e),al(e)),n()};let i=()=>{let r=e(t.proxy);t.ce?ll(t.ce,r):cl(t.subTree,r),n(r)};aa(()=>{cr(i)}),ia(()=>{Nr(i,a,{flush:`post`});let e=new MutationObserver(i);e.observe(t.subTree.el.parentNode,{childList:!0}),ca(()=>e.disconnect())})}var il=Symbol(``);function al(e,t){let[n,r]=e[il],i;if(r.update)for(let a=e;a&&a!==n;a=a.nextSibling)a.nodeType===1&&(!t||(t===!0||t.has(a))&&(a.getAttribute(`data-v-owner`)||r.uid)===r.uid)&&(a.setAttribute(`data-v-owner`,r.uid),i=r.update);return i}function ol(e){let t=e.parentNode;if(t){let n=t[il];n||(n=t[il]=new Set,new MutationObserver(sl).observe(t,{childList:!0})),n.add(e)}}function sl(e,t){let n=e[0].target,r=n[il],i=new Set;for(let{addedNodes:t}of e)t.forEach(e=>i.add(e));let a=new Set;r.forEach(e=>{e.parentNode===n?i.size&&a.add(al(e,i)):(r.delete(e),ol(e),a.add(al(e,!0)))}),a.forEach(e=>e&&e()),r.size||(t.disconnect(),n[il]=void 0)}function cl(e,t){if(e.shapeFlag&128){let n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{cl(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)ll(e.el,t);else if(e.type===B)e.children.forEach(e=>cl(e,t));else if(e.type===vs){let{el:n,anchor:r}=e;for(;n&&(ll(n,t),n!==r);)n=n.nextSibling}}function ll(e,t){if(e.nodeType===1){let n=e.style,r=``;for(let e in t){let i=Ie(t[e]);n.setProperty(`--${e}`,i),r+=`--${e}: ${i};`}n[nl]=r}}var ul=/(?:^|;)\s*display\s*:/;function dl(e,t,n){let r=e.style,i=y(n),a=!1;if(n&&!i){if(t){if(y(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??pl(r,t,``)}else for(let e in t)n[e]??pl(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?pl(r,i,``):_l(e,i,!y(t)&&t?t[i]:void 0,o)||pl(r,i,o)}}else if(i){if(t!==n){let e=r[nl];e&&(n+=`;`+e),r.cssText=n,a=ul.test(n)}}else t&&e.removeAttribute(`style`);Zc in e&&(i&&t===n||(e[Zc]=a?r.display:``),e[Qc]&&(r.display=`none`))}var fl=/\s*!important$/;function pl(e,t,n){if(p(n))n.forEach(n=>pl(e,t,n));else if(n??=``,t.startsWith(`--`))fl.test(n)?e.setProperty(t,n.replace(fl,``),`important`):e.setProperty(t,n);else{let r=gl(e,t);fl.test(n)?e.setProperty(se(r),n.replace(fl,``),`important`):e[r]=n}}var ml=[`Webkit`,`Moz`,`ms`],hl={};function gl(e,t){let n=hl[t];if(n)return n;let r=E(t);if(r!==`filter`&&r in e)return hl[t]=r;r=ce(r);for(let n=0;nOl||=(kl.then(()=>Ol=0),Date.now());function jl(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(p(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;ne.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Nl=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?Xc(e,r,o):t===`style`?dl(e,n,r):s(t)?c(t)||wl(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Pl(e,t,r,o))?(bl(e,t,r),e.tagName.includes(`-`)||t!==`value`&&t!==`checked`&&t!==`selected`||yl(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Fl(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!y(r)))?bl(e,E(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),yl(e,t,r,o))};function Pl(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Ml(t)&&v(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`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Ml(t)&&y(n)?!1:t in e}function Fl(e,t){let n=e._def.props;if(!n)return!1;let r=E(t);return Array.isArray(n)?n.some(e=>E(e)===r):Object.keys(n).some(e=>E(e)===r)}var Il={};function Ll(e,t,n){let r=L(e,t);w(r)&&(r=l({},r,t));class i extends Bl{constructor(e){super(r,e,n)}}return i.def=r,i}var Rl=((e,t)=>Ll(e,t,Iu)),zl=typeof HTMLElement<`u`?HTMLElement:class{},Bl=class e extends zl{constructor(e,t={},n=Fu){super(),this._def=e,this._props=t,this._createApp=n,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&n!==Fu?this._root=this.shadowRoot:e.shadowRoot===!1?this._root=this:(this.attachShadow(l({},e.shadowRootOptions,{mode:`open`})),this._root=this.shadowRoot)}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t&&=t.assignedSlot||t.parentNode||t.host;)if(t instanceof e){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{if(this._pendingResolve=void 0,this.isConnected)return this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,ir(()=>{this._connected||(this._ob&&=(this._ob.disconnect(),null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&=(this._teleportTargets.clear(),void 0))})}_processMutations(e){for(let t of e)this._setAttr(t.attributeName)}_resolveDef(){if(this._pendingResolve)return this._pendingResolve;for(let e=0;e{this._resolved=!0,this._pendingResolve=void 0;let{props:n,styles:r}=e,i;if(n&&!p(n))for(let e in n){let t=n[e];(t===Number||t&&t.type===Number)&&(e in this._props&&(this._props[e]=pe(this._props[e])),(i||=Object.create(null))[E(e)]=!0)}this._numberProps=i,this._resolveProps(e),this.shadowRoot&&this._applyStyles(r),this._connected&&this._mount(e)},t=this._def.__asyncLoader;if(t)return this._pendingResolve=t().then(t=>{t.configureApp=this._def.configureApp,e(this._def=t,!0)}),this._pendingResolve;e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);let t=this._instance&&this._instance.exposed;if(t)for(let e in t)f(this,e)||Object.defineProperty(this,e,{get:()=>P(t[e])})}_resolveProps(e){let{props:t}=e,n=p(t)?t:Object.keys(t||{});for(let e of Object.keys(this))e[0]!==`_`&&n.includes(e)&&this._setProp(e,this[e]);for(let e of n.map(E))Object.defineProperty(this,e,{get(){return this._getProp(e)},set(t){this._setProp(e,t,!0,!this._patching)}})}_setAttr(e){if(e.startsWith(`data-v-`))return;let t=this.hasAttribute(e),n=t?this.getAttribute(e):Il,r=E(e);t&&this._numberProps&&this._numberProps[r]&&(n=pe(n)),this._setProp(r,n,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,t,n=!0,r=!1){if(t!==this._props[e]&&(this._dirty=!0,t===Il?delete this._props[e]:(this._props[e]=t,e===`key`&&this._app&&(this._app._ceVNode.key=t)),r&&this._instance&&this._update(),n)){let n=this._ob;n&&(this._processMutations(n.takeRecords()),n.disconnect()),t===!0?this.setAttribute(se(e),``):typeof t==`string`||typeof t==`number`?this.setAttribute(se(e),t+``):t||this.removeAttribute(se(e)),n&&n.observe(this,{attributes:!0})}}_update(){let e=this._createVNode();this._app&&(e.appContext=this._app._context),Nu(e,this._root)}_createVNode(){let e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));let t=K(this._def,l(e,this._props));return this._instance||(t.ce=e=>{this._instance=e,e.ce=this,e.isCE=!0;let t=(e,t)=>{this.dispatchEvent(new CustomEvent(e,w(t[0])?l({detail:t},t[0]):{detail:t}))};e.emit=(e,...n)=>{t(e,n),se(e)!==e&&t(se(e),n)},this._setParent()}),t}_applyStyles(e,t,n){if(!e)return;if(t){if(t===this._def||this._styleChildren.has(t))return;this._styleChildren.add(t)}let r=this._nonce,i=this.shadowRoot,a=n?this._getStyleAnchor(n)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i),o=null;for(let s=e.length-1;s>=0;s--){let c=document.createElement(`style`);r&&c.setAttribute(`nonce`,r),c.textContent=e[s],i.insertBefore(c,o||a),o=c,s===0&&(n||this._styleAnchors.set(this._def,c),t&&this._styleAnchors.set(t,c))}}_getStyleAnchor(e){if(!e)return null;let t=this._styleAnchors.get(e);return t&&t.parentNode===this.shadowRoot?t:(t&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let t=0;t(delete e.props.mode,e))({name:`TransitionGroup`,props:l({},Pc,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Ws(),r=$r(),i,a,o,s,c=()=>(s===void 0&&(s=i.length>0&&iu(i[0].el,n.vnode.el,Zl(e))),s);return oa(()=>{if(Jl.delete(n),!c()){i=[],o=void 0;return}let t=Zl(e);i.forEach(Xl);let r=o&&ru(o,n.vnode.el);o=void 0,i.forEach(e=>Ql(e,r));let a=i.filter($l);Yc(n.vnode.el),a.forEach(e=>{let n=e.el,r=n.style;Vc(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[Kl]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[Kl]=null,Hc(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let l=j(e),u=Rc(l),d=l.tag||B;if(i=[],s=void 0,a)for(let e=0;ee.willMove()&&e.item.contains(t));return n&&eu(n.item,n)}function iu(e,t,n){let r=e.cloneNode(),i=e[Mc];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Kc(r);return a.removeChild(r),o}var au=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return p(t)?e=>ue(t,e):t};function ou(e){e.target.composing=!0}function su(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var cu=Symbol(`_assign`),lu=Symbol(`_initialValue`);function uu(e,t,n){return t&&(e=e.trim()),n&&(e=fe(e)),e}var Y={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[lu]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[lu]=e.defaultValue.replace(/\r\n?/g,` +`))),e[cu]=au(i);let a=r||i.props&&i.props.type===`number`;xl(e,t?`change`:`input`,t=>{t.target.composing||e[cu](uu(e.value,n,a))}),(n||a)&&xl(e,`change`,()=>{e.value=uu(e.value,n,a)}),t||(xl(e,`compositionstart`,ou),xl(e,`compositionend`,su),xl(e,`change`,su))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[lu];delete e[lu],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[cu](uu(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[cu]=au(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?fe(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},du={deep:!0,created(e,t,n){e[cu]=au(n),xl(e,`change`,()=>{let t=e._modelValue,n=_u(e),r=e.checked,i=e[cu];if(p(t)){let e=je(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(vu(e,r))})},mounted:fu,beforeUpdate(e,t,n){e[cu]=au(n),fu(e,t,n)}};function fu(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=je(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ae(t,vu(e,!0))}e.checked!==i&&(e.checked=i)}var pu={created(e,{value:t},n){e.checked=Ae(t,n.props.value),e[cu]=au(n),xl(e,`change`,()=>{e[cu](_u(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[cu]=au(r),t!==n&&(e.checked=Ae(t,r.props.value))}},mu={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,xl(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?fe(_u(e)):_u(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[cu](i)}finally{ir(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[cu]=au(r)},mounted(e,{value:t,modifiers:{number:n}}){gu(e,t,n)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[cu]=au(n)},updated(e,{value:t,modifiers:{number:n}}){let r=e._pendingValue;e._pendingValue=void 0,r&&r[0]===e.multiple&&hu(t,r[1],r[0])||gu(e,t,n)}};function hu(e,t,n){if(!n||p(e))return Ae(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function gu(e,t,n=!1){let r=e.multiple,i=p(t);if(!r||i||h(t)){for(let a=0,o=e.options.length;aString(e)===String(s)):je(t,s)>-1}else o.selected=t.has(s)||n&&typeof s==`string`&&t.has(fe(s))}else if(Ae(_u(o),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!r&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function _u(e){return`_value`in e?e._value:e.value}function vu(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var yu={created(e,t,n){xu(e,t,n,null,`created`)},mounted(e,t,n){xu(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){xu(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){xu(e,t,n,r,`updated`)}};function bu(e,t){switch(e){case`SELECT`:return mu;case`TEXTAREA`:return Y;default:switch(t){case`checkbox`:return du;case`radio`:return pu;default:return Y}}}function xu(e,t,n,r,i){let a=bu(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function Su(){Y.getSSRProps=({value:e})=>({value:e}),pu.getSSRProps=({value:e},t)=>{if(t.props&&Ae(t.props.value,e))return{checked:!0}},du.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&je(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},yu.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=bu(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var Cu=[`ctrl`,`shift`,`alt`,`meta`],wu={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)=>Cu.some(n=>e[`${n}Key`]&&!t.includes(n))},Tu=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`),i=n[r];if(i)return i;let a=t.some(e=>e===`left`||e===`right`);return n[r]=(n=>{if(!(`key`in n))return a?e(n):void 0;let r=se(n.key);if(t.some(e=>e===r||Eu[e]===r))return e(n)})},Ou=l({patchProp:Nl},kc),ku,Au=!1;function ju(){return ku||=Uo(Ou)}function Mu(){return ku=Au?ku:Wo(Ou),Au=!0,ku}var Nu=((...e)=>{ju().render(...e)}),Pu=((...e)=>{Mu().hydrate(...e)}),Fu=((...e)=>{let t=ju().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Ru(e);if(!r)return;let i=t._component;v(i)||i.render||i.template||(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Lu(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),Iu=((...e)=>{let t=Mu().createApp(...e),{mount:n}=t;return t.mount=e=>{let t=Ru(e);if(t)return n(t,!0,Lu(t))},t});function Lu(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Ru(e){return y(e)?document.querySelector(e):e}var zu=!1,Bu=()=>{zu||(zu=!0,Su(),tl())},Vu=t({BaseTransition:()=>ii,BaseTransitionPropsValidators:()=>ti,Comment:()=>V,DeprecationTypes:()=>null,EffectScope:()=>Re,ErrorCodes:()=>Gn,ErrorTypeStrings:()=>vc,Fragment:()=>B,KeepAlive:()=>qi,ReactiveEffect:()=>Ue,Static:()=>vs,Suspense:()=>rs,Teleport:()=>Jr,Text:()=>_s,TrackOpTypes:()=>Mn,Transition:()=>Fc,TransitionGroup:()=>Yl,TriggerOpTypes:()=>Nn,VueElement:()=>Bl,assertNumber:()=>Wn,callWithAsyncErrorHandling:()=>Jn,callWithErrorHandling:()=>qn,camelize:()=>E,capitalize:()=>ce,cloneVNode:()=>Ms,compatUtils:()=>null,compile:()=>Hu,computed:()=>dc,createApp:()=>Fu,createBlock:()=>W,createCommentVNode:()=>J,createElementBlock:()=>U,createElementVNode:()=>G,createHydrationRenderer:()=>Wo,createPropsRestProxy:()=>Ua,createRenderer:()=>Uo,createSSRApp:()=>Iu,createSlots:()=>xa,createStaticVNode:()=>Ns,createTextVNode:()=>q,createVNode:()=>K,customRef:()=>wn,defineAsyncComponent:()=>Wi,defineComponent:()=>L,defineCustomElement:()=>Ll,defineEmits:()=>ja,defineExpose:()=>Ma,defineModel:()=>Fa,defineOptions:()=>Na,defineProps:()=>Aa,defineSSRCustomElement:()=>Rl,defineSlots:()=>Pa,devtools:()=>yc,effect:()=>nt,effectScope:()=>ze,getCurrentInstance:()=>Ws,getCurrentScope:()=>Be,getCurrentWatcher:()=>Ln,getTransitionRawChildren:()=>ui,guardReactiveProps:()=>js,h:()=>fc,handleError:()=>Yn,hasInjectionContext:()=>Dr,hydrate:()=>Pu,hydrateOnIdle:()=>Li,hydrateOnInteraction:()=>Vi,hydrateOnMediaQuery:()=>Bi,hydrateOnVisible:()=>zi,initCustomFormatter:()=>pc,initDirectivesForSSR:()=>Bu,inject:()=>Er,isMemoSame:()=>hc,isProxy:()=>fn,isReactive:()=>ln,isReadonly:()=>un,isRef:()=>M,isRuntimeOnly:()=>rc,isShallow:()=>dn,isVNode:()=>Ts,markRaw:()=>pn,mergeDefaults:()=>Va,mergeModels:()=>Ha,mergeProps:()=>Ls,nextTick:()=>ir,nodeOps:()=>kc,normalizeClass:()=>O,normalizeProps:()=>Se,normalizeStyle:()=>_e,onActivated:()=>Yi,onBeforeMount:()=>ra,onBeforeUnmount:()=>sa,onBeforeUpdate:()=>aa,onDeactivated:()=>Xi,onErrorCaptured:()=>fa,onMounted:()=>ia,onRenderTracked:()=>da,onRenderTriggered:()=>ua,onScopeDispose:()=>Ve,onServerPrefetch:()=>la,onUnmounted:()=>ca,onUpdated:()=>oa,onWatcherCleanup:()=>Rn,openBlock:()=>H,patchProp:()=>Nl,popScopeId:()=>Sr,provide:()=>Tr,proxyRefs:()=>Sn,pushScopeId:()=>xr,queuePostFlushCb:()=>cr,reactive:()=>rn,readonly:()=>on,ref:()=>N,registerRuntimeCompiler:()=>nc,render:()=>Nu,renderList:()=>R,renderSlot:()=>Sa,resolveComponent:()=>ha,resolveDirective:()=>va,resolveDynamicComponent:()=>_a,resolveFilter:()=>null,resolveTransitionHooks:()=>oi,setBlockTracking:()=>Cs,setDevtoolsHook:()=>bc,setTransitionHooks:()=>li,shallowReactive:()=>an,shallowReadonly:()=>sn,shallowRef:()=>gn,ssrContextKey:()=>Or,ssrUtils:()=>xc,stop:()=>rt,toDisplayString:()=>k,toHandlerKey:()=>le,toHandlers:()=>wa,toRaw:()=>j,toRef:()=>On,toRefs:()=>Tn,toValue:()=>bn,transformVNodeArgs:()=>Ds,triggerRef:()=>yn,unref:()=>P,useAttrs:()=>Ra,useCssModule:()=>Ul,useCssVars:()=>rl,useHost:()=>Vl,useId:()=>fi,useModel:()=>uo,useSSRContext:()=>kr,useShadowRoot:()=>Hl,useSlots:()=>La,useTemplateRef:()=>mi,useTransitionState:()=>$r,vModelCheckbox:()=>du,vModelDynamic:()=>yu,vModelRadio:()=>pu,vModelSelect:()=>mu,vModelText:()=>Y,vShow:()=>$c,version:()=>gc,warn:()=>_c,watch:()=>Nr,watchEffect:()=>Ar,watchPostEffect:()=>jr,watchSyncEffect:()=>Mr,withAsyncContext:()=>Wa,withCtx:()=>F,withDefaults:()=>Ia,withDirectives:()=>I,withKeys:()=>Du,withMemo:()=>mc,withModifiers:()=>Tu,withScopeId:()=>Cr}),Hu=()=>{},Uu=class extends Error{status;body;constructor(e,t){super(t?.message??`HTTP ${e}`),this.status=e,this.body=t}get errors(){return Object.fromEntries(Object.entries(this.body?.errors??{}).map(([e,t])=>[e,t[0]]))}},X=JSON.parse(document.getElementById(`manager-boot`).textContent);function Wu(){let e=document.cookie.match(/(?:^|; )XSRF-TOKEN=([^;]+)/);return e?decodeURIComponent(e[1]):``}async function Gu(e,t,n){let r=await fetch(t,{method:e,credentials:`same-origin`,headers:{Accept:`application/json`,"X-Requested-With":`XMLHttpRequest`,"X-XSRF-TOKEN":Wu(),...n===void 0?{}:{"Content-Type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n)}),i=r.status===204?null:await r.json().catch(()=>null);if(!r.ok)throw new Uu(r.status,i);return i}async function Ku(e,t){let n=await fetch(e,{method:`POST`,credentials:`same-origin`,headers:{Accept:`application/json`,"X-Requested-With":`XMLHttpRequest`,"X-XSRF-TOKEN":Wu()},body:t}),r=await n.json().catch(()=>null);if(!n.ok)throw new Uu(n.status,r);return r}var qu={get:e=>Gu(`GET`,e),post:(e,t={})=>Gu(`POST`,e,t),put:(e,t={})=>Gu(`PUT`,e,t),delete:(e,t)=>Gu(`DELETE`,e,t)};function Ju(e){let t=rn({values:{...e},errors:{},busy:!1,async send(e,n){t.busy=!0,t.errors={};try{return await qu[e](n,t.values)}catch(e){if(e instanceof Uu&&e.status===422)return t.errors=e.errors,null;throw e}finally{t.busy=!1}}});return t}var Yu={Dashboard:`Dashboard`,"Log in":`Inloggen`,"Log out":`Uitloggen`,Email:`E-mailadres`,Password:`Wachtwoord`,"Keep me logged in":`Ingelogd blijven`,"Logging in…":`Bezig met inloggen…`,"Log in to manage the site.":`Log in om de site te beheren.`,"My account":`Mijn account`,Name:`Naam`,"Email address":`E-mailadres`,"What you may do":`Wat je mag`,"Super admin: everything":`Super admin: alles`,"Not in a group yet":`Nog in geen groep`,"New password":`Nieuw wachtwoord`,"Leave empty to keep the password you have.":`Laat leeg om je wachtwoord te houden.`,"Current password":`Huidig wachtwoord`,"At least 12 characters.":`Minstens 12 tekens.`,"New password, once more":`Nieuw wachtwoord, nogmaals`,Save:`Opslaan`,"Saving…":`Bezig met opslaan…`,"Saved.":`Opgeslagen.`,Look:`Uiterlijk`,Theme:`Thema`,Posts:`Berichten`,"New post":`Nieuw bericht`,Title:`Titel`,Status:`Status`,Category:`Categorie`,Edit:`Bewerken`,Delete:`Verwijderen`,"Put online":`Online zetten`,"Take offline":`Offline halen`,Draft:`Concept`,Scheduled:`Ingepland`,Published:`Gepubliceerd`,"Are you sure?":`Weet je het zeker?`,"No posts yet.":`Nog geen berichten.`,"Address (slug)":`Adres (slug)`,Summary:`Samenvatting`,"Text (Markdown)":`Tekst (Markdown)`,"Cover image":`Omslagafbeelding`,"Tags (comma separated)":`Tags (met komma's)`,Featured:`Uitgelicht`,Publish:`Publiceren`,"Publish at":`Publiceren op`,Menu:`Menu`,"Click the part of the picture that must stay in view.":`Klik op het deel van de foto dat in beeld moet blijven.`,"Focus point":`Scherpstelpunt`,Clear:`Wissen`,Formatting:`Opmaak`,Bold:`Vet`,Italic:`Cursief`,Heading:`Kop`,List:`Lijst`,Quote:`Citaat`,Link:`Link`,bold:`vet`,italic:`cursief`,text:`tekst`,Photo:`Foto`,Write:`Schrijven`,Preview:`Voorbeeld`,History:`Geschiedenis`,Now:`Nu`,"Put back":`Terugzetten`,"Put this version back? The text now is kept in the history.":`Deze versie terugzetten? De tekst van nu blijft bewaard in de geschiedenis.`,"The earlier version is back.":`De eerdere versie is terug.`,New:`Nieuw`,"New page":`Nieuwe pagina`,"Description for search engines":`Omschrijving voor zoekmachines`,"One per line.":`Eén per regel.`,"Show everything":`Alles tonen`,"Simple view":`Simpele weergave`,"Loading…":`Laden…`,"You may not open this page.":`Je mag deze pagina niet openen.`,"Something went wrong. Try again.":`Er ging iets mis. Probeer het opnieuw.`,"This page has no screen in the manager yet.":`Deze pagina heeft nog geen scherm in de manager.`,"Go to the dashboard":`Naar het dashboard`,"The page expired. Reload it and try again.":`De pagina is verlopen. Laad hem opnieuw en probeer het nog eens.`,Back:`Terug`,Accounts:`Accounts`,"New account":`Nieuw account`,you:`jij`,"Super admin":`Super admin`,Groups:`Groepen`,Cancel:`Annuleren`,"New group":`Nieuwe groep`,Description:`Omschrijving`,accounts:`accounts`,"Categories and tags":`Categorieën en tags`,Categories:`Categorieën`,Tags:`Tags`,Add:`Toevoegen`,Rename:`Hernoemen`,"New name":`Nieuwe naam`,Pages:`Pagina's`,Reviews:`Reviews`,"Nothing here yet.":`Hier is nog niets.`,Previous:`Vorige`,Next:`Volgende`,Media:`Media`,"Choose an image":`Kies een afbeelding`,"No images yet.":`Nog geen afbeeldingen.`,"Uploaded.":`Geüpload.`,Upload:`Uploaden`,"Uploading…":`Bezig met uploaden…`,"This file is in use. Delete it anyway?":`Dit bestand is in gebruik. Toch verwijderen?`,"Largest file":`Grootste bestand`,"Alternative text":`Alternatieve tekst`,Used:`Gebruikt`,"No files yet.":`Nog geen bestanden.`,Choose:`Kiezen`,"Audit log":`Auditlog`,"Addresses banned":`Geblokkeerde adressen`,"Logins (24 h)":`Logins (24 u)`,"Failed logins (24 h)":`Mislukte logins (24 u)`,"Refused (24 h)":`Geweigerd (24 u)`,all:`alles`,logins:`logins`,failed:`mislukt`,actions:`acties`,viewed:`bekeken`,refused:`geweigerd`,bans:`blokkades`,Search:`Zoeken`,Account:`Account`,Everyone:`Iedereen`,Filter:`Filteren`,Someone:`Iemand`,banned:`geblokkeerd`,Ban:`Blokkeren`,Bans:`Blokkades`,"Minutes (0 = until lifted)":`Minuten (0 = tot opgeheven)`,Reason:`Reden`,"Whole site":`Hele site`,"No bans.":`Geen blokkades.`,automatic:`automatisch`,"whole site":`hele site`,hits:`pogingen`,Lift:`Opheffen`,Rules:`Regels`,"until lifted":`tot opgeheven`,"Ban an address by itself after too many failed logins":`Een adres zelf blokkeren na te veel mislukte logins`,"Failed logins":`Mislukte logins`,"Within minutes":`Binnen minuten`,"Ban for minutes (0 = until lifted)":`Blokkeren voor minuten (0 = tot opgeheven)`,"Keep the log (days)":`Log bewaren (dagen)`,"Notes about addresses":`Notities over adressen`,Group:`Groep`,Note:`Notitie`,Statistics:`Statistieken`,"compared with":`vergeleken met`,Visitors:`Bezoekers`,Visits:`Bezoeken`,"Page views":`Paginaweergaven`,"Average time":`Gemiddelde tijd`,"Bounce rate":`Bouncepercentage`,Channels:`Kanalen`,Sources:`Bronnen`,Countries:`Landen`,Devices:`Apparaten`,Browsers:`Browsers`,Systems:`Systemen`,Direct:`Direct`,"When people visit":`Wanneer mensen komen`,Programs:`Programma's`,Download:`Downloaden`,Open:`Openen`,"Created.":`Aangemaakt.`,"Deleted.":`Verwijderd.`},Xu={};function Zu(e){Xu=e.toLowerCase().startsWith(`nl`)?Yu:{}}function Z(e){return Xu[e]??e}var Qu=[`href`],$u=L({__name:`Link`,props:{href:{}},setup(e){function t(e,t){e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0||(e.preventDefault(),b1(t))}return(n,r)=>(H(),U(`a`,{href:e.href,onClick:r[0]||=n=>t(n,e.href)},[Sa(n.$slots,`default`)],8,Qu))}}),ed={class:`font-display mb-6 text-2xl font-bold`},td={class:`mb-4 text-muted`},nd={class:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`},rd=L({__name:`Dashboard`,props:{navigation:{}},setup(e){return(t,n)=>(H(),U(B,null,[G(`h1`,ed,k(P(Z)(`Dashboard`)),1),G(`p`,td,k(P(X).user?.name),1),G(`div`,nd,[(H(!0),U(B,null,R(e.navigation,e=>(H(),W($u,{key:e.href,href:e.href,class:`m-card block p-5 font-semibold transition hover:border-brand`},{default:F(()=>[q(k(P(Z)(e.label)),1)]),_:2},1032,[`href`]))),128))])],64))}}),id={class:`m-card max-w-xl p-6`},ad={class:`text-sm`},od=L({__name:`Fallback`,setup(e){return(e,t)=>(H(),U(`div`,id,[G(`p`,ad,k(P(Z)(`This page has no screen in the manager yet.`)),1),K($u,{href:P(X).base,class:`m-btn m-btn-secondary mt-4`},{default:F(()=>[q(k(P(Z)(`Go to the dashboard`)),1)]),_:1},8,[`href`])]))}}),sd={class:`grid min-h-screen place-items-center px-4`},cd=[`src`],ld={class:`font-display text-2xl font-bold`},ud={class:`mt-1 text-sm text-muted`},dd={class:`mt-6`},fd={for:`email`,class:`m-label`},pd={key:0,class:`m-error`},md={class:`mt-4`},hd={for:`password`,class:`m-label`},gd={key:0,class:`m-error`},_d={key:0,class:`mt-4`},vd={key:0,class:`m-error`},yd={key:1,class:`mt-4`},bd=[`for`],xd=[`id`,`onUpdate:modelValue`,`type`,`autocomplete`,`required`],Sd={key:0,class:`m-error`},Cd={class:`mt-4 flex items-center gap-2 text-sm text-muted`},wd=[`disabled`],Td=L({__name:`Login`,setup(e){let t=X.login_fields??[],n=Ju({email:``,password:``,remember:!1,...Object.fromEntries(t.map(e=>[e.name,``]))}),r=N(null),i;ia(()=>{let e=t.find(e=>e.type===`turnstile`);if(!e)return;let a=()=>{i=window.turnstile.render(r.value,{sitekey:e.site_key,callback:t=>n.values[e.name]=t})};if(window.turnstile)a();else{let e=document.createElement(`script`);e.src=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,e.async=!0,e.onload=a,document.head.appendChild(e)}});async function a(){let e=await n.send(`post`,X.base+`/login`);e?window.location.assign(e.redirect):(n.values.password=``,i!==void 0&&window.turnstile.reset(i),t.filter(e=>e.type===`turnstile`).forEach(e=>n.values[e.name]=``))}return(e,i)=>(H(),U(`div`,sd,[G(`form`,{class:`m-card w-full max-w-sm p-7`,onSubmit:Tu(a,[`prevent`])},[P(X).logo?(H(),U(`img`,{key:0,src:P(X).logo,alt:``,class:`mb-4 h-9 w-auto`},null,8,cd)):J(``,!0),G(`h1`,ld,k(P(X).name),1),G(`p`,ud,k(P(Z)(`Log in to manage the site.`)),1),G(`div`,dd,[G(`label`,fd,k(P(Z)(`Email`)),1),I(G(`input`,{id:`email`,"onUpdate:modelValue":i[0]||=e=>P(n).values.email=e,type:`email`,autocomplete:`username`,required:``,autofocus:``,class:`m-input`},null,512),[[Y,P(n).values.email]]),P(n).errors.email?(H(),U(`p`,pd,k(P(n).errors.email),1)):J(``,!0)]),G(`div`,md,[G(`label`,hd,k(P(Z)(`Password`)),1),I(G(`input`,{id:`password`,"onUpdate:modelValue":i[1]||=e=>P(n).values.password=e,type:`password`,autocomplete:`current-password`,required:``,class:`m-input`},null,512),[[Y,P(n).values.password]]),P(n).errors.password?(H(),U(`p`,gd,k(P(n).errors.password),1)):J(``,!0)]),(H(!0),U(B,null,R(P(t),e=>(H(),U(B,{key:e.name},[e.type===`turnstile`?(H(),U(`div`,_d,[G(`div`,{ref_for:!0,ref:e=>r.value=e},null,512),P(n).errors[e.name]?(H(),U(`p`,vd,k(P(n).errors[e.name]),1)):J(``,!0)])):(H(),U(`div`,yd,[G(`label`,{for:`login-`+e.name,class:`m-label`},k(P(Z)(e.label??e.name)),9,bd),I(G(`input`,{id:`login-`+e.name,"onUpdate:modelValue":t=>P(n).values[e.name]=t,type:e.type===`password`||e.type===`number`?e.type:`text`,autocomplete:e.autocomplete,required:e.required,class:`m-input`},null,8,xd),[[yu,P(n).values[e.name]]]),P(n).errors[e.name]?(H(),U(`p`,Sd,k(P(n).errors[e.name]),1)):J(``,!0)]))],64))),128)),G(`label`,Cd,[I(G(`input`,{"onUpdate:modelValue":i[2]||=e=>P(n).values.remember=e,type:`checkbox`},null,512),[[du,P(n).values.remember]]),q(` `+k(P(Z)(`Keep me logged in`)),1)]),G(`button`,{type:`submit`,class:`m-btn m-btn-primary mt-6 w-full justify-center`,disabled:P(n).busy},k(P(n).busy?P(Z)(`Logging in…`):P(Z)(`Log in`)),9,wd)],32)]))}}),Ed={class:`m-card max-h-[85vh] w-full max-w-3xl overflow-y-auto p-5`,role:`dialog`,"aria-modal":`true`},Dd={class:`mb-4 flex items-center justify-between`},Od={class:`font-display text-lg font-bold`},kd={key:0,class:`text-sm text-muted`},Ad={key:1,class:`text-sm text-muted`},jd={key:2,class:`grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4`},Md=[`onClick`],Nd=[`src`,`alt`],Pd={class:`block truncate px-2 py-1 text-xs`},Fd=L({__name:`MediaPicker`,emits:[`pick`,`close`],setup(e,{emit:t}){let n=t,r=N([]),i=N(!0);return ia(async()=>{try{r.value=(await qu.get(`${X.base}/media/items`)).items.filter(e=>e.is_image)}finally{i.value=!1}}),(e,t)=>(H(),U(`div`,{class:`fixed inset-0 z-50 grid place-items-center bg-black/60 p-4`,onClick:t[1]||=Tu(e=>n(`close`),[`self`])},[G(`div`,Ed,[G(`div`,Dd,[G(`h2`,Od,k(P(Z)(`Choose an image`)),1),G(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:t[0]||=e=>n(`close`)},k(P(Z)(`Cancel`)),1)]),i.value?(H(),U(`p`,kd,k(P(Z)(`Loading…`)),1)):r.value.length?(H(),U(`div`,jd,[(H(!0),U(B,null,R(r.value,e=>(H(),U(`button`,{key:e.id,type:`button`,class:`overflow-hidden rounded-lg border border-line text-left hover:border-brand`,onClick:t=>n(`pick`,e.url,e)},[G(`img`,{src:e.url,alt:e.name,loading:`lazy`,class:`aspect-square w-full object-cover`},null,8,Nd),G(`span`,Pd,k(e.name),1)],8,Md))),128))])):(H(),U(`p`,Ad,k(P(Z)(`No images yet.`)),1))])]))}}),Id=[`aria-label`],Ld=[`disabled`,`title`],Rd=[`disabled`,`title`],zd=[`disabled`,`title`],Bd=[`disabled`,`title`],Vd=[`disabled`,`title`],Hd=[`disabled`,`title`],Ud=[`disabled`],Wd={class:`ml-auto flex gap-1`},Gd=[`id`,`value`,`rows`,`required`,`maxlength`],Kd={key:0,class:`m-input min-h-40 overflow-auto`},qd={key:0,class:`text-sm text-muted`},Jd=[`innerHTML`],Yd=L({__name:`MarkdownEditor`,props:{modelValue:{},id:{},rows:{},required:{type:Boolean},maxlength:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=N(null),a=N(`write`),o=N(``),s=N(!1),c=N(!1),l=X.permissions.includes(`media.view`);function u(e,t=e,a=``){let o=i.value,s=o.selectionStart,c=o.selectionEnd,l=n.modelValue.slice(s,c)||a,u=n.modelValue.slice(0,s)+e+l+t+n.modelValue.slice(c);r(`update:modelValue`,u),requestAnimationFrame(()=>{o.focus(),o.setSelectionRange(s+e.length,s+e.length+l.length)})}function d(e){let t=i.value,a=n.modelValue.lastIndexOf(` +`,t.selectionStart-1)+1,o=t.selectionEnd,s=n.modelValue.slice(a,o).split(` +`).map(t=>e+t).join(` +`);r(`update:modelValue`,n.modelValue.slice(0,a)+s+n.modelValue.slice(o)),requestAnimationFrame(()=>t.focus())}function f(e,t){c.value=!1;let a=(t?.alt||t?.name||``).replace(/[[\]]/g,``),o=i.value,s=o.selectionStart,l=`![${a}](${e})`;r(`update:modelValue`,n.modelValue.slice(0,s)+l+n.modelValue.slice(o.selectionEnd)),requestAnimationFrame(()=>{o.focus(),o.setSelectionRange(s+l.length,s+l.length)})}async function p(e){if(a.value=e,e===`preview`){s.value=!0;try{o.value=(await qu.post(`${X.base}/markdown`,{text:n.modelValue})).html}finally{s.value=!1}}}return(t,n)=>(H(),U(`div`,null,[G(`div`,{class:`mb-2 flex flex-wrap items-center gap-1`,role:`toolbar`,"aria-label":P(Z)(`Formatting`)},[G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1 font-bold`,disabled:a.value===`preview`,title:P(Z)(`Bold`),onClick:n[0]||=e=>u(`**`,`**`,P(Z)(`bold`))},`B`,8,Ld),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1 italic`,disabled:a.value===`preview`,title:P(Z)(`Italic`),onClick:n[1]||=e=>u(`*`,`*`,P(Z)(`italic`))},`I`,8,Rd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`Heading`),onClick:n[2]||=e=>d(`## `)},`H`,8,zd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`List`),onClick:n[3]||=e=>d(`- `)},`•`,8,Bd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`Quote`),onClick:n[4]||=e=>d(`> `)},`”`,8,Vd),G(`button`,{type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,title:P(Z)(`Link`),onClick:n[5]||=e=>u(`[`,`](https://)`,P(Z)(`text`))},`🔗`,8,Hd),P(l)?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary !px-2 !py-1`,disabled:a.value===`preview`,onClick:n[6]||=e=>c.value=!0},k(P(Z)(`Photo`)),9,Ud)):J(``,!0),G(`span`,Wd,[G(`button`,{type:`button`,class:O([`m-btn !px-3 !py-1`,a.value===`write`?`m-btn-primary`:`m-btn-secondary`]),onClick:n[7]||=e=>p(`write`)},k(P(Z)(`Write`)),3),G(`button`,{type:`button`,class:O([`m-btn !px-3 !py-1`,a.value===`preview`?`m-btn-primary`:`m-btn-secondary`]),onClick:n[8]||=e=>p(`preview`)},k(P(Z)(`Preview`)),3)])],8,Id),I(G(`textarea`,{id:e.id,ref_key:`area`,ref:i,value:e.modelValue,rows:e.rows??14,required:e.required,maxlength:e.maxlength,class:`m-input font-mono`,onInput:n[9]||=e=>r(`update:modelValue`,e.target.value)},null,40,Gd),[[$c,a.value===`write`]]),a.value===`preview`?(H(),U(`div`,Kd,[s.value?(H(),U(`p`,qd,k(P(Z)(`Loading…`)),1)):(H(),U(`div`,{key:1,class:`m-prose`,innerHTML:o.value},null,8,Jd))])):J(``,!0),c.value?(H(),W(Fd,{key:1,onPick:f,onClose:n[10]||=e=>c.value=!1})):J(``,!0)]))}}),Xd={class:`m-card mt-6 max-w-3xl p-5`},Zd={class:`font-display text-lg font-bold`},Qd={key:0,class:`mt-2 text-sm text-muted`},$d={key:1,class:`mt-2 text-sm text-muted`},ef={key:2,class:`mt-3 divide-y divide-line`},tf={class:`flex flex-wrap items-center justify-between gap-2`},nf=[`aria-expanded`,`onClick`],rf={class:`font-semibold`},af={key:0,class:`text-muted`},of={key:1,class:`m-badge ml-2`},sf={class:`block text-xs text-muted`},cf=[`onClick`],lf={key:0,class:`mt-2 space-y-2 text-sm`},uf={class:`text-xs font-semibold uppercase tracking-wide text-muted`},df={class:`whitespace-pre-wrap break-words`},ff=L({__name:`RevisionsPanel`,props:{type:{},id:{}},setup(e){let t=e,n=N([]),r=N(!1),i=N(null),a=N(!0),o=`${X.base}/revisions/${t.type}/${t.id}`;ia(async()=>{try{let e=await qu.get(o);n.value=e.revisions,r.value=e.can_restore}finally{a.value=!1}});async function s(e){window.confirm(Z(`Put this version back? The text now is kept in the history.`))&&(await qu.post(`${o}/${e.id}/restore`),$(Z(`The earlier version is back.`)),await x1())}let c=e=>new Date(e).toLocaleString(X.locale||void 0);return(e,t)=>(H(),U(`section`,Xd,[G(`h2`,Zd,k(P(Z)(`History`)),1),a.value?(H(),U(`p`,Qd,k(P(Z)(`Loading…`)),1)):n.value.length?(H(),U(`ul`,ef,[(H(!0),U(B,null,R(n.value,e=>(H(),U(`li`,{key:e.id,class:`py-3`},[G(`div`,tf,[G(`button`,{type:`button`,class:`text-left text-sm`,"aria-expanded":i.value===e.id,onClick:t=>i.value=i.value===e.id?null:e.id},[G(`span`,rf,k(c(e.created_at)),1),e.user?(H(),U(`span`,af,` · `+k(e.user),1)):J(``,!0),e.current?(H(),U(`span`,of,k(P(Z)(`Now`)),1)):J(``,!0),G(`span`,sf,k(e.changed.join(`, `)),1)],8,nf),r.value&&!e.current?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>s(e)},k(P(Z)(`Put back`)),9,cf)):J(``,!0)]),i.value===e.id?(H(),U(`dl`,lf,[(H(!0),U(B,null,R(e.values,(e,t)=>(H(),U(`div`,{key:t},[G(`dt`,uf,k(t),1),G(`dd`,df,k(e),1)]))),128))])):J(``,!0)]))),128))])):(H(),U(`p`,$d,k(P(Z)(`Nothing here yet.`)),1))]))}}),pf={class:`mb-6 flex items-center justify-between gap-3`},mf={class:`font-display text-2xl font-bold`},hf={for:`title`,class:`m-label`},gf={key:0,class:`m-error`},_f={class:`grid gap-5 sm:grid-cols-2`},vf={for:`slug`,class:`m-label`},yf={key:0,class:`m-error`},bf={for:`category`,class:`m-label`},xf={id:`categories`},Sf=[`value`],Cf={for:`excerpt`,class:`m-label`},wf={key:0,class:`m-error`},Tf={for:`body`,class:`m-label`},Ef={key:0,class:`m-error`},Df={class:`grid gap-5 sm:grid-cols-2`},Of={for:`cover`,class:`m-label`},kf={class:`flex gap-2`},Af={for:`tags`,class:`m-label`},jf={id:`known-tags`},Mf=[`value`],Nf={class:`flex flex-wrap items-center gap-6`},Pf={class:`flex items-center gap-2 text-sm`},Ff={key:0,class:`flex items-center gap-2 text-sm`},If={key:1},Lf={for:`at`,class:`m-label`},Rf=[`disabled`],zf=L({__name:`PostForm`,props:{post:{},categories:{},known_tags:{}},setup(e){let t=e.post,n=Ju({title:t?.title??``,slug:t?.slug??``,excerpt:t?.excerpt??``,body:t?.body??``,cover_image:t?.cover_image??``,category:t?.category??``,tags:t?.tags??[],is_featured:t?.is_featured??!1,is_published:t?.is_published??!1,published_at:t?.published_at??``}),r=N(!1),i=(t?.tags??[]).join(`, `);async function a(){n.values.tags=i.split(`,`).map(e=>e.trim()).filter(Boolean),(t?await n.send(`put`,`${X.base}/posts/${t.id}`):await n.send(`post`,`${X.base}/posts`))&&($(Z(t?`Saved.`:`Created.`)),b1(`${X.base}/posts`))}return(o,s)=>(H(),U(B,null,[G(`div`,pf,[G(`h1`,mf,k(P(t)?P(t).title:P(Z)(`New post`)),1),K($u,{href:P(X).base+`/posts`,class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Back`)),1)]),_:1},8,[`href`])]),G(`form`,{class:`m-card max-w-3xl space-y-5 p-5`,onSubmit:Tu(a,[`prevent`])},[G(`div`,null,[G(`label`,hf,k(P(Z)(`Title`)),1),I(G(`input`,{id:`title`,"onUpdate:modelValue":s[0]||=e=>P(n).values.title=e,required:``,maxlength:`255`,class:`m-input`},null,512),[[Y,P(n).values.title]]),P(n).errors.title?(H(),U(`p`,gf,k(P(n).errors.title),1)):J(``,!0)]),G(`div`,_f,[G(`div`,null,[G(`label`,vf,k(P(Z)(`Address (slug)`)),1),I(G(`input`,{id:`slug`,"onUpdate:modelValue":s[1]||=e=>P(n).values.slug=e,maxlength:`255`,class:`m-input`},null,512),[[Y,P(n).values.slug]]),P(n).errors.slug?(H(),U(`p`,yf,k(P(n).errors.slug),1)):J(``,!0)]),G(`div`,null,[G(`label`,bf,k(P(Z)(`Category`)),1),I(G(`input`,{id:`category`,"onUpdate:modelValue":s[2]||=e=>P(n).values.category=e,list:`categories`,maxlength:`60`,class:`m-input`},null,512),[[Y,P(n).values.category]]),G(`datalist`,xf,[(H(!0),U(B,null,R(e.categories,e=>(H(),U(`option`,{key:e,value:e},null,8,Sf))),128))])])]),G(`div`,null,[G(`label`,Cf,k(P(Z)(`Summary`)),1),I(G(`textarea`,{id:`excerpt`,"onUpdate:modelValue":s[3]||=e=>P(n).values.excerpt=e,rows:`2`,maxlength:`500`,class:`m-input`},null,512),[[Y,P(n).values.excerpt]]),P(n).errors.excerpt?(H(),U(`p`,wf,k(P(n).errors.excerpt),1)):J(``,!0)]),G(`div`,null,[G(`label`,Tf,k(P(Z)(`Text (Markdown)`)),1),K(Yd,{id:`body`,modelValue:P(n).values.body,"onUpdate:modelValue":s[4]||=e=>P(n).values.body=e,required:``},null,8,[`modelValue`]),P(n).errors.body?(H(),U(`p`,Ef,k(P(n).errors.body),1)):J(``,!0)]),G(`div`,Df,[G(`div`,null,[G(`label`,Of,k(P(Z)(`Cover image`)),1),G(`div`,kf,[I(G(`input`,{id:`cover`,"onUpdate:modelValue":s[5]||=e=>P(n).values.cover_image=e,maxlength:`2048`,class:`m-input`},null,512),[[Y,P(n).values.cover_image]]),P(X).permissions.includes(`media.view`)?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary shrink-0`,onClick:s[6]||=e=>r.value=!0},k(P(Z)(`Choose`)),1)):J(``,!0)])]),G(`div`,null,[G(`label`,Af,k(P(Z)(`Tags (comma separated)`)),1),I(G(`input`,{id:`tags`,"onUpdate:modelValue":s[7]||=e=>M(i)?i.value=e:i=e,list:`known-tags`,class:`m-input`},null,512),[[Y,P(i)]]),G(`datalist`,jf,[(H(!0),U(B,null,R(e.known_tags,e=>(H(),U(`option`,{key:e,value:e},null,8,Mf))),128))])])]),G(`div`,Nf,[G(`label`,Pf,[I(G(`input`,{"onUpdate:modelValue":s[8]||=e=>P(n).values.is_featured=e,type:`checkbox`},null,512),[[du,P(n).values.is_featured]]),q(` `+k(P(Z)(`Featured`)),1)]),P(X).permissions.includes(`posts.publish`)?(H(),U(`label`,Ff,[I(G(`input`,{"onUpdate:modelValue":s[9]||=e=>P(n).values.is_published=e,type:`checkbox`},null,512),[[du,P(n).values.is_published]]),q(` `+k(P(Z)(`Publish`)),1)])):J(``,!0),P(n).values.is_published?(H(),U(`div`,If,[G(`label`,Lf,k(P(Z)(`Publish at`)),1),I(G(`input`,{id:`at`,"onUpdate:modelValue":s[10]||=e=>P(n).values.published_at=e,type:`datetime-local`,class:`m-input`},null,512),[[Y,P(n).values.published_at]])])):J(``,!0)]),G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(n).busy},k(P(n).busy?P(Z)(`Saving…`):P(Z)(`Save`)),9,Rf)],32),P(t)&&P(X).permissions.includes(`revisions.view`)?(H(),W(ff,{key:0,type:`posts`,id:P(t).id},null,8,[`id`])):J(``,!0),r.value?(H(),W(Fd,{key:1,onPick:s[11]||=e=>{P(n).values.cover_image=e,r.value=!1},onClose:s[12]||=e=>r.value=!1})):J(``,!0)],64))}}),Bf={class:`mb-6 flex flex-wrap items-center justify-between gap-3`},Vf={class:`font-display text-2xl font-bold`},Hf={key:0,class:`m-card p-5 text-sm text-muted`},Uf={key:1,class:`m-card divide-y divide-line`},Wf={class:`min-w-0`},Gf={class:`truncate font-semibold`},Kf={class:`mt-1 flex items-center gap-2 text-xs text-muted`},qf={class:`m-badge`},Jf={key:0},Yf={class:`flex gap-2`},Xf=[`onClick`],Zf=[`onClick`],Qf=L({__name:`PostsIndex`,props:{posts:{}},setup(e){let t={draft:`Draft`,scheduled:`Scheduled`,published:`Published`};async function n(e){await qu.put(`${X.base}/posts/${e.id}/online`,{online:e.status!==`published`}),await x1()}async function r(e){window.confirm(Z(`Are you sure?`))&&(await qu.delete(`${X.base}/posts/${e.id}`),$(Z(`Deleted.`)),await x1())}return(i,a)=>(H(),U(B,null,[G(`div`,Bf,[G(`h1`,Vf,k(P(Z)(`Posts`)),1),P(X).permissions.includes(`posts.write`)?(H(),W($u,{key:0,href:P(X).base+`/posts/create`,class:`m-btn m-btn-primary`},{default:F(()=>[q(k(P(Z)(`New post`)),1)]),_:1},8,[`href`])):J(``,!0)]),e.posts.length?(H(),U(`ul`,Uf,[(H(!0),U(B,null,R(e.posts,e=>(H(),U(`li`,{key:e.id,class:`flex flex-wrap items-center justify-between gap-3 p-4`},[G(`div`,Wf,[G(`p`,Gf,k(e.title),1),G(`p`,Kf,[G(`span`,qf,k(P(Z)(t[e.status])),1),e.category?(H(),U(`span`,Jf,k(e.category),1)):J(``,!0)])]),G(`div`,Yf,[P(X).permissions.includes(`posts.publish`)&&e.can_change?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>n(e)},k(e.status===`published`?P(Z)(`Take offline`):P(Z)(`Put online`)),9,Xf)):J(``,!0),e.can_change?(H(),W($u,{key:1,href:`${P(X).base}/posts/${e.id}/edit`,class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Edit`)),1)]),_:1},8,[`href`])):J(``,!0),e.can_delete?(H(),U(`button`,{key:2,type:`button`,class:`m-btn m-btn-danger`,onClick:t=>r(e)},k(P(Z)(`Delete`)),9,Zf)):J(``,!0)])]))),128))])):(H(),U(`p`,Hf,k(P(Z)(`No posts yet.`)),1))],64))}}),$f={class:`font-display mb-6 text-2xl font-bold`},ep={for:`name`,class:`m-label`},tp={key:0,class:`m-error`},np={class:`m-label`},rp={class:`text-sm`},ip={class:`m-label`},ap={class:`flex flex-wrap gap-1.5`},op={key:0,class:`m-badge`},sp={key:0,class:`m-badge`},cp={key:0,class:`rounded-lg border border-line p-4`},lp={class:`px-1.5 text-sm font-semibold`},up={class:`mt-1 flex flex-wrap gap-3`},dp=[`onUpdate:modelValue`,`value`],fp={class:`flex`},pp={key:0,class:`m-error`},mp={class:`space-y-4 rounded-lg border border-line p-4`},hp={class:`px-1.5 text-sm font-semibold`},gp={class:`m-help`},_p={for:`current_password`,class:`m-label`},vp={key:0,class:`m-error`},yp={for:`password`,class:`m-label`},bp={class:`m-help`},xp={key:0,class:`m-error`},Sp={for:`password_confirmation`,class:`m-label`},Cp=[`disabled`],wp=L({__name:`Profile`,props:{profile:{}},setup(e){let t=e,n=Ju({name:t.profile.name,theme:t.profile.theme,current_password:``,password:``,password_confirmation:``});async function r(){await n.send(`put`,X.base+`/profile`)&&($(Z(`Saved.`)),n.values.theme!==X.theme&&window.location.reload(),n.values.current_password=n.values.password=n.values.password_confirmation=``)}return(t,i)=>(H(),U(B,null,[G(`h1`,$f,k(P(Z)(`My account`)),1),G(`form`,{class:`m-card max-w-xl space-y-5 p-5`,onSubmit:Tu(r,[`prevent`])},[G(`div`,null,[G(`label`,ep,k(P(Z)(`Name`)),1),I(G(`input`,{id:`name`,"onUpdate:modelValue":i[0]||=e=>P(n).values.name=e,type:`text`,required:``,maxlength:`255`,class:`m-input`,autocomplete:`name`},null,512),[[Y,P(n).values.name]]),P(n).errors.name?(H(),U(`p`,tp,k(P(n).errors.name),1)):J(``,!0)]),G(`div`,null,[G(`span`,np,k(P(Z)(`Email address`)),1),G(`p`,rp,k(e.profile.email),1)]),G(`div`,null,[G(`span`,ip,k(P(Z)(`What you may do`)),1),G(`p`,ap,[e.profile.is_super_admin?(H(),U(`span`,op,k(P(Z)(`Super admin: everything`)),1)):(H(),U(B,{key:1},[(H(!0),U(B,null,R(e.profile.groups,e=>(H(),U(`span`,{key:e,class:`m-badge`},k(e),1))),128)),e.profile.groups.length?J(``,!0):(H(),U(`span`,sp,k(P(Z)(`Not in a group yet`)),1))],64))])]),e.profile.themes.length?(H(),U(`fieldset`,cp,[G(`legend`,lp,k(P(Z)(`Look`)),1),G(`div`,up,[(H(!0),U(B,null,R(e.profile.themes,e=>(H(),U(`label`,{key:e.key,class:O([`flex cursor-pointer items-center gap-2 rounded-lg border px-3 py-2 text-sm`,P(n).values.theme===e.key?`border-brand`:`border-line`])},[I(G(`input`,{"onUpdate:modelValue":e=>P(n).values.theme=e,type:`radio`,name:`theme`,value:e.key,class:`sr-only`},null,8,dp),[[pu,P(n).values.theme]]),G(`span`,fp,[(H(),U(B,null,R([`ink`,`panel`,`brand`],t=>G(`span`,{key:t,class:`h-4 w-4 border border-line`,style:_e({background:e.colors[t]})},null,4)),64))]),q(` `+k(e.label),1)],2))),128))]),P(n).errors.theme?(H(),U(`p`,pp,k(P(n).errors.theme),1)):J(``,!0)])):J(``,!0),G(`fieldset`,mp,[G(`legend`,hp,k(P(Z)(`New password`)),1),G(`p`,gp,k(P(Z)(`Leave empty to keep the password you have.`)),1),G(`div`,null,[G(`label`,_p,k(P(Z)(`Current password`)),1),I(G(`input`,{id:`current_password`,"onUpdate:modelValue":i[1]||=e=>P(n).values.current_password=e,type:`password`,class:`m-input`,autocomplete:`current-password`},null,512),[[Y,P(n).values.current_password]]),P(n).errors.current_password?(H(),U(`p`,vp,k(P(n).errors.current_password),1)):J(``,!0)]),G(`div`,null,[G(`label`,yp,k(P(Z)(`New password`)),1),I(G(`input`,{id:`password`,"onUpdate:modelValue":i[2]||=e=>P(n).values.password=e,type:`password`,minlength:`12`,maxlength:`200`,class:`m-input`,autocomplete:`new-password`},null,512),[[Y,P(n).values.password]]),G(`p`,bp,k(P(Z)(`At least 12 characters.`)),1),P(n).errors.password?(H(),U(`p`,xp,k(P(n).errors.password),1)):J(``,!0)]),G(`div`,null,[G(`label`,Sp,k(P(Z)(`New password, once more`)),1),I(G(`input`,{id:`password_confirmation`,"onUpdate:modelValue":i[3]||=e=>P(n).values.password_confirmation=e,type:`password`,maxlength:`200`,class:`m-input`,autocomplete:`new-password`},null,512),[[Y,P(n).values.password_confirmation]])])]),G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(n).busy},k(P(n).busy?P(Z)(`Saving…`):P(Z)(`Save`)),9,Cp)],32)],64))}}),Tp={class:`mb-6 flex flex-wrap items-center justify-between gap-3`},Ep={class:`font-display text-2xl font-bold`},Dp={class:`grid gap-4 sm:grid-cols-2`},Op={class:`m-label`,for:`a-name`},kp={key:0,class:`m-error`},Ap={class:`m-label`,for:`a-email`},jp={key:0,class:`m-error`},Mp={class:`m-label`,for:`a-pass`},Np=[`required`],Pp={class:`m-help`},Fp={key:0,class:`m-error`},Ip={key:0},Lp={class:`m-label`},Rp=[`value`,`disabled`],zp={class:`flex gap-2`},Bp=[`disabled`],Vp={class:`m-card divide-y divide-line`},Hp={class:`min-w-0`},Up={class:`truncate font-semibold`},Wp={key:0,class:`text-xs font-normal text-muted`},Gp={class:`truncate text-xs text-muted`},Kp={class:`mt-1 flex flex-wrap gap-1`},qp={key:0,class:`m-badge`},Jp={class:`flex gap-2`},Yp=[`onClick`],Xp=[`onClick`],Zp=L({__name:`AccountsIndex`,props:{accounts:{},groups:{}},setup(e){let t=N(null),n=Ju({name:``,email:``,password:``,groups:[]});function r(e){t.value=e,n.errors={},n.values.name=e===`new`?``:e.name,n.values.email=e===`new`?``:e.email,n.values.password=``,n.values.groups=e===`new`?[]:e.groups.map(e=>e.id)}async function i(){let e=t.value;(e===`new`?await n.send(`post`,`${X.base}/accounts`):await n.send(`put`,`${X.base}/accounts/${e.id}`))&&($(Z(`Saved.`)),t.value=null,await x1())}async function a(e){window.confirm(Z(`Are you sure?`))&&(await qu.delete(`${X.base}/accounts/${e.id}`),$(Z(`Deleted.`)),await x1())}return(o,s)=>(H(),U(B,null,[G(`div`,Tp,[G(`h1`,Ep,k(P(Z)(`Accounts`)),1),G(`button`,{type:`button`,class:`m-btn m-btn-primary`,onClick:s[0]||=e=>r(`new`)},k(P(Z)(`New account`)),1)]),t.value?(H(),U(`form`,{key:0,class:`m-card mb-6 max-w-2xl space-y-4 p-5`,onSubmit:Tu(i,[`prevent`])},[G(`div`,Dp,[G(`div`,null,[G(`label`,Op,k(P(Z)(`Name`)),1),I(G(`input`,{id:`a-name`,"onUpdate:modelValue":s[1]||=e=>P(n).values.name=e,required:``,maxlength:`255`,class:`m-input`},null,512),[[Y,P(n).values.name]]),P(n).errors.name?(H(),U(`p`,kp,k(P(n).errors.name),1)):J(``,!0)]),G(`div`,null,[G(`label`,Ap,k(P(Z)(`Email address`)),1),I(G(`input`,{id:`a-email`,"onUpdate:modelValue":s[2]||=e=>P(n).values.email=e,type:`email`,required:``,maxlength:`255`,class:`m-input`},null,512),[[Y,P(n).values.email]]),P(n).errors.email?(H(),U(`p`,jp,k(P(n).errors.email),1)):J(``,!0)])]),G(`div`,null,[G(`label`,Mp,k(P(Z)(`Password`)),1),I(G(`input`,{id:`a-pass`,"onUpdate:modelValue":s[3]||=e=>P(n).values.password=e,type:`password`,minlength:`12`,maxlength:`200`,required:t.value===`new`,class:`m-input`,autocomplete:`new-password`},null,8,Np),[[Y,P(n).values.password]]),G(`p`,Pp,k(t.value===`new`?P(Z)(`At least 12 characters.`):P(Z)(`Leave empty to keep the password you have.`)),1),P(n).errors.password?(H(),U(`p`,Fp,k(P(n).errors.password),1)):J(``,!0)]),e.groups.length?(H(),U(`fieldset`,Ip,[G(`legend`,Lp,k(P(Z)(`Groups`)),1),(H(!0),U(B,null,R(e.groups,e=>(H(),U(`label`,{key:e.id,class:O([`flex items-center gap-2 py-0.5 text-sm`,e.can_give?``:`opacity-50`])},[I(G(`input`,{"onUpdate:modelValue":s[4]||=e=>P(n).values.groups=e,type:`checkbox`,value:e.id,disabled:!e.can_give},null,8,Rp),[[du,P(n).values.groups]]),q(` `+k(e.name),1)],2))),128))])):J(``,!0),G(`div`,zp,[G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(n).busy},k(P(n).busy?P(Z)(`Saving…`):P(Z)(`Save`)),9,Bp),G(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:s[5]||=e=>t.value=null},k(P(Z)(`Cancel`)),1)])],32)):J(``,!0),G(`ul`,Vp,[(H(!0),U(B,null,R(e.accounts,e=>(H(),U(`li`,{key:e.id,class:`flex flex-wrap items-center justify-between gap-3 p-4`},[G(`div`,Hp,[G(`p`,Up,[q(k(e.name)+` `,1),e.is_you?(H(),U(`span`,Wp,`(`+k(P(Z)(`you`))+`)`,1)):J(``,!0)]),G(`p`,Gp,k(e.email),1),G(`p`,Kp,[e.is_super_admin?(H(),U(`span`,qp,k(P(Z)(`Super admin`)),1)):J(``,!0),(H(!0),U(B,null,R(e.groups,e=>(H(),U(`span`,{key:e.id,class:`m-badge`},k(e.name),1))),128))])]),G(`div`,Jp,[e.can_change?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>r(e)},k(P(Z)(`Edit`)),9,Yp)):J(``,!0),e.can_delete?(H(),U(`button`,{key:1,type:`button`,class:`m-btn m-btn-danger`,onClick:t=>a(e)},k(P(Z)(`Delete`)),9,Xp)):J(``,!0)])]))),128))])],64))}}),Qp={class:`mb-6 flex flex-wrap items-center justify-between gap-3`},$p={class:`font-display text-2xl font-bold`},em={class:`m-label`,for:`g-name`},tm={key:0,class:`m-error`},nm={class:`m-label`,for:`g-desc`},rm={class:`px-1 text-sm font-semibold`},im=[`value`,`onChange`],am={class:`flex gap-2`},om=[`disabled`],sm={key:1,class:`m-card p-5 text-sm text-muted`},cm={key:2,class:`m-card divide-y divide-line`},lm={class:`min-w-0`},um={class:`font-semibold`},dm={class:`text-xs font-normal text-muted`},fm={key:0,class:`text-xs text-muted`},pm={class:`flex gap-2`},mm=[`onClick`],hm=[`onClick`],gm=L({__name:`GroupsIndex`,props:{groups:{},catalogue:{}},setup(e){let t=e,n=N(null),r=Ju({name:``,description:``,permissions:[]}),i=t.catalogue.flatMap(e=>e.permissions);function a(e){n.value=e,r.errors={},r.values.name=e===`new`?``:e.name,r.values.description=e===`new`?``:e.description??``,r.values.permissions=e===`new`?[]:[...e.permissions]}function o(e){r.values.permissions.includes(e.value)?r.values.permissions=[...new Set([...r.values.permissions,...e.needs])]:r.values.permissions=r.values.permissions.filter(t=>!i.find(e=>e.value===t)?.needs.includes(e.value))}async function s(){let e=n.value;(e===`new`?await r.send(`post`,`${X.base}/groups`):await r.send(`put`,`${X.base}/groups/${e.id}`))&&($(Z(`Saved.`)),n.value=null,await x1())}async function c(e){window.confirm(Z(`Are you sure?`))&&(await qu.delete(`${X.base}/groups/${e.id}`),$(Z(`Deleted.`)),await x1())}return(t,i)=>(H(),U(B,null,[G(`div`,Qp,[G(`h1`,$p,k(P(Z)(`Groups`)),1),G(`button`,{type:`button`,class:`m-btn m-btn-primary`,onClick:i[0]||=e=>a(`new`)},k(P(Z)(`New group`)),1)]),n.value?(H(),U(`form`,{key:0,class:`m-card mb-6 max-w-3xl space-y-4 p-5`,onSubmit:Tu(s,[`prevent`])},[G(`div`,null,[G(`label`,em,k(P(Z)(`Name`)),1),I(G(`input`,{id:`g-name`,"onUpdate:modelValue":i[1]||=e=>P(r).values.name=e,required:``,maxlength:`60`,class:`m-input`},null,512),[[Y,P(r).values.name]]),P(r).errors.name?(H(),U(`p`,tm,k(P(r).errors.name),1)):J(``,!0)]),G(`div`,null,[G(`label`,nm,k(P(Z)(`Description`)),1),I(G(`textarea`,{id:`g-desc`,"onUpdate:modelValue":i[2]||=e=>P(r).values.description=e,rows:`2`,maxlength:`500`,class:`m-input`},null,512),[[Y,P(r).values.description]])]),(H(!0),U(B,null,R(e.catalogue,e=>(H(),U(`fieldset`,{key:e.section,class:`rounded-lg border border-line p-3`},[G(`legend`,rm,k(e.section),1),(H(!0),U(B,null,R(e.permissions,e=>(H(),U(`label`,{key:e.value,class:`flex items-center gap-2 py-0.5 text-sm`},[I(G(`input`,{"onUpdate:modelValue":i[3]||=e=>P(r).values.permissions=e,type:`checkbox`,value:e.value,onChange:t=>o(e)},null,40,im),[[du,P(r).values.permissions]]),q(` `+k(e.label),1)]))),128))]))),128)),G(`div`,am,[G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(r).busy},k(P(r).busy?P(Z)(`Saving…`):P(Z)(`Save`)),9,om),G(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:i[4]||=e=>n.value=null},k(P(Z)(`Cancel`)),1)])],32)):J(``,!0),e.groups.length?(H(),U(`ul`,cm,[(H(!0),U(B,null,R(e.groups,e=>(H(),U(`li`,{key:e.id,class:`flex flex-wrap items-center justify-between gap-3 p-4`},[G(`div`,lm,[G(`p`,um,[q(k(e.name)+` `,1),G(`span`,dm,`· `+k(e.accounts)+` `+k(P(Z)(`accounts`)),1)]),e.description?(H(),U(`p`,fm,k(e.description),1)):J(``,!0)]),G(`div`,pm,[G(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:t=>a(e)},k(P(Z)(`Edit`)),9,mm),G(`button`,{type:`button`,class:`m-btn m-btn-danger`,onClick:t=>c(e)},k(P(Z)(`Delete`)),9,hm)])]))),128))])):(H(),U(`p`,sm,k(P(Z)(`Nothing here yet.`)),1))],64))}}),_m={class:`font-display mb-6 text-2xl font-bold`},vm={key:0,class:`m-error mb-4`},ym={class:`grid gap-6 md:grid-cols-2`},bm={class:`mb-3 font-semibold`},xm=[`onSubmit`],Sm=[`onUpdate:modelValue`,`aria-label`],Cm={type:`submit`,class:`m-btn m-btn-primary`},wm={class:`divide-y divide-line`},Tm={class:`min-w-0 truncate`},Em={class:`text-xs text-muted`},Dm={class:`flex gap-1`},Om=[`onClick`],km=[`onClick`],Am=L({__name:`LabelsIndex`,props:{categories:{},tags:{}},setup(e){let t=[{type:`category`,title:`Categories`},{type:`tag`,title:`Tags`}],n=N({category:``,tag:``}),r=N(``);async function i(e){r.value=``;try{await e(),await x1()}catch(e){if(e instanceof Uu&&e.status===422)r.value=Object.values(e.errors)[0]??e.message;else throw e}}let a=e=>i(async()=>{await qu.post(`${X.base}/labels`,{type:e,name:n.value[e]}),n.value[e]=``,$(Z(`Created.`))}),o=(e,t)=>{let n=window.prompt(Z(`New name`),t);return n&&n!==t?i(()=>qu.put(`${X.base}/labels`,{type:e,name:t,new_name:n})):void 0},s=(e,t)=>window.confirm(Z(`Are you sure?`))?i(()=>qu.delete(`${X.base}/labels`,{type:e,name:t})):void 0;return(i,c)=>(H(),U(B,null,[G(`h1`,_m,k(P(Z)(`Categories and tags`)),1),r.value?(H(),U(`p`,vm,k(r.value),1)):J(``,!0),G(`div`,ym,[(H(),U(B,null,R(t,t=>G(`section`,{key:t.type,class:`m-card p-4`},[G(`h2`,bm,k(P(Z)(t.title)),1),G(`form`,{class:`mb-3 flex gap-2`,onSubmit:Tu(e=>a(t.type),[`prevent`])},[I(G(`input`,{"onUpdate:modelValue":e=>n.value[t.type]=e,required:``,maxlength:`60`,class:`m-input`,"aria-label":P(Z)(t.title)},null,8,Sm),[[Y,n.value[t.type]]]),G(`button`,Cm,k(P(Z)(`Add`)),1)],40,xm),G(`ul`,wm,[(H(!0),U(B,null,R(t.type===`category`?e.categories:e.tags,e=>(H(),U(`li`,{key:e.name,class:`flex items-center justify-between gap-2 py-2 text-sm`},[G(`span`,Tm,[q(k(e.name)+` `,1),G(`span`,Em,`· `+k(e.posts),1)]),G(`span`,Dm,[G(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:n=>o(t.type,e.name)},k(P(Z)(`Rename`)),9,Om),G(`button`,{type:`button`,class:`m-btn m-btn-danger`,onClick:n=>s(t.type,e.name)},k(P(Z)(`Delete`)),9,km)])]))),128))])])),64))])],64))}}),jm={class:`mb-6 flex flex-wrap items-center justify-between gap-3`},Mm={class:`font-display text-2xl font-bold`},Nm=[`accept`,`disabled`],Pm=[`title`],Fm={class:`h-2 overflow-hidden rounded-full bg-panel-2`},Im={class:`m-help`},Lm={key:0,class:`w-full shrink-0 sm:w-64`},Rm=[`src`,`alt`],zm={class:`m-help`},Bm={class:`mt-2 flex items-center gap-2`},Vm=[`src`],Hm={class:`min-w-0 flex-1 space-y-3`},Um={class:`m-label`,for:`m-name`},Wm=[`disabled`],Gm={key:0,class:`m-error`},Km={key:0},qm={class:`m-label`,for:`m-alt`},Jm=[`disabled`],Ym={class:`m-help`},Xm={key:0},Zm={key:1},Qm={class:`m-help break-all`},$m={class:`flex gap-2`},eh=[`disabled`],th={key:1,class:`m-card p-5 text-sm text-muted`},nh={key:2,class:`grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5`},rh=[`onClick`],ih=[`src`,`alt`],ah={key:1,class:`grid aspect-square w-full place-items-center text-xs text-muted`},oh={class:`block truncate px-2 py-1.5 text-xs`},sh=L({__name:`MediaLibrary`,props:{items:{},max_file_mb:{},extensions:{},storage:{}},setup(e){let t=e=>X.permissions.includes(e),n=N(!1),r=N(null),i=Ju({name:``,alt:``,focus_x:null,focus_y:null}),a=e=>e>1e6?`${(e/1e6).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1e3))} kB`;function o(e){r.value=e,i.errors={},i.values.name=e.name,i.values.alt=e.alt??``,i.values.focus_x=e.focus_x,i.values.focus_y=e.focus_y}function s(e){if(!t(`media.edit`))return;let n=e.currentTarget.getBoundingClientRect();i.values.focus_x=Math.round(Math.min(1,Math.max(0,(e.clientX-n.left)/n.width))*1e3)/1e3,i.values.focus_y=Math.round(Math.min(1,Math.max(0,(e.clientY-n.top)/n.height))*1e3)/1e3}let c=(e,t)=>`${(e??.5)*100}% ${(t??.5)*100}%`;async function l(e){let t=e.target;n.value=!0;try{for(let e of Array.from(t.files??[])){let t=new FormData;t.append(`file`,e),await Ku(`${X.base}/media`,t)}$(Z(`Uploaded.`)),await x1()}catch(e){$(e instanceof Uu?Object.values(e.errors)[0]??e.message:Z(`Something went wrong. Try again.`),!0)}finally{n.value=!1,t.value=``}}async function u(){r.value&&await i.send(`put`,`${X.base}/media/${r.value.id}`)&&($(Z(`Saved.`)),r.value=null,await x1())}async function d(e){let t=e.usage_count>0?Z(`This file is in use. Delete it anyway?`):Z(`Are you sure?`);window.confirm(t)&&(await qu.delete(`${X.base}/media/${e.id}`),r.value=null,$(Z(`Deleted.`)),await x1())}return(f,p)=>(H(),U(B,null,[G(`div`,jm,[G(`h1`,Mm,k(P(Z)(`Media`)),1),t(`media.upload`)?(H(),U(`label`,{key:0,class:O([`m-btn m-btn-primary cursor-pointer`,n.value?`opacity-50`:``])},[q(k(n.value?P(Z)(`Uploading…`):P(Z)(`Upload`))+` `,1),G(`input`,{type:`file`,multiple:``,class:`sr-only`,accept:e.extensions.map(e=>`.`+e).join(`,`),disabled:n.value,onChange:l},null,40,Nm)],2)):J(``,!0)]),G(`div`,{class:`mb-6 max-w-md`,title:`${a(e.storage.used)} / ${a(e.storage.limit)}`},[G(`div`,Fm,[G(`div`,{class:`h-full bg-brand`,style:_e({width:Math.min(100,e.storage.used/Math.max(1,e.storage.limit)*100)+`%`})},null,4)]),G(`p`,Im,k(a(e.storage.used))+` / `+k(a(e.storage.limit))+` · `+k(P(Z)(`Largest file`))+`: `+k(e.max_file_mb)+` MB`,1)],8,Pm),r.value?(H(),U(`form`,{key:0,class:`m-card mb-6 flex max-w-3xl flex-wrap gap-5 p-5`,onSubmit:Tu(u,[`prevent`])},[r.value.is_image?(H(),U(`div`,Lm,[G(`div`,{class:O([`relative`,t(`media.edit`)?`cursor-crosshair`:``]),onClick:s},[G(`img`,{src:r.value.url,alt:r.value.alt??``,class:`w-full rounded-lg`,draggable:`false`},null,8,Rm),P(i).values.focus_x===null?J(``,!0):(H(),U(`span`,{key:0,class:`pointer-events-none absolute h-5 w-5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white bg-brand/60 shadow`,style:_e({left:(P(i).values.focus_x??0)*100+`%`,top:(P(i).values.focus_y??0)*100+`%`})},null,4))],2),G(`p`,zm,k(t(`media.edit`)?P(Z)(`Click the part of the picture that must stay in view.`):P(Z)(`Focus point`)),1),G(`div`,Bm,[G(`img`,{src:r.value.url,alt:``,class:`h-16 w-16 rounded-lg object-cover`,style:_e({objectPosition:c(P(i).values.focus_x,P(i).values.focus_y)})},null,12,Vm),t(`media.edit`)&&P(i).values.focus_x!==null?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:p[0]||=e=>P(i).values.focus_x=P(i).values.focus_y=null},k(P(Z)(`Clear`)),1)):J(``,!0)])])):J(``,!0),G(`div`,Hm,[G(`div`,null,[G(`label`,Um,k(P(Z)(`Name`)),1),I(G(`input`,{id:`m-name`,"onUpdate:modelValue":p[1]||=e=>P(i).values.name=e,required:``,maxlength:`250`,class:`m-input`,disabled:!t(`media.edit`)},null,8,Wm),[[Y,P(i).values.name]]),P(i).errors.name?(H(),U(`p`,Gm,k(P(i).errors.name),1)):J(``,!0)]),r.value.is_image?(H(),U(`div`,Km,[G(`label`,qm,k(P(Z)(`Alternative text`)),1),I(G(`input`,{id:`m-alt`,"onUpdate:modelValue":p[2]||=e=>P(i).values.alt=e,maxlength:`500`,class:`m-input`,disabled:!t(`media.edit`)},null,8,Jm),[[Y,P(i).values.alt]])])):J(``,!0),G(`p`,Ym,[q(k(r.value.mime_type)+` · `+k(a(r.value.size)),1),r.value.width?(H(),U(`span`,Xm,` · `+k(r.value.width)+`×`+k(r.value.height),1)):J(``,!0),q(` · `+k(P(Z)(`Used`))+`: `+k(r.value.usage_count),1),r.value.uploaded_by?(H(),U(`span`,Zm,` · `+k(r.value.uploaded_by),1)):J(``,!0)]),G(`p`,Qm,k(r.value.url),1),G(`div`,$m,[t(`media.edit`)?(H(),U(`button`,{key:0,type:`submit`,class:`m-btn m-btn-primary`,disabled:P(i).busy},k(P(Z)(`Save`)),9,eh)):J(``,!0),t(`media.delete`)?(H(),U(`button`,{key:1,type:`button`,class:`m-btn m-btn-danger`,onClick:p[3]||=e=>d(r.value)},k(P(Z)(`Delete`)),1)):J(``,!0),G(`button`,{type:`button`,class:`m-btn m-btn-secondary`,onClick:p[4]||=e=>r.value=null},k(P(Z)(`Cancel`)),1)])])],32)):J(``,!0),e.items.length?(H(),U(`div`,nh,[(H(!0),U(B,null,R(e.items,e=>(H(),U(`button`,{key:e.id,type:`button`,class:O([`m-card overflow-hidden text-left transition hover:border-brand`,r.value?.id===e.id?`border-brand`:``]),onClick:t=>o(e)},[e.is_image?(H(),U(`img`,{key:0,src:e.url,alt:e.alt??``,loading:`lazy`,class:`aspect-square w-full object-cover`},null,8,ih)):(H(),U(`span`,ah,k(e.mime_type),1)),G(`span`,oh,k(e.name),1)],10,rh))),128))])):(H(),U(`p`,th,k(P(Z)(`No files yet.`)),1))],64))}}),ch={class:`font-display mb-6 text-2xl font-bold`},lh={class:`mb-6 grid grid-cols-2 gap-3 md:grid-cols-4`},uh={class:`text-2xl font-bold`},dh={class:`m-help`},fh={class:`mb-4 flex flex-wrap gap-2`},ph=[`onClick`],mh=[`placeholder`,`aria-label`],hh=[`aria-label`],gh={value:``},_h=[`value`],vh={type:`submit`,class:`m-btn m-btn-secondary`},yh={key:0,class:`m-card p-5 text-sm text-muted`},bh={key:1,class:`m-card divide-y divide-line`},xh={class:`min-w-0`},Sh={class:`font-semibold`},Ch={key:1},wh={class:`text-xs text-muted`},Th={class:`flex gap-2`},Eh={key:0,class:`m-badge`},Dh=[`onClick`],Oh={key:2,class:`mt-4 flex items-center gap-2`},kh={class:`text-sm text-muted`},Ah={class:`font-display mb-3 mt-10 text-xl font-bold`},jh={class:`m-label`,for:`b-min`},Mh={class:`min-w-[10rem] flex-1`},Nh={class:`m-label`,for:`b-why`},Ph={key:0,class:`flex items-center gap-2 text-sm`},Fh={type:`submit`,class:`m-btn m-btn-danger`},Ih={key:1,class:`m-error w-full`},Lh={key:4,class:`text-sm text-muted`},Rh={key:5,class:`m-card divide-y divide-line`},zh={class:`font-semibold`},Bh={key:0,class:`m-badge`},Vh={key:1,class:`m-badge`},Hh={class:`text-xs text-muted`},Uh=[`onClick`],Wh={class:`font-display mb-3 mt-10 text-xl font-bold`},Gh={class:`flex items-center gap-2 text-sm sm:col-span-2`},Kh={class:`m-label`,for:`r-max`},qh={class:`m-label`,for:`r-win`},Jh={class:`m-label`,for:`r-ban`},Yh={class:`m-label`,for:`r-keep`},Xh=[`max`],Zh={class:`m-help`},Qh={class:`sm:col-span-2`},$h=[`disabled`],eg={class:`font-display mb-3 mt-10 text-xl font-bold`},tg={class:`m-label`,for:`n-group`},ng={class:`min-w-[10rem] flex-1`},rg={class:`m-label`,for:`n-note`},ig={type:`submit`,class:`m-btn m-btn-secondary`},ag={key:0,class:`m-error w-full`},og={key:0,class:`m-card divide-y divide-line text-sm`},sg={key:0,class:`m-badge`},cg=L({__name:`AuditLog`,props:{entries:{},pagination:{},filters:{},accounts:{},summary:{},bans:{},notes:{},settings:{},max_keep_days:{},can_manage:{type:Boolean},my_ip:{},never_banned:{},whole_site_bans:{type:Boolean}},setup(e){let t=e,n=[`all`,`logins`,`failed`,`actions`,`viewed`,`refused`,`bans`],r=rn({q:t.filters.q,ip:t.filters.ip,user:t.filters.user??``}),i=e=>new Date(e).toLocaleString();function a(e){let n=new URLSearchParams,i={show:t.filters.show,q:r.q,ip:r.ip,user:r.user,...e};for(let[e,t]of Object.entries(i))t!==``&&t!==`all`&&t!==1&&n.set(e,String(t));b1(`${X.base}/audit${n.size?`?`+n:``}`)}let o=Ju({ip:``,minutes:1440,reason:``,whole_site:!1});async function s(e){e&&(o.values.ip=e);let t=await o.send(`post`,`${X.base}/audit/bans`);t&&($(t.message),o.values.ip=o.values.reason=``,await x1())}async function c(e){$((await qu.delete(`${X.base}/audit/bans/${e.id}`)).message),await x1()}let l=Ju({...t.settings});async function u(){await l.send(`put`,`${X.base}/audit/settings`)&&($(Z(`Saved.`)),await x1())}let d=Ju({ip:``,group:``,note:``});async function f(){await d.send(`put`,`${X.base}/audit/notes`)&&($(Z(`Saved.`)),d.values.ip=d.values.group=d.values.note=``,await x1())}let p=e=>e.expires_at?i(e.expires_at):Z(`until lifted`);return(t,m)=>(H(),U(B,null,[G(`h1`,ch,k(P(Z)(`Audit log`)),1),G(`div`,lh,[(H(!0),U(B,null,R(e.summary,(e,t)=>(H(),U(`div`,{key:t,class:`m-card p-4`},[G(`p`,uh,k(e),1),G(`p`,dh,k(P(Z)(t===`banned`?`Addresses banned`:t===`logins`?`Logins (24 h)`:t===`failed`?`Failed logins (24 h)`:`Refused (24 h)`)),1)]))),128))]),G(`nav`,fh,[(H(),U(B,null,R(n,t=>G(`button`,{key:t,type:`button`,class:O([`m-btn`,e.filters.show===t?`m-btn-primary`:`m-btn-secondary`]),onClick:e=>a({show:t,page:1})},k(P(Z)(t)),11,ph)),64))]),G(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:m[3]||=Tu(e=>a({page:1}),[`prevent`])},[I(G(`input`,{"onUpdate:modelValue":m[0]||=e=>r.q=e,class:`m-input max-w-xs`,placeholder:P(Z)(`Search`),"aria-label":P(Z)(`Search`)},null,8,mh),[[Y,r.q]]),I(G(`input`,{"onUpdate:modelValue":m[1]||=e=>r.ip=e,class:`m-input max-w-[12rem]`,placeholder:`IP`,"aria-label":`IP`},null,512),[[Y,r.ip]]),I(G(`select`,{"onUpdate:modelValue":m[2]||=e=>r.user=e,class:`m-input max-w-[12rem]`,"aria-label":P(Z)(`Account`)},[G(`option`,gh,k(P(Z)(`Everyone`)),1),(H(!0),U(B,null,R(e.accounts,e=>(H(),U(`option`,{key:e.id,value:e.id},k(e.name),9,_h))),128))],8,hh),[[mu,r.user]]),G(`button`,vh,k(P(Z)(`Filter`)),1)],32),e.entries.length?(H(),U(`ul`,bh,[(H(!0),U(B,null,R(e.entries,t=>(H(),U(`li`,{key:t.id,class:`flex flex-wrap items-start justify-between gap-3 p-4 text-sm`},[G(`div`,xh,[G(`p`,Sh,[q(k(t.summary)+` `,1),t.subject?(H(),U(B,{key:0},[m[19]||=q(` · `,-1),t.subject.url?(H(),W($u,{key:0,href:t.subject.url,class:`underline`},{default:F(()=>[q(k(t.subject.label),1)]),_:2},1032,[`href`])):(H(),U(`span`,Ch,k(t.subject.label),1))],64)):J(``,!0)]),G(`p`,wh,k(i(t.at))+` · `+k(t.who??t.email??P(Z)(`Someone`))+` · `+k(t.ip)+` · `+k(t.browser),1)]),G(`span`,Th,[t.banned?(H(),U(`span`,Eh,k(P(Z)(`banned`)),1)):J(``,!0),e.can_manage&&t.ip&&!t.banned&&!t.never_banned&&t.ip!==e.my_ip?(H(),U(`button`,{key:1,type:`button`,class:`m-btn m-btn-danger`,onClick:e=>s(t.ip)},k(P(Z)(`Ban`)),9,Dh)):J(``,!0)])]))),128))])):(H(),U(`p`,yh,k(P(Z)(`Nothing here yet.`)),1)),e.pagination.pages>1?(H(),U(`nav`,Oh,[e.pagination.page>1?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:m[4]||=t=>a({page:e.pagination.page-1})},k(P(Z)(`Previous`)),1)):J(``,!0),G(`span`,kh,k(e.pagination.page)+` / `+k(e.pagination.pages),1),e.pagination.pagea({page:e.pagination.page+1})},k(P(Z)(`Next`)),1)):J(``,!0)])):J(``,!0),G(`h2`,Ah,k(P(Z)(`Bans`)),1),e.can_manage?(H(),U(`form`,{key:3,class:`m-card mb-4 flex max-w-3xl flex-wrap items-end gap-3 p-4`,onSubmit:m[10]||=Tu(e=>s(),[`prevent`])},[G(`div`,null,[m[20]||=G(`label`,{class:`m-label`,for:`b-ip`},`IP`,-1),I(G(`input`,{id:`b-ip`,"onUpdate:modelValue":m[6]||=e=>P(o).values.ip=e,required:``,class:`m-input`},null,512),[[Y,P(o).values.ip]])]),G(`div`,null,[G(`label`,jh,k(P(Z)(`Minutes (0 = until lifted)`)),1),I(G(`input`,{id:`b-min`,"onUpdate:modelValue":m[7]||=e=>P(o).values.minutes=e,type:`number`,min:`0`,class:`m-input w-32`},null,512),[[Y,P(o).values.minutes,void 0,{number:!0}]])]),G(`div`,Mh,[G(`label`,Nh,k(P(Z)(`Reason`)),1),I(G(`input`,{id:`b-why`,"onUpdate:modelValue":m[8]||=e=>P(o).values.reason=e,maxlength:`200`,class:`m-input`},null,512),[[Y,P(o).values.reason]])]),e.whole_site_bans?(H(),U(`label`,Ph,[I(G(`input`,{"onUpdate:modelValue":m[9]||=e=>P(o).values.whole_site=e,type:`checkbox`},null,512),[[du,P(o).values.whole_site]]),q(` `+k(P(Z)(`Whole site`)),1)])):J(``,!0),G(`button`,Fh,k(P(Z)(`Ban`)),1),P(o).errors.ip?(H(),U(`p`,Ih,k(P(o).errors.ip),1)):J(``,!0)],32)):J(``,!0),e.bans.length?(H(),U(`ul`,Rh,[(H(!0),U(B,null,R(e.bans,t=>(H(),U(`li`,{key:t.id,class:O([`flex flex-wrap items-center justify-between gap-3 p-4 text-sm`,t.active?``:`opacity-50`])},[G(`div`,null,[G(`p`,zh,[q(k(t.ip)+` `,1),t.automatic?(H(),U(`span`,Bh,k(P(Z)(`automatic`)),1)):J(``,!0),m[21]||=q(),t.whole_site?(H(),U(`span`,Vh,k(P(Z)(`whole site`)),1)):J(``,!0)]),G(`p`,Hh,k(t.reason)+` · `+k(p(t))+` · `+k(t.hits)+` `+k(P(Z)(`hits`)),1)]),e.can_manage&&t.active?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary`,onClick:e=>c(t)},k(P(Z)(`Lift`)),9,Uh)):J(``,!0)],2))),128))])):(H(),U(`p`,Lh,k(P(Z)(`No bans.`)),1)),e.can_manage?(H(),U(B,{key:6},[G(`h2`,Wh,k(P(Z)(`Rules`)),1),G(`form`,{class:`m-card grid max-w-3xl gap-4 p-5 sm:grid-cols-2`,onSubmit:Tu(u,[`prevent`])},[G(`label`,Gh,[I(G(`input`,{"onUpdate:modelValue":m[11]||=e=>P(l).values.auto_ban=e,type:`checkbox`},null,512),[[du,P(l).values.auto_ban]]),q(` `+k(P(Z)(`Ban an address by itself after too many failed logins`)),1)]),G(`div`,null,[G(`label`,Kh,k(P(Z)(`Failed logins`)),1),I(G(`input`,{id:`r-max`,"onUpdate:modelValue":m[12]||=e=>P(l).values.max_failures=e,type:`number`,min:`3`,max:`100`,class:`m-input`},null,512),[[Y,P(l).values.max_failures,void 0,{number:!0}]])]),G(`div`,null,[G(`label`,qh,k(P(Z)(`Within minutes`)),1),I(G(`input`,{id:`r-win`,"onUpdate:modelValue":m[13]||=e=>P(l).values.window_minutes=e,type:`number`,min:`1`,max:`1440`,class:`m-input`},null,512),[[Y,P(l).values.window_minutes,void 0,{number:!0}]])]),G(`div`,null,[G(`label`,Jh,k(P(Z)(`Ban for minutes (0 = until lifted)`)),1),I(G(`input`,{id:`r-ban`,"onUpdate:modelValue":m[14]||=e=>P(l).values.ban_minutes=e,type:`number`,min:`0`,class:`m-input`},null,512),[[Y,P(l).values.ban_minutes,void 0,{number:!0}]])]),G(`div`,null,[G(`label`,Yh,k(P(Z)(`Keep the log (days)`)),1),I(G(`input`,{id:`r-keep`,"onUpdate:modelValue":m[15]||=e=>P(l).values.keep_days=e,type:`number`,min:`7`,max:e.max_keep_days,class:`m-input`},null,8,Xh),[[Y,P(l).values.keep_days,void 0,{number:!0}]]),G(`p`,Zh,`≤ `+k(e.max_keep_days),1)]),G(`div`,Qh,[G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(l).busy},k(P(Z)(`Save`)),9,$h)]),(H(!0),U(B,null,R(P(l).errors,(e,t)=>(H(),U(`p`,{key:t,class:`m-error sm:col-span-2`},k(e),1))),128))],32),G(`h2`,eg,k(P(Z)(`Notes about addresses`)),1),G(`form`,{class:`m-card mb-4 flex max-w-3xl flex-wrap items-end gap-3 p-4`,onSubmit:Tu(f,[`prevent`])},[G(`div`,null,[m[22]||=G(`label`,{class:`m-label`,for:`n-ip`},`IP`,-1),I(G(`input`,{id:`n-ip`,"onUpdate:modelValue":m[16]||=e=>P(d).values.ip=e,required:``,class:`m-input`},null,512),[[Y,P(d).values.ip]])]),G(`div`,null,[G(`label`,tg,k(P(Z)(`Group`)),1),I(G(`input`,{id:`n-group`,"onUpdate:modelValue":m[17]||=e=>P(d).values.group=e,maxlength:`60`,class:`m-input`},null,512),[[Y,P(d).values.group]])]),G(`div`,ng,[G(`label`,rg,k(P(Z)(`Note`)),1),I(G(`input`,{id:`n-note`,"onUpdate:modelValue":m[18]||=e=>P(d).values.note=e,maxlength:`2000`,class:`m-input`},null,512),[[Y,P(d).values.note]])]),G(`button`,ig,k(P(Z)(`Save`)),1),P(d).errors.ip?(H(),U(`p`,ag,k(P(d).errors.ip),1)):J(``,!0)],32),e.notes.length?(H(),U(`ul`,og,[(H(!0),U(B,null,R(e.notes,e=>(H(),U(`li`,{key:e.ip,class:`p-3`},[G(`b`,null,k(e.ip),1),m[23]||=q(),e.group?(H(),U(`span`,sg,k(e.group),1)):J(``,!0),q(` `+k(e.note),1)]))),128))])):J(``,!0)],64)):J(``,!0)],64))}}),lg={class:`mb-6 flex flex-wrap items-center justify-between gap-3`},ug={class:`font-display text-2xl font-bold`},dg={class:`text-sm text-muted`},fg={key:0},pg={class:`mb-6 flex flex-wrap gap-2`},mg={class:`mb-6 grid grid-cols-2 gap-3 md:grid-cols-5`},hg={class:`text-2xl font-bold`},gg={class:`m-help`},_g={class:`m-card mb-6 p-4`},vg={class:`mb-3 font-semibold`},yg=[`aria-label`],bg=[`title`],xg={class:`mb-6 grid gap-6 md:grid-cols-2`},Sg={class:`m-card p-4`},Cg={class:`mb-3 font-semibold`},wg={key:0,class:`text-sm text-muted`},Tg={class:`divide-y divide-line text-sm`},Eg={class:`truncate`},Dg={class:`text-muted`},Og={class:`m-card p-4`},kg={class:`mb-3 font-semibold`},Ag={key:0,class:`text-sm text-muted`},jg={class:`divide-y divide-line text-sm`},Mg={class:`truncate`},Ng={class:`text-muted`},Pg={class:`mb-3 font-semibold`},Fg={key:0,class:`text-sm text-muted`},Ig={class:`divide-y divide-line text-sm`},Lg={class:`truncate`},Rg={class:`text-muted`},zg={class:`m-card mb-6 overflow-x-auto p-4`},Bg={class:`mb-3 font-semibold`},Vg={class:`space-y-0.5 text-xs`},Hg={class:`w-9 shrink-0 text-muted`},Ug=[`title`],Wg={class:`m-card mb-6 p-4`},Gg={class:`mb-3 font-semibold`},Kg={class:`text-sm font-normal text-muted`},qg={key:0,class:`text-sm text-muted`},Jg={class:`divide-y divide-line text-sm`},Yg={class:`text-xs text-muted`},Xg={class:`text-muted`},Zg={class:`flex flex-wrap items-center gap-2 text-sm`},Qg={class:`text-muted`},$g=[`href`],e_=L({__name:`StatisticsReport`,props:{range:{},ranges:{},exports:{},totals:{},previous:{},series:{},pages:{},posts:{},channels:{},sources:{},countries:{},devices:{},browsers:{},systems:{},heatmap:{},bots:{}},setup(e){let t=e,n=dc(()=>[[`Visitors`,`visitors`],[`Visits`,`visits`],[`Page views`,`page_views`],[`Average time`,`average_seconds`],[`Bounce rate`,`bounce_rate`]]),r=(e,t)=>e===`average_seconds`?`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`:e===`bounce_rate`?`${t}%`:t.toLocaleString(),i=e=>{let n=t.previous?.[e];return n?Math.round((t.totals[e]-n)/n*100):null},a=dc(()=>Math.max(1,...t.series.map(e=>e.visits))),o=dc(()=>Math.max(1,...t.heatmap.flatMap(e=>e.hours))),s=dc(()=>[[`Channels`,t.channels],[`Sources`,t.sources],[`Countries`,t.countries],[`Devices`,t.devices],[`Browsers`,t.browsers],[`Systems`,t.systems]]),c=e=>`${X.base}/statistics?range=${e}`,l=e=>`${X.base}/statistics/export?sheet=${e}&range=${new URLSearchParams(Q.path.split(`?`)[1]??``).get(`range`)??t.range.key}`;return(t,u)=>(H(),U(B,null,[G(`div`,lg,[G(`h1`,ug,k(P(Z)(`Statistics`)),1),G(`p`,dg,[q(k(e.range.from)+` → `+k(e.range.to),1),e.range.compared_to?(H(),U(`span`,fg,` · `+k(P(Z)(`compared with`))+` `+k(e.range.compared_to),1)):J(``,!0)])]),G(`nav`,pg,[(H(!0),U(B,null,R(e.ranges,t=>(H(),W($u,{key:t.key,href:c(t.key),class:O([`m-btn`,e.range.key===t.key?`m-btn-primary`:`m-btn-secondary`])},{default:F(()=>[q(k(t.label),1)]),_:2},1032,[`href`,`class`]))),128))]),G(`div`,mg,[(H(!0),U(B,null,R(n.value,([t,n])=>(H(),U(`div`,{key:n,class:`m-card p-4`},[G(`p`,hg,k(r(n,e.totals[n])),1),G(`p`,gg,[q(k(P(Z)(t)),1),i(n)===null?J(``,!0):(H(),U(`span`,{key:0,class:O((i(n)??0)>=0?`text-emerald-500`:`text-red-500`)},k((i(n)??0)>0?`+`:``)+k(i(n))+`%`,3))])]))),128))]),G(`section`,_g,[G(`h2`,vg,k(P(Z)(`Visits`)),1),G(`div`,{class:`flex h-40 items-end gap-px`,role:`img`,"aria-label":P(Z)(`Visits`)},[(H(!0),U(B,null,R(e.series,e=>(H(),U(`div`,{key:e.key,class:`min-w-px flex-1 rounded-t bg-brand`,style:_e({height:Math.max(2,e.visits/a.value*100)+`%`}),title:`${e.label}: ${e.visits}`},null,12,bg))),128))],8,yg)]),G(`div`,xg,[G(`section`,Sg,[G(`h2`,Cg,k(P(Z)(`Pages`)),1),e.pages.length?J(``,!0):(H(),U(`p`,wg,k(P(Z)(`Nothing here yet.`)),1)),G(`ul`,Tg,[(H(!0),U(B,null,R(e.pages,e=>(H(),U(`li`,{key:e.path,class:`flex justify-between gap-3 py-1.5`},[G(`span`,Eg,k(e.title??e.path),1),G(`span`,Dg,k(e.views),1)]))),128))])]),G(`section`,Og,[G(`h2`,kg,k(P(Z)(`Posts`)),1),e.posts.length?J(``,!0):(H(),U(`p`,Ag,k(P(Z)(`Nothing here yet.`)),1)),G(`ul`,jg,[(H(!0),U(B,null,R(e.posts,e=>(H(),U(`li`,{key:e.slug,class:`flex justify-between gap-3 py-1.5`},[G(`span`,Mg,k(e.title),1),G(`span`,Ng,k(e.views),1)]))),128))])]),(H(!0),U(B,null,R(s.value,([e,t])=>(H(),U(`section`,{key:e,class:`m-card p-4`},[G(`h2`,Pg,k(P(Z)(e)),1),t.length?J(``,!0):(H(),U(`p`,Fg,k(P(Z)(`Nothing here yet.`)),1)),G(`ul`,Ig,[(H(!0),U(B,null,R(t,e=>(H(),U(`li`,{key:e.name+(e.channel??``),class:`flex justify-between gap-3 py-1.5`},[G(`span`,Lg,k(e.name||P(Z)(`Direct`)),1),G(`span`,Rg,k(e.visits),1)]))),128))])]))),128))]),G(`section`,zg,[G(`h2`,Bg,k(P(Z)(`When people visit`)),1),G(`div`,Vg,[(H(!0),U(B,null,R(e.heatmap,e=>(H(),U(`div`,{key:e.day,class:`flex items-center gap-0.5`},[G(`span`,Hg,k(e.day),1),(H(!0),U(B,null,R(e.hours,(t,n)=>(H(),U(`span`,{key:n,class:`block h-5 min-w-3 flex-1 rounded-sm border border-line`,title:`${e.day} ${n}:00 · ${t}`,style:_e({background:`color-mix(in srgb, var(--m-brand) ${Math.round(t/o.value*100)}%, var(--m-panel-2))`})},null,12,Ug))),128))]))),128))])]),G(`section`,Wg,[G(`h2`,Gg,[q(k(P(Z)(`Programs`))+` `,1),G(`span`,Kg,`· `+k(e.bots.total),1)]),e.bots.names.length?J(``,!0):(H(),U(`p`,qg,k(P(Z)(`Nothing here yet.`)),1)),G(`ul`,Jg,[(H(!0),U(B,null,R(e.bots.names,e=>(H(),U(`li`,{key:e.name,class:`flex justify-between gap-3 py-1.5`},[G(`span`,null,[q(k(e.name)+` `,1),G(`span`,Yg,k(e.kind),1)]),G(`span`,Xg,k(e.hits),1)]))),128))])]),G(`p`,Zg,[G(`span`,Qg,k(P(Z)(`Download`))+`:`,1),(H(!0),U(B,null,R(e.exports,(e,t)=>(H(),U(`a`,{key:t,href:l(String(t)),class:`m-btn m-btn-secondary`},k(e)+` (CSV)`,9,$g))),128))])],64))}}),t_={class:`font-display mb-6 text-2xl font-bold`},n_={key:0,class:`m-card p-5 text-sm text-muted`},r_={key:1,class:`m-card divide-y divide-line`},i_={class:`min-w-0`},a_={class:`truncate font-semibold`},o_={class:`truncate text-xs text-muted`},s_={class:`m-badge`},c_={key:2,class:`mt-4 flex gap-2`},l_=L({__name:`ListPage`,props:{data:{},current_page:{},last_page:{},path:{}},setup(e){let t=e,n=dc(()=>Q.path.includes(`/reviews`)?`reviews`:`pages`),r=dc(()=>n.value===`reviews`?`Reviews`:`Pages`),i=e=>n.value===`reviews`?e.author:e.title,a=e=>n.value===`reviews`?e.rating?`★`.repeat(e.rating):``:e.slug,o=e=>n.value===`reviews`?e.is_visible:e.is_published,s=e=>`${Q.path.split(`?`)[0]}?page=${e}`;return(e,n)=>(H(),U(B,null,[G(`h1`,t_,k(P(Z)(r.value)),1),t.data.length?(H(),U(`ul`,r_,[(H(!0),U(B,null,R(t.data,e=>(H(),U(`li`,{key:e.id,class:`flex items-center justify-between gap-3 p-4`},[G(`div`,i_,[G(`p`,a_,k(i(e)),1),G(`p`,o_,k(a(e)),1)]),G(`span`,s_,k(o(e)?P(Z)(`Published`):P(Z)(`Draft`)),1)]))),128))])):(H(),U(`p`,n_,k(P(Z)(`Nothing here yet.`)),1)),t.last_page>1?(H(),U(`nav`,c_,[t.current_page>1?(H(),W($u,{key:0,href:s(t.current_page-1),class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Previous`)),1)]),_:1},8,[`href`])):J(``,!0),t.current_page[q(k(P(Z)(`Next`)),1)]),_:1},8,[`href`])):J(``,!0)])):J(``,!0)],64))}}),u_={class:`space-y-5`},d_={key:0,class:`flex items-center gap-2 text-sm`},f_=[`onUpdate:modelValue`],p_=[`for`],m_={key:0,class:`text-muted`},h_=[`id`,`onUpdate:modelValue`],g_={key:0,value:``},__=[`value`],v_=[`id`,`onUpdate:modelValue`,`rows`,`maxlength`,`required`],y_={key:3,class:`flex gap-2`},b_=[`id`,`onUpdate:modelValue`],x_=[`onClick`],S_=[`id`,`onUpdate:modelValue`,`type`,`maxlength`,`required`],C_=[`src`],w_={key:2,class:`mt-1 text-xs text-muted`},T_={key:3,class:`mt-1 text-xs text-muted`},E_={key:4,class:`m-error`},D_=L({__name:`FormFields`,props:{fields:{},values:{},errors:{},prefix:{}},setup(e){let t=N(null),n=X.permissions.includes(`media.view`);return(r,i)=>(H(),U(`div`,u_,[(H(!0),U(B,null,R(e.fields,r=>(H(),U(`div`,{key:r.key},[r.type===`toggle`?(H(),U(`label`,d_,[I(G(`input`,{"onUpdate:modelValue":t=>e.values[r.key]=t,type:`checkbox`},null,8,f_),[[du,e.values[r.key]]]),q(` `+k(P(Z)(r.label)),1)])):(H(),U(B,{key:1},[G(`label`,{for:`f-`+r.key,class:`m-label`},[q(k(P(Z)(r.label)),1),r.required?(H(),U(`span`,m_,` *`)):J(``,!0)],8,p_),r.type===`select`?I((H(),U(`select`,{key:0,id:`f-`+r.key,"onUpdate:modelValue":t=>e.values[r.key]=t,class:`m-input`},[r.required?J(``,!0):(H(),U(`option`,g_)),(H(!0),U(B,null,R(r.options,(e,t)=>(H(),U(`option`,{key:t,value:t},k(e),9,__))),128))],8,h_)),[[mu,e.values[r.key]]]):r.type===`markdown`?(H(),W(Yd,{key:1,id:`f-`+r.key,modelValue:e.values[r.key],"onUpdate:modelValue":t=>e.values[r.key]=t,required:r.required,maxlength:r.max??void 0},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`required`,`maxlength`])):r.type===`textarea`||r.type===`lines`?I((H(),U(`textarea`,{key:2,id:`f-`+r.key,"onUpdate:modelValue":t=>e.values[r.key]=t,rows:r.type===`lines`?5:4,maxlength:r.max??void 0,required:r.required,class:`m-input`},null,8,v_)),[[Y,e.values[r.key]]]):r.type===`media`?(H(),U(`div`,y_,[I(G(`input`,{id:`f-`+r.key,"onUpdate:modelValue":t=>e.values[r.key]=t,maxlength:`2048`,class:`m-input`},null,8,b_),[[Y,e.values[r.key]]]),P(n)?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary shrink-0`,onClick:e=>t.value=r.key},k(P(Z)(`Choose`)),9,x_)):J(``,!0)])):I((H(),U(`input`,{key:4,id:`f-`+r.key,"onUpdate:modelValue":t=>e.values[r.key]=t,type:r.type===`number`?`number`:r.type===`date`?`date`:`text`,maxlength:r.max??void 0,required:r.required,class:`m-input`},null,8,S_)),[[yu,e.values[r.key]]]),r.type===`media`&&e.values[r.key]?(H(),U(`img`,{key:5,src:e.values[r.key],alt:``,class:`mt-2 h-24 w-auto rounded-lg border border-line object-cover`},null,8,C_)):J(``,!0)],64)),r.type===`lines`?(H(),U(`p`,w_,k(P(Z)(`One per line.`)),1)):J(``,!0),r.help?(H(),U(`p`,T_,k(P(Z)(r.help)),1)):J(``,!0),e.errors?.[(e.prefix??``)+r.key]?(H(),U(`p`,E_,k(e.errors[(e.prefix??``)+r.key]),1)):J(``,!0)]))),128)),t.value?(H(),W(Fd,{key:0,onPick:i[0]||=n=>{e.values[t.value]=n,t.value=null},onClose:i[1]||=e=>t.value=null})):J(``,!0)]))}}),O_={class:`mb-6 flex items-center justify-between gap-3`},k_={class:`font-display text-2xl font-bold`},A_=[`disabled`],j_=L({__name:`RecordForm`,props:{resource:{},record:{}},setup(e){let t=e,n=`${X.base}/records/${t.resource.key}`,r=Ju({...t.record.values});async function i(){(t.record.id===null?await r.send(`post`,n):await r.send(`put`,`${n}/${t.record.id}`))&&($(Z(`Saved.`)),b1(n))}return(t,a)=>(H(),U(B,null,[G(`div`,O_,[G(`h1`,k_,k(e.record.id===null?P(Z)(`New`)+`: `+P(Z)(e.resource.singular):P(Z)(e.resource.singular)),1),K($u,{href:n,class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Back`)),1)]),_:1})]),G(`form`,{class:`m-card max-w-3xl space-y-5 p-5`,onSubmit:Tu(i,[`prevent`])},[K(D_,{fields:e.resource.fields,values:P(r).values,errors:P(r).errors},null,8,[`fields`,`values`,`errors`]),G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(r).busy},k(P(r).busy?P(Z)(`Saving…`):P(Z)(`Save`)),9,A_)],32)],64))}}),M_={class:`mb-6 flex items-center justify-between gap-3`},N_={class:`font-display text-2xl font-bold`},P_={key:0,class:`m-card p-5 text-sm text-muted`},F_={key:1,class:`m-card overflow-x-auto`},I_={class:`w-full text-left text-sm`},L_={class:`border-b border-line text-xs uppercase tracking-wide text-muted`},R_={key:0,class:`px-4 py-3`},z_={class:`divide-y divide-line`},B_={key:0,class:`flex justify-end gap-2 px-4 py-2`},V_=[`onClick`],H_={key:2,class:`mt-4 flex gap-2`},U_=L({__name:`RecordsIndex`,props:{resource:{},rows:{},current_page:{},last_page:{}},setup(e){let t=e,n=`${X.base}/records/${t.resource.key}`,r=e=>t.resource.fields.find(t=>t.key===e)?.label??e;function i(e,n){let r=e.values[n],i=t.resource.fields.find(e=>e.key===n);return i?.type===`toggle`?r?`✓`:``:i?.type===`select`?i.options[r]??r:String(r??``)}async function a(e){window.confirm(Z(`Are you sure?`))&&(await qu.delete(`${n}/${e.id}`),await x1())}return(t,o)=>(H(),U(B,null,[G(`div`,M_,[G(`h1`,N_,k(P(Z)(e.resource.label)),1),e.resource.can_manage?(H(),W($u,{key:0,href:n+`/create`,class:`m-btn m-btn-primary`},{default:F(()=>[q(k(P(Z)(`Add`)),1)]),_:1},8,[`href`])):J(``,!0)]),e.rows.length?(H(),U(`div`,F_,[G(`table`,I_,[G(`thead`,L_,[G(`tr`,null,[(H(!0),U(B,null,R(e.resource.columns,e=>(H(),U(`th`,{key:e,class:`px-4 py-3 font-semibold`},k(P(Z)(r(e))),1))),128)),e.resource.can_manage?(H(),U(`th`,R_)):J(``,!0)])]),G(`tbody`,z_,[(H(!0),U(B,null,R(e.rows,t=>(H(),U(`tr`,{key:t.id},[(H(!0),U(B,null,R(e.resource.columns,e=>(H(),U(`td`,{key:e,class:`max-w-xs truncate px-4 py-3`},k(i(t,e)),1))),128)),e.resource.can_manage?(H(),U(`td`,B_,[K($u,{href:`${n}/${t.id}/edit`,class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Edit`)),1)]),_:1},8,[`href`]),G(`button`,{type:`button`,class:`m-btn m-btn-danger`,onClick:e=>a(t)},k(P(Z)(`Delete`)),9,V_)])):J(``,!0)]))),128))])])])):(H(),U(`p`,P_,k(P(Z)(`Nothing here yet.`)),1)),e.last_page>1?(H(),U(`nav`,H_,[e.current_page>1?(H(),W($u,{key:0,href:`${n}?page=${e.current_page-1}`,class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Previous`)),1)]),_:1},8,[`href`])):J(``,!0),e.current_page[q(k(P(Z)(`Next`)),1)]),_:1},8,[`href`])):J(``,!0)])):J(``,!0)],64))}}),W_={class:`mb-6 flex items-center justify-between gap-3`},G_={class:`font-display text-2xl font-bold`},K_={for:`title`,class:`m-label`},q_={key:0,class:`m-error`},J_={for:`meta`,class:`m-label`},Y_={key:0,class:`m-error`},X_={for:`body`,class:`m-label`},Z_={key:0,class:`m-error`},Q_={class:`flex items-center gap-2 text-sm`},$_={class:`flex gap-3`},e1=[`disabled`],t1=L({__name:`PageForm`,props:{page:{}},setup(e){let t=e.page,n=Ju({title:t.title,meta_description:t.meta_description??``,...t.defined?{content:{...t.content}}:{body:t.body??``,is_published:t.is_published??!1}});async function r(){await n.send(`put`,`${X.base}/pages/${t.slug}`)&&$(Z(`Saved.`))}async function i(){window.confirm(Z(`Are you sure?`))&&(await qu.delete(`${X.base}/pages/${t.slug}`),b1(`${X.base}/pages`))}return(e,a)=>(H(),U(B,null,[G(`div`,W_,[G(`h1`,G_,k(P(t).title),1),K($u,{href:P(X).base+`/pages`,class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Back`)),1)]),_:1},8,[`href`])]),G(`form`,{class:`m-card max-w-3xl space-y-5 p-5`,onSubmit:Tu(r,[`prevent`])},[G(`div`,null,[G(`label`,K_,k(P(Z)(`Title`)),1),I(G(`input`,{id:`title`,"onUpdate:modelValue":a[0]||=e=>P(n).values.title=e,required:``,maxlength:`255`,class:`m-input`},null,512),[[Y,P(n).values.title]]),P(n).errors.title?(H(),U(`p`,q_,k(P(n).errors.title),1)):J(``,!0)]),G(`div`,null,[G(`label`,J_,k(P(Z)(`Description for search engines`)),1),I(G(`input`,{id:`meta`,"onUpdate:modelValue":a[1]||=e=>P(n).values.meta_description=e,maxlength:`255`,class:`m-input`},null,512),[[Y,P(n).values.meta_description]]),P(n).errors.meta_description?(H(),U(`p`,Y_,k(P(n).errors.meta_description),1)):J(``,!0)]),P(t).defined?(H(),W(D_,{key:0,fields:P(t).fields,values:P(n).values.content,errors:P(n).errors,prefix:`content.`},null,8,[`fields`,`values`,`errors`])):(H(),U(B,{key:1},[G(`div`,null,[G(`label`,X_,k(P(Z)(`Text (Markdown)`)),1),K(Yd,{id:`body`,modelValue:P(n).values.body,"onUpdate:modelValue":a[2]||=e=>P(n).values.body=e},null,8,[`modelValue`]),P(n).errors.body?(H(),U(`p`,Z_,k(P(n).errors.body),1)):J(``,!0)]),G(`label`,Q_,[I(G(`input`,{"onUpdate:modelValue":a[3]||=e=>P(n).values.is_published=e,type:`checkbox`},null,512),[[du,P(n).values.is_published]]),q(` `+k(P(Z)(`Publish`)),1)])],64)),G(`div`,$_,[G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(n).busy},k(P(n).busy?P(Z)(`Saving…`):P(Z)(`Save`)),9,e1),P(t).defined?J(``,!0):(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-danger`,onClick:i},k(P(Z)(`Delete`)),1))])],32),P(t).id&&P(X).permissions.includes(`revisions.view`)?(H(),W(ff,{key:0,type:`pages`,id:P(t).id},null,8,[`id`])):J(``,!0)],64))}}),n1={class:`font-display mb-6 text-2xl font-bold`},r1={class:`m-card divide-y divide-line`},i1={class:`min-w-0`},a1={class:`truncate font-semibold`},o1={class:`truncate text-xs text-muted`},s1={class:`flex items-center gap-2`},c1={key:0,class:`m-badge`},l1={key:0,class:`p-4 text-sm text-muted`},u1={for:`new-title`,class:`m-label`},d1={key:0,class:`m-error`},f1={for:`new-slug`,class:`m-label`},p1={key:0,class:`m-error`},m1=[`disabled`],h1=[{pattern:/^\/?$/,component:rd,data:!0},{pattern:/^\/login$/,component:Td,guest:!0},{pattern:/^\/profile$/,component:wp,data:!0},{pattern:/^\/posts$/,component:Qf,data:!0},{pattern:/^\/posts\/create$/,component:zf,data:!0},{pattern:/^\/posts\/\d+\/edit$/,component:zf,data:!0},{pattern:/^\/media$/,component:sh,data:!0,source:`/media/items`},{pattern:/^\/audit$/,component:cg,data:!0},{pattern:/^\/statistics$/,component:e_,data:!0},{pattern:/^\/accounts$/,component:Zp,data:!0},{pattern:/^\/groups$/,component:gm,data:!0},{pattern:/^\/labels$/,component:Am,data:!0},{pattern:/^\/pages$/,component:L({__name:`PagesIndex`,props:{pages:{}},setup(e){let t=Ju({slug:``,title:``});async function n(){await t.send(`post`,`${X.base}/pages`)&&b1(`${X.base}/pages/${t.values.slug}`)}return(r,i)=>(H(),U(B,null,[G(`h1`,n1,k(P(Z)(`Pages`)),1),G(`ul`,r1,[(H(!0),U(B,null,R(e.pages,e=>(H(),U(`li`,{key:e.slug,class:`flex items-center justify-between gap-3 p-4`},[G(`div`,i1,[G(`p`,a1,k(e.title),1),G(`p`,o1,`/`+k(e.slug),1)]),G(`div`,s1,[e.defined?J(``,!0):(H(),U(`span`,c1,k(e.is_published?P(Z)(`Published`):P(Z)(`Draft`)),1)),K($u,{href:`${P(X).base}/pages/${e.slug}`,class:`m-btn m-btn-secondary`},{default:F(()=>[q(k(P(Z)(`Edit`)),1)]),_:1},8,[`href`])])]))),128)),e.pages.length?J(``,!0):(H(),U(`li`,l1,k(P(Z)(`Nothing here yet.`)),1))]),G(`form`,{class:`m-card mt-6 grid max-w-3xl gap-4 p-5 sm:grid-cols-[1fr_1fr_auto] sm:items-end`,onSubmit:Tu(n,[`prevent`])},[G(`div`,null,[G(`label`,u1,k(P(Z)(`Title`)),1),I(G(`input`,{id:`new-title`,"onUpdate:modelValue":i[0]||=e=>P(t).values.title=e,required:``,maxlength:`255`,class:`m-input`},null,512),[[Y,P(t).values.title]]),P(t).errors.title?(H(),U(`p`,d1,k(P(t).errors.title),1)):J(``,!0)]),G(`div`,null,[G(`label`,f1,k(P(Z)(`Address (slug)`)),1),I(G(`input`,{id:`new-slug`,"onUpdate:modelValue":i[1]||=e=>P(t).values.slug=e,required:``,maxlength:`120`,class:`m-input`},null,512),[[Y,P(t).values.slug]]),P(t).errors.slug?(H(),U(`p`,p1,k(P(t).errors.slug),1)):J(``,!0)]),G(`button`,{type:`submit`,class:`m-btn m-btn-primary`,disabled:P(t).busy},k(P(Z)(`New page`)),9,m1)],32)],64))}}),data:!0},{pattern:/^\/pages\/[a-z0-9]+(?:-[a-z0-9]+)*$/,component:t1,data:!0},{pattern:/^\/records\/[a-z][a-z0-9_]*$/,component:U_,data:!0},{pattern:/^\/records\/[a-z][a-z0-9_]*\/(create|\d+\/edit)$/,component:j_,data:!0},{pattern:/^\/reviews$/,component:l_,data:!0}];function g1(e,t,n={}){h1.unshift({pattern:new RegExp(e),component:t,data:n.data,source:n.source})}var Q=rn({path:``,component:null,props:{},loading:!0,forbidden:!1,toast:null}),_1;function $(e,t=!1){Q.toast={text:e,error:t},window.clearTimeout(_1),_1=window.setTimeout(()=>Q.toast=null,4e3)}function v1(e){return e.split(`?`)[0].slice(X.base.length)||`/`}async function y1(e){let t=h1.find(t=>t.pattern.test(v1(e)));if(!X.user&&!t?.guest)window.location.assign(X.base+`/login`);else{if(X.user&&t?.guest)return b1(X.base,!0);Q.loading=!0,Q.forbidden=!1,Q.path=e,Q.component=t?.component??od,Q.props={};try{Q.props=t?.data?await qu.get(t.source?X.base+t.source:e):{}}catch(e){e instanceof Uu&&e.status===401?window.location.assign(X.base+`/login`):e instanceof Uu&&e.status===403?Q.forbidden=!0:$(Z(`Something went wrong. Try again.`),!0)}finally{Q.loading=!1}}}function b1(e,t=!1){return window.history[t?`replaceState`:`pushState`]({},``,e),window.scrollTo(0,0),y1(e)}function x1(){return y1(Q.path)}function S1(){window.addEventListener(`popstate`,()=>y1(window.location.pathname+window.location.search)),y1(window.location.pathname+window.location.search)}var C1={key:0,class:`h-4 w-4 shrink-0`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},w1=[`d`],T1=L({__name:`Icon`,props:{name:{}},setup(e){let t={home:`M3 11l9-8 9 8v9a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z`,file:`M7 3h7l5 5v13H7zM14 3v5h5`,image:`M4 5h16v14H4zM4 16l5-5 4 4 3-3 4 4M9 9h.01`,users:`M16 20v-1a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v1M10 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6M20 20v-1a3 3 0 0 0-2-2.8M16 5.2a3 3 0 0 1 0 5.6`,group:`M3 7h18v12H3zM8 7V5h8v2`,chart:`M4 20V10M10 20V4M16 20v-8M22 20H2`,shield:`M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z`,star:`M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z`,tag:`M3 12V4h8l10 10-8 8zM7.5 8h.01`,link:`M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1`,cog:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6M19 12a7 7 0 0 0-.1-1.2l2-1.5-2-3.4-2.3.9a7 7 0 0 0-2-1.2L14.2 3h-4l-.4 2.6a7 7 0 0 0-2 1.2l-2.3-.9-2 3.4 2 1.5A7 7 0 0 0 5 12c0 .4 0 .8.1 1.2l-2 1.5 2 3.4 2.3-.9a7 7 0 0 0 2 1.2l.4 2.6h4l.4-2.6a7 7 0 0 0 2-1.2l2.3.9 2-3.4-2-1.5c.1-.4.1-.8.1-1.2`};return(n,r)=>e.name&&t[e.name]?(H(),U(`svg`,C1,[G(`path`,{d:t[e.name]},null,8,w1)])):J(``,!0)}}),E1={class:`min-h-screen`},D1={class:`fixed inset-x-0 top-0 z-40 flex h-14 items-center justify-between border-b border-line bg-panel px-4 md:hidden`},O1={class:`font-display font-bold`},k1=[`aria-expanded`],A1={class:`hidden h-16 items-center gap-2 px-5 md:flex`},j1=[`src`],M1={class:`font-display text-lg font-bold`},N1={class:`flex-1 space-y-0.5 overflow-y-auto px-3 py-3`,"aria-label":`Manager`},P1={key:0,class:`my-3 border-line`},F1={key:1,class:`px-3 pb-1 pt-4 text-xs font-semibold uppercase tracking-wide text-muted`},I1=[`href`],L1={class:`border-t border-line p-4`},R1={class:`truncate text-sm font-semibold group-hover:text-brand`},z1={class:`truncate text-xs text-muted`},B1={class:`px-4 pb-16 pt-20 md:ml-60 md:px-8 md:pt-8`},V1={class:`mx-auto max-w-5xl`},H1=L({__name:`Layout`,setup(e){let t=N(!1),n=dc(()=>{let e=[];for(let t of[{label:`Dashboard`,href:X.base,icon:`home`},...X.navigation]){let n=t.section??``,r=e[e.length-1];r&&r.title===n?r.items.push(t):e.push({title:n,items:[t]})}return e}),r=N(X.view);async function i(){await qu.put(X.base+`/profile/view`,{view:r.value===`simple`?`full`:`simple`}),window.location.assign(X.base)}function a(e){let t=Q.path.split(`?`)[0];return e===X.base?t===e:t===e||t.startsWith(e+`/`)}async function o(){let{redirect:e}=await qu.post(X.base+`/logout`);window.location.assign(e)}return Nr(()=>Q.path,()=>t.value=!1),(e,s)=>(H(),U(`div`,E1,[G(`header`,D1,[G(`span`,O1,k(P(X).name),1),G(`button`,{type:`button`,class:`m-btn m-btn-secondary`,"aria-expanded":t.value,onClick:s[0]||=e=>t.value=!t.value},k(P(Z)(`Menu`)),9,k1)]),G(`aside`,{class:O([`fixed inset-y-0 left-0 z-30 flex w-60 flex-col border-r border-line bg-panel pt-14 transition-transform md:translate-x-0 md:pt-0`,t.value?`translate-x-0`:`-translate-x-full`])},[G(`div`,A1,[P(X).logo?(H(),U(`img`,{key:0,src:P(X).logo,alt:``,class:`h-7 w-auto`},null,8,j1)):J(``,!0),G(`span`,M1,k(P(X).name),1)]),G(`nav`,N1,[(H(!0),U(B,null,R(n.value,(e,t)=>(H(),U(B,{key:e.title+t},[!e.title&&t>0?(H(),U(`hr`,P1)):J(``,!0),e.title?(H(),U(`p`,F1,k(P(Z)(e.title)),1)):J(``,!0),(H(!0),U(B,null,R(e.items,e=>(H(),U(B,{key:e.href},[e.new_tab?(H(),U(`a`,{key:0,href:e.href,target:`_blank`,rel:`noopener`,class:`flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium text-muted transition hover:bg-text/5 hover:text-text`},[K(T1,{name:e.icon},null,8,[`name`]),q(k(P(Z)(e.label)),1)],8,I1)):(H(),W($u,{key:1,href:e.href,class:O([`flex items-center gap-2 rounded-lg px-3 py-2 text-sm font-medium transition`,a(e.href)?`bg-brand/15 text-text`:`text-muted hover:bg-text/5 hover:text-text`]),"aria-current":a(e.href)?`page`:void 0},{default:F(()=>[K(T1,{name:e.icon},null,8,[`name`]),q(k(P(Z)(e.label)),1)]),_:2},1032,[`href`,`class`,`aria-current`]))],64))),128))],64))),128))]),G(`div`,L1,[K($u,{href:P(X).base+`/profile`,class:`group block`},{default:F(()=>[G(`p`,R1,k(P(X).user?.name),1),G(`p`,z1,k(P(X).user?.email),1)]),_:1},8,[`href`]),P(X).can_switch?(H(),U(`button`,{key:0,type:`button`,class:`m-btn m-btn-secondary mt-3 w-full justify-center`,onClick:i},k(r.value===`simple`?P(Z)(`Show everything`):P(Z)(`Simple view`)),1)):J(``,!0),G(`button`,{type:`button`,class:`m-btn m-btn-secondary mt-3 w-full justify-center`,onClick:o},k(P(Z)(`Log out`)),1)])],2),t.value?(H(),U(`div`,{key:0,class:`fixed inset-0 z-20 bg-black/60 md:hidden`,onClick:s[1]||=e=>t.value=!1})):J(``,!0),G(`main`,B1,[G(`div`,V1,[Sa(e.$slots,`default`)])])]))}}),U1={key:0,class:`m-card p-5 text-sm`},W1={key:1,class:`text-sm text-muted`},G1=L({__name:`App`,setup(e){return(e,t)=>(H(),U(B,null,[P(Q).component&&!P(X).user?(H(),W(_a(P(Q).component),{key:0})):P(Q).component?(H(),W(H1,{key:1},{default:F(()=>[P(Q).forbidden?(H(),U(`p`,U1,k(P(Z)(`You may not open this page.`)),1)):P(Q).loading?(H(),U(`p`,W1,k(P(Z)(`Loading…`)),1)):(H(),W(_a(P(Q).component),Se(Ls({key:2},P(Q).props)),null,16))]),_:1})):J(``,!0),P(Q).toast?(H(),U(`div`,{key:2,role:`status`,class:O([`fixed bottom-5 right-5 z-50 rounded-lg border border-l-4 border-line bg-panel px-4 py-3 text-sm font-medium text-text shadow-xl`,P(Q).toast.error?`border-l-red-500`:`border-l-emerald-500`])},k(P(Q).toast.text),3)):J(``,!0)],64))}});Zu(X.locale),window.IriksManager={Vue:Vu,boot:X,api:qu,t:Z,flash:$,navigate:b1,register:g1,components:{Link:$u,FormFields:D_,Icon:T1,MediaPicker:Fd}};async function K1(){for(let e of X.extensions??[])try{await import(e)}catch(t){console.error(`Manager extension ${e} did not load`,t)}Fu(G1).mount(`#manager`),S1()}K1(); \ No newline at end of file diff --git a/resources/dist/vue.js b/resources/dist/vue.js new file mode 100644 index 0000000..826b71d --- /dev/null +++ b/resources/dist/vue.js @@ -0,0 +1,174 @@ +const Vue = window.IriksManager.Vue; +export const BaseTransition = Vue.BaseTransition; +export const BaseTransitionPropsValidators = Vue.BaseTransitionPropsValidators; +export const Comment = Vue.Comment; +export const DeprecationTypes = Vue.DeprecationTypes; +export const EffectScope = Vue.EffectScope; +export const ErrorCodes = Vue.ErrorCodes; +export const ErrorTypeStrings = Vue.ErrorTypeStrings; +export const Fragment = Vue.Fragment; +export const KeepAlive = Vue.KeepAlive; +export const ReactiveEffect = Vue.ReactiveEffect; +export const Static = Vue.Static; +export const Suspense = Vue.Suspense; +export const Teleport = Vue.Teleport; +export const Text = Vue.Text; +export const TrackOpTypes = Vue.TrackOpTypes; +export const Transition = Vue.Transition; +export const TransitionGroup = Vue.TransitionGroup; +export const TriggerOpTypes = Vue.TriggerOpTypes; +export const VueElement = Vue.VueElement; +export const __esModule = Vue.__esModule; +export const assertNumber = Vue.assertNumber; +export const callWithAsyncErrorHandling = Vue.callWithAsyncErrorHandling; +export const callWithErrorHandling = Vue.callWithErrorHandling; +export const camelize = Vue.camelize; +export const capitalize = Vue.capitalize; +export const cloneVNode = Vue.cloneVNode; +export const compatUtils = Vue.compatUtils; +export const compile = Vue.compile; +export const computed = Vue.computed; +export const createApp = Vue.createApp; +export const createBlock = Vue.createBlock; +export const createCommentVNode = Vue.createCommentVNode; +export const createElementBlock = Vue.createElementBlock; +export const createElementVNode = Vue.createElementVNode; +export const createHydrationRenderer = Vue.createHydrationRenderer; +export const createPropsRestProxy = Vue.createPropsRestProxy; +export const createRenderer = Vue.createRenderer; +export const createSSRApp = Vue.createSSRApp; +export const createSlots = Vue.createSlots; +export const createStaticVNode = Vue.createStaticVNode; +export const createTextVNode = Vue.createTextVNode; +export const createVNode = Vue.createVNode; +export const customRef = Vue.customRef; +export const defineAsyncComponent = Vue.defineAsyncComponent; +export const defineComponent = Vue.defineComponent; +export const defineCustomElement = Vue.defineCustomElement; +export const defineEmits = Vue.defineEmits; +export const defineExpose = Vue.defineExpose; +export const defineModel = Vue.defineModel; +export const defineOptions = Vue.defineOptions; +export const defineProps = Vue.defineProps; +export const defineSSRCustomElement = Vue.defineSSRCustomElement; +export const defineSlots = Vue.defineSlots; +export const devtools = Vue.devtools; +export const effect = Vue.effect; +export const effectScope = Vue.effectScope; +export const getCurrentInstance = Vue.getCurrentInstance; +export const getCurrentScope = Vue.getCurrentScope; +export const getCurrentWatcher = Vue.getCurrentWatcher; +export const getTransitionRawChildren = Vue.getTransitionRawChildren; +export const guardReactiveProps = Vue.guardReactiveProps; +export const h = Vue.h; +export const handleError = Vue.handleError; +export const hasInjectionContext = Vue.hasInjectionContext; +export const hydrate = Vue.hydrate; +export const hydrateOnIdle = Vue.hydrateOnIdle; +export const hydrateOnInteraction = Vue.hydrateOnInteraction; +export const hydrateOnMediaQuery = Vue.hydrateOnMediaQuery; +export const hydrateOnVisible = Vue.hydrateOnVisible; +export const initCustomFormatter = Vue.initCustomFormatter; +export const initDirectivesForSSR = Vue.initDirectivesForSSR; +export const inject = Vue.inject; +export const isMemoSame = Vue.isMemoSame; +export const isProxy = Vue.isProxy; +export const isReactive = Vue.isReactive; +export const isReadonly = Vue.isReadonly; +export const isRef = Vue.isRef; +export const isRuntimeOnly = Vue.isRuntimeOnly; +export const isShallow = Vue.isShallow; +export const isVNode = Vue.isVNode; +export const markRaw = Vue.markRaw; +export const mergeDefaults = Vue.mergeDefaults; +export const mergeModels = Vue.mergeModels; +export const mergeProps = Vue.mergeProps; +export const nextTick = Vue.nextTick; +export const nodeOps = Vue.nodeOps; +export const normalizeClass = Vue.normalizeClass; +export const normalizeProps = Vue.normalizeProps; +export const normalizeStyle = Vue.normalizeStyle; +export const onActivated = Vue.onActivated; +export const onBeforeMount = Vue.onBeforeMount; +export const onBeforeUnmount = Vue.onBeforeUnmount; +export const onBeforeUpdate = Vue.onBeforeUpdate; +export const onDeactivated = Vue.onDeactivated; +export const onErrorCaptured = Vue.onErrorCaptured; +export const onMounted = Vue.onMounted; +export const onRenderTracked = Vue.onRenderTracked; +export const onRenderTriggered = Vue.onRenderTriggered; +export const onScopeDispose = Vue.onScopeDispose; +export const onServerPrefetch = Vue.onServerPrefetch; +export const onUnmounted = Vue.onUnmounted; +export const onUpdated = Vue.onUpdated; +export const onWatcherCleanup = Vue.onWatcherCleanup; +export const openBlock = Vue.openBlock; +export const patchProp = Vue.patchProp; +export const popScopeId = Vue.popScopeId; +export const provide = Vue.provide; +export const proxyRefs = Vue.proxyRefs; +export const pushScopeId = Vue.pushScopeId; +export const queuePostFlushCb = Vue.queuePostFlushCb; +export const reactive = Vue.reactive; +export const readonly = Vue.readonly; +export const ref = Vue.ref; +export const registerRuntimeCompiler = Vue.registerRuntimeCompiler; +export const render = Vue.render; +export const renderList = Vue.renderList; +export const renderSlot = Vue.renderSlot; +export const resolveComponent = Vue.resolveComponent; +export const resolveDirective = Vue.resolveDirective; +export const resolveDynamicComponent = Vue.resolveDynamicComponent; +export const resolveFilter = Vue.resolveFilter; +export const resolveTransitionHooks = Vue.resolveTransitionHooks; +export const setBlockTracking = Vue.setBlockTracking; +export const setDevtoolsHook = Vue.setDevtoolsHook; +export const setTransitionHooks = Vue.setTransitionHooks; +export const shallowReactive = Vue.shallowReactive; +export const shallowReadonly = Vue.shallowReadonly; +export const shallowRef = Vue.shallowRef; +export const ssrContextKey = Vue.ssrContextKey; +export const ssrUtils = Vue.ssrUtils; +export const stop = Vue.stop; +export const toDisplayString = Vue.toDisplayString; +export const toHandlerKey = Vue.toHandlerKey; +export const toHandlers = Vue.toHandlers; +export const toRaw = Vue.toRaw; +export const toRef = Vue.toRef; +export const toRefs = Vue.toRefs; +export const toValue = Vue.toValue; +export const transformVNodeArgs = Vue.transformVNodeArgs; +export const triggerRef = Vue.triggerRef; +export const unref = Vue.unref; +export const useAttrs = Vue.useAttrs; +export const useCssModule = Vue.useCssModule; +export const useCssVars = Vue.useCssVars; +export const useHost = Vue.useHost; +export const useId = Vue.useId; +export const useModel = Vue.useModel; +export const useSSRContext = Vue.useSSRContext; +export const useShadowRoot = Vue.useShadowRoot; +export const useSlots = Vue.useSlots; +export const useTemplateRef = Vue.useTemplateRef; +export const useTransitionState = Vue.useTransitionState; +export const vModelCheckbox = Vue.vModelCheckbox; +export const vModelDynamic = Vue.vModelDynamic; +export const vModelRadio = Vue.vModelRadio; +export const vModelSelect = Vue.vModelSelect; +export const vModelText = Vue.vModelText; +export const vShow = Vue.vShow; +export const version = Vue.version; +export const warn = Vue.warn; +export const watch = Vue.watch; +export const watchEffect = Vue.watchEffect; +export const watchPostEffect = Vue.watchPostEffect; +export const watchSyncEffect = Vue.watchSyncEffect; +export const withAsyncContext = Vue.withAsyncContext; +export const withCtx = Vue.withCtx; +export const withDefaults = Vue.withDefaults; +export const withDirectives = Vue.withDirectives; +export const withKeys = Vue.withKeys; +export const withMemo = Vue.withMemo; +export const withModifiers = Vue.withModifiers; +export const withScopeId = Vue.withScopeId; +export default Vue; diff --git a/resources/js/pulse.js b/resources/js/pulse.js new file mode 100644 index 0000000..fcff87d --- /dev/null +++ b/resources/js/pulse.js @@ -0,0 +1,105 @@ +/* + * Reports a page view of the public site to the statistics of the manager, and how long the page was in view. + * No cookies, no storage, nothing about the visitor: the server decides what it keeps (see the README). A browser that + * asks not to be followed (Do Not Track, Global Privacy Control) is not counted, here and on the server. + * + * + * + * `data-spa` on the script tag: also report the pages a client-side router moves to (history.pushState). + */ +(function () { + 'use strict'; + + var script = document.currentScript; + var base = script && script.src ? script.src.replace(/\/pulse\.js(\?.*)?$/, '') : '/pulse'; + + if (navigator.doNotTrack === '1' || navigator.globalPrivacyControl === true) { + return; + } + + var token = null; + var visible = 0; + var shownAt = document.visibilityState === 'visible' ? Date.now() : null; + var sent = false; + + function params() { + return new URLSearchParams(location.search); + } + + function other(referrer) { + try { + return new URL(referrer).host !== location.host ? referrer : ''; + } catch (e) { + return ''; + } + } + + function report(path, referrer) { + var query = params(); + + fetch(base + '/view', { + method: 'POST', + headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, + credentials: 'omit', + keepalive: true, + body: JSON.stringify({ + path: path, + referrer: referrer, + via: query.get('via') || query.get('utm_source') || '', + campaign: query.get('utm_campaign') || '', + }), + }) + .then(function (response) { return response.ok ? response.json() : null; }) + .then(function (data) { token = data && data.token ? data.token : null; }) + .catch(function () {}); + } + + function leave() { + if (shownAt !== null) { + visible += Date.now() - shownAt; + shownAt = null; + } + + if (token && !sent && visible > 0) { + sent = true; + var body = JSON.stringify({ token: token, seconds: Math.min(Math.round(visible / 1000), 7200) }); + + if (!(navigator.sendBeacon && navigator.sendBeacon(base + '/leave', new Blob([body], { type: 'application/json' })))) { + fetch(base + '/leave', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: body, keepalive: true, credentials: 'omit' }).catch(function () {}); + } + } + } + + function resume() { + shownAt = shownAt === null && document.visibilityState === 'visible' ? Date.now() : shownAt; + sent = false; + } + + document.addEventListener('visibilitychange', function () { + document.visibilityState === 'hidden' ? leave() : resume(); + }); + window.addEventListener('pagehide', leave); + + report(location.pathname, other(document.referrer)); + + if (script && script.hasAttribute('data-spa')) { + var previous = location.pathname; + var push = history.pushState; + + history.pushState = function () { + var result = push.apply(this, arguments); + + if (location.pathname !== previous) { + leave(); + visible = 0; + token = null; + shownAt = Date.now(); + sent = false; + report(location.pathname, location.origin + previous); + previous = location.pathname; + } + + return result; + }; + } +})(); diff --git a/resources/lang/nl.json b/resources/lang/nl.json new file mode 100644 index 0000000..956e640 --- /dev/null +++ b/resources/lang/nl.json @@ -0,0 +1,116 @@ +{ + "Audit log": "Auditlog", + "Banned an address": "Een adres geblokkeerd", + "Lifted the ban of an address": "De blokkade van een adres opgeheven", + "Banned the addresses of a group": "De adressen van een groep geblokkeerd", + "Lifted the bans of a group": "De blokkades van een groep opgeheven", + "Wrote or removed the note about an address": "Een notitie over een adres geschreven of verwijderd", + "Changed the rules of the audit log": "De regels van de auditlog gewijzigd", + "Opened the audit log": "De auditlog geopend", + "See the audit log: who logged in and what was done, with addresses and browsers": "De auditlog zien: wie er inlogde en wat er gedaan is, met adressen en browsers", + "Ban addresses and lift bans, write notes about addresses, and set the rules of the audit log": "Adressen blokkeren en weer vrijgeven, notities over adressen schrijven en de regels van de auditlog instellen", + "Media": "Media", + "Uploaded a file": "Een bestand geüpload", + "Changed a file": "Een bestand gewijzigd", + "Deleted a file": "Een bestand verwijderd", + "Opened the media library": "De mediabibliotheek geopend", + "See the media library and pick files from it": "De mediabibliotheek zien en er bestanden uit kiezen", + "Upload files": "Bestanden uploaden", + "Change the name, description and focus point of a file": "De naam, omschrijving en het scherpstelpunt van een bestand wijzigen", + "Delete files": "Bestanden verwijderen", + "Pages": "Pagina's", + "Opened the pages": "De pagina's geopend", + "Change the texts of the pages": "De teksten van de pagina's wijzigen", + "Site content": "Inhoud van de site", + "Posts": "Berichten", + "Categories and tags": "Categorieën en tags", + "Created a post": "Een bericht gemaakt", + "Changed a post": "Een bericht gewijzigd", + "Put a post on the site, or took it off": "Een bericht online gezet of offline gehaald", + "Deleted a post": "Een bericht verwijderd", + "Made a category or tag": "Een categorie of tag gemaakt", + "Renamed a category or tag": "Een categorie of tag hernoemd", + "Removed a category or tag": "Een categorie of tag verwijderd", + "Opened the posts": "De berichten geopend", + "Opened the form for a new post": "Het formulier voor een nieuw bericht geopend", + "Opened a post": "Een bericht geopend", + "Opened the preview of a post": "De voorvertoning van een bericht geopend", + "Opened the categories and tags": "De categorieën en tags geopend", + "See the posts, drafts included": "De berichten zien, concepten inbegrepen", + "Write posts: create drafts and change them": "Berichten schrijven: concepten maken en wijzigen", + "Publish, schedule and unpublish posts, and change posts that are live": "Berichten publiceren, plannen en offline halen, en berichten wijzigen die online staan", + "Delete posts (one that is live only together with publishing)": "Berichten verwijderen (een online bericht alleen samen met publiceren)", + "Manage the categories and tags: make them, and rename, merge and remove them on all posts": "De categorieën en tags beheren: maken, hernoemen, samenvoegen en verwijderen op alle berichten", + "Reviews": "Reviews", + "Opened the reviews": "De reviews geopend", + "Manage the reviews": "De reviews beheren", + "Statistics": "Statistieken", + "Exported the statistics": "De statistieken geëxporteerd", + "Opened the statistics": "De statistieken geopend", + "See the visitor statistics and download them": "De bezoekersstatistieken zien en downloaden", + "Accounts": "Accounts", + "Groups": "Groepen", + "Created an account": "Een account aangemaakt", + "Changed an account": "Een account gewijzigd", + "Deleted an account": "Een account verwijderd", + "Created a group": "Een groep aangemaakt", + "Changed a group": "Een groep gewijzigd", + "Deleted a group": "Een groep verwijderd", + "Opened the accounts": "De accounts geopend", + "Opened the groups": "De groepen geopend", + "Create, change and delete accounts, and put them in groups": "Accounts maken, wijzigen en verwijderen, en in groepen zetten", + "Users": "Gebruikers", + "Changed own account": "Eigen account gewijzigd", + "Logged in": "Ingelogd", + "Logged out": "Uitgelogd", + "Asked for :request": ":request opgevraagd", + "Was not allowed: :what": "Mocht dit niet: :what", + "The address was banned after too many failed logins": "Het adres is geblokkeerd na te veel mislukte inlogpogingen", + "Dark": "Donker", + "Light": "Licht", + "category": "categorie", + "tag": "tag", + "The :type \":name\" already exists.": "De :type \":name\" bestaat al.", + "You cannot delete your own account.": "Je kunt je eigen account niet verwijderen.", + "Another account already uses this email address.": "Een ander account gebruikt dit e-mailadres al.", + "You can only choose groups that allow nothing more than your own account.": "Je kunt alleen groepen kiezen die niet meer toestaan dan je eigen account.", + "The current password is not right.": "Het huidige wachtwoord klopt niet.", + "The media library is full: this file does not fit in the room that is left. Remove files that are no longer used, or raise manager.media.max_total_gb.": "De mediabibliotheek is vol: dit bestand past niet in de ruimte die over is. Verwijder bestanden die niet meer gebruikt worden, of verhoog manager.media.max_total_gb.", + "The file storage is not available right now. Try again in a moment.": "De bestandsopslag is nu niet beschikbaar. Probeer het zo opnieuw.", + ":ip is banned from the whole site.": ":ip is geblokkeerd voor de hele site.", + ":ip is banned from the manager.": ":ip is geblokkeerd voor de manager.", + "The ban of :ip is lifted.": "De blokkade van :ip is opgeheven.", + "The note about :ip is removed.": "De notitie over :ip is verwijderd.", + "The note about :ip is saved.": "De notitie over :ip is opgeslagen.", + "Rules saved.": "Regels opgeslagen.", + "That is the address you are on yourself.": "Dat is het adres waar je zelf op zit.", + "This address is on the list that is never banned.": "Dit adres staat op de lijst die nooit geblokkeerd wordt.", + "this site": "deze site", + "the manager": "de manager", + "This address is blocked from :where.": "Dit adres is geblokkeerd voor :where.", + "This address is blocked from :where until :when.": "Dit adres is geblokkeerd voor :where tot :when.", + "Switched between the simple and the whole manager": "Gewisseld tussen de simpele en de hele manager", + "See the whole manager, not only the simple screens": "De hele manager zien, niet alleen de simpele schermen", + "Switch between the simple and the whole manager": "Wisselen tussen de simpele en de hele manager", + "Manager": "Manager", + "Created a page": "Een pagina gemaakt", + "Changed a page": "Een pagina gewijzigd", + "Removed a page": "Een pagina verwijderd", + "Opened a page": "Een pagina geopend", + "A page with fields of its own cannot be removed.": "Een pagina met eigen velden kan niet verwijderd worden.", + "Resources": "Lijsten", + "Added a record": "Een item toegevoegd", + "Changed a record": "Een item gewijzigd", + "Removed a record": "Een item verwijderd", + "Opened a list": "Een lijst geopend", + "Opened the form for a new record": "Het formulier voor een nieuw item geopend", + "Opened a record": "Een item geopend", + "See :label": ":label bekijken", + "Add, change and delete :label": ":label toevoegen, wijzigen en verwijderen", + "History": "Geschiedenis", + "See the history of posts and pages": "De geschiedenis van berichten en pagina's zien", + "Put an earlier version of a post or page back": "Een eerdere versie van een bericht of pagina terugzetten", + "Put an earlier version back": "Een eerdere versie teruggezet", + "Opened the history of a text": "De geschiedenis van een tekst geopend", + "Prove you are not a program, then log in again.": "Laat zien dat je geen programma bent en log dan opnieuw in." +} \ No newline at end of file diff --git a/resources/views/components/pulse.blade.php b/resources/views/components/pulse.blade.php new file mode 100644 index 0000000..94f40d9 --- /dev/null +++ b/resources/views/components/pulse.blade.php @@ -0,0 +1,5 @@ +{{-- Counts the page in the statistics of the manager (module `statistics`). Put it once in the layout of the public site. --}} +@props(['spa' => false]) +@if (\Illuminate\Support\Facades\Route::has(\IriksIT\Manager\Support\Names::route('pulse.script'))) + +@endif diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index b28b228..c9fa81f 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -9,7 +9,7 @@

Manager

diff --git a/resources/views/shell.blade.php b/resources/views/shell.blade.php index 3ff5eb3..ae2868e 100644 --- a/resources/views/shell.blade.php +++ b/resources/views/shell.blade.php @@ -7,11 +7,15 @@ {{ $title }} {{-- The theme: values were checked by IriksIT\Manager\Support\Themes, nothing else goes in here. --}} - + + @if ($extensions !== []) + {{-- A bundle of the site imports `vue`: this makes it the Vue of the screens. Before any module script. --}} + + @endif
- + diff --git a/routes/manager.php b/routes/manager.php index 7283459..4588f34 100644 --- a/routes/manager.php +++ b/routes/manager.php @@ -3,9 +3,16 @@ use Illuminate\Support\Facades\Route; use IriksIT\Manager\Http\Controllers\DashboardController; use IriksIT\Manager\Http\Controllers\LoginController; +use IriksIT\Manager\Http\Controllers\MarkdownController; use IriksIT\Manager\Http\Controllers\ProfileController; Route::get('/', DashboardController::class)->name('dashboard'); Route::get('/profile', [ProfileController::class, 'show'])->name('profile.show'); Route::put('/profile', [ProfileController::class, 'update'])->name('profile.update'); +Route::put('/profile/view', [ProfileController::class, 'view'])->name('profile.view'); +Route::post('/markdown', MarkdownController::class)->name('markdown.preview')->middleware('throttle:120,1'); Route::post('/logout', [LoginController::class, 'destroy'])->name('logout'); + +// A screen that exists only in the bundle of the site (`manager.extensions`) has no route of its own: a browser that +// asks for it gets the shell, which shows the screen. Anything else that asks for data gets a plain 404. +Route::fallback(fn () => abort(404)); diff --git a/src/Concerns/HasManagerAccess.php b/src/Concerns/HasManagerAccess.php index ab9b7fc..2611f3c 100644 --- a/src/Concerns/HasManagerAccess.php +++ b/src/Concerns/HasManagerAccess.php @@ -5,12 +5,14 @@ namespace IriksIT\Manager\Concerns; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use IriksIT\Manager\Models\Group; use IriksIT\Manager\Support\ModuleRegistry; +use IriksIT\Manager\Support\Names; +use IriksIT\Manager\Support\Permissions\Sources; /** * Put this on the User model of the host app (needs the Users module). * * A super admin may do everything of the manager. Everyone else may do what any of their - * groups allows. `is_super_admin` is never fillable and no form sets it: only + * groups allows, or (config `manager.permissions`) what the roles of the site say. `is_super_admin` is never fillable and no form sets it: only * `manager:create-user` makes one. Keep it out of `$fillable` in the host model. */ trait HasManagerAccess @@ -18,7 +20,7 @@ trait HasManagerAccess /** @return BelongsToMany */ public function managerGroups(): BelongsToMany { - return $this->belongsToMany(Group::class, config('manager.table_prefix').'group_user', 'user_id', 'group_id'); + return $this->belongsToMany(Group::class, Names::table('group_user'), 'user_id', 'group_id'); } public function isManagerSuperAdmin(): bool @@ -39,7 +41,9 @@ trait HasManagerAccess return $registry->permissionValues(); } - return $registry->complete($this->managerGroups->flatMap(fn (Group $group) => $group->allowed())->all()); + $fromGroups = Sources::usesGroups() ? $this->managerGroups->flatMap(fn (Group $group) => $group->allowed())->all() : []; + + return $registry->complete([...$fromGroups, ...Sources::fromHost($this)]); } public function hasManagerPermission(string $permission): bool diff --git a/src/Console/DoctorCommand.php b/src/Console/DoctorCommand.php index b5f0231..6bdb780 100644 --- a/src/Console/DoctorCommand.php +++ b/src/Console/DoctorCommand.php @@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Schema; use IriksIT\Manager\Concerns\HasManagerAccess; use IriksIT\Manager\Support\ModuleRegistry; +use IriksIT\Manager\Support\Names; /** * Checks that the manager is wired into the app, and says what to do when it is not. Meant for people and for @@ -30,6 +31,7 @@ class DoctorCommand extends Command $this->checkUserModel($modules); $this->checkTables($modules); $this->checkRoutes(); + $this->checkNames(); $this->checkModules($modules); $failed = collect($this->checks)->contains('status', 'fail'); @@ -86,7 +88,7 @@ class DoctorCommand extends Command $this->add('super_admin_fillable', 'fail', 'is_super_admin is mass assignable: anyone who can fill the model could make themselves a super admin.', 'Remove is_super_admin from $fillable of the user model.'); } - if ($modules->enabled('users') && Schema::hasTable((new $model)->getTable()) && Schema::hasTable(config('manager.table_prefix').'groups')) { + if ($modules->enabled('users') && Schema::hasTable((new $model)->getTable()) && Schema::hasTable(Names::table('groups'))) { $admins = $model::query()->where('is_super_admin', true)->count(); $admins > 0 ? $this->add('super_admin', 'ok', "{$admins} super admin(s) exist.") @@ -96,13 +98,12 @@ class DoctorCommand extends Command private function checkTables(ModuleRegistry $modules): void { - $prefix = config('manager.table_prefix'); $missing = []; foreach ($modules->active() as $module) { foreach (method_exists($module, 'tables') ? $module->tables() : [] as $table) { - if (! Schema::hasTable($prefix.$table)) { - $missing[] = $prefix.$table; + if (! Schema::hasTable(Names::table($table))) { + $missing[] = Names::table($table); } } } @@ -114,19 +115,51 @@ class DoctorCommand extends Command private function checkRoutes(): void { - Route::has('manager.dashboard') + Route::has(Names::route('dashboard')) ? $this->add('routes', 'ok', 'The manager routes are registered under /'.trim((string) config('manager.path'), '/').'.') : $this->add('routes', 'fail', 'The manager routes are not registered.', 'Run `composer dump-autoload` and make sure the package service provider is discovered (not in dont-discover).'); if (Route::has('login')) { $this->add('login', 'ok', 'The app has a login route.'); - } elseif (Route::has('manager.login')) { + } elseif (Route::has(Names::route('login'))) { $this->add('login', 'ok', 'The app has no login of its own: visitors use the login of the manager.'); } else { $this->add('login', 'warn', 'There is no login: the auth middleware has nowhere to send visitors.', 'Set MANAGER_UI=package (the manager brings a login), or add a login to the app.'); } } + /** Route names or addresses of the site that the package would share with its own. */ + private function checkNames(): void + { + $prefix = Names::routePrefix(); + $path = trim((string) config('manager.path'), '/'); + $names = []; + $foreign = []; + + foreach (Route::getRoutes()->getRoutes() as $route) { + $name = (string) $route->getName(); + $mine = $route->isFallback || ($route->getActionName() === 'Closure' && str_starts_with($name, $prefix)) || str_starts_with(ltrim($route->getActionName(), '\\'), 'IriksIT\\Manager\\'); + + if ($prefix !== '' && str_starts_with($name, $prefix) && $name !== $prefix) { + $names[$name] = ($names[$name] ?? 0) + 1; + } + + if (! $mine && ($route->uri() === $path || str_starts_with($route->uri(), $path.'/'))) { + $foreign[] = $route->uri(); + } + } + + $twice = array_keys(array_filter($names, fn (int $count) => $count > 1)); + + if ($twice !== []) { + $this->add('names', 'warn', 'Route names used twice: '.implode(', ', array_slice($twice, 0, 5)).'. The site and the manager share them, and one of the two stops working.', "Set 'route_name' in config/manager.php to something the site does not use, for example 'cms'."); + } elseif ($foreign !== []) { + $this->add('names', 'warn', 'The site has routes under the address of the manager: '.implode(', ', array_slice($foreign, 0, 5)).'.', "Move them, or set 'path' in config/manager.php (MANAGER_PATH) to another address."); + } else { + $this->add('names', 'ok', 'No route name or address is shared with the site.'); + } + } + private function checkModules(ModuleRegistry $modules): void { $active = array_keys($modules->active()); diff --git a/src/Console/ImportCommand.php b/src/Console/ImportCommand.php new file mode 100644 index 0000000..5b4c54e --- /dev/null +++ b/src/Console/ImportCommand.php @@ -0,0 +1,70 @@ +` (`table`, `connection`, `map`). + */ +class ImportCommand extends Command +{ + protected $signature = 'manager:import {target : posts, pages or reviews} + {--table= : Table to read (default: config manager.import..table)} + {--connection= : Database connection of that table (default: the default one)} + {--map=* : package_column=source_column, repeat for each column that is named differently} + {--limit= : Only the first rows} + {--dry-run : Count what would happen and write nothing}'; + + protected $description = 'Copy the existing posts, pages or reviews of the site into the package tables'; + + public function handle(Importer $importer): int + { + $target = (string) $this->argument('target'); + $config = (array) config('manager.import.'.$target, []); + $table = $this->option('table') ?: ($config['table'] ?? null); + + if (! is_string($table) || $table === '') { + $this->error('Which table? Give --table=... or set manager.import.'.$target.'.table.'); + + return self::FAILURE; + } + + $map = (array) ($config['map'] ?? []); + + foreach ((array) $this->option('map') as $pair) { + if (! str_contains((string) $pair, '=')) { + $this->error("--map wants package_column=source_column, got {$pair}"); + + return self::FAILURE; + } + + [$to, $from] = explode('=', (string) $pair, 2); + $map[trim($to)] = trim($from); + } + + try { + $connection = DB::connection($this->option('connection') ?: ($config['connection'] ?? null)); + $result = $importer->run($target, $connection, $table, $map, (bool) $this->option('dry-run'), $this->option('limit') !== null ? (int) $this->option('limit') : null); + } catch (InvalidArgumentException $e) { + $this->error($e->getMessage()); + + return self::FAILURE; + } + + foreach ($result['problems'] as $problem) { + $this->warn($problem); + } + + $this->info(($this->option('dry-run') ? 'Dry run: ' : '')."{$result['created']} created, {$result['updated']} updated, {$result['skipped']} skipped."); + + return self::SUCCESS; + } +} diff --git a/src/Contracts/LoginCheck.php b/src/Contracts/LoginCheck.php new file mode 100644 index 0000000..37cf31d --- /dev/null +++ b/src/Contracts/LoginCheck.php @@ -0,0 +1,30 @@ +> + */ + public function fields(): array; + + /** Runs first, before the password is looked at: a captcha belongs here. */ + public function before(Request $request): void; + + /** + * Runs when the email and password are right, before anyone is logged in: a second factor belongs here. When it refuses, the + * attempt counts as a failed login (the audit log and the bans see it). + */ + public function after(Request $request, Authenticatable $user): void; +} diff --git a/src/Contracts/PermissionResolver.php b/src/Contracts/PermissionResolver.php new file mode 100644 index 0000000..17ccd59 --- /dev/null +++ b/src/Contracts/PermissionResolver.php @@ -0,0 +1,15 @@ + permission values such as `posts.write` */ + public function permissions(Authenticatable $user): array; +} diff --git a/src/Http/Controllers/AssetController.php b/src/Http/Controllers/AssetController.php index 600dd93..433532d 100644 --- a/src/Http/Controllers/AssetController.php +++ b/src/Http/Controllers/AssetController.php @@ -7,7 +7,7 @@ use Symfony\Component\HttpFoundation\BinaryFileResponse; /** The built screens, served by the package itself: the app does not need Node, a build step or a publish. */ class AssetController { - private const FILES = ['manager.js' => 'application/javascript', 'manager.css' => 'text/css']; + private const FILES = ['manager.js' => 'application/javascript', 'manager.css' => 'text/css', 'vue.js' => 'application/javascript']; public function __invoke(string $file): BinaryFileResponse { diff --git a/src/Http/Controllers/DashboardController.php b/src/Http/Controllers/DashboardController.php index 810882b..23a3f72 100644 --- a/src/Http/Controllers/DashboardController.php +++ b/src/Http/Controllers/DashboardController.php @@ -3,25 +3,20 @@ namespace IriksIT\Manager\Http\Controllers; use Illuminate\Http\Request; +use IriksIT\Manager\Support\Menu; use IriksIT\Manager\Support\ModuleRegistry; class DashboardController { - public function __invoke(Request $request, ModuleRegistry $modules) + public function __invoke(Request $request, ModuleRegistry $modules, Menu $menu) { - // Only what this account may reach. - $navigation = array_values(array_filter( - $modules->navigation(), - fn (array $item) => $request->user()?->can($item['permission']), - )); + $user = $request->user(); - if ($request->wantsJson()) { - return response()->json(['navigation' => array_map( - fn (array $item) => ['label' => $item['label'], 'href' => route($item['route'], [], false)], - $navigation, - )]); - } + // Only what this account may reach, in the face it looks at. + $navigation = $menu->for($user, array_values(array_filter($modules->permissionValues(), fn (string $permission) => $user?->can($permission)))); - return view('manager::dashboard', ['navigation' => $navigation]); + return $request->wantsJson() + ? response()->json(['navigation' => $navigation]) + : view('manager::dashboard', ['navigation' => $navigation]); } } diff --git a/src/Http/Controllers/LoginController.php b/src/Http/Controllers/LoginController.php index d6614b9..ec787f4 100644 --- a/src/Http/Controllers/LoginController.php +++ b/src/Http/Controllers/LoginController.php @@ -7,19 +7,38 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; use Illuminate\Validation\ValidationException; +use IriksIT\Manager\Support\LoginChecks; +use IriksIT\Manager\Support\Names; /** The manager's own login, for an app that has none. Failed attempts reach the audit log through Laravel's `Failed` event. */ class LoginController { - public function store(Request $request): JsonResponse + public function store(Request $request, LoginChecks $checks): JsonResponse { + $checks->before($request); + $credentials = $request->validate([ 'email' => ['required', 'string', 'email', 'max:255'], 'password' => ['required', 'string', 'max:200'], ]); - if (! Auth::attempt($credentials, $request->boolean('remember'))) { - throw ValidationException::withMessages(['email' => trans('auth.failed')]); + $refused = null; + + // `attemptWhen` runs the second checks after the password is right and before the login begins; a refusal is a failed login. + $loggedIn = Auth::attemptWhen($credentials, function ($user) use ($checks, $request, &$refused) { + try { + $checks->after($request, $user); + } catch (ValidationException $e) { + $refused = $e; + + return false; + } + + return true; + }, $request->boolean('remember')); + + if (! $loggedIn) { + throw $refused ?? ValidationException::withMessages(['email' => trans('auth.failed')]); } $request->session()->regenerate(); @@ -33,6 +52,6 @@ class LoginController $request->session()->invalidate(); $request->session()->regenerateToken(); - return response()->json(['redirect' => Route::has('manager.login') ? route('manager.login', [], false) : '/']); + return response()->json(['redirect' => Route::has(Names::route('login')) ? route(Names::route('login'), [], false) : '/']); } } diff --git a/src/Http/Controllers/MarkdownController.php b/src/Http/Controllers/MarkdownController.php new file mode 100644 index 0000000..c67d6d6 --- /dev/null +++ b/src/Http/Controllers/MarkdownController.php @@ -0,0 +1,18 @@ +validate(['text' => ['nullable', 'string', 'max:200000']]); + + return response()->json(['html' => Markdown::toHtml((string) ($data['text'] ?? ''))]); + } +} diff --git a/src/Http/Controllers/ProfileController.php b/src/Http/Controllers/ProfileController.php index 98662a9..91c2ac3 100644 --- a/src/Http/Controllers/ProfileController.php +++ b/src/Http/Controllers/ProfileController.php @@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Hash; use Illuminate\Validation\Rule; use IriksIT\Manager\Models\UserSetting; use IriksIT\Manager\Support\AuditTrail; +use IriksIT\Manager\Support\Menu; use IriksIT\Manager\Support\Themes; /** Your own name, password and look. Never the rights: those are the groups'. */ @@ -24,11 +25,22 @@ class ProfileController 'groups' => method_exists($user, 'managerGroups') ? $user->managerGroups()->pluck('name')->values() : [], 'theme' => $themes->keyFor($user), 'themes' => config('manager.user_themes') - ? collect($themes->all())->map(fn (array $theme, string $key) => ['key' => $key, 'label' => $theme['label'], 'colors' => $theme['colors']])->values() + ? collect($themes->all())->map(fn (array $theme, string $key) => ['key' => $key, 'label' => __($theme['label']), 'colors' => $theme['colors']])->values() : [], ]]); } + /** The face of the manager (`full` or `simple`) an account that may switch looks at. */ + public function view(Request $request, Menu $menu): JsonResponse + { + abort_unless($menu->maySwitch($request->user()), 403); + + $data = $request->validate(['view' => ['required', Rule::in([Menu::FULL, Menu::SIMPLE])]]); + UserSetting::query()->updateOrCreate(['user_id' => $request->user()->getKey()], ['view' => $data['view']]); + + return response()->json(['view' => $data['view']]); + } + public function update(Request $request, Themes $themes): JsonResponse { $user = $request->user(); @@ -42,7 +54,7 @@ class ProfileController ]); if (($data['password'] ?? '') !== '' && ! Hash::check((string) ($data['current_password'] ?? ''), $user->getAuthPassword())) { - return response()->json(['message' => 'The current password is not right.', 'errors' => ['current_password' => ['The current password is not right.']]], 422); + return response()->json(['message' => $wrong = __('The current password is not right.'), 'errors' => ['current_password' => [$wrong]]], 422); } $user->name = $data['name']; diff --git a/src/Http/Middleware/Authenticate.php b/src/Http/Middleware/Authenticate.php index 5b990fd..ae86f6e 100644 --- a/src/Http/Middleware/Authenticate.php +++ b/src/Http/Middleware/Authenticate.php @@ -5,6 +5,7 @@ namespace IriksIT\Manager\Http\Middleware; use Illuminate\Auth\Middleware\Authenticate as Middleware; use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; +use IriksIT\Manager\Support\Names; /** `auth`, but a visitor goes to the login of the host app when it has one and to the manager's own login when not. */ class Authenticate extends Middleware @@ -15,6 +16,6 @@ class Authenticate extends Middleware return null; } - return Route::has('login') ? route('login') : (Route::has('manager.login') ? route('manager.login') : null); + return Route::has('login') ? route('login') : (Route::has(Names::route('login')) ? route(Names::route('login')) : null); } } diff --git a/src/Http/Middleware/ServeShell.php b/src/Http/Middleware/ServeShell.php index 574e2da..12eb139 100644 --- a/src/Http/Middleware/ServeShell.php +++ b/src/Http/Middleware/ServeShell.php @@ -4,6 +4,7 @@ namespace IriksIT\Manager\Http\Middleware; use Closure; use Illuminate\Http\Request; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Shell; use Symfony\Component\HttpFoundation\Response; @@ -22,7 +23,7 @@ class ServeShell $name = (string) $request->route()?->getName(); - if ($name === 'manager.assets' || str_ends_with($name, '.export')) { + if ($name === Names::route('assets') || str_ends_with($name, '.export')) { return $next($request); } diff --git a/src/ManagerServiceProvider.php b/src/ManagerServiceProvider.php index eca5548..2ca2d03 100644 --- a/src/ManagerServiceProvider.php +++ b/src/ManagerServiceProvider.php @@ -9,6 +9,7 @@ use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; use IriksIT\Manager\Support\ModuleRegistry; +use IriksIT\Manager\Support\Names; class ManagerServiceProvider extends ServiceProvider { @@ -24,7 +25,8 @@ class ManagerServiceProvider extends ServiceProvider $this->app->singleton(Modules\Posts\PostLabels::class); $this->app->singleton(ModuleRegistry::class, fn ($app) => new ModuleRegistry( - $app['config']->get('manager.available', []), + // A config that was published before resources existed does not list their module. + array_values(array_unique([...$app['config']->get('manager.available', []), Modules\Resources\ResourcesModule::class, Modules\Revisions\RevisionsModule::class])), $app['config']->get('manager.modules', []), )); } @@ -34,6 +36,7 @@ class ManagerServiceProvider extends ServiceProvider $modules->validate(); $this->publishes([__DIR__.'/../config/manager.php' => config_path('manager.php')], 'manager-config'); + $this->loadJsonTranslationsFrom(__DIR__.'/../resources/lang'); $this->loadViewsFrom(__DIR__.'/../resources/views', 'manager'); $this->loadMigrationsFrom(__DIR__.'/../database/migrations'); @@ -54,7 +57,7 @@ class ManagerServiceProvider extends ServiceProvider } if ($this->app->runningInConsole()) { - $this->commands([Console\InstallCommand::class, Console\DoctorCommand::class, Console\MakeThemeCommand::class]); + $this->commands([Console\InstallCommand::class, Console\DoctorCommand::class, Console\MakeThemeCommand::class, Console\ImportCommand::class]); } $this->registerGates($modules); @@ -82,13 +85,13 @@ class ManagerServiceProvider extends ServiceProvider // Outside `auth`, but behind the bans of the modules. Route::middleware(['web', ...$modules->middleware('before'), 'manager.shell']) ->prefix(config('manager.path')) - ->name('manager.') + ->name(Names::routePrefix()) ->group(fn () => $this->loadRoutesFrom(__DIR__.'/../routes/guest.php')); } Route::middleware([...$modules->middleware('before'), ...config('manager.middleware'), ...($screens ? ['manager.shell'] : []), ...$modules->middleware('after')]) ->prefix(config('manager.path')) - ->name('manager.') + ->name(Names::routePrefix()) ->group(function () use ($modules) { $this->loadRoutesFrom(__DIR__.'/../routes/manager.php'); diff --git a/src/Models/Group.php b/src/Models/Group.php index 3c1dd8f..6c17d7f 100644 --- a/src/Models/Group.php +++ b/src/Models/Group.php @@ -4,6 +4,7 @@ namespace IriksIT\Manager\Models; use Illuminate\Database\Eloquent\Relations\BelongsToMany; use IriksIT\Manager\Support\ModuleRegistry; +use IriksIT\Manager\Support\Names; /** * A set of permissions with a name ("Writers"). Accounts are put in groups; a group is the @@ -20,7 +21,7 @@ class Group extends Model public function users(): BelongsToMany { - return $this->belongsToMany(config('manager.user_model'), config('manager.table_prefix').'group_user', 'group_id', 'user_id'); + return $this->belongsToMany(config('manager.user_model'), Names::table('group_user'), 'group_id', 'user_id'); } /** diff --git a/src/Models/Media.php b/src/Models/Media.php index fd00012..7301b3b 100644 --- a/src/Models/Media.php +++ b/src/Models/Media.php @@ -3,6 +3,7 @@ namespace IriksIT\Manager\Models; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use IriksIT\Manager\Support\Names; /** * One file in the media library. The row is the bookkeeping; the file itself is stored on the @@ -14,7 +15,7 @@ class Media extends Model public function getTable(): string { - return config('manager.table_prefix').'media'; + return Names::table('media'); } protected function casts(): array diff --git a/src/Models/Model.php b/src/Models/Model.php index 4ad0091..617ed86 100644 --- a/src/Models/Model.php +++ b/src/Models/Model.php @@ -3,6 +3,7 @@ namespace IriksIT\Manager\Models; use Illuminate\Database\Eloquent\Model as Eloquent; +use IriksIT\Manager\Support\Names; /** Base of the package models: tables get the configured prefix, e.g. manager_pages. */ abstract class Model extends Eloquent @@ -11,6 +12,6 @@ abstract class Model extends Eloquent public function getTable(): string { - return $this->table ?? config('manager.table_prefix').parent::getTable(); + return $this->table ?? Names::table(parent::getTable()); } } diff --git a/src/Models/Page.php b/src/Models/Page.php index 66fa1ea..a9ee06c 100644 --- a/src/Models/Page.php +++ b/src/Models/Page.php @@ -2,4 +2,50 @@ namespace IriksIT\Manager\Models; -class Page extends Model {} +use IriksIT\Manager\Support\Fields; + +/** + * A page of the site. A page with a definition (config `manager.pages.definitions`) keeps its texts in + * `content`, one value per defined field; any other page keeps one text in `body`. + * + * The public site reads it with `Page::contentFor('home')`: the stored values over the defaults, so a page + * that was never saved still has all its keys. + */ +class Page extends Model +{ + protected function casts(): array + { + return ['content' => 'array', 'is_published' => 'boolean']; + } + + /** + * The definitions of the pages: slug => ['title' => ..., 'fields' => normalized fields]. + * + * @return array>}> + */ + public static function definitions(): array + { + $out = []; + + foreach ((array) config('manager.pages.definitions', []) as $slug => $definition) { + if (is_string($slug) && preg_match('/^[a-z0-9]+(?:-[a-z0-9]+)*$/', $slug) && is_array($definition)) { + $out[$slug] = ['title' => (string) ($definition['title'] ?? ucfirst(str_replace('-', ' ', $slug))), 'fields' => Fields::normalize((array) ($definition['fields'] ?? []))]; + } + } + + return $out; + } + + /** + * What the public site shows on a page: every defined key, stored or default. + * + * @return array + */ + public static function contentFor(string $slug): array + { + $fields = self::definitions()[$slug]['fields'] ?? []; + $page = self::query()->where('slug', $slug)->first(); + + return Fields::values($fields, is_array($page?->content) ? $page->content : []); + } +} diff --git a/src/Models/Record.php b/src/Models/Record.php new file mode 100644 index 0000000..a322098 --- /dev/null +++ b/src/Models/Record.php @@ -0,0 +1,12 @@ + 'array']; + } +} diff --git a/src/Models/Revision.php b/src/Models/Revision.php new file mode 100644 index 0000000..cfc0d48 --- /dev/null +++ b/src/Models/Revision.php @@ -0,0 +1,15 @@ + 'array', 'changed' => 'array']; + } +} diff --git a/src/Models/UserSetting.php b/src/Models/UserSetting.php index 0e18a5b..12423bc 100644 --- a/src/Models/UserSetting.php +++ b/src/Models/UserSetting.php @@ -3,14 +3,15 @@ namespace IriksIT\Manager\Models; use Illuminate\Database\Eloquent\Model; +use IriksIT\Manager\Support\Names; -/** What one account chose for itself in the manager (now: its theme). */ +/** What one account chose for itself in the manager (its theme and which face of the manager it looks at). */ class UserSetting extends Model { - protected $fillable = ['user_id', 'theme']; + protected $fillable = ['user_id', 'theme', 'view']; public function getTable(): string { - return config('manager.table_prefix').'user_settings'; + return Names::table('user_settings'); } } diff --git a/src/Modules/Audit/AuditController.php b/src/Modules/Audit/AuditController.php index ac7ef86..a0712bd 100644 --- a/src/Modules/Audit/AuditController.php +++ b/src/Modules/Audit/AuditController.php @@ -15,6 +15,7 @@ use IriksIT\Manager\Models\IpBan; use IriksIT\Manager\Models\IpNote; use IriksIT\Manager\Models\Post; use IriksIT\Manager\Support\AuditTrail; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\UserAgent; /** @@ -86,7 +87,7 @@ class AuditController 'type' => str_replace('_', ' ', (string) $entry->subject_type), 'label' => $entry->subject_label, 'url' => $entry->subject_type === 'post' && in_array($entry->subject_id, $posts, true) - ? route('manager.posts.edit', $entry->subject_id, false) + ? route(Names::route('posts.edit'), $entry->subject_id, false) : null, ], 'details' => $entry->details ?? [], @@ -170,7 +171,7 @@ class AuditController $this->trail->about($ban); } - return response()->json(['message' => $wholeSite ? "{$ip} is banned from the whole site." : "{$ip} is banned from the manager."], 201); + return response()->json(['message' => $wholeSite ? __(':ip is banned from the whole site.', ['ip' => $ip]) : __(':ip is banned from the manager.', ['ip' => $ip])], 201); } public function unban(int $ban): JsonResponse @@ -179,7 +180,7 @@ class AuditController $this->trail->about($ipBan); $this->bans->lift($ipBan); - return response()->json(['message' => "The ban of {$ipBan->ip} is lifted."]); + return response()->json(['message' => __('The ban of :ip is lifted.', ['ip' => $ipBan->ip])]); } /** Bans every address of a group at once, with the same time, reason and reach. */ @@ -257,7 +258,7 @@ class AuditController $note->delete(); } - return response()->json(['message' => "The note about {$ip} is removed."]); + return response()->json(['message' => __('The note about :ip is removed.', ['ip' => $ip])]); } $note ??= new IpNote(['ip' => $ip]); @@ -266,7 +267,7 @@ class AuditController $note->fill(['note' => $text, 'group_name' => $group !== '' ? $group : null, 'user_id' => $user?->getAuthIdentifier(), 'user_name' => is_string($name) ? $name : null])->save(); $this->trail->about($note); - return response()->json(['message' => "The note about {$ip} is saved."]); + return response()->json(['message' => __('The note about :ip is saved.', ['ip' => $ip])]); } public function settings(Request $request): JsonResponse @@ -283,12 +284,12 @@ class AuditController AuditSetting::current()->forceFill(['id' => 1, ...$rules])->save(); - return response()->json(['message' => 'Rules saved.', 'settings' => AuditSetting::current()->rules()]); + return response()->json(['message' => __('Rules saved.'), 'settings' => AuditSetting::current()->rules()]); } private function refuse(string $field, string $message): JsonResponse { - return response()->json(['message' => $message, 'errors' => [$field => [$message]]], 422); + return response()->json(['message' => $message = __($message), 'errors' => [$field => [$message]]], 422); } /** @@ -305,7 +306,7 @@ class AuditController */ private function existingPosts(array $ids): array { - if ($ids === [] || ! Route::has('manager.posts.edit')) { + if ($ids === [] || ! Route::has(Names::route('posts.edit'))) { return []; } diff --git a/src/Modules/Audit/AuditModule.php b/src/Modules/Audit/AuditModule.php index b7ac0fa..636421e 100644 --- a/src/Modules/Audit/AuditModule.php +++ b/src/Modules/Audit/AuditModule.php @@ -12,6 +12,7 @@ use Illuminate\Support\Facades\Event; use IriksIT\Manager\Models\AuditLog; use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Support\AuditTrail; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Permission; /** @@ -51,7 +52,7 @@ class AuditModule extends BaseModule public function navigation(): array { - return [['label' => 'Audit log', 'route' => 'manager.audit.index', 'permission' => 'audit.view']]; + return [['label' => 'Audit log', 'route' => Names::route('audit.index'), 'permission' => 'audit.view']]; } public function commands(): array @@ -114,13 +115,13 @@ class AuditModule extends BaseModule Event::listen(Login::class, function (Login $event) use ($model) { if ($event->user instanceof $model) { - app(AuditTrail::class)->record(AuditLog::LOGIN, 'Logged in', $event->user); + app(AuditTrail::class)->record(AuditLog::LOGIN, __('Logged in'), $event->user); } }); Event::listen(Logout::class, function (Logout $event) use ($model) { if ($event->user instanceof $model) { - app(AuditTrail::class)->record(AuditLog::LOGOUT, 'Logged out', $event->user); + app(AuditTrail::class)->record(AuditLog::LOGOUT, __('Logged out'), $event->user); } }); diff --git a/src/Modules/Audit/IpBans.php b/src/Modules/Audit/IpBans.php index 43fb7f8..95e4b7d 100644 --- a/src/Modules/Audit/IpBans.php +++ b/src/Modules/Audit/IpBans.php @@ -172,7 +172,7 @@ final class IpBans return null; } - $this->trail->record(AuditLog::BAN, 'The address was banned after too many failed logins', subject: $ban, details: ['failures' => $failures]); + $this->trail->record(AuditLog::BAN, __('The address was banned after too many failed logins'), subject: $ban, details: ['failures' => $failures]); return $ban; } diff --git a/src/Modules/Audit/RecordActions.php b/src/Modules/Audit/RecordActions.php index dbcf5e2..1b75c6c 100644 --- a/src/Modules/Audit/RecordActions.php +++ b/src/Modules/Audit/RecordActions.php @@ -13,6 +13,7 @@ use Illuminate\Support\Str; use IriksIT\Manager\Models\AuditLog; use IriksIT\Manager\Support\AuditTrail; use IriksIT\Manager\Support\ModuleRegistry; +use IriksIT\Manager\Support\Names; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Throwable; @@ -29,6 +30,9 @@ class RecordActions /** Opening the same page again within this time is not a new line. */ private const SAME_LOOK_MINUTES = 5; + /** Requests that only look at something while it is written: not an action, not worth a line. */ + private const SILENT = ['markdown.preview']; + public function __construct(private readonly AuditTrail $trail, private readonly ModuleRegistry $modules) {} /** @@ -50,18 +54,22 @@ class RecordActions private function write(Request $request, Response $response, Authenticatable $user, ?Model $subject): void { - $route = Str::after((string) $request->route()?->getName(), 'manager.'); + $route = Str::after((string) $request->route()?->getName(), Names::routePrefix()); $actions = $this->modules->actions(); $views = $this->modules->views(); $thrown = property_exists($response, 'exception') && $response->exception instanceof Throwable ? $response->exception : null; $details = $this->details($request, $actions[$route][1] ?? []); $name = $actions[$route][0] ?? ($views[$route] ?? ''); - $name = $name !== '' ? $name : 'Asked for '.$request->method().' /'.ltrim($request->path(), '/'); + $name = $name !== '' ? __($name) : __('Asked for :request', ['request' => $request->method().' /'.ltrim($request->path(), '/')]); + + if (in_array($route, self::SILENT, true)) { + return; + } if ($thrown !== null) { // Only a refusal is worth a line; a form with a mistake or a page that is not there is not. if ($thrown instanceof AuthorizationException || ($thrown instanceof HttpExceptionInterface && $thrown->getStatusCode() === 403)) { - $this->trail->record(AuditLog::REFUSED, 'Was not allowed: '.Str::lcfirst($name), $user, $subject, $details, $route); + $this->trail->record(AuditLog::REFUSED, __('Was not allowed: :what', ['what' => Str::lcfirst($name)]), $user, $subject, $details, $route); } return; @@ -74,7 +82,7 @@ class RecordActions $changes = ! in_array($request->method(), ['GET', 'HEAD', 'OPTIONS'], true); if (! $changes && ! isset($actions[$route])) { - $this->viewed($user, $route, $views[$route] ?? '', $subject, $details); + $this->viewed($user, $route, __($views[$route] ?? ''), $subject, $details); return; } diff --git a/src/Modules/Audit/RefuseBannedAddress.php b/src/Modules/Audit/RefuseBannedAddress.php index 0450e01..0418a4c 100644 --- a/src/Modules/Audit/RefuseBannedAddress.php +++ b/src/Modules/Audit/RefuseBannedAddress.php @@ -35,10 +35,10 @@ class RefuseBannedAddress /** The page (or JSON) a banned address gets, also for a ban on the whole site. */ public static function answer(Request $request, IpBan $ban): Response { - $where = $ban->whole_site ? 'this site' : 'the manager'; + $where = $ban->whole_site ? __('this site') : __('the manager'); $message = $ban->expires_at === null - ? "This address is blocked from {$where}." - : "This address is blocked from {$where} until ".$ban->expires_at->format('j F Y, H:i').'.'; + ? __('This address is blocked from :where.', ['where' => $where]) + : __('This address is blocked from :where until :when.', ['where' => $where, 'when' => $ban->expires_at->format('j F Y, H:i')]); // A ban that followed too many attempts is "429 Too Many Requests" and says when to come // back; one that was given by hand is a plain "403 Forbidden". diff --git a/src/Modules/Audit/migrations/2026_12_04_000003_create_manager_audit_tables.php b/src/Modules/Audit/migrations/2026_12_04_000003_create_manager_audit_tables.php index 8c6ad23..49b2c0b 100644 --- a/src/Modules/Audit/migrations/2026_12_04_000003_create_manager_audit_tables.php +++ b/src/Modules/Audit/migrations/2026_12_04_000003_create_manager_audit_tables.php @@ -3,16 +3,16 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; return new class extends Migration { public function up(): void { - $prefix = config('manager.table_prefix'); // Who did what in the manager, and every attempt to log in. A row stands on its own: the // name of the account is copied, so it stays readable after the account is deleted. - Schema::create($prefix.'audit_logs', function (Blueprint $table) { + Schema::create(Names::table('audit_logs'), function (Blueprint $table) { $table->id(); $table->string('event', 40)->index(); // The route that was called, for an action in the manager. @@ -32,7 +32,7 @@ return new class extends Migration }); // Addresses that are kept out of the manager, or off the whole site. - Schema::create($prefix.'ip_bans', function (Blueprint $table) { + Schema::create(Names::table('ip_bans'), function (Blueprint $table) { $table->id(); $table->string('ip', 45)->unique(); $table->string('reason')->nullable(); @@ -49,7 +49,7 @@ return new class extends Migration }); // One row (id 1) with the rules; without it the defaults of the model count. - Schema::create($prefix.'audit_settings', function (Blueprint $table) { + Schema::create(Names::table('audit_settings'), function (Blueprint $table) { $table->id(); $table->boolean('auto_ban')->default(true); $table->unsignedSmallInteger('max_failures')->default(10); @@ -59,7 +59,7 @@ return new class extends Migration $table->timestamps(); }); - Schema::create($prefix.'ip_notes', function (Blueprint $table) { + Schema::create(Names::table('ip_notes'), function (Blueprint $table) { $table->id(); $table->string('ip', 45)->unique(); // Addresses that belong together carry the same name here; null: no group. @@ -73,10 +73,9 @@ return new class extends Migration public function down(): void { - $prefix = config('manager.table_prefix'); foreach (['ip_notes', 'audit_settings', 'ip_bans', 'audit_logs'] as $table) { - Schema::dropIfExists($prefix.$table); + Schema::dropIfExists(Names::table($table)); } } }; diff --git a/src/Modules/Media/MediaController.php b/src/Modules/Media/MediaController.php index e5d66e3..2e00a43 100644 --- a/src/Modules/Media/MediaController.php +++ b/src/Modules/Media/MediaController.php @@ -49,7 +49,7 @@ class MediaController $room = $this->library->room(); if ($file->getSize() > $room['left']) { - $message = 'The media library is full: this file does not fit in the room that is left. Remove files that are no longer used, or raise manager.media.max_total_gb.'; + $message = __('The media library is full: this file does not fit in the room that is left. Remove files that are no longer used, or raise manager.media.max_total_gb.'); return response()->json(['message' => $message, 'errors' => ['file' => [$message]], 'storage' => $room], 422); } @@ -130,7 +130,7 @@ class MediaController { Log::warning('Media storage failed.', ['error' => $e->getMessage(), 'status' => $e->status]); - return response()->json(['message' => self::UNAVAILABLE], 502); + return response()->json(['message' => __(self::UNAVAILABLE)], 502); } /** @return array{max_file_mb: int, extensions: list, storage: array{used: int, limit: int, left: int}} */ diff --git a/src/Modules/Media/MediaModule.php b/src/Modules/Media/MediaModule.php index ba9e36c..2712642 100644 --- a/src/Modules/Media/MediaModule.php +++ b/src/Modules/Media/MediaModule.php @@ -6,6 +6,7 @@ use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Http\Request; use Illuminate\Support\Facades\RateLimiter; use IriksIT\Manager\Modules\BaseModule; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Permission; class MediaModule extends BaseModule @@ -43,7 +44,7 @@ class MediaModule extends BaseModule public function navigation(): array { return [ - ['label' => 'Media', 'route' => 'manager.media.index', 'permission' => 'media.view'], + ['label' => 'Media', 'route' => Names::route('media.index'), 'permission' => 'media.view'], ]; } diff --git a/src/Modules/Media/migrations/2026_12_04_000002_create_manager_media.php b/src/Modules/Media/migrations/2026_12_04_000002_create_manager_media.php index 3e22b1e..01a4123 100644 --- a/src/Modules/Media/migrations/2026_12_04_000002_create_manager_media.php +++ b/src/Modules/Media/migrations/2026_12_04_000002_create_manager_media.php @@ -3,6 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; return new class extends Migration { @@ -11,7 +12,7 @@ return new class extends Migration $users = (new (config('manager.user_model')))->getTable(); // The file itself is elsewhere: `disk` says where, `location` is its path there. - Schema::create(config('manager.table_prefix').'media', function (Blueprint $table) use ($users) { + Schema::create(Names::table('media'), function (Blueprint $table) use ($users) { $table->id(); $table->string('disk', 40); $table->string('location'); @@ -34,6 +35,6 @@ return new class extends Migration public function down(): void { - Schema::dropIfExists(config('manager.table_prefix').'media'); + Schema::dropIfExists(Names::table('media')); } }; diff --git a/src/Modules/Media/public-routes.php b/src/Modules/Media/public-routes.php index 6577da9..aa1433a 100644 --- a/src/Modules/Media/public-routes.php +++ b/src/Modules/Media/public-routes.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\Route; use IriksIT\Manager\Modules\Media\MediaFileController; +use IriksIT\Manager\Support\Names; // Files of the media library, for visitors. No session and no cookies: this is a file, not a // page, and the browser may cache it for good. The address ends in /view on purpose: web servers @@ -9,4 +10,4 @@ use IriksIT\Manager\Modules\Media\MediaFileController; Route::get('/media-files/{media}/{filename}/view', MediaFileController::class) ->whereNumber('media') ->middleware('throttle:media-files') - ->name('manager.media.file'); + ->name(Names::route('media.file')); diff --git a/src/Modules/Pages/PagesController.php b/src/Modules/Pages/PagesController.php index 7e0b8de..a2687b4 100644 --- a/src/Modules/Pages/PagesController.php +++ b/src/Modules/Pages/PagesController.php @@ -2,13 +2,121 @@ namespace IriksIT\Manager\Modules\Pages; +use Illuminate\Http\JsonResponse; +use Illuminate\Http\Request; +use Illuminate\Validation\Rule; use IriksIT\Manager\Models\Page; +use IriksIT\Manager\Support\AuditTrail; +use IriksIT\Manager\Support\Fields; +/** + * Pages: the ones a site defines (config `manager.pages.definitions`: a title and fields per slug) and free + * pages with one text. A defined page needs no setup: it is made the first time it is saved. + */ class PagesController { - /** First opzet: lists the records as JSON. The screens come with the frontend. */ - public function index() + private const SLUG = '[a-z0-9]+(?:-[a-z0-9]+)*'; + + public function index(): JsonResponse { - return response()->json(Page::query()->latest()->paginate(25)); + $definitions = Page::definitions(); + $stored = Page::query()->orderBy('title')->get()->keyBy('slug'); + $pages = []; + + foreach ($definitions as $slug => $definition) { + $pages[] = ['slug' => $slug, 'title' => $definition['title'], 'defined' => true, 'saved' => $stored->has($slug), 'updated_at' => $stored[$slug]->updated_at ?? null]; + } + + foreach ($stored as $slug => $page) { + if (! isset($definitions[$slug])) { + $pages[] = ['slug' => $slug, 'title' => $page->title, 'defined' => false, 'saved' => true, 'is_published' => $page->is_published, 'updated_at' => $page->updated_at]; + } + } + + return response()->json(['pages' => $pages]); + } + + public function show(string $slug): JsonResponse + { + return response()->json(['page' => $this->payload($slug)]); + } + + /** Makes a free page. A defined page is made by saving it. */ + public function store(Request $request): JsonResponse + { + $data = $request->validate([ + 'slug' => ['required', 'string', 'max:120', 'regex:/^'.self::SLUG.'$/', Rule::unique(Page::query()->getModel()->getTable(), 'slug'), Rule::notIn(array_keys(Page::definitions()))], + 'title' => ['required', 'string', 'max:255'], + ]); + + $page = Page::query()->create($data + ['is_published' => false]); + app(AuditTrail::class)->about($page); + + return response()->json(['page' => $this->payload($page->slug)], 201); + } + + public function update(Request $request, string $slug): JsonResponse + { + $definition = Page::definitions()[$slug] ?? null; + $page = Page::query()->where('slug', $slug)->first(); + abort_if($definition === null && $page === null, 404); + + $rules = [ + 'title' => ['required', 'string', 'max:255'], + 'meta_description' => ['nullable', 'string', 'max:255'], + ]; + + if ($definition !== null) { + $rules = [...$rules, 'content' => ['nullable', 'array'], ...Fields::rules($definition['fields'], 'content.')]; + } else { + $rules = [...$rules, 'body' => ['nullable', 'string', 'max:200000'], 'is_published' => ['boolean']]; + } + + $data = $request->validate($rules); + $values = ['title' => $data['title'], 'meta_description' => ($data['meta_description'] ?? '') ?: null]; + + if ($definition !== null) { + $values['content'] = Fields::clean($definition['fields'], (array) ($data['content'] ?? [])); + } else { + $values += ['body' => $data['body'] ?? null, 'is_published' => (bool) ($data['is_published'] ?? false)]; + } + + $page = $page ?? new Page(['slug' => $slug]); + $page->fill($values)->save(); + app(AuditTrail::class)->about($page); + + return response()->json(['page' => $this->payload($slug)]); + } + + /** Removes a free page; a defined page stays (its values go back to the defaults when it is emptied by saving). */ + public function destroy(string $slug): JsonResponse + { + abort_if(isset(Page::definitions()[$slug]), 422, __('A page with fields of its own cannot be removed.')); + + $page = Page::query()->where('slug', $slug)->firstOrFail(); + app(AuditTrail::class)->about($page); + $page->delete(); + + return response()->json(['deleted' => true]); + } + + /** @return array */ + private function payload(string $slug): array + { + $definition = Page::definitions()[$slug] ?? null; + $page = Page::query()->where('slug', $slug)->first(); + abort_if($definition === null && $page === null, 404); + + return [ + 'id' => $page?->id, + 'slug' => $slug, + 'title' => $page->title ?? $definition['title'], + 'meta_description' => $page->meta_description ?? '', + 'defined' => $definition !== null, + 'fields' => array_values($definition['fields'] ?? []), + 'content' => $definition !== null ? Fields::values($definition['fields'], is_array($page?->content) ? $page->content : []) : null, + 'body' => $definition === null ? (string) $page->body : null, + 'is_published' => $definition === null ? (bool) $page->is_published : null, + ]; } } diff --git a/src/Modules/Pages/PagesModule.php b/src/Modules/Pages/PagesModule.php index d6c3a33..b9f7d76 100644 --- a/src/Modules/Pages/PagesModule.php +++ b/src/Modules/Pages/PagesModule.php @@ -5,6 +5,7 @@ namespace IriksIT\Manager\Modules\Pages; use IriksIT\Manager\Models\Page; use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Support\MediaUsage; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Permission; class PagesModule extends BaseModule @@ -39,18 +40,27 @@ class PagesModule extends BaseModule public function navigation(): array { return [ - ['label' => 'Pages', 'route' => 'manager.pages.index', 'permission' => 'pages.edit'], + ['label' => 'Pages', 'route' => Names::route('pages.index'), 'permission' => 'pages.edit'], ]; } /** Where the media library looks for the use of a file: the texts of the pages. */ public function views(): array { - return ['pages.index' => 'Opened the pages']; + return ['pages.index' => 'Opened the pages', 'pages.show' => 'Opened a page']; + } + + public function actions(): array + { + return [ + 'pages.store' => ['Created a page'], + 'pages.update' => ['Changed a page'], + 'pages.destroy' => ['Removed a page'], + ]; } public function boot(): void { - app(MediaUsage::class)->register(fn () => Page::query()->get(['body'])->flatMap(fn (Page $row) => array_values($row->only(['body'])))); + app(MediaUsage::class)->register(fn () => Page::query()->get(['body', 'content'])->flatMap(fn (Page $row) => [$row->body, ...array_values(array_filter((array) $row->content, 'is_string'))])); } } diff --git a/src/Modules/Pages/migrations/2026_12_04_000002_create_manager_pages.php b/src/Modules/Pages/migrations/2026_12_04_000002_create_manager_pages.php index 6f16a33..beb594a 100644 --- a/src/Modules/Pages/migrations/2026_12_04_000002_create_manager_pages.php +++ b/src/Modules/Pages/migrations/2026_12_04_000002_create_manager_pages.php @@ -3,12 +3,13 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; return new class extends Migration { public function up(): void { - Schema::create(config('manager.table_prefix').'pages', function (Blueprint $table) { + Schema::create(Names::table('pages'), function (Blueprint $table) { $table->id(); $table->string('slug')->unique(); $table->string('title'); @@ -20,6 +21,6 @@ return new class extends Migration public function down(): void { - Schema::dropIfExists(config('manager.table_prefix').'pages'); + Schema::dropIfExists(Names::table('pages')); } }; diff --git a/src/Modules/Pages/migrations/2026_12_06_000001_add_content_to_manager_pages.php b/src/Modules/Pages/migrations/2026_12_06_000001_add_content_to_manager_pages.php new file mode 100644 index 0000000..fd57e9f --- /dev/null +++ b/src/Modules/Pages/migrations/2026_12_06_000001_add_content_to_manager_pages.php @@ -0,0 +1,25 @@ +string('meta_description', 255)->nullable()->after('title'); + $table->json('content')->nullable()->after('body'); + }); + } + + public function down(): void + { + Schema::table(Names::table('pages'), function (Blueprint $table) { + $table->dropColumn(['meta_description', 'content']); + }); + } +}; diff --git a/src/Modules/Pages/routes.php b/src/Modules/Pages/routes.php index 3dae8d8..f226379 100644 --- a/src/Modules/Pages/routes.php +++ b/src/Modules/Pages/routes.php @@ -3,4 +3,10 @@ use Illuminate\Support\Facades\Route; use IriksIT\Manager\Modules\Pages\PagesController; -Route::get('/pages', [PagesController::class, 'index'])->name('pages.index')->middleware('can:pages.edit'); +Route::middleware('can:pages.edit')->group(function () { + Route::get('/pages', [PagesController::class, 'index'])->name('pages.index'); + Route::post('/pages', [PagesController::class, 'store'])->name('pages.store'); + Route::get('/pages/{slug}', [PagesController::class, 'show'])->name('pages.show')->where('slug', '[a-z0-9]+(?:-[a-z0-9]+)*'); + Route::put('/pages/{slug}', [PagesController::class, 'update'])->name('pages.update')->where('slug', '[a-z0-9]+(?:-[a-z0-9]+)*'); + Route::delete('/pages/{slug}', [PagesController::class, 'destroy'])->name('pages.destroy')->where('slug', '[a-z0-9]+(?:-[a-z0-9]+)*'); +}); diff --git a/src/Modules/Posts/LabelController.php b/src/Modules/Posts/LabelController.php index e42d4a7..c91db84 100644 --- a/src/Modules/Posts/LabelController.php +++ b/src/Modules/Posts/LabelController.php @@ -28,7 +28,7 @@ class LabelController $name = $request->string('name')->trim()->toString(); if (! $this->labels->create($type, $name)) { - return response()->json(['message' => "The {$type} \"{$name}\" already exists.", 'errors' => ['name' => ["The {$type} \"{$name}\" already exists."]]], 422); + return response()->json(['message' => $already = __('The :type ":name" already exists.', ['type' => __($type), 'name' => $name]), 'errors' => ['name' => [$already]]], 422); } return response()->json(['created' => $name], 201); diff --git a/src/Modules/Posts/PostController.php b/src/Modules/Posts/PostController.php index 577eaa5..1746c97 100644 --- a/src/Modules/Posts/PostController.php +++ b/src/Modules/Posts/PostController.php @@ -10,6 +10,7 @@ use Illuminate\Validation\Rule; use IriksIT\Manager\Models\Post; use IriksIT\Manager\Support\AuditTrail; use IriksIT\Manager\Support\Markdown; +use IriksIT\Manager\Support\Names; /** * The posts. A post that is live or scheduled is only changed or deleted by who may publish: a @@ -137,7 +138,7 @@ class PostController { $request->validate([ 'title' => ['required', 'string', 'max:255'], - 'slug' => ['nullable', 'string', 'max:255', 'regex:/^[a-z0-9]+(?:-[a-z0-9]+)*$/', Rule::unique(config('manager.table_prefix').'posts', 'slug')->ignore($post?->id)], + 'slug' => ['nullable', 'string', 'max:255', 'regex:/^[a-z0-9]+(?:-[a-z0-9]+)*$/', Rule::unique(Names::table('posts'), 'slug')->ignore($post?->id)], 'excerpt' => ['nullable', 'string', 'max:500'], 'body' => ['required', 'string'], 'cover_image' => ['nullable', 'string', 'max:2048'], diff --git a/src/Modules/Posts/PostLabels.php b/src/Modules/Posts/PostLabels.php index 71ffd3a..bcd0f4a 100644 --- a/src/Modules/Posts/PostLabels.php +++ b/src/Modules/Posts/PostLabels.php @@ -5,6 +5,7 @@ namespace IriksIT\Manager\Modules\Posts; use Closure; use Illuminate\Support\Facades\DB; use IriksIT\Manager\Models\Post; +use IriksIT\Manager\Support\Names; /** * The categories and tags of the posts, for managing them in one place. A category is the @@ -49,7 +50,7 @@ class PostLabels private function table(): string { - return config('manager.table_prefix').'post_labels'; + return Names::table('post_labels'); } /** diff --git a/src/Modules/Posts/PostsModule.php b/src/Modules/Posts/PostsModule.php index af32646..a0b44fb 100644 --- a/src/Modules/Posts/PostsModule.php +++ b/src/Modules/Posts/PostsModule.php @@ -5,6 +5,7 @@ namespace IriksIT\Manager\Modules\Posts; use IriksIT\Manager\Models\Post; use IriksIT\Manager\Modules\BaseModule; use IriksIT\Manager\Support\MediaUsage; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Permission; class PostsModule extends BaseModule @@ -43,8 +44,8 @@ class PostsModule extends BaseModule public function navigation(): array { return [ - ['label' => 'Posts', 'route' => 'manager.posts.index', 'permission' => 'posts.view'], - ['label' => 'Categories and tags', 'route' => 'manager.labels.index', 'permission' => 'posts.labels'], + ['label' => 'Posts', 'route' => Names::route('posts.index'), 'permission' => 'posts.view'], + ['label' => 'Categories and tags', 'route' => Names::route('labels.index'), 'permission' => 'posts.labels'], ]; } diff --git a/src/Modules/Posts/migrations/2026_12_04_000002_create_manager_posts.php b/src/Modules/Posts/migrations/2026_12_04_000002_create_manager_posts.php index 7a14923..0c81595 100644 --- a/src/Modules/Posts/migrations/2026_12_04_000002_create_manager_posts.php +++ b/src/Modules/Posts/migrations/2026_12_04_000002_create_manager_posts.php @@ -3,14 +3,14 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; return new class extends Migration { public function up(): void { - $prefix = config('manager.table_prefix'); - Schema::create($prefix.'posts', function (Blueprint $table) { + Schema::create(Names::table('posts'), function (Blueprint $table) { $table->id(); $table->string('title'); $table->string('slug')->unique(); @@ -27,7 +27,7 @@ return new class extends Migration // Categories and tags that were made by hand, so one can exist before a post uses it. // The ones a post uses are in the post itself; this only remembers names to offer. - Schema::create($prefix.'post_labels', function (Blueprint $table) { + Schema::create(Names::table('post_labels'), function (Blueprint $table) { $table->id(); $table->string('type', 10); $table->string('name', 60); @@ -39,9 +39,8 @@ return new class extends Migration public function down(): void { - $prefix = config('manager.table_prefix'); - Schema::dropIfExists($prefix.'post_labels'); - Schema::dropIfExists($prefix.'posts'); + Schema::dropIfExists(Names::table('post_labels')); + Schema::dropIfExists(Names::table('posts')); } }; diff --git a/src/Modules/Resources/ResourceController.php b/src/Modules/Resources/ResourceController.php new file mode 100644 index 0000000..19170c0 --- /dev/null +++ b/src/Modules/Resources/ResourceController.php @@ -0,0 +1,108 @@ +resource($resource, 'view'); + $page = Resources::query($def)->paginate($def['per_page']); + + return response()->json([ + 'resource' => $this->describe($def), + 'rows' => $page->getCollection()->map(fn (Model $model) => Resources::row($def, $model))->values(), + 'current_page' => $page->currentPage(), + 'last_page' => $page->lastPage(), + ]); + } + + public function create(string $resource): JsonResponse + { + $def = $this->resource($resource, 'manage'); + + return response()->json(['resource' => $this->describe($def), 'record' => ['id' => null, 'values' => Fields::values($def['fields'], [])]]); + } + + public function edit(string $resource, string $id): JsonResponse + { + $def = $this->resource($resource, 'manage'); + + return response()->json(['resource' => $this->describe($def), 'record' => Resources::row($def, $this->record($def, $id))]); + } + + public function store(Request $request, string $resource): JsonResponse + { + $def = $this->resource($resource, 'manage'); + $model = Resources::save($def, null, $this->values($request, $def)); + app(AuditTrail::class)->about($model); + + return response()->json(['record' => Resources::row($def, $model)], 201); + } + + public function update(Request $request, string $resource, string $id): JsonResponse + { + $def = $this->resource($resource, 'manage'); + $model = Resources::save($def, $this->record($def, $id), $this->values($request, $def)); + app(AuditTrail::class)->about($model); + + return response()->json(['record' => Resources::row($def, $model)]); + } + + public function destroy(string $resource, string $id): JsonResponse + { + $def = $this->resource($resource, 'manage'); + $model = $this->record($def, $id); + app(AuditTrail::class)->about($model); + $model->delete(); + + return response()->json(['deleted' => true]); + } + + /** @return array */ + private function resource(string $key, string $ability): array + { + $def = Resources::find($key); + abort_if($def === null, 404); + Gate::authorize($key.'.'.$ability); + + return $def; + } + + /** @param array $def */ + private function record(array $def, string $id): Model + { + return Resources::record($def, $id) ?? abort(404); + } + + /** + * @param array $def + * @return array + */ + private function values(Request $request, array $def): array + { + $data = $request->validate(Fields::rules($def['fields'])); + + return Fields::clean($def['fields'], $data); + } + + /** + * @param array $def + * @return array + */ + private function describe(array $def): array + { + return [ + 'key' => $def['key'], 'label' => $def['label'], 'singular' => $def['singular'], 'columns' => $def['columns'], + 'fields' => array_values($def['fields']), 'can_manage' => Gate::allows($def['key'].'.manage'), + ]; + } +} diff --git a/src/Modules/Resources/ResourcesModule.php b/src/Modules/Resources/ResourcesModule.php new file mode 100644 index 0000000..6227bdf --- /dev/null +++ b/src/Modules/Resources/ResourcesModule.php @@ -0,0 +1,69 @@ + $resource) { + $permissions[] = new Permission($key.'.view', __('See :label', ['label' => $resource['label']]), $resource['label']); + $permissions[] = new Permission($key.'.manage', __('Add, change and delete :label', ['label' => $resource['label']]), $resource['label'], needs: [$key.'.view']); + } + + return $permissions; + } + + public function navigation(): array + { + return array_values(array_map( + fn (array $resource) => ['id' => 'records.'.$resource['key'], 'label' => $resource['label'], 'route' => Names::route('records.index'), 'params' => ['resource' => $resource['key']], 'permission' => $resource['key'].'.view'], + Resources::all(), + )); + } + + public function actions(): array + { + return [ + 'records.store' => ['Added a record'], + 'records.update' => ['Changed a record'], + 'records.destroy' => ['Removed a record'], + ]; + } + + public function views(): array + { + return ['records.index' => 'Opened a list', 'records.create' => 'Opened the form for a new record', 'records.edit' => 'Opened a record']; + } +} diff --git a/src/Modules/Resources/migrations/2026_12_06_000001_create_manager_records.php b/src/Modules/Resources/migrations/2026_12_06_000001_create_manager_records.php new file mode 100644 index 0000000..987f0d9 --- /dev/null +++ b/src/Modules/Resources/migrations/2026_12_06_000001_create_manager_records.php @@ -0,0 +1,24 @@ +id(); + $table->string('resource', 40)->index(); + $table->json('data')->nullable(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists(Names::table('records')); + } +}; diff --git a/src/Modules/Resources/routes.php b/src/Modules/Resources/routes.php new file mode 100644 index 0000000..3069e52 --- /dev/null +++ b/src/Modules/Resources/routes.php @@ -0,0 +1,14 @@ +.view` and `.manage`. +Route::prefix('/records/{resource}')->where(['resource' => '[a-z][a-z0-9_]*', 'id' => '[0-9]+'])->group(function () { + Route::get('/', [ResourceController::class, 'index'])->name('records.index'); + Route::get('/create', [ResourceController::class, 'create'])->name('records.create'); + Route::post('/', [ResourceController::class, 'store'])->name('records.store'); + Route::get('/{id}/edit', [ResourceController::class, 'edit'])->name('records.edit'); + Route::put('/{id}', [ResourceController::class, 'update'])->name('records.update'); + Route::delete('/{id}', [ResourceController::class, 'destroy'])->name('records.destroy'); +}); diff --git a/src/Modules/Reviews/ReviewsModule.php b/src/Modules/Reviews/ReviewsModule.php index e09ecc6..0bc86e4 100644 --- a/src/Modules/Reviews/ReviewsModule.php +++ b/src/Modules/Reviews/ReviewsModule.php @@ -3,6 +3,7 @@ namespace IriksIT\Manager\Modules\Reviews; use IriksIT\Manager\Modules\BaseModule; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Permission; class ReviewsModule extends BaseModule @@ -37,7 +38,7 @@ class ReviewsModule extends BaseModule public function navigation(): array { return [ - ['label' => 'Reviews', 'route' => 'manager.reviews.index', 'permission' => 'reviews.manage'], + ['label' => 'Reviews', 'route' => Names::route('reviews.index'), 'permission' => 'reviews.manage'], ]; } diff --git a/src/Modules/Reviews/migrations/2026_12_04_000002_create_manager_reviews.php b/src/Modules/Reviews/migrations/2026_12_04_000002_create_manager_reviews.php index 330ec4e..a261d2a 100644 --- a/src/Modules/Reviews/migrations/2026_12_04_000002_create_manager_reviews.php +++ b/src/Modules/Reviews/migrations/2026_12_04_000002_create_manager_reviews.php @@ -3,12 +3,13 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; return new class extends Migration { public function up(): void { - Schema::create(config('manager.table_prefix').'reviews', function (Blueprint $table) { + Schema::create(Names::table('reviews'), function (Blueprint $table) { $table->id(); $table->string('author'); $table->string('place')->nullable(); @@ -21,6 +22,6 @@ return new class extends Migration public function down(): void { - Schema::dropIfExists(config('manager.table_prefix').'reviews'); + Schema::dropIfExists(Names::table('reviews')); } }; diff --git a/src/Modules/Revisions/RevisionController.php b/src/Modules/Revisions/RevisionController.php new file mode 100644 index 0000000..7727f39 --- /dev/null +++ b/src/Modules/Revisions/RevisionController.php @@ -0,0 +1,65 @@ +find($type, $id, 'view'); + + $revisions = Revision::query()->where('type', $type)->where('subject_id', $model->getKey())->orderByDesc('id')->limit(100)->get(); + + return response()->json([ + 'revisions' => $revisions->map(fn (Revision $revision, int $position) => [ + 'id' => $revision->id, + 'created_at' => $revision->created_at, + 'user' => $revision->user_name, + 'changed' => $revision->changed ?? [], + 'current' => $position === 0, + // What the changed attributes were then, shortened: enough to see what an old version said. + 'values' => collect($revision->changed ?? [])->mapWithKeys(fn (string $key) => [$key => $this->shorten($revision->data[$key] ?? null)])->all(), + ])->values(), + 'can_restore' => Gate::allows('revisions.restore') && Gate::allows($config['restore']), + ]); + } + + public function restore(string $type, string $id, string $revision): JsonResponse + { + [$config, $model] = $this->find($type, $id, 'restore'); + $revision = Revision::query()->where('type', $type)->where('subject_id', $model->getKey())->whereKey($revision)->firstOrFail(); + + // A post that is on the site is only changed by someone who may publish. + abort_if($model instanceof Post && $model->isPublished() && Gate::denies('posts.publish'), 403); + + app(AuditTrail::class)->about($model); + Revisions::restore($model, $revision, $config); + + return response()->json(['restored' => true]); + } + + /** @return array{0: array{model: class-string, view: string, restore: string, except: list}, 1: Model} */ + private function find(string $type, string $id, string $ability): array + { + $config = Revisions::types()[$type] ?? null; + abort_if($config === null, 404); + Gate::authorize($config[$ability]); + + return [$config, $config['model']::query()->findOrFail($id)]; + } + + private function shorten(mixed $value): mixed + { + $text = is_scalar($value) || $value === null ? (string) $value : json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + + return mb_strlen($text) > 300 ? mb_substr($text, 0, 300).'…' : $text; + } +} diff --git a/src/Modules/Revisions/RevisionsModule.php b/src/Modules/Revisions/RevisionsModule.php new file mode 100644 index 0000000..ef5820b --- /dev/null +++ b/src/Modules/Revisions/RevisionsModule.php @@ -0,0 +1,54 @@ + ['Put an earlier version back']]; + } + + public function views(): array + { + return ['revisions.index' => 'Opened the history of a text']; + } + + public function boot(): void + { + Revisions::listen(); + } +} diff --git a/src/Modules/Revisions/migrations/2026_12_06_000001_create_manager_revisions.php b/src/Modules/Revisions/migrations/2026_12_06_000001_create_manager_revisions.php new file mode 100644 index 0000000..028a0a0 --- /dev/null +++ b/src/Modules/Revisions/migrations/2026_12_06_000001_create_manager_revisions.php @@ -0,0 +1,31 @@ +id(); + $table->string('type', 40); + $table->unsignedBigInteger('subject_id'); + // Who saved it: no foreign key, so the history stays when an account is removed. + $table->unsignedBigInteger('user_id')->nullable(); + $table->string('user_name')->nullable(); + $table->json('data'); + $table->json('changed')->nullable(); + $table->dateTime('created_at'); + + $table->index(['type', 'subject_id', 'id']); + }); + } + + public function down(): void + { + Schema::dropIfExists(Names::table('revisions')); + } +}; diff --git a/src/Modules/Revisions/routes.php b/src/Modules/Revisions/routes.php new file mode 100644 index 0000000..d141f2f --- /dev/null +++ b/src/Modules/Revisions/routes.php @@ -0,0 +1,10 @@ +prefix('/revisions/{type}/{id}')->where(['type' => '[a-z][a-z0-9_]*', 'id' => '[0-9]+', 'revision' => '[0-9]+'])->group(function () { + Route::get('/', [RevisionController::class, 'index'])->name('revisions.index'); + Route::post('/{revision}/restore', [RevisionController::class, 'restore'])->name('revisions.restore')->middleware('can:revisions.restore'); +}); diff --git a/src/Modules/Statistics/BotRecorder.php b/src/Modules/Statistics/BotRecorder.php index ba95cb7..b1bb119 100644 --- a/src/Modules/Statistics/BotRecorder.php +++ b/src/Modules/Statistics/BotRecorder.php @@ -4,6 +4,7 @@ namespace IriksIT\Manager\Modules\Statistics; use Illuminate\Support\Facades\DB; use Illuminate\Support\Str; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\UserAgent; /** @@ -30,7 +31,7 @@ final class BotRecorder /** Counts one page that was served to a program. Does nothing for a person. */ public function hit(string $userAgent, string $path): void { - $table = config('manager.table_prefix').'bot_hits'; + $table = Names::table('bot_hits'); $bot = (new UserAgent($userAgent))->bot(); if ($bot === null) { diff --git a/src/Modules/Statistics/CountBots.php b/src/Modules/Statistics/CountBots.php index fdcb51e..ae251fd 100644 --- a/src/Modules/Statistics/CountBots.php +++ b/src/Modules/Statistics/CountBots.php @@ -4,6 +4,7 @@ namespace IriksIT\Manager\Modules\Statistics; use Closure; use Illuminate\Http\Request; +use IriksIT\Manager\Support\Names; use Symfony\Component\HttpFoundation\Response; use Throwable; @@ -42,7 +43,7 @@ class CountBots return $request->isMethod('GET') && $response->getStatusCode() === 200 && is_string($name) - && ! str_starts_with($name, 'manager.') + && ! str_starts_with($name, Names::routePrefix()) // The same promise as for visitors: who asks not to be followed is not counted at all. && $request->header('Sec-GPC') !== '1' && $request->header('DNT') !== '1'; diff --git a/src/Modules/Statistics/PulseController.php b/src/Modules/Statistics/PulseController.php index 2c1984c..d92ea17 100644 --- a/src/Modules/Statistics/PulseController.php +++ b/src/Modules/Statistics/PulseController.php @@ -5,6 +5,7 @@ namespace IriksIT\Manager\Modules\Statistics; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Symfony\Component\HttpFoundation\BinaryFileResponse; /** * Where the public pages report a page view and the time spent on it. These routes run without @@ -12,6 +13,16 @@ use Illuminate\Http\Response; */ class PulseController { + /** The script of the public pages (`` puts it in the page). */ + public function script(): BinaryFileResponse + { + return response()->file(__DIR__.'/../../../resources/js/pulse.js', [ + 'Content-Type' => 'application/javascript', + 'Cache-Control' => 'public, max-age=3600', + 'X-Content-Type-Options' => 'nosniff', + ]); + } + public function view(Request $request, VisitRecorder $recorder): JsonResponse { // A browser that says its user does not want to be followed is not counted at all. diff --git a/src/Modules/Statistics/Statistics.php b/src/Modules/Statistics/Statistics.php index e05336b..9ce0f16 100644 --- a/src/Modules/Statistics/Statistics.php +++ b/src/Modules/Statistics/Statistics.php @@ -7,6 +7,7 @@ use Illuminate\Database\Query\Builder; use Illuminate\Support\Facades\DB; use IriksIT\Manager\Facades\Manager; use IriksIT\Manager\Models\Post; +use IriksIT\Manager\Support\Names; /** * The numbers of the visitor statistics, for the manager. The only code that @@ -735,7 +736,7 @@ final class Statistics /** A count or sum as the database gives it (int, numeric string or null). */ private function table(string $name): string { - return config('manager.table_prefix').$name; + return Names::table($name); } private static function number(mixed $value): int diff --git a/src/Modules/Statistics/StatisticsModule.php b/src/Modules/Statistics/StatisticsModule.php index 8f7c11b..cb610d4 100644 --- a/src/Modules/Statistics/StatisticsModule.php +++ b/src/Modules/Statistics/StatisticsModule.php @@ -8,6 +8,7 @@ use Illuminate\Contracts\Http\Kernel; use Illuminate\Http\Request; use Illuminate\Support\Facades\RateLimiter; use IriksIT\Manager\Modules\BaseModule; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Permission; /** @@ -45,7 +46,7 @@ class StatisticsModule extends BaseModule public function navigation(): array { - return [['label' => 'Statistics', 'route' => 'manager.statistics.index', 'permission' => 'statistics.view']]; + return [['label' => 'Statistics', 'route' => Names::route('statistics.index'), 'permission' => 'statistics.view']]; } public function commands(): array diff --git a/src/Modules/Statistics/migrations/2026_12_04_000004_create_manager_statistics_tables.php b/src/Modules/Statistics/migrations/2026_12_04_000004_create_manager_statistics_tables.php index 9cc43b3..78020c9 100644 --- a/src/Modules/Statistics/migrations/2026_12_04_000004_create_manager_statistics_tables.php +++ b/src/Modules/Statistics/migrations/2026_12_04_000004_create_manager_statistics_tables.php @@ -3,6 +3,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; /** * The site's own visitor statistics. No cookie and no IP address: a visitor is a code made of the @@ -18,16 +19,15 @@ return new class extends Migration { public function up(): void { - $prefix = config('manager.table_prefix'); // The random key of a day. Yesterday's row is deleted: see VisitorSalt. - Schema::create($prefix.'visitor_salts', function (Blueprint $table) { + Schema::create(Names::table('visitor_salts'), function (Blueprint $table) { $table->date('day')->primary(); $table->string('salt', 64); }); // One visit: the pages someone looks at with less than half an hour between them. - Schema::create($prefix.'visits', function (Blueprint $table) { + Schema::create(Names::table('visits'), function (Blueprint $table) { $table->id(); $table->string('visitor_hash', 64); $table->dateTime('started_at'); @@ -54,11 +54,11 @@ return new class extends Migration $table->index(['visitor_hash', 'last_seen_at']); }); - Schema::create($prefix.'page_views', function (Blueprint $table) use ($prefix) { + Schema::create(Names::table('page_views'), function (Blueprint $table) { $table->id(); // What the browser sends back when the visitor leaves the page, to report the time spent. $table->string('token', 40)->unique(); - $table->foreignId('visit_id')->constrained($prefix.'visits')->cascadeOnDelete(); + $table->foreignId('visit_id')->constrained(Names::table('visits'))->cascadeOnDelete(); $table->string('path'); // The post behind the page, when the posts module is on. No foreign key: posts may be off. $table->unsignedBigInteger('post_id')->nullable(); @@ -73,7 +73,7 @@ return new class extends Migration // How often each program (search engine, AI crawler, link preview, ...) fetched each page, per // day. A counter, not a log: no address, no browser line. - Schema::create($prefix.'bot_hits', function (Blueprint $table) { + Schema::create(Names::table('bot_hits'), function (Blueprint $table) { $table->id(); $table->date('day'); $table->string('bot', 60); @@ -88,10 +88,9 @@ return new class extends Migration public function down(): void { - $prefix = config('manager.table_prefix'); foreach (['bot_hits', 'page_views', 'visits', 'visitor_salts'] as $table) { - Schema::dropIfExists($prefix.$table); + Schema::dropIfExists(Names::table($table)); } } }; diff --git a/src/Modules/Statistics/public-routes.php b/src/Modules/Statistics/public-routes.php index dcc0140..da80677 100644 --- a/src/Modules/Statistics/public-routes.php +++ b/src/Modules/Statistics/public-routes.php @@ -2,9 +2,13 @@ use Illuminate\Support\Facades\Route; use IriksIT\Manager\Modules\Statistics\PulseController; +use IriksIT\Manager\Support\Names; // Visitors of the public site report a page view here. No session, no cookies. +// The script that does the reporting, and the component that puts it in a page: . +Route::get(trim((string) config('manager.statistics.pulse_path', 'pulse'), '/').'/pulse.js', [PulseController::class, 'script'])->name(Names::route('pulse.script')); + Route::prefix(trim((string) config('manager.statistics.pulse_path', 'pulse'), '/'))->middleware('throttle:manager-pulse')->group(function () { - Route::post('/view', [PulseController::class, 'view'])->name('manager.pulse.view'); - Route::post('/leave', [PulseController::class, 'leave'])->name('manager.pulse.leave'); + Route::post('/view', [PulseController::class, 'view'])->name(Names::route('pulse.view')); + Route::post('/leave', [PulseController::class, 'leave'])->name(Names::route('pulse.leave')); }); diff --git a/src/Modules/Users/AccountController.php b/src/Modules/Users/AccountController.php index 3e4d149..e9a5f9a 100644 --- a/src/Modules/Users/AccountController.php +++ b/src/Modules/Users/AccountController.php @@ -103,7 +103,7 @@ class AccountController app(AuditTrail::class)->about($user); if ($user->is($me)) { - return response()->json(['message' => 'You cannot delete your own account.'], 422); + return response()->json(['message' => __('You cannot delete your own account.')], 422); } $user->managerGroups()->detach(); @@ -144,7 +144,7 @@ class AccountController $email = $request->string('email')->trim()->lower()->toString(); if ($this->model()::query()->where('email', $email)->when($user !== null, fn ($query) => $query->whereKeyNot($user->getKey()))->exists()) { - throw ValidationException::withMessages(['email' => 'Another account already uses this email address.']); + throw ValidationException::withMessages(['email' => __('Another account already uses this email address.')]); } return ['name' => $request->string('name')->trim()->toString(), 'email' => $email]; @@ -163,7 +163,7 @@ class AccountController $groups = Group::query()->whereKey($ids)->get(); if ($groups->count() !== count($ids) || $groups->contains(fn (Group $group) => ! $me->managerMayGive($group))) { - throw ValidationException::withMessages(['groups' => 'You can only choose groups that allow nothing more than your own account.']); + throw ValidationException::withMessages(['groups' => __('You can only choose groups that allow nothing more than your own account.')]); } return $ids; diff --git a/src/Modules/Users/GroupController.php b/src/Modules/Users/GroupController.php index 3117ad3..004f74f 100644 --- a/src/Modules/Users/GroupController.php +++ b/src/Modules/Users/GroupController.php @@ -8,6 +8,7 @@ use Illuminate\Validation\Rule; use IriksIT\Manager\Models\Group; use IriksIT\Manager\Support\AuditTrail; use IriksIT\Manager\Support\ModuleRegistry; +use IriksIT\Manager\Support\Names; /** The groups and what each allows. Only for a super admin (the `groups.manage` gate). */ class GroupController @@ -59,7 +60,7 @@ class GroupController /** @return array{name: string, description: string|null, permissions: list} */ private function validated(Request $request, ?Group $group = null): array { - $table = config('manager.table_prefix').'groups'; + $table = Names::table('groups'); $request->validate([ 'name' => ['required', 'string', 'max:60', Rule::unique($table, 'name')->ignore($group?->id)], diff --git a/src/Modules/Users/UsersModule.php b/src/Modules/Users/UsersModule.php index fcda472..2f62b8f 100644 --- a/src/Modules/Users/UsersModule.php +++ b/src/Modules/Users/UsersModule.php @@ -3,6 +3,7 @@ namespace IriksIT\Manager\Modules\Users; use IriksIT\Manager\Modules\BaseModule; +use IriksIT\Manager\Support\Names; use IriksIT\Manager\Support\Permission; class UsersModule extends BaseModule @@ -37,8 +38,8 @@ class UsersModule extends BaseModule public function navigation(): array { return [ - ['label' => 'Accounts', 'route' => 'manager.accounts.index', 'permission' => 'accounts.manage'], - ['label' => 'Groups', 'route' => 'manager.groups.index', 'permission' => 'groups.manage'], + ['label' => 'Accounts', 'route' => Names::route('accounts.index'), 'permission' => 'accounts.manage'], + ['label' => 'Groups', 'route' => Names::route('groups.index'), 'permission' => 'groups.manage'], ]; } diff --git a/src/Modules/Users/migrations/2026_12_04_000001_create_manager_groups.php b/src/Modules/Users/migrations/2026_12_04_000001_create_manager_groups.php index 64aacfd..e0b7386 100644 --- a/src/Modules/Users/migrations/2026_12_04_000001_create_manager_groups.php +++ b/src/Modules/Users/migrations/2026_12_04_000001_create_manager_groups.php @@ -3,12 +3,12 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; +use IriksIT\Manager\Support\Names; return new class extends Migration { public function up(): void { - $prefix = config('manager.table_prefix'); $users = (new (config('manager.user_model')))->getTable(); // New accounts are never super admins; an existing one is not promoted here. @@ -17,7 +17,7 @@ return new class extends Migration Schema::table($users, fn (Blueprint $table) => $table->boolean('is_super_admin')->default(false)); } - Schema::create($prefix.'groups', function (Blueprint $table) { + Schema::create(Names::table('groups'), function (Blueprint $table) { $table->id(); $table->string('name')->unique(); $table->string('description', 500)->nullable(); @@ -25,8 +25,8 @@ return new class extends Migration $table->timestamps(); }); - Schema::create($prefix.'group_user', function (Blueprint $table) use ($prefix, $users) { - $table->foreignId('group_id')->constrained($prefix.'groups')->cascadeOnDelete(); + Schema::create(Names::table('group_user'), function (Blueprint $table) use ($users) { + $table->foreignId('group_id')->constrained(Names::table('groups'))->cascadeOnDelete(); $table->foreignId('user_id')->constrained($users)->cascadeOnDelete(); $table->primary(['group_id', 'user_id']); }); @@ -34,11 +34,10 @@ return new class extends Migration public function down(): void { - $prefix = config('manager.table_prefix'); $users = (new (config('manager.user_model')))->getTable(); - Schema::dropIfExists($prefix.'group_user'); - Schema::dropIfExists($prefix.'groups'); + Schema::dropIfExists(Names::table('group_user')); + Schema::dropIfExists(Names::table('groups')); Schema::table($users, fn (Blueprint $table) => $table->dropColumn('is_super_admin')); } }; diff --git a/src/Support/Fields.php b/src/Support/Fields.php new file mode 100644 index 0000000..e190f00 --- /dev/null +++ b/src/Support/Fields.php @@ -0,0 +1,150 @@ + ['label' => 'Title on the photo', 'type' => 'text', 'help' => 'One line.', 'max' => 120] + * + * Types: `text` (one line), `textarea` (paragraphs), `markdown` (a long text in Markdown), `lines` (one item + * per line), `media` (a picture from the media library; the value is its address), `url`, `number`, `date`, + * `toggle` (a switch) and `select` (needs `options`: a list of values, or value => label). `required`, `default` and + * `rules` (extra Laravel rules) are optional on every type. + */ +final class Fields +{ + public const TYPES = ['text', 'textarea', 'markdown', 'lines', 'media', 'url', 'number', 'date', 'toggle', 'select']; + + private const LENGTHS = ['text' => 255, 'textarea' => 20000, 'markdown' => 100000, 'lines' => 10000, 'media' => 2048, 'url' => 2048, 'date' => 40, 'select' => 255]; + + /** + * The definitions in one shape, with a key, a label and a known type; what is wrong is dropped. + * + * @param array $fields key => definition + * @return array, max: ?int, rules: list}> + */ + public static function normalize(array $fields): array + { + $out = []; + + foreach ($fields as $key => $field) { + if (! is_string($key) || ! preg_match('/^[a-z][a-z0-9_]{0,59}$/', $key) || ! is_array($field)) { + continue; + } + + $type = in_array($field['type'] ?? 'text', self::TYPES, true) ? ($field['type'] ?? 'text') : 'text'; + $options = []; + + $given = (array) ($field['options'] ?? []); + + foreach ($given as $value => $label) { + $options[(string) (array_is_list($given) ? $label : $value)] = (string) $label; + } + + if ($type === 'select' && $options === []) { + continue; + } + + $out[$key] = [ + 'key' => $key, + 'label' => (string) ($field['label'] ?? ucfirst(str_replace('_', ' ', $key))), + 'type' => $type, + 'help' => isset($field['help']) ? (string) $field['help'] : null, + 'required' => (bool) ($field['required'] ?? false), + 'default' => $field['default'] ?? self::empty($type), + 'options' => $options, + 'max' => isset($field['max']) ? max(1, (int) $field['max']) : null, + 'rules' => array_values((array) ($field['rules'] ?? [])), + ]; + } + + return $out; + } + + /** + * The Laravel rules for the values, keyed ``. + * + * @param array> $fields normalized + * @return array> + */ + public static function rules(array $fields, string $prefix = ''): array + { + $rules = []; + + foreach ($fields as $key => $field) { + $type = $field['type']; + $max = $field['max'] ?? self::LENGTHS[$type] ?? null; + $presence = $field['required'] ? 'required' : 'nullable'; + + $rules[$prefix.$key] = [$presence, ...match ($type) { + 'toggle' => ['boolean'], + 'number' => ['numeric'], + 'date' => ['date'], + 'select' => ['string', Rule::in(array_keys($field['options']))], + 'media', 'url' => ['string', 'max:'.$max, 'regex:'.self::ADDRESS], + default => ['string', 'max:'.$max], + }, ...$field['rules']]; + } + + return $rules; + } + + /** A web address or a path of the site. Never `javascript:` and its kin. */ + public const ADDRESS = '#^(/(?!/)|https?://)[^\s<>"\']*$#i'; + + /** + * What is stored: only the known keys, in the type of the field, the default where nothing is given. + * + * @param array> $fields normalized + * @param array $input + * @return array + */ + public static function clean(array $fields, array $input): array + { + $out = []; + + foreach ($fields as $key => $field) { + $value = array_key_exists($key, $input) ? $input[$key] : $field['default']; + + $out[$key] = match ($field['type']) { + 'toggle' => filter_var($value, FILTER_VALIDATE_BOOLEAN), + 'number' => $value === null || $value === '' ? null : $value + 0, + default => $value === null ? '' : (is_scalar($value) ? trim((string) $value) : ''), + }; + } + + return $out; + } + + /** + * The stored values over the defaults, for the screens and for the public site. + * + * @param array> $fields normalized + * @param array $stored + * @return array + */ + public static function values(array $fields, array $stored): array + { + $out = []; + + foreach ($fields as $key => $field) { + $out[$key] = array_key_exists($key, $stored) ? $stored[$key] : $field['default']; + } + + return $out; + } + + private static function empty(string $type): mixed + { + return match ($type) { + 'toggle' => false, + 'number' => null, + default => '', + }; + } +} diff --git a/src/Support/Importer.php b/src/Support/Importer.php new file mode 100644 index 0000000..8b0b6d9 --- /dev/null +++ b/src/Support/Importer.php @@ -0,0 +1,125 @@ +, columns: list, required: list, key: list}> + */ + public const TARGETS = [ + 'posts' => [ + 'model' => Post::class, + 'columns' => ['title', 'slug', 'excerpt', 'body', 'cover_image', 'category', 'tags', 'is_featured', 'published_at'], + 'required' => ['title', 'body'], + 'key' => ['slug'], + ], + 'pages' => [ + 'model' => Page::class, + 'columns' => ['slug', 'title', 'body', 'is_published'], + 'required' => ['slug', 'title'], + 'key' => ['slug'], + ], + 'reviews' => [ + 'model' => Review::class, + 'columns' => ['author', 'place', 'rating', 'body', 'is_visible'], + 'required' => ['author', 'body'], + 'key' => ['author', 'body'], + ], + ]; + + /** + * @param array $map package column => column of the source table; same name when left out + * @return array{created: int, updated: int, skipped: int, problems: list} + */ + public function run(string $target, ConnectionInterface $source, string $table, array $map = [], bool $dry = false, ?int $limit = null): array + { + $spec = self::TARGETS[$target] ?? throw new InvalidArgumentException("Unknown target {$target}; use one of: ".implode(', ', array_keys(self::TARGETS))); + + foreach (array_keys($map) as $column) { + if (! in_array($column, $spec['columns'], true)) { + throw new InvalidArgumentException("{$target} has no column {$column}; known: ".implode(', ', $spec['columns'])); + } + } + + $result = ['created' => 0, 'updated' => 0, 'skipped' => 0, 'problems' => []]; + $query = $source->table($table); + $limit !== null && $query->limit($limit); + + foreach ($query->get() as $number => $row) { + $row = (array) $row; + $values = []; + + foreach ($spec['columns'] as $column) { + $from = $map[$column] ?? $column; + + if (array_key_exists($from, $row)) { + $values[$column] = $this->convert($column, $row[$from]); + } + } + + if ($target === 'posts' || $target === 'pages') { + $values['slug'] = ($values['slug'] ?? '') !== '' ? Str::slug((string) $values['slug']) : Str::slug((string) ($values['title'] ?? '')); + } + + foreach ($spec['required'] as $column) { + if (! isset($values[$column]) || $values[$column] === '') { + $result['skipped']++; + $result['problems'][] = 'row '.($number + 1).": no value for {$column}"; + + continue 2; + } + } + + $key = Arr::only($values, $spec['key']); + $model = $spec['model']; + $existing = $model::query()->where($key)->first(); + $existing ? $result['updated']++ : $result['created']++; + + if (! $dry) { + $existing ? $existing->update($values) : $model::query()->create($values); + } + } + + return $result; + } + + private function convert(string $column, mixed $value): mixed + { + return match ($column) { + 'tags' => $this->tags($value), + 'is_featured', 'is_published', 'is_visible' => filter_var($value, FILTER_VALIDATE_BOOLEAN), + 'rating' => $value === null || $value === '' ? null : max(1, min(5, (int) $value)), + 'published_at' => $value === null || $value === '' ? null : $value, + default => is_string($value) ? trim($value) : $value, + }; + } + + /** @return list */ + private function tags(mixed $value): array + { + if (is_string($value)) { + $decoded = json_decode($value, true); + $value = is_array($decoded) ? $decoded : array_map('trim', explode(',', $value)); + } + + return array_values(array_filter(array_map(fn ($tag) => is_string($tag) ? trim($tag) : '', (array) $value), fn ($tag) => $tag !== '')); + } +} diff --git a/src/Support/Login/BaseLoginCheck.php b/src/Support/Login/BaseLoginCheck.php new file mode 100644 index 0000000..f4130d2 --- /dev/null +++ b/src/Support/Login/BaseLoginCheck.php @@ -0,0 +1,20 @@ + 'turnstile', 'type' => 'turnstile', 'site_key' => (string) config('manager.login.turnstile.site_key')]]; + } + + public function before(Request $request): void + { + $token = $request->string('turnstile')->limit(2048, '')->toString(); + + if ($token === '' || ! $this->valid($token, (string) $request->ip())) { + throw ValidationException::withMessages(['turnstile' => __('Prove you are not a program, then log in again.')]); + } + } + + private function valid(string $token, string $ip): bool + { + try { + $answer = Http::asForm()->timeout(5)->post(self::VERIFY, ['secret' => config('manager.login.turnstile.secret'), 'response' => $token, 'remoteip' => $ip]); + + return $answer->ok() && $answer->json('success') === true; + } catch (Throwable) { + return false; + } + } +} diff --git a/src/Support/LoginChecks.php b/src/Support/LoginChecks.php new file mode 100644 index 0000000..1f1f0fe --- /dev/null +++ b/src/Support/LoginChecks.php @@ -0,0 +1,47 @@ + */ + public function all(): array + { + $classes = array_values(array_unique([...(array) config('manager.login.checks', []), ...(Turnstile::configured() ? [Turnstile::class] : [])])); + $checks = []; + + foreach ($classes as $class) { + if (is_string($class) && is_subclass_of($class, LoginCheck::class)) { + $checks[] = app($class); + } + } + + return $checks; + } + + /** @return list> */ + public function fields(): array + { + return array_merge(...array_map(fn (LoginCheck $check) => $check->fields(), $this->all()) ?: [[]]); + } + + public function before(Request $request): void + { + foreach ($this->all() as $check) { + $check->before($request); + } + } + + public function after(Request $request, Authenticatable $user): void + { + foreach ($this->all() as $check) { + $check->after($request, $user); + } + } +} diff --git a/src/Support/Menu.php b/src/Support/Menu.php new file mode 100644 index 0000000..0f6fe8b --- /dev/null +++ b/src/Support/Menu.php @@ -0,0 +1,84 @@ +hasFull($user); + + if ($this->maySwitch($user)) { + $chosen = $user->getKey() === null ? null : UserSetting::query()->where('user_id', $user->getKey())->value('view'); + + if (in_array($chosen, [self::FULL, self::SIMPLE], true)) { + return $chosen; + } + } + + return $full ? self::FULL : self::SIMPLE; + } + + public function maySwitch(?object $user): bool + { + return $user !== null && config('manager.simple_view') && ($this->hasFull($user) || Gate::forUser($user)->allows('manager.switch')); + } + + /** + * @param list $allowed the permissions this account has + * @return list + */ + public function for(?object $user, array $allowed): array + { + if ($user === null) { + return []; + } + + $simple = $this->view($user) === self::SIMPLE; + $items = []; + + foreach ($this->modules->navigation() as $item) { + if (($item['permission'] ?? null) !== null && ! in_array($item['permission'], $allowed, true)) { + continue; + } + + if ($simple && ! $item['simple']) { + continue; + } + + $items[] = array_filter([ + 'label' => $item['label'], + 'href' => isset($item['route']) ? route($item['route'], $item['params'] ?? [], false) : (string) $item['url'], + 'section' => $item['section'] ?? null, + 'icon' => $item['icon'] ?? null, + 'new_tab' => ($item['new_tab'] ?? false) ?: null, + ], fn ($value) => $value !== null); + } + + return $items; + } + + private function hasFull(object $user): bool + { + return (method_exists($user, 'isManagerSuperAdmin') && $user->isManagerSuperAdmin()) || Gate::forUser($user)->allows('manager.full'); + } +} diff --git a/src/Support/ModuleRegistry.php b/src/Support/ModuleRegistry.php index b4cf2c9..0e22e08 100644 --- a/src/Support/ModuleRegistry.php +++ b/src/Support/ModuleRegistry.php @@ -2,6 +2,7 @@ namespace IriksIT\Manager\Support; +use Illuminate\Support\Str; use IriksIT\Manager\Contracts\Module; use IriksIT\Manager\Exceptions\ModuleException; @@ -76,6 +77,11 @@ final class ModuleRegistry } } + if (config('manager.simple_view')) { + $permissions['manager.full'] = new Permission('manager.full', 'See the whole manager, not only the simple screens', 'Manager'); + $permissions['manager.switch'] = new Permission('manager.switch', 'Switch between the simple and the whole manager', 'Manager'); + } + return $permissions; } @@ -120,7 +126,7 @@ final class ModuleRegistry $sections = []; foreach ($this->permissions() as $permission) { - $sections[$permission->section][] = ['value' => $permission->value, 'label' => $permission->label, 'needs' => $permission->needs]; + $sections[__($permission->section)][] = ['value' => $permission->value, 'label' => __($permission->label), 'needs' => $permission->needs]; } $catalogue = []; @@ -131,16 +137,49 @@ final class ModuleRegistry return $catalogue; } - /** @return list */ + /** + * The menu: what the modules give, changed by config `manager.menu`, in order. An item has `label`, + * `route` (or `url` for a link of the site's own) and `permission`, and may add `section` (a heading), + * `icon`, `order` (lower comes first; default 100), `simple` (shown in the simple view) and `new_tab`. + * + * @return list + */ public function navigation(): array { + $changes = (array) config('manager.menu.items', []); $items = []; foreach ($this->active() as $module) { - array_push($items, ...$module->navigation()); + foreach ($module->navigation() as $item) { + $short = $item['id'] ?? (isset($item['route']) ? Str::after($item['route'], Names::routePrefix()) : ''); + $item = [...$item, ...(array) ($changes[$short] ?? [])]; + + if (($item['hidden'] ?? false) === true) { + continue; + } + + $items[] = $item; + } } - return $items; + foreach ((array) config('manager.menu.links', []) as $link) { + if (is_array($link) && isset($link['label'], $link['url'])) { + $items[] = $link + ['permission' => null]; + } + } + + $items = array_map(fn (array $item) => [ + ...$item, + 'label' => __($item['label']), + ...(isset($item['section']) ? ['section' => __($item['section'])] : []), + 'order' => (int) ($item['order'] ?? 100), + 'simple' => (bool) ($item['simple'] ?? false), + ], $items); + + // PHP's sort is stable: items with the same order keep the order of the modules. + usort($items, fn (array $a, array $b) => $a['order'] <=> $b['order']); + + return array_values($items); } /** @@ -150,7 +189,7 @@ final class ModuleRegistry */ public function actions(): array { - $actions = ['profile.update' => ['Changed own account']]; + $actions = ['profile.update' => ['Changed own account'], 'profile.view' => ['Switched between the simple and the whole manager']]; foreach ($this->active() as $module) { $actions = [...$actions, ...$module->actions()]; diff --git a/src/Support/Names.php b/src/Support/Names.php new file mode 100644 index 0000000..42f4384 --- /dev/null +++ b/src/Support/Names.php @@ -0,0 +1,33 @@ + ['posts.view', 'posts.write'], 'owner' => ['*']]` (`*` is everything). The attribute is + * `manager.permissions.role_attribute`. + */ +final class RoleMap implements PermissionResolver +{ + public function permissions(Authenticatable $user): array + { + $roles = $user->{(string) config('manager.permissions.role_attribute', 'role')} ?? []; + $roles = $roles instanceof Collection ? $roles->all() : (array) $roles; + $map = (array) config('manager.permissions.roles', []); + $out = []; + + foreach ($roles as $role) { + $name = is_object($role) ? (string) ($role->name ?? '') : (string) (is_scalar($role) ? $role : ''); + + foreach ((array) ($map[$name] ?? []) as $permission) { + $out[] = (string) $permission; + } + } + + return array_values(array_unique($out)); + } +} diff --git a/src/Support/Permissions/Sources.php b/src/Support/Permissions/Sources.php new file mode 100644 index 0000000..638f43c --- /dev/null +++ b/src/Support/Permissions/Sources.php @@ -0,0 +1,45 @@ + what the roles of the site allow (empty in `groups` mode) */ + public static function fromHost(Authenticatable $user): array + { + if (self::mode() === 'groups') { + return []; + } + + $class = config('manager.permissions.resolver'); + $resolver = is_string($class) && is_subclass_of($class, PermissionResolver::class) ? app($class) : (config('manager.permissions.roles') ? new RoleMap : null); + + if ($resolver === null) { + return []; + } + + $known = app(ModuleRegistry::class)->permissionValues(); + $given = $resolver->permissions($user); + + return in_array('*', $given, true) ? $known : array_values(array_filter($given, fn ($value) => is_string($value) && in_array($value, $known, true))); + } + + private static function mode(): string + { + return in_array(config('manager.permissions.mode'), ['groups', 'host', 'merge'], true) ? config('manager.permissions.mode') : 'groups'; + } +} diff --git a/src/Support/Resources.php b/src/Support/Resources.php new file mode 100644 index 0000000..11c478b --- /dev/null +++ b/src/Support/Resources.php @@ -0,0 +1,122 @@ + ['label' => 'Services', 'singular' => 'Service', 'model' => App\Models\Service::class, + * 'columns' => ['name', 'price'], 'order' => ['position', 'asc'], 'fields' => [...]] + */ +final class Resources +{ + /** Names the permissions of modules that exist already would clash with. */ + private const RESERVED = ['posts', 'pages', 'media', 'accounts', 'groups', 'audit', 'statistics', 'reviews', 'labels', 'profile', 'manager', 'records']; + + /** + * @return array>, columns: list, order: array{0: string, 1: string}, per_page: int}> + */ + public static function all(): array + { + $out = []; + + foreach ((array) config('manager.resources', []) as $key => $definition) { + if (! is_string($key) || ! preg_match('/^[a-z][a-z0-9_]{0,39}$/', $key) || in_array($key, self::RESERVED, true) || ! is_array($definition)) { + continue; + } + + $fields = Fields::normalize((array) ($definition['fields'] ?? [])); + $model = $definition['model'] ?? null; + $columns = array_values(array_filter((array) ($definition['columns'] ?? array_slice(array_keys($fields), 0, 3)), fn ($column) => isset($fields[$column]))); + $order = (array) ($definition['order'] ?? []); + + $out[$key] = [ + 'key' => $key, + 'label' => (string) ($definition['label'] ?? ucfirst(str_replace('_', ' ', $key))), + 'singular' => (string) ($definition['singular'] ?? $definition['label'] ?? $key), + 'model' => is_string($model) && is_subclass_of($model, Eloquent::class) ? $model : null, + 'fields' => $fields, + 'columns' => $columns, + 'order' => [preg_match('/^[a-z_][a-z0-9_]*$/', (string) ($order[0] ?? '')) ? (string) $order[0] : 'id', ($order[1] ?? 'desc') === 'asc' ? 'asc' : 'desc'], + 'per_page' => max(5, min(200, (int) ($definition['per_page'] ?? 50))), + ]; + } + + return $out; + } + + /** @return ?array */ + public static function find(string $key): ?array + { + return self::all()[$key] ?? null; + } + + /** + * @param array $resource + * @return Builder + */ + public static function query(array $resource): Builder + { + [$column, $direction] = $resource['order']; + + if ($resource['model'] !== null) { + return $resource['model']::query()->orderBy($column, $direction)->orderBy('id', 'desc'); + } + + // The package's own table keeps the values in one JSON column. + $query = Record::query()->where('resource', $resource['key']); + + return $column !== 'id' && isset($resource['fields'][$column]) ? $query->orderBy('data->'.$column, $direction) : $query->orderBy('id', $column === 'id' ? $direction : 'desc'); + } + + /** + * @param array $resource + * @return array + */ + public static function row(array $resource, Eloquent $model): array + { + $stored = $resource['model'] === null ? (array) $model->getAttribute('data') : null; + $values = []; + + foreach ($resource['fields'] as $key => $field) { + $values[$key] = $stored !== null ? ($stored[$key] ?? $field['default']) : ($model->getAttribute($key) ?? $field['default']); + } + + return ['id' => $model->getKey(), 'values' => $values]; + } + + /** + * @param array $resource + * @param array $values cleaned by `Fields::clean` + */ + public static function save(array $resource, ?Eloquent $model, array $values): Eloquent + { + if ($resource['model'] === null) { + $model ??= new Record(['resource' => $resource['key']]); + $model->data = $values; + } else { + $model ??= new $resource['model']; + // Only the keys the site defined: the definition is the whitelist. + $model->forceFill($values); + } + + $model->save(); + + return $model; + } + + /** + * @param array $resource + */ + public static function record(array $resource, int|string $id): ?Eloquent + { + return self::query($resource)->reorder()->whereKey($id)->first(); + } +} diff --git a/src/Support/Revisions.php b/src/Support/Revisions.php new file mode 100644 index 0000000..5f78d8f --- /dev/null +++ b/src/Support/Revisions.php @@ -0,0 +1,118 @@ + ['services' => ['model' => App\Models\Service::class, 'view' => 'services.view', 'restore' => 'services.manage']] + */ +final class Revisions +{ + /** How many states are kept per record unless config `manager.revisions.keep` says otherwise. */ + private const KEEP = 50; + + /** + * What has a history: key => model, the permissions to see and to put back, the attributes that are not part of it (for a + * post that is whether it is on the site: going back in time must not publish or hide anything). + * + * @return array, view: string, restore: string, except: list}> + */ + public static function types(): array + { + $types = [ + 'posts' => ['model' => Post::class, 'view' => 'posts.view', 'restore' => 'posts.write', 'except' => ['published_at']], + 'pages' => ['model' => Page::class, 'view' => 'pages.edit', 'restore' => 'pages.edit', 'except' => ['is_published']], + ]; + + foreach ((array) config('manager.revisions.types', []) as $key => $type) { + if (is_string($key) && preg_match('/^[a-z][a-z0-9_]{0,39}$/', $key) && is_array($type) && is_subclass_of($type['model'] ?? '', Eloquent::class)) { + $types[$key] = ['model' => $type['model'], 'view' => (string) ($type['view'] ?? $key.'.view'), 'restore' => (string) ($type['restore'] ?? $key.'.manage'), 'except' => array_values((array) ($type['except'] ?? []))]; + } + } + + return array_filter($types, fn (array $type) => ! in_array($type['model'], (array) config('manager.revisions.skip', []), true)); + } + + /** Starts keeping the history of every type: a save of a record writes its state, a delete removes its history. */ + public static function listen(): void + { + foreach (self::types() as $key => $type) { + $type['model']::saved(fn (Eloquent $model) => self::record($key, $model)); + $type['model']::deleted(fn (Eloquent $model) => Revision::query()->where('type', $key)->where('subject_id', $model->getKey())->delete()); + } + } + + public static function record(string $key, Eloquent $model): ?Revision + { + $type = self::types()[$key] ?? null; + + if ($type === null || ! $model->getKey()) { + return null; + } + + $data = self::snapshot($model, $type['except']); + $latest = Revision::query()->where('type', $key)->where('subject_id', $model->getKey())->orderByDesc('id')->first(); + + if ($latest !== null && $latest->data == $data) { + return null; + } + + $user = auth()->user(); + $revision = Revision::query()->create([ + 'type' => $key, + 'subject_id' => $model->getKey(), + 'user_id' => $user?->getAuthIdentifier(), + 'user_name' => $user === null ? null : mb_substr((string) ($user->name ?? ''), 0, 255), + 'data' => $data, + 'changed' => $latest === null ? array_keys($data) : self::changed((array) $latest->data, $data), + 'created_at' => now(), + ]); + + // Keep the newest ones only. + $old = Revision::query()->where('type', $key)->where('subject_id', $model->getKey())->orderByDesc('id')->skip(max(5, (int) config('manager.revisions.keep', self::KEEP)))->take(1000)->pluck('id'); + $old->isNotEmpty() && Revision::query()->whereKey($old)->delete(); + + return $revision; + } + + /** + * Puts a state back. It is a save like any other, so the history shows it and the state before it is not lost. + * + * @param array{except: list} $type + */ + public static function restore(Eloquent $model, Revision $revision, array $type): Eloquent + { + $keep = array_flip([...$type['except'], $model->getKeyName(), $model->getCreatedAtColumn(), $model->getUpdatedAtColumn()]); + $model->forceFill(array_diff_key((array) $revision->data, $keep))->save(); + + return $model; + } + + /** + * @param list $except + * @return array + */ + private static function snapshot(Eloquent $model, array $except): array + { + $skip = array_flip([...$except, $model->getKeyName(), $model->getCreatedAtColumn(), $model->getUpdatedAtColumn()]); + + return array_diff_key($model->attributesToArray(), $skip); + } + + /** + * @param array $before + * @param array $after + * @return list + */ + private static function changed(array $before, array $after): array + { + return array_values(array_filter(array_keys($after + $before), fn ($key) => ($before[$key] ?? null) != ($after[$key] ?? null))); + } +} diff --git a/src/Support/Shell.php b/src/Support/Shell.php index 36ba347..79fac51 100644 --- a/src/Support/Shell.php +++ b/src/Support/Shell.php @@ -10,7 +10,7 @@ use IriksIT\Manager\ManagerServiceProvider; /** What the first page of the screens needs to know: who, what they may do, the menu and the look. */ class Shell { - public function __construct(private readonly ModuleRegistry $modules, private readonly Themes $themes) {} + public function __construct(private readonly ModuleRegistry $modules, private readonly Themes $themes, private readonly Menu $menu, private readonly LoginChecks $loginChecks) {} /** @return array{boot: array, css: string, scripts: string, styles: string} */ public function data(Request $request): array @@ -25,12 +25,15 @@ class Shell fn (string $permission) => Gate::forUser($user)->allows($permission), )); - $navigation = $user === null ? [] : array_values(array_map( - fn (array $item) => ['label' => $item['label'], 'href' => route($item['route'], [], false)], - array_filter($this->modules->navigation(), fn (array $item) => in_array($item['permission'], $allowed, true)), + $navigation = $this->menu->for($user, $allowed); + + $extensions = array_values(array_filter( + (array) config('manager.extensions', []), + fn ($url) => is_string($url) && preg_match('#^(/(?!/)|https://)[^\s<>"\'\\\\]*$#', $url) === 1, )); return [ + 'extensions' => $extensions, 'css' => $this->themes->css($theme), 'title' => $theme['name'] ?? config('manager.name') ?? config('app.name', 'Manager'), 'version' => is_file($dist.'/manager.js') ? substr(md5_file($dist.'/manager.js').md5_file($dist.'/manager.css'), 0, 10) : 'dev', @@ -46,8 +49,12 @@ class Shell ], 'permissions' => $allowed, 'navigation' => $navigation, + 'extensions' => $user === null ? [] : $extensions, + 'view' => $this->menu->view($user), + 'can_switch' => $this->menu->maySwitch($user), 'theme' => $key, - 'can_login' => Route::has('manager.login'), + 'can_login' => Route::has(Names::route('login')), + 'login_fields' => $user === null ? $this->loginChecks->fields() : [], ], ]; } diff --git a/tests/AllModulesTestCase.php b/tests/AllModulesTestCase.php new file mode 100644 index 0000000..255cd51 --- /dev/null +++ b/tests/AllModulesTestCase.php @@ -0,0 +1,9 @@ + true, 'audit' => true, 'statistics' => true, 'pages' => true, 'posts' => true]; +} diff --git a/tests/Feature/AuditTest.php b/tests/Feature/AuditTest.php index 4d22681..2f205d5 100644 --- a/tests/Feature/AuditTest.php +++ b/tests/Feature/AuditTest.php @@ -47,7 +47,7 @@ describe('what is switched on', function () { ->filter(fn ($name) => is_string($name) && str_starts_with($name, 'manager.')) ->map(fn ($name) => substr($name, 8)) // The login and the built files are outside `auth` (nobody is known there); a logout is logged by Laravel's Logout event. - ->reject(fn ($name) => in_array($name, [...$labelled, 'assets', 'login', 'login.store', 'logout'], true)) + ->reject(fn ($name) => $name === '' || in_array($name, [...$labelled, 'assets', 'login', 'login.store', 'logout', 'markdown.preview'], true)) ->values()->all(); expect($missing)->toBe([]); diff --git a/tests/Feature/DoctorTest.php b/tests/Feature/DoctorTest.php index 2c266ec..ba4fe6c 100644 --- a/tests/Feature/DoctorTest.php +++ b/tests/Feature/DoctorTest.php @@ -73,3 +73,24 @@ it('leaves the check to a new process after it changed the switches', function ( expect(Artisan::output())->toContain('manager:doctor')->not->toContain('[OK]'); }); + +it('finds no shared names in a clean setup', function () { + $check = collect(doctorReport()['checks'])->firstWhere('check', 'names'); + expect($check['message'])->toBe('No route name or address is shared with the site.'); +}); + +it('warns when the site uses a route name of the manager, and says what to set', function () { + Route::get('/home', fn () => 'x')->name('manager.dashboard'); + + $check = collect(doctorReport()['checks'])->firstWhere('check', 'names'); + + expect($check['status'])->toBe('warn')->and($check['message'])->toContain('manager.dashboard')->and($check['fix'])->toContain('route_name'); +}); + +it('warns when the site has routes under the address of the manager', function () { + Route::get('/manager/reports', fn () => 'x'); + + $check = collect(doctorReport()['checks'])->firstWhere('check', 'names'); + + expect($check['status'])->toBe('warn')->and($check['message'])->toContain('manager/reports'); +}); diff --git a/tests/Feature/EditorTest.php b/tests/Feature/EditorTest.php new file mode 100644 index 0000000..d3e4dd5 --- /dev/null +++ b/tests/Feature/EditorTest.php @@ -0,0 +1,25 @@ +actingAs(makeUser(['posts.view'])); + + $html = $this->postJson('/manager/markdown', ['text' => "## Hi\n\n**bold** ![alt](/media/a.jpg)\n\n"])->assertOk()->json('html'); + + expect($html)->toContain('

Hi

', 'bold', 'altand($html)->not->toContain(''); + expect(Blade::render(''))->toContain('data-spa'); +}); diff --git a/tests/Feature/RenamedTest.php b/tests/Feature/RenamedTest.php new file mode 100644 index 0000000..2d7f827 --- /dev/null +++ b/tests/Feature/RenamedTest.php @@ -0,0 +1,23 @@ +toBeTrue() + ->and(Route::has('pkg-manager.posts.index'))->toBeTrue() + ->and(Route::has('manager.dashboard'))->toBeFalse() + ->and(Schema::hasTable('pkg_posts'))->toBeTrue() + ->and(Schema::hasTable('site_files'))->toBeTrue() + ->and(Schema::hasTable('manager_posts'))->toBeFalse() + ->and(Schema::hasTable('pkg_media'))->toBeFalse(); + + $routes = collect(app(ModuleRegistry::class)->navigation())->pluck('route'); + + expect($routes)->not->toBeEmpty() + ->and($routes->every(fn ($route) => str_starts_with($route, 'pkg-manager.')))->toBeTrue(); +}); diff --git a/tests/Feature/ResourcesTest.php b/tests/Feature/ResourcesTest.php new file mode 100644 index 0000000..a86c7b2 --- /dev/null +++ b/tests/Feature/ResourcesTest.php @@ -0,0 +1,88 @@ + 'boolean']; + } +} + +beforeEach(function () { + Schema::create('site_services', function ($table) { + $table->id(); + $table->string('name'); + $table->integer('position')->nullable(); + $table->boolean('visible')->default(true); + $table->string('secret')->nullable(); + $table->timestamps(); + }); + $this->actingAs(makeUser(['services.manage', 'services.view', 'links.view', 'links.manage'])); +}); + +it('puts a menu item and permissions in the manager for each resource', function () { + $registry = app(ModuleRegistry::class); + + expect($registry->permissionValues())->toContain('services.view', 'services.manage', 'links.view') + ->and($registry->permissionValues())->not->toContain('posts.view-more') + ->and(collect($registry->navigation())->firstWhere('label', 'Services'))->toMatchArray(['route' => 'manager.records.index', 'params' => ['resource' => 'services']]); + + $this->getJson('/manager')->assertOk()->assertJsonFragment(['href' => '/manager/records/services']); +}); + +it('keeps the records of a resource in a model of the site', function () { + $this->postJson('/manager/records/services', ['name' => 'Roofs', 'position' => 2, 'visible' => true, 'secret' => 'x'])->assertCreated(); + $this->postJson('/manager/records/services', ['name' => 'Floors', 'position' => 1])->assertCreated(); + + $rows = $this->getJson('/manager/records/services')->assertOk()->json('rows'); + + expect(collect($rows)->pluck('values.name')->all())->toBe(['Floors', 'Roofs']) + ->and(Service::query()->where('name', 'Roofs')->value('secret'))->toBeNull(); + + $id = $rows[0]['id']; + $this->putJson("/manager/records/services/{$id}", ['name' => 'Floors and walls', 'position' => 1])->assertOk(); + $this->getJson("/manager/records/services/{$id}/edit")->assertOk()->assertJsonPath('record.values.name', 'Floors and walls'); + $this->deleteJson("/manager/records/services/{$id}")->assertOk(); + + expect(Service::query()->count())->toBe(1); +}); + +it('keeps the records of a resource without a model in the table of the package', function () { + $this->postJson('/manager/records/links', ['label' => 'Home', 'url' => '/', 'new_tab' => true])->assertCreated(); + $this->postJson('/manager/records/links', ['label' => 'Bad', 'url' => 'javascript:alert(1)'])->assertJsonValidationErrors(['url']); + $this->postJson('/manager/records/links', ['url' => '/x'])->assertJsonValidationErrors(['label']); + + expect(Record::query()->where('resource', 'links')->sole()->data)->toBe(['label' => 'Home', 'url' => '/', 'new_tab' => true]); + + $this->getJson('/manager/records/links/create')->assertOk()->assertJsonPath('record.values.new_tab', false)->assertJsonCount(3, 'resource.fields'); +}); + +it('is closed to those without the permission and to what was not defined', function () { + $this->actingAs(makeUser(['services.view'])); + + $this->getJson('/manager/records/services')->assertOk(); + $this->postJson('/manager/records/services', ['name' => 'x'])->assertForbidden(); + $this->getJson('/manager/records/links')->assertForbidden(); + $this->getJson('/manager/records/posts')->assertNotFound(); + $this->getJson('/manager/records/nothing')->assertNotFound(); + $this->getJson('/manager/records/services/99/edit')->assertForbidden(); +}); + +it('does not take a name that belongs to a module', function () { + config(['manager.resources.posts' => ['fields' => ['a' => ['type' => 'text']]]]); + + expect(array_keys(Resources::all()))->toBe(['services', 'links']); +}); diff --git a/tests/Feature/RevisionsTest.php b/tests/Feature/RevisionsTest.php new file mode 100644 index 0000000..7705185 --- /dev/null +++ b/tests/Feature/RevisionsTest.php @@ -0,0 +1,88 @@ + 'First', 'slug' => 'first', 'body' => 'One', 'tags' => ['a']]); +} + +it('keeps a state at every save, and nothing when nothing changed', function () { + $post = writtenPost(); + $post->update(['body' => 'Two']); + $post->save(); + + $revisions = Revision::query()->where('type', 'posts')->orderBy('id')->get(); + + expect($revisions)->toHaveCount(2) + ->and($revisions[0]->changed)->toContain('title', 'body') + ->and($revisions[1]->changed)->toBe(['body']) + ->and($revisions[1]->data)->not->toHaveKey('published_at')->and($revisions[1]->data)->not->toHaveKey('id'); +}); + +it('lists the history to someone who may see it, and only that', function () { + $post = writtenPost(); + $post->update(['body' => 'Two']); + + $this->actingAs(makeUser(['posts.view', 'revisions.view'])); + $list = $this->getJson("/manager/revisions/posts/{$post->id}")->assertOk()->json(); + + expect($list['revisions'])->toHaveCount(2) + ->and($list['revisions'][0])->toMatchArray(['current' => true, 'changed' => ['body']]) + ->and($list['revisions'][0]['values']['body'])->toBe('Two') + ->and($list['can_restore'])->toBeFalse(); + + $this->actingAs(makeUser(['revisions.view']))->getJson("/manager/revisions/posts/{$post->id}")->assertForbidden(); + $this->actingAs(makeUser(['posts.view']))->getJson("/manager/revisions/posts/{$post->id}")->assertForbidden(); + $this->actingAs(makeUser(['posts.view', 'revisions.view']))->getJson('/manager/revisions/cars/1')->assertNotFound(); +}); + +it('puts an earlier state back without touching whether the post is on the site', function () { + $post = writtenPost(['published_at' => now()->subDay()]); + $first = Revision::query()->where('type', 'posts')->sole(); + $post->update(['body' => 'Two', 'tags' => ['b'], 'published_at' => null]); + + $this->actingAs(makeUser(['posts.view', 'posts.write', 'revisions.view', 'revisions.restore'])); + $this->postJson("/manager/revisions/posts/{$post->id}/{$first->id}/restore")->assertOk(); + + $post->refresh(); + + expect($post->body)->toBe('One')->and($post->tags)->toBe(['a'])->and($post->published_at)->toBeNull() + ->and(Revision::query()->where('type', 'posts')->count())->toBe(3); +}); + +it('keeps a live post for those who may publish', function () { + $post = writtenPost(['published_at' => now()->subDay()]); + $first = Revision::query()->where('type', 'posts')->sole(); + $post->update(['body' => 'Two']); + + $this->actingAs(makeUser(['posts.view', 'posts.write', 'revisions.view', 'revisions.restore'])); + $this->postJson("/manager/revisions/posts/{$post->id}/{$first->id}/restore")->assertForbidden(); + + $this->actingAs(makeUser(['posts.view', 'posts.write', 'posts.publish', 'revisions.view', 'revisions.restore'])); + $this->postJson("/manager/revisions/posts/{$post->id}/{$first->id}/restore")->assertOk(); + + $this->actingAs(makeUser(['posts.view', 'revisions.view'])); + $this->postJson("/manager/revisions/posts/{$post->id}/{$first->id}/restore")->assertForbidden(); +}); + +it('has a history for pages, forgets it with the page, and keeps only the newest', function () { + $page = Page::create(['slug' => 'privacy', 'title' => 'Privacy', 'body' => '1']); + + config(['manager.revisions.keep' => 5]); + foreach (range(2, 9) as $n) { + $page->update(['body' => (string) $n]); + } + + expect(Revision::query()->where('type', 'pages')->count())->toBe(5) + ->and(Revision::query()->where('type', 'pages')->orderByDesc('id')->first()->data['body'])->toBe('9'); + + $page->delete(); + + expect(Revision::query()->where('type', 'pages')->count())->toBe(0); +}); diff --git a/tests/Feature/StatisticsOffTest.php b/tests/Feature/StatisticsOffTest.php index cc8210e..91f1e6a 100644 --- a/tests/Feature/StatisticsOffTest.php +++ b/tests/Feature/StatisticsOffTest.php @@ -1,5 +1,6 @@ postJson('/pulse/view', ['path' => '/'])->assertNotFound(); }); + +it('puts nothing in a page for the pulse component', function () { + expect(trim(Blade::render('')))->toBe(''); +}); diff --git a/tests/Feature/TranslationsTest.php b/tests/Feature/TranslationsTest.php new file mode 100644 index 0000000..c0fa881 --- /dev/null +++ b/tests/Feature/TranslationsTest.php @@ -0,0 +1,59 @@ +active() as $module) { + $english[] = $module->label(); + + foreach ($module->permissions() as $permission) { + array_push($english, $permission->label, $permission->section); + } + + foreach ($module->navigation() as $item) { + $english[] = $item['label']; + } + + foreach ($module->actions() as $action) { + $english[] = $action[0]; + } + + array_push($english, ...array_values($module->views())); + } + + $dutch = json_decode(file_get_contents(__DIR__.'/../../resources/lang/nl.json'), true); + $missing = collect($english)->unique()->filter(fn (string $text) => $text !== '' && ! array_key_exists($text, $dutch))->values()->all(); + + expect($missing)->toBe([]); +}); + +it('says the menu and the group form in the language of the app', function () { + app()->setLocale('nl'); + $registry = app(ModuleRegistry::class); + + expect(collect($registry->navigation())->pluck('label'))->toContain('Berichten', 'Groepen') + ->and(collect($registry->catalogue())->pluck('section'))->toContain('Inhoud van de site'); + + app()->setLocale('en'); + + expect(collect($registry->navigation())->pluck('label'))->toContain('Posts'); +}); + +it('lets the site override a text', function () { + app()->setLocale('nl'); + $folder = sys_get_temp_dir().'/manager-lang-'.uniqid(); + mkdir($folder); + file_put_contents($folder.'/nl.json', json_encode(['Posts' => 'Nieuws'])); + app('translator')->addJsonPath($folder); + + expect(collect(app(ModuleRegistry::class)->navigation())->pluck('label'))->toContain('Nieuws'); + + unlink($folder.'/nl.json'); + rmdir($folder); +}); diff --git a/tests/RenamedTestCase.php b/tests/RenamedTestCase.php new file mode 100644 index 0000000..9167144 --- /dev/null +++ b/tests/RenamedTestCase.php @@ -0,0 +1,18 @@ + true]; + + protected function defineEnvironment($app): void + { + parent::defineEnvironment($app); + + $app['config']->set('manager.route_name', 'pkg-manager'); + $app['config']->set('manager.table_prefix', 'pkg_'); + $app['config']->set('manager.tables', ['media' => 'site_files']); + } +} diff --git a/tests/ResourcesTestCase.php b/tests/ResourcesTestCase.php new file mode 100644 index 0000000..7366212 --- /dev/null +++ b/tests/ResourcesTestCase.php @@ -0,0 +1,23 @@ +set('manager.resources', [ + 'services' => [ + 'label' => 'Services', 'singular' => 'Service', 'model' => \Service::class, 'columns' => ['name'], 'order' => ['position', 'asc'], + 'fields' => ['name' => ['type' => 'text', 'required' => true], 'position' => ['type' => 'number'], 'visible' => ['type' => 'toggle']], + ], + 'links' => [ + 'label' => 'Links', + 'fields' => ['label' => ['type' => 'text', 'required' => true], 'url' => ['type' => 'url'], 'new_tab' => ['type' => 'toggle']], + ], + ]); + } +} diff --git a/tests/SimpleViewTestCase.php b/tests/SimpleViewTestCase.php new file mode 100644 index 0000000..a35f57a --- /dev/null +++ b/tests/SimpleViewTestCase.php @@ -0,0 +1,15 @@ +set('manager.simple_view', true); + $app['config']->set('manager.menu.items', ['posts.index' => ['simple' => true, 'order' => 5, 'section' => 'Content', 'icon' => 'file']]); + } +} diff --git a/ui/package-lock.json b/ui/package-lock.json index 322d992..b1631ff 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -12,8 +12,8 @@ "@tailwindcss/vite": "^4.3.5", "@vitejs/plugin-vue": "^6.0.11", "tailwindcss": "^4.3.5", - "typescript": "^5.9.0", - "vite": "^7.0.0", + "typescript": "^5.9.3", + "vite": "^8.4.1", "vue-tsc": "^3.0.0" } }, @@ -76,6 +76,7 @@ "os": [ "aix" ], + "peer": true, "engines": { "node": ">=18" } @@ -93,6 +94,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -110,6 +112,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -127,6 +130,7 @@ "os": [ "android" ], + "peer": true, "engines": { "node": ">=18" } @@ -144,6 +148,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=18" } @@ -161,6 +166,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">=18" } @@ -178,6 +184,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -195,6 +202,7 @@ "os": [ "freebsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -212,6 +220,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -229,6 +238,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -246,6 +256,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -263,6 +274,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -280,6 +292,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -297,6 +310,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -314,6 +328,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -331,6 +346,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -348,6 +364,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">=18" } @@ -365,6 +382,7 @@ "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -382,6 +400,7 @@ "os": [ "netbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -399,6 +418,7 @@ "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -416,6 +436,7 @@ "os": [ "openbsd" ], + "peer": true, "engines": { "node": ">=18" } @@ -433,6 +454,7 @@ "os": [ "openharmony" ], + "peer": true, "engines": { "node": ">=18" } @@ -450,6 +472,7 @@ "os": [ "sunos" ], + "peer": true, "engines": { "node": ">=18" } @@ -467,6 +490,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -484,6 +508,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -501,6 +526,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">=18" } @@ -554,17 +580,20 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@rolldown/pluginutils": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", - "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", + "node_modules/@oxc-project/types": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.160.0.tgz", + "integrity": "sha512-gw4k9syEmnckbOgw2A2FU1TBDdX9hfwV9jEn/uio65pguPzwWiXQS3OIJDMEhv9m06tj9XiEe6RoD0YA+LgreA==", "dev": true, - "license": "MIT" + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.69.3.tgz", - "integrity": "sha512-WDG3WNktJVR+OTqdP/OrBg2b+JXXIgIZ+Ppzp7gjaRK9C59fn3vcFhUqjtxiscE9lygTYP3EFxY9xTLUfEFRaw==", + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.3.4.tgz", + "integrity": "sha512-xCW8CkL/ualx/SbYqeG9iK87lJCZGDQ0soE+kaORJ0Bd+pHALyE4qK7BStmEAyYWLEzZ3/biSIpA6/7GDFvzIg==", "cpu": [ "arm" ], @@ -573,12 +602,15 @@ "optional": true, "os": [ "android" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.69.3.tgz", - "integrity": "sha512-D5NgwE943sMSNRGoWFg9r2jPUG7EWk0/BYNgG3C/lIHAqY1M+GTA7EvQtCAJxKUv6gtb4lBOvx/0+8GS6yOIdA==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.3.4.tgz", + "integrity": "sha512-5lifIO+b/prcM9sx/bkPN4w6UEToEfQ3gjhx0+0neuL+dkYskI792CfAq03T51jc8JFcaYXs2hi3l8RjiH/VWQ==", "cpu": [ "arm64" ], @@ -587,26 +619,15 @@ "optional": true, "os": [ "android" - ] - }, - "node_modules/@rollup/rollup-android-x64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-x64/-/rollup-android-x64-4.69.3.tgz", - "integrity": "sha512-qT8AKzfYdZfAsoI/UFggqr1ghJfhW9GgGgDHTrYDviKvgGzqcteSjfaK0AwwJtbnbLu+FrMGF7RlGXfrZ1uFuA==", - "cpu": [ - "x64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "android" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.69.3.tgz", - "integrity": "sha512-UdQ9EDKcIyJEyQ7rKcxwfTVZt4SoM4o2NxTEWb6WFSK2SDEJKMEXjkEd6csGOfzKnr8xBUAtOLN7WnocRSjqdQ==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.3.4.tgz", + "integrity": "sha512-RCgxTI4AJQxhVF//BI3ImQOsXTHrF4Eg+f99jBy8WoETA2kSEGFxpnrVmW0leQq/2aBR4R5AC6csmy3rc66e3Q==", "cpu": [ "arm64" ], @@ -615,12 +636,15 @@ "optional": true, "os": [ "darwin" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.69.3.tgz", - "integrity": "sha512-i1a4Erge+lLWo3sSlwX9LU/KK4CkaLZe7kvCc6Fc8NNKiW6mRcXcebRze9pPdGyfdA5SVcnl9pxekXK4O+Gbcw==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.3.4.tgz", + "integrity": "sha512-zNPJVVPUaDEj+L0lImoK3rFv2b+Z5gNijI6DWu/fcD3/1TfmRXKb9ZyxbSN+2AhlctqjbNzUvCsMa+EBhnEM4Q==", "cpu": [ "x64" ], @@ -629,26 +653,15 @@ "optional": true, "os": [ "darwin" - ] - }, - "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.69.3.tgz", - "integrity": "sha512-w30OkToJS0ed5UEqXBu61gg8/adzmcnvOc7qoZi+92FsOYtVmLlQGHeVqBn9GGiruk2aiDJpd1fMHwZhOhj8rw==", - "cpu": [ - "arm64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "freebsd" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.69.3.tgz", - "integrity": "sha512-Ze4Bo4axd2xzxG72ltgQtOcRuY1zyw47Z8bye5gDwgehBglMA0AQwGy2dL1MZ4ZutjdImwVc8jbL/geawm3wjA==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.3.4.tgz", + "integrity": "sha512-upP6g7ZIRy5by1RDQ/EphHIdJ5xK0eUD7sUgfZFWJ49s4XdbYsIvIlAPtrFpayR70Hhf9J22lb4Pm8/9FhrZmg==", "cpu": [ "x64" ], @@ -657,12 +670,15 @@ "optional": true, "os": [ "freebsd" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.69.3.tgz", - "integrity": "sha512-hzMaEmx1VYvlfesicuLSI58962aaPvwK+J8Ksi1Qqy6GfM/Nsq8IDKYzw/Mg3DI5JlCwnuEcPj9ymzsAtk+sPA==", + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.3.4.tgz", + "integrity": "sha512-SAX5C5+poMLCxu8dkPF6h5yst40rkzs+9Y3cbPn2OFSydmHjAEprrGi64zGgnYyPIVZfdGUFqJ2fJbfbnHI+mA==", "cpu": [ "arm" ], @@ -671,26 +687,15 @@ "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.69.3.tgz", - "integrity": "sha512-EZRv+RnscDTuXinvItllk8VNO81mdYjWlupt1QexTPOuSt9UDkRHH6C2ArJBiNyaHqxA/dDAuK3vWAFKLmMgAA==", - "cpu": [ - "arm" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.69.3.tgz", - "integrity": "sha512-8TNXGRkMqZ7QIL3KvpL0MXGE1ueqWnm1I40CQijo6G/CCKzoMUOsMdVmfgjPGl/G22+FtQMb3+6Moc6obmZ5vQ==", + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.3.4.tgz", + "integrity": "sha512-nwHqdlRZS6GWBef3dG5/pMY6RNTBBUjj7s0Da+m6xsFpe7jx6IC46SLZcCu8f46JOfCovZmwnrz51EzGE+7Fyw==", "cpu": [ "arm64" ], @@ -699,12 +704,15 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.69.3.tgz", - "integrity": "sha512-VWRKTMZq9N9EWxDRYgLAxE4Ory+O9ZO7+m0RjWlTjhtEF9V9ts/fnfgEjDisF2wYmmJA40c98HuREBlIT29S+w==", + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.3.4.tgz", + "integrity": "sha512-Gr78X2ur/AgLCkmZgHffk/FerIX8S5zb/eII4bCcvJo0ANzeXhTShahdNbpnY6bpiszIAgIfiuKS9ziziWsamw==", "cpu": [ "arm64" ], @@ -713,40 +721,15 @@ "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-loong64-gnu": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.69.3.tgz", - "integrity": "sha512-UNm9BN6OuckVOAYvsDT0JHGQF3Lt7gjcrZL5JzmR8JvzfMb4SGjUcWtBL+fkUjdwT81vsBvUyZMZCman6dwNxw==", - "cpu": [ - "loong64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-loong64-musl": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.69.3.tgz", - "integrity": "sha512-8w6fC76ChAodM1ZAEdpNlIkV7jq+HDHpa1xawVfOdwFsgWVWQkKcYa36bFlo58PWxfinMEuMWnyyWl4Ro3mjZA==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.69.3.tgz", - "integrity": "sha512-5J/hPeDhQ8hZLRpmaNpzI5G4fT0qQQC47uj1dwCdJwd8/yk8v0aiZJ0V+Sw4HGiScgMBANKVZyrzedHqRCilIQ==", + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.3.4.tgz", + "integrity": "sha512-o9Wcn8nWrsQasaBRYM4d//FwhlBsTJYWkPVlhlt6FwzpwEoovY4IopRZjk5Fq3+ntRuSDORJjF/nA8sFeF2q6w==", "cpu": [ "ppc64" ], @@ -755,54 +738,15 @@ "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-linux-ppc64-musl": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.69.3.tgz", - "integrity": "sha512-MBOWof2RZbbM2gTUagZsEwmIUAesxvB2zxnX3Af4M69NVdqDvGEXGkV8zYfXjLoJjiU7J1mzDHABmXhz5jMlZQ==", - "cpu": [ - "ppc64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.69.3.tgz", - "integrity": "sha512-pzpggub9hyhZ89uAcXORCg6loWFoQOoTFatNpcJuiCqRdQvQa1oK37eG+vnVdFbULAzIuRlMZu23l3433OZi1g==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.69.3.tgz", - "integrity": "sha512-kUlaRxOwQKcdLSo2CrHpTVFZaKrrEONZz6yDmX2UUgzSsIUvNPGlgGEQ6mxBwCYWzIrXWtu0nILkYIc+5dZWDA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.69.3.tgz", - "integrity": "sha512-N/xL1PKN8D+CIX6/Mdnkr/T5FuZVzov5JbzQiGGaMlsVdPBi9If0qN8E91p3ex/JT9nCYKe9WNrKeml7xi87lg==", + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.3.4.tgz", + "integrity": "sha512-UDWu4jkVcx2kiBKm3Ec//4lVCbeTWj8gmJ9SyLWCdLWtTlyq7fQVeVV/14nXvRtSLErvJ2+yA/Ux5taS31Y17Q==", "cpu": [ "s390x" ], @@ -811,12 +755,15 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.69.3.tgz", - "integrity": "sha512-uBpTadP1uQZZvVe+AV4dsTwNfs1H92Ra231OcHW2PVOYdW83PS899Wr3bXGbJO5erxWVfiZ70oPnhCPJ5utL3A==", + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.3.4.tgz", + "integrity": "sha512-W9mGtTa0w4fWh8RLMNPyaEhhcuqUfO07Q4I1bBc4PDMNg7gQSw0yPQNQ3D0qwbkXwxbyL4YrIzc8n6k1vuFExQ==", "cpu": [ "x64" ], @@ -825,12 +772,15 @@ "optional": true, "os": [ "linux" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.69.3.tgz", - "integrity": "sha512-4MWQvR0w9Ao4REGwJoFZxKKtU//Bd6vl0wIexJaG0EhxbrzMdIKotNkih+qJxlZjdJHf6/W3ETZ0CrEXeNTTcQ==", + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.3.4.tgz", + "integrity": "sha512-8B+ofyQZ7/aCmkqnyMonPr5zKLqMVNczhRGFNtdIuItiwNn8iQWJawMq2E58r7bxD1XEbtRRsULY/eCWwZQ01Q==", "cpu": [ "x64" ], @@ -839,26 +789,15 @@ "optional": true, "os": [ "linux" - ] - }, - "node_modules/@rollup/rollup-openbsd-x64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.69.3.tgz", - "integrity": "sha512-GC5b98fZgnb4MD0GSO/7XFVK7z2m/geaVS4CATdb7QA1VetuXhQJxTdlJblk4uriCmS9oexARH2fVbWR+FQOLA==", - "cpu": [ - "x64" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "openbsd" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-openharmony-arm64": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.69.3.tgz", - "integrity": "sha512-jrsZxYM1Zyr0QXuHVHoRGC6tvqakkr96Vvy2eM8HYqxtmlWpjITW7pCEzDkg/X/IjLuUdyGJ693E4WJ5NcUXxQ==", + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.3.4.tgz", + "integrity": "sha512-TlD0FSZaC7o2B4NCe9V5N11ugTnhzTM9ksj4sgRLvrKosDzjEkvlsTX3ehkw4ZlPv8AADimZZTvJGEa16pfXug==", "cpu": [ "arm64" ], @@ -867,12 +806,32 @@ "optional": true, "os": [ "openharmony" - ] + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.69.3.tgz", - "integrity": "sha512-SnAwiYVNy5lfxVL7BQhtg3UbrAvAhSSonI342A5JbrznG6t8VvvkCDyLRXypQsRBvxIBVDrelpgR9yDIAlwS4w==", + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.3.4.tgz", + "integrity": "sha512-jwO8P3o53ygo7b5061B7BeaJ1BGv3BKZ6jroFdw/01qWry7Z+qNBlDvulzbTle5s/A0Fc1FRgsTxrke9DvsSbA==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@oxc-project/types": "0.160.0" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.3.4.tgz", + "integrity": "sha512-8adGMrNtrdzi2WD1ozhYapER59gD8Q/DV6SCKJlyG2HqULPdeQUBvMa33lTsiEYwIqTZUaIU2MmvPp5f1wbtXA==", "cpu": [ "arm64" ], @@ -881,26 +840,15 @@ "optional": true, "os": [ "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.69.3.tgz", - "integrity": "sha512-85tt4vmTGSq04BsY0FKnYif4JHD2aR+MeoC1cUbdZkTvjOIYO3iHmPTpOf2nOympL6yZngvJjLmeoBzUsGUJmA==", - "cpu": [ - "ia32" ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "engines": { + "node": "^20.19.0 || >=22.12.0" + } }, - "node_modules/@rollup/rollup-win32-x64-gnu": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.69.3.tgz", - "integrity": "sha512-IpRuzCYcIfSNxcqHertICkJ7JSHM74TeN5lGleOE1jGK9dPphyIB2EfFud/8oZRrt3CVd3z10UIRzLJQflnVcg==", + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.3.4.tgz", + "integrity": "sha512-rIMjtESdXJCIoOiUTroQ1Y1rjVDZkuUVRUxs3APX2vNv175D7TDWvzdELiIhzGq9cUNUFat+co+PTmPHPqSREg==", "cpu": [ "x64" ], @@ -909,21 +857,17 @@ "optional": true, "os": [ "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.69.3.tgz", - "integrity": "sha512-dyv+ETPjCDTn03T5ZAnk+OvB+4+yg1onKgTb7jjv9LQ8KEwcvUkZmIPtNTdreULsKX0Amaod6C2W1iSFseTiwQ==", - "cpu": [ - "x64" ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.1.1.tgz", + "integrity": "sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==", "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "win32" - ] + "license": "MIT" }, "node_modules/@tailwindcss/node": { "version": "4.3.5", @@ -1263,13 +1207,6 @@ "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, - "node_modules/@types/estree": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.11.tgz", - "integrity": "sha512-YBdNe5JcjYR0sPhJW1QIeRCmI11YhYvaRuGCs9+WCeTTb+Yhb2BE2XMe5/wAqF10FK5g3+q1PDhQABfT7aX0gg==", - "dev": true, - "license": "MIT" - }, "node_modules/@vitejs/plugin-vue": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.1.1.tgz", @@ -1297,27 +1234,6 @@ "@volar/source-map": "2.4.30" } }, - "node_modules/@volar/language-service": { - "version": "2.4.30", - "resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.4.30.tgz", - "integrity": "sha512-w/xDsASiqC71ggCOm7sTDXDNk/l72XEptodeRC68tgZ0e5QM4hM3zAqBGC7mBctvhrpYwKfMG+t9xcUo2hEFtA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@volar/language-core": "2.4.30", - "vscode-languageserver-protocol": "^3.17.5", - "vscode-languageserver-textdocument": "^1.0.11", - "vscode-uri": "^3.0.8" - }, - "peerDependencies": { - "typescript": "<7" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/@volar/source-map": { "version": "2.4.30", "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.30.tgz", @@ -1325,27 +1241,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@volar/typescript": { - "version": "2.4.30", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.30.tgz", - "integrity": "sha512-/DgA5tgYFPfrLFuSjIMXMGHk1LQv2+P8eny6+BhGNzFJELWIW7UZlc56ZLIRFhLsPpMfIFxM8/HvOPBggrjTZg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@volar/language-core": "2.4.30", - "@volar/language-service": "2.4.30", - "path-browserify": "^1.0.1", - "vscode-uri": "^3.0.8" - }, - "peerDependencies": { - "typescript": "<7" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/@vue/compiler-core": { "version": "3.5.47", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.47.tgz", @@ -1525,6 +1420,8 @@ "dev": true, "hasInstallScript": true, "license": "MIT", + "optional": true, + "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -1912,6 +1809,24 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/napi-windows-process-start-time": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/napi-windows-process-start-time/-/napi-windows-process-start-time-0.1.0.tgz", + "integrity": "sha512-zHxhzKsIFu3elch3eFw69WEUGc79DFhbc3nD/WEOzWL/pFFLZRW13EHnuO0c+0YjncE5uCaS9ICHxOBXkb6vPw==", + "cpu": [ + "x64", + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20" + } + }, "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", @@ -1966,50 +1881,39 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/rollup": { - "version": "4.69.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.69.3.tgz", - "integrity": "sha512-IvHhlznYBMqePMsPb0Z5QLJIweHo4L6gQb5XC1cfmRDMNLfnx3bCLzcepRQFjVi5jXer4areo5CjcqSvab5ftA==", + "node_modules/rolldown": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.3.4.tgz", + "integrity": "sha512-p2rq4bfBmF0M6yaR8+A89fbkBQynZI2fxUW4G07eq9kpctAkpo7q5BZ4X4Mo4XZ7HHROu33cX9PeopUFN6u+2Q==", "dev": true, "license": "MIT", "dependencies": { - "@types/estree": "^1.0.10" + "@oxc-project/types": "=0.160.0", + "@rolldown/pluginutils": "^1.0.0" }, "bin": { - "rollup": "dist/bin/rollup" + "rolldown": "bin/cli.mjs" }, "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" + "node": "^20.19.0 || >=22.12.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.69.3", - "@rollup/rollup-android-arm64": "4.69.3", - "@rollup/rollup-android-x64": "4.69.3", - "@rollup/rollup-darwin-arm64": "4.69.3", - "@rollup/rollup-darwin-x64": "4.69.3", - "@rollup/rollup-freebsd-arm64": "4.69.3", - "@rollup/rollup-freebsd-x64": "4.69.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.69.3", - "@rollup/rollup-linux-arm-musleabihf": "4.69.3", - "@rollup/rollup-linux-arm64-gnu": "4.69.3", - "@rollup/rollup-linux-arm64-musl": "4.69.3", - "@rollup/rollup-linux-loong64-gnu": "4.69.3", - "@rollup/rollup-linux-loong64-musl": "4.69.3", - "@rollup/rollup-linux-ppc64-gnu": "4.69.3", - "@rollup/rollup-linux-ppc64-musl": "4.69.3", - "@rollup/rollup-linux-riscv64-gnu": "4.69.3", - "@rollup/rollup-linux-riscv64-musl": "4.69.3", - "@rollup/rollup-linux-s390x-gnu": "4.69.3", - "@rollup/rollup-linux-x64-gnu": "4.69.3", - "@rollup/rollup-linux-x64-musl": "4.69.3", - "@rollup/rollup-openbsd-x64": "4.69.3", - "@rollup/rollup-openharmony-arm64": "4.69.3", - "@rollup/rollup-win32-arm64-msvc": "4.69.3", - "@rollup/rollup-win32-ia32-msvc": "4.69.3", - "@rollup/rollup-win32-x64-gnu": "4.69.3", - "@rollup/rollup-win32-x64-msvc": "4.69.3", - "fsevents": "~2.3.2" + "@rolldown/binding-android-arm-eabi": "1.3.4", + "@rolldown/binding-android-arm64": "1.3.4", + "@rolldown/binding-darwin-arm64": "1.3.4", + "@rolldown/binding-darwin-x64": "1.3.4", + "@rolldown/binding-freebsd-x64": "1.3.4", + "@rolldown/binding-linux-arm-gnueabihf": "1.3.4", + "@rolldown/binding-linux-arm64-gnu": "1.3.4", + "@rolldown/binding-linux-arm64-musl": "1.3.4", + "@rolldown/binding-linux-ppc64-gnu": "1.3.4", + "@rolldown/binding-linux-s390x-gnu": "1.3.4", + "@rolldown/binding-linux-x64-gnu": "1.3.4", + "@rolldown/binding-linux-x64-musl": "1.3.4", + "@rolldown/binding-openharmony-arm64": "1.3.4", + "@rolldown/binding-wasm32-wasi": "1.3.4", + "@rolldown/binding-win32-arm64-msvc": "1.3.4", + "@rolldown/binding-win32-x64-msvc": "1.3.4" } }, "node_modules/source-map-js": { @@ -2074,18 +1978,17 @@ } }, "node_modules/vite": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.8.tgz", - "integrity": "sha512-3tTi78MAKhVk9h+YZVXMQ8POmneJuE97QUPAWtJghHzhH7BAyiqQOC2KZh1DWOsu/USB2cRXhznPByaabvYXfw==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.4.1.tgz", + "integrity": "sha512-2bl8n3+GkKBKQQR8CZC+t+3NvjWCBNh9S0Dbfu7hr7+Jjeg71jcZk7uKF6mo8GZXjIws+Nl6jhvAfHUO320VuQ==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.27.0 || ^0.28.0", - "fdir": "^6.5.0", - "picomatch": "^4.0.3", - "postcss": "^8.5.6", - "rollup": "^4.43.0", - "tinyglobby": "^0.2.15" + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.34", + "rolldown": "~1.3.4", + "tinyglobby": "^0.2.17" }, "bin": { "vite": "bin/vite.js" @@ -2097,13 +2000,15 @@ "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { - "fsevents": "~2.3.3" + "fsevents": "~2.3.3", + "napi-windows-process-start-time": "^0.1.0" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", - "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", @@ -2116,15 +2021,18 @@ "@types/node": { "optional": true }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, "jiti": { "optional": true }, "less": { "optional": true }, - "lightningcss": { - "optional": true - }, "sass": { "optional": true }, @@ -2227,6 +2135,48 @@ "peerDependencies": { "typescript": ">=5.0.0" } + }, + "node_modules/vue-tsc/node_modules/@volar/typescript": { + "version": "2.4.30", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.30.tgz", + "integrity": "sha512-/DgA5tgYFPfrLFuSjIMXMGHk1LQv2+P8eny6+BhGNzFJELWIW7UZlc56ZLIRFhLsPpMfIFxM8/HvOPBggrjTZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.30", + "@volar/language-service": "2.4.30", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "typescript": "<7" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-tsc/node_modules/@volar/typescript/node_modules/@volar/language-service": { + "version": "2.4.30", + "resolved": "https://registry.npmjs.org/@volar/language-service/-/language-service-2.4.30.tgz", + "integrity": "sha512-w/xDsASiqC71ggCOm7sTDXDNk/l72XEptodeRC68tgZ0e5QM4hM3zAqBGC7mBctvhrpYwKfMG+t9xcUo2hEFtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.30", + "vscode-languageserver-protocol": "^3.17.5", + "vscode-languageserver-textdocument": "^1.0.11", + "vscode-uri": "^3.0.8" + }, + "peerDependencies": { + "typescript": "<7" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } } } } diff --git a/ui/package.json b/ui/package.json index 2184457..d231059 100644 --- a/ui/package.json +++ b/ui/package.json @@ -13,8 +13,8 @@ "@tailwindcss/vite": "^4.3.5", "@vitejs/plugin-vue": "^6.0.11", "tailwindcss": "^4.3.5", - "typescript": "^5.9.0", - "vite": "^7.0.0", + "typescript": "^5.9.3", + "vite": "^8.4.1", "vue-tsc": "^3.0.0" } } diff --git a/ui/src/api.ts b/ui/src/api.ts index a5eb0e2..c5b8a47 100644 --- a/ui/src/api.ts +++ b/ui/src/api.ts @@ -11,6 +11,14 @@ export class ApiError extends Error { } } +export interface NavItem { + label: string; + href: string; + section?: string; + icon?: string; + new_tab?: boolean; +} + /** What the page was started with (see resources/views/shell.blade.php). */ export interface Boot { base: string; @@ -19,7 +27,11 @@ export interface Boot { locale: string; user: { name: string; email: string; is_super_admin: boolean } | null; permissions: string[]; - navigation: { label: string; href: string }[]; + navigation: NavItem[]; + view: 'full' | 'simple'; + extensions: string[]; + login_fields: { name: string; type: string; label?: string; autocomplete?: string; required?: boolean; site_key?: string }[]; + can_switch: boolean; theme: string; can_login: boolean; } diff --git a/ui/src/components/FormFields.vue b/ui/src/components/FormFields.vue new file mode 100644 index 0000000..b8d8222 --- /dev/null +++ b/ui/src/components/FormFields.vue @@ -0,0 +1,70 @@ + + +