Author SHA1 Message Date
lexxandClaude Opus 5.5 f50ad504ff Chore: enable the boboko plugin and slim CLAUDE.md to 3dealer's own facts
The general front-end, localization and performance rules now live in
the boboko plugin's skills (re-skills marketplace). CLAUDE.md keeps the
Greek register, the design tokens, 3dealer specifics, and a map of
which skill covers what.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 18:58:40 +02:00
lexxandClaude Opus 5.5 81e70de70f Docs: bring CLAUDE.md, the transition roadmap and the README up to date
CLAUDE.md: localization now describes core's locale middleware,
$currentLocale/$altLocales and storefront.* Language Lines (there are
no lang/ files or SetLocale); the stack is Lunar 1.5, Postgres,
Meilisearch, Caddy, no Turbo; the design-reference section pointed at
files nobody has, and the component checklist was out of date.

CACHING-TRANSITION.md: records the 2026-11-06 changes (no Turbo, JSON
islands and writes, one bb_state cookie, prefetch instead of prerender),
a status table per task, the A4/A9 rework, and sources that the team
can actually reach.

README: known issues found while writing the boboko plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 18:49:52 +02:00
lexxandClaude Opus 5.5 f9b2756456 Merge branch 'feature/core-mode-guard' into caching-transition
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 18:48:18 +02:00
lexx eed538964e Merge branch 'chore/claude-plugins' into caching-transition
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	package-lock.json
2026-11-06 18:48:18 +02:00
lexxandClaude Opus 5.5 5ea33a0857 Feature: block commits of boboko-core local-mode wiring
bin/check-core-mode runs as a pre-commit hook and refuses staged
composer.json, package.json or lockfiles that point at ../boboko-core,
which would break the build for everyone. bin/core-mode enables it via
core.hooksPath on first use, since git doesn't version hooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 15:57:38 +02:00
lexxandClaude Opus 5.5 2d42d83851 Chore: enable re-skills Claude Code plugins at project scope
Shared project settings now only enable plugins from the re-skills
marketplace. Personal permissions belong in .claude/settings.local.json,
which is now gitignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:00:00 +02:00
elvira efc2576c9e Merge branch 'master' into caching-transition 2026-11-03 21:26:34 +02:00
elviraandClaude Opus 5.5 0e7fbaf504 Docs: caching transition roadmap (delete once the transition is done)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:24:09 +02:00
elviraandClaude Opus 5.5 0a516fa681 Deps: update composer packages, Filament assets and @boboko/core 0.31.3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:24:03 +02:00
elviraandClaude Opus 5.5 f7e42f1056 Deps: update packages resolved by the dev entrypoint
docker/entrypoint.sh runs `composer update "boboko/*"
--with-all-dependencies` on boot; this is what it resolved, about 55
packages. boboko/core itself is unchanged. Mostly patch releases,
notably:
- laravel/framework v12.70.0 -> v12.70.2
- filament/* v4.15.2 -> v4.16.0 (published assets in public/ updated)
- livewire/livewire v3.8.10 -> v3.8.11
- stripe/stripe-php v16.6.0 -> v16.6.1
- spatie/laravel-medialibrary 11.23.10 -> 11.23.11
- symfony/* 7.4.x/8.1.x patch releases

Kept separate from the Caddy commit so it's easy to revert. Click
through the admin panel and a Stripe test checkout before deploying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 01:53:45 +02:00
elviraandClaude Opus 5.5 6d88d53882 Infra: Caddy instead of nginx (plain swap, TLS stays in front)
Caddy 2.11.7 built with xcaddy, with caddy-ratelimit pinned to commit
5625512f (for M3/F7 later; its only tag is years old). Prod bakes
public/ and the config into the image (target caddy); dev uses the
caddy-base stage with docker/caddy and public/ bind-mounted.

It's a 1:1 swap for the host's TLS proxy: plain HTTP on
127.0.0.1:${APP_PORT:-8090}, auto_https off, and
trusted_proxies private_ranges so the proxy's X-Forwarded-* headers
still reach Laravel (checked: https + forwarded host in redirects, as
before). Narrow that range once it's known where TLS ends.

Carried over from nginx:
- php_fastcgi to app:9000, 300s read timeout, try_files to index.php
- /build, /static, /packages and /storage (from the storage volume)
  with Cache-Control "public, max-age=31536000, immutable"
- /sitemap.xml from storage/app, max-age=3600, application/xml
- X-Frame-Options SAMEORIGIN + X-Content-Type-Options nosniff
- 100 MiB upload limit (413 above, as before)
- dotfiles denied except /.well-known/
- /stoic/ proxied to stoic:2727, prefix stripped, cookie paths
  rewritten to /stoic/
- access log to stdout, favicon/robots not logged

Changed on purpose:
- FastCGI page cache dropped (and X-Cache-Status with it). The static
  page cache comes later (P2). It also replayed the first visitor's
  Set-Cookie (session + XSRF) to other guests, since it ignored
  Set-Cookie and keyed on URL only.
- New: zstd/gzip compression for text responses (nginx had none).
- Security headers now on every response; prod nginx dropped them on
  PHP responses and on 4xx/5xx.
- A missing file under the static paths is a plain 404 instead of
  Laravel's page with a 404 status.
- No Via or CGI Status header; one Content-Type on the sitemap (nginx
  sent two).
- Dropped as unneeded: open_file_cache, fastcgi buffers/keepalive,
  `charset utf-8` (Caddy's MIME types carry it where it matters).

Stoic's dev config called the app at http://nginx/validate; it's now
http://caddy/validate. bootstrap/app.php and .env.example comments
updated. docker/nginx/ is removed.

Not in this repo, not changed: boboko-test and the boboko starter
still use nginx.

Deploy note: the service is renamed nginx -> caddy; Envoy's
`up -d --remove-orphans` removes the old nginx container. Expect a few
seconds without a listener on 8090 while it swaps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 01:01:13 +02:00
elviraandClaude Opus 5.5 f0a1b928dd Reviews: submit without a redirect, answered with Turbo Streams
The review form now submits through Turbo (data-turbo="true"; Drive
stays off) and storeReview answers with Turbo Streams instead of a
redirect with flashed data:
- success: the new review is prepended to the list (same Blade partial
  as the existing ones), the empty message is removed, the stars/count
  under the title and the tab label are updated (count and average from
  the DB, which is what the index builds them from), the form is removed
  and the thank-you goes into a live region and gets focus
- validation error: 422 + a stream that replaces the form with inline
  errors (aria-invalid/aria-describedby) and the entered values, focus on
  the first invalid field

Nothing on the product page reads the session any more: no
session('reviewSubmitted'), old() or $errors, and
mergeJustSubmittedReview and the justSubmittedReview flash are gone.
searchableSync() stays.

Without JS it's a plain POST that redirects back to ?tab=reviews,
without inline errors or the thank-you, and the new review shows once
Meilisearch catches up. The ?tab=reviews query parameter is noted in
the controller as a variant to handle once product pages are cached.

New: product/partials/review, product/partials/rating-summary,
product/streams/review-stored|review-invalid, and a small
focus-on-connect Stimulus controller that only appears on streamed
markup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:09:58 +02:00
elviraandClaude Opus 5.5 c1acc0067c Layout: Speculation Rules, prerender on hover
A <script type="speculationrules"> in the layout prerenders same-origin
links with eagerness "moderate" (hover or press). Excluded:
- cart, checkout, account, login, logout, wishlist, contact and the
  future /islands, plus the admin (/boboko) and /stoic
- rel~=nofollow and [data-no-prerender]
- listing controls that load into a Turbo Frame (sort, filters,
  pagination): links inside a <turbo-frame> or pointing at one, unless
  they break out with data-turbo-frame="_top" like the product cards

Contact is excluded too, though the task didn't list it: it's a session
page with hCaptcha.

GA4 and a consent banner aren't in this repo, so no page-view delay on
document.prerendering is needed yet. Add one when they're added.

Watch production FPM after this deploy: until pages are cached, every
prerender is a full PHP render, and there are only 8 FPM workers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:05:50 +02:00
elviraandClaude Opus 5.5 bad5a7db69 CSS: cross-document View Transitions
@view-transition { navigation: auto } inside prefers-reduced-motion:
no-preference, so page changes cross-fade in supporting browsers and
stay instant for visitors who ask for less motion. Turbo Frame listing
updates aren't document navigations and are unaffected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:03:32 +02:00
elviraandClaude Opus 5.5 1ff55ac015 Deploy: turn view:cache back on
It was commented out by mistake. Same < /dev/null as its neighbours.
It compiles every view (vendor ones too) and runs cleanly locally, so no
views needed fixing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:02:51 +02:00
elviraandClaude Opus 5.5 702609da1e Header: account and wishlist links no longer depend on login
Both links are now the same for every visitor, so the header can be
cached:
- Account always goes to route('account'); the auth middleware sends
  guests to login, and after login they land back on the account page
  (url.intended) instead of home.
- Wishlist always goes to route('wishlist'); WishlistController::guest
  already redirects logged-in users to account.wishlist.
- One neutral label, storefront.nav.account, on desktop and mobile.

header.blade.php no longer calls auth().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:02:34 +02:00
elviraandClaude Opus 5.5 4fc7880187 Markup: stable island targets for wishlist, account link and CSRF meta
- x-wishlist-button gets data-wishlist-product on its form root; the
  server-rendered aria-pressed stays for now.
- Both header account links (desktop and mobile menu) share
  [data-account-link].
- The CSRF meta tag gets id="csrf-token".

No visible change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:01:42 +02:00
elviraandClaude Opus 5.5 6948c134e3 Header: give the cart badge a stable id for islands
The badge is absolute inside the fixed-size cart button, so showing it
or growing from 1 to 2 digits doesn't move the header. Adds #cart-badge
as a Turbo Stream target and records the rule that no island may change
the size of its container. cart-count-controller is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:01:21 +02:00
50 changed files with 1651 additions and 1021 deletions

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
{
"extraKnownMarketplaces": {
"re-skills": {
"source": {
"source": "git",
"url": "git@code.radical-elements.com:radical/re-skills.git"
},
"autoUpdate": true
}
},
"enabledPlugins": {
"design@re-skills": true,
"seo@re-skills": true,
"studio@re-skills": true,
"engineering@re-skills": true,
"boboko@re-skills": true
}
}
+1 -1
View File
@@ -76,7 +76,7 @@ VITE_APP_NAME="${APP_NAME}"
SESSION_SECURE_COOKIE=true SESSION_SECURE_COOKIE=true
# Stoic is the headless CMS, proxied at /stoic/ behind the app in prod (see docker/nginx/prod.conf) # Stoic is the headless CMS, proxied at /stoic/ behind the app (see docker/caddy/common.caddy)
STOIC_SECRET=dev-secret-change-me STOIC_SECRET=dev-secret-change-me
STOIC_SSO_SECRET=dev-sso-secret-change-me STOIC_SSO_SECRET=dev-sso-secret-change-me
STOIC_HOST=http://localhost:2727 STOIC_HOST=http://localhost:2727
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
exec bin/check-core-mode
+2
View File
@@ -27,3 +27,5 @@ Homestead.json
Homestead.yaml Homestead.yaml
Thumbs.db Thumbs.db
.exports .exports
.claude/settings.local.json
+329
View File
@@ -0,0 +1,329 @@
# Caching transition: context and first tasks (for Claude)
> **Temporary roadmap.** Delete this file once the caching transition is
> done; it's only needed while the work is in progress.
Written 2026-11-02 from a planning session in `boboko-research`, updated the
same day with the team's decisions. Read this before working on the tasks
below. Front-end conventions are still in [CLAUDE.md](CLAUDE.md), and that
file wins on style, Greek register, localization and performance rules.
Source documents (outside this repo, read-only for context):
- The research repo (`lexx/research` on code.radical-elements.com), `products/boboko/`:
- `caching-islands.md`: the target design (partly superseded, see "Changed on 2026-11-06")
- `tech-platform.md`: the platform plan
- `manifesto.md`: the principles decisions are checked against
- `tasks.md` (the full task list and **source of truth for task ids**) and `team-discussion.md`
(open items D7, D10) were written in the same planning session but aren't in the research
repo. Ask the team for them.
The rules that come out of this work are written up as skills in the **`boboko` Claude Code
plugin** (re-skills marketplace): `cacheable-pages` above all, plus `storefront-frontend`,
`storefront-performance` and `storefront-translations`.
Every task is also a card on the Planka board (3dealer.gr → Development,
label **Transition**). The task id (A1, W1…) is in each card's description.
**boboko-core is paused** (the backend developer is on leave). Only do the
tasks below that don't need core. A0 waits until core work resumes.
## Where we're going
**Every catalogue page becomes the same HTML for every visitor**, cached
(probably as static files Caddy serves without PHP). Anything personal (cart,
login state, wishlist, CSRF token) comes from **one small "islands" request**
that runs only when the visitor has a state cookie, and is answered with
**JSON** that Stimulus applies to elements already in the page.
- Cacheable routes (home, category, product, `/products`, FAQ, legal pages)
will run **without a session**: no cookies, no CSRF token, no `auth()`, no
flash, no `old()`, no `$errors`.
- Session routes (cart, checkout, account, login, contact, islands, writes)
stay in `web`.
- Writes (add to cart, wishlist toggle, review) are normal forms enhanced with
`fetch`, answered with JSON. New markup (e.g. a new review) is cloned from a
Blade-rendered `<template>` of the same component.
**Changed on 2026-11-06 (these replace the matching 2026-11-02 decisions below):**
- **No Turbo at all**: no Drive, Frames or Streams. Islands and writes answer with
**JSON**; Stimulus applies it as text and attributes on existing targets. New
markup comes from a Blade `<template>` of the same component, filled with
`textContent`, the same pattern as the Meilisearch search cards. Existing Turbo
code (listing/search Frames, the review Streams from A4) gets replaced.
- **One hint cookie, `bb_state=1`** (has a cart, a login or a wishlist item), with
no count in it. One `GET /{locale}/islands` when it's present, nothing otherwise.
- **Speculation Rules: `prefetch`, not `prerender`.** Prerender runs every analytics,
pixel and consent script on pages nobody may see. Revisit only once pages are
cached and the pilot shows analytics stay correct.
- **Where the standard storefront template lives** (core or starter) is decided once
3dealer is ready.
**Decided (2026-11-02):**
- ~~Turbo Streams for islands and writes~~ (replaced: JSON, see above); the cart
badge starts as a fixed-size placeholder.
- Laravel 13 (core C0, then A0 here), once core work resumes.
- **Page cache: static files** served by Caddy (later tasks P1–P3).
- **No Turbo Drive** (now: no Turbo at all). A normal multi-page site plus
Speculation Rules, View Transitions and back/forward cache (A7–A9 here).
- **Caddy** replaces nginx (W1, the last task in this file).
- **Search and filters will run in the browser against Meilisearch** through
Caddy on a subdomain, with the card as one Blade component reused through a
`<template>` (Meilisearch track M1–M6, not in this list).
- **URLs become id + slug** (`/el/products/123-blue-vase`), core C7 first,
then A10 here (not in this file).
- `view:cache` was commented out by mistake (A6).
## Where 3dealer is today (personal state found in catalogue pages)
| What | Where | Handled by |
|---|---|---|
| `auth()->check()` branching (4 places) | `resources/views/components/header.blade.php` | **A2** |
| Cart badge count | header, `data-cart-count-target="badge"`; primed from the drawer's server-rendered count | **A1** (placeholder), core C2/C3 (content) |
| Cart drawer body rendered on every page | `@include('checkout::drawer')` in `layouts/app.blade.php` (view lives in boboko-core) | core C3, **not here** |
| Wishlist heart state | `components/wishlist-button.blade.php` calls `WishlistService::has()` | **A3** (target only), core C3 (state) |
| Review flash, `old()`, `$errors`, `mergeJustSubmittedReview` | `product/show.blade.php`, `components/review-form.blade.php`, `ProductController` | **A4** |
| `@csrf` in forms + `<meta name="csrf-token">` | add-to-cart (core), wishlist, review, newsletter, layout | Later (CS1 in core, CS2 here, after Laravel 13 and core C2). **Leave as is** |
| Stoic staff embed (`@auth('staff')`) | `layouts/app.blade.php` | Core C2 (via islands), **not here**. Stoic itself may be dropped later |
Other facts worth knowing:
- Turbo is installed, but **Drive is off** (`window.Turbo.session.drive = false`
in `resources/js/app.js`). Frames drive the listing, search and sort. **The
direction is no Turbo at all**: don't add to it; Frames go away with the
Meilisearch track, and `@hotwired/turbo` is removed once nothing uses it.
- Catalogue data comes from Meilisearch via boboko-core's `ProductService`.
Listings use query-string filters. Don't change that in these tasks; the
browser-side rewrite is the M track.
- Product reviews have **no moderation**: they go live immediately. The index
update is async, which is why `mergeJustSubmittedReview` exists.
- URLs use numeric ids (`/products/{id}`). Don't change routes in these
tasks; that's A10, after core C7.
## Rules for this work
- **3dealer only.** Don't edit `vendor/boboko/core` or `../boboko-core`. If a
task turns out to need a core change, stop and write down what's needed
instead (core tasks are planned separately in `tasks.md`).
- **The site must keep working exactly as today** after each task. These
tasks prepare the page; they don't switch on caching.
- Only the tasks in this file (A1–A9, W1; A0 once core resumes). The other
decided work (page cache, Meilisearch in the browser, URLs) needs core
first and has its own tasks and order.
- Follow the `{locale}` controller rule in CLAUDE.md (`$locale` is the first
parameter).
- UI strings: reuse existing `storefront.*` keys where possible. New keys are
DB-backed Language Lines (the `storefront-translations` skill), never `lang/`
files, and they must reach core's seeder (`boboko:translations:pull`).
## Status (2026-11-06)
| Task | Status |
|---|---|
| A0 Laravel 13 | Waiting for core C0 |
| A1 Cart badge placeholder | Done (`6948c13`) |
| A2 Header without login checks | Done (`702609d`) |
| A3 Stable island targets | Done (`4fc7880`) |
| A4 Reviews without a redirect | Done with Turbo Streams (`f0a1b92`). **Rework to JSON** (see A4 below) |
| A5 Personal-state test | Not started |
| A6 `view:cache` in deploy | Done (`1ff55ac`) |
| A7 View Transitions | Done (`bad5a7d`) |
| A8 Back/forward cache | No commit yet |
| A9 Speculation Rules | Done with `prerender` (`c1acc00`). **Switch to `prefetch`** (see A9 below) |
| W1 Caddy | Done (`6d88d53`) |
## Tasks to work on now
### A0. Laravel 13 (S, waits for core C0: skip for now)
**Only once boboko-core has a tagged release that allows `laravel/framework
^13`.** Until then, skip it and do the others.
- Bump `laravel/framework` to `^13.0` and update `boboko/core` to that
release. Lunar stays on 1.5.0.
- Go through the Laravel 13 upgrade guide for app code (config, middleware in
`bootstrap/app.php`, anything deprecated), and note what changed around
CSRF (the `Sec-Fetch-Site` origin check) for later tasks CS1/CS2.
- Click through: home, category, product, search, cart drawer, checkout with
Stripe test mode, account, login/logout, the admin panel.
- **Done when:** `composer.lock` is on Laravel 13, the tests pass, and the
click-through shows nothing broken.
### A1. Cart badge as a fixed-size placeholder (S)
- The badge in `components/header.blade.php` (`data-cart-count-target="badge"`)
is `absolute` inside the button, so its appearance probably doesn't shift
the layout. **Verify** on mobile and desktop widths (CLS: no movement of the
header or icons when the count appears or changes, including 1 → 2 digits).
- Give it a stable `id` (e.g. `cart-badge`) so a Turbo Stream can target it.
- Keep `cart-count-controller.js` working as today (it listens for
`bbk-cart:updated`).
- **Rule to record in a comment:** no island may change the size of its
container.
- **Done when:** a stable id exists, behaviour is unchanged, and no layout
shift is measurable.
### A2. Header links that don't depend on login (S)
- The account icon always links to `route('account')`. The `auth` middleware
already redirects guests to login (`redirectGuestsTo` in
`bootstrap/app.php`).
- The wishlist icon always links to `route('wishlist')`. Make
`WishlistController::guest` redirect logged-in users to `account.wishlist`.
- One neutral aria-label for the account link (`storefront.nav.account`)
instead of switching to the login label.
- Both the desktop and mobile parts of the header (≈ lines 50–62 and 175–189).
- **Done when:** `header.blade.php` contains no `auth()` call, and guests and
logged-in users still end up on the right pages.
### A3. Stable island targets in the markup (S)
- `x-wishlist-button`: add `data-wishlist-product="{{ $productId }}"` on the
form root. **Keep** the current server-side `aria-pressed` state for now
(core will move it to islands later).
- The account link: a stable `id` (e.g. `header-account-link`) on both the
desktop and mobile versions, or one shared attribute selector.
- `<meta name="csrf-token">` in the layout: a stable `id` (e.g. `csrf-token`).
- **Done when:** each personal element has a stable selector, with no visible
change.
### A4. Review submission without a redirect (M)
Today `ProductController::storeReview` validates, creates a `ProductReview`,
calls `searchableSync()`, and redirects to `?tab=reviews#product-tabs` with
`withErrors`/`withInput` or a `reviewSubmitted` + `justSubmittedReview` flash.
Change it to (**updated 2026-11-06: JSON, no Turbo**; the first version used
Turbo Streams and needs reworking):
- A Stimulus controller that submits the form with `fetch` and
`Accept: application/json`. Remove `data-turbo="true"` and the stream views
(`product/streams/`).
- **Success:** a JSON response (the review, display-ready, plus count and
average). The controller clones a Blade-rendered `<template>` of the same
review component, fills its slots with `textContent`, prepends it to the
list, updates the count and average, and swaps the form for the thank-you.
- **Validation errors:** 422 with `{ "errors": { … } }` (what
`$request->validate()` already returns for a JSON request), filled into the
form's existing error slots, with `aria-invalid`. No session `old()`/`$errors`.
- Remove `session('reviewSubmitted')` from `product/show.blade.php`,
`old()`/`$errors` from `review-form.blade.php`, and
`mergeJustSubmittedReview` and the `justSubmittedReview` flash from the
controller.
- Keep `searchableSync()`.
- **No-JS fallback:** a plain POST may still redirect back to the product
page. That fallback may lose inline errors, which is acceptable.
- Accessibility: announce the result in a live region, and move focus to the
thank-you message or the first invalid field.
- Leave the `?tab=reviews` query parameter alone for now, but note it: it's a
query-string variant of the product page, which matters once pages are
cached.
- **Done when:** a submitted review appears immediately without a page load,
errors show inline, and nothing on the product page reads the session.
### A5. Test for personal state on catalogue pages (S)
- A feature test (in this repo's existing `tests/` setup) that renders home, a
category, a product, `/products`, FAQ and the legal pages **as a guest**, and
asserts the HTML has no per-visitor content.
- Start with assertions that pass after A2–A4 (no `auth()`-dependent markup,
no review flash/old input), and **mark the rest as expected failures/skipped
with a reason**: the drawer cart body and wishlist state (core C3), the CSRF
token (CS1/CS2), and the Stoic staff embed (core C2).
- It will need seeded catalogue data, or Meilisearch mocked through
`ProductService`. Check how the app can be booted in tests first, and say
so if that's harder than an S.
- **Done when:** the test runs in CI/locally, passes for what's done, and lists
what's still missing.
### A6. Turn `view:cache` back on in the deploy (S)
- In `Envoy.blade.php` (`artisan_optimize` task), uncomment the `view:cache`
line and give it the same `< /dev/null` as its neighbours.
- First run `php artisan view:cache` locally (in the app container). It
compiles **every** view, vendor ones included, so a broken view that is
never rendered would now fail the deploy. Fix or remove any that fail.
- **Done when:** `view:cache` runs cleanly locally and is in the deploy.
### A7. Cross-document View Transitions (S)
- Add `@view-transition { navigation: auto; }` to the CSS, inside
`@media (prefers-reduced-motion: no-preference)` so it's off for visitors
who ask for less motion.
- Check in Chrome that the header, the cart drawer and the cookie banner
don't flash or jump during a transition. If the default cross-fade looks
wrong on some element, give it a `view-transition-name` or exclude it;
keep it minimal.
- Browsers without support just navigate normally. Turbo Frame listing
updates aren't document navigations, so they're unaffected.
- **Done when:** page changes cross-fade in Chrome, nothing else changes
visibly, and reduced-motion turns it off.
### A8. Back/forward cache eligibility (S)
- In Chrome DevTools → Application → Back/forward cache, run the test on
home, a category, a product and `/products`, as a guest and logged in.
- Fix every blocker it reports that lives in 3dealer: `unload` listeners
(ours or a third-party script's), `Cache-Control: no-store` on catalogue
pages, open connections. Use `pagehide` instead of `unload` where something
needs to run on leave.
- Known gap, **not here**: a restored page shows the cart as it was. Core's
C2 refreshes on `pageshow` with `event.persisted`. Just note it.
- Write down any blocker that only core or a vendor script can fix.
- **Done when:** the DevTools test reports "restored from back/forward cache"
on those pages, or each remaining blocker is listed with its owner.
### A9. Speculation Rules (S)
> **Updated 2026-11-06:** use `prefetch`, not `prerender` (see "Changed on
> 2026-11-06"). The rest of this task stands; once Turbo Frames are gone, the
> Frame-link exclusions can go too.
- In the layout, a `<script type="speculationrules">` with `prerender`,
`eagerness: "moderate"` (hover or press), for same-origin links.
- **Exclude:** cart, checkout, account, login, logout (it's a POST, but
exclude the path anyway), wishlist, `/islands` (future), links with
`rel~=nofollow`, links inside the Turbo Frame listing controls (filters,
sort, pagination: those load into the frame, not as a new page), and
anything marked `data-no-prerender`. Use `where` with `href_matches` /
`selector_matches`.
- Check that GA4 and the consent banner count a page view **only when the
prerendered page is actually shown** (DevTools → Application → Speculative
loads lets you inspect a prerendered page). If one doesn't, delay it on
`document.prerendering` / `prerenderingchange`.
- Until pages are cached, each prerender is a full PHP render with 8 FPM
workers. Mention it in the commit message so production FPM is watched
after the deploy.
- **Done when:** hovering a product or category link in Chrome prerenders it
(visible in DevTools), excluded links don't, and analytics counts are
unchanged.
### W1. Caddy instead of nginx (M)
- Today: `docker/nginx/default.conf` (dev) and `prod.conf` (prod, with the
FastCGI cache block), `nginx` service in `docker-compose.yml`.
- A Caddy image built with `xcaddy`, including the `caddy-ratelimit` module
(needed later for the search subdomain M3 and rate limits F7). Pin the
Caddy and module versions.
- Caddyfile: `php_fastcgi` to the app container, static assets from
`public/` with the same long cache headers nginx sends, compression
(zstd/gzip), the same security headers, the same upload size limit, the
`/up` health check. Copy each rule over deliberately; list anything you
drop and why.
- **No page cache in Caddy** and no FastCGI-style cache: the static page
cache comes later (P2).
- **TLS:** find out first how it ends today (a host proxy, Cloudflare, or
the container). Don't switch on Caddy's automatic TLS until that's clear;
ask if it isn't findable in the repo or Envoy.
- Dev stays usable (`docker compose up` works, Vite still proxied as today).
- Remove the nginx files and service once Caddy works. boboko-test and the
starter are separate repos: note them, don't edit them.
- **Done when:** dev and a production-like local run serve every page,
asset, upload and the admin panel through Caddy, response headers match
today's (compare `curl -I` on a few URLs before and after), and no nginx
config is left in this repo.
## Suggested order
1. A1 → A3 → A2 (small header/markup work, one commit each).
2. A6, A7, A8, A9 (small, independent; one commit each).
3. A4, then A5 (the test confirms A2–A4).
4. W1.
5. A0 only once core C0 is tagged.
+40 -199
View File
@@ -1,215 +1,56 @@
# Front-end Guidelines # 3dealer
This is a Laravel 12 e-commerce project using Lunar PHP (headless). These guidelines apply to all front-end work. The storefront for 3dealer.gr: a boboko shop (Laravel + Lunar, on top of the shared
`boboko/core` package). It's also the **reference shop**: boboko's standard storefront is being
worked out here.
--- ## Shared rules: the `boboko` plugin
## Project Language Settings The rules for every boboko shop are in the **`boboko` Claude Code plugin** (re-skills
marketplace, enabled in `.claude/settings.json`). Its skills load when the work calls for them:
<!-- CHANGE THESE PER PROJECT --> | Skill | For |
- **Greek register:** `singular` — use the informal second person (εσύ/σου/σε). e.g. "Η κριτική σου", "Το όνομά σου", "Το email σου"
<!-- singular = informal (εσύ) | plural = formal (εσείς) -->
All UI text written for this project must follow the register above.
---
## Localization
Uses classic Laravel localization (https://laravel.com/docs/13.x/localization) — no third-party i18n routing package.
**Locales:** Greek (`el`) is primary/default, English (`en`) is secondary. Set in `config('app.available_locales')` (`config/app.php`).
**URL structure:** every route is prefixed with `{locale}`, including the default — `3dealer.gr/el/...` and `3dealer.gr/en/...`. Bare root (`/`) 301-redirects to `/el` (see `routes/web.php`). This avoids the ambiguity of an unprefixed default locale (see the reasoning in project memory / past conversation — prefixing every locale keeps hreflang symmetrical and scales cleanly to a third language later).
**URL slugs are the same across both locales, permanently** — e.g. `/el/products/{x}` and `/en/products/{x}`, not `/el/proionta/{x}` vs `/en/products/{x}`. This is a deliberate, standing decision for this project, not a placeholder to revisit later. Only the visible content is translated, not the slug. Do not introduce per-locale translated slugs (e.g. a `lang/{locale}/routes.php` segment map) unless the user explicitly asks for that to change.
**How it's wired:**
- All routes live inside `Route::prefix('{locale}')->where('locale', ...)->middleware('setlocale')` in `routes/web.php`.
- `App\Http\Middleware\SetLocale` validates the `{locale}` segment (404s if not in `available_locales`), calls `App::setLocale()`, and shares `$currentLocale`, `$altLocale`, and `$altLocaleUrl` (the same page in the other locale) to every view — this is what powers both the header's language switcher and the `<head>` hreflang tags in `resources/views/layouts/app.blade.php`. Don't recompute this logic elsewhere; read those shared variables instead.
- When adding a new route, put it inside that `{locale}` group and give it a route `name()` — the alt-locale URL generation in the middleware depends on the current route being named (falls back to the locale root if unnamed).
- When linking to a page in Blade, prefer `route('name', [...])` (locale is a normal route param, defaults to `app()->getLocale()` implicitly via the shared route group) over hand-built path strings, except for pages that don't have a controller/route yet (e.g. `/products`, `/contact`, `/cart` placeholders in the header currently use `url('/'.app()->getLocale().'/products')` — replace with `route()` once those pages exist).
- **Every controller action for a route inside the `{locale}` group must declare `$locale` as its first parameter, even if unused** — e.g. `show(string $locale, Product $product)`. Laravel's `ControllerDispatcher` ultimately calls the controller with `...array_values($parameters)`, i.e. **positionally**. If a route-bound model parameter (like `$product`) isn't preceded by a matching `$locale` parameter in the method signature, the resolved values shift out of position and the wrong value (the locale string) gets passed where the model was expected — a `TypeError` that's easy to misread as a binding failure. Closures with zero declared parameters are unaffected (PHP just ignores the extra positional arg), so this only bites real controller methods.
**Where translatable strings go:**
- Most UI copy is editable by the client/marketing team via **Stoic** (the headless CMS) — don't hardcode it here.
- Small strings that don't need client editing (nav labels, aria-labels, tab labels, pluralized counts) go in Laravel's own lang files at **`lang/{locale}/*.php`** (project root, per Laravel 12+ convention — not `resources/lang`). Current file: `lang/el/general.php` / `lang/en/general.php`. Use `__('general.key')` or `trans_choice('general.key', $count, [...])` for pluralized strings.
---
## Tech Stack
- **Laravel 12** + **Lunar PHP 1.3** (headless e-commerce)
- **Blade** for templating (`@extends`, `@section`, `@yield`, components)
- **Tailwind CSS v4** via `@tailwindcss/vite` — zero config, `@import 'tailwindcss'` only
- **Stimulus JS** for interactivity — controllers registered in `resources/js/stimulus/index.js`
- **Popover API** (native browser) for overlays — no JS overlay libraries
- SQLite database, `npm run dev` for local asset compilation
---
## Key File Locations
| What | Where |
|---|---| |---|---|
| CSS entry point | `resources/css/app.css` | | `boboko-platform` | How core, starter and the shops fit together; where new code goes; approved third-party scripts |
| Font definitions | `resources/css/fonts.css` | | `cacheable-pages` | Catalogue pages identical for every visitor; islands; JSON writes. **Read before touching catalogue pages, the header, the layout or any form** |
| JS entry point | `resources/js/app.js` | | `storefront-frontend` | Tailwind, tokens, components, Popover, Stimulus, ARIA, Greek capitals, forms |
| Stimulus controllers | `resources/js/stimulus/` | | `storefront-performance` | Core Web Vitals: bundling, fonts, LCP images, CLS, Speculation Rules, bfcache |
| JS utilities | `resources/js/utils/` | | `locale-routes` | `{locale}` routes, `$locale` first in controllers, same slugs, hreflang |
| Layout | `resources/views/layouts/app.blade.php` | | `storefront-translations` | `storefront.*` labels as Language Lines; getting keys into core |
| UI components (atomic) | `resources/views/components/ui/` | | `core-local-dev`, `releasing-core` | Working on core alongside this shop; releasing and `bin/deploy` |
| Section components | `resources/views/components/` |
| Page views | `resources/views/{page}/` |
| Public assets | `public/images/` |
--- If something below conflicts with a skill, this file wins for 3dealer. Say so, so the skill or
this file gets fixed.
## Design Reference **Work in progress:** [CACHING-TRANSITION.md](CACHING-TRANSITION.md) has the current transition's
decisions, task status and rules. Known problems: [README.md](README.md), "Known issues".
The Bluebeard template (`resources/css/bluebeard.css`) is used as a **reference only** for colors, spacing, typography, and effects. It is never imported or used directly. Everything is translated to Tailwind utilities or custom CSS where unavoidable. ## Greek register
The boboko project at `/Users/farenoubi/Projects/boboko-test` can be referenced for CSS architecture patterns. - **Greek register:** `singular`. Use the informal second person (εσύ/σου/σε), e.g.
"Η κριτική σου", "Το όνομά σου", "Το email σου".
--- All UI text written for this project follows it, including labels added in the admin.
## Tailwind vs. Custom CSS ## Design tokens
**Prefer Tailwind utilities by default.** Write custom CSS only when something genuinely cannot be expressed as a utility: In `@theme {}` in `resources/css/app.css`:
- Pseudo-elements (`::before`, `::after`) with dynamic transforms or transitions - `--font-sans`: **Manrope** (body text).
- Complex descendant/sibling selectors (e.g. `.group:hover .nav-dropdown`) - `--font-display`: **Manrope** (headings, nav, buttons). Kept separate from `--font-sans` in
- Keyframe animations case they diverge later.
- The underline-slide animation on nav links (background-size trick) - `--color-brand` / `--color-brand-light`: the brand greens.
- `--text-h1` … `--text-h4`: the heading sizes.
**Never** write inline CSS (`style="..."`). **Never** write custom CSS for something Tailwind already covers. Reuse these and the colours already in use (`neutral-200`, `black`) before adding anything.
The Manrope weights used above the fold are preloaded in `layouts/app.blade.php`; a new heavy
weight in a hero needs its own preload there.
When a component requires a CSS class (e.g. as a hook for a pseudo-element), still put all properties that can be Tailwind utilities as classes on the element in the component file. The CSS rule should contain only what genuinely cannot be a utility — pseudo-elements, complex selectors, keyframes. Do not default to putting all styles in the CSS class just because the class exists. ## 3dealer specifics
When custom CSS is needed, add it to `resources/css/app.css` inside `@layer components`. Keep the rule minimal — only what can't be a utility. - **Product custom fields** (text answers and photo uploads on the product page): how they work,
limits and clean-up are in [README.md](README.md). Products with custom fields can't be
--- quick-added from cards.
- **hCaptcha** protects the contact and login forms only.
## Design Tokens - **Stoic** provides the FAQ, legal pages and other client-edited copy (`App\Services\Stoic`,
`App\Models\Stoic*`).
Defined in `@theme {}` in `app.css`:
- `--font-sans`: Manrope (body text)
- `--font-display`: Manrope (headings, nav, buttons) — kept separate from `--font-sans` in case they diverge later
Reuse existing colors (`neutral-200`, `black`), font sizes, spacing, and border styles as components are built. Do not invent new values — check what's already in use first.
---
## Component Structure
### `resources/views/components/ui/` — atomic, reusable UI elements
Single-purpose, stateless or minimally stateful elements used across many contexts:
- `button.blade.php` ✓
- `input.blade.php`
- `input-group.blade.php`
- `icon.blade.php`
- `image.blade.php`
- `tabs.blade.php` / `tab.blade.php`
- `accordion.blade.php`
- `tooltip.blade.php`
- `badge.blade.php`
- etc.
### `resources/views/components/` — section-level or composite components
Larger reusable blocks made of several elements, often with real content:
- `header.blade.php` ✓
- `footer.blade.php`
- `cta.blade.php`
- `product-card.blade.php`
- `contact-section.blade.php`
- etc.
---
## Interactivity
### Popover API for overlays
For **tooltips, modals, dropdowns, and any overlay**: use the native [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) with CSS — no JS, no libraries.
```html
<button popovertarget="my-popover">Open</button>
<div id="my-popover" popover>...</div>
```
Style open/closed states with `[popover]` and `:popover-open` selectors in CSS.
### Stimulus JS for behavior
Use Stimulus when JS is genuinely needed (form handling, cart updates, dynamic state, etc.).
- Keep controllers lean: manage state and coordinate the DOM, don't build UI inside them
- Use Stimulus values, targets, and outlets — avoid reading from the DOM imperatively
- **Never inject HTML strings or classes from inside a controller.** Instead, drive appearance via data attributes or CSS classes toggled on existing elements, and let CSS handle the visual result
- Never write inline JS (`onclick="..."`, etc.)
### Pure CSS for simple interactions
Hover dropdowns, focus states, active states — handle with CSS (`:hover`, `:focus-within`, `.group:hover`) before reaching for Stimulus.
---
## Accessibility (ARIA)
Always add ARIA attributes. This is not optional:
- Interactive elements: `aria-label`, `aria-expanded`, `aria-controls`, `aria-haspopup` as appropriate
- Images: meaningful `alt` text, or `alt=""` + `aria-hidden="true"` for decorative images
- Icons used as buttons: `aria-label` on the button, `aria-hidden="true"` on the SVG
- Form fields: always associated `<label>`, `aria-describedby` for hints/errors
- Dynamic content: `aria-live` regions where content updates without navigation
- When refactoring or adding interactivity, review ARIA impact — don't break existing roles
---
## Greek Typography
CSS `text-transform: uppercase` leaves Greek tonos accents in place (e.g. Ά instead of Α), which is incorrect. The utility at `resources/js/utils/strip-accents.js` handles this automatically for any element with the `uppercase` Tailwind class. **Always add the `uppercase` class to elements** rather than applying `text-transform: uppercase` in CSS — this keeps the strip-accents utility working without extra configuration.
---
## Performance & Core Web Vitals
Every frontend change should assume it will be measured by PageSpeed/Lighthouse. These rules exist because we hit each of these mistakes in production and had to fix them after the fact — bake them in up front instead.
### CSS bundling
- Before adding a CSS import to a shared/global entry point (e.g. `app.css`), ask whether every page actually needs it. Page- or component-specific styles (date pickers, legal-page typography, admin-only widgets) should not ship on pages that don't use them.
- Scope non-critical CSS to load only where it's used — either a dedicated build entry for that page, or import the `.css` file inside the same JS module that already lazy-loads that component (e.g. a Stimulus/JS controller), so the bundler emits it as a separate chunk fetched only when that component actually mounts.
- Exception: never defer CSS for anything the page shows immediately on load (above-the-fold content, or a component that renders as soon as its JS runs — an FAQ accordion, a cookie-consent banner). Even a well-scoped async CSS chunk arrives a beat after the JS that displays the element, causing a visible flash of unstyled/wrong-state content and a layout shift. Keep that CSS in the blocking bundle on purpose.
- Never import a full icon-font library (Phosphor, Font Awesome, etc.) — it ships every icon regardless of usage. Use inline SVGs for only the icons actually referenced; check the shared icon component for an existing icon before adding a new one.
- Only declare design tokens / CSS custom properties that are actually used somewhere in the codebase (Tailwind v4 already tree-shakes unused `@theme` tokens from output, so this is for keeping the source legible, not for bytes).
### Fonts
- `font-display: swap` means any text using a font weight will visibly reflow once that weight's file finishes downloading, if the fallback font's metrics differ. Preload every font weight used in above-the-fold text, not just the default body-copy weight — bold/black heading weights are usually the most visually prominent element on the page and cause the most visible reflow if not preloaded.
- When introducing a new heavy-weight text utility (e.g. a bold/black heading class) in a hero or above-the-fold component, confirm that weight has a matching `<link rel="preload" as="font">` in the layout `<head>`.
### Images
- Any image that could be the Largest Contentful Paint element (hero/banner images) must have: `fetchpriority="high"`, `loading="eager"`, explicit `width`/`height`, a responsive `srcset`/`sizes`, and a `<link rel="preload" as="image">` in `<head>` with matching `imagesrcset`/`imagesizes` — this lets the browser start the fetch as soon as it parses `<head>`, instead of waiting to discover the `<img>` tag in the body.
- Every other image: `loading="lazy"` with explicit `width`/`height` to reserve its layout space.
### Layout shift (CLS)
- Never animate `top`/`bottom`/`left`/`right`/`width`/`height`/`margin` on any element that appears or moves without direct user interaction (banners, toasts, slide-in modals, accordions). These are layout-affecting properties — the browser recalculates layout on every animation frame, and each frame's position delta counts toward CLS. Animate `transform` (translate/scale) and `opacity` instead — both are compositor-only and fully excluded from CLS scoring, no matter how far or long the animation runs.
- This applies to vendor/third-party CSS too (cookie-consent widgets, modal libraries) — check its default show/hide mechanism before shipping, and override it if it animates a layout property directly.
- Any element with a collapsed/expanded default state (accordions, dropdowns) needs its collapsed-state CSS in the blocking stylesheet, never a lazily-loaded chunk — otherwise it renders in its expanded/default state for a frame before the async CSS applies.
---
## Forms
Never add `novalidate` to forms. Always use the browser's default validation.
---
## Asking Questions
When the approach is unclear — layout structure, whether something should be a component, which Tailwind pattern fits — **ask before building**. A short question is cheaper than a refactor.
+15 -3
View File
@@ -103,10 +103,22 @@ EXPOSE 9000
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm8.5", "-F"] CMD ["php-fpm8.5", "-F"]
# ── Stage 5: Nginx (public assets baked in from production) ────────────────── # ── Stage 5a: Caddy binary (xcaddy, pinned versions) ─────────────────────────
FROM nginx:alpine AS nginx # caddy-ratelimit isn't used yet: it's for the search subdomain (M3) and the
# PHP-route rate limits (F7). Its only tag (v0.1.0) is years old, so it's
# pinned to a commit.
FROM caddy:2.11.7-builder-alpine AS caddy-build
RUN xcaddy build v2.11.7 \
--with github.com/mholt/caddy-ratelimit@5625512f24f6f59d6f64fb3aafe5eecff0b286db
COPY docker/nginx/prod.conf /etc/nginx/conf.d/default.conf # Development uses this stage as is, with docker/caddy and public/ bind-mounted
# (docker-compose.dev.yml).
FROM caddy:2.11.7-alpine AS caddy-base
COPY --from=caddy-build /usr/bin/caddy /usr/bin/caddy
# ── Stage 5b: Caddy for production (config + public assets baked in) ─────────
FROM caddy-base AS caddy
COPY docker/caddy/global.caddy docker/caddy/common.caddy docker/caddy/Caddyfile /etc/caddy/
COPY --from=production /var/www/html/public /var/www/html/public COPY --from=production /var/www/html/public /var/www/html/public
# ── Stage 6: Development ────────────────────────────────────────────────────── # ── Stage 6: Development ──────────────────────────────────────────────────────
+1 -1
View File
@@ -49,7 +49,7 @@
cd {{ $path }} cd {{ $path }}
{{ $compose }} exec -T app php artisan config:cache < /dev/null {{ $compose }} exec -T app php artisan config:cache < /dev/null
{{ $compose }} exec -T app php artisan route:cache < /dev/null {{ $compose }} exec -T app php artisan route:cache < /dev/null
{{-- {{ $compose }} exec -T app php artisan view:cache --}} {{ $compose }} exec -T app php artisan view:cache < /dev/null
{{ $compose }} exec -T app php artisan event:cache < /dev/null {{ $compose }} exec -T app php artisan event:cache < /dev/null
@endtask @endtask
+18
View File
@@ -27,3 +27,21 @@ ## Product custom fields
- **Photos are cleaned up automatically.** Photos never added to a cart are deleted by `custom-fields:prune-uploads` (see above). A photo on a cart line is kept as long as that cart line exists, and a photo on an order is kept indefinitely. - **Photos are cleaned up automatically.** Photos never added to a cart are deleted by `custom-fields:prune-uploads` (see above). A photo on a cart line is kept as long as that cart line exists, and a photo on an order is kept indefinitely.
- **Products with custom fields can't be quick-added.** On product cards, the "add to cart" button becomes a link to the product page. - **Products with custom fields can't be quick-added.** On product cards, the "add to cart" button becomes a link to the product page.
- Field labels are entered once in the admin and aren't translated, so they appear as entered in both `/el` and `/en`. - Field labels are entered once in the admin and aren't translated, so they appear as entered in both `/el` and `/en`.
## Known issues
Found 2026-11-06 while setting up the `boboko` Claude Code plugin. Remove an entry once it's fixed.
- **Storefront labels aren't seeded on boot.** `docker/entrypoint.sh` runs the `checkout` and
`validation` translation seeders, but not `StorefrontTranslationsSeeder`, so new
`storefront.*` keys released in core never reach an environment by themselves. Fix: add it
next to the other two.
- **About 20 `storefront.*` keys exist only in this shop's database**, not in core's seeder:
all `footer.*` and `errors.*`, `nav.faq`, `nav.menu`, `search.no_results`,
`search.results_count`, `shop.filters`, `contact.privacy_notice`. A fresh environment shows
them as raw keys. Fix: `bin/core-mode local`, then
`bin/dc-core.sh exec app php artisan boboko:translations:pull`, then commit and release core.
- **Home hero carousel images (LCP).** In `resources/views/home.blade.php`, every slide gets
`loading="eager"` and `fetchpriority="high"` (only the first visible one should), the
`preload="…"` attribute on `<img>` does nothing (preloading is a `<link>` in `<head>`), and
there's no `srcset`/`sizes` or `<head>` image preload.
+53 -51
View File
@@ -46,8 +46,6 @@ public function show(string $locale, int $id)
$product = $this->products->getById($id); $product = $this->products->getById($id);
abort_if($product === null, Response::HTTP_NOT_FOUND); abort_if($product === null, Response::HTTP_NOT_FOUND);
$product = $this->mergeJustSubmittedReview($product);
[$productOptions, $variantsData] = $this->buildOptionPicker($id); [$productOptions, $variantsData] = $this->buildOptionPicker($id);
return view('product.show', [ return view('product.show', [
@@ -147,40 +145,6 @@ private function buildOptionPicker(int $productId): array
return [$productOptions, $variantsData]; return [$productOptions, $variantsData];
} }
/**
* Meilisearch's own write API is itself async — addDocuments() enqueues an
* indexing task and returns immediately, and Laravel\Scout\Engines\
* MeilisearchEngine::update() never waits on that task, so even
* $product->searchableSync() (which only skips OUR queue) can still land
* the shopper back on this page before Meilisearch has actually processed
* the write. storeReview() flashes the review it just created for exactly
* this one next request; splice it in here rather than trust the index is
* already caught up. Guarded by id so a race the other way — the index
* DID catch up in time — doesn't show the same review twice.
*/
private function mergeJustSubmittedReview(array $product): array
{
$justSubmitted = session('justSubmittedReview');
if (! $justSubmitted || (string) ($justSubmitted['product_id'] ?? null) !== (string) $product['id']) {
return $product;
}
$items = $product['reviews']['items'] ?? [];
if (collect($items)->contains('id', $justSubmitted['id'])) {
return $product;
}
$items = [$justSubmitted, ...$items];
$product['reviews']['items'] = $items;
$product['reviews']['count'] = count($items);
$product['reviews']['average_rating'] = round(collect($items)->avg('rating'), 1);
return $product;
}
/** /**
* A storefront-owned, checkout-module-independent stock check — the * A storefront-owned, checkout-module-independent stock check — the
* product page's "Add to cart" calls this first and only submits to the * product page's "Add to cart" calls this first and only submits to the
@@ -214,14 +178,21 @@ public function checkStock(string $locale, Request $request): JsonResponse
/** /**
* boboko/core's product_reviews table has no moderation/status column, so * boboko/core's product_reviews table has no moderation/status column, so
* this goes live immediately — no approval queue to land in. * this goes live immediately — no approval queue to land in.
*
* The form submits through Turbo, so the answer is Turbo Streams: the new
* review into the list, the updated count and average, the thank-you in
* place of the form; or, on a validation error, the form again with inline
* errors (422). Nothing goes through the session, so the product page
* itself never reads one (it'll be cached). Without JS this is a plain
* POST that redirects back to the product page, losing the inline errors
* and the thank-you — accepted.
*
* The redirect's ?tab=reviews is a query-string variant of the product
* page: keep that in mind once product pages are cached.
*/ */
public function storeReview(string $locale, Request $request, Product $product): RedirectResponse public function storeReview(string $locale, Request $request, Product $product): RedirectResponse|Response
{ {
$reviewsUrl = route('product.show', [ $wantsStream = str_contains((string) $request->header('Accept'), 'text/vnd.turbo-stream.html');
'locale' => $locale,
'id' => $product->id,
'tab' => 'reviews',
]).'#product-tabs';
$validator = Validator::make($request->all(), [ $validator = Validator::make($request->all(), [
'rating' => ['required', 'integer', 'between:1,5'], 'rating' => ['required', 'integer', 'between:1,5'],
@@ -231,7 +202,13 @@ public function storeReview(string $locale, Request $request, Product $product):
]); ]);
if ($validator->fails()) { if ($validator->fails()) {
return redirect($reviewsUrl)->withErrors($validator)->withInput(); return $wantsStream
? $this->turboStream('product.streams.review-invalid', [
'productId' => $product->id,
'messages' => $validator->errors(),
'values' => $request->only('rating', 'content', 'name', 'email'),
], Response::HTTP_UNPROCESSABLE_ENTITY)
: redirect($this->reviewsUrl($locale, $product));
} }
$data = $validator->validated(); $data = $validator->validated();
@@ -251,17 +228,23 @@ public function storeReview(string $locale, Request $request, Product $product):
]); ]);
// ReviewServiceProvider also reindexes on the model's `created` event, but // ReviewServiceProvider also reindexes on the model's `created` event, but
// queued (SCOUT_QUEUE=true) — it wouldn't land before this redirect's page // queued (SCOUT_QUEUE=true). Syncing here skips our queue, so the next
// load. Syncing here skips our queue too, but Meilisearch's own write API // product page load has it as soon as Meilisearch (itself async) catches
// is itself async on top of that (see mergeJustSubmittedReview()), so this // up. The stream below doesn't wait for the index: it renders the new
// alone still isn't a guarantee — it's the flash below that actually is. // review and the count/average straight from the DB, which is exactly
// what ProductIndexer builds the index's `reviews` from.
$product->searchableSync(); $product->searchableSync();
return redirect($reviewsUrl) if (! $wantsStream) {
->with('reviewSubmitted', true) return redirect($this->reviewsUrl($locale, $product));
->with('justSubmittedReview', [ }
$reviews = ProductReview::where('product_id', $product->id);
return $this->turboStream('product.streams.review-stored', [
// Same shape as ProductIndexer::mapReview(), for the shared partial.
'review' => [
'id' => $review->id, 'id' => $review->id,
'product_id' => $review->product_id,
'title' => $review->title, 'title' => $review->title,
'body' => $review->body, 'body' => $review->body,
'rating' => $review->rating, 'rating' => $review->rating,
@@ -270,6 +253,25 @@ public function storeReview(string $locale, Request $request, Product $product):
'reply' => null, 'reply' => null,
'replied_at' => null, 'replied_at' => null,
'media' => [], 'media' => [],
],
'count' => (clone $reviews)->count(),
'averageRating' => round((float) (clone $reviews)->avg('rating'), 1),
]); ]);
} }
private function reviewsUrl(string $locale, Product $product): string
{
return route('product.show', [
'locale' => $locale,
'id' => $product->id,
'tab' => 'reviews',
]).'#product-tabs';
}
private function turboStream(string $view, array $data, int $status = Response::HTTP_OK): Response
{
return response()
->view($view, $data, $status)
->header('Content-Type', 'text/vnd.turbo-stream.html');
}
} }
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
# Refuse to commit boboko-core "local mode" wiring (see bin/core-mode).
#
# Local mode points composer.json / package.json and both lockfiles at
# ../boboko-core, which doesn't exist on the server, so committing any of them
# breaks the build for everyone. Runs as the git pre-commit hook
# (.githooks/pre-commit) and only looks at what is staged: you can keep working
# in local mode and commit everything else — just leave these four unstaged.
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
staged=$(git diff --cached --name-only --diff-filter=ACMR)
is_staged() { printf '%s\n' "$staged" | grep -qx "$1"; }
show() { git show ":$1"; }
problems=()
# Same detection as bin/core-mode. The leading quote keeps "_repositories"
# (the parked block) out of the match.
if is_staged composer.json &&
show composer.json | sed -n '/"repositories": \[/,/"type"/p' | grep -q '"type": "path"'; then
problems+=("composer.json: \"repositories\" is the local path repo")
fi
if is_staged package.json &&
show package.json | sed -n '/"dependencies": {/,/}/p' | grep -q '"@boboko/core": "file:'; then
problems+=("package.json: @boboko/core is file:../boboko-core")
fi
if is_staged composer.lock &&
show composer.lock | grep -A14 '"name": "boboko/core"' | grep -q '"type": "path"'; then
problems+=("composer.lock: boboko/core is locked to the local path")
fi
if is_staged package-lock.json &&
show package-lock.json | grep -A6 '"node_modules/@boboko/core": {' | grep -q '"link": true'; then
problems+=("package-lock.json: @boboko/core is a link to ../boboko-core")
fi
[ ${#problems[@]} -eq 0 ] && exit 0
{
echo "!!! Commit blocked: boboko-core local-mode wiring is staged."
printf ' - %s\n' "${problems[@]}"
echo
echo " Unstage them and keep working in local mode:"
echo " git restore --staged composer.json composer.lock package.json package-lock.json"
echo " or switch back first:"
echo " bin/core-mode repo"
} >&2
exit 1
+12
View File
@@ -106,6 +106,18 @@ if [ "$target" = local ] && [ ! -d ../boboko-core ]; then
fail "../boboko-core not found — local mode needs the core checkout next to this repo." fail "../boboko-core not found — local mode needs the core checkout next to this repo."
fi fi
# Turn on the pre-commit guard (bin/check-core-mode) that stops local-mode
# wiring from being committed. Git doesn't version hooks, so it's enabled here,
# the first time anyone switches modes. Leaves a custom hooksPath alone.
hooks_path=$(git config --get core.hooksPath || true)
if [ -z "$hooks_path" ]; then
git config core.hooksPath .githooks
echo ">>> Enabled the pre-commit guard (git config core.hooksPath .githooks)"
elif [ "$hooks_path" != .githooks ]; then
echo "!!! core.hooksPath is '$hooks_path', so the pre-commit guard isn't active." >&2
echo " Call bin/check-core-mode from your own pre-commit hook." >&2
fi
old_dc=$(wrapper_for "$mode") old_dc=$(wrapper_for "$mode")
new_dc=$(wrapper_for "$target") new_dc=$(wrapper_for "$target")
+4 -2
View File
@@ -11,8 +11,10 @@
health: '/up', health: '/up',
) )
->withMiddleware(function (Middleware $middleware): void { ->withMiddleware(function (Middleware $middleware): void {
// nginx (docker/nginx/prod.conf) only listens on plain HTTP:80. // Caddy (docker/caddy) only listens on plain HTTP:80, behind the
// Without trusting that layer's X-Forwarded-Proto header, Laravel sees every // host's TLS proxy, and passes that proxy's X-Forwarded-* headers on
// (trusted_proxies in docker/caddy/global.caddy).
// Without trusting the X-Forwarded-Proto header, Laravel sees every
// request as http://, so url()/signed-route generation and // request as http://, so url()/signed-route generation and
// verification (URL::hasValidSignature()) both use the wrong // verification (URL::hasValidSignature()) both use the wrong
// scheme — breaks any signed URL whose recipient hits it over // scheme — breaks any signed URL whose recipient hits it over
Generated
+643 -468
View File
File diff suppressed because it is too large. Load diff
+7 -3
View File
@@ -31,12 +31,16 @@ services:
valkey: valkey:
condition: service_started condition: service_started
nginx: caddy:
image: nginx:alpine build:
context: .
target: caddy-base
image: boboko-caddy
command: caddy run --config /etc/caddy/Caddyfile.dev --adapter caddyfile
ports: ports:
- "${APP_PORT:-8080}:80" - "${APP_PORT:-8080}:80"
volumes: volumes:
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro - ./docker/caddy:/etc/caddy:ro
- ./public:/var/www/html/public:ro - ./public:/var/www/html/public:ro
- ./storage/app/public:/var/www/html/storage/app/public:ro - ./storage/app/public:/var/www/html/storage/app/public:ro
depends_on: depends_on:
+4 -2
View File
@@ -32,10 +32,12 @@ services:
retries: 20 retries: 20
start_period: 60s start_period: 60s
nginx: # Caddy (docker/caddy/Caddyfile), plain HTTP on 127.0.0.1 behind the
# host's TLS proxy, same port nginx used.
caddy:
build: build:
context: . context: .
target: nginx target: caddy
restart: unless-stopped restart: unless-stopped
ports: ports:
- "127.0.0.1:${APP_PORT:-8090}:80" - "127.0.0.1:${APP_PORT:-8090}:80"
+44
View File
@@ -0,0 +1,44 @@
# Production. public/ is baked into the image (Dockerfile, target caddy);
# storage/app is the shared `storage` volume, read-only.
# No page cache here: nginx's FastCGI cache is dropped on purpose, the
# static page cache comes later (P2).
{
import global.caddy
}
import common.caddy
:80 {
import site
route {
import deny_dotfiles
import stoic
# Content-hashed or versioned files: cache forever.
@immutable path /build/* /static/* /packages/*
handle @immutable {
header Cache-Control "public, max-age=31536000, immutable"
file_server
}
# User media, straight from the storage volume (no symlink needed).
handle_path /storage/* {
root * /var/www/html/storage/app/public
header Cache-Control "public, max-age=31536000, immutable"
file_server
}
# Generated by the app into storage/app.
handle /sitemap.xml {
root * /var/www/html/storage/app
header Cache-Control "public, max-age=3600"
header Content-Type "application/xml; charset=utf-8"
file_server
}
import laravel
}
import static_404
}
+19
View File
@@ -0,0 +1,19 @@
# Development. public/ and storage/app/public are bind-mounted
# (docker-compose.dev.yml); /storage/ goes through the public/storage symlink.
# No long cache headers in dev. Vite is reached directly on its own port
# (public/hot), not through Caddy.
{
import global.caddy
}
import common.caddy
:80 {
import site
route {
import deny_dotfiles
import stoic
import laravel
}
}
+76
View File
@@ -0,0 +1,76 @@
# Snippets shared by Caddyfile (prod) and Caddyfile.dev, imported right after
# their global options block (global.caddy).
# Site-level settings shared by both environments.
(site) {
root * /var/www/html/public
# New with Caddy: nginx compressed nothing. Caddy only compresses text
# types (HTML, CSS, JS, JSON, SVG…), never images or fonts.
encode zstd gzip
# Same upload limit as nginx's client_max_body_size (and php.ini).
request_body {
max_size 100MiB
}
# On every response. nginx only added these to static files and 2xx/3xx
# (prod's PHP location dropped them).
header {
X-Frame-Options "SAMEORIGIN"
X-Content-Type-Options "nosniff"
# Caddy's proxy adds Via; nginx sent none. A deletion is applied as
# the response goes out, so it also catches headers set later.
-Via
}
# Access log to stdout, as nginx did; favicon/robots skipped like nginx.
log
@quiet path /favicon.ico /robots.txt
log_skip @quiet
}
# Dotfiles (.env, .git…) are never served; /.well-known/ is allowed.
# Use inside a route block, first.
(deny_dotfiles) {
@dotfiles {
path */.*
not path /.well-known/*
}
respond @dotfiles 403
}
# Stoic (the headless CMS) under /stoic/, prefix stripped, cookies scoped to
# /stoic/ (nginx: proxy_cookie_path / /stoic/).
(stoic) {
handle_path /stoic/* {
reverse_proxy stoic:2727 {
header_up X-Real-IP {client_ip}
header_down Set-Cookie "(?i)(;\s*path=)/" "$1/stoic/"
}
}
}
# Laravel. php_fastcgi does the try_files (file, dir/index.php, index.php);
# file_server serves the files that exist in public/.
(laravel) {
php_fastcgi app:9000 {
read_timeout 300s
# PHP-FPM's CGI status line; nginx didn't pass it on either.
header_down -Status
}
file_server
}
# A missing file under one of prod's static paths (/build/, /storage/…): a
# plain 404, without the Cache-Control/Content-Type that path's handle already
# set.
# (nginx sent these to Laravel via `error_page 404 /index.php`, kept the 404
# status and showed Laravel's page; nobody sees that page for an asset.)
(static_404) {
handle_errors 404 {
header -Cache-Control
header Content-Type "text/plain; charset=utf-8"
respond "Not Found" 404
}
}
+16
View File
@@ -0,0 +1,16 @@
# Global options shared by Caddyfile (prod) and Caddyfile.dev, imported inside
# their global options block.
# TLS ends in front of this container (a proxy on the host talks to it on
# 127.0.0.1:8090), so Caddy serves plain HTTP and never tries to get
# certificates. Revisit once it's settled where TLS should end.
auto_https off
servers {
# Keep the X-Forwarded-For/-Proto/-Host the host proxy sends: it
# reaches the container from a private (docker) address. Without this
# Caddy replaces them with its own, so Laravel (trustProxies '*')
# would see every request as plain http. Narrow this to the proxy's
# actual address once it's known.
trusted_proxies static private_ranges
}
-48
View File
@@ -1,48 +0,0 @@
server {
listen 80;
server_name _;
root /var/www/html/public;
index index.php;
client_max_body_size 100M;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
resolver 127.0.0.11 valid=5s;
set $upstream app:9000;
fastcgi_pass $upstream;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_read_timeout 300;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
location /stoic/ {
proxy_pass http://stoic:2727/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cookie_path / /stoic/;
}
location ~ /\.(?!well-known).* {
deny all;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
}
-121
View File
@@ -1,121 +0,0 @@
fastcgi_cache_path /tmp/fcgi_cache levels=1:2 keys_zone=app_cache:10m max_size=256m inactive=10m use_temp_path=off;
upstream php_fpm {
server app:9000;
keepalive 16;
}
server {
listen 80;
server_name _;
root /var/www/html/public;
index index.php;
client_max_body_size 100M;
charset utf-8;
open_file_cache max=5000 inactive=30s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
# --- FastCGI cache bypass rules ---
set $skip_cache 0;
if ($request_method = POST) { set $skip_cache 1; }
if ($request_uri ~* "^/(boboko|up)") { set $skip_cache 1; }
if ($query_string) { set $skip_cache 1; }
# Any logged-in request must never be served a cached response —
# the cache key is URL-only ($scheme$request_method$host$request_uri,
# see fastcgi_cache_key below), with no per-session variation. Without
# this, the first cached hit on an authenticated GET page (e.g.
# /account) gets replayed verbatim to every other visitor of that same
# URL for up to fastcgi_cache_valid's 10m window — a real account/
# session data leak, not just a staleness bug. Laravel's session
# cookie name is env('SESSION_COOKIE', Str::slug(APP_NAME).'-session')
# (config/session.php) — APP_NAME varies per environment, so this
# matches the fixed '-session' suffix rather than a hardcoded name.
if ($http_cookie ~* "-session") { set $skip_cache 1; }
# Vite build assets — content-hashed filenames, safe to cache forever
location /build/ {
add_header Cache-Control "public, max-age=31536000, immutable";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
try_files $uri =404;
}
location /static/ {
add_header Cache-Control "public, max-age=31536000, immutable";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
try_files $uri =404;
}
location /packages/ {
add_header Cache-Control "public, max-age=31536000, immutable";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
try_files $uri =404;
}
# User media — served directly from the storage volume (no symlink needed)
location /storage/ {
alias /var/www/html/storage/app/public/;
add_header Cache-Control "public, max-age=31536000, immutable";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
try_files $uri =404;
}
location / {
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php_fpm;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_read_timeout 300;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_keep_conn on;
fastcgi_cache app_cache;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_valid 200 10m;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
add_header X-Cache-Status $upstream_cache_status;
}
location /stoic/ {
proxy_pass http://stoic:2727/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cookie_path / /stoic/;
}
location ~ /\.(?!well-known).* {
deny all;
}
location = /sitemap.xml {
root /var/www/html/storage/app;
try_files /sitemap.xml =404;
add_header Cache-Control "public, max-age=3600";
add_header Content-Type "application/xml; charset=utf-8";
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
}
+1 -1
View File
@@ -1,2 +1,2 @@
/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */ /*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-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;--tw-tracking:initial;--tw-duration:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-ease:initial;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-x-reverse:0;--tw-content:"";--tw-space-x-reverse:0;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial}}}@layer theme{:root,:host{--font-mono:var(--mono-font-family), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-sky-400:oklch(74.6% .16 232.661);--color-gray-100:var(--gray-100);--color-gray-200:var(--gray-200);--color-gray-300:var(--gray-300);--color-gray-400:var(--gray-400);--color-gray-500:var(--gray-500);--color-gray-600:var(--gray-600);--color-gray-700:var(--gray-700);--color-gray-900:var(--gray-900);--color-gray-950:var(--gray-950);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--leading-loose:2;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-family), ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--default-mono-font-family:var(--mono-font-family), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-primary-400:var(--primary-400);--color-primary-500:var(--primary-500);--color-primary-600:var(--primary-600)}}@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,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;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{Line truncated @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-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;--tw-tracking:initial;--tw-duration:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-outline-style:solid;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-ease:initial;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-divide-x-reverse:0;--tw-content:"";--tw-space-x-reverse:0;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial}}}@layer theme{:root,:host{--font-mono:var(--font-family-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-sky-400:oklch(74.6% .16 232.661);--color-gray-100:var(--gray-100);--color-gray-200:var(--gray-200);--color-gray-300:var(--gray-300);--color-gray-400:var(--gray-400);--color-gray-500:var(--gray-500);--color-gray-600:var(--gray-600);--color-gray-700:var(--gray-700);--color-gray-900:var(--gray-900);--color-gray-950:var(--gray-950);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-sm:40rem;--breakpoint-md:48rem;--breakpoint-lg:64rem;--breakpoint-xl:80rem;--breakpoint-2xl:96rem;--container-3xs:16rem;--container-2xs:18rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-xl:36rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--tracking-tighter:-.05em;--tracking-tight:-.025em;--leading-loose:2;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-family), ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--default-mono-font-family:var(--font-family-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-primary-400:var(--primary-400);--color-primary-500:var(--primary-500);--color-primary-600:var(--primary-600)}}@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,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;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{Line truncated
+1 -1
View File
@@ -1 +1 @@
(()=>{var ne=Object.create,x=Object.defineProperty,ae=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,le=Object.getOwnPropertyNames,ue=Object.getOwnPropertyDescriptor,fe=i=>x(i,"__esModule",{value:!0}),ce=(i,s)=>()=>(s||(s={exports:{}},i(s.exports,s)),s.exports),de=(i,s,e)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of le(s))!oe.call(i,n)&&n!=="default"&&x(i,n,{get:()=>s[n],enumerable:!(e=ue(s,n))||e.enumerable});return i},he=i=>de(fe(x(i!=null?ne(ae(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i),pe=ce((i,s)=>{(function(e,n,o){if(!e)return;for(var l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},g={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},p={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},_={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},k,b=1;b<20;++b)l[111+b]="f"+b;for(b=0;b<=9;++b)l[b+96]=b.toString();function T(t,r,u){if(t.addEventListener){t.addEventListener(r,u,!1);return}t.attachEvent("on"+r,u)}function U(t){if(t.type=="keypress"){var r=String.fromCharCode(t.which);return t.shiftKey||(r=r.toLowerCase()),r}return l[t.which]?l[t.which]:g[t.which]?g[t.which]:String.fromCharCode(t.which).toLowerCase()}function V(t,r){return t.sort().join(",")===r.sort().join(",")}function B(t){var r=[];return t.shiftKey&&r.push("shift"),t.altKey&&r.push("alt"),t.ctrlKey&&r.push("ctrl"),t.metaKey&&r.push("meta"),r}function X(t){if(t.preventDefault){t.preventDefault();return}t.returnValue=!1}function Y(t){if(t.stopPropagation){t.stopPropagation();return}t.cancelBubble=!0}function E(t){return t=="shift"||t=="ctrl"||t=="alt"||t=="meta"}function Q(){if(!k){k={};for(var t in l)t>95&&t<112||l.hasOwnProperty(t)&&(k[l[t]]=t)}return k}function Z(t,r,u){return u||(u=Q()[t]?"keydown":"keypress"),u=="keypress"&&r.length&&(u="keydown"),u}function ee(t){return t==="+"?["+"]:(t=t.replace(/\+{2}/g,"+plus"),t.split("+"))}function N(t,r){var u,v,O,C=[];for(u=ee(t),O=0;O<u.length;++O)v=u[O],_[v]&&(v=_[v]),r&&r!="keypress"&&p[v]&&(v=p[v],C.push("shift")),E(v)&&C.push(v);return r=Z(v,C,r),{key:v,modifiers:C,action:r}}function $(t,r){return t===null||t===n?!1:t===r?!0:$(t.parentNode,r)}function w(t){var r=this;if(t=t||n,!(r instanceof w))return new w(t);r.target=t,r._callbacks={},r._directMap={};var u={},v,O=!1,C=!1,M=!1;function P(a){a=a||{};var c=!1,h;for(h in u){if(a[h]){c=!0;continue}u[h]=0}c||(M=!1)}function I(a,c,h,f,m,S){var d,y,A=[],D=h.type;if(!r._callbacks[a])return[];for(D=="keyup"&&E(a)&&(c=[a]),d=0;d<r._callbacks[a].length;++d)if(y=r._callbacks[a][d],!(!f&&y.seq&&u[y.seq]!=y.level)&&D==y.action&&(D=="keypress"&&!h.metaKey&&!h.ctrlKey||V(c,y.modifiers))){var re=!f&&y.combo==m,se=f&&y.seq==f&&y.level==S;(re||se)&&r._callbacks[a].splice(d,1),A.push(y)}return A}function q(a,c,h,f){r.stopCallback(c,c.target||c.srcElement,h,f)||a(c,h)===!1&&(X(c),Y(c))}r._handleKey=function(a,c,h){var f=I(a,c,h),m,S={},d=0,y=!1;for(m=0;m<f.length;++m)f[m].seq&&(d=Math.max(d,f[m].level));for(m=0;m<f.length;++m){if(f[m].seq){if(f[m].level!=d)continue;y=!0,S[f[m].seq]=1,q(f[m].callback,h,f[m].combo,f[m].seq);continue}y||q(f[m].callback,h,f[m].combo)}var A=h.type=="keypress"&&C;h.type==M&&!E(a)&&!A&&P(S),C=y&&h.type=="keydown"};function R(a){typeof a.which!="number"&&(a.which=a.keyCode);var c=U(a);if(c){if(a.type=="keyup"&&O===c){O=!1;return}r.handleKey(c,B(a),a)}}function te(){clearTimeout(v),v=setTimeout(P,1e3)}function ie(a,c,h,f){u[a]=0;function m(D){return function(){M=D,++u[a],te()}}function S(D){q(h,D,a),f!=="keyup"&&(O=U(D)),setTimeout(P,10)}for(var d=0;d<c.length;++d){var y=d+1===c.length,A=y?S:m(f||N(c[d+1]).action);G(c[d],A,f,a,d)}}function G(a,c,h,f,m){r._directMap[a+":"+h]=c,a=a.replace(/\s+/g," ");var S=a.split(" "),d;if(S.length>1){ie(a,S,c,h);return}d=N(a,h),r._callbacks[d.key]=r._callbacks[d.key]||[],I(d.key,d.modifiers,{type:d.action},f,a,m),r._callbacks[d.key][f?"unshift":"push"]({callback:c,modifiers:d.modifiers,action:d.action,seq:f,level:m,combo:a})}r._bindMultiple=function(a,c,h){for(var f=0;f<a.length;++f)G(a[f],c,h)},T(t,"keypress",R),T(t,"keydown",R),T(t,"keyup",R)}w.prototype.bind=function(t,r,u){var v=this;return t=t instanceof Array?t:[t],v._bindMultiple.call(v,t,r,u),v},w.prototype.unbind=function(t,r){var u=this;return u.bind.call(u,t,function(){},r)},w.prototype.trigger=function(t,r){var u=this;return u._directMap[t+":"+r]&&u._directMap[t+":"+r]({},t),u},w.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},w.prototype.stopCallback=function(t,r){var u=this;ifLine truncated (()=>{var le=Object.create,x=Object.defineProperty,ue=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty,fe=Object.getOwnPropertyNames,ce=Object.getOwnPropertyDescriptor,he=e=>x(e,"__esModule",{value:!0}),pe=(e,n)=>()=>(n||(n={exports:{}},e(n.exports,n)),n.exports),me=(e,n,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of fe(n))!de.call(e,r)&&r!=="default"&&x(e,r,{get:()=>n[r],enumerable:!(t=ce(n,r))||t.enumerable});return e},ve=e=>me(he(x(e!=null?le(ue(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),ge=pe((e,n)=>{(function(t,r,o){if(!t)return;for(var l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},g={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},p={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},_={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},k,b=1;b<20;++b)l[111+b]="f"+b;for(b=0;b<=9;++b)l[b+96]=b.toString();function C(i,s,u){if(i.addEventListener){i.addEventListener(s,u,!1);return}i.attachEvent("on"+s,u)}function U(i){if(i.type=="keypress"){var s=String.fromCharCode(i.which);return i.shiftKey||(s=s.toLowerCase()),s}return l[i.which]?l[i.which]:g[i.which]?g[i.which]:String.fromCharCode(i.which).toLowerCase()}function X(i,s){return i.sort().join(",")===s.sort().join(",")}function Y(i){var s=[];return i.shiftKey&&s.push("shift"),i.altKey&&s.push("alt"),i.ctrlKey&&s.push("ctrl"),i.metaKey&&s.push("meta"),s}function Z(i){if(i.preventDefault){i.preventDefault();return}i.returnValue=!1}function ee(i){if(i.stopPropagation){i.stopPropagation();return}i.cancelBubble=!0}function L(i){return i=="shift"||i=="ctrl"||i=="alt"||i=="meta"}function te(){if(!k){k={};for(var i in l)i>95&&i<112||l.hasOwnProperty(i)&&(k[l[i]]=i)}return k}function ie(i,s,u){return u||(u=te()[i]?"keydown":"keypress"),u=="keypress"&&s.length&&(u="keydown"),u}function se(i){return i==="+"?["+"]:(i=i.replace(/\+{2}/g,"+plus"),i.split("+"))}function N(i,s){var u,v,M,D=[];for(u=se(i),M=0;M<u.length;++M)v=u[M],_[v]&&(v=_[v]),s&&s!="keypress"&&p[v]&&(v=p[v],D.push("shift")),L(v)&&D.push(v);return s=ie(v,D,s),{key:v,modifiers:D,action:s}}function I(i,s){return i===null||i===r?!1:i===s?!0:I(i.parentNode,s)}function y(i){var s=this;if(i=i||r,!(s instanceof y))return new y(i);s.target=i,s._callbacks={},s._directMap={};var u={},v,M=!1,D=!1,T=!1;function P(a){a=a||{};var f=!1,h;for(h in u){if(a[h]){f=!0;continue}u[h]=0}f||(T=!1)}function G(a,f,h,d,m,O){var c,w,E=[],S=h.type;if(!s._callbacks[a])return[];for(S=="keyup"&&L(a)&&(f=[a]),c=0;c<s._callbacks[a].length;++c)if(w=s._callbacks[a][c],!(!d&&w.seq&&u[w.seq]!=w.level)&&S==w.action&&(S=="keypress"&&!h.metaKey&&!h.ctrlKey||X(f,w.modifiers))){var ae=!d&&w.combo==m,oe=d&&w.seq==d&&w.level==O;(ae||oe)&&s._callbacks[a].splice(c,1),E.push(w)}return E}function $(a,f,h,d){s.stopCallback(f,f.target||f.srcElement,h,d)||a(f,h)===!1&&(Z(f),ee(f))}s._handleKey=function(a,f,h){var d=G(a,f,h),m,O={},c=0,w=!1;for(m=0;m<d.length;++m)d[m].seq&&(c=Math.max(c,d[m].level));for(m=0;m<d.length;++m){if(d[m].seq){if(d[m].level!=c)continue;w=!0,O[d[m].seq]=1,$(d[m].callback,h,d[m].combo,d[m].seq);continue}w||$(d[m].callback,h,d[m].combo)}var E=h.type=="keypress"&&D;h.type==T&&!L(a)&&!E&&P(O),D=w&&h.type=="keydown"};function q(a){typeof a.which!="number"&&(a.which=a.keyCode);var f=U(a);if(f){if(a.type=="keyup"&&M===f){M=!1;return}s.handleKey(f,Y(a),a)}}function re(){clearTimeout(v),v=setTimeout(P,1e3)}function ne(a,f,h,d){u[a]=0;function m(S){return function(){T=S,++u[a],re()}}function O(S){$(h,S,a),d!=="keyup"&&(M=U(S)),setTimeout(P,10)}for(var c=0;c<f.length;++c){var w=c+1===f.length,E=w?O:m(d||N(f[c+1]).action);Q(f[c],E,d,a,c)}}function Q(a,f,h,d,m){s._directMap[a+":"+h]=f,a=a.replace(/\s+/g," ");var O=a.split(" "),c;if(O.length>1){ne(a,O,f,h);return}c=N(a,h),s._callbacks[c.key]=s._callbacks[c.key]||[],G(c.key,c.modifiers,{type:c.action},d,a,m),s._callbacks[c.key][d?"unshift":"push"]({callback:f,modifiers:c.modifiers,action:c.action,seq:d,level:m,combo:a})}s._bindMultiple=function(a,f,h){for(var d=0;d<a.length;++d)Q(a[d],f,h)},C(i,"keypress",q),C(i,"keydown",q),C(i,"keyup",q)}y.prototype.bind=function(i,s,u){var v=this;return i=i instanceof Array?i:[i],v._bindMultiple.call(v,i,s,u),v},y.prototype.unbind=function(i,s){var u=this;return u.bind.call(u,i,function(){},s)},y.prototype.trigger=function(i,s){var u=this;return u._directMap[i+":"+s]&&u._directMap[i+":"+s]({},i),u},y.prototype.reset=function(){var i=this;return i._callbacks={},i._directMap={},i},y.prototype.stopCallback=function(i,s){var u=tLine truncated
@@ -1,6 +1,6 @@
var zr=Object.defineProperty;var Fr=(e,t)=>{for(var i in t)zr(e,i,{get:t[i],enumerable:!0})};var da={};Fr(da,{FileOrigin:()=>Gt,FileStatus:()=>Rt,OptionTypes:()=>qi,Status:()=>pl,create:()=>It,destroy:()=>si,find:()=>$i,getOptions:()=>Xi,parse:()=>Yi,registerPlugin:()=>_e,setOptions:()=>Ki,supported:()=>ji});var Or=e=>e instanceof HTMLElement,Dr=(e,t=[],i=[])=>{let a={...e},n=[],l=[],o=()=>({...a}),r=()=>{let g=[...n];return n.length=0,g},s=()=>{let g=[...l];l.length=0,g.forEach(({type:f,data:b})=>{p(f,b)})},p=(g,f,b)=>{if(b&&!document.hidden){l.push({type:g,data:f});return}u[g]&&u[g](f),n.push({type:g,data:f})},c=(g,...f)=>m[g]?m[g](...f):null,d={getState:o,processActionQueue:r,processDispatchQueue:s,dispatch:p,query:c},m={};t.forEach(g=>{m={...g(a),...m}});let u={};return i.forEach(g=>{u={...g(p,c,a),...u}}),d},Cr=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},ae=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},Xe=e=>{let t={};return ae(e,i=>{Cr(t,i,e[i])}),t},pe=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},Br="http://www.w3.org/2000/svg",kr=["svg","path"],ka=e=>kr.includes(e),ci=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=ka(e)?document.createElementNS(Br,e):document.createElement(e);return t&&(ka(e)?pe(a,"class",t):a.className=t),ae(i,(n,l)=>{pe(a,n,l)}),a},Nr=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},Vr=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),Gr=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),Ur=typeof window<"u"&&typeof window.document<"u",Rn=()=>Ur,Hr=Rn()?ci("svg"):{},Wr="children"in Hr?e=>e.children.length:e=>e.childNodes.length,Sn=(e,t,i,a)=>{let n=i[0]||e.left,l=i[1]||e.top,o=n+e.width,r=l+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:l,right:o,bottom:r}};return t.filter(p=>!p.isRectIgnored()).map(p=>p.rect).forEach(p=>{Na(s.inner,{...p.inner}),Na(s.outer,{...p.outer})}),Va(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Va(s.outer),s},Na=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Va=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},tt=e=>typeof e=="number",jr=(e,t,i,a=.001)=>Math.abs(e-t)<a&&Math.abs(i)<a,qr=({stiffness:e=.5,damping:t=.75,mass:i=10}={})=>{let a=null,n=null,l=0,o=!1,p=Xe({interpolate:(c,d)=>{if(o)return;if(!(tt(a)&&tt(n))){o=!0,l=0;return}let m=-(n-a)*e;l+=m/i,n+=l,l*=t,jr(n,a,l)||d?(n=a,l=0,o=!0,p.onupdate(n),p.oncomplete(n)):p.onupdate(n)},target:{set:c=>{if(tt(c)&&!tt(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){o=!0,l=0,p.onupdate(n),p.oncomplete(n);return}o=!1},get:()=>a},resting:{get:()=>o},onupdate:c=>{},oncomplete:c=>{}});return p};var Yr=e=>e<.5?2*e*e:-1+(4-2*e)*e,$r=({duration:e=500,easing:t=Yr,delay:i=0}={})=>{let a=null,n,l,o=!0,r=!1,s=null,c=Xe({interpolate:(d,m)=>{o||s===null||(a===null&&(a=d),!(d-a<i)&&(n=d-a-i,n>=e||m?(n=1,l=r?0:1,c.onupdate(l*s),c.oncomplete(l*s),o=!0):(l=n/e,c.onupdate((n>=0?t(r?1-l:l):0)*s))))},target:{get:()=>r?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}d<s?(s=1,r=!0):(r=!1,s=d),o=!1,a=null}},resting:{get:()=>o},onupdate:d=>{},oncomplete:d=>{}});return c},Ga={spring:qr,tween:$r},Xr=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,l=typeof a=="object"?{...a}:{};return Ga[n]?Ga[n](l):null},Zi=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(l=>{let o=l,r=()=>i[l],s=p=>i[l]=p;typeof l=="object"&&(o=l.key,r=l.getter||r,s=l.setter||s),!(n[o]&&!a)&&(n[o]={get:r,set:s})})})},Kr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},l=[];return ae(e,(o,r)=>{let s=Xr(r);if(!s)return;s.onupdate=c=>{t[o]=c},s.target=n[o],Zi([{key:o,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[o]}],[i,a],t,!0),l.push(s)}),{write:o=>{let r=document.hidden,s=!0;return l.forEach(p=>{p.resting||(s=!1),p.interpolate(o,r)}),s},destroy:()=>{}}},Zr=e=>(t,i)=>{e.addEventListener(t,i)},Qr=e=>(t,i)=>{e.removeEventListener(t,i)},Jr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,viewState:n,view:l})=>{let o=[],r=Zr(l.element),s=Qr(l.element);return a.on=(p,c)=>{o.push({type:p,fn:c}),r(p,c)},a.off=(p,c)=>{o.splice(o.findIndex(d=>d.type===p&&d.fn===c),1),s(p,c)},{write:()=>!0,destroy:()=>{o.forEach(p=>{s(p.type,p.fn)})}}},es=({mixinConfig:e,viewProps:t,viewExternalAPI:i})=>{Zi(e,i,t)},be=e=>e!=null,ts={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},is=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,view:n})=>{let l={...t},o={};Zi(e,[i,a],t);let r=()=>[t.translateX||0,t.translateY||0],s=()=>[t.scaleX||0,t.scaleY||0],p=()=>n.rect?Sn(n.rect,n.childViews,r(),s()):null;return i.Line truncated var wr=Object.defineProperty;var Lr=(e,t)=>{for(var i in t)wr(e,i,{get:t[i],enumerable:!0})};var pa={};Lr(pa,{FileOrigin:()=>Gt,FileStatus:()=>Rt,OptionTypes:()=>Yi,Status:()=>pl,create:()=>It,destroy:()=>si,find:()=>Xi,getOptions:()=>Ki,parse:()=>$i,registerPlugin:()=>_e,setOptions:()=>Zi,supported:()=>qi});var Mr=e=>e instanceof HTMLElement,Ar=(e,t=[],i=[])=>{let a={...e},n=[],l=[],o=()=>({...a}),r=()=>{let g=[...n];return n.length=0,g},s=()=>{let g=[...l];l.length=0,g.forEach(({type:f,data:b})=>{p(f,b)})},p=(g,f,b)=>{if(b&&!document.hidden){l.push({type:g,data:f});return}u[g]&&u[g](f),n.push({type:g,data:f})},c=(g,...f)=>m[g]?m[g](...f):null,d={getState:o,processActionQueue:r,processDispatchQueue:s,dispatch:p,query:c},m={};t.forEach(g=>{m={...g(a),...m}});let u={};return i.forEach(g=>{u={...g(p,c,a),...u}}),d},Pr=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},ae=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},Xe=e=>{let t={};return ae(e,i=>{Pr(t,i,e[i])}),t},pe=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},zr="http://www.w3.org/2000/svg",Fr=["svg","path"],ka=e=>Fr.includes(e),ci=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=ka(e)?document.createElementNS(zr,e):document.createElement(e);return t&&(ka(e)?pe(a,"class",t):a.className=t),ae(i,(n,l)=>{pe(a,n,l)}),a},Or=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},Dr=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),Cr=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),Br=typeof window<"u"&&typeof window.document<"u",Rn=()=>Br,kr=Rn()?ci("svg"):{},Nr="children"in kr?e=>e.children.length:e=>e.childNodes.length,Sn=(e,t,i,a)=>{let n=i[0]||e.left,l=i[1]||e.top,o=n+e.width,r=l+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:l,right:o,bottom:r}};return t.filter(p=>!p.isRectIgnored()).map(p=>p.rect).forEach(p=>{Na(s.inner,{...p.inner}),Na(s.outer,{...p.outer})}),Va(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Va(s.outer),s},Na=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Va=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},tt=e=>typeof e=="number",Vr=(e,t,i,a=.001)=>Math.abs(e-t)<a&&Math.abs(i)<a,Gr=({stiffness:e=.5,damping:t=.75,mass:i=10}={})=>{let a=null,n=null,l=0,o=!1,p=Xe({interpolate:(c,d)=>{if(o)return;if(!(tt(a)&&tt(n))){o=!0,l=0;return}let m=-(n-a)*e;l+=m/i,n+=l,l*=t,Vr(n,a,l)||d?(n=a,l=0,o=!0,p.onupdate(n),p.oncomplete(n)):p.onupdate(n)},target:{set:c=>{if(tt(c)&&!tt(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){o=!0,l=0,p.onupdate(n),p.oncomplete(n);return}o=!1},get:()=>a},resting:{get:()=>o},onupdate:c=>{},oncomplete:c=>{}});return p};var Ur=e=>e<.5?2*e*e:-1+(4-2*e)*e,Hr=({duration:e=500,easing:t=Ur,delay:i=0}={})=>{let a=null,n,l,o=!0,r=!1,s=null,c=Xe({interpolate:(d,m)=>{o||s===null||(a===null&&(a=d),!(d-a<i)&&(n=d-a-i,n>=e||m?(n=1,l=r?0:1,c.onupdate(l*s),c.oncomplete(l*s),o=!0):(l=n/e,c.onupdate((n>=0?t(r?1-l:l):0)*s))))},target:{get:()=>r?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}d<s?(s=1,r=!0):(r=!1,s=d),o=!1,a=null}},resting:{get:()=>o},onupdate:d=>{},oncomplete:d=>{}});return c},Ga={spring:Gr,tween:Hr},Wr=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,l=typeof a=="object"?{...a}:{};return Ga[n]?Ga[n](l):null},Qi=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(l=>{let o=l,r=()=>i[l],s=p=>i[l]=p;typeof l=="object"&&(o=l.key,r=l.getter||r,s=l.setter||s),!(n[o]&&!a)&&(n[o]={get:r,set:s})})})},jr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},l=[];return ae(e,(o,r)=>{let s=Wr(r);if(!s)return;s.onupdate=c=>{t[o]=c},s.target=n[o],Qi([{key:o,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[o]}],[i,a],t,!0),l.push(s)}),{write:o=>{let r=document.hidden,s=!0;return l.forEach(p=>{p.resting||(s=!1),p.interpolate(o,r)}),s},destroy:()=>{}}},qr=e=>(t,i)=>{e.addEventListener(t,i)},Yr=e=>(t,i)=>{e.removeEventListener(t,i)},$r=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,viewState:n,view:l})=>{let o=[],r=qr(l.element),s=Yr(l.element);return a.on=(p,c)=>{o.push({type:p,fn:c}),r(p,c)},a.off=(p,c)=>{o.splice(o.findIndex(d=>d.type===p&&d.fn===c),1),s(p,c)},{write:()=>!0,destroy:()=>{o.forEach(p=>{s(p.type,p.fn)})}}},Xr=({mixinConfig:e,viewProps:t,viewExternalAPI:i})=>{Qi(e,i,t)},be=e=>e!=null,Kr={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},Zr=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a,view:n})=>{let l={...t},o={};Qi(e,[i,a],t);let r=()=>[t.translateX||0,t.translateY||0],s=()=>[t.scaleX||0,t.scaleY||0],p=()=>n.rect?Sn(n.rect,n.childViews,r(),s()):null;return i.Line truncated
`);for(let a of i){let n=Xs(a);if(n){t.name=n;continue}let l=Ks(a);if(l){t.size=l;continue}let o=Zs(a);if(o){t.source=o;continue}}return t},Qs=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let r=t.source;o.fire("init",r),r instanceof File?o.fire("load",r):r instanceof Blob?o.fire("load",xt(r,r.name)):ki(r)?o.fire("load",$s(r)):l(r)},l=r=>{if(!e){o.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(r,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=xt(s,s.name||Vt(r))),o.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{o.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,p,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=p/c,o.fire("progress",t.progress)},()=>{o.fire("abort")},s=>{let p=ta(typeof s=="string"?s:s.headers);o.fire("meta",{size:t.size||p.size,filename:p.name,source:p.source})})},o={...hi(),setSource:r=>t.source=r,getProgress:i,abort:a,load:n};return o},Xa=e=>/GET|HEAD/.test(e),nt=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,o.abort()}},n=!1,l=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),Xa(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let o=new XMLHttpRequest,r=Xa(i.method)?o:o.upload;return r.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},o.onreadystatechange=()=>{o.readyState<2||o.readyState===4&&o.status===0||l||(l=!0,a.onheaders(o))},o.onload=()=>{o.status>=200&&o.status<300?a.onload(o):a.onerror(o)},o.onerror=()=>a.onerror(o),o.onabort=()=>{n=!0,a.onabort()},o.ontimeout=()=>a.ontimeout(o),o.open(i.method,t,!0),yt(i.timeout)&&(o.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let p=unescape(encodeURIComponent(i.headers[s]));o.setRequestHeader(s,p)}),i.responseType&&(o.responseType=i.responseType),i.withCredentials&&(o.withCredentials=!0),o.send(e),a},ne=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),lt=e=>t=>{e(ne("error",0,"Timeout",t.getAllResponseHeaders()))},Ka=e=>/\?/.test(e),Nt=(...e)=>{let t="";return e.forEach(i=>{t+=Ka(t)&&Ka(i)?i.replace(/\?/,"&"):i}),t},Pi=(e="",t)=>{if(typeof t=="function")return t;if(!t||!Ee(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,l,o,r,s,p)=>{let c=nt(n,Nt(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let m=d.getAllResponseHeaders(),u=ta(m).name||Vt(n);l(ne("load",d.status,t.method==="HEAD"?null:xt(i(d.response),u),m))},c.onerror=d=>{o(ne("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{p(ne("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=lt(o),c.onprogress=r,c.onabort=s,c}},we={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},Js=(e,t,i,a,n,l,o,r,s,p,c)=>{let d=[],{chunkTransferId:m,chunkServer:u,chunkSize:g,chunkRetryDelays:f}=c,b={serverId:m,aborted:!1},v=t.ondata||(w=>w),h=t.onload||((w,F)=>F==="HEAD"?w.getResponseHeader("Upload-Offset"):w.response),T=t.onerror||(w=>null),I=w=>{let F=new FormData;me(n)&&F.append(i,JSON.stringify(n));let S=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:S},D=nt(v(F),Nt(e,t.url),L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ne("error",O.status,T(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=lt(o)},y=w=>{let F=Nt(e,u.url,b.serverId),L={headers:typeof t.headers=="function"?t.headers(b.serverId):{...t.headers},method:"HEAD"},D=nt(null,F,L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ne("error",O.status,T(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=lt(o)},E=Math.floor(a.size/g);for(let w=0;w<=E;w++){let F=w*g,S=a.slice(F,F+g,"application/offset+octet-stream");d[w]={index:w,size:S.size,offset:F,data:S,file:a,progress:0,retries:[...f],status:we.QUEUED,error:null,request:null,timeout:null}}let _=()=>l(b.serverId),x=w=>w.status===we.QUEUED||w.status===we.ERROR,R=w=>{if(b.aborted)return;if(w=w||d.find(x),!w){d.every(C=>C.status===we.COMPLETE)&&_();return}w.status=we.PROCESSING,w.progress=null;let F=u.ondata||(C=>C),S=u.onerror||(C=>null),L=u.onload||(()=>{}),D=Nt(e,u.url,b.serverId),O=typeof u.headers=="function"?u.headers(w):{...u.headers,"Content-Type":"application/offset+octet-stream","Upload-Offset":w.offset,"Upload-Length":a.size,"Upload-Name":a.name},G=w.request=nt(F(w.data),D,{...u,headers:O});G.onload=C=>{L(C,w.index,d.length),w.status=we.COMPLETE,w.request=null,A()},G.onprogress=(C,$,K)=>{w.progress=C?$:null,P()},G.onerror=C=>{w.status=we.ERROR,w.request=null,w.error=S(C.response)||C.statusText,z(w)||o(ne("error",C.status,S(C.response)||C.statusText,C.getAllResponseHeaders()))},G.ontimeout=C=>{w.status=we.ERROR,w.request=null,z(w)||lt(o)(C)},G.onabort=()=>{w.status=we.QUEUED,w.request=null,s() Line truncated `);for(let a of i){let n=Ws(a);if(n){t.name=n;continue}let l=js(a);if(l){t.size=l;continue}let o=qs(a);if(o){t.source=o;continue}}return t},Ys=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let r=t.source;o.fire("init",r),r instanceof File?o.fire("load",r):r instanceof Blob?o.fire("load",xt(r,r.name)):Ni(r)?o.fire("load",Hs(r)):l(r)},l=r=>{if(!e){o.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(r,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=xt(s,s.name||Vt(r))),o.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{o.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,p,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=p/c,o.fire("progress",t.progress)},()=>{o.fire("abort")},s=>{let p=ia(typeof s=="string"?s:s.headers);o.fire("meta",{size:t.size||p.size,filename:p.name,source:p.source})})},o={...hi(),setSource:r=>t.source=r,getProgress:i,abort:a,load:n};return o},Xa=e=>/GET|HEAD/.test(e),nt=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,o.abort()}},n=!1,l=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),Xa(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let o=new XMLHttpRequest,r=Xa(i.method)?o:o.upload;return r.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},o.onreadystatechange=()=>{o.readyState<2||o.readyState===4&&o.status===0||l||(l=!0,a.onheaders(o))},o.onload=()=>{o.status>=200&&o.status<300?a.onload(o):a.onerror(o)},o.onerror=()=>a.onerror(o),o.onabort=()=>{n=!0,a.onabort()},o.ontimeout=()=>a.ontimeout(o),o.open(i.method,t,!0),yt(i.timeout)&&(o.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let p=unescape(encodeURIComponent(i.headers[s]));o.setRequestHeader(s,p)}),i.responseType&&(o.responseType=i.responseType),i.withCredentials&&(o.withCredentials=!0),o.send(e),a},ne=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),lt=e=>t=>{e(ne("error",0,"Timeout",t.getAllResponseHeaders()))},Ka=e=>/\?/.test(e),Nt=(...e)=>{let t="";return e.forEach(i=>{t+=Ka(t)&&Ka(i)?i.replace(/\?/,"&"):i}),t},zi=(e="",t)=>{if(typeof t=="function")return t;if(!t||!Ee(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,l,o,r,s,p)=>{let c=nt(n,Nt(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let m=d.getAllResponseHeaders(),u=ia(m).name||Vt(n);l(ne("load",d.status,t.method==="HEAD"?null:xt(i(d.response),u),m))},c.onerror=d=>{o(ne("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{p(ne("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=lt(o),c.onprogress=r,c.onabort=s,c}},we={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},$s=(e,t,i,a,n,l,o,r,s,p,c)=>{let d=[],{chunkTransferId:m,chunkServer:u,chunkSize:g,chunkRetryDelays:f}=c,b={serverId:m,aborted:!1},v=t.ondata||(w=>w),h=t.onload||((w,F)=>F==="HEAD"?w.getResponseHeader("Upload-Offset"):w.response),E=t.onerror||(w=>null),I=w=>{let F=new FormData;me(n)&&F.append(i,JSON.stringify(n));let S=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:S},D=nt(v(F),Nt(e,t.url),L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ne("error",O.status,E(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=lt(o)},y=w=>{let F=Nt(e,u.url,b.serverId),L={headers:typeof t.headers=="function"?t.headers(b.serverId):{...t.headers},method:"HEAD"},D=nt(null,F,L);D.onload=O=>w(h(O,L.method)),D.onerror=O=>o(ne("error",O.status,E(O.response)||O.statusText,O.getAllResponseHeaders())),D.ontimeout=lt(o)},T=Math.floor(a.size/g);for(let w=0;w<=T;w++){let F=w*g,S=a.slice(F,F+g,"application/offset+octet-stream");d[w]={index:w,size:S.size,offset:F,data:S,file:a,progress:0,retries:[...f],status:we.QUEUED,error:null,request:null,timeout:null}}let _=()=>l(b.serverId),x=w=>w.status===we.QUEUED||w.status===we.ERROR,R=w=>{if(b.aborted)return;if(w=w||d.find(x),!w){d.every(C=>C.status===we.COMPLETE)&&_();return}w.status=we.PROCESSING,w.progress=null;let F=u.ondata||(C=>C),S=u.onerror||(C=>null),L=u.onload||(()=>{}),D=Nt(e,u.url,b.serverId),O=typeof u.headers=="function"?u.headers(w):{...u.headers,"Content-Type":"application/offset+octet-stream","Upload-Offset":w.offset,"Upload-Length":a.size,"Upload-Name":a.name},G=w.request=nt(F(w.data),D,{...u,headers:O});G.onload=C=>{L(C,w.index,d.length),w.status=we.COMPLETE,w.request=null,A()},G.onprogress=(C,X,K)=>{w.progress=C?X:null,P()},G.onerror=C=>{w.status=we.ERROR,w.request=null,w.error=S(C.response)||C.statusText,z(w)||o(ne("error",C.status,S(C.response)||C.statusText,C.getAllResponseHeaders()))},G.ontimeout=C=>{w.status=we.ERROR,w.request=null,z(w)||lt(o)(C)},G.onabort=()=>{w.status=we.QUEUED,w.request=null,s() Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var yi=typeof window<"u"&&typeof window.document<"u",Ve=yi?window:{},ya=yi&&Ve.document.documentElement?"ontouchstart"in Ve.document.documentElement:!1,Ra=yi?"PointerEvent"in Ve:!1,ee="cropper",Sa="all",Pl="crop",zl="move",Fl="zoom",dt="e",pt="w",St="s",Ke="n",Ut="ne",Ht="nw",Wt="se",jt="sw",fa="".concat(ee,"-crop"),gl="".concat(ee,"-disabled"),ye="".concat(ee,"-hidden"),fl="".concat(ee,"-hide"),Yp="".concat(ee,"-invisible"),xi="".concat(ee,"-modal"),ha="".concat(ee,"-move"),Yt="".concat(ee,"Action"),vi="".concat(ee,"Preview"),_a="crop",Ol="move",Dl="none",ba="crop",Ea="cropend",Ta="cropmove",va="cropstart",hl="dblclick",$p=ya?"touchstart":"mousedown",Xp=ya?"touchmove":"mousemove",Kp=ya?"touchend touchcancel":"mouseup",bl=Ra?"pointerdown":$p,El=Ra?"pointermove":Xp,Tl=Ra?"pointerup pointercancel":Kp,vl="ready",Il="resize",xl="wheel",Ia="zoom",yl="image/jpeg",Zp=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Qp=/^data:/,Jp=/^data:image\/jpeg;base64,/,em=/^img|canvas$/i,Cl=200,Bl=100,Rl={viewMode:0,dragMode:_a,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Cl,minContainerHeight:Bl,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},tm='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',im=Number.isNaN||Ve.isNaN;function q(e){return typeof e=="number"&&!im(e)}var Sl=function(t){return t>0&&t<1/0};function pa(e){return typeof e>"u"}function mt(e){return ua(e)==="object"&&e!==null}var am=Object.prototype.hasOwnProperty;function _t(e){if(!mt(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&am.call(i,"isPrototypeOf")}catch{return!1}}function xe(e){return typeof e=="function"}var nm=Array.prototype.slice;function kl(e){return Array.from?Array.from(e):nm.call(e)}function se(e,t){return e&&xe(t)&&(Array.isArray(e)||q(e.length)?kl(e).forEach(function(i,a){t.call(e,i,a,e)}):mt(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var te=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];return mt(t)&&a.length>0&&a.forEach(function(l){mt(l)&&Object.keys(l).forEach(function(o){t[o]=l[o]})}),t},lm=/\.\d*(?:0|9){12}\d*$/;function Lt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return lm.test(e)?Math.round(e*t)/t:e}var om=/^width|height|left|top|marginLeft|marginTop$/;function Ze(e,t){var i=e.style;se(t,function(a,n){om.test(n)&&q(a)&&(a="".concat(a,"px")),i[n]=a})}function rm(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function ue(e,t){if(t){if(q(e.length)){se(e,function(a){ue(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function Ne(e,t){if(t){if(q(e.length)){se(e,function(i){Ne(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function wt(e,t,i){if(t){if(q(e.length)){se(e,function(a){wt(a,t,i)});return}i?ue(e,t):Ne(e,t)}}var sm=/([a-z\d])([A-Z])/g;function wa(e){return e.replace(sm,"$1-$2").toLowerCase()}function xa(e,t){return mt(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(wa(t)))}function $t(e,t,i){mt(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(wa(t)),i)}function cm(e,t){if(mt(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.d Line truncated In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var yi=typeof window<"u"&&typeof window.document<"u",Ge=yi?window:{},Ra=yi&&Ge.document.documentElement?"ontouchstart"in Ge.document.documentElement:!1,Sa=yi?"PointerEvent"in Ge:!1,J="cropper",_a="all",Pl="crop",zl="move",Fl="zoom",dt="e",pt="w",St="s",Ke="n",Ut="ne",Ht="nw",Wt="se",jt="sw",ha="".concat(J,"-crop"),gl="".concat(J,"-disabled"),ye="".concat(J,"-hidden"),fl="".concat(J,"-hide"),Up="".concat(J,"-invisible"),xi="".concat(J,"-modal"),ba="".concat(J,"-move"),Yt="".concat(J,"Action"),vi="".concat(J,"Preview"),wa="crop",Ol="move",Dl="none",Ea="crop",Ta="cropend",va="cropmove",Ia="cropstart",hl="dblclick",Hp=Ra?"touchstart":"mousedown",Wp=Ra?"touchmove":"mousemove",jp=Ra?"touchend touchcancel":"mouseup",bl=Sa?"pointerdown":Hp,El=Sa?"pointermove":Wp,Tl=Sa?"pointerup pointercancel":jp,vl="ready",Il="resize",xl="wheel",xa="zoom",yl="image/jpeg",qp=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Yp=/^data:/,$p=/^data:image\/jpeg;base64,/,Xp=/^img|canvas$/i,Cl=200,Bl=100,Rl={viewMode:0,dragMode:wa,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Cl,minContainerHeight:Bl,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Kp='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Zp=Number.isNaN||Ge.isNaN;function q(e){return typeof e=="number"&&!Zp(e)}var Sl=function(t){return t>0&&t<1/0};function ma(e){return typeof e>"u"}function mt(e){return ga(e)==="object"&&e!==null}var Qp=Object.prototype.hasOwnProperty;function _t(e){if(!mt(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&Qp.call(i,"isPrototypeOf")}catch{return!1}}function xe(e){return typeof e=="function"}var Jp=Array.prototype.slice;function kl(e){return Array.from?Array.from(e):Jp.call(e)}function se(e,t){return e&&xe(t)&&(Array.isArray(e)||q(e.length)?kl(e).forEach(function(i,a){t.call(e,i,a,e)}):mt(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var ee=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];return mt(t)&&a.length>0&&a.forEach(function(l){mt(l)&&Object.keys(l).forEach(function(o){t[o]=l[o]})}),t},em=/\.\d*(?:0|9){12}\d*$/;function Lt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return em.test(e)?Math.round(e*t)/t:e}var tm=/^width|height|left|top|marginLeft|marginTop$/;function Ze(e,t){var i=e.style;se(t,function(a,n){tm.test(n)&&q(a)&&(a="".concat(a,"px")),i[n]=a})}function im(e,t){return e.classList?e.classList.contains(t):e.className.indexOf(t)>-1}function ue(e,t){if(t){if(q(e.length)){se(e,function(a){ue(a,t)});return}if(e.classList){e.classList.add(t);return}var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function Ve(e,t){if(t){if(q(e.length)){se(e,function(i){Ve(i,t)});return}if(e.classList){e.classList.remove(t);return}e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,""))}}function wt(e,t,i){if(t){if(q(e.length)){se(e,function(a){wt(a,t,i)});return}i?ue(e,t):Ve(e,t)}}var am=/([a-z\d])([A-Z])/g;function La(e){return e.replace(am,"$1-$2").toLowerCase()}function ya(e,t){return mt(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(La(t)))}function $t(e,t,i){mt(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(La(t)),i)}function nm(e,t){if(mt(e[t]))try{delete e[t]}catch{e[t]=void 0}else if(e.dataset)try Line truncated
<defs> <defs>
<radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15"> <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">
<stop offset='50%' stop-color='#000000'/> <stop offset='50%' stop-color='#000000'/>
@@ -18,13 +18,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
</mask> </mask>
</defs> </defs>
<rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect> <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>
</svg>`,uo=0,vu=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=Tu;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}uo++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,uo)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),Iu=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},xu=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,l=i[0],o=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],g=i[9],f=i[10],b=i[11],v=i[12],h=i[13],T=i[14],I=i[15],y=i[16],E=i[17],_=i[18],x=i[19],R=0,z=0,P=0,A=0,B=0;for(;R<n;R+=4)z=a[R]/255,P=a[R+1]/255,A=a[R+2]/255,B=a[R+3]/255,a[R]=Math.max(0,Math.min((z*l+P*o+A*r+B*s+p)*255,255)),a[R+1]=Math.max(0,Math.min((z*c+P*d+A*m+B*u+g)*255,255)),a[R+2]=Math.max(0,Math.min((z*f+P*b+A*v+B*h+T)*255,255)),a[R+3]=Math.max(0,Math.min((z*I+P*y+A*E+B*_+x)*255,255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},yu=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},Ru={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},Su=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,Ru[a](t,i))},_u=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let l=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),Su(l,t,i,a),l.drawImage(e,0,0,t,i),n},ho=e=>/^image/.test(e.type)&&!/svg/.test(e.type),wu=10,Lu=10,Mu=e=>{let t=Math.min(wu/e.width,Lu/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),l=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,l);let o=null;try{o=a.getImageData(0,0,n,l).data}catch{return null}let r=o.length,s=0,p=0,c=0,d=0;for(;d<r;d+=4)s+=o[d]*o[d],p+=o[d+1]*o[d+1],c+=o[d+2]*o[d+2];return s=za(s,r),p=za(p,r),c=za(c,r),{r:s,g:p,b:c}},za=(e,t)=>Math.floor(Math.sqrt(e/(t/4))),Au=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),Pu=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},zu=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Fu=e=>{let t=vu(e),i=Eu(e),{createWorker:a}=e.utils,n=(h,T,I)=>new Promise(y=>{h.ref.imageData||(h.ref.imageData=I.getContext("2d").getImageData(0,0,I.width,I.height));let E=Pu(h.ref.imageData);if(!T||T.length!==20)return I.getContext("2d").putImageData(E,0,0),y();let _=a(xu);_.post({imageData:E,colorMatrix:T},x=>{I.getContext("2d").putImageData(x,0,0),_.terminate(),y()},[E.data.buffer])}),l=(h,T)=>{h.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},o=({root:h})=>{let T=h.ref.images.shift();return T.opacity=0,T.translateY=-15,h.ref.imageViewBin.push(T),T},r=({root:h,props:T,image:I})=>{let y=T.id,E=h.query("GET_ITEM",{id:y});if(!E)return;let _=E.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),R,z,P=!1;h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(R=E.getMetadata("markup")||[],z=E.getMetadata("resize"),P=!0);let A=h.appendChildView(h.createChildView(i,{id:y,image:I,crop:_,resize:z,markup:R,dirty:P,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),h.childViews.length);h.ref.images.push(A),A.opacity=1,A.scaleX=1,A.scaleY=1,A.translateY=0,setTimeout(()=>{h.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:h,props:T})=>{let I=h.query("GET_ITEM",{id:T.id});if(!I)return;let y=h.ref.images[h.ref.images.length-1];y.crop=I.getMetadata("crop"),y.background=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(y.dirty=!0,y.resize=I.getMetadata("resize"),y.markup=I.getMetadata("markup"))},p=({root:h,props:T,action:I})=>{if(!/crop|filter|markup|resize/.test(I.change.key)||!h.ref.images.length)return;let y=h.query("GET_ITEM",{id:T.id});if(y){if(/filter/.test(I.change.key)){let E=h.ref.images[h.ref.images.length-1];n(h,I.change.value,E.image);return}if(/crop|markup|resize/.test(I.change.key)){let E=y.getMetadata("crop"),_=h.ref.images[h.ref.images.length-1];if(E&&E.aspectRatio&&_.crop&&_.crop.aspectRatio&&Math.abs(E.aspectRatio-_.crop.aspectRatio)>1e-5){let x=o({root:h});r({root:h,props:T,image:Au(x.image)})}else s({root:h,props:T})}}},c=h=>{let I=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),y=I?parseInt(I[1]):null;return y!==null&&y<=58?!1:"createImagLine truncated </svg>`,uo=0,fu=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=gu;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}uo++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,uo)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),hu=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},bu=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,l=i[0],o=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],g=i[9],f=i[10],b=i[11],v=i[12],h=i[13],E=i[14],I=i[15],y=i[16],T=i[17],_=i[18],x=i[19],R=0,z=0,P=0,A=0,B=0;for(;R<n;R+=4)z=a[R]/255,P=a[R+1]/255,A=a[R+2]/255,B=a[R+3]/255,a[R]=Math.max(0,Math.min((z*l+P*o+A*r+B*s+p)*255,255)),a[R+1]=Math.max(0,Math.min((z*c+P*d+A*m+B*u+g)*255,255)),a[R+2]=Math.max(0,Math.min((z*f+P*b+A*v+B*h+E)*255,255)),a[R+3]=Math.max(0,Math.min((z*I+P*y+A*T+B*_+x)*255,255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},Eu=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},Tu={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},vu=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,Tu[a](t,i))},Iu=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let l=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),vu(l,t,i,a),l.drawImage(e,0,0,t,i),n},ho=e=>/^image/.test(e.type)&&!/svg/.test(e.type),xu=10,yu=10,Ru=e=>{let t=Math.min(xu/e.width,yu/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),l=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,l);let o=null;try{o=a.getImageData(0,0,n,l).data}catch{return null}let r=o.length,s=0,p=0,c=0,d=0;for(;d<r;d+=4)s+=o[d]*o[d],p+=o[d+1]*o[d+1],c+=o[d+2]*o[d+2];return s=Fa(s,r),p=Fa(p,r),c=Fa(c,r),{r:s,g:p,b:c}},Fa=(e,t)=>Math.floor(Math.sqrt(e/(t/4))),Su=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),_u=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},wu=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Lu=e=>{let t=fu(e),i=uu(e),{createWorker:a}=e.utils,n=(h,E,I)=>new Promise(y=>{h.ref.imageData||(h.ref.imageData=I.getContext("2d").getImageData(0,0,I.width,I.height));let T=_u(h.ref.imageData);if(!E||E.length!==20)return I.getContext("2d").putImageData(T,0,0),y();let _=a(bu);_.post({imageData:T,colorMatrix:E},x=>{I.getContext("2d").putImageData(x,0,0),_.terminate(),y()},[T.data.buffer])}),l=(h,E)=>{h.removeChildView(E),E.image.width=1,E.image.height=1,E._destroy()},o=({root:h})=>{let E=h.ref.images.shift();return E.opacity=0,E.translateY=-15,h.ref.imageViewBin.push(E),E},r=({root:h,props:E,image:I})=>{let y=E.id,T=h.query("GET_ITEM",{id:y});if(!T)return;let _=T.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),R,z,P=!1;h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(R=T.getMetadata("markup")||[],z=T.getMetadata("resize"),P=!0);let A=h.appendChildView(h.createChildView(i,{id:y,image:I,crop:_,resize:z,markup:R,dirty:P,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),h.childViews.length);h.ref.images.push(A),A.opacity=1,A.scaleX=1,A.scaleY=1,A.translateY=0,setTimeout(()=>{h.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:h,props:E})=>{let I=h.query("GET_ITEM",{id:E.id});if(!I)return;let y=h.ref.images[h.ref.images.length-1];y.crop=I.getMetadata("crop"),y.background=h.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),h.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(y.dirty=!0,y.resize=I.getMetadata("resize"),y.markup=I.getMetadata("markup"))},p=({root:h,props:E,action:I})=>{if(!/crop|filter|markup|resize/.test(I.change.key)||!h.ref.images.length)return;let y=h.query("GET_ITEM",{id:E.id});if(y){if(/filter/.test(I.change.key)){let T=h.ref.images[h.ref.images.length-1];n(h,I.change.value,T.image);return}if(/crop|markup|resize/.test(I.change.key)){let T=y.getMetadata("crop"),_=h.ref.images[h.ref.images.length-1];if(T&&T.aspectRatio&&_.crop&&_.crop.aspectRatio&&Math.abs(T.aspectRatio-_.crop.aspectRatio)>1e-5){let x=o({root:h});r({root:h,props:E,image:Su(x.image)})}else s({root:h,props:E})}}},c=h=>{let I=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./),y=I?parseInt(I[1]):null;return y!==null&&y<=58?!1:"createImagLine truncated
`+W.outerHTML+` `+j.outerHTML+`
`},""),_=` `},""),_=`
<g>${_.replace(/&nbsp;/g," ")}</g> <g>${_.replace(/&nbsp;/g," ")}</g>
`}let x=t.aspectRatio||E/y,R=y,z=R*x,P=typeof t.scaleToFit>"u"||t.scaleToFit,A=t.center?t.center.x:.5,B=t.center?t.center.y:.5,w=_o({width:y,height:E},wo({width:R,height:z},x),t.rotation,P?{x:A,y:B}:{x:.5,y:.5}),F=t.zoom*w,S=t.rotation*(180/Math.PI),L={x:R*.5,y:z*.5},D={x:L.x-y*A,y:L.y-E*B},O=[`rotate(${S} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${F})`,`translate(${-L.x} ${-L.y})`,`translate(${D.x} ${D.y})`],G=t.flip&&t.flip.horizontal,C=t.flip&&t.flip.vertical,$=[`scale(${G?-1:1} ${C?-1:1})`,`translate(${G?-y:0} ${C?-E:0})`],K=`<?xml version="1.0" encoding="UTF-8"?> `}let x=t.aspectRatio||T/y,R=y,z=R*x,P=typeof t.scaleToFit>"u"||t.scaleToFit,A=t.center?t.center.x:.5,B=t.center?t.center.y:.5,w=_o({width:y,height:T},wo({width:R,height:z},x),t.rotation,P?{x:A,y:B}:{x:.5,y:.5}),F=t.zoom*w,S=t.rotation*(180/Math.PI),L={x:R*.5,y:z*.5},D={x:L.x-y*A,y:L.y-T*B},O=[`rotate(${S} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${F})`,`translate(${-L.x} ${-L.y})`,`translate(${D.x} ${D.y})`],G=t.flip&&t.flip.horizontal,C=t.flip&&t.flip.vertical,X=[`scale(${G?-1:1} ${C?-1:1})`,`translate(${G?-y:0} ${C?-T:0})`],K=`<?xml version="1.0" encoding="UTF-8"?>
<svg width="${R}${v}" height="${z}${h}" <svg width="${R}${v}" height="${z}${h}"
viewBox="0 0 ${R} ${z}" ${l?'style="background:'+l+'" ':""} viewBox="0 0 ${R} ${z}" ${l?'style="background:'+l+'" ':""}
preserveAspectRatio="xMinYMin" preserveAspectRatio="xMinYMin"
@@ -33,11 +33,11 @@ xmlns="http://www.w3.org/2000/svg">
<!-- Generated by PQINA - https://pqina.nl/ --> <!-- Generated by PQINA - https://pqina.nl/ -->
<title>${d?d.textContent:""}</title> <title>${d?d.textContent:""}</title>
<g transform="${O.join(" ")}"> <g transform="${O.join(" ")}">
<g transform="${$.join(" ")}"> <g transform="${X.join(" ")}">
${p.outerHTML}${_} ${p.outerHTML}${_}
</g> </g>
</g> </g>
</svg>`;n(K)},o.readAsText(e)}),hg=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},bg=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,g=null;if(u.forEach(f=>{f.type==="filter"&&(g=f)}),g){let f=null;u.forEach(b=>{b.type==="resize"&&(f=b)}),f&&(f.data.matrix=g.data,u=u.filter(b=>b.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,l=1;function o(d,m,u){let g=m[d]/255,f=m[d+1]/255,b=m[d+2]/255,v=m[d+3]/255,h=g*u[0]+f*u[1]+b*u[2]+v*u[3]+u[4],T=g*u[5]+f*u[6]+b*u[7]+v*u[8]+u[9],I=g*u[10]+f*u[11]+b*u[12]+v*u[13]+u[14],y=g*u[15]+f*u[16]+b*u[17]+v*u[18]+u[19],E=Math.max(0,h*y)+a*(1-y),_=Math.max(0,T*y)+n*(1-y),x=Math.max(0,I*y)+l*(1-y);m[d]=Math.max(0,Math.min(1,E))*255,m[d+1]=Math.max(0,Math.min(1,_))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,g=u.length,f=m[0],b=m[1],v=m[2],h=m[3],T=m[4],I=m[5],y=m[6],E=m[7],_=m[8],x=m[9],R=m[10],z=m[11],P=m[12],A=m[13],B=m[14],w=m[15],F=m[16],S=m[17],L=m[18],D=m[19],O=0,G=0,C=0,$=0,K=0,X=0,ge=0,N=0,W=0,Y=0,ce=0,ie=0;for(;O<g;O+=4)G=u[O]/255,C=u[O+1]/255,$=u[O+2]/255,K=u[O+3]/255,X=G*f+C*b+$*v+K*h+T,ge=G*I+C*y+$*E+K*_+x,N=G*R+C*z+$*P+K*A+B,W=G*w+C*F+$*S+K*L+D,Y=Math.max(0,X*W)+a*(1-W),ce=Math.max(0,ge*W)+n*(1-W),ie=Math.max(0,N*W)+l*(1-W),u[O]=Math.max(0,Math.min(1,Y))*255,u[O+1]=Math.max(0,Math.min(1,ce))*255,u[O+2]=Math.max(0,Math.min(1,ie))*255;return d}function c(d,m){let{mode:u="contain",upscale:g=!1,width:f,height:b,matrix:v}=m;if(v=!v||s(v)?null:v,!f&&!b)return p(d,v);if(f===null?f=b:b===null&&(b=f),u!=="force"){let A=f/d.width,B=b/d.height,w=1;if(u==="cover"?w=Math.max(A,B):u==="contain"&&(w=Math.min(A,B)),w>1&&g===!1)return p(d,v);f=d.width*w,b=d.height*w}let h=d.width,T=d.height,I=Math.round(f),y=Math.round(b),E=d.data,_=new Uint8ClampedArray(I*y*4),x=h/I,R=T/y,z=Math.ceil(x*.5),P=Math.ceil(R*.5);for(let A=0;A<y;A++)for(let B=0;B<I;B++){let w=(B+A*I)*4,F=0,S=0,L=0,D=0,O=0,G=0,C=0,$=(A+.5)*R;for(let K=Math.floor(A*R);K<(A+1)*R;K++){let X=Math.abs($-(K+.5))/P,ge=(B+.5)*x,N=X*X;for(let W=Math.floor(B*x);W<(B+1)*x;W++){let Y=Math.abs(ge-(W+.5))/z,ce=Math.sqrt(N+Y*Y);if(ce>=-1&&ce<=1&&(F=2*ce*ce*ce-3*ce*ce+1,F>0)){Y=4*(W+K*h);let ie=E[Y+3];C+=F*ie,L+=F,ie<255&&(F=F*ie/250),D+=F*E[Y],O+=F*E[Y+1],G+=F*E[Y+2],S+=F}}}_[w]=D/S,_[w+1]=O/S,_[w+2]=G/S,_[w+3]=C/L,v&&o(w,_,v)}return{data:_,width:I,height:y}}},Eg=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n<a;n++)if(e.getUint16(t+n*12,i)===274)return e.setUint16(t+n*12+8,1,i),!0;return!1},Tg=e=>{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,l=!1;for(;i<t.byteLength&&(a=t.getUint16(i,!1),n=t.getUint16(i+2,!1)+2,!(!(a>=65504&&a<=65519||a===65534)||(l||(l=Eg(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},vg=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(Tg(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),Ig=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,xg=(e,t)=>{let i=Ig();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},yg=()=>Math.random().toString(36).substr(2,9),Rg=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(l,o,r)=>{let s=yg();n[s]=o,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:l},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},Sg=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),_g=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.concat.bind(a))),Promise.resolve([])),wg=(e,t)=>new Promise(i=>{let a={width:e.width,height:e.height},n=e.getContext("2d"),l=t.sort(Ao).map(o=>()=>new Promise(r=>{Og[o[0]](n,a,o[1],r)&&r()}));_g(l).then(()=>i(e))}),Ot=(e,t)=>{e.beginPath(),e.lineCap=t["stroke-linecap"],e.lineJoin=t["stroke-linejoin"],e.lineWidth=t["stroke-width"],t["stroke-dasharray"].length&&e.setLineDash(t["stroke-dasharray"].split(",")),e.fillStyle=t.fill,e.strokeStyle=t.stroke,e.globalAlpha=t.opacity||1},Dt=e=>{e.fill(),e.stroke(),e.globalAlpha=1},Lg=(e,t,i)=>{let a=Ft(i,t),n=ht(i,t);return Ot(e,n),e.rect(a.x,a.y,a.width,a.height),Dt(e,n),!0},Mg=(e,t,i)=>{let a=Ft(i,t),n=ht(i,t);Ot(e,n);let l=a.x,o=a.y,r=a.width,s=a.height,p=.5522848,c=r/2*p,d=s/2*p,m=l+r,u=o+s,g=l+r/2,f=o+s/2;return e.moveTo(l,f),e.bezierCurveTo(l,f-d,g-c,o,g,o),e.bezierCurveTo(g+c,o,m,f-d,m,f),e.bezierCurveTo(m,f+d,g+c,u,g,u),e.bezierCurveTo(Line truncated </svg>`;n(K)},o.readAsText(e)}),pg=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},mg=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,g=null;if(u.forEach(f=>{f.type==="filter"&&(g=f)}),g){let f=null;u.forEach(b=>{b.type==="resize"&&(f=b)}),f&&(f.data.matrix=g.data,u=u.filter(b=>b.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,l=1;function o(d,m,u){let g=m[d]/255,f=m[d+1]/255,b=m[d+2]/255,v=m[d+3]/255,h=g*u[0]+f*u[1]+b*u[2]+v*u[3]+u[4],E=g*u[5]+f*u[6]+b*u[7]+v*u[8]+u[9],I=g*u[10]+f*u[11]+b*u[12]+v*u[13]+u[14],y=g*u[15]+f*u[16]+b*u[17]+v*u[18]+u[19],T=Math.max(0,h*y)+a*(1-y),_=Math.max(0,E*y)+n*(1-y),x=Math.max(0,I*y)+l*(1-y);m[d]=Math.max(0,Math.min(1,T))*255,m[d+1]=Math.max(0,Math.min(1,_))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,g=u.length,f=m[0],b=m[1],v=m[2],h=m[3],E=m[4],I=m[5],y=m[6],T=m[7],_=m[8],x=m[9],R=m[10],z=m[11],P=m[12],A=m[13],B=m[14],w=m[15],F=m[16],S=m[17],L=m[18],D=m[19],O=0,G=0,C=0,X=0,K=0,Z=0,ge=0,k=0,j=0,$=0,ce=0,te=0;for(;O<g;O+=4)G=u[O]/255,C=u[O+1]/255,X=u[O+2]/255,K=u[O+3]/255,Z=G*f+C*b+X*v+K*h+E,ge=G*I+C*y+X*T+K*_+x,k=G*R+C*z+X*P+K*A+B,j=G*w+C*F+X*S+K*L+D,$=Math.max(0,Z*j)+a*(1-j),ce=Math.max(0,ge*j)+n*(1-j),te=Math.max(0,k*j)+l*(1-j),u[O]=Math.max(0,Math.min(1,$))*255,u[O+1]=Math.max(0,Math.min(1,ce))*255,u[O+2]=Math.max(0,Math.min(1,te))*255;return d}function c(d,m){let{mode:u="contain",upscale:g=!1,width:f,height:b,matrix:v}=m;if(v=!v||s(v)?null:v,!f&&!b)return p(d,v);if(f===null?f=b:b===null&&(b=f),u!=="force"){let A=f/d.width,B=b/d.height,w=1;if(u==="cover"?w=Math.max(A,B):u==="contain"&&(w=Math.min(A,B)),w>1&&g===!1)return p(d,v);f=d.width*w,b=d.height*w}let h=d.width,E=d.height,I=Math.round(f),y=Math.round(b),T=d.data,_=new Uint8ClampedArray(I*y*4),x=h/I,R=E/y,z=Math.ceil(x*.5),P=Math.ceil(R*.5);for(let A=0;A<y;A++)for(let B=0;B<I;B++){let w=(B+A*I)*4,F=0,S=0,L=0,D=0,O=0,G=0,C=0,X=(A+.5)*R;for(let K=Math.floor(A*R);K<(A+1)*R;K++){let Z=Math.abs(X-(K+.5))/P,ge=(B+.5)*x,k=Z*Z;for(let j=Math.floor(B*x);j<(B+1)*x;j++){let $=Math.abs(ge-(j+.5))/z,ce=Math.sqrt(k+$*$);if(ce>=-1&&ce<=1&&(F=2*ce*ce*ce-3*ce*ce+1,F>0)){$=4*(j+K*h);let te=T[$+3];C+=F*te,L+=F,te<255&&(F=F*te/250),D+=F*T[$],O+=F*T[$+1],G+=F*T[$+2],S+=F}}}_[w]=D/S,_[w+1]=O/S,_[w+2]=G/S,_[w+3]=C/L,v&&o(w,_,v)}return{data:_,width:I,height:y}}},ug=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n<a;n++)if(e.getUint16(t+n*12,i)===274)return e.setUint16(t+n*12+8,1,i),!0;return!1},gg=e=>{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,l=!1;for(;i<t.byteLength&&(a=t.getUint16(i,!1),n=t.getUint16(i+2,!1)+2,!(!(a>=65504&&a<=65519||a===65534)||(l||(l=ug(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},fg=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(gg(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),hg=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,bg=(e,t)=>{let i=hg();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},Eg=()=>Math.random().toString(36).substr(2,9),Tg=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(l,o,r)=>{let s=Eg();n[s]=o,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:l},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},vg=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Ig=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototype.concat.bind(a))),Promise.resolve([])),xg=(e,t)=>new Promise(i=>{let a={width:e.width,height:e.height},n=e.getContext("2d"),l=t.sort(Ao).map(o=>()=>new Promise(r=>{Mg[o[0]](n,a,o[1],r)&&r()}));Ig(l).then(()=>i(e))}),Ot=(e,t)=>{e.beginPath(),e.lineCap=t["stroke-linecap"],e.lineJoin=t["stroke-linejoin"],e.lineWidth=t["stroke-width"],t["stroke-dasharray"].length&&e.setLineDash(t["stroke-dasharray"].split(",")),e.fillStyle=t.fill,e.strokeStyle=t.stroke,e.globalAlpha=t.opacity||1},Dt=e=>{e.fill(),e.stroke(),e.globalAlpha=1},yg=(e,t,i)=>{let a=Ft(i,t),n=ht(i,t);return Ot(e,n),e.rect(a.x,a.y,a.width,a.height),Dt(e,n),!0},Rg=(e,t,i)=>{let a=Ft(i,t),n=ht(i,t);Ot(e,n);let l=a.x,o=a.y,r=a.width,s=a.height,p=.5522848,c=r/2*p,d=s/2*p,m=l+r,u=o+s,g=l+r/2,f=o+s/2;return e.moveTo(l,f),e.bezierCurveTo(l,f-d,g-c,o,g,o),e.bezierCurveTo(g+c,o,m,f-d,m,f),e.bezierCurveTo(m,f+d,g+c,u,g,u),e.bezierCurveTo(Line truncated
/*! Bundled license information: /*! Bundled license information:
filepond/dist/filepond.esm.js: filepond/dist/filepond.esm.js:
@@ -1,37 +1,37 @@
var $g=Object.defineProperty;var $o=(t,e)=>{for(var n in e)$g(t,n,{get:e[n],enumerable:!0})};var Ri={};$o(Ri,{CommandManager:()=>Rn,DECORATION_MANAGER_PLUGIN_KEY:()=>Nn,Decoration:()=>mo,DecorationManager:()=>Zf,Editor:()=>Dx,Extendable:()=>Ei,Extension:()=>Z,Fragment:()=>Bx,InlineDecoration:()=>Ch,InputRule:()=>cn,MappablePosition:()=>va,Mark:()=>le,MarkView:()=>vx,Node:()=>j,NodeDecoration:()=>vh,NodePos:()=>Sh,NodeView:()=>Wx,PasteRule:()=>wr,ResizableNodeView:()=>Ni,ResizableNodeview:()=>Vx,Tracker:()=>Ux,WidgetDecoration:()=>Mh,attrsEqual:()=>Ta,callOrReturn:()=>G,canInsertNode:()=>Aa,combineTransactionSteps:()=>wi,commands:()=>_f,createAtomBlockMarkdownSpec:()=>ih,createBlockMarkdownSpec:()=>br,createChainableState:()=>lo,createDocument:()=>mi,createElement:()=>Hx,createInlineMarkdownSpec:()=>sh,createMappablePosition:()=>Vf,createNodeFromContent:()=>Ln,createStyleTag:()=>eh,createWidgetDecoration:()=>Px,decodeHtmlEntities:()=>ax,defaultBlockAt:()=>gr,deleteProps:()=>sa,elementFromString:()=>fr,encodeHtmlEntities:()=>cx,escapeForRegEx:()=>Ea,extensions:()=>Ox,findChildren:()=>yr,findChildrenInRange:()=>pa,findDuplicates:()=>Lf,findParentNode:()=>Ht,findParentNodeClosestToPos:()=>dt,flattenExtensions:()=>xi,fromString:()=>Df,generateHTML:()=>aw,generateJSON:()=>cw,generateText:()=>dw,getAttributes:()=>vi,getAttributesFromExtensions:()=>ga,getChangedRanges:()=>Pn,getDebugJSON:()=>$f,getExtensionField:()=>P,getHTMLFromFragment:()=>co,getMarkAttributes:()=>ha,getMarkRange:()=>bi,getMarkType:()=>wt,getMarksBetween:()=>uo,getNodeAtPosition:()=>xa,getNodeAttributes:()=>If,getNodeType:()=>de,getPreviousBlockSibling:()=>ka,getRenderedAttributes:()=>zt,getSchema:()=>Si,getSchemaByResolvedExtensions:()=>ya,getSchemaTypeByName:()=>On,getSchemaTypeNameByName:()=>ao,getSplittedAttributes:()=>oo,getStyleProperty:()=>Oa,getText:()=>wa,getTextBetween:()=>ba,getTextContentFromNodes:()=>Bf,getTextSerializersFromSchema:()=>Ci,getUpdatedPosition:()=>Ff,h:()=>Hx,injectExtensionAttributesToParseRule:()=>la,inputRulesPlugin:()=>lh,isActive:()=>Mi,isAndroid:()=>so,isAtEndOfNode:()=>Sa,isAtStartOfNode:()=>Ca,isEmptyObject:()=>Rf,isExtensionRulesEnabled:()=>aa,isFirefox:()=>dx,isFunction:()=>ma,isList:()=>hi,isMacOS:()=>fa,isMarkActive:()=>gi,isNodeActive:()=>ct,isNodeEmpty:()=>$n,isNodeSelection:()=>fo,isNodeViewSelected:()=>fw,isNumber:()=>th,isPlainObject:()=>no,isProseMirrorAddMarkStep:()=>hw,isProseMirrorAddNodeMarkStep:()=>pw,isProseMirrorAttrStep:()=>mw,isProseMirrorCellSelection:()=>gw,isProseMirrorDocAttrStep:()=>yw,isProseMirrorFragment:()=>zf,isProseMirrorNodeSelection:()=>bw,isProseMirrorRemoveMarkStep:()=>ww,isProseMirrorRemoveNodeMarkStep:()=>xw,isProseMirrorReplaceAroundStep:()=>kw,isProseMirrorReplaceStep:()=>Sw,isProseMirrorSlice:()=>Cw,isProseMirrorStep:()=>Ft,isProseMirrorStepResult:()=>vw,isRegExp:()=>yi,isSafari:()=>Af,isString:()=>fx,isTextSelection:()=>mr,isiOS:()=>Dn,liveWidgetKeys:()=>Qf,markInputRule:()=>Le,markPasteRule:()=>Ae,markdown:()=>Sx,marksEqual:()=>Cx,mergeAttributes:()=>D,mergeDeep:()=>Ra,minMax:()=>bt,nodeInputRule:()=>go,nodePasteRule:()=>jx,objectIncludes:()=>io,parseAttributes:()=>Ti,parseIndentedBlocks:()=>ho,pasteRulesPlugin:()=>ch,posToDOMRect:()=>Ma,removeDuplicates:()=>Pf,renderNestedMarkdownContent:()=>po,resolveExtensions:()=>ki,resolveFocusPosition:()=>pi,rewriteUnknownContent:()=>Mw,selectionToInsertionEnd:()=>ua,serializeAttributes:()=>Ai,sortExtensions:()=>hr,splitExtensions:()=>In,textInputRule:()=>$x,textPasteRule:()=>_x,textblockTypeInputRule:()=>xr,updateMarkViewAttributes:()=>Da,wrappingInputRule:()=>Vt});var Uc=Object.defineProperty,Bo=(t,e)=>{let n={};for(var r in t)Uc(n,r,{get:t[r],enumerable:!0});return e||Uc(n,Symbol.toStringTag,{value:"Module"}),n};function Ce(t){this.content=t}Ce.prototype={constructor:Ce,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Ce(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Ce(n)},addToStart:function(t,e){return new Ce([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ce(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Ce(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ce.from(t),t.size?new Ce(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ce.from(t),t.size?new Ce(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ce.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){vaLine truncated var $g=Object.defineProperty;var Po=(t,e)=>{for(var n in e)$g(t,n,{get:e[n],enumerable:!0})};var Ni={};Po(Ni,{CommandManager:()=>On,DECORATION_MANAGER_PLUGIN_KEY:()=>En,Decoration:()=>ho,DecorationManager:()=>Qf,Editor:()=>Dx,Extendable:()=>Ai,Extension:()=>Z,Fragment:()=>Bx,InlineDecoration:()=>Sh,InputRule:()=>ln,MappablePosition:()=>Ca,Mark:()=>ie,MarkView:()=>vx,Node:()=>W,NodeDecoration:()=>Ch,NodePos:()=>kh,NodeView:()=>Wx,PasteRule:()=>yr,ResizableNodeView:()=>Oi,ResizableNodeview:()=>Vx,Tracker:()=>Ux,WidgetDecoration:()=>vh,attrsEqual:()=>Ma,callOrReturn:()=>G,canInsertNode:()=>Ta,combineTransactionSteps:()=>bi,commands:()=>jf,createAtomBlockMarkdownSpec:()=>oh,createBlockMarkdownSpec:()=>gr,createChainableState:()=>io,createDocument:()=>pi,createElement:()=>Hx,createInlineMarkdownSpec:()=>ih,createMappablePosition:()=>Ff,createNodeFromContent:()=>Rn,createStyleTag:()=>Zf,createWidgetDecoration:()=>Px,decodeHtmlEntities:()=>ax,defaultBlockAt:()=>pr,deleteProps:()=>ia,elementFromString:()=>dr,encodeHtmlEntities:()=>cx,escapeForRegEx:()=>Aa,extensions:()=>Ox,findChildren:()=>mr,findChildrenInRange:()=>ha,findDuplicates:()=>Df,findParentNode:()=>Ht,findParentNodeClosestToPos:()=>dt,flattenExtensions:()=>wi,fromString:()=>Rf,generateHTML:()=>aw,generateJSON:()=>cw,generateText:()=>dw,getAttributes:()=>Ci,getAttributesFromExtensions:()=>ma,getChangedRanges:()=>Ln,getDebugJSON:()=>Pf,getExtensionField:()=>B,getHTMLFromFragment:()=>lo,getMarkAttributes:()=>fa,getMarkRange:()=>yi,getMarkType:()=>xt,getMarksBetween:()=>ao,getNodeAtPosition:()=>wa,getNodeAttributes:()=>Lf,getNodeType:()=>ce,getPreviousBlockSibling:()=>xa,getRenderedAttributes:()=>zt,getSchema:()=>ki,getSchemaByResolvedExtensions:()=>ga,getSchemaTypeByName:()=>An,getSchemaTypeNameByName:()=>so,getSplittedAttributes:()=>no,getStyleProperty:()=>Ea,getText:()=>ba,getTextBetween:()=>ya,getTextContentFromNodes:()=>$f,getTextSerializersFromSchema:()=>Si,getUpdatedPosition:()=>Hf,h:()=>Hx,injectExtensionAttributesToParseRule:()=>sa,inputRulesPlugin:()=>sh,isActive:()=>vi,isAndroid:()=>oo,isAtEndOfNode:()=>ka,isAtStartOfNode:()=>Sa,isEmptyObject:()=>Nf,isExtensionRulesEnabled:()=>la,isFirefox:()=>dx,isFunction:()=>pa,isList:()=>fi,isMacOS:()=>ua,isMarkActive:()=>mi,isNodeActive:()=>ct,isNodeEmpty:()=>In,isNodeSelection:()=>co,isNodeViewSelected:()=>fw,isNumber:()=>eh,isPlainObject:()=>eo,isProseMirrorAddMarkStep:()=>hw,isProseMirrorAddNodeMarkStep:()=>pw,isProseMirrorAttrStep:()=>mw,isProseMirrorCellSelection:()=>gw,isProseMirrorDocAttrStep:()=>yw,isProseMirrorFragment:()=>Bf,isProseMirrorNodeSelection:()=>bw,isProseMirrorRemoveMarkStep:()=>ww,isProseMirrorRemoveNodeMarkStep:()=>xw,isProseMirrorReplaceAroundStep:()=>kw,isProseMirrorReplaceStep:()=>Sw,isProseMirrorSlice:()=>Cw,isProseMirrorStep:()=>Ft,isProseMirrorStepResult:()=>vw,isRegExp:()=>gi,isSafari:()=>Tf,isString:()=>fx,isTextSelection:()=>hr,isiOS:()=>Nn,liveWidgetKeys:()=>Yf,markInputRule:()=>Ie,markPasteRule:()=>Ne,markdown:()=>Sx,marksEqual:()=>Cx,mergeAttributes:()=>L,mergeDeep:()=>Na,minMax:()=>wt,nodeInputRule:()=>po,nodePasteRule:()=>jx,objectIncludes:()=>ro,parseAttributes:()=>Mi,parseIndentedBlocks:()=>uo,pasteRulesPlugin:()=>ah,posToDOMRect:()=>va,removeDuplicates:()=>If,renderNestedMarkdownContent:()=>fo,resolveExtensions:()=>xi,resolveFocusPosition:()=>hi,rewriteUnknownContent:()=>Mw,selectionToInsertionEnd:()=>da,serializeAttributes:()=>Ti,sortExtensions:()=>ur,splitExtensions:()=>Dn,textInputRule:()=>$x,textPasteRule:()=>_x,textblockTypeInputRule:()=>br,updateMarkViewAttributes:()=>Ra,wrappingInputRule:()=>Vt});var _c=Object.defineProperty,$o=(t,e)=>{let n={};for(var r in t)_c(n,r,{get:t[r],enumerable:!0});return e||_c(n,Symbol.toStringTag,{value:"Module"}),n};function Te(t){this.content=t}Te.prototype={constructor:Te,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new Te(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Te(n)},addToStart:function(t,e){return new Te([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Te(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new Te(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Te.from(t),t.size?new Te(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Te.from(t),t.size?new Te(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Te.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){vaLine truncated
`)}};en.empty=new en(!0);var qs=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function ud(t){let e=[];do e.push(Vg(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Vg(t){let e=[];do e.push(Wg(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Wg(t){let e=Ug(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=jg(t,e);else break;return e}function qc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function jg(t,e){let n=qc(t),r=n;return t.eat(",")&&(t.next!="}"?r=qc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _g(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Ug(t){if(t.eat("(")){let e=ud(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=_g(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Kg(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let d=n();o(i(s.expr,a),d),a=d}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let d=n();r(a,d),o(i(s.expr,a),d),a=d}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function fd(t,e){return e-t}function Jc(t,e){let n=[];return r(e),n.sort(fd);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function qg(t){let e=Object.create(null);return n(Jc(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let d=0;d<o.length;d++)o[d][0]==l&&(c=o[d][1]);Jc(t,a).forEach(d=>{c||o.push([l,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=e[r.join(",")]=new en(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(fd);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function Jg(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function hd(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function pd(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function md(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in t)t[o].validate&&t[o].validate(e[o])}function gd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Js(t,r,e[r]);return n}var Lr=class t{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=gd(e,r.attrs),this.defaultAttrs=hd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==en.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAtt Line truncated `)}};Qt.empty=new Qt(!0);var Ks=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function dd(t){let e=[];do e.push(Vg(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Vg(t){let e=[];do e.push(Wg(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Wg(t){let e=Ug(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=jg(t,e);else break;return e}function Kc(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function jg(t,e){let n=Kc(t),r=n;return t.eat(",")&&(t.next!="}"?r=Kc(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _g(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function Ug(t){if(t.eat("(")){let e=dd(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=_g(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Kg(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function o(s,l){s.forEach(a=>a.to=l)}function i(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=i(s.exprs[a],l);if(a==s.exprs.length-1)return c;o(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),o(i(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return o(i(s.expr,l),a),o(i(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(i(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c<s.min;c++){let d=n();o(i(s.expr,a),d),a=d}if(s.max==-1)o(i(s.expr,a),a);else for(let c=s.min;c<s.max;c++){let d=n();r(a,d),o(i(s.expr,a),d),a=d}return[r(a)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function ud(t,e){return e-t}function qc(t,e){let n=[];return r(e),n.sort(ud);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:l,to:a}=i[s];!l&&n.indexOf(a)==-1&&r(a)}}}function qg(t){let e=Object.create(null);return n(qc(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let d=0;d<o.length;d++)o[d][0]==l&&(c=o[d][1]);qc(t,a).forEach(d=>{c||o.push([l,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=e[r.join(",")]=new Qt(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let l=o[s][1].sort(ud);i.next.push({type:o[s][0],next:e[l.join(",")]||n(l)})}return i}}function Jg(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let l=0;l<o.next.length;l++){let{type:a,next:c}=o.next[l];s.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function fd(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function hd(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function pd(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${r}`);for(let o in t)t[o].validate&&t[o].validate(e[o])}function md(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new qs(t,r,e[r]);return n}var Rr=class t{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=md(e,r.attrs),this.defaultAttrs=fd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Qt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAtt Line truncated
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(s.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(s.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=o.content[o.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;bd.hasOwnProperty(s)&&this.parser.normalizeLists&&Zg(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Qg.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,d=this.needsBlock;if(yd.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let u=a&&a.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),c&&this.sync(i),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` `);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(s.linebreakReplacement.create(),n,!0),l[a]&&this.insertNode(s.text(l[a]),n,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=o.content[o.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;yd.hasOwnProperty(s)&&this.parser.normalizeLists&&Zg(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Qg.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,d=this.needsBlock;if(gd.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let u=a&&a.skip?n:this.readStyles(e,n);u&&this.addAll(e,u),c&&this.sync(i),this.needsBlock=d}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(i,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(s,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];s!=l;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,l=0;s>=0;s--){let a=this.nodes[s],c=a.findWrapping(e);if(c&&(!o||o.length>c.length+l)&&(o=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Q.none;for(let l of o.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Qc(l.type,e.type))&&(s=l.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Xc(e,i,s.options);s.options&Rr&&s.content.length==0&&(l|=Rr);let a=Q.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Qc(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Gn(e,n,a,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Ir)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let d=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function Zg(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&bd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function ey(t,e){return(t.matches||t.msMatchesSelector||t.webkitM Line truncated `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let l=void 0;;){let a=this.parser.matchStyle(i,s,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?n=n.filter(c=>!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(s,n.attrs||null,r,n.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof n.contentElement=="string"?a=e.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(e):n.contentElement&&(a=n.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];s!=l;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n,r){let o,i;for(let s=this.open,l=0;s>=0;s--){let a=this.nodes[s],c=a.findWrapping(e);if(c&&(!o||o.length>c.length+l)&&(o=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!o)return null;this.sync(i);for(let s=0;s<o.length;s++)n=this.enterInner(o[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let o=this.findPlace(e,n,r);if(o){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Q.none;for(let l of o.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):Yc(l.type,e.type))&&(s=l.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r,!1);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Gc(e,i,s.options);s.options&Or&&s.content.length==0&&(l|=Or);let a=Q.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):Yc(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new qn(e,n,a,o,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Dr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=i;a--)if(s(l-1,a))return!0;return!1}else{let d=a>0||a==0&&o?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}};function Zg(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&yd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function ey(t,e){return(t.matches||t.msMatchesSelector||t.webkitM Line truncated
`))}})}function hy(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function py(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new ue(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new T(v.from(s),0,0),1,!0))}function Ye(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>i;c--,d--){let u=o.node(c),f=o.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),p=r&&r[d+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function my(t,e,n=1,r){let o=t.doc.resolve(e),i=v.empty,s=v.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=v.from(o.node(l).copy(i));let d=r&&r[c];s=v.from(d?d.type.create(d.attrs,s):o.node(l).copy(s))}t.step(new ge(e,e,new T(i.append(s),n,n),!0))}function lt(t,e){let n=t.resolve(e),r=n.index();return Ed(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function gy(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Ed(t,e){return!!(t&&e&&!t.isLeaf&&gy(t,e))}function tr(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&Ed(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function yy(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(o);d&&!u?r=!1:!d&&u&&(r=!0)}let l=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Ad(t,d.node(),d.before(),l)}s.inlineContent&&nl(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new ge(c,a.map(e+n,-1),T.empty,!0)),r===!0){let d=t.doc.resolve(c);Td(t,d.node(),d.before(),t.steps.length)}return t}function by(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function qo(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),d=!1;if(i==1)d=c.canReplace(a,a,o);else{let u=c.contentMatchAt(a).findWrapping(o.firstChild.type);d=u&&c.canReplaceWith(a,a,u[0])}if(d)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Vr(t,e,n=e,r=T.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Od(o,i,r)?new ge(e,n,r):new el(o,i,r).fit()}function Od(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var el=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=v.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=v.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new T(i,s,l);return e>-1?new ue(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ge(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++ Line truncated `))}})}function hy(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function py(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new ue(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new E(S.from(s),0,0),1,!0))}function Ke(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,d=n-2;c>i;c--,d--){let u=o.node(c),f=o.index(c);if(u.type.spec.isolating)return!1;let h=u.content.cutByIndex(f,u.childCount),p=r&&r[d+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let g=r&&r[d]||u;if(!u.canReplace(f+1,u.childCount)||!g.type.validContent(h))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function my(t,e,n=1,r){let o=t.doc.resolve(e),i=S.empty,s=S.empty;for(let l=o.depth,a=o.depth-n,c=n-1;l>a;l--,c--){i=S.from(o.node(l).copy(i));let d=r&&r[c];s=S.from(d?d.type.create(d.attrs,s):o.node(l).copy(s))}t.step(new be(e,e,new E(i.append(s),n,n),!0))}function lt(t,e){let n=t.resolve(e),r=n.index();return Ad(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function gy(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function Ad(t,e){return!!(t&&e&&!t.isLeaf&&gy(t,e))}function Zn(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),l++,s=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),s=r.node(o+1)),i&&!i.isTextblock&&Ad(i,s)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function yy(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let d=s.whitespace=="pre",u=!!s.contentMatch.matchType(o);d&&!u?r=!1:!d&&u&&(r=!0)}let l=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Td(t,d.node(),d.before(),l)}s.inlineContent&&tl(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let a=t.mapping.slice(l),c=a.map(e-n);if(t.step(new be(c,a.map(e+n,-1),E.empty,!0)),r===!0){let d=t.doc.resolve(c);Md(t,d.node(),d.before(),t.steps.length)}return t}function by(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function Ko(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),d=!1;if(i==1)d=c.canReplace(a,a,o);else{let u=c.contentMatchAt(a).findWrapping(o.firstChild.type);d=u&&c.canReplaceWith(a,a,u[0])}if(d)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Hr(t,e,n=e,r=E.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return Ed(o,i,r)?new be(e,n,r):new Zs(o,i,r).fit()}function Ed(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}var Zs=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=S.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=S.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,l=o.depth;for(;s&&l&&i.childCount==1;)i=i.firstChild.content,s--,l--;let a=new E(i,s,l);return e>-1?new ue(r.pos,e,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new be(r.pos,o.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++ Line truncated
`).scrollIntoView()),!0)};function pl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var ml=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=pl(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(B.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},gl=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof ve||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=pl(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(s,i.createAndFill());l.setSelection(N.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},yl=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Ye(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Rt(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function Ty(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof I&&e.selection.node.isBlock)return!r.parentOffset||!Ye(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,l,a=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=pl(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let g=t&&t(o.parent,a,r);i.unshift(g||(a&&l?{type:l}:null)),s=h;break}else{if(h==1)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof N||e.selection instanceof ve)&&d.deleteSelection();let u=d.mapping.map(r.pos),f=Ye(d.doc,u,i.length,i);if(f||(i[0]=l?{type:l}:null,f=Ye(d.doc,u,i.length,i)),!f)return!1;if(d.split(u,i.length,i),!a&&c&&r.node(s).type!=l){let h=d.mapping.map(r.before(s)),p=d.doc.resolve(h);l&&r.node(s-1).canReplaceWith(p.index(),p.index()+1,l)&&d.setNodeMarkup(d.mapping.map(r.before(s)),l)}return n&&n(d.scrollIntoView()),!0}}var Ay=Ty();var Yd=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(I.create(t.doc,o))),!0)},Ey=(t,e)=>(e&&e(t.tr.setSelection(new ve(t.doc))),!0);function Oy(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||lt(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Qd(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,a=o.type.spec.isolating||i.type.spec.isolating;if(!a&&Oy(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,p=v.empty;for(let y=s.length-1;y>=0;y--)p=v.from(s[y].create(null,p));p=v.from(o.copy(p));let g=t.tr.step(new ue(e.pos-1,h,e.pos,h,new T(p,1,0),s.length,!0)),m=g.doc.resolve(h+2*s.length);m.nodeAfter&&m.nodeAfter.type==o.type&&lt(g.doc,m.pos)&&g.join(m.pos),n(g.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&a?null:B.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&Rt(u);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&or(i,"start",!0)&&or(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=i,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let y=v.empty;for(let b=p.length-1;b>=0;b--)y=v.from(p[b].copy(y));let x=t.tr.step(new ue(e.pos-p.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new T(y,p.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function Zd(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(N.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}var bl=Zd(-1),wl=Zd(1);function eu(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&er(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function xl(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(s,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let d=n.doc.resolve(c),u=d.index();o=d.parent.canReplaceWith(u,u+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function kl(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var sl=kl(Wd,ll,al),Vd=kl(Wd,dl,ul),nn={Enter:kl(hl,gl,yl,Ay),"Mod-Enter":ml,Backspace:sl,"Mod- Line truncated `).scrollIntoView()),!0)};function hl(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var pl=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=hl(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let l=n.after(),a=t.tr.replaceWith(l,l,s.createAndFill());a.setSelection(z.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},ml=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Ae||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=hl(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(s,i.createAndFill());l.setSelection(R.create(l.doc,s+1)),e(l.scrollIntoView())}return!0},gl=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(Ke(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Rt(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function Ty(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof $&&e.selection.node.isBlock)return!r.parentOffset||!Ke(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],s,l,a=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=hl(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let g=t&&t(o.parent,a,r);i.unshift(g||(a&&l?{type:l}:null)),s=h;break}else{if(h==1)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof R||e.selection instanceof Ae)&&d.deleteSelection();let u=d.mapping.map(r.pos),f=Ke(d.doc,u,i.length,i);if(f||(i[0]=l?{type:l}:null,f=Ke(d.doc,u,i.length,i)),!f)return!1;if(d.split(u,i.length,i),!a&&c&&r.node(s).type!=l){let h=d.mapping.map(r.before(s)),p=d.doc.resolve(h);l&&r.node(s-1).canReplaceWith(p.index(),p.index()+1,l)&&d.setNodeMarkup(d.mapping.map(r.before(s)),l)}return n&&n(d.scrollIntoView()),!0}}var Ay=Ty();var Xd=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection($.create(t.doc,o))),!0)},Ey=(t,e)=>(e&&e(t.tr.setSelection(new Ae(t.doc))),!0);function Oy(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||lt(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function Yd(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,l,a=o.type.spec.isolating||i.type.spec.isolating;if(!a&&Oy(t,e,n))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&l.matchType(s[0]||i.type).validEnd){if(n){let h=e.pos+i.nodeSize,p=S.empty;for(let y=s.length-1;y>=0;y--)p=S.from(s[y].create(null,p));p=S.from(o.copy(p));let g=t.tr.step(new ue(e.pos-1,h,e.pos,h,new E(p,1,0),s.length,!0)),m=g.doc.resolve(h+2*s.length);m.nodeAfter&&m.nodeAfter.type==o.type&&lt(g.doc,m.pos)&&g.join(m.pos),n(g.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&a?null:z.findFrom(e,1),u=d&&d.$from.blockRange(d.$to),f=u&&Rt(u);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(u,f).scrollIntoView()),!0;if(c&&nr(i,"start",!0)&&nr(o,"end")){let h=o,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let g=i,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(h.canReplace(h.childCount,h.childCount,g.content)){if(n){let y=S.empty;for(let x=p.length-1;x>=0;x--)y=S.from(p[x].copy(y));let w=t.tr.step(new ue(e.pos-p.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new E(y,p.length,0),0,!0));n(w.scrollIntoView())}return!0}}return!1}function Qd(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(R.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}var yl=Qd(-1),bl=Qd(1);function Zd(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&Qn(s,t,e);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function wl(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:l}}=n.selection.ranges[i];n.doc.nodesBetween(s,l,(a,c)=>{if(o)return!1;if(!(!a.isTextblock||a.hasMarkup(t,e)))if(a.type==t)o=!0;else{let d=n.doc.resolve(c),u=d.index();o=d.parent.canReplaceWith(u,u+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:l},$to:{pos:a}}=n.selection.ranges[s];i.setBlockType(l,a,t,e)}r(i.scrollIntoView())}return!0}}function xl(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}var il=xl(Vd,sl,ll),Fd=xl(Vd,cl,dl),en={Enter:xl(fl,ml,gl,Ay),"Mod-Enter":pl,Backspace:il,"Mod- Line truncated
`),u&&p==h.nodeValue.length)for(let g=h,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(l=a={node:m.parentNode,offset:we(m)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[p-1];u=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(et&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||u&&Te)&&Tn(l.node,l.offset,d.anchorNode,d.anchorOffset)&&Tn(a.node,a.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(u&&et)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?xn:du,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=at:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?xn:at}r=s}this.dirty=xn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?xn:du;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Qo=class extends An{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.hasAttribute("contenteditable")||(s.contentEditable="false"),s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==tt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Dl=class extends An{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},Sn=class t extends An{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=gt.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&at||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=at&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=tt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=tt}}slice(e,n,r){let o=t.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=$l(i,n,s,r)),e>0&&(i=$l(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},ln=class t extends An{constructor(e,n,r,o,i,s,l){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=gt.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=Uu(d,r,n),c?a=new Ll(e,n,r,o,d,u||null,f,c):n.isText?new Zo(e,n,r,o,d,f):new t(e,n,r,o,d,u||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let o=this.children[r];if(this.dom.contains(o.dom.parentNode)){n.contentElemen Line truncated `),u&&p==h.nodeValue.length)for(let g=h,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(l=a={node:m.parentNode,offset:Se(m)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=h.childNodes[p-1];u=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Ge&&d.focusNode&&d.focusNode!=a.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(o=!0)}if(!(o||u&&Oe)&&vn(l.node,l.offset,d.anchorNode,d.anchorOffset)&&vn(a.node,a.offset,d.focusNode,d.focusOffset))return;let f=!1;if((c.extend||e==n)&&!(u&&Ge)){c.collapse(l.node,l.offset);try{e!=n&&c.extend(a.node,a.offset),f=!0}catch{}}if(!f){if(e>n){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let l=r+i.border,a=s-i.border;if(e>=l&&n<=a){this.dirty=e==r||n==s?bn:cu,e==l&&n==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=at:i.markDirty(e-l,n-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?bn:at}r=s}this.dirty=bn}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?bn:cu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Yo=class extends Mn{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.hasAttribute("contenteditable")||(s.contentEditable="false"),s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==Xe&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},Rl=class extends Mn{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},xn=class t extends Mn{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=yt.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new t(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&at||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=at&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Xe){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Xe}}slice(e,n,r){let o=t.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=Pl(i,n,s,r)),e>0&&(i=Pl(i,0,e,r));for(let l=0;l<i.length;l++)i[l].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},on=class t extends Mn{constructor(e,n,r,o,i,s,l){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,i,s){let l=i.nodeViews[n.type.name],a,c=l&&l(n,i,()=>{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,o),d=c&&c.dom,u=c&&c.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:u}=yt.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!u&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=_u(d,r,n),c?a=new Dl(e,n,r,o,d,u||null,f,c):n.isText?new Qo(e,n,r,o,d,f):new t(e,n,r,o,d,u||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let o=this.children[r];if(this.dom.contains(o.dom.parentNode)){n.contentElemen Line truncated
`);return{dom:a,text:f,slice:e}}function Yl(t,e,n,r,o){let i=o.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return l=new T(v.from(t.state.schema.text(e.replace(/\r\n?/g,` `);return{dom:a,text:f,slice:e}}function Xl(t,e,n,r,o){let i=o.parent.type.spec.code,s,l;if(!n&&!e)return null;let a=!!e&&(r||i||!n);if(a){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return l=new E(S.from(t.state.schema.text(e.replace(/\r\n?/g,`
`))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let u=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(u)l=u;else{let f=o.marks(),{schema:h}=t.state,p=gt.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=C0(n),Qr&&v0(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||_e.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||d),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!x0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)l=M0(Cu(l,+d[1],+d[2]),d[4]);else if(l=T.maxOpen(k0(l.content,o),!0),l.openStart||l.openEnd){let u=0,f=0;for(let h=l.content.firstChild;u<l.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=Cu(l,u,f)}return t.someProp("transformPasted",u=>{l=u(l,t,a)}),l}var x0=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function k0(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(l=>{if(!s)return;let a=o.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&i.length&&Yu(a,i,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Qu(s[s.length-1],i.length));let d=Xu(l,a);s.push(d),o=o.matchType(d.type),i=a}}),s)return v.from(s)}return t}function Xu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,v.from(t));return t}function Yu(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Yu(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(v.from(Xu(n,t,o+1))))}}function Qu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Qu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(v.empty,!0);return t.copy(n.append(r))}function Hl(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(i=0),o<r-1&&(l=Hl(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(v.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Cu(t,e,n){return e<t.openStart&&(t=new T(Hl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new T(Hl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Zu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function ef(){return document.implementation.createHTMLDocument("title")}var _r=null;function S0(t){let e=window.trustedTypes;if(!e)return t;if(!_r){if(_r=e.defaultPolicy)try{return _r.createHTML(t)}catch{}_r=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return _r.createHTML(t)}function C0(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=ef(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),i;if((i=o&&Zu[o[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=S0(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;for(let s=0;s<n.styleSheets.length;s++){let l=n.styleSheets[s];for(let a=0;a<l.rules.length;a++){let c=l.rules[a];if(c instanceof CSSStyleRule){let d=r.querySelectorAll(c.selectorText);for(let u=0;u<d.length;u++)d[u].style.cssText+=c.style.cssText}}}return r}function v0(t){let e=t.querySelectorAll(xe?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function M0(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;try{a.checkAttrs(r[l+1])}catch{break}o=v.from(a.create(r[l+1],o)),i++,s++}return new T(o,i,s)}var Re={},De={},T0={touchstart:!0,touchmove:!0},Fl=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.com Line truncated `))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let u=t.someProp("clipboardTextParser",f=>f(e,o,r,t));if(u)l=u;else{let f=o.marks(),{schema:h}=t.state,p=yt.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(h.text(g,f)))})}}else t.someProp("transformPastedHTML",u=>{n=u(n,t)}),s=C0(n),Xr&&v0(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let u=+d[3];u>0;u--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Ve.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||d),context:o,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!x0.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)l=M0(Su(l,+d[1],+d[2]),d[4]);else if(l=E.maxOpen(k0(l.content,o),!0),l.openStart||l.openEnd){let u=0,f=0;for(let h=l.content.firstChild;u<l.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=l.content.lastChild;f<l.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);l=Su(l,u,f)}return t.someProp("transformPasted",u=>{l=u(l,t,a)}),l}var x0=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function k0(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(l=>{if(!s)return;let a=o.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&i.length&&Xu(a,i,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Yu(s[s.length-1],i.length));let d=Gu(l,a);s.push(d),o=o.matchType(d.type),i=a}}),s)return S.from(s)}return t}function Gu(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,S.from(t));return t}function Xu(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Xu(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(S.from(Gu(n,t,o+1))))}}function Yu(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Yu(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(S.empty,!0);return t.copy(n.append(r))}function zl(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,l=s.content;return t.childCount>1&&(i=0),o<r-1&&(l=zl(l,e,n,r,o+1,i)),o>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(S.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Su(t,e,n){return e<t.openStart&&(t=new E(zl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new E(zl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Qu={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function Zu(){return document.implementation.createHTMLDocument("title")}var Wr=null;function S0(t){let e=window.trustedTypes;if(!e)return t;if(!Wr){if(Wr=e.defaultPolicy)try{return Wr.createHTML(t)}catch{}Wr=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return Wr.createHTML(t)}function C0(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Zu(),r=n.body,o=/<([a-z][^>\s]+)/i.exec(t),i;if((i=o&&Qu[o[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),r.innerHTML=S0(t),i)for(let s=0;s<i.length;s++)r=r.querySelector(i[s])||r;for(let s=0;s<n.styleSheets.length;s++){let l=n.styleSheets[s];for(let a=0;a<l.rules.length;a++){let c=l.rules[a];if(c instanceof CSSStyleRule){let d=r.querySelectorAll(c.selectorText);for(let u=0;u<d.length;u++)d[u].style.cssText+=c.style.cssText}}}return r}function v0(t){let e=t.querySelectorAll(Ce?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function M0(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let l=r.length-2;l>=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;try{a.checkAttrs(r[l+1])}catch{break}o=S.from(a.create(r[l+1],o)),i++,s++}return new E(o,i,s)}var De={},Le={},T0={touchstart:!0,touchmove:!0},Hl=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.com Line truncated
`,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,o,(a,c,d,u)=>{a.isBlock&&c>r&&(l+=i);let f=s?.[a.type.name];if(f)return d&&(l+=f({node:a,pos:c,parent:d,index:u,range:e})),!1;if(a.isText){var h;l+=a==null||(h=a.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,o-c)}}),l}function wa(t,e){return ba(t,{from:0,to:t.content.size},e)}function Ci(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function dw(t,e,n){let{blockSeparator:r=` `,textSerializers:s={}}=n||{},l="";return t.nodesBetween(r,o,(a,c,d,u)=>{a.isBlock&&c>r&&(l+=i);let f=s?.[a.type.name];if(f)return d&&(l+=f({node:a,pos:c,parent:d,index:u,range:e})),!1;if(a.isText){var h;l+=a==null||(h=a.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,o-c)}}),l}function ba(t,e){return ya(t,{from:0,to:t.content.size},e)}function Si(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function dw(t,e,n){let{blockSeparator:r=`
`,textSerializers:o={}}=n||{},i=Si(e);return wa(pe.fromJSON(i,t),{blockSeparator:r,textSerializers:{...Ci(i),...o}})}function If(t,e){let n=de(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,l=>{i.push(l)});let s=i.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function vi(t,e){let n=ao(typeof e=="string"?e:e.name,t.schema);return n==="node"?If(t,e):n==="mark"?ha(t,e):{}}function Pf(t,e=JSON.stringify){let n={};return t.filter(r=>{let o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function uw(t){let e=Pf(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,i)=>i!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function Pn(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{let s=[];if(o.ranges.length)o.forEach((l,a)=>{s.push({from:l,to:a})});else{let{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{let c=e.slice(i).map(l,-1),d=e.slice(i).map(a),u=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}})})}),uw(r)}function $f(t,e=0){let n=t.type===t.type.schema.topNodeType?0:1,r=e,o=r+t.nodeSize,i=t.marks.map(a=>{let c={type:a.type.name};return Object.keys(a.attrs).length&&(c.attrs={...a.attrs}),c}),s={...t.attrs},l={type:t.type.name,from:r,to:o};return Object.keys(s).length&&(l.attrs=s),i.length&&(l.marks=i),t.content.childCount&&(l.content=[],t.forEach((a,c)=>{var d;(d=l.content)===null||d===void 0||d.push($f(a,e+c+n))})),t.text&&(l.text=t.text),l}function uo(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(o=>{let i=bi(n.resolve(t),o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}var xa=(t,e,n,r=20)=>{let o=t.doc.resolve(n),i=r,s=null;for(;i>0&&s===null;){let l=o.node(i);l?.type.name===e?s=l:i-=1}return[s,i]},ka=t=>{let e=t.depth-1;if(e<0)return null;let n=t.index(e);return n===0?null:t.node(e).child(n-1)};function On(t,e){return e.nodes[t]||e.marks[t]||null}function oo(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}var Bf=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var a,c;let d=((a=(c=o.type.spec).toText)===null||a===void 0?void 0:a.call(c,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),n};function gi(t,e,n={}){let{empty:r,ranges:o}=t.selection,i=e?wt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>io(d.attrs,n,{strict:!1}));let s=0,l=[];if(o.forEach(({$from:d,$to:u})=>{let f=d.pos,h=u.pos;t.doc.nodesBetween(f,h,(p,g)=>{if(i&&p.inlineContent&&!p.type.allowsMarkType(i))return!1;if(!p.isText&&!p.marks.length)return;let m=Math.max(f,g),y=Math.min(h,g+p.nodeSize),x=y-m;s+=x,l.push(...p.marks.map(b=>({mark:b,from:m,to:y})))})}),s===0)return!1;let a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>io(d.mark.attrs,n,{strict:!1})).reduce((d,u)=>d+u.to-u.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,u)=>d+u.to-u.from,0);return(a>0?a+c:a)>=s}function Mi(t,e,n={}){if(!e)return ct(t,null,n)||gi(t,null,n);let r=ao(e,t.schema);return r==="node"?ct(t,e,n):r==="mark"?gi(t,e,n):!1}var Sa=(t,e)=>{let{$from:n,$to:r,$anchor:o}=t.selection;if(e){let i=Ht(l=>l.type.name===e)(t.selection);if(!i)return!1;let s=t.doc.resolve(i.pos+1);return o.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Ca=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function aa(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function hi(t,e){let{nodeExtensions:n}=In(e),r=n.find(i=>i.name===t);if(!r)return!1;let o=G(P(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof o!="string"?!1:o.split(" ").includes("list")}function $n(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){if(n){if(t.type.name==="hardBreak")return!0;if(t.isText){var r;return!/\S/.test((r=t.text)!==null&&r!==void 0?r:"")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&($n(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function fo(t){return t instanceof I}function fw({selection:t,pos:e,nodeSize:n,selectedOnTextSelection:r=!1}){let{from:o,to:i}=t;return!!(o<=e&&i>=e+n||r&&mr(t)&&o>e&&i<e+n)}function Ft(t){if(t===null||typeof t!="object")return!1;let e=t;return!(typeof e.apply!="function"||typeof e.getMap!="function"||typeof e.invert!="function"||typeof e.map!="function"||typeof e.merge!="function"||typeof e.toJSON!="function")}function hw(t){if(t===null||typeof t!="object")return!1;let e=t Line truncated `,textSerializers:o={}}=n||{},i=ki(e);return ba(ge.fromJSON(i,t),{blockSeparator:r,textSerializers:{...Si(i),...o}})}function Lf(t,e){let n=ce(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,l=>{i.push(l)});let s=i.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function Ci(t,e){let n=so(typeof e=="string"?e:e.name,t.schema);return n==="node"?Lf(t,e):n==="mark"?fa(t,e):{}}function If(t,e=JSON.stringify){let n={};return t.filter(r=>{let o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function uw(t){let e=If(t);return e.length===1?e:e.filter((n,r)=>!e.filter((o,i)=>i!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function Ln(t){let{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{let s=[];if(o.ranges.length)o.forEach((l,a)=>{s.push({from:l,to:a})});else{let{from:l,to:a}=n[i];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{let c=e.slice(i).map(l,-1),d=e.slice(i).map(a),u=e.invert().map(c,-1),f=e.invert().map(d);r.push({oldRange:{from:u,to:f},newRange:{from:c,to:d}})})}),uw(r)}function Pf(t,e=0){let n=t.type===t.type.schema.topNodeType?0:1,r=e,o=r+t.nodeSize,i=t.marks.map(a=>{let c={type:a.type.name};return Object.keys(a.attrs).length&&(c.attrs={...a.attrs}),c}),s={...t.attrs},l={type:t.type.name,from:r,to:o};return Object.keys(s).length&&(l.attrs=s),i.length&&(l.marks=i),t.content.childCount&&(l.content=[],t.forEach((a,c)=>{var d;(d=l.content)===null||d===void 0||d.push(Pf(a,e+c+n))})),t.text&&(l.text=t.text),l}function ao(t,e,n){let r=[];return t===e?n.resolve(t).marks().forEach(o=>{let i=yi(n.resolve(t),o.type);i&&r.push({mark:o,...i})}):n.nodesBetween(t,e,(o,i)=>{!o||o?.nodeSize===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}var wa=(t,e,n,r=20)=>{let o=t.doc.resolve(n),i=r,s=null;for(;i>0&&s===null;){let l=o.node(i);l?.type.name===e?s=l:i-=1}return[s,i]},xa=t=>{let e=t.depth-1;if(e<0)return null;let n=t.index(e);return n===0?null:t.node(e).child(n-1)};function An(t,e){return e.nodes[t]||e.marks[t]||null}function no(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{let o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}var $f=(t,e=500)=>{let n="",r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,l)=>{var a,c;let d=((a=(c=o.type.spec).toText)===null||a===void 0?void 0:a.call(c,{node:o,pos:i,parent:s,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?d:d.slice(0,Math.max(0,r-i))}),n};function mi(t,e,n={}){let{empty:r,ranges:o}=t.selection,i=e?xt(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>ro(d.attrs,n,{strict:!1}));let s=0,l=[];if(o.forEach(({$from:d,$to:u})=>{let f=d.pos,h=u.pos;t.doc.nodesBetween(f,h,(p,g)=>{if(i&&p.inlineContent&&!p.type.allowsMarkType(i))return!1;if(!p.isText&&!p.marks.length)return;let m=Math.max(f,g),y=Math.min(h,g+p.nodeSize),w=y-m;s+=w,l.push(...p.marks.map(x=>({mark:x,from:m,to:y})))})}),s===0)return!1;let a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>ro(d.mark.attrs,n,{strict:!1})).reduce((d,u)=>d+u.to-u.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,u)=>d+u.to-u.from,0);return(a>0?a+c:a)>=s}function vi(t,e,n={}){if(!e)return ct(t,null,n)||mi(t,null,n);let r=so(e,t.schema);return r==="node"?ct(t,e,n):r==="mark"?mi(t,e,n):!1}var ka=(t,e)=>{let{$from:n,$to:r,$anchor:o}=t.selection;if(e){let i=Ht(l=>l.type.name===e)(t.selection);if(!i)return!1;let s=t.doc.resolve(i.pos+1);return o.pos+1===s.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Sa=t=>{let{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function la(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function fi(t,e){let{nodeExtensions:n}=Dn(e),r=n.find(i=>i.name===t);if(!r)return!1;let o=G(B(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof o!="string"?!1:o.split(" ").includes("list")}function In(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){if(n){if(t.type.name==="hardBreak")return!0;if(t.isText){var r;return!/\S/.test((r=t.text)!==null&&r!==void 0?r:"")}}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(In(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function co(t){return t instanceof $}function fw({selection:t,pos:e,nodeSize:n,selectedOnTextSelection:r=!1}){let{from:o,to:i}=t;return!!(o<=e&&i>=e+n||r&&hr(t)&&o>e&&i<e+n)}function Ft(t){if(t===null||typeof t!="object")return!1;let e=t;return!(typeof e.apply!="function"||typeof e.getMap!="function"||typeof e.invert!="function"||typeof e.map!="function"||typeof e.merge!="function"||typeof e.toJSON!="function")}function hw(t){if(t===null||typeof t!="object")return!1;let e=t Line truncated
`);return`:::${c}${g} `);return`:::${c}${g}
${m} ${m}
:::`}}}function xx(t){let e={};return oh(t,"shortcode").forEach(n=>{n.type==="keyValue"&&(e[n.name]=n.value)}),e}function kx(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function sh(t){let{nodeName:e,name:n,getContent:r,parseAttributes:o=xx,serializeAttributes:i=kx,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=t,c=n||e,d=f=>{if(!a)return f;let h={};return a.forEach(p=>{let g=typeof p=="string"?p:p.name,m=typeof p=="string"?void 0:p.skipIfDefault;if(g in f){let y=f[g];if(m!==void 0&&y===m)return;h[g]=y}}),h},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,h)=>{let p={...s,...f.attributes};if(l)return h.createNode(e,p);let g=r?r(f):f.content||"";return g?h.createNode(e,p,[h.createTextNode(g)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(f){let h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),p=f.match(h),g=p?.index;return g!==void 0?g:-1},tokenize(f,h,p){let g=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),m=f.match(g);if(!m)return;let y="",x="";if(l){let[,w]=m;x=w}else{let[,w,k]=m;x=w,y=k||""}let b=o(x.trim());return{type:e,raw:m[0],content:y.trim(),attributes:b}}},renderMarkdown:f=>{let h="";r?h=r(f):f.content&&f.content.length>0&&(h=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));let p=d(f.attrs||{}),g=i(p),m=g?` ${g}`:"";return l?`[${c}${m}]`:`[${c}${m}]${h}[/${c}]`}}}function ho(t,e,n){let r=t.split(` :::`}}}function xx(t){let e={};return rh(t,"shortcode").forEach(n=>{n.type==="keyValue"&&(e[n.name]=n.value)}),e}function kx(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function ih(t){let{nodeName:e,name:n,getContent:r,parseAttributes:o=xx,serializeAttributes:i=kx,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=t,c=n||e,d=f=>{if(!a)return f;let h={};return a.forEach(p=>{let g=typeof p=="string"?p:p.name,m=typeof p=="string"?void 0:p.skipIfDefault;if(g in f){let y=f[g];if(m!==void 0&&y===m)return;h[g]=y}}),h},u=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(f,h)=>{let p={...s,...f.attributes};if(l)return h.createNode(e,p);let g=r?r(f):f.content||"";return g?h.createNode(e,p,[h.createTextNode(g)]):h.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(f){let h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),p=f.match(h),g=p?.index;return g!==void 0?g:-1},tokenize(f,h,p){let g=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),m=f.match(g);if(!m)return;let y="",w="";if(l){let[,b]=m;w=b}else{let[,b,k]=m;w=b,y=k||""}let x=o(w.trim());return{type:e,raw:m[0],content:y.trim(),attributes:x}}},renderMarkdown:f=>{let h="";r?h=r(f):f.content&&f.content.length>0&&(h=f.content.filter(y=>y.type==="text").map(y=>y.text).join(""));let p=d(f.attrs||{}),g=i(p),m=g?` ${g}`:"";return l?`[${c}${m}]`:`[${c}${m}]${h}[/${c}]`}}}function uo(t,e,n){let r=t.split(`
`),o=[],i="",s=0,l=e.baseIndentSize||2;for(;s<r.length;){let d=r[s],u=d.match(e.itemPattern);if(!u){if(o.length>0)break;if(d.trim()===""){s+=1,i=`${i}${d} `),o=[],i="",s=0,l=e.baseIndentSize||2;for(;s<r.length;){let d=r[s],u=d.match(e.itemPattern);if(!u){if(o.length>0)break;if(d.trim()===""){s+=1,i=`${i}${d}
`;continue}else return}let f=e.extractItemData(u),{indentLevel:h,mainContent:p}=f;i=`${i}${d} `;continue}else return}let f=e.extractItemData(u),{indentLevel:h,mainContent:p}=f;i=`${i}${d}
`;let g=[p];for(s+=1;s<r.length;){var a;let b=r[s];if(b.trim()===""){var c;let w=r.slice(s+1).findIndex(k=>k.trim()!=="");if(w===-1)break;if((((c=r[s+1+w].match(/^(\s*)/))===null||c===void 0||(c=c[1])===null||c===void 0?void 0:c.length)||0)>h){g.push(b),i=`${i}${b} `;let g=[p];for(s+=1;s<r.length;){var a;let x=r[s];if(x.trim()===""){var c;let b=r.slice(s+1).findIndex(k=>k.trim()!=="");if(b===-1)break;if((((c=r[s+1+b].match(/^(\s*)/))===null||c===void 0||(c=c[1])===null||c===void 0?void 0:c.length)||0)>h){g.push(x),i=`${i}${x}
`,s+=1;continue}else break}if((((a=b.match(/^(\s*)/))===null||a===void 0||(a=a[1])===null||a===void 0?void 0:a.length)||0)>h)g.push(b),i=`${i}${b} `,s+=1;continue}else break}if((((a=x.match(/^(\s*)/))===null||a===void 0||(a=a[1])===null||a===void 0?void 0:a.length)||0)>h)g.push(x),i=`${i}${x}
`,s+=1;else break}let m,y=g.slice(1);if(y.length>0){let b=y.map(w=>w.slice(h+l)).join(` `,s+=1;else break}let m,y=g.slice(1);if(y.length>0){let x=y.map(b=>b.slice(h+l)).join(`
`);b.trim()&&(e.customNestedParser?m=e.customNestedParser(b):m=n.blockTokens(b))}let x=e.createToken(f,m);o.push(x)}if(o.length!==0)return{items:o,raw:i}}function po(t,e,n,r){if(!t||!Array.isArray(t.content))return"";let o=typeof n=="function"?n(r):n,[i,...s]=t.content,l=`${o}${e.renderChildren([i])}`;return s&&s.length>0&&s.forEach((a,c)=>{var d,u;let f=(d=(u=e.renderChild)===null||u===void 0?void 0:u.call(e,a,c+1))!==null&&d!==void 0?d:e.renderChildren([a]);if(f!=null){let h=f.split(` `);x.trim()&&(e.customNestedParser?m=e.customNestedParser(x):m=n.blockTokens(x))}let w=e.createToken(f,m);o.push(w)}if(o.length!==0)return{items:o,raw:i}}function fo(t,e,n,r){if(!t||!Array.isArray(t.content))return"";let o=typeof n=="function"?n(r):n,[i,...s]=t.content,l=`${o}${e.renderChildren([i])}`;return s&&s.length>0&&s.forEach((a,c)=>{var d,u;let f=(d=(u=e.renderChild)===null||u===void 0?void 0:u.call(e,a,c+1))!==null&&d!==void 0?d:e.renderChildren([a]);if(f!=null){let h=f.split(`
`).map(p=>p?e.indent(p):e.indent("")).join(` `).map(p=>p?e.indent(p):e.indent("")).join(`
`);l+=a.type==="paragraph"?` `);l+=a.type==="paragraph"?`
${h}`:` ${h}`:`
${h}`}}),l}var Sx=Bo({createAtomBlockMarkdownSpec:()=>ih,createBlockMarkdownSpec:()=>br,createInlineMarkdownSpec:()=>sh,parseAttributes:()=>Ti,parseIndentedBlocks:()=>ho,renderNestedMarkdownContent:()=>po,serializeAttributes:()=>Ai});function Cf(t){return typeof t.type=="string"?t.type:t.type.name}function Cx(t,e){if(t.length!==e.length)return!1;let n=Array.from({length:e.length},()=>!1);return t.every(r=>{let o=Cf(r),i=e.findIndex((s,l)=>!n[l]&&o===Cf(s)&&Ta(r.attrs,s.attrs));return i===-1?!1:(n[i]=!0,!0)})}function Ra(t,e){let n={...t};return no(t)&&no(e)&&Object.keys(e).forEach(r=>{no(e[r])&&no(t[r])?n[r]=Ra(t[r],e[r]):n[r]=e[r]}),n}function Da(t,e,n={}){let{state:r}=e,{doc:o,tr:i}=r,s=t;o.descendants((l,a)=>{let c=i.mapping.map(a),d=i.mapping.map(a)+l.nodeSize,u=null;if(l.marks.forEach(h=>{if(h!==s)return!1;u=h}),!u)return;let f=!1;if(Object.keys(n).forEach(h=>{n[h]!==u.attrs[h]&&(f=!0)}),f){let h=t.type.create({...t.attrs,...n});i.removeMark(c,d,t.type),i.addMark(c,d,h)}}),i.docChanged&&e.view.dispatch(i)}var vx=class{constructor(t,e,n){this.component=t,this.editor=e.editor,this.options={...n},this.mark=e.mark,this.HTMLAttributes=e.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(t,e){Da(e||this.mark,this.editor,t)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(Dn()||so())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}},cn=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}},Mx=(t,e)=>{if(yi(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function ui(t){var e;let{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=t,{view:a}=n;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1,u=Bf(c)+i;return s.forEach(f=>{if(d)return;let h=Mx(u,f.find);if(!h)return;let p=h[0].length-i.length;if(p>0){let k=c.parentOffset-p;if(k<0||c.parent.textBetween(k,c.parentOffset)!==h[0].slice(0,p))return}let g=a.state.tr,m=lo({state:a.state,transaction:g}),y={from:r-(h[0].length-i.length),to:o},{commands:x,chain:b,can:w}=new Rn({editor:n,state:m});f.handler({state:m,range:y,match:h,commands:x,chain:b,can:w})===null||!g.steps.length||(f.undoable&&g.setMeta(l,{transform:g,from:r,to:o,text:i}),a.dispatch(g),d=!0)}),d}function lh(t){let{editor:e,rules:n}=t,r=new F({state:{init(){return null},apply(o,i,s){let l=o.getMeta(r);if(l)return l;let a=o.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=co(v.from(c),s.schema);let{from:d}=a,u=d+c.length;ui({editor:e,from:d,to:u,text:c,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,l){return ui({editor:e,from:i,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{let{$cursor:i}=o.state.selection;i&&ui({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;let{$cursor:s}=o.state.selection;return s?ui({editor:e,from:s.pos,to:s.pos,text:` ${h}`}}),l}var Sx=$o({createAtomBlockMarkdownSpec:()=>oh,createBlockMarkdownSpec:()=>gr,createInlineMarkdownSpec:()=>ih,parseAttributes:()=>Mi,parseIndentedBlocks:()=>uo,renderNestedMarkdownContent:()=>fo,serializeAttributes:()=>Ti});function Sf(t){return typeof t.type=="string"?t.type:t.type.name}function Cx(t,e){if(t.length!==e.length)return!1;let n=Array.from({length:e.length},()=>!1);return t.every(r=>{let o=Sf(r),i=e.findIndex((s,l)=>!n[l]&&o===Sf(s)&&Ma(r.attrs,s.attrs));return i===-1?!1:(n[i]=!0,!0)})}function Na(t,e){let n={...t};return eo(t)&&eo(e)&&Object.keys(e).forEach(r=>{eo(e[r])&&eo(t[r])?n[r]=Na(t[r],e[r]):n[r]=e[r]}),n}function Ra(t,e,n={}){let{state:r}=e,{doc:o,tr:i}=r,s=t;o.descendants((l,a)=>{let c=i.mapping.map(a),d=i.mapping.map(a)+l.nodeSize,u=null;if(l.marks.forEach(h=>{if(h!==s)return!1;u=h}),!u)return;let f=!1;if(Object.keys(n).forEach(h=>{n[h]!==u.attrs[h]&&(f=!0)}),f){let h=t.type.create({...t.attrs,...n});i.removeMark(c,d,t.type),i.addMark(c,d,h)}}),i.docChanged&&e.view.dispatch(i)}var vx=class{constructor(t,e,n){this.component=t,this.editor=e.editor,this.options={...n},this.mark=e.mark,this.HTMLAttributes=e.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(t,e){Ra(e||this.mark,this.editor,t)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(Nn()||oo())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}},ln=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}},Mx=(t,e)=>{if(gi(e))return e.exec(t);let n=e(t);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function di(t){var e;let{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=t,{view:a}=n;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1,u=$f(c)+i;return s.forEach(f=>{if(d)return;let h=Mx(u,f.find);if(!h)return;let p=h[0].length-i.length;if(p>0){let k=c.parentOffset-p;if(k<0||c.parent.textBetween(k,c.parentOffset)!==h[0].slice(0,p))return}let g=a.state.tr,m=io({state:a.state,transaction:g}),y={from:r-(h[0].length-i.length),to:o},{commands:w,chain:x,can:b}=new On({editor:n,state:m});f.handler({state:m,range:y,match:h,commands:w,chain:x,can:b})===null||!g.steps.length||(f.undoable&&g.setMeta(l,{transform:g,from:r,to:o,text:i}),a.dispatch(g),d=!0)}),d}function sh(t){let{editor:e,rules:n}=t,r=new F({state:{init(){return null},apply(o,i,s){let l=o.getMeta(r);if(l)return l;let a=o.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:c}=a;typeof c=="string"?c=c:c=lo(S.from(c),s.schema);let{from:d}=a,u=d+c.length;di({editor:e,from:d,to:u,text:c,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,l){return di({editor:e,from:i,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{let{$cursor:i}=o.state.selection;i&&di({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;let{$cursor:s}=o.state.selection;return s?di({editor:e,from:s.pos,to:s.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Ei=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...G(P(this,"addOptions",{name:this.name}))}}get storage(){return{...G(P(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>Ra(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},le=class ah extends Ei{constructor(...e){super(...e),this.type="mark"}static create(e={}){let n=typeof e=="function"?e():e;return new ah(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){let i=o.marks();if(!i.find(l=>l?.type.name===n.name))return!1;let s=i.find(l=>l?.type.name===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}},wr=class{constructor(t){this.find=t.find,this.handler=t.handler}},Tx=(t,e,n)=>{if(yi(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(o=>{let i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function Ax(t){let{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=t,{commands:a,chain:c,can:d}=new Rn({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,o,(f,h)=>{var p,g,m,y;if(!((p=f.type)===null||p===void 0||(p=p.spec)===null||p===void 0)&&p.code||!(f.isText||f.isTextblock||f.isInline))return;let x=(g=(m=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&m!==void 0?m:f.nodeSize)!==null&&g!==void 0?g:0,b=Math.max(r,h),w=Math.min(o,h+x);if(b>=w)return;let k=f.isText?f.text||"":f.textBetween(b-h,w-h,void 0,"\uFFFC");Tx(k,i.find,s).forEach(C=>{if(C.index===void 0)return;let S=b+C.index+1,O=S+C[0].length,R={from:n.tr.mapping.map(S),to:n.tr.mapping.map(O)},A=i.handler({state:n,range:R,match:C,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});u.push(A)})}),u.every(f=>f!==null)}var fi=null,Ex=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function ch(t){let{editor:e,rules:n}=t,r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let a=({state:c,from:d,to:u,rule:f,pasteEvt:h})=>{let p=c.tr,g=lo({state:c,transaction:p});if(!(!Ax({editor:e,state:g,from:Math.max(d-1,0),to:u.b-1,rule:f,pasteEvent:h,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return n.map(c=>new F({view(d){let u=h=>{var p;r=!((p=d.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?d.dom.parentElement:null,r&&(fi=e)},f=()=>{fi&&(fi=null)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",u),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,u)=>{if(i=r===d.dom.parentElement,l=u,!i){let f=fi;f?.isEditable&&setTimeout(()=>{let h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(d,u)=>{var f;let h=(f=u.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=u,o=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(d,u,f)=>{let h=d[0],p=h.getMeta("uiEvent")==="paste"&&!o,g=h.getMeta("uiEvent")==="drop"&&!i,m=h.getMeta("applyPasteRules"),y=!!m;if(!p&&!g&&!y)return;if(y){let{text:w}=m;typeof w=="string"?w=w:w=co(v.from(w),f.schema);let{from:k}=m,C=k+w.length,S=Ex(w);return a({rule:c,state:f,from:k,to:{b:C},pasteEvt:S})}let x=u.doc.content.findDiffStart(f.doc.content),b=u.doc.content.findDiffEnd(f.doc.content);if(!(!th(x)||!b||x===b.b))return a({rule:c,state:f,from:x,to:b,pasteEvt:s})}}))}var Oi=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=ki(t),this.schema=ya(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{let n=P(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:On(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){let{editor:t}=this,e=hr([...this.extensions].reverse()).flatMap(r=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:On(r.name,this.schema)},i=[],s=P(r,"addKeyboardShortcuts",o) Line truncated `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var Ai=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...G(B(this,"addOptions",{name:this.name}))}}get storage(){return{...G(B(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){let e=this.extend({...this.config,addOptions:()=>Na(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){let e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},ie=class lh extends Ai{constructor(...e){super(...e),this.type="mark"}static create(e={}){let n=typeof e=="function"?e():e;return new lh(n)}static handleExit({editor:e,mark:n}){let{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){let i=o.marks();if(!i.find(l=>l?.type.name===n.name))return!1;let s=i.find(l=>l?.type.name===n.name);return s&&r.removeStoredMark(s),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){let n=typeof e=="function"?e():e;return super.extend(n)}},yr=class{constructor(t){this.find=t.find,this.handler=t.handler}},Tx=(t,e,n)=>{if(gi(e))return[...t.matchAll(e)];let r=e(t,n);return r?r.map(o=>{let i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function Ax(t){let{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=t,{commands:a,chain:c,can:d}=new On({editor:e,state:n}),u=[];return n.doc.nodesBetween(r,o,(f,h)=>{var p,g,m,y;if(!((p=f.type)===null||p===void 0||(p=p.spec)===null||p===void 0)&&p.code||!(f.isText||f.isTextblock||f.isInline))return;let w=(g=(m=(y=f.content)===null||y===void 0?void 0:y.size)!==null&&m!==void 0?m:f.nodeSize)!==null&&g!==void 0?g:0,x=Math.max(r,h),b=Math.min(o,h+w);if(x>=b)return;let k=f.isText?f.text||"":f.textBetween(x-h,b-h,void 0,"\uFFFC");Tx(k,i.find,s).forEach(v=>{if(v.index===void 0)return;let C=x+v.index+1,O=C+v[0].length,P={from:n.tr.mapping.map(C),to:n.tr.mapping.map(O)},N=i.handler({state:n,range:P,match:v,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});u.push(N)})}),u.every(f=>f!==null)}var ui=null,Ex=t=>{var e;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function ah(t){let{editor:e,rules:n}=t,r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let a=({state:c,from:d,to:u,rule:f,pasteEvt:h})=>{let p=c.tr,g=io({state:c,transaction:p});if(!(!Ax({editor:e,state:g,from:Math.max(d-1,0),to:u.b-1,rule:f,pasteEvent:h,dropEvent:l})||!p.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return n.map(c=>new F({view(d){let u=h=>{var p;r=!((p=d.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?d.dom.parentElement:null,r&&(ui=e)},f=()=>{ui&&(ui=null)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",u),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,u)=>{if(i=r===d.dom.parentElement,l=u,!i){let f=ui;f?.isEditable&&setTimeout(()=>{let h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(d,u)=>{var f;let h=(f=u.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=u,o=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(d,u,f)=>{let h=d[0],p=h.getMeta("uiEvent")==="paste"&&!o,g=h.getMeta("uiEvent")==="drop"&&!i,m=h.getMeta("applyPasteRules"),y=!!m;if(!p&&!g&&!y)return;if(y){let{text:b}=m;typeof b=="string"?b=b:b=lo(S.from(b),f.schema);let{from:k}=m,v=k+b.length,C=Ex(b);return a({rule:c,state:f,from:k,to:{b:v},pasteEvt:C})}let w=u.doc.content.findDiffStart(f.doc.content),x=u.doc.content.findDiffEnd(f.doc.content);if(!(!eh(w)||!x||w===x.b))return a({rule:c,state:f,from:w,to:x,pasteEvt:s})}}))}var Ei=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=xi(t),this.schema=ga(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{let n=B(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:An(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){let{editor:t}=this,e=ur([...this.extensions].reverse()).flatMap(r=>{let o={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:An(r.name,this.schema)},i=[],s=B(r,"addKeyboardShortcuts",o) Line truncated
`)}}})]}}),fh=Z.create({name:"commands",addCommands(){return{..._f}}}),hh=Z.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r;let o=()=>{var i,s,l;if((i=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0||(l=s.filterTransaction)===null||l===void 0?void 0:l.call(s,t))!==null&&i!==void 0?i:t.getMeta("y-sync$"))return;let a=wi(t.before,[t,...e]);Pn(a).forEach(d=>{a.mapping.mapResult(d.oldRange.from).deletedAfter&&a.mapping.mapResult(d.oldRange.to).deletedBefore&&a.before.nodesBetween(d.oldRange.from,d.oldRange.to,(u,f)=>{let h=f+u.nodeSize-2,p=d.oldRange.from<=f&&h<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:u,from:f,to:h,newFrom:a.mapping.map(f),newTo:a.mapping.map(h),deletedRange:d.oldRange,newRange:d.newRange,partial:!p,editor:this.editor,transaction:t,combinedTransform:a})})});let c=a.mapping;a.steps.forEach((d,u)=>{if(d instanceof Nt){var f,h;let p=c.slice(u).map(d.from,-1),g=c.slice(u).map(d.to),m=c.invert().map(p,-1),y=c.invert().map(g),x=p>0?(f=a.doc.nodeAt(p-1))===null||f===void 0?void 0:f.marks.some(w=>w.eq(d.mark)):!1,b=(h=a.doc.nodeAt(g))===null||h===void 0?void 0:h.marks.some(w=>w.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:m,to:y},newRange:{from:p,to:g},partial:!!(b||x),editor:this.editor,transaction:t,combinedTransform:a})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(o,0):o()}}),ph=Z.create({name:"drop",addProseMirrorPlugins(){return[new F({key:new _("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),mh=Z.create({name:"editable",addProseMirrorPlugins(){return[new F({key:new _("editable"),props:{editable:()=>this.editor.options.editable}})]}}),gh=new _("focusEvents"),yh=Z.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new F({key:gh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),bh=Z.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:a,doc:c}=l,{empty:d,$anchor:u}=a,{pos:f,parent:h}=u,p=u.parent.isTextblock&&f>0?l.doc.resolve(f-1):u,g=p.parent.type.spec.isolating,m=u.pos-u.parentOffset,y=g&&p.parent.childCount===1?m===u.pos:B.atStart(c).from===f;return!d||!h.type.isTextblock||h.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Dn()||fa()?i:o},addProseMirrorPlugins(){return[new F({key:new _("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(h=>h.getMeta("composition")))return;let r=t.some(h=>h.docChanged)&&!e.doc.eq(n.doc),o=t.some(h=>h.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:s,to:l}=e.selection,a=B.atStart(e.doc).from,c=B.atEnd(e.doc).to;if(i||!(s===a&&l===c)||!$n(n.doc))return;let d=n.tr,u=lo({state:n,transaction:d}),{commands:f}=new Rn({editor:this.editor,state:u});if(f.clearNodes(),!!d.steps.length)return d}})]}}),wh=Z.create({name:"paste",addProseMirrorPlugins(){return[new F({key:new _("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),xh=Z.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new F({key:new _("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:"0"}}}})]}}),kh=Z.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:t}=In(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}} Line truncated `)}}})]}}),uh=Z.create({name:"commands",addCommands(){return{...jf}}}),fh=Z.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r;let o=()=>{var i,s,l;if((i=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0||(l=s.filterTransaction)===null||l===void 0?void 0:l.call(s,t))!==null&&i!==void 0?i:t.getMeta("y-sync$"))return;let a=bi(t.before,[t,...e]);Ln(a).forEach(d=>{a.mapping.mapResult(d.oldRange.from).deletedAfter&&a.mapping.mapResult(d.oldRange.to).deletedBefore&&a.before.nodesBetween(d.oldRange.from,d.oldRange.to,(u,f)=>{let h=f+u.nodeSize-2,p=d.oldRange.from<=f&&h<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:u,from:f,to:h,newFrom:a.mapping.map(f),newTo:a.mapping.map(h),deletedRange:d.oldRange,newRange:d.newRange,partial:!p,editor:this.editor,transaction:t,combinedTransform:a})})});let c=a.mapping;a.steps.forEach((d,u)=>{if(d instanceof Nt){var f,h;let p=c.slice(u).map(d.from,-1),g=c.slice(u).map(d.to),m=c.invert().map(p,-1),y=c.invert().map(g),w=p>0?(f=a.doc.nodeAt(p-1))===null||f===void 0?void 0:f.marks.some(b=>b.eq(d.mark)):!1,x=(h=a.doc.nodeAt(g))===null||h===void 0?void 0:h.marks.some(b=>b.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:m,to:y},newRange:{from:p,to:g},partial:!!(x||w),editor:this.editor,transaction:t,combinedTransform:a})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(o,0):o()}}),hh=Z.create({name:"drop",addProseMirrorPlugins(){return[new F({key:new j("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),ph=Z.create({name:"editable",addProseMirrorPlugins(){return[new F({key:new j("editable"),props:{editable:()=>this.editor.options.editable}})]}}),mh=new j("focusEvents"),gh=Z.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:t}=this;return[new F({key:mh,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;let r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;let r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),yh=Z.create({name:"keymap",addKeyboardShortcuts(){let t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:a,doc:c}=l,{empty:d,$anchor:u}=a,{pos:f,parent:h}=u,p=u.parent.isTextblock&&f>0?l.doc.resolve(f-1):u,g=p.parent.type.spec.isolating,m=u.pos-u.parentOffset,y=g&&p.parent.childCount===1?m===u.pos:z.atStart(c).from===f;return!d||!h.type.isTextblock||h.textContent.length||!y||y&&u.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Nn()||ua()?i:o},addProseMirrorPlugins(){return[new F({key:new j("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(h=>h.getMeta("composition")))return;let r=t.some(h=>h.docChanged)&&!e.doc.eq(n.doc),o=t.some(h=>h.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:s,to:l}=e.selection,a=z.atStart(e.doc).from,c=z.atEnd(e.doc).to;if(i||!(s===a&&l===c)||!In(n.doc))return;let d=n.tr,u=io({state:n,transaction:d}),{commands:f}=new On({editor:this.editor,state:u});if(f.clearNodes(),!!d.steps.length)return d}})]}}),bh=Z.create({name:"paste",addProseMirrorPlugins(){return[new F({key:new j("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),wh=Z.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new F({key:new j("tabindex"),props:{attributes:()=>{var t;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(t=this.options.value)!==null&&t!==void 0?t:"0"}}}})]}}),xh=Z.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:t}=Dn(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}} Line truncated
position: relative; position: relative;
} }
@@ -101,61 +101,61 @@ img.ProseMirror-separator {
.ProseMirror-focused .ProseMirror-gapcursor { .ProseMirror-focused .ProseMirror-gapcursor {
display: block; display: block;
}`,Dx=class extends Yw{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Ff,createMappablePosition:Vf},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);let e=this.createDoc();if(!this.editorState){let n=pi(e,this.options.autofocus);this.editorState=rr.create({doc:e,schema:this.schema,selection:n||void 0})}Nx(this.schema),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Rn.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Rn.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=eh(Rx,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return Uf&&!this.hasWarnedStaleDecorationRead&&Xw(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){let n=ma(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.vi Line truncated }`,Dx=class extends Yw{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Hf,createMappablePosition:Ff},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);let e=this.createDoc();if(!this.editorState){let n=hi(e,this.options.autofocus);this.editorState=tr.create({doc:e,schema:this.schema,selection:n||void 0})}Nx(this.schema),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():On.createFakeChain()}can(){return this.commandManager?this.commandManager.can():On.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Zf(Rx,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return _f&&!this.hasWarnedStaleDecorationRead&&Xw(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){let n=pa(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.vi Line truncated
`,textSerializers:n={}}=t||{};return wa(this.state.doc,{blockSeparator:e,textSerializers:{...Ci(this.schema),...n}})}get isEmpty(){return $n(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(t=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&t!==void 0?t:!0}$node(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new Sh(e,this,!1,n)}get $doc(){return this.$pos(0)}},mo=class{static Inline(t,e,n={},r){return new Ch(t,e,n,r)}static Node(t,e,n={},r){return new vh(t,e,n,r)}static Widget(t,e,n){let{key:r,...o}=n;return new Mh(t,e,r,o)}},Ch=class extends mo{constructor(t,e,n={},r){super(),this.kind="inline",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return ie.inline(this.from,this.to,this.attrs,e)}},vh=class extends mo{constructor(t,e,n={},r){super(),this.kind="node",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return ie.node(this.from,this.to,this.attrs,e)}},Mh=class extends mo{constructor(t,e,n,r){super(),this.kind="widget",this.pos=t,this.render=e,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(t){let e=t?{...this.spec,key:this.key,extensionName:t}:{...this.spec,key:this.key};return ie.widget(this.pos,this.render,e)}};function Lx(t,e){let n=t,r=n[e];if(!r){r={renderers:new Map,props:new Map,pendingProps:new Map,flushScheduled:!1},n[e]=r;let o=r;t.on("destroy",()=>{o.pendingProps.clear(),o.renderers.forEach(i=>i.destroy()),o.renderers.clear(),o.props.clear()})}return r}function Ix(t){t.flushScheduled=!1;for(let[e,n]of t.pendingProps){let r=t.renderers.get(e);r&&(r.updateProps(n),t.props.set(e,{...n}))}t.pendingProps.clear()}function Px(t){let{editor:e,pos:n,key:r,props:o,cacheKey:i,context:s,create:l,materialize:a,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:p}=t,g=Lx(e,i);if(g.renderers.has(r)){var m;let x=(m=g.pendingProps.get(r))!==null&&m!==void 0?m:g.props.get(r);(!x||!Ta(x,o))&&(g.pendingProps.set(r,o),g.flushScheduled||(g.flushScheduled=!0,queueMicrotask(()=>Ix(g))))}let y=(x,b)=>{let w={...o,...s(b)},k=g.renderers.get(r);return k?k.updateProps(w):(k=l(w),g.renderers.set(r,k),g.props.set(r,{...o})),a(k)};return mo.Widget(n,y,{key:r,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:x=>{if(!Qf(e).has(r))try{var b;(b=g.renderers.get(r))===null||b===void 0||b.destroy(),g.renderers.delete(r),g.props.delete(r),g.pendingProps.delete(r)}finally{p?.(x)}}})}function Le(t){return new cn({find:t.find,handler:({state:e,range:n,match:r})=>{let o=G(t.getAttributes,void 0,r);if(o===!1||o===null)return null;let{tr:i}=e,s=r[r.length-1],l=r[0];if(s){let a=l.search(/\S/),c=n.from+l.indexOf(s),d=c+s.length;if(uo(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>c).length)return null;d<n.to&&i.delete(d,n.to),c>n.from&&i.delete(n.from+a,c);let u=n.from+a+s.length;i.addMark(n.from+a,u,t.type.create(o||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function go(t){return new cn({find:t.find,handler:({state:e,range:n,match:r})=>{let o=G(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from,l=n.to,a=t.type.create(o);if(r[1]){let c=s+r[0].lastIndexOf(r[1]);c>l?c=l:l=c+r[1].length;let d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(c,l,a)}else if(r[0]){let c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function xr(t){return new cn({find:t.find,handler:({state:e,range:n,match:r})=>{let o=e.doc.resolve(n.from),i=G(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function $x(t){return new cn({find:t.find,handler:({state:e,range:n,match:r})=>{let o=t.replace,i=n.from,s=n.to;if(r[1]){let l=r[0].lastIndexOf(r[1]);o+=r[0].slice(l+r[1].length),i+=l;let a=i-s;a>0&&(o=r[0].slice(l-a,l)+o,i=s)}e.tr.insertText(o,i,s)},undoable:t.undoable})}function Vt(t){return new cn({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{let i=G(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&er(l,t.type,i);if(!a)return null;if(s.wrap(l,a),t.keepMarks&&t.editor){let{selection:d,storedMarks:u}=e,{splittableMarks:f}=t.editor.extensionManager,h=u||d.$to. Line truncated `,textSerializers:n={}}=t||{};return ba(this.state.doc,{blockSeparator:e,textSerializers:{...Si(this.schema),...n}})}get isEmpty(){return In(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var t,e;return(t=(e=this.editorView)===null||e===void 0?void 0:e.isDestroyed)!==null&&t!==void 0?t:!0}$node(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(t,e))||null}$pos(t){let e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new kh(e,this,!1,n)}get $doc(){return this.$pos(0)}},ho=class{static Inline(t,e,n={},r){return new Sh(t,e,n,r)}static Node(t,e,n={},r){return new Ch(t,e,n,r)}static Widget(t,e,n){let{key:r,...o}=n;return new vh(t,e,r,o)}},Sh=class extends ho{constructor(t,e,n={},r){super(),this.kind="inline",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return re.inline(this.from,this.to,this.attrs,e)}},Ch=class extends ho{constructor(t,e,n={},r){super(),this.kind="node",this.from=t,this.to=e,this.attrs=n,this.spec=r}get anchor(){return this.from}toPMDecoration(t){let e=t?{...this.spec,extensionName:t}:this.spec;return re.node(this.from,this.to,this.attrs,e)}},vh=class extends ho{constructor(t,e,n,r){super(),this.kind="widget",this.pos=t,this.render=e,this.key=n,this.spec=r}get anchor(){return this.pos}toPMDecoration(t){let e=t?{...this.spec,key:this.key,extensionName:t}:{...this.spec,key:this.key};return re.widget(this.pos,this.render,e)}};function Lx(t,e){let n=t,r=n[e];if(!r){r={renderers:new Map,props:new Map,pendingProps:new Map,flushScheduled:!1},n[e]=r;let o=r;t.on("destroy",()=>{o.pendingProps.clear(),o.renderers.forEach(i=>i.destroy()),o.renderers.clear(),o.props.clear()})}return r}function Ix(t){t.flushScheduled=!1;for(let[e,n]of t.pendingProps){let r=t.renderers.get(e);r&&(r.updateProps(n),t.props.set(e,{...n}))}t.pendingProps.clear()}function Px(t){let{editor:e,pos:n,key:r,props:o,cacheKey:i,context:s,create:l,materialize:a,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:p}=t,g=Lx(e,i);if(g.renderers.has(r)){var m;let w=(m=g.pendingProps.get(r))!==null&&m!==void 0?m:g.props.get(r);(!w||!Ma(w,o))&&(g.pendingProps.set(r,o),g.flushScheduled||(g.flushScheduled=!0,queueMicrotask(()=>Ix(g))))}let y=(w,x)=>{let b={...o,...s(x)},k=g.renderers.get(r);return k?k.updateProps(b):(k=l(b),g.renderers.set(r,k),g.props.set(r,{...o})),a(k)};return ho.Widget(n,y,{key:r,side:c,relaxedSide:d,marks:u,stopEvent:f,ignoreSelection:h,destroy:w=>{if(!Yf(e).has(r))try{var x;(x=g.renderers.get(r))===null||x===void 0||x.destroy(),g.renderers.delete(r),g.props.delete(r),g.pendingProps.delete(r)}finally{p?.(w)}}})}function Ie(t){return new ln({find:t.find,handler:({state:e,range:n,match:r})=>{let o=G(t.getAttributes,void 0,r);if(o===!1||o===null)return null;let{tr:i}=e,s=r[r.length-1],l=r[0];if(s){let a=l.search(/\S/),c=n.from+l.indexOf(s),d=c+s.length;if(ao(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(h=>h===t.type&&h!==f.mark.type)).filter(f=>f.to>c).length)return null;d<n.to&&i.delete(d,n.to),c>n.from&&i.delete(n.from+a,c);let u=n.from+a+s.length;i.addMark(n.from+a,u,t.type.create(o||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function po(t){return new ln({find:t.find,handler:({state:e,range:n,match:r})=>{let o=G(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from,l=n.to,a=t.type.create(o);if(r[1]){let c=s+r[0].lastIndexOf(r[1]);c>l?c=l:l=c+r[1].length;let d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(c,l,a)}else if(r[0]){let c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function br(t){return new ln({find:t.find,handler:({state:e,range:n,match:r})=>{let o=e.doc.resolve(n.from),i=G(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)},undoable:t.undoable})}function $x(t){return new ln({find:t.find,handler:({state:e,range:n,match:r})=>{let o=t.replace,i=n.from,s=n.to;if(r[1]){let l=r[0].lastIndexOf(r[1]);o+=r[0].slice(l+r[1].length),i+=l;let a=i-s;a>0&&(o=r[0].slice(l-a,l)+o,i=s)}e.tr.insertText(o,i,s)},undoable:t.undoable})}function Vt(t){return new ln({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{let i=G(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&Qn(l,t.type,i);if(!a)return null;if(s.wrap(l,a),t.keepMarks&&t.editor){let{selection:d,storedMarks:u}=e,{splittableMarks:f}=t.editor.extensionManager,h=u||d.$to. Line truncated
`).map(c=>c.trim()===""?n:`${n} ${c}`);r.push(a.join(` `).map(c=>c.trim()===""?n:`${n} ${c}`);r.push(a.join(`
`))}),r.join(` `))}),r.join(`
${n} ${n}
`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>wk(this.editor,this.type)}},addInputRules(){return[Vt({find:xk,type:this.type})]}}),Gh=kk;var Sk=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ck=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,vk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Mk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Tk=le.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return kr("strong",{...D(this.options.HTMLAttributes,t),children:kr("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Le({find:Sk,type:this.type}),Le({find:vk,type:this.type})]},addPasteRules(){return[Ae({find:Ck,type:this.type}),Ae({find:Mk,type:this.type})]}}),Xh=Tk;var Ak=t=>{let e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Ek=t=>{let e=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},Ok=le.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",D(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Le({find:Ak,type:this.type})]},addPasteRules(){return[Ae({find:Ek,type:this.type})]}}),Yh=Ok;var _a=4,Nk=/^```([a-z]+)?[\s\n]$/,Rk=/^~~~([a-z]+)?[\s\n]$/,Dk=j.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:_a,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",D(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)===null||n===void 0?void 0:n.startsWith("```"))===!1&&((r=t.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="",o=((n=t.attrs)===null||n===void 0?void 0:n.language)||"";return t.content?r=[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join(` `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>wk(this.editor,this.type)}},addInputRules(){return[Vt({find:xk,type:this.type})]}}),Jh=kk;var Sk=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ck=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,vk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Mk=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Tk=ie.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return wr("strong",{...L(this.options.HTMLAttributes,t),children:wr("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ie({find:Sk,type:this.type}),Ie({find:vk,type:this.type})]},addPasteRules(){return[Ne({find:Ck,type:this.type}),Ne({find:Mk,type:this.type})]}}),Gh=Tk;var Ak=t=>{let e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Ek=t=>{let e=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=e.exec(t))!==null;)r.index>0&&t[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n},Ok=ie.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",L(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Ie({find:Ak,type:this.type})]},addPasteRules(){return[Ne({find:Ek,type:this.type})]}}),Xh=Ok;var ja=4,Nk=/^```([a-z]+)?[\s\n]$/,Rk=/^~~~([a-z]+)?[\s\n]$/,Dk=W.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:ja,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",L(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n,r;return((n=t.raw)===null||n===void 0?void 0:n.startsWith("```"))===!1&&((r=t.raw)===null||r===void 0?void 0:r.startsWith("~~~"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let r="",o=((n=t.attrs)===null||n===void 0?void 0:n.language)||"";return t.content?r=[`\`\`\`${o}`,e.renderChildren(t.content),"```"].join(`
`):r=`\`\`\`${o} `):r=`\`\`\`${o}
\`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:_a,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;let l=" ".repeat(n);return s?t.commands.insertContent(l):t.commands.command(({tr:a})=>{let{from:c,to:d}=o,u=r.doc.textBetween(c,d,` \`\`\``,r},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:ja,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;if(i.parent.type!==this.type)return!1;let l=" ".repeat(n);return s?t.commands.insertContent(l):t.commands.command(({tr:a})=>{let{from:c,to:d}=o,u=r.doc.textBetween(c,d,`
`,` `,`
`).split(` `).split(`
`).map(f=>l+f).join(` `).map(f=>l+f).join(`
`);return a.replaceWith(c,d,r.schema.text(u)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:_a,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;return i.parent.type!==this.type?!1:s?t.commands.command(({tr:l})=>{var a;let{pos:c}=i,d=i.start(),u=i.end(),f=r.doc.textBetween(d,u,` `);return a.replaceWith(c,d,r.schema.text(u)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;let n=(e=this.options.tabSize)!==null&&e!==void 0?e:ja,{state:r}=t,{selection:o}=r,{$from:i,empty:s}=o;return i.parent.type!==this.type?!1:s?t.commands.command(({tr:l})=>{var a;let{pos:c}=i,d=i.start(),u=i.end(),f=r.doc.textBetween(d,u,`
`,` `,`
`).split(` `).split(`
`),h=0,p=0,g=c-d;for(let b=0;b<f.length;b+=1){if(p+f[b].length>=g){h=b;break}p+=f[b].length+1}let m=((a=f[h].match(/^ */))===null||a===void 0?void 0:a[0])||"",y=Math.min(m.length,n);if(y===0)return!0;let x=d;for(let b=0;b<h;b+=1)x+=f[b].length+1;return l.delete(x,x+y),c-x<=y&&l.setSelection(N.create(l.doc,x)),!0}):t.commands.command(({tr:l})=>{let{from:a,to:c}=o,d=r.doc.textBetween(a,c,` `),h=0,p=0,g=c-d;for(let x=0;x<f.length;x+=1){if(p+f[x].length>=g){h=x;break}p+=f[x].length+1}let m=((a=f[h].match(/^ */))===null||a===void 0?void 0:a[0])||"",y=Math.min(m.length,n);if(y===0)return!0;let w=d;for(let x=0;x<h;x+=1)w+=f[x].length+1;return l.delete(w,w+y),c-w<=y&&l.setSelection(R.create(l.doc,w)),!0}):t.commands.command(({tr:l})=>{let{from:a,to:c}=o,d=r.doc.textBetween(a,c,`
`,` `,`
`).split(` `).split(`
`).map(u=>{var f;let h=((f=u.match(/^ */))===null||f===void 0?void 0:f[0])||"",p=Math.min(h.length,n);return u.slice(p)}).join(` `).map(u=>{var f;let h=((f=u.match(/^ */))===null||f===void 0?void 0:f[0])||"",p=Math.min(h.length,n);return u.slice(p)}).join(`
`);return l.replaceWith(a,c,r.schema.text(d)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return l.replaceWith(a,c,r.schema.text(d)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
`);return!i||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||r.parentOffset!==0)return!1;let i=r.before();return i>0?!1:t.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let s=o.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:l})=>(l.setSelection(B.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[xr({find:Nk,type:this.type,getAttributes:t=>({language:t[1]})}),xr({find:Rk,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new F({key:new _("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;let{tr:s,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,` `);return!i||!s?!1:t.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;let{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type||r.parentOffset!==0)return!1;let i=r.before();return i>0?!1:t.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let s=o.after();return s===void 0?!1:r.nodeAt(s)?t.commands.command(({tr:l})=>(l.setSelection(z.near(r.resolve(s))),!0)):t.commands.exitCode()}}},addInputRules(){return[br({find:Nk,type:this.type,getAttributes:t=>({language:t[1]})}),br({find:Rk,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new F({key:new j("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o?.mode;if(!n||!i)return!1;let{tr:s,schema:l}=t.state,a=l.text(n.replace(/\r\n?/g,`
`));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(N.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Qh=Dk;var Zh=j.create({name:"customBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addNodeView(){return({editor:t,node:e,getPos:n,HTMLAttributes:r,decorations:o,extension:i})=>{let s=document.createElement("div");s.setAttribute("data-config",JSON.stringify(e.attrs.config)),s.setAttribute("data-id",e.attrs.id),s.setAttribute("data-testid","rich-editor-custom-block"),s.setAttribute("data-type","customBlock"),i.options.hasMinimalCustomBlockControls&&e.attrs.preview&&s.classList.add("fi-fo-rich-editor-custom-block-minimal");let l=document.createElement("div");if(l.className="fi-fo-rich-editor-custom-block-header fi-not-prose",s.appendChild(l),t.isEditable&&typeof e.attrs.config=="object"&&e.attrs.config!==null&&Object.keys(e.attrs.config).length>0){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-edit-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.dataset.testid="rich-editor-custom-block-edit-button",d.type="button",i.options.editCustomBlockButtonLabel&&d.setAttribute("aria-label",i.options.editCustomBlockButtonLabel),d.innerHTML=i.options.editCustomBlockButtonIconHtml,d.addEventListener("click",()=>{t.commands.setNodeSelection(n()),i.options.editCustomBlockUsing(e.attrs.id,e.attrs.config)}),c.appendChild(d)}let a=document.createElement("p");if(a.className="fi-fo-rich-editor-custom-block-heading",a.textContent=e.attrs.label,l.appendChild(a),t.isEditable){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-delete-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.dataset.testid="rich-editor-custom-block-delete-button",d.type="button",i.options.deleteCustomBlockButtonLabel&&d.setAttribute("aria-label",i.options.deleteCustomBlockButtonLabel),d.innerHTML=i.options.deleteCustomBlockButtonIconHtml,d.addEventListener("click",()=>t.chain().focus().setNodeSelection(n()).deleteSelection().run()),c.appendChild(d)}if(e.attrs.preview){let c=document.createElement("div"),d=["fi-fo-rich-editor-custom-block-preview"];e.attrs.shouldApplyProseStylingToPreview||d.push("fi-not-prose"),c.className=d.join(" "),c.innerHTML=new TextDecoder().decode(Uint8Array.from(atob(e.attrs.preview),u=>u.charCodeAt(0))),s.appendChild(c)}return{dom:s,stopEvent:c=>c.target instanceof Element&&l.contains(c.target.closest("button"))}}},addOptions(){return{deleteCustomBlockButtonIconHtml:null,deleteCustomBlockButtonLabel:null,editCustomBlockButtonIconHtml:null,editCustomBlockButtonLabel:null,editCustomBlockUsing:()=>{},getCustomBlockPreviewsUsing:async()=>[],hasMinimalCustomBlockControls:!1,insertCustomBlockUsing:()=>{}}},addAttributes(){return{config:{default:null,parseHTML:t=>JSON.parse(t.getAttribute("data-config")),renderHTML:t=>t.config?{"data-config":JSON.stringify(t.config)}:{}},id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:()=>null,rendered:!1},preview:{default:null,parseHTML:()=>null,rendered:!1},shouldApplyProseStylingToPreview:{default:!1,parseHTML:()=>!1,rendered:!1}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",D({"data-type":"customBlock"},t)]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({state:t})=>{let e=!1,{selection:n}=t,{empty:r,anchor:o}=n;return r?(t.doc.nodesBetween(o-1,o,i=>{if(i.type.name===this.name)return e=!0,!1}),e):!1})}},addProseMirrorPlugins(){let{getCustomBlockPreviewsUsing:t,insertCustomBlockUsing:e}=this.options,n=new Map,r=new Set,o=s=>JSON.stringify([s.attrs.id,s.attrs.config]),i=async s=>{if(this.editor.isDestroyed)return;let l=[],a=[],c=new Map;if(s.state.doc.descendants(u=>{if(u.type.name!==this.name)return;let f=o(u);if(u.attrs.preview!==null){n.set(f,{label:u.attrs.label,preview:u.attrs.preview,shouldApplyProseStylingToPreview:u.attrs.shouldApplyProseStylingToPreview});return}!u.attrs.id||r.has(f)||c.set(f,{config:u.attrs.config,id:u.attrs.id})}),c.forEach((u,f)=>{n.has(f)||(r.add(f),a.push(f),l.push({...u,key:l.length}))}),l.length){let u,f;try{u=await Promise.race([t(l),new Promise((h,p)=>{f=setTimeout(()=>p(new Error("Preview request timed out")),3e4)})])}catch(h){this.editor.isDestroyed||console.error("Failed to hydrate custom block previews",h);return}finally{clearTimeout(f),a.forEach(h=>{r.delete(h)})}if(this.editor.isDestroyed)return;a.forEach(h=>{n.set(h,null)}),u.forEach(h=>{let p=a[h.key];p!==void 0&&n.set(p,{label:h.label,preview:h.preview,shouldApplyProseStylingToPreview:h.shouldApplyProseStylingToPreview})})}let d=s.state.tr;s.state.doc.descendants((u,f)=>{if(u.type.name!==this.name||u.attrs.preview!==null Line truncated `));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(R.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),Yh=Dk;var Qh=W.create({name:"customBlock",group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addNodeView(){return({editor:t,node:e,getPos:n,HTMLAttributes:r,decorations:o,extension:i})=>{let s=document.createElement("div");s.setAttribute("data-config",JSON.stringify(e.attrs.config)),s.setAttribute("data-id",e.attrs.id),s.setAttribute("data-testid","rich-editor-custom-block"),s.setAttribute("data-type","customBlock"),i.options.hasMinimalCustomBlockControls&&e.attrs.preview&&s.classList.add("fi-fo-rich-editor-custom-block-minimal");let l=document.createElement("div");if(l.className="fi-fo-rich-editor-custom-block-header fi-not-prose",s.appendChild(l),t.isEditable&&typeof e.attrs.config=="object"&&e.attrs.config!==null&&Object.keys(e.attrs.config).length>0){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-edit-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.dataset.testid="rich-editor-custom-block-edit-button",d.type="button",i.options.editCustomBlockButtonLabel&&d.setAttribute("aria-label",i.options.editCustomBlockButtonLabel),d.innerHTML=i.options.editCustomBlockButtonIconHtml,d.addEventListener("click",()=>{t.commands.setNodeSelection(n()),i.options.editCustomBlockUsing(e.attrs.id,e.attrs.config)}),c.appendChild(d)}let a=document.createElement("p");if(a.className="fi-fo-rich-editor-custom-block-heading",a.textContent=e.attrs.label,l.appendChild(a),t.isEditable){let c=document.createElement("div");c.className="fi-fo-rich-editor-custom-block-delete-btn-ctn",l.appendChild(c);let d=document.createElement("button");d.className="fi-icon-btn",d.dataset.testid="rich-editor-custom-block-delete-button",d.type="button",i.options.deleteCustomBlockButtonLabel&&d.setAttribute("aria-label",i.options.deleteCustomBlockButtonLabel),d.innerHTML=i.options.deleteCustomBlockButtonIconHtml,d.addEventListener("click",()=>t.chain().focus().setNodeSelection(n()).deleteSelection().run()),c.appendChild(d)}if(e.attrs.preview){let c=document.createElement("div"),d=["fi-fo-rich-editor-custom-block-preview"];e.attrs.shouldApplyProseStylingToPreview||d.push("fi-not-prose"),c.className=d.join(" "),c.innerHTML=new TextDecoder().decode(Uint8Array.from(atob(e.attrs.preview),u=>u.charCodeAt(0))),s.appendChild(c)}return{dom:s,stopEvent:c=>c.target instanceof Element&&l.contains(c.target.closest("button"))}}},addOptions(){return{deleteCustomBlockButtonIconHtml:null,deleteCustomBlockButtonLabel:null,editCustomBlockButtonIconHtml:null,editCustomBlockButtonLabel:null,editCustomBlockUsing:()=>{},getCustomBlockPreviewsUsing:async()=>[],hasMinimalCustomBlockControls:!1,insertCustomBlockUsing:()=>{}}},addAttributes(){return{config:{default:null,parseHTML:t=>JSON.parse(t.getAttribute("data-config")),renderHTML:t=>t.config?{"data-config":JSON.stringify(t.config)}:{}},id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:()=>null,rendered:!1},preview:{default:null,parseHTML:()=>null,rendered:!1},shouldApplyProseStylingToPreview:{default:!1,parseHTML:()=>!1,rendered:!1}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({HTMLAttributes:t}){return["div",L({"data-type":"customBlock"},t)]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({state:t})=>{let e=!1,{selection:n}=t,{empty:r,anchor:o}=n;return r?(t.doc.nodesBetween(o-1,o,i=>{if(i.type.name===this.name)return e=!0,!1}),e):!1})}},addProseMirrorPlugins(){let{getCustomBlockPreviewsUsing:t,insertCustomBlockUsing:e}=this.options,n=new Map,r=new Set,o=s=>JSON.stringify([s.attrs.id,s.attrs.config]),i=async s=>{if(this.editor.isDestroyed)return;let l=[],a=[],c=new Map;if(s.state.doc.descendants(u=>{if(u.type.name!==this.name)return;let f=o(u);if(u.attrs.preview!==null){n.set(f,{label:u.attrs.label,preview:u.attrs.preview,shouldApplyProseStylingToPreview:u.attrs.shouldApplyProseStylingToPreview});return}!u.attrs.id||r.has(f)||c.set(f,{config:u.attrs.config,id:u.attrs.id})}),c.forEach((u,f)=>{n.has(f)||(r.add(f),a.push(f),l.push({...u,key:l.length}))}),l.length){let u,f;try{u=await Promise.race([t(l),new Promise((h,p)=>{f=setTimeout(()=>p(new Error("Preview request timed out")),3e4)})])}catch(h){this.editor.isDestroyed||console.error("Failed to hydrate custom block previews",h);return}finally{clearTimeout(f),a.forEach(h=>{r.delete(h)})}if(this.editor.isDestroyed)return;a.forEach(h=>{n.set(h,null)}),u.forEach(h=>{let p=a[h.key];p!==void 0&&n.set(p,{label:h.label,preview:h.preview,shouldApplyProseStylingToPreview:h.shouldApplyProseStylingToPreview})})}let d=s.state.tr;s.state.doc.descendants((u,f)=>{if(u.type.name!==this.name||u.attrs.preview!==null Line truncated
`):""}),op=Ik;var Pk=12,sp=(t,e)=>{let n=dt(t.$from,o=>o.type.name===e),r=t.node?.type.name==="gridColumn"?{node:t.node,pos:t.from,depth:t.$from.depth+1}:dt(t.$from,o=>o.type.name==="gridColumn");return n&&r&&r.depth===n.depth+1?{grid:n,column:r}:null},lp=t=>Math.max(1,Number(t.attrs["data-col-span"])||1),ap=(t,e)=>e?ap(e,t%e):t,$k=t=>{let e=!0;return t.forEach(n=>{lp(n)!==1&&(e=!1)}),e},ip=({tr:t,dispatch:e,editor:n,gridNodeName:r,shouldInsertAfter:o})=>{let i=sp(t.selection,r);if(!i||!$k(i.grid.node)||i.grid.node.childCount>=Pk)return!1;if(e){let s=n.schema.nodes.gridColumn.createAndFill({"data-col-span":1}),l=o?i.column.pos+i.column.node.nodeSize:i.column.pos;t.setNodeMarkup(i.grid.pos,void 0,{...i.grid.node.attrs,"data-cols":i.grid.node.childCount+1}).insert(l,s).scrollIntoView()}return!0},cp=j.create({name:"grid",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"gridColumn+",addOptions(){return{HTMLAttributes:{class:"grid-layout"}}},addAttributes(){return{"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-from-breakpoint":{default:"md",parseHTML:t=>t.getAttribute("data-from-breakpoint")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`--cols: repeat(${Math.max(1,Number(t["data-cols"])||1)}, minmax(0, 1fr))`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout")&&null}]},renderHTML({HTMLAttributes:t}){return["div",D(this.options.HTMLAttributes,t),0]},addCommands(){return{addGridColumnBefore:()=>({tr:t,dispatch:e,editor:n})=>ip({tr:t,dispatch:e,editor:n,gridNodeName:this.name,shouldInsertAfter:!1}),addGridColumnAfter:()=>({tr:t,dispatch:e,editor:n})=>ip({tr:t,dispatch:e,editor:n,gridNodeName:this.name,shouldInsertAfter:!0}),deleteGridColumn:()=>({tr:t,dispatch:e})=>{let n=sp(t.selection,this.name);if(!n||n.grid.node.childCount<=1)return!1;if(e){let r=[];n.grid.node.forEach((s,l)=>{let a=n.grid.pos+1+l;a!==n.column.pos&&r.push({column:s,position:a,span:lp(s)})});let o=r.map(s=>s.span).reduce(ap),i=r.reduce((s,l)=>s+l.span/o,0);r.forEach(({column:s,position:l,span:a})=>{t.setNodeMarkup(l,void 0,{...s.attrs,"data-col-span":a/o})}),t.setNodeMarkup(n.grid.pos,void 0,{...n.grid.node.attrs,"data-cols":i}).delete(n.column.pos,n.column.pos+n.column.node.nodeSize).setSelection(N.near(t.doc.resolve(n.column.pos))).scrollIntoView()}return!0},deleteGrid:()=>({tr:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name===this.name);if(!n)return!1;if(e){let r=[];n.node.forEach(o=>{o.forEach(i=>r.push(i))}),t.replaceWith(n.pos,n.pos+n.node.nodeSize,r).setSelection(N.near(t.doc.resolve(n.pos))).scrollIntoView()}return!0},insertGrid:({columns:t=[1,1],fromBreakpoint:e,coordinates:n=null}={})=>({tr:r,dispatch:o,editor:i})=>{let s=i.schema.nodes.gridColumn,l=Array.isArray(t)&&t.length?t:[1,1],a=[];for(let u=0;u<l.length;u+=1)a.push(s.createAndFill({"data-col-span":Number(l[u]??1)||1}));let c=l.map(u=>Number(u)||1).reduce((u,f)=>u+f,0),d=i.schema.nodes.grid.createChecked({"data-cols":c,"data-from-breakpoint":e},a);if(o){let u=r.selection.anchor+1;[null,void 0].includes(n?.from)?r.replaceSelectionWith(d).scrollIntoView().setSelection(N.near(r.doc.resolve(u))):r.replaceRangeWith(n.from,n.to,d).scrollIntoView().setSelection(N.near(r.doc.resolve(n.from)))}return!0}}}});var dp=j.create({name:"gridColumn",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"grid-layout-col"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span"),renderHTML:t=>({"data-col-span":t["data-col-span"]??1})},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>{let e=Math.max(1,Number(t["data-col-span"])||1);return{style:`--col-span: span ${e} / span ${e}`}}}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout-col")&&null}]},renderHTML({HTMLAttributes:t}){return["div",D(this.options.HTMLAttributes,t),0]}});var Bk=j.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",D(this.options.HTMLAttributes,t)]},renderText(){return` `):""}),rp=Ik;var Pk=12,ip=(t,e)=>{let n=dt(t.$from,o=>o.type.name===e),r=t.node?.type.name==="gridColumn"?{node:t.node,pos:t.from,depth:t.$from.depth+1}:dt(t.$from,o=>o.type.name==="gridColumn");return n&&r&&r.depth===n.depth+1?{grid:n,column:r}:null},sp=t=>Math.max(1,Number(t.attrs["data-col-span"])||1),lp=(t,e)=>e?lp(e,t%e):t,$k=t=>{let e=!0;return t.forEach(n=>{sp(n)!==1&&(e=!1)}),e},op=({tr:t,dispatch:e,editor:n,gridNodeName:r,shouldInsertAfter:o})=>{let i=ip(t.selection,r);if(!i||!$k(i.grid.node)||i.grid.node.childCount>=Pk)return!1;if(e){let s=n.schema.nodes.gridColumn.createAndFill({"data-col-span":1}),l=o?i.column.pos+i.column.node.nodeSize:i.column.pos;t.setNodeMarkup(i.grid.pos,void 0,{...i.grid.node.attrs,"data-cols":i.grid.node.childCount+1}).insert(l,s).scrollIntoView()}return!0},ap=W.create({name:"grid",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"gridColumn+",addOptions(){return{HTMLAttributes:{class:"grid-layout"}}},addAttributes(){return{"data-cols":{default:2,parseHTML:t=>t.getAttribute("data-cols")},"data-from-breakpoint":{default:"md",parseHTML:t=>t.getAttribute("data-from-breakpoint")},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>({style:`--cols: repeat(${Math.max(1,Number(t["data-cols"])||1)}, minmax(0, 1fr))`})}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout")&&null}]},renderHTML({HTMLAttributes:t}){return["div",L(this.options.HTMLAttributes,t),0]},addCommands(){return{addGridColumnBefore:()=>({tr:t,dispatch:e,editor:n})=>op({tr:t,dispatch:e,editor:n,gridNodeName:this.name,shouldInsertAfter:!1}),addGridColumnAfter:()=>({tr:t,dispatch:e,editor:n})=>op({tr:t,dispatch:e,editor:n,gridNodeName:this.name,shouldInsertAfter:!0}),deleteGridColumn:()=>({tr:t,dispatch:e})=>{let n=ip(t.selection,this.name);if(!n||n.grid.node.childCount<=1)return!1;if(e){let r=[];n.grid.node.forEach((s,l)=>{let a=n.grid.pos+1+l;a!==n.column.pos&&r.push({column:s,position:a,span:sp(s)})});let o=r.map(s=>s.span).reduce(lp),i=r.reduce((s,l)=>s+l.span/o,0);r.forEach(({column:s,position:l,span:a})=>{t.setNodeMarkup(l,void 0,{...s.attrs,"data-col-span":a/o})}),t.setNodeMarkup(n.grid.pos,void 0,{...n.grid.node.attrs,"data-cols":i}).delete(n.column.pos,n.column.pos+n.column.node.nodeSize).setSelection(R.near(t.doc.resolve(n.column.pos))).scrollIntoView()}return!0},deleteGrid:()=>({tr:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name===this.name);if(!n)return!1;if(e){let r=[];n.node.forEach(o=>{o.forEach(i=>r.push(i))}),t.replaceWith(n.pos,n.pos+n.node.nodeSize,r).setSelection(R.near(t.doc.resolve(n.pos))).scrollIntoView()}return!0},insertGrid:({columns:t=[1,1],fromBreakpoint:e,coordinates:n=null}={})=>({tr:r,dispatch:o,editor:i})=>{let s=i.schema.nodes.gridColumn,l=Array.isArray(t)&&t.length?t:[1,1],a=[];for(let u=0;u<l.length;u+=1)a.push(s.createAndFill({"data-col-span":Number(l[u]??1)||1}));let c=l.map(u=>Number(u)||1).reduce((u,f)=>u+f,0),d=i.schema.nodes.grid.createChecked({"data-cols":c,"data-from-breakpoint":e},a);if(o){let u=r.selection.anchor+1;[null,void 0].includes(n?.from)?r.replaceSelectionWith(d).scrollIntoView().setSelection(R.near(r.doc.resolve(u))):r.replaceRangeWith(n.from,n.to,d).scrollIntoView().setSelection(R.near(r.doc.resolve(n.from)))}return!0}}}});var cp=W.create({name:"gridColumn",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"grid-layout-col"}}},addAttributes(){return{"data-col-span":{default:1,parseHTML:t=>t.getAttribute("data-col-span"),renderHTML:t=>({"data-col-span":t["data-col-span"]??1})},style:{default:null,parseHTML:t=>t.getAttribute("style"),renderHTML:t=>{let e=Math.max(1,Number(t["data-col-span"])||1);return{style:`--col-span: span ${e} / span ${e}`}}}}},parseHTML(){return[{tag:"div",getAttrs:t=>t.classList.contains("grid-layout-col")&&null}]},renderHTML({HTMLAttributes:t}){return["div",L(this.options.HTMLAttributes,t),0]}});var Bk=W.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",L(this.options.HTMLAttributes,t)]},renderText(){return`
`},renderMarkdown:()=>` `},renderMarkdown:()=>`
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&a&&s){let u=a.filter(f=>l.includes(f.type.name));c.ensureMarks(u)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),up=Bk;var zk=j.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,D(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;let r=!((n=t.attrs)===null||n===void 0)&&n.level?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>xr({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),fp=zk;var Hk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Fk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Vk=le.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||Oa(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",D(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){let r=/^(==)([^=]+)(==)/.exec(t);if(r){let o=r[2].trim(),i=n.inlineTokens(o);return{type:"highlight",raw:r[0],text:o,tokens:i}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Le({find:Hk,type:this.type})]},addPasteRules(){return[Ae({find:Fk,type:this.type})]}}),hp=Vk;var Wk=j.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",D(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Aa(e,e.schema.nodes[this.name]))return!1;let{selection:n}=e,{$to:r}=n,o=t();return fo(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:i,tr:s,dispatch:l})=>{if(l){let{$to:a}=s.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?s.setSelection(N.create(s.doc,a.pos+1)):a.nodeAfter.isBlock?s.setSelection(I.create(s.doc,a.pos)):s.setSelection(N.create(s.doc,a.pos));else{let d=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,u=d?.create();u&&(s.insert(c,u),s.setSelection(N.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[go({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),pp=Wk;var jk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_k=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Uk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Kk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,qk=le.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",D(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({co Line truncated `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&a&&s){let u=a.filter(f=>l.includes(f.type.name));c.ensureMarks(u)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),dp=Bk;var zk=W.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,L(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;let r=!((n=t.attrs)===null||n===void 0)&&n.level?parseInt(t.attrs.level,10):1,o="#".repeat(r);return t.content?`${o} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>br({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),up=zk;var Hk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,Fk=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,Vk=ie.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||Ea(t,"background-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",L(this.options.HTMLAttributes,t),0]},renderMarkdown:(t,e)=>`==${e.renderChildren(t)}==`,parseMarkdown:(t,e)=>e.applyMark("highlight",e.parseInline(t.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:t=>t.indexOf("=="),tokenize(t,e,n){let r=/^(==)([^=]+)(==)/.exec(t);if(r){let o=r[2].trim(),i=n.inlineTokens(o);return{type:"highlight",raw:r[0],text:o,tokens:i}}}},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Ie({find:Hk,type:this.type})]},addPasteRules(){return[Ne({find:Fk,type:this.type})]}}),fp=Vk;var Wk=W.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",L(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!Ta(e,e.schema.nodes[this.name]))return!1;let{selection:n}=e,{$to:r}=n,o=t();return co(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({state:i,tr:s,dispatch:l})=>{if(l){let{$to:a}=s.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?s.setSelection(R.create(s.doc,a.pos+1)):a.nodeAfter.isBlock?s.setSelection($.create(s.doc,a.pos)):s.setSelection(R.create(s.doc,a.pos));else{let d=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,u=d?.create();u&&(s.insert(c,u),s.setSelection(R.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[po({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),hp=Wk;var jk=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_k=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Uk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Kk=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,qk=ie.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",L(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({co Line truncated
`,nS="\uFE0F",rS="\u200D",Ga="\uFFFC",Bi=null,zi=null;function oS(t=[]){let e={};ze.groups=e;let n=new ze;Bi==null&&(Bi=Sp(Xk)),zi==null&&(zi=Sp(Yk)),M(n,"'",ns),M(n,"{",So),M(n,"}",Co),M(n,"[",Vi),M(n,"]",Wi),M(n,"(",ji),M(n,")",_i),M(n,"<",Ui),M(n,">",Ki),M(n,"\uFF08",qi),M(n,"\uFF09",Ji),M(n,"\u300C",Gi),M(n,"\u300D",Xi),M(n,"\u300E",Yi),M(n,"\u300F",Qi),M(n,"\uFF1C",Zi),M(n,"\uFF1E",es),M(n,"&",ts),M(n,"*",rs),M(n,"@",un),M(n,"`",ss),M(n,"^",ls),M(n,":",Vn),M(n,",",lc),M(n,"$",as),M(n,".",St),M(n,"=",cs),M(n,"!",ac),M(n,"-",rt),M(n,"%",vo),M(n,"|",ds),M(n,"+",us),M(n,"#",fs),M(n,"?",Mo),M(n,'"',cc),M(n,"/",Ct),M(n,";",dc),M(n,"~",To),M(n,"_",hs),M(n,"\\",is),M(n,"\u30FB",Ep);let r=ae(n,jt,ic,{[Ya]:!0});ae(r,jt,r);let o=ae(r,Wt,Tp,{[ko]:!0}),i=ae(r,wo,Ap,{[xo]:!0}),s=ae(n,Wt,_t,{[Qa]:!0});ae(s,jt,o),ae(s,Wt,s),ae(o,jt,o),ae(o,Wt,o);let l=ae(n,wo,tc,{[Za]:!0});ae(l,Wt),ae(l,jt,i),ae(l,wo,l),ae(i,jt,i),ae(i,Wt),ae(i,wo,i);let a=M(n,Ja,sc,{[Ua]:!0}),c=M(n,kp,oc,{[Ua]:!0}),d=ae(n,qa,oc,{[Ua]:!0});M(n,Ga,d),M(c,Ja,a),M(c,Ga,d),ae(c,qa,d),M(d,kp),M(d,Ja),ae(d,qa,d),M(d,Ga,d);let u=ae(n,Ka,Op,{[Mp]:!0});M(u,"#"),ae(u,Ka,u),M(u,nS,u);let f=M(u,rS);M(f,"#"),ae(f,Ka,u);let h=[[Wt,s],[jt,o]],p=[[Wt,null],[wo,l],[jt,i]];for(let g=0;g<Bi.length;g++)dn(n,Bi[g],nc,_t,h);for(let g=0;g<zi.length;g++)dn(n,zi[g],rc,tc,p);Fn(nc,{tld:!0,ascii:!0},e),Fn(rc,{utld:!0,alpha:!0},e),dn(n,"file",Fi,_t,h),dn(n,"mailto",Fi,_t,h),dn(n,"http",Sr,_t,h),dn(n,"https",Sr,_t,h),dn(n,"ftp",Sr,_t,h),dn(n,"ftps",Sr,_t,h),Fn(Fi,{scheme:!0,ascii:!0},e),Fn(Sr,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){let m=t[g][0],x=t[g][1]?{[Qk]:!0}:{[Zk]:!0};m.indexOf("-")>=0?x[ec]=!0:Wt.test(m)?jt.test(m)?x[ko]=!0:x[Qa]=!0:x[Ya]=!0,xp(n,m,m,x)}return xp(n,"localhost",Ao,{ascii:!0}),n.jd=new ze(ps),{start:n,tokens:Object.assign({groups:e},Np)}}function Rp(t,e){let n=iS(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[],i=0,s=0;for(;s<r;){let l=t,a=null,c=0,d=null,u=-1,f=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(u=0,f=0,d=l):u>=0&&(u+=n[s].length,f++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=f,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function iS(t){let e=[],n=t.length,r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function dn(t,e,n,r,o){let i,s=e.length;for(let l=0;l<s-1;l++){let a=e[l];t.j[a]?i=t.j[a]:(i=new ze(r),i.jr=o.slice(),t.j[a]=i),t=i}return i=new ze(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function Sp(t){let e=[],n=[],r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}var Eo={defaultProtocol:"http",events:null,format:Cp,formatHref:Cp,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function uc(t,e=null){let n=Object.assign({},Eo);t&&(n=Object.assign(n,t instanceof uc?t.o:t));let r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}uc.prototype={o:Eo,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=e!=null,o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Eo[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Cp(t){return t}function Dp(t,e){this.t="token",this.v=t,this.tk=e}Dp.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Eo.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};function ms(t,e){class n extends Dp{constructor(o,i){super(o,i),thLine truncated `,nS="\uFE0F",rS="\u200D",Ja="\uFFFC",$i=null,Bi=null;function oS(t=[]){let e={};Be.groups=e;let n=new Be;$i==null&&($i=kp(Xk)),Bi==null&&(Bi=kp(Yk)),T(n,"'",ts),T(n,"{",xo),T(n,"}",ko),T(n,"[",Fi),T(n,"]",Vi),T(n,"(",Wi),T(n,")",ji),T(n,"<",_i),T(n,">",Ui),T(n,"\uFF08",Ki),T(n,"\uFF09",qi),T(n,"\u300C",Ji),T(n,"\u300D",Gi),T(n,"\u300E",Xi),T(n,"\u300F",Yi),T(n,"\uFF1C",Qi),T(n,"\uFF1E",Zi),T(n,"&",es),T(n,"*",ns),T(n,"@",cn),T(n,"`",is),T(n,"^",ss),T(n,":",Hn),T(n,",",sc),T(n,"$",ls),T(n,".",Ct),T(n,"=",as),T(n,"!",lc),T(n,"-",Qe),T(n,"%",So),T(n,"|",cs),T(n,"+",ds),T(n,"#",us),T(n,"?",Co),T(n,'"',ac),T(n,"/",vt),T(n,";",cc),T(n,"~",vo),T(n,"_",fs),T(n,"\\",rs),T(n,"\u30FB",Ap);let r=le(n,jt,oc,{[Xa]:!0});le(r,jt,r);let o=le(r,Wt,Mp,{[wo]:!0}),i=le(r,yo,Tp,{[bo]:!0}),s=le(n,Wt,_t,{[Ya]:!0});le(s,jt,o),le(s,Wt,s),le(o,jt,o),le(o,Wt,o);let l=le(n,yo,ec,{[Qa]:!0});le(l,Wt),le(l,jt,i),le(l,yo,l),le(i,jt,i),le(i,Wt),le(i,yo,i);let a=T(n,qa,ic,{[_a]:!0}),c=T(n,xp,rc,{[_a]:!0}),d=le(n,Ka,rc,{[_a]:!0});T(n,Ja,d),T(c,qa,a),T(c,Ja,d),le(c,Ka,d),T(d,xp),T(d,qa),le(d,Ka,d),T(d,Ja,d);let u=le(n,Ua,Ep,{[vp]:!0});T(u,"#"),le(u,Ua,u),T(u,nS,u);let f=T(u,rS);T(f,"#"),le(f,Ua,u);let h=[[Wt,s],[jt,o]],p=[[Wt,null],[yo,l],[jt,i]];for(let g=0;g<$i.length;g++)an(n,$i[g],tc,_t,h);for(let g=0;g<Bi.length;g++)an(n,Bi[g],nc,ec,p);zn(tc,{tld:!0,ascii:!0},e),zn(nc,{utld:!0,alpha:!0},e),an(n,"file",Hi,_t,h),an(n,"mailto",Hi,_t,h),an(n,"http",xr,_t,h),an(n,"https",xr,_t,h),an(n,"ftp",xr,_t,h),an(n,"ftps",xr,_t,h),zn(Hi,{scheme:!0,ascii:!0},e),zn(xr,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){let m=t[g][0],w=t[g][1]?{[Qk]:!0}:{[Zk]:!0};m.indexOf("-")>=0?w[Za]=!0:Wt.test(m)?jt.test(m)?w[wo]=!0:w[Ya]=!0:w[Xa]=!0,wp(n,m,m,w)}return wp(n,"localhost",Mo,{ascii:!0}),n.jd=new Be(hs),{start:n,tokens:Object.assign({groups:e},Op)}}function Np(t,e){let n=iS(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[],i=0,s=0;for(;s<r;){let l=t,a=null,c=0,d=null,u=-1,f=-1;for(;s<r&&(a=l.go(n[s]));)l=a,l.accepts()?(u=0,f=0,d=l):u>=0&&(u+=n[s].length,f++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=f,c-=u,o.push({t:d.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function iS(t){let e=[],n=t.length,r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function an(t,e,n,r,o){let i,s=e.length;for(let l=0;l<s-1;l++){let a=e[l];t.j[a]?i=t.j[a]:(i=new Be(r),i.jr=o.slice(),t.j[a]=i),t=i}return i=new Be(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function kp(t){let e=[],n=[],r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}var To={defaultProtocol:"http",events:null,format:Sp,formatHref:Sp,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function dc(t,e=null){let n=Object.assign({},To);t&&(n=Object.assign(n,t instanceof dc?t.o:t));let r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}dc.prototype={o:To,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){let r=e!=null,o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:To[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){let e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Sp(t){return t}function Rp(t,e){this.t="token",this.v=t,this.tk=e}Rp.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){let e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=To.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){let e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},l=t.get("className",n,e),a=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),u=t.getObj("events",n,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:u}}};function ps(t,e){class n extends Rp{constructor(o,i){super(o,i),thLine truncated
1. Must only contain digits, lowercase ASCII letters or "-" 1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-" 2. Cannot start or end with "-"
3. "-" cannot repeat`);se.customSchemes.push([t,e])}function fS(){se.scanner=oS(se.customSchemes);for(let t=0;t<se.tokenQueue.length;t++)se.tokenQueue[t][1]({scanner:se.scanner});se.parser=aS(se.scanner.tokens);for(let t=0;t<se.pluginQueue.length;t++)se.pluginQueue[t][1]({scanner:se.scanner,parser:se.parser});return se.initialized=!0,se}function gs(t){return se.initialized||fS(),cS(se.parser.start,t,Rp(se.scanner.start,t))}gs.scan=Rp;function hc(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new uc(n),o=gs(t),i=[];for(let s=0;s<o.length;s++){let l=o[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var pc="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",hS=new RegExp(pc),pS=new RegExp(`${pc}$`),mS=new RegExp(pc,"g");function gS(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function yS(t){return new F({key:new _("autolink"),appendTransaction:(e,n,r)=>{let o=e.some(a=>a.docChanged)&&!n.doc.eq(r.doc),i=e.some(a=>a.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=r,l=wi(n.doc,[...e]);if(Pn(l).forEach(({newRange:a})=>{let c=pa(r.doc,a,f=>f.isTextblock),d,u;if(c.length>1)d=c[0],u=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){let f=r.doc.textBetween(a.from,a.to," "," ");if(!pS.test(f))return;d=c[0],u=r.doc.textBetween(d.pos,a.to,void 0," ")}if(d&&u){let f=u.split(hS).filter(Boolean);if(f.length<=0)return!1;let h=f[f.length-1],p=d.pos+u.lastIndexOf(h);if(!h)return!1;let g=gs(h).map(m=>m.toObject(t.defaultProtocol));if(!gS(g))return!1;g.filter(m=>m.isLink).map(m=>({...m,from:p+m.start+1,to:p+m.end+1})).filter(m=>r.schema.marks.code?!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code):!0).filter(m=>t.validate(m.value)).filter(m=>t.shouldAutoLink(m.value)).forEach(m=>{uo(m.from,m.to,r.doc).some(y=>y.mark.type===t.type)||s.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),!!s.steps.length)return s}})}function bS(t){return new F({key:new _("handleClickLink"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{let a=r.target;if(!a)return!1;let c=t.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let i=!1;if(t.enableClickSelection&&(i=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var s,l;let a=vi(e.state,t.type.name),c=(s=o.href)!==null&&s!==void 0?s:a.href,d=(l=o.target)!==null&&l!==void 0?l:a.target;c&&(window.open(c,d),i=!0)}return i}}})}var wS=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,xS=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Ip(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function kS(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&Ip(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]==="`";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function Pp(t,e,n){var r,o;let[,i,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||Ip(t,(r=e.index)!==null&&r!==void 0?r:0)||kS(t,(o=e.index)!==null&&o!==void 0?o:0)?!1:!!i.trim()&&n(s)}function $p(t){var e,n;let[r,o,i,,s,l,a]=t,c=(e=s??l)!==null&&e!==void 0?e:a;return{index:(n=t.index)!==null&&n!==void 0?n:0,text:r,replaceWith:o,data:{href:i,title:c||null,markdown:!0}}}function SS(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function Bp(t){var e,n,r;return{href:(e=t.data)===null||e===void 0?void 0:e.href,title:(n=(r=t.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function CS(t){let e=Le({find:n=>{let r=wS.exec(n);return!r||!Pp(n,r,t.isAllowedHref)?null:$p(r)},type:t.type,getAttributes:Bp});return new cn({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function vS(t){let e=Ae({find:n=>{var r,o;let i=[];for(let l of n.matchAll(xS))Pp(n,l,t.isAllowedHref)&&i.push($p(l));let s=((r=(o=t.findPlainUrls)===null||o===void 0?void 0:o.call(t,n))!==null&&r!==void 0?r:[]).filter(l=>!i.some(a=>SS(a,l)));return[...i,...s]},type:t.type,getAttributes:Bp});return new wr({find:e.find,handler:n=>{var r;let o=e.handler(n);return o!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),o}})}function MS(t){return new F({key:new _("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{shouldAutoLink:o}=t,{state:i}=e,{selection:s}=i,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(d=>{a+=d.textContent});let c=hc(a,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===a);return!a||!c||o!==void 0&&!o(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function Ut(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let o=typeof r=="string"? Line truncated 3. "-" cannot repeat`);oe.customSchemes.push([t,e])}function fS(){oe.scanner=oS(oe.customSchemes);for(let t=0;t<oe.tokenQueue.length;t++)oe.tokenQueue[t][1]({scanner:oe.scanner});oe.parser=aS(oe.scanner.tokens);for(let t=0;t<oe.pluginQueue.length;t++)oe.pluginQueue[t][1]({scanner:oe.scanner,parser:oe.parser});return oe.initialized=!0,oe}function ms(t){return oe.initialized||fS(),cS(oe.parser.start,t,Np(oe.scanner.start,t))}ms.scan=Np;function fc(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}let r=new dc(n),o=ms(t),i=[];for(let s=0;s<o.length;s++){let l=o[s];l.isLink&&(!e||l.t===e)&&r.check(l)&&i.push(l.toFormattedObject(r))}return i}var hc="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",hS=new RegExp(hc),pS=new RegExp(`${hc}$`),mS=new RegExp(hc,"g");function gS(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function yS(t){return new F({key:new j("autolink"),appendTransaction:(e,n,r)=>{let o=e.some(a=>a.docChanged)&&!n.doc.eq(r.doc),i=e.some(a=>a.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=r,l=bi(n.doc,[...e]);if(Ln(l).forEach(({newRange:a})=>{let c=ha(r.doc,a,f=>f.isTextblock),d,u;if(c.length>1)d=c[0],u=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(c.length){let f=r.doc.textBetween(a.from,a.to," "," ");if(!pS.test(f))return;d=c[0],u=r.doc.textBetween(d.pos,a.to,void 0," ")}if(d&&u){let f=u.split(hS).filter(Boolean);if(f.length<=0)return!1;let h=f[f.length-1],p=d.pos+u.lastIndexOf(h);if(!h)return!1;let g=ms(h).map(m=>m.toObject(t.defaultProtocol));if(!gS(g))return!1;g.filter(m=>m.isLink).map(m=>({...m,from:p+m.start+1,to:p+m.end+1})).filter(m=>r.schema.marks.code?!r.doc.rangeHasMark(m.from,m.to,r.schema.marks.code):!0).filter(m=>t.validate(m.value)).filter(m=>t.shouldAutoLink(m.value)).forEach(m=>{ao(m.from,m.to,r.doc).some(y=>y.mark.type===t.type)||s.addMark(m.from,m.to,t.type.create({href:m.href}))})}}),!!s.steps.length)return s}})}function bS(t){return new F({key:new j("handleClickLink"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{let a=r.target;if(!a)return!1;let c=t.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let i=!1;if(t.enableClickSelection&&(i=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var s,l;let a=Ci(e.state,t.type.name),c=(s=o.href)!==null&&s!==void 0?s:a.href,d=(l=o.target)!==null&&l!==void 0?l:a.target;c&&(window.open(c,d),i=!0)}return i}}})}var wS=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,xS=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function Lp(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function kS(t,e){let n=0,r=0;for(;r<e;){if(t[r]!=="`"){r+=1;continue}if(n===0&&Lp(t,r)){r+=1;continue}let o=0;for(;r<e&&t[r]==="`";)o+=1,r+=1;n===0?n=o:o===n&&(n=0)}return n>0}function Ip(t,e,n){var r,o;let[,i,s]=e;return(e.index?t[e.index-1]:void 0)==="!"||Lp(t,(r=e.index)!==null&&r!==void 0?r:0)||kS(t,(o=e.index)!==null&&o!==void 0?o:0)?!1:!!i.trim()&&n(s)}function Pp(t){var e,n;let[r,o,i,,s,l,a]=t,c=(e=s??l)!==null&&e!==void 0?e:a;return{index:(n=t.index)!==null&&n!==void 0?n:0,text:r,replaceWith:o,data:{href:i,title:c||null,markdown:!0}}}function SS(t,e){return t.index<e.index+e.text.length&&e.index<t.index+t.text.length}function $p(t){var e,n,r;return{href:(e=t.data)===null||e===void 0?void 0:e.href,title:(n=(r=t.data)===null||r===void 0?void 0:r.title)!==null&&n!==void 0?n:null}}function CS(t){let e=Ie({find:n=>{let r=wS.exec(n);return!r||!Ip(n,r,t.isAllowedHref)?null:Pp(r)},type:t.type,getAttributes:$p});return new ln({find:e.find,handler:n=>{let r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function vS(t){let e=Ne({find:n=>{var r,o;let i=[];for(let l of n.matchAll(xS))Ip(n,l,t.isAllowedHref)&&i.push(Pp(l));let s=((r=(o=t.findPlainUrls)===null||o===void 0?void 0:o.call(t,n))!==null&&r!==void 0?r:[]).filter(l=>!i.some(a=>SS(a,l)));return[...i,...s]},type:t.type,getAttributes:$p});return new yr({find:e.find,handler:n=>{var r;let o=e.handler(n);return o!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),o}})}function MS(t){return new F({key:new j("handlePasteLink"),props:{handlePaste:(e,n,r)=>{let{shouldAutoLink:o}=t,{state:i}=e,{selection:s}=i,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(d=>{a+=d.textContent});let c=fc(a,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===a);return!a||!c||o!==void 0&&!o(c.value)?!1:t.editor.commands.setMark(t.type,{href:c.href})}}})}function Ut(t,e){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let o=typeof r=="string"? Line truncated
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(AS,this.editor.getAttributes(Hp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Vt({find:Fp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Vt({find:Fp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Hp),editor:this.editor})),[t]}}),ES=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let i=-1;for(let h=o.depth;h>0;h-=1)if(o.node(h).type.name===e){i=h;break}if(i<0)return null;let s=o.node(i),l=o.index(i);if(l+1>=s.childCount)return null;let a=s.child(l+1);if(!n.includes(a.type.name))return null;let c=t.schema.nodes[e],d=!1;if(a.forEach(h=>{h.type===c&&h.childCount>1&&(d=!0)}),!d)return null;let u=t.doc.resolve(o.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;let f=[];return u.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:i,nestedList:u,nestedListPos:o.after(),insertPos:o.after(i),items:f}},OS=(t,e,n,r)=>{let o=ES(t,n,r);if(!o)return!1;let{selection:i}=t,{nestedList:s,nestedListPos:l,insertPos:a,items:c}=o,d=t.tr;d.delete(l,l+s.nodeSize);let u=d.mapping.map(a);return d.insert(u,v.from(c)),d.setSelection(i.map(d.doc,d.mapping)),e&&e(d),!0},NS=(t,e,n)=>OS(t.state,t.view.dispatch,e,n),Kp=(t,e)=>Z.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>NS(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),qp=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],ys="abcdefghijklmnopqrstuvwxyz",Jp=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function ws(t){let e=t,n="";for(let[r,o]of qp)for(;e>=r;)n+=o,e-=r;return n}function yc(t){return ws(t).toUpperCase()}function Gp(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let o=!1;for(let[i,s]of qp)if(e.startsWith(s,n)){r+=i,n+=s.length,o=!0;break}if(!o)return 0}return r}function RS(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=Gp(t);return e<=0?!1:(t===t.toLowerCase()?ws(e):yc(e))===t}function DS(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function bs(t){if(t<=26)return ys[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?ys[n]:ys[e]+ys[n]}function xs(t){if(!(!t||/^\d+$/.test(t))){if(RS(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function bc(t){if(/^\d+$/.test(t))return parseInt(t,10);let e=xs(t);if(e==="i"||e==="I")return Gp(t);if(e==="a"||e==="A"){let r=DS(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function LS(t,e){if(t==="numeric")return String(e);switch(t){case"a":return bs(e);case"A":return bs(e).toUpperCase();case"i":return ws(e);case"I":return yc(e);default:return String(e)}}function IS(t){var e;if(t.length===0)return!1;let n=(e=xs(t[0]))!==null&&e!==void 0?e:"numeric",r=bc(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){let i=LS(n,r+o);if(t[o]!==i)return!1}return!0}function PS(t){return{type:xs(t),start:bc(t)}}function $S(t){let{type:e,start:n}=PS(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function BS(t,e,n=". "){let r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${bs(r)}${n}`;case"A":return`${bs(r).toUpperCase()}${n}`;case"i":return`${ws(r)}${n}`;case"I":return`${yc(r)}${n}`;default:return`${r}${n}`}}function zS(t){var e,n;let r=(e=t.tokens)===null||e===void 0?void 0:e[0];return!!(t.text&&((n=t.tokens)===null||n===void 0?void 0:n.length)===1&&r?.type==="list"&&r.ordered&&r.raw===t.text)}function HS(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var wc=j.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",D(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];let r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren,o=[];if(t.tokens&&t.tokens.length>0){if(zS(t))return{type:"listItem",content:[{type:"paragraph",content:HS(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))o=r(t.tokens);else{let i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(o=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){let s=r(t.tokens.slice(1));o.push Line truncated `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(AS,this.editor.getAttributes(zp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Vt({find:Hp,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Vt({find:Hp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(zp),editor:this.editor})),[t]}}),ES=(t,e,n)=>{let{selection:r}=t;if(!r.empty)return null;let{$from:o}=r;if(!o.parent.isTextblock||o.parentOffset!==o.parent.content.size)return null;let i=-1;for(let h=o.depth;h>0;h-=1)if(o.node(h).type.name===e){i=h;break}if(i<0)return null;let s=o.node(i),l=o.index(i);if(l+1>=s.childCount)return null;let a=s.child(l+1);if(!n.includes(a.type.name))return null;let c=t.schema.nodes[e],d=!1;if(a.forEach(h=>{h.type===c&&h.childCount>1&&(d=!0)}),!d)return null;let u=t.doc.resolve(o.after()).nodeAfter;if(!u||!n.includes(u.type.name))return null;let f=[];return u.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:i,nestedList:u,nestedListPos:o.after(),insertPos:o.after(i),items:f}},OS=(t,e,n,r)=>{let o=ES(t,n,r);if(!o)return!1;let{selection:i}=t,{nestedList:s,nestedListPos:l,insertPos:a,items:c}=o,d=t.tr;d.delete(l,l+s.nodeSize);let u=d.mapping.map(a);return d.insert(u,S.from(c)),d.setSelection(i.map(d.doc,d.mapping)),e&&e(d),!0},NS=(t,e,n)=>OS(t.state,t.view.dispatch,e,n),Up=(t,e)=>Z.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>NS(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),Kp=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],gs="abcdefghijklmnopqrstuvwxyz",qp=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function bs(t){let e=t,n="";for(let[r,o]of Kp)for(;e>=r;)n+=o,e-=r;return n}function gc(t){return bs(t).toUpperCase()}function Jp(t){let e=t.toLowerCase(),n=0,r=0;for(;n<e.length;){let o=!1;for(let[i,s]of Kp)if(e.startsWith(s,n)){r+=i,n+=s.length,o=!0;break}if(!o)return 0}return r}function RS(t){if(!/^[ivxlcdmIVXLCDM]+$/.test(t))return!1;let e=Jp(t);return e<=0?!1:(t===t.toLowerCase()?bs(e):gc(e))===t}function DS(t){let e=t.toLowerCase();if(e.length===1)return e.charCodeAt(0)-97+1;if(e.length===2){let n=e.charCodeAt(0)-97,r=e.charCodeAt(1)-97;return(n+1)*26+r+1}return 0}function ys(t){if(t<=26)return gs[t-1];let e=Math.floor((t-1)/26)-1,n=(t-1)%26;return e<0?gs[n]:gs[e]+gs[n]}function ws(t){if(!(!t||/^\d+$/.test(t))){if(RS(t))return t===t.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(t))return"a";if(/^[A-Z]{1,2}$/.test(t))return"A"}}function yc(t){if(/^\d+$/.test(t))return parseInt(t,10);let e=ws(t);if(e==="i"||e==="I")return Jp(t);if(e==="a"||e==="A"){let r=DS(t);return r>0?r:1}let n=parseInt(t,10);return Number.isNaN(n)?1:n}function LS(t,e){if(t==="numeric")return String(e);switch(t){case"a":return ys(e);case"A":return ys(e).toUpperCase();case"i":return bs(e);case"I":return gc(e);default:return String(e)}}function IS(t){var e;if(t.length===0)return!1;let n=(e=ws(t[0]))!==null&&e!==void 0?e:"numeric",r=yc(t[0]);if(r<1)return!1;for(let o=0;o<t.length;o++){let i=LS(n,r+o);if(t[o]!==i)return!1}return!0}function PS(t){return{type:ws(t),start:yc(t)}}function $S(t){let{type:e,start:n}=PS(t),r={};return e&&(r.type=e),n!==1&&(r.start=n),r}function BS(t,e,n=". "){let r=e+1;if(!t||t==="1")return`${r}${n}`;switch(t){case"a":return`${ys(r)}${n}`;case"A":return`${ys(r).toUpperCase()}${n}`;case"i":return`${bs(r)}${n}`;case"I":return`${gc(r)}${n}`;default:return`${r}${n}`}}function zS(t){var e,n;let r=(e=t.tokens)===null||e===void 0?void 0:e[0];return!!(t.text&&((n=t.tokens)===null||n===void 0?void 0:n.length)===1&&r?.type==="list"&&r.ordered&&r.raw===t.text)}function HS(t,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(t)):e.parseInline([{type:"text",raw:t,text:t}])}var bc=W.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",L(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{var n;if(t.type!=="list_item")return[];let r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren,o=[];if(t.tokens&&t.tokens.length>0){if(zS(t))return{type:"listItem",content:[{type:"paragraph",content:HS(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))o=r(t.tokens);else{let i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(o=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){let s=r(t.tokens.slice(1));o.push Line truncated
`).trim(),contentLines:p,raw:m.join(` `).trim(),contentLines:p,raw:m.join(`
`)}),r=g,n=g}return[e,r]}var YS=new RegExp(`^(${Jp})([.)])\\s+(.+)$`);function QS(t){let e=t.split(` `)}),r=g,n=g}return[e,r]}var YS=new RegExp(`^(${qp})([.)])\\s+(.+)$`);function QS(t){let e=t.split(`
`).filter(r=>r.trim().length>0);if(e.length===0)return null;let n=[];for(let r of e){let o=r.trim().match(YS);if(!o)return null;n.push({marker:o[1],content:o[3]})}return IS(n.map(r=>r.marker))?{type:"orderedList",attrs:$S(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function Yp(t,e,n){let r=[],o=0;for(;o<t.length;){let i=t[o];if(i.indent===e){let{paragraphLines:s,blockLines:l}=GS(i.contentLines),a=s.join(` `).filter(r=>r.trim().length>0);if(e.length===0)return null;let n=[];for(let r of e){let o=r.trim().match(YS);if(!o)return null;n.push({marker:o[1],content:o[3]})}return IS(n.map(r=>r.marker))?{type:"orderedList",attrs:$S(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function Xp(t,e,n){let r=[],o=0;for(;o<t.length;){let i=t[o];if(i.indent===e){let{paragraphLines:s,blockLines:l}=GS(i.contentLines),a=s.join(`
`).trim(),c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});let d=l.join(` `).trim(),c=[];a&&c.push({type:"paragraph",raw:a,tokens:n.inlineTokens(a)});let d=l.join(`
`).trim();if(d){let h=n.blockTokens(d);c.push(...h)}let u=o+1,f=[];for(;u<t.length&&t[u].indent>e;)f.push(t[u]),u+=1;if(f.length>0){let h=Yp(f,Math.min(...f.map(p=>p.indent)),n);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:h,raw:f.map(p=>p.raw).join(` `).trim();if(d){let h=n.blockTokens(d);c.push(...h)}let u=o+1,f=[];for(;u<t.length&&t[u].indent>e;)f.push(t[u]),u+=1;if(f.length>0){let h=Xp(f,Math.min(...f.map(p=>p.indent)),n);c.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:h,raw:f.map(p=>p.raw).join(`
`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=u}else o+=1}return r}function ZS(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];let r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...e.parseChildren([o]));else if(o.type==="text"&&o.tokens){let i=e.parseChildren([o]);r.push({type:"paragraph",content:i})}else{let i=e.parseChildren([o]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var e1="listItem",jp="textStyle",_p=/^(\d+)\.\s$/;function Up(t){let e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var kc=j.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{let e=t.getAttribute("type");if(e)return e;let n=t.getAttribute("style");if(n){let o=Up(n);if(o)return o}let r=t.querySelector("li");if(r){let o=r.getAttribute("style");if(o){let i=Up(o);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,type:n,...r}=t,o=D(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!=="1"&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];let n=t.start||1,r=t.typeMarker,o=t.items?ZS(t.items,e):[],i={};return n!==1&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `)})}r.push({type:"list_item",raw:i.raw,tokens:c}),o=u}else o+=1}return r}function ZS(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];let r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(o=>{if(o.type==="paragraph"||o.type==="list"||o.type==="blockquote"||o.type==="code")r.push(...e.parseChildren([o]));else if(o.type==="text"&&o.tokens){let i=e.parseChildren([o]);r.push({type:"paragraph",content:i})}else{let i=e.parseChildren([o]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var e1="listItem",Wp="textStyle",jp=/^(\d+)\.\s$/;function _p(t){let e=t.match(/list-style-type\s*:\s*([^;]+)/i);if(!e)return null;switch(e[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var xc=W.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>{let e=t.getAttribute("type");if(e)return e;let n=t.getAttribute("style");if(n){let o=_p(n);if(o)return o}let r=t.querySelector("li");if(r){let o=r.getAttribute("style");if(o){let i=_p(o);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){let{start:e,type:n,...r}=t,o=L(this.options.HTMLAttributes,r);return e!==1&&(o.start=e),n&&n!=="1"&&(o.type=n),["ol",o,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];let n=t.start||1,r=t.typeMarker,o=t.items?ZS(t.items,e):[],i={};return n!==1&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;let i=t.split(` `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,o;let i=t.split(`
`),[s,l]=XS(i);if(s.length===0)return;let a=Yp(s,s[0].indent,n);if(a.length!==0)return{type:"list",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(o=s[0])===null||o===void 0?void 0:o.type,items:a,raw:i.slice(0,l).join(` `),[s,l]=XS(i);if(s.length===0)return;let a=Xp(s,s[0].indent,n);if(a.length!==0)return{type:"list",ordered:!0,start:((r=s[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(o=s[0])===null||o===void 0?void 0:o.type,items:a,raw:i.slice(0,l).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(e1,this.editor.getAttributes(jp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new F({props:{handlePaste:(t,e)=>{var n,r;let o=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(o?.trim())return!1;let i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i)return!1;let s=QS(i);if(!s)return!1;try{let l=t.state.schema.nodeFromJSON(s),a=t.state.tr.replaceSelectionWith(l);return t.dispatch(a),!0}catch{return!1}}}})]},addInputRules(){let t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1],e=Vt({find:_p,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Vt({find:_p,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(jp)}),joinPredicate:t,editor:this.editor})),[e]}}),t1=/^\s*(\[([( |x])?\])\s$/,n1="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",r1=(t,e,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},o1=j.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",D(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;let r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return po(t,e,r)},addExtensions(){return this.options.nested?[Kp(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");s.style.cssText=n1;let c=u=>{let f=r1(u,u.attrs.checked,this.options.a11y);l.setAttribute("aria-label",f),s.textContent=f};c(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:f}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{let p=n();if(typeof p!="number")return!1;let g=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...g?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{o.setAttribute(u,f)}),o.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,s),o.append(i,a),Object.entries(e).forEach(([u,f])=>{o.setAttribute(u,f)});let d=new Set(Object.keys(e));return{dom:o,contentDOM:a,update:u=>{if(u.type!==this.type)return!1;o.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u);let f=r.extensionManager.attributes,h=zt(u,f),p=new Set(Object.keys(h)),g=this.options.HTMLAttributes;return d.forEach(m=>{p.has(m)||(m in g?o.setAttribute(m,g[m]):o.removeAttribute(m))}),Object.entries(h).forEach(([m,y])=>{y==null?m in g?o.setAttribute(m,g[m]):o.removeAttribute(m):o.setAttribute(m,y)}),d=p,!0}}}},addInputRules(){return[Vt({find:t1,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),i1=j.create({name:"taskList",addOptions() Line truncated `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(e1,this.editor.getAttributes(Wp)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new F({props:{handlePaste:(t,e)=>{var n,r;let o=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(o?.trim())return!1;let i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i)return!1;let s=QS(i);if(!s)return!1;try{let l=t.state.schema.nodeFromJSON(s),a=t.state.tr.replaceSelectionWith(l);return t.dispatch(a),!0}catch{return!1}}}})]},addInputRules(){let t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1],e=Vt({find:jp,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Vt({find:jp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(Wp)}),joinPredicate:t,editor:this.editor})),[e]}}),t1=/^\s*(\[([( |x])?\])\s$/,n1="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",r1=(t,e,n)=>{var r;return(n==null||(r=n.checkboxLabel)===null||r===void 0?void 0:r.call(n,t,e))||`Task item checkbox for ${t.textContent||"empty task item"}`},o1=W.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{let e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:t=>{var e;return(e=t.querySelector("div"))!==null&&e!==void 0?e:t}}]},renderHTML({node:t,HTMLAttributes:e}){return["li",L(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{let n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){let r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;let r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return fo(t,e,r)},addExtensions(){return this.options.nested?[Up(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{let o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");s.style.cssText=n1;let c=u=>{let f=r1(u,u.attrs.checked,this.options.a11y);l.setAttribute("aria-label",f),s.textContent=f};c(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:f}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{let p=n();if(typeof p!="number")return!1;let g=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...g?.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{o.setAttribute(u,f)}),o.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,s),o.append(i,a),Object.entries(e).forEach(([u,f])=>{o.setAttribute(u,f)});let d=new Set(Object.keys(e));return{dom:o,contentDOM:a,update:u=>{if(u.type!==this.type)return!1;o.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u);let f=r.extensionManager.attributes,h=zt(u,f),p=new Set(Object.keys(h)),g=this.options.HTMLAttributes;return d.forEach(m=>{p.has(m)||(m in g?o.setAttribute(m,g[m]):o.removeAttribute(m))}),Object.entries(h).forEach(([m,y])=>{y==null?m in g?o.setAttribute(m,g[m]):o.removeAttribute(m):o.setAttribute(m,y)}),d=p,!0}}}},addInputRules(){return[Vt({find:t1,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),i1=W.create({name:"taskList",addOptions() Line truncated
`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;let n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){let r=i=>{let s=ho(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);if(s){let l={type:"taskList",raw:s.raw,items:s.items},a=i.slice(s.raw.length);return a.trim()?[l,...n.blockTokens(a)]:[l]}return n.blockTokens(i)},o=ho(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),nA=Z.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(gc.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(wc.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(_S.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(kc.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(o1.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(i1.configure(this.options.taskList)),t}});var Qp=(t,e,n={})=>{t?.dispatchEvent(new CustomEvent(e,{composed:!0,cancelable:!0,detail:n}))},Sc=({files:t,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:r,maxSizeValidationMessage:o})=>{for(let i of t){if(e&&!e.includes(i.type))return n;if(r&&i.size>+r*1024)return o}return null},s1=()=>("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)),l1=({editor:t,acceptedTypes:e,acceptedTypesValidationMessage:n,get$WireUsing:r,key:o,maxSize:i,maxSizeValidationMessage:s,statePath:l,uploadingMessage:a})=>{let c=new Set,d,u=!1;t.on("destroy",()=>{u=!0,c.forEach(m=>m())});let f=m=>r().callSchemaComponentMethod(o,"getUploadedFileAttachmentTemporaryUrl",{attachment:m}),h=m=>{let y=m.dom.closest("form");c.size||(d=t.isEditable);let x=()=>{c.delete(x)&&(!u&&!c.size&&(t.setEditable(d),m.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:o,livewireId:r().id}}))),Qp(y,"form-processing-finished"))};return c.add(x),t.setEditable(!1),Qp(y,"form-processing-started",{message:a}),m.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:o,livewireId:r().id}})),{finish:x,isCurrent:()=>!u&&c.has(x)}},p=(m,y)=>new Promise(x=>{let b=s1();r().upload(`componentFileAttachments.${l}.${b}`,m,async()=>{if(!y.isCurrent()){x(null);return}try{let w=await f(b);x(w?{id:b,src:w}:null)}catch{x(null)}},()=>x(null),()=>{},()=>x(null))}).catch(()=>null),g=async(m,y,x)=>{let b=h(m);try{(await Promise.allSettled(y.map(async k=>{let C=await p(k,b);!C||!b.isCurrent()||t.chain().insertContentAt(x(),{type:"image",attrs:C}).run()}))).forEach(k=>{k.status==="rejected"&&console.error("Failed to insert uploaded file attachment",k.reason)})}finally{b.finish()}};return new F({key:new _("localFiles"),props:{handleDrop(m,y){if(!y.dataTransfer?.files.length)return!1;let x=Array.from(y.dataTransfer.files),b=Sc({files:x,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:i,maxSizeValidationMessage:s});if(b)return m.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:o,livewireId:r().id,validationMessage:b}})),!1;if(!x.length)return!1;y.preventDefault(),y.stopPropagation();let w=m.posAtCoords({left:y.clientX,top:y.clientY});return g(m,x,()=>w?.pos??0),!0},handlePaste(m,y){let x=y.clipboardData?.files?.length?Array.from(y.clipboardData.files):[],b=y.clipboardData?.getData("text")?.length>0,w=y.clipboardData?.getData("text/html")||"";if(x.length&&!b){let k=Sc({files:x,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:i,maxSizeValidationMessage:s});return k?(m.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:o,livewireId:r().id,validationMessage:k}})),!1):(y.preventDefault(),y.stopPropagation(),g(m,x,()=>t.state.selection.anchor),!0)}if(w){let C=new DOMParser().parseFromString(w,"text/html"),S=C.querySelectorAll("img[src]");if(S.length){y.stopPropagation();let{from:O,to:R}=t.state.selection,A=h(m);return(async()=>{try{for(let z of S){if(!A.isCurrent())return;let $=z.getAttribu Line truncated `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;let n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||e===void 0?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){let r=i=>{let s=uo(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},n);if(s){let l={type:"taskList",raw:s.raw,items:s.items},a=i.slice(s.raw.length);return a.trim()?[l,...n.blockTokens(a)]:[l]}return n.blockTokens(i)},o=uo(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:r},n);if(o)return{type:"taskList",raw:o.raw,items:o.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),nA=Z.create({name:"listKit",addExtensions(){let t=[];return this.options.bulletList!==!1&&t.push(mc.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(bc.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(_S.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(xc.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(o1.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(i1.configure(this.options.taskList)),t}});var Yp=(t,e,n={})=>{t?.dispatchEvent(new CustomEvent(e,{composed:!0,cancelable:!0,detail:n}))},kc=({files:t,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:r,maxSizeValidationMessage:o})=>{for(let i of t){if(e&&!e.includes(i.type))return n;if(r&&i.size>+r*1024)return o}return null},s1=()=>("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,t=>(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)),l1=({editor:t,acceptedTypes:e,acceptedTypesValidationMessage:n,get$WireUsing:r,getFileAttachmentUrlUsing:o,key:i,maxSize:s,maxSizeValidationMessage:l,statePath:a,uploadingMessage:c})=>{let d=new Set,u,f=!1;t.on("destroy",()=>{f=!0,d.forEach(m=>m())});let h=m=>{let y=m.dom.closest("form");d.size||(u=t.isEditable);let w=()=>{d.delete(w)&&(!f&&!d.size&&(t.setEditable(u),m.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:i,livewireId:r().id}}))),Yp(y,"form-processing-finished"))};return d.add(w),t.setEditable(!1),Yp(y,"form-processing-started",{message:c}),m.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:i,livewireId:r().id}})),{finish:w,isCurrent:()=>!f&&d.has(w)}},p=(m,y)=>new Promise(w=>{let x=s1();r().upload(`componentFileAttachments.${a}.${x}`,m,async()=>{if(!y.isCurrent()){w(null);return}try{let b=await o(x);w(b?{id:x,src:b}:null)}catch{w(null)}},()=>w(null),()=>{},()=>w(null))}).catch(()=>null),g=async(m,y,w)=>{let x=h(m);try{(await Promise.allSettled(y.map(async k=>{let v=await p(k,x);!v||!x.isCurrent()||t.chain().insertContentAt(w(),{type:"image",attrs:v}).run()}))).forEach(k=>{k.status==="rejected"&&console.error("Failed to insert uploaded file attachment",k.reason)})}finally{x.finish()}};return new F({key:new j("localFiles"),props:{handleDrop(m,y,w,x){if(x||!y.dataTransfer?.files.length)return!1;let b=Array.from(y.dataTransfer.files),k=kc({files:b,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:s,maxSizeValidationMessage:l});if(k)return m.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:i,livewireId:r().id,validationMessage:k}})),!1;if(!b.length)return!1;y.preventDefault(),y.stopPropagation();let v=m.posAtCoords({left:y.clientX,top:y.clientY});return g(m,b,()=>v?.pos??0),!0},handlePaste(m,y){let w=y.clipboardData?.files?.length?Array.from(y.clipboardData.files):[],x=y.clipboardData?.getData("text")?.length>0,b=y.clipboardData?.getData("text/html")||"";if(w.length&&!x){let k=kc({files:w,acceptedTypes:e,acceptedTypesValidationMessage:n,maxSize:s,maxSizeValidationMessage:l});return k?(m.dom.dispatchEvent(new CustomEvent("rich-editor-file-validation-message",{bubbles:!0,detail:{key:i,livewireId:r().id,validationMessage:k}})),!1):(y.preventDefault(),y.stopPropagation(),g(m,w,()=>t.state.selection.anchor),!0)}if(b){let v=new DOMParser().parseFromString(b,"text/html"),C=v.querySelectorAll("img[src]");if(C.length){y.stopPropagation();let{from:O,to:P}=t.state.selection,N=h(m);return(async()=>{try{for(let I of C){if(!N.isCurrent())return;let M=I.getAttribute("src");if(!M.startsWith("data:image/"))continue;let V;t Line truncated
`);return/\s/.test(r)}):!1}function B1(t){return()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:o,left:i}=t.view.coordsAtPos(e);try{return new DOMRect(i,n,r-i,o-n)}catch{return null}}}function z1(t,e,n,r){return n?()=>{let o=r.getState(t.state),i=o?.decorationId,s=e.dom.querySelector(`[data-decoration-id="${i}"]`);return s?.getBoundingClientRect()||null}:B1(t)}function H1({match:t,dismissedRange:e,state:n,transaction:r,editor:o,shouldResetDismissed:i,effectiveAllowSpaces:s}){return i?.({editor:o,state:n,range:e,match:t,transaction:r,allowSpaces:s})?!1:s?t.range.from===e.from:t.range.from===e.from&&!$1(r)}function F1({view:t,pluginKeyRef:e}){let n=t.state.tr.setMeta(e,{exit:!0});t.dispatch(n)}function V1({pluginKey:t,decorationTag:e,decorationClass:n,decorationContent:r,decorationEmptyClass:o,renderer:i,dispatchExit:s}){return{handleKeyDown(l,a){var c;let d=t.getState(l.state);if(!d.active)return!1;if(a.key==="Escape"||a.key==="Esc"){var u;return i==null||(u=i.onKeyDown)===null||u===void 0||u.call(i,{view:l,event:a,range:d.range}),s(l),!0}return(i==null||(c=i.onKeyDown)===null||c===void 0?void 0:c.call(i,{view:l,event:a,range:d.range}))||!1},decorations(l){let{active:a,range:c,decorationId:d,query:u}=t.getState(l);if(!a)return null;let f=!u?.length,h=[n];return f&&h.push(o),Y.create(l.doc,[ie.inline(c.from,c.to,{nodeName:e,class:h.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":r})])}}}function W1({editor:t,char:e,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,findSuggestionMatch:s,allow:l,shouldShow:a,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,f,h,p){let{isEditable:g}=t,{composing:m}=t.view,{selection:y}=u,{empty:x,from:b}=y,w={...f},k=u.getMeta(d);if(k&&k.exit)return w.active=!1,w.decorationId=null,w.range={from:0,to:0},w.query=null,w.text=null,w.dismissedRange=f.active?{...f.range}:f.dismissedRange,w;if(w.composing=m,u.docChanged&&w.dismissedRange!==null&&(w.dismissedRange={from:u.mapping.map(w.dismissedRange.from),to:u.mapping.map(w.dismissedRange.to)}),g&&(x||t.view.composing)){(b<f.range.from||b>f.range.to)&&!m&&!f.composing&&(w.active=!1);let C=s({char:e,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,$position:y.$from}),S=`id_${Math.floor(Math.random()*4294967295)}`;C&&l({editor:t,state:p,range:C.range,isActive:f.active})&&(!a||a({editor:t,range:C.range,query:C.query,text:C.text,transaction:u}))?(w.dismissedRange!==null&&!c({match:C,dismissedRange:w.dismissedRange,state:p,transaction:u})&&(w.dismissedRange=null),w.dismissedRange===null?(w.active=!0,w.decorationId=f.decorationId||S,w.range=C.range,w.query=C.query,w.text=C.text):w.active=!1):(C||(w.dismissedRange=null),w.active=!1)}else w.active=!1;return w.active||(w.decorationId=null,w.range={from:0,to:0},w.query=null,w.text=null),w}}}function j1({editor:t,items:e}){let n=null,r=null,o=null,i=()=>{r!==null&&(clearTimeout(r),r=null),o?.(),o=null},s=c=>new Promise(d=>{o=d,r=setTimeout(()=>{r=null;let u=o;o=null,u?.()},c)}),l=()=>{n?.abort(),i(),n=null};return{abort:l,fetch:async(c,d)=>{l(),n=new AbortController;let u=n;if(d>0&&await s(d),n!==u||u.signal.aborted)return{status:"aborted"};try{let f=await e({editor:t,query:c,signal:u.signal});return n!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:f}}catch{return n!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function _1({placement:t,offset:e,flip:n,floatingUi:r}){var o,i,s,l;let a=[Ns({mainAxis:(o=e.mainAxis)!==null&&o!==void 0?o:4,crossAxis:(i=e.crossAxis)!==null&&i!==void 0?i:0})];return n&&a.push(Ar()),!(r==null||(s=r.middleware)===null||s===void 0)&&s.length&&a.push(...r.middleware),{placement:t,strategy:(l=r?.strategy)!==null&&l!==void 0?l:"absolute",middleware:a}}function U1(t){if(t instanceof HTMLElement)return t;if(typeof t=="string")try{let e=document.querySelector(t);if(e)return e}catch{return document.body}return document.body}function K1({getReferenceRect:t,contextElement:e,config:n,container:r,dismissOnOutsideClick:o,dismiss:i}){return(s,l={})=>{let a={getBoundingClientRect:()=>{var p;return(p=t())!==null&&p!==void 0?p:new DOMRect},contextElement:e},c=!1,d=!s.isConnected;d&&U1(r).appendChild(s),l.onPosition||(s.style.visibility="hidden",s.style.width="max-content");let f=Lm(a,s,()=>{Er(a,s,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:p,y:g,placement:m,strategy:y})=>{if(l.onPosition){l.onPosition({x:p,y:g,placement:m,strategy:y});return}Object.assign(s.style,{position:y,left:`${p}px`,top:`${g}px`}),c||(c=!0,s.style.visibility="")})},l.autoUpdate),h;return o&&(h=p=>{let g=p.target;!(g instanceof Node)||s.contains(g)||e.contains(g)||i()},document.addEventListener("pointerdown",h,!0)),()=>{f(),h&&document.removeEventListener("pointerdown",h,!0),d&&s.remove()}}}function q1({editor:t,pluginKey:e,items:n,renderer:r,minQueryLength:o,debounce:i,in Line truncated `);return/\s/.test(r)}):!1}function B1(t){return()=>{let e=t.state.selection.$anchor.pos,{top:n,right:r,bottom:o,left:i}=t.view.coordsAtPos(e);try{return new DOMRect(i,n,r-i,o-n)}catch{return null}}}function z1(t,e,n,r){return n?()=>{let o=r.getState(t.state),i=o?.decorationId,s=e.dom.querySelector(`[data-decoration-id="${i}"]`);return s?.getBoundingClientRect()||null}:B1(t)}function H1({match:t,dismissedRange:e,state:n,transaction:r,editor:o,shouldResetDismissed:i,effectiveAllowSpaces:s}){return i?.({editor:o,state:n,range:e,match:t,transaction:r,allowSpaces:s})?!1:s?t.range.from===e.from:t.range.from===e.from&&!$1(r)}function F1({view:t,pluginKeyRef:e}){let n=t.state.tr.setMeta(e,{exit:!0});t.dispatch(n)}function V1({pluginKey:t,decorationTag:e,decorationClass:n,decorationContent:r,decorationEmptyClass:o,renderer:i,dispatchExit:s}){return{handleKeyDown(l,a){var c;let d=t.getState(l.state);if(!d.active)return!1;if(a.key==="Escape"||a.key==="Esc"){var u;return i==null||(u=i.onKeyDown)===null||u===void 0||u.call(i,{view:l,event:a,range:d.range}),s(l),!0}return(i==null||(c=i.onKeyDown)===null||c===void 0?void 0:c.call(i,{view:l,event:a,range:d.range}))||!1},decorations(l){let{active:a,range:c,decorationId:d,query:u}=t.getState(l);if(!a)return null;let f=!u?.length,h=[n];return f&&h.push(o),Y.create(l.doc,[re.inline(c.from,c.to,{nodeName:e,class:h.join(" "),"data-decoration-id":d||void 0,"data-decoration-content":r})])}}}function W1({editor:t,char:e,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,findSuggestionMatch:s,allow:l,shouldShow:a,shouldKeepDismissed:c,pluginKey:d}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(u,f,h,p){let{isEditable:g}=t,{composing:m}=t.view,{selection:y}=u,{empty:w,from:x}=y,b={...f},k=u.getMeta(d);if(k&&k.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=m,u.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:u.mapping.map(b.dismissedRange.from),to:u.mapping.map(b.dismissedRange.to)}),g&&(w||t.view.composing)){(x<f.range.from||x>f.range.to)&&!m&&!f.composing&&(b.active=!1);let v=s({char:e,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:o,startOfLine:i,$position:y.$from}),C=`id_${Math.floor(Math.random()*4294967295)}`;v&&l({editor:t,state:p,range:v.range,isActive:f.active})&&(!a||a({editor:t,range:v.range,query:v.query,text:v.text,transaction:u}))?(b.dismissedRange!==null&&!c({match:v,dismissedRange:b.dismissedRange,state:p,transaction:u})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||C,b.range=v.range,b.query=v.query,b.text=v.text):b.active=!1):(v||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function j1({editor:t,items:e}){let n=null,r=null,o=null,i=()=>{r!==null&&(clearTimeout(r),r=null),o?.(),o=null},s=c=>new Promise(d=>{o=d,r=setTimeout(()=>{r=null;let u=o;o=null,u?.()},c)}),l=()=>{n?.abort(),i(),n=null};return{abort:l,fetch:async(c,d)=>{l(),n=new AbortController;let u=n;if(d>0&&await s(d),n!==u||u.signal.aborted)return{status:"aborted"};try{let f=await e({editor:t,query:c,signal:u.signal});return n!==u||u.signal.aborted?{status:"aborted"}:{status:"resolved",items:f}}catch{return n!==u||u.signal.aborted?{status:"aborted"}:{status:"error"}}}}}function _1({placement:t,offset:e,flip:n,floatingUi:r}){var o,i,s,l;let a=[Os({mainAxis:(o=e.mainAxis)!==null&&o!==void 0?o:4,crossAxis:(i=e.crossAxis)!==null&&i!==void 0?i:0})];return n&&a.push(Mr()),!(r==null||(s=r.middleware)===null||s===void 0)&&s.length&&a.push(...r.middleware),{placement:t,strategy:(l=r?.strategy)!==null&&l!==void 0?l:"absolute",middleware:a}}function U1(t){if(t instanceof HTMLElement)return t;if(typeof t=="string")try{let e=document.querySelector(t);if(e)return e}catch{return document.body}return document.body}function K1({getReferenceRect:t,contextElement:e,config:n,container:r,dismissOnOutsideClick:o,dismiss:i}){return(s,l={})=>{let a={getBoundingClientRect:()=>{var p;return(p=t())!==null&&p!==void 0?p:new DOMRect},contextElement:e},c=!1,d=!s.isConnected;d&&U1(r).appendChild(s),l.onPosition||(s.style.visibility="hidden",s.style.width="max-content");let f=Dm(a,s,()=>{Tr(a,s,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:p,y:g,placement:m,strategy:y})=>{if(l.onPosition){l.onPosition({x:p,y:g,placement:m,strategy:y});return}Object.assign(s.style,{position:y,left:`${p}px`,top:`${g}px`}),c||(c=!0,s.style.visibility="")})},l.autoUpdate),h;return o&&(h=p=>{let g=p.target;!(g instanceof Node)||s.contains(g)||e.contains(g)||i()},document.addEventListener("pointerdown",h,!0)),()=>{f(),h&&document.removeEventListener("pointerdown",h,!0),d&&s.remove()}}}function q1({editor:t,pluginKey:e,items:n,renderer:r,minQueryLength:o,debounce:i,in Line truncated
`).map(e=>!e.includes("|")||!e.includes("`")?e:nv(e)).join(` `).map(e=>!e.includes("|")||!e.includes("`")?e:nv(e)).join(`
`)}function ov(t){return(t||"").replace(/\s+/g," ").trim()}function iv(t,e,n={}){var r;let o=(r=n.cellLineSeparator)!==null&&r!==void 0?r:"";if(!t||!t.content||t.content.length===0)return"";let i=[];t.content.forEach(p=>{let g=[];p.content&&p.content.forEach(m=>{let y="";m.content&&Array.isArray(m.content)&&m.content.length>1?y=m.content.map(k=>e.renderChildren(k)).join(o):y=m.content?e.renderChildren(m.content):"";let x=ov(y.split(o).join(` `)}function ov(t){return(t||"").replace(/\s+/g," ").trim()}function iv(t,e,n={}){var r;let o=(r=n.cellLineSeparator)!==null&&r!==void 0?r:"";if(!t||!t.content||t.content.length===0)return"";let i=[];t.content.forEach(p=>{let g=[];p.content&&p.content.forEach(m=>{let y="";m.content&&Array.isArray(m.content)&&m.content.length>1?y=m.content.map(k=>e.renderChildren(k)).join(o):y=m.content?e.renderChildren(m.content):"";let w=ov(y.split(o).join(`
`).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),b=m.type==="tableHeader",w=UC(m.attrs);g.push({text:x,isHeader:b,align:w})}),i.push(g)});let s=i.reduce((p,g)=>Math.max(p,g.length),0);if(s===0)return"";let l=Array.from({length:s}).fill(0);i.forEach(p=>{for(let m=0;m<s;m+=1){var g;let y=(((g=p[m])===null||g===void 0?void 0:g.text)||"").length;y>l[m]&&(l[m]=y),l[m]<3&&(l[m]=3)}});let a=(p,g)=>p+" ".repeat(Math.max(0,g-p.length)),c=i[0],d=c.some(p=>p.isHeader),u=Array.from({length:s}).fill(null);i.forEach(p=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=p[m])===null||g===void 0)&&g.align)&&(u[m]=p[m].align)}});let f=` `).replace(/[ \t]*\r?\n[ \t]*/g,"<br>")),x=m.type==="tableHeader",b=UC(m.attrs);g.push({text:w,isHeader:x,align:b})}),i.push(g)});let s=i.reduce((p,g)=>Math.max(p,g.length),0);if(s===0)return"";let l=Array.from({length:s}).fill(0);i.forEach(p=>{for(let m=0;m<s;m+=1){var g;let y=(((g=p[m])===null||g===void 0?void 0:g.text)||"").length;y>l[m]&&(l[m]=y),l[m]<3&&(l[m]=3)}});let a=(p,g)=>p+" ".repeat(Math.max(0,g-p.length)),c=i[0],d=c.some(p=>p.isHeader),u=Array.from({length:s}).fill(null);i.forEach(p=>{for(let m=0;m<s;m+=1){var g;!u[m]&&(!((g=p[m])===null||g===void 0)&&g.align)&&(u[m]=p[m].align)}});let f=`
`,h=Array.from({length:s}).map((p,g)=>d&&c[g]&&c[g].text||"");return f+=`| ${h.map((p,g)=>a(p,l[g])).join(" | ")} | `,h=Array.from({length:s}).map((p,g)=>d&&c[g]&&c[g].text||"");return f+=`| ${h.map((p,g)=>a(p,l[g])).join(" | ")} |
`,f+=`| ${l.map((p,g)=>{let m=Math.max(3,p),y=u[g];return y==="left"?`:${"-".repeat(m)}`:y==="right"?`${"-".repeat(m)}:`:y==="center"?`:${"-".repeat(m)}:`:"-".repeat(m)}).join(" | ")} | `,f+=`| ${l.map((p,g)=>{let m=Math.max(3,p),y=u[g];return y==="left"?`:${"-".repeat(m)}`:y==="right"?`${"-".repeat(m)}:`:y==="center"?`:${"-".repeat(m)}:`:"-".repeat(m)}).join(" | ")} |
`,(d?i.slice(1):i).forEach(p=>{f+=`| ${Array.from({length:s}).fill(0).map((g,m)=>a(p[m]&&p[m].text||"",l[m])).join(" | ")} | `,(d?i.slice(1):i).forEach(p=>{f+=`| ${Array.from({length:s}).fill(0).map((g,m)=>a(p[m]&&p[m].text||"",l[m])).join(" | ")} |
`}),f}var sv=j.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:YC,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:o}=QC(t,this.options.cellMinWidth),i=e.style;function s(){return i||(r?`width: ${r}`:`min-width: ${o}`)}let l=["table",D(this.options.HTMLAttributes,e,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},l]:l},parseMarkdown:(t,e)=>{let n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){let o=[];t.header.forEach((i,s)=>{var l;let a=Vs((l=r[s])!==null&&l!==void 0?l:i.align),c=a?{align:a}:{};o.push(e.createNode("tableHeader",c,[{type:"paragraph",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode("tableRow",{},o))}return t.rows&&t.rows.forEach(o=>{let i=[];o.forEach((s,l)=>{var a;let c=Vs((a=r[l])!==null&&a!==void 0?a:s.align),d=c?{align:c}:{};i.push(e.createNode("tableCell",d,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>iv(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{let e=t.split(` `}),f}var sv=W.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:YC,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){let{colgroup:n,tableWidth:r,tableMinWidth:o}=QC(t,this.options.cellMinWidth),i=e.style;function s(){return i||(r?`width: ${r}`:`min-width: ${o}`)}let l=["table",L(this.options.HTMLAttributes,e,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},l]:l},parseMarkdown:(t,e)=>{let n=[],r=Array.isArray(t.align)?t.align:[];if(t.header){let o=[];t.header.forEach((i,s)=>{var l;let a=Fs((l=r[s])!==null&&l!==void 0?l:i.align),c=a?{align:a}:{};o.push(e.createNode("tableHeader",c,[{type:"paragraph",content:e.parseInline(i.tokens)}]))}),n.push(e.createNode("tableRow",{},o))}return t.rows&&t.rows.forEach(o=>{let i=[];o.forEach((s,l)=>{var a;let c=Fs((a=r[l])!==null&&a!==void 0?a:s.align),d=c?{align:c}:{};i.push(e.createNode("tableCell",d,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),n.push(e.createNode("tableRow",{},i))}),e.createNode("table",void 0,n)},renderMarkdown:(t,e)=>iv(t,e),markdownTokenizer:{name:"table",level:"block",start:t=>{let e=t.split(`
`);if(e.length<2)return-1;let n=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,n){let r=t.indexOf(` `);if(e.length<2)return-1;let n=e[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:e[0].includes("|")?0:-1},tokenize(t,e,n){let r=t.indexOf(`
`),o=r>=0?t.slice(0,r):t,i=o.split(` `),o=r>=0?t.slice(0,r):t,i=o.split(`
`);if(i.length<2)return;let s=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;let l=rv(o);if(l===o)return;let a=n.blockTokens(l)[0];if(a?.type!=="table"||!a.raw)return;let c=a.raw.split(` `);if(i.length<2)return;let s=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;let l=rv(o);if(l===o)return;let a=n.blockTokens(l)[0];if(a?.type!=="table"||!a.raw)return;let c=a.raw.split(`
`).length,d=t.split(` `).length,d=t.split(`
`).slice(0,c).join(` `).slice(0,c).join(`
`);return{...a,raw:d}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{let s=ev(i.schema,t,e,n);if(o){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(N.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>ag(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>cg(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name==="table");return dg(t,e&&(r=>{n&&vg(r,n.pos),e(r)}))},addRowBefore:()=>({state:t,dispatch:e})=>fg(t,e),addRowAfter:()=>({state:t,dispatch:e})=>hg(t,e),deleteRow:()=>({state:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name==="table");return pg(t,e&&(r=>{n&&vg(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>yg(t,e),mergeCells:()=>({state:t,dispatch:e})=>Fc(t,e),splitCell:()=>({state:t,dispatch:e})=>Vc(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Or("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Or("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>gg(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Fc(t,e)?!0:Vc(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>mg(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Wc(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Wc(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&Hc(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=te.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Fs,"Mod-Backspace":Fs,Delete:Fs,"Mod-Delete":Fs}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[wg({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],kg({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:o})=>{let i=D(this.options.HTMLAttributes,o);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:G(P(t,"tableRole",e))}}}),Og=Z.create({name:"tableKit",addExtensions(){let t=[];return this.options.table!==!1&&t.push(sv.configure(this.options.table)),this.options.tableCell!==!1&&t.push(JC.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(GC.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(XC.configure(this.options.tableRow)),t}});var lv=j.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),Ng=lv;var av=Z.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{let e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Rg=av;var cv=le.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",D(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;let o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor. Line truncated `);return{...a,raw:d}}},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:i})=>{let s=ev(i.schema,t,e,n);if(o){let l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(R.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>lg(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>ag(t,e),deleteColumn:()=>({state:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name==="table");return cg(t,e&&(r=>{n&&Cg(r,n.pos),e(r)}))},addRowBefore:()=>({state:t,dispatch:e})=>ug(t,e),addRowAfter:()=>({state:t,dispatch:e})=>fg(t,e),deleteRow:()=>({state:t,dispatch:e})=>{let n=dt(t.selection.$from,r=>r.type.name==="table");return hg(t,e&&(r=>{n&&Cg(r,n.pos),e(r)}))},deleteTable:()=>({state:t,dispatch:e})=>gg(t,e),mergeCells:()=>({state:t,dispatch:e})=>Hc(t,e),splitCell:()=>({state:t,dispatch:e})=>Fc(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>Ar("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>Ar("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>mg(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>Hc(t,e)?!0:Fc(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>pg(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>Vc(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>Vc(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&zc(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){let r=te.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Hs,"Mod-Backspace":Hs,Delete:Hs,"Mod-Delete":Hs}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[bg({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],xg({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){let t=this.options.resizable&&this.editor.isEditable,e=this.options.View;return t||!e?null:({node:n,view:r,HTMLAttributes:o})=>{let i=L(this.options.HTMLAttributes,o);return new e(n,this.options.cellMinWidth,r,i)}},extendNodeSchema(t){let e={name:t.name,options:t.options,storage:t.storage};return{tableRole:G(B(t,"tableRole",e))}}}),Eg=Z.create({name:"tableKit",addExtensions(){let t=[];return this.options.table!==!1&&t.push(sv.configure(this.options.table)),this.options.tableCell!==!1&&t.push(JC.configure(this.options.tableCell)),this.options.tableHeader!==!1&&t.push(GC.configure(this.options.tableHeader)),this.options.tableRow!==!1&&t.push(XC.configure(this.options.tableRow)),t}});var lv=W.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),Og=lv;var av=Z.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{let e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).some(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).some(e=>e),toggleTextAlign:t=>({editor:e,commands:n})=>this.options.alignments.includes(t)?e.isActive({textAlign:t})?n.unsetTextAlign():n.setTextAlign(t):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),Ng=av;var cv=ie.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",L(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;let o=r[2].trim();return{type:"underline",raw:r[0],text:o,tokens:n.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor. Line truncated
@@ -1,4 +1,4 @@
var Yt=Math.min,yt=Math.max,Kt=Math.round;var ot=n=>({x:n,y:n}),on={left:"right",right:"left",bottom:"top",top:"bottom"};function Re(n,t,e){return yt(n,Yt(t,e))}function jt(n,t){return typeof n=="function"?n(t):n}function wt(n){return n.split("-")[0]}function Ut(n){return n.split("-")[1]}function Me(n){return n==="x"?"y":"x"}function _e(n){return n==="y"?"height":"width"}function pt(n){let t=n[0];return t==="t"||t==="b"?"y":"x"}function Pe(n){return Me(pt(n))}function ni(n,t,e){e===void 0&&(e=!1);let i=Ut(n),s=Pe(n),o=_e(s),r=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Xt(r)),[r,Xt(r)]}function si(n){let t=Xt(n);return[ce(n),t,ce(t)]}function ce(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var ei=["left","right"],ii=["right","left"],rn=["top","bottom"],an=["bottom","top"];function ln(n,t,e){switch(n){case"top":case"bottom":return e?t?ii:ei:t?ei:ii;case"left":case"right":return t?rn:an;default:return[]}}function oi(n,t,e,i){let s=Ut(n),o=ln(wt(n),e==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(ce)))),o}function Xt(n){let t=wt(n);return on[t]+n.slice(t.length)}function cn(n){return{top:0,right:0,bottom:0,left:0,...n}}function ri(n){return typeof n!="number"?cn(n):{top:n,right:n,bottom:n,left:n}}function xt(n){let{x:t,y:e,width:i,height:s}=n;return{width:i,height:s,top:e,left:t,right:t+i,bottom:e+s,x:t,y:e}}function ai(n,t,e){let{reference:i,floating:s}=n,o=pt(t),r=Pe(t),a=_e(r),l=wt(t),c=o==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,p=i[a]/2-s[a]/2,f;switch(l){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-s.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Ut(t)){case"start":f[r]-=p*(e&&c?-1:1);break;case"end":f[r]+=p*(e&&c?-1:1);break}return f}async function li(n,t){var e;t===void 0&&(t={});let{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=jt(t,n),m=ri(f),S=a[p?u==="floating"?"reference":"floating":u],O=xt(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(S)))==null||e?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=u==="floating"?{x:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},M=xt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(O.top-M.top+m.top)/A.y,bottom:(M.bottom-O.bottom+m.bottom)/A.y,left:(O.left-M.left+m.left)/A.x,right:(M.right-O.right+m.right)/A.x}}var un=50,ci=async(n,t,e)=>{let{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:li},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:u}=ai(c,i,l),p=i,f=0,m={};for(let g=0;g<o.length;g++){let S=o[g];if(!S)continue;let{name:O,fn:w}=S,{x,y:A,data:M,reset:C}=await w({x:h,y:u,initialPlacement:i,placement:p,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:n,floating:t}});h=x??h,u=A??u,m[O]={...m[O],...M},C&&f<un&&(f++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:n,floating:t,strategy:s}):C.rects),{x:h,y:u}=ai(c,p,l)),g=-1)}return{x:h,y:u,placement:p,strategy:s,middlewareData:m}};var ui=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...S}=jt(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let O=wt(s),w=pt(a),x=wt(a)===a,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=p||(x||!g?[Xt(a)]:si(a)),C=m!=="none";!p&&C&&M.push(...oi(a,g,m,A));let q=[a,...M],J=await l.detectOverflow(t,S),I=[],V=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&I.push(J[O]),u){let B=ni(s,r,A);I.push(J[B[0]],J[B[1]])}if(V=[...V,{placement:s,overflows:I}],!I.every(B=>B<=0)){var X,et;let B=(((X=o.flip)==null?void 0:X.index)||0)+1,Q=q[B];if(Q&&(!(u==="alignment"?w!==pt(Q):!1)||V.every(_=>pt(_.placement)===w?_.overflows[0]>0:!0)))return{data:{index:B,overflows:V},reset:{placement:Q}};let k=(et=V.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:et.placement;if(!k)switch(f){case"bestFit":{var W;let $=(W=V.filter(_=>{if(C){let K=pt(_.placement);return K===w||K==="y"}return!0}).map(_=>[_.placement,_Line truncated var $t=Math.min,St=Math.max,zt=Math.round;var rt=n=>({x:n,y:n}),on={left:"right",right:"left",bottom:"top",top:"bottom"};function Te(n,t,e){return St(n,$t(t,e))}function Xt(n,t){return typeof n=="function"?n(t):n}function Ot(n){return n.split("-")[0]}function Yt(n){return n.split("-")[1]}function Ie(n){return n==="x"?"y":"x"}function Re(n){return n==="y"?"height":"width"}function mt(n){let t=n[0];return t==="t"||t==="b"?"y":"x"}function Me(n){return Ie(mt(n))}function ei(n,t,e){e===void 0&&(e=!1);let i=Yt(n),s=Me(n),o=Re(s),r=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Wt(r)),[r,Wt(r)]}function ii(n){let t=Wt(n);return[re(n),t,re(t)]}function re(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var Ze=["left","right"],ti=["right","left"],rn=["top","bottom"],an=["bottom","top"];function ln(n,t,e){switch(n){case"top":case"bottom":return e?t?ti:Ze:t?Ze:ti;case"left":case"right":return t?rn:an;default:return[]}}function ni(n,t,e,i){let s=Yt(n),o=ln(Ot(n),e==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(re)))),o}function Wt(n){let t=Ot(n);return on[t]+n.slice(t.length)}function cn(n){return{top:0,right:0,bottom:0,left:0,...n}}function si(n){return typeof n!="number"?cn(n):{top:n,right:n,bottom:n,left:n}}function At(n){let{x:t,y:e,width:i,height:s}=n;return{width:i,height:s,top:e,left:t,right:t+i,bottom:e+s,x:t,y:e}}function oi(n,t,e){let{reference:i,floating:s}=n,o=mt(t),r=Me(t),a=Re(r),l=Ot(t),c=o==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,p=i[a]/2-s[a]/2,f;switch(l){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-s.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Yt(t)){case"start":f[r]-=p*(e&&c?-1:1);break;case"end":f[r]+=p*(e&&c?-1:1);break}return f}async function ri(n,t){var e;t===void 0&&(t={});let{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=Xt(t,n),m=si(f),S=a[p?u==="floating"?"reference":"floating":u],O=At(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(S)))==null||e?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=u==="floating"?{x:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},M=At(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(O.top-M.top+m.top)/A.y,bottom:(M.bottom-O.bottom+m.bottom)/A.y,left:(O.left-M.left+m.left)/A.x,right:(M.right-O.right+m.right)/A.x}}var un=50,ai=async(n,t,e)=>{let{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ri},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:u}=oi(c,i,l),p=i,f=0,m={};for(let g=0;g<o.length;g++){let S=o[g];if(!S)continue;let{name:O,fn:w}=S,{x,y:A,data:M,reset:C}=await w({x:h,y:u,initialPlacement:i,placement:p,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:n,floating:t}});h=x??h,u=A??u,m[O]={...m[O],...M},C&&f<un&&(f++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:n,floating:t,strategy:s}):C.rects),{x:h,y:u}=oi(c,p,l)),g=-1)}return{x:h,y:u,placement:p,strategy:s,middlewareData:m}};var li=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...S}=Xt(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let O=Ot(s),w=mt(a),x=Ot(a)===a,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),M=p||(x||!g?[Wt(a)]:ii(a)),C=m!=="none";!p&&C&&M.push(...ni(a,g,m,A));let J=[a,...M],Q=await l.detectOverflow(t,S),I=[],V=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&I.push(Q[O]),u){let B=ei(s,r,A);I.push(Q[B[0]],Q[B[1]])}if(V=[...V,{placement:s,overflows:I}],!I.every(B=>B<=0)){var X,it;let B=(((X=o.flip)==null?void 0:X.index)||0)+1,Z=J[B];if(Z&&(!(u==="alignment"?w!==mt(Z):!1)||V.every(_=>mt(_.placement)===w?_.overflows[0]>0:!0)))return{data:{index:B,overflows:V},reset:{placement:Z}};let k=(it=V.filter($=>$.overflows[0]<=0).sort(($,_)=>$.overflows[1]-_.overflows[1])[0])==null?void 0:it.placement;if(!k)switch(f){case"bestFit":{var W;let $=(W=V.filter(_=>{if(C){let j=mt(_.placement);return j===w||j==="y"}return!0}).map(_=>[_.placement,_Line truncated
/*! Bundled license information: /*! Bundled license information:
sortablejs/modular/sortable.esm.js: sortablejs/modular/sortable.esm.js:
@@ -1 +1 @@
(()=>{function d(e,t=()=>{}){let i=!1;return function(){i?t.apply(this,arguments):(i=!0,e.apply(this,arguments))}}function c({notification:e}){return{isShown:!1,computedStyle:null,transitionDuration:null,transitionEasing:null,closeTimeout:null,durationTimeout:null,remainingDuration:null,durationStartedAt:null,isHovered:!1,isFocusedWithin:!1,isClosing:!1,focusOrigin:null,unsubscribeLivewireHook:null,transitionEffect:null,isDestroyed:!1,init(){this.computedStyle=window.getComputedStyle(this.$el),this.transitionDuration=parseFloat(this.computedStyle.transitionDuration)*1e3,this.transitionEasing=this.computedStyle.transitionTimingFunction,this.configureTransitions(),this.configureAnimations(),e.duration&&e.duration!=="persistent"&&(this.$root.classList.contains("fi-inline")?this.durationTimeout=setTimeout(()=>{if(!this.$el.matches(":hover")){this.close();return}this.$el.addEventListener("mouseleave",()=>this.close())},e.duration):(this.remainingDuration=e.duration,this.isHovered=this.$el.matches(":hover"),this.isFocusedWithin=this.$el.contains(document.activeElement),!this.isHovered&&!this.isFocusedWithin&&this.resumeDuration())),this.isShown=!0},pauseDuration(t){if(this.isClosing)return;let i=this.isHovered||this.isFocusedWithin;t==="hover"?this.isHovered=!0:this.isFocusedWithin=!0,!(i||!this.durationTimeout)&&(this.remainingDuration=Math.max(0,this.remainingDuration-(performance.now()-this.durationStartedAt)),clearTimeout(this.durationTimeout),this.durationTimeout=null,this.durationStartedAt=null)},resumeDuration(t=null){t==="hover"?this.isHovered=!1:t==="focus"&&(this.isFocusedWithin=!1),!(this.isClosing||this.isHovered||this.isFocusedWithin||this.remainingDuration===null||this.durationTimeout)&&(this.durationStartedAt=performance.now(),this.durationTimeout=setTimeout(()=>{this.durationTimeout=null,this.durationStartedAt=null,this.remainingDuration=0,this.close()},this.remainingDuration))},handleFocusIn(t){this.$el.contains(t.relatedTarget)||(this.focusOrigin=t.relatedTarget instanceof HTMLElement?t.relatedTarget:null),this.pauseDuration("focus")},handleFocusOut(t){this.$el.contains(t.relatedTarget)||this.resumeDuration("focus")},handleEscape(t){this.$el.contains(document.activeElement)&&(t.preventDefault(),t.stopImmediatePropagation(),this.dismiss())},configureTransitions(){let t=this.computedStyle.display,i=()=>{Alpine.mutateDom(()=>{this.$el.style.setProperty("display",t),this.$el.style.setProperty("visibility","visible")}),this.$el._x_isShown=!0},s=()=>{Alpine.mutateDom(()=>{this.$el._x_isShown?this.$el.style.setProperty("visibility","hidden"):this.$el.style.setProperty("display","none")})},o=d(n=>n?i():s(),n=>{this.$el._x_toggleAndCascadeWithTransitions(this.$el,n,i,s)});this.transitionEffect=Alpine.effect(()=>{this.isDestroyed||o(this.isShown)})},configureAnimations(){this.$el.classList.contains("fi-inline")||(this.unsubscribeLivewireHook=Livewire.hook("commit",({component:t,succeed:i})=>{t.snapshot.data.isFilamentNotificationsComponent&&requestAnimationFrame(()=>{if(this.isDestroyed)return;let s=()=>this.$el.getBoundingClientRect().top,o=s();i(()=>{this.isDestroyed||queueMicrotask(()=>queueMicrotask(()=>{if(this.isDestroyed||!this.isShown)return;this.$el.getAnimations().forEach(r=>r.finish());let n=s();o!==n&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches||this.$el.animate([{transform:`translateY(${o-n}px)`},{transform:"translateY(0px)"}],{duration:this.transitionDuration,easing:this.transitionEasing}))}))})})}))},close(t=!1){if(this.isClosing)return;this.isClosing=!0,clearTimeout(this.closeTimeout),clearTimeout(this.durationTimeout),this.durationTimeout=null,this.durationStartedAt=null;let i=()=>window.dispatchEvent(new CustomEvent("notificationClosed",{detail:{id:e.id}}));if(t===!0){this.isShown=!1,i();return}if(this.$root.classList.contains("fi-inline")){i();return}let s=this.$el.closest("[wire\\:id]");this.isShown=!1,this.closeTimeout=setTimeout(()=>{s&&!s.isConnected||i()},this.transitionDuration)},dismiss(){let t=this.focusOrigin;this.focusOrigin=null,this.$el.contains(document.activeElement)&&t instanceof HTMLElement&&t.isConnected&&!this.$el.contains(t)&&t.focus({preventScroll:!0}),this.close()},markAsRead(){window.dispatchEvent(new CustomEvent("markedNotificationAsRead",{detail:{id:e.id}}))},markAsUnread(){window.dispatchEvent(new CustomEvent("markedNotificationAsUnread",{detail:{id:e.id}}))},destroy(){this.isDestroyed=!0,clearTimeout(this.durationTimeout),this.durationTimeout=null,this.unsubscribeLivewireHook?.(),this.unsubscribeLivewireHook=null,Alpine.release(this.transitionEffect)}}}var a=class{constructor(){return this.id(crypto.randomUUID?.()??"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+t/4).toString(16))),this}id(t){return this._id=t,this}title(t){return this._title=t,this}body(t){return this._body=t,this}actions(t){return this._actions=t,this}status(t){return this._status=t,this}color(t){return this.Line truncated (()=>{function C(i,t=()=>{}){let e=!1;return function(){e?t.apply(this,arguments):(e=!0,i.apply(this,arguments))}}function g({notification:i}){return{isShown:!1,computedStyle:null,transitionDuration:null,transitionEasing:null,closeTimeout:null,durationTimeout:null,remainingDuration:null,durationStartedAt:null,isHovered:!1,isFocusedWithin:!1,isClosing:!1,focusOrigin:null,unsubscribeLivewireHook:null,transitionEffect:null,isDestroyed:!1,init(){this.$el.classList.contains("fi-inline")?this.isShown=!0:(this.computedStyle=window.getComputedStyle(this.$el),this.transitionDuration=parseFloat(this.computedStyle.transitionDuration)*1e3,this.transitionEasing=this.computedStyle.transitionTimingFunction),this.configureTransitions(),this.configureAnimations(),i.duration&&i.duration!=="persistent"&&(this.$root.classList.contains("fi-inline")?this.durationTimeout=setTimeout(()=>{if(!this.$el.matches(":hover")){this.close();return}this.$el.addEventListener("mouseleave",()=>this.close())},i.duration):(this.remainingDuration=i.duration,this.isHovered=this.$el.matches(":hover"),this.isFocusedWithin=this.$el.contains(document.activeElement),!this.isHovered&&!this.isFocusedWithin&&this.resumeDuration())),this.isShown=!0},pauseDuration(t){if(this.isClosing)return;let e=this.isHovered||this.isFocusedWithin;t==="hover"?this.isHovered=!0:this.isFocusedWithin=!0,!(e||!this.durationTimeout)&&(this.remainingDuration=Math.max(0,this.remainingDuration-(performance.now()-this.durationStartedAt)),clearTimeout(this.durationTimeout),this.durationTimeout=null,this.durationStartedAt=null)},resumeDuration(t=null){t==="hover"?this.isHovered=!1:t==="focus"&&(this.isFocusedWithin=!1),!(this.isClosing||this.isHovered||this.isFocusedWithin||this.remainingDuration===null||this.durationTimeout)&&(this.durationStartedAt=performance.now(),this.durationTimeout=setTimeout(()=>{this.durationTimeout=null,this.durationStartedAt=null,this.remainingDuration=0,this.close()},this.remainingDuration))},handleFocusIn(t){this.$el.contains(t.relatedTarget)||(this.focusOrigin=t.relatedTarget instanceof HTMLElement?t.relatedTarget:null),this.pauseDuration("focus")},handleFocusOut(t){this.$el.contains(t.relatedTarget)||this.resumeDuration("focus")},handleEscape(t){this.$el.contains(document.activeElement)&&(t.preventDefault(),t.stopImmediatePropagation(),this.dismiss())},configureTransitions(){if(this.$el.classList.contains("fi-inline")){let r=this.$el.style.getPropertyValue("display"),h=this.$el.style.getPropertyPriority("display");this.transitionEffect=Alpine.effect(()=>{if(this.isDestroyed)return;let u=this.isShown;Alpine.mutateDom(()=>{u?(this.$el.style.setProperty("display",r,h),this.$el.style.setProperty("visibility","visible")):this.$el.style.setProperty("display","none","important")}),this.$el._x_isShown=u});return}let t=this.computedStyle.display,e=()=>{Alpine.mutateDom(()=>{this.$el.style.setProperty("display",t),this.$el.style.setProperty("visibility","visible")}),this.$el._x_isShown=!0},s=()=>{Alpine.mutateDom(()=>{this.$el._x_isShown?this.$el.style.setProperty("visibility","hidden"):this.$el.style.setProperty("display","none")})},n=C(r=>r?e():s(),r=>{this.$el._x_toggleAndCascadeWithTransitions(this.$el,r,e,s)});this.transitionEffect=Alpine.effect(()=>{this.isDestroyed||n(this.isShown)})},configureAnimations(){this.$el.classList.contains("fi-inline")||(this.unsubscribeLivewireHook=Livewire.hook("commit",({component:t,succeed:e})=>{t.snapshot.data.isFilamentNotificationsComponent&&requestAnimationFrame(()=>{if(this.isDestroyed)return;let s=()=>this.$el.getBoundingClientRect().top,n=s();e(()=>{this.isDestroyed||queueMicrotask(()=>queueMicrotask(()=>{if(this.isDestroyed||!this.isShown)return;this.$el.getAnimations().forEach(h=>h.finish());let r=s();n!==r&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches||this.$el.animate([{transform:`translateY(${n-r}px)`},{transform:"translateY(0px)"}],{duration:this.transitionDuration,easing:this.transitionEasing}))}))})})}))},close(t=!1){if(this.isClosing)return;this.isClosing=!0,clearTimeout(this.closeTimeout),clearTimeout(this.durationTimeout),this.durationTimeout=null,this.durationStartedAt=null;let e=()=>window.dispatchEvent(new CustomEvent("notificationClosed",{detail:{id:i.id}}));if(t===!0){this.isShown=!1,e();return}if(this.$root.classList.contains("fi-inline")){e();return}let s=this.$el.closest("[wire\\:id]");this.isShown=!1,this.closeTimeout=setTimeout(()=>{s&&!s.isConnected||e()},this.transitionDuration)},dismiss(){let t=this.focusOrigin;this.focusOrigin=null,this.$el.contains(document.activeElement)&&t instanceof HTMLElement&&t.isConnected&&!this.$el.contains(t)&&t.focus({preventScroll:!0}),this.close()},markAsRead(){window.dispatchEvent(new CustomEvent("markedNotificationAsRead",{detail:{id:i.id}}))},markAsUnread(){window.dispatchEvent(new CustomEvent("markedNotificationAsUnread",{detail:{id:i.id}}))},destroy(){this.isDestroyed=!0,clearTimeout(this.durationTimeout),this.durationTimeout=null,this.uLine truncated
@@ -1 +1 @@
var _=Math.min,R=Math.max,nt=Math.round,ot=Math.floor,H=t=>({x:t,y:t}),ee={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,o){return R(t,_(e,o))}function X(t,e){return typeof t=="function"?t(e):t}function $(t){return t.split("-")[0]}function G(t){return t.split("-")[1]}function gt(t){return t==="x"?"y":"x"}function pt(t){return t==="y"?"height":"width"}function V(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function bt(t){return gt(V(t))}function Rt(t,e,o){o===void 0&&(o=!1);let n=G(t),r=bt(t),a=pt(r),c=r==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(c=it(c)),[c,it(c)]}function St(t){let e=it(t);return[lt(t),e,lt(e)]}function lt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var At=["left","right"],Et=["right","left"],ie=["top","bottom"],ne=["bottom","top"];function oe(t,e,o){switch(t){case"top":case"bottom":return o?e?Et:At:e?At:Et;case"left":case"right":return e?ie:ne;default:return[]}}function Ft(t,e,o,n){let r=G(t),a=oe($(t),o==="start",n);return r&&(a=a.map(c=>c+"-"+r),e&&(a=a.concat(a.map(lt)))),a}function it(t){let e=$(t);return ee[e]+t.slice(e.length)}function se(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ct(t){return typeof t!="number"?se(t):{top:t,right:t,bottom:t,left:t}}function I(t){let{x:e,y:o,width:n,height:r}=t;return{width:n,height:r,top:o,left:e,right:e+n,bottom:o+r,x:e,y:o}}function Lt(t,e,o){let{reference:n,floating:r}=t,a=V(e),c=bt(e),f=pt(c),m=$(e),g=a==="y",h=n.x+n.width/2-r.width/2,i=n.y+n.height/2-r.height/2,l=n[f]/2-r[f]/2,s;switch(m){case"top":s={x:h,y:n.y-r.height};break;case"bottom":s={x:h,y:n.y+n.height};break;case"right":s={x:n.x+n.width,y:i};break;case"left":s={x:n.x-r.width,y:i};break;default:s={x:n.x,y:n.y}}switch(G(e)){case"start":s[c]-=l*(o&&g?-1:1);break;case"end":s[c]+=l*(o&&g?-1:1);break}return s}async function Pt(t,e){var o;e===void 0&&(e={});let{x:n,y:r,platform:a,rects:c,elements:f,strategy:m}=t,{boundary:g="clippingAncestors",rootBoundary:h="viewport",elementContext:i="floating",altBoundary:l=!1,padding:s=0}=X(e,t),u=Ct(s),y=f[l?i==="floating"?"reference":"floating":i],p=I(await a.getClippingRect({element:(o=await(a.isElement==null?void 0:a.isElement(y)))==null||o?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(f.floating)),boundary:g,rootBoundary:h,strategy:m})),v=i==="floating"?{x:n,y:r,width:c.floating.width,height:c.floating.height}:c.reference,d=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f.floating)),w=await(a.isElement==null?void 0:a.isElement(d))?await(a.getScale==null?void 0:a.getScale(d))||{x:1,y:1}:{x:1,y:1},O=I(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:v,offsetParent:d,strategy:m}):v);return{top:(p.top-O.top+u.top)/w.y,bottom:(O.bottom-p.bottom+u.bottom)/w.y,left:(p.left-O.left+u.left)/w.x,right:(O.right-p.right+u.right)/w.x}}var re=50,Dt=async(t,e,o)=>{let{placement:n="bottom",strategy:r="absolute",middleware:a=[],platform:c}=o,f=c.detectOverflow?c:{...c,detectOverflow:Pt},m=await(c.isRTL==null?void 0:c.isRTL(e)),g=await c.getElementRects({reference:t,floating:e,strategy:r}),{x:h,y:i}=Lt(g,n,m),l=n,s=0,u={};for(let b=0;b<a.length;b++){let y=a[b];if(!y)continue;let{name:p,fn:v}=y,{x:d,y:w,data:O,reset:T}=await v({x:h,y:i,initialPlacement:n,placement:l,strategy:r,middlewareData:u,rects:g,platform:f,elements:{reference:t,floating:e}});h=d??h,i=w??i,u[p]={...u[p],...O},T&&s<re&&(s++,typeof T=="object"&&(T.placement&&(l=T.placement),T.rects&&(g=T.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:r}):T.rects),{x:h,y:i}=Lt(g,l,m)),b=-1)}return{x:h,y:i,placement:l,strategy:r,middlewareData:u}};var Mt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;let{placement:r,middlewareData:a,rects:c,initialPlacement:f,platform:m,elements:g}=e,{mainAxis:h=!0,crossAxis:i=!0,fallbackPlacements:l,fallbackStrategy:s="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:b=!0,...y}=X(t,e);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let p=$(r),v=V(f),d=$(f)===f,w=await(m.isRTL==null?void 0:m.isRTL(g.floating)),O=l||(d||!b?[it(f)]:St(f)),T=u!=="none";!l&&T&&O.push(...Ft(f,b,u,w));let x=[f,...O],S=await m.detectOverflow(e,y),A=[],E=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&A.push(S[p]),i){let K=Rt(r,c,w);A.push(S[K[0]],S[K[1]])}if(E=[...E,{placement:r,overflows:A}],!A.every(K=>K<=0)){var C,L;let K=(((C=a.flip)==null?void 0:C.index)||0)+1,ht=x[K];if(ht&&(!(i==="alignment"?v!==V(ht):!1)||E.every(M=>V(M.placement)===v?M.overflows[0]>0:!0)))return{data:{index:K,overflows:E},reset:{placement:ht}};let et=(L=E.filter(z=>z.overflows[0]<=0).sort((z,M)=>z.overflows[1]-M.overflows[1])[0])==null?void 0:L.placement;if(!et)switch(s){case"bestFit":{var tt;let z=(tt=E.filter(M=>{if(T){let N=V(M.placement);return N===v||N==="y"}return!0}).map(M=>[M.placement,M.overflows.Line truncated var _=Math.min,R=Math.max,nt=Math.round,ot=Math.floor,H=t=>({x:t,y:t}),ee={left:"right",right:"left",bottom:"top",top:"bottom"};function mt(t,e,o){return R(t,_(e,o))}function X(t,e){return typeof t=="function"?t(e):t}function $(t){return t.split("-")[0]}function G(t){return t.split("-")[1]}function gt(t){return t==="x"?"y":"x"}function pt(t){return t==="y"?"height":"width"}function V(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function bt(t){return gt(V(t))}function Rt(t,e,o){o===void 0&&(o=!1);let n=G(t),r=bt(t),a=pt(r),c=r==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(c=it(c)),[c,it(c)]}function St(t){let e=it(t);return[lt(t),e,lt(e)]}function lt(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var At=["left","right"],Et=["right","left"],ie=["top","bottom"],ne=["bottom","top"];function oe(t,e,o){switch(t){case"top":case"bottom":return o?e?Et:At:e?At:Et;case"left":case"right":return e?ie:ne;default:return[]}}function Ft(t,e,o,n){let r=G(t),a=oe($(t),o==="start",n);return r&&(a=a.map(c=>c+"-"+r),e&&(a=a.concat(a.map(lt)))),a}function it(t){let e=$(t);return ee[e]+t.slice(e.length)}function se(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ct(t){return typeof t!="number"?se(t):{top:t,right:t,bottom:t,left:t}}function I(t){let{x:e,y:o,width:n,height:r}=t;return{width:n,height:r,top:o,left:e,right:e+n,bottom:o+r,x:e,y:o}}function Lt(t,e,o){let{reference:n,floating:r}=t,a=V(e),c=bt(e),f=pt(c),m=$(e),g=a==="y",h=n.x+n.width/2-r.width/2,i=n.y+n.height/2-r.height/2,l=n[f]/2-r[f]/2,s;switch(m){case"top":s={x:h,y:n.y-r.height};break;case"bottom":s={x:h,y:n.y+n.height};break;case"right":s={x:n.x+n.width,y:i};break;case"left":s={x:n.x-r.width,y:i};break;default:s={x:n.x,y:n.y}}switch(G(e)){case"start":s[c]-=l*(o&&g?-1:1);break;case"end":s[c]+=l*(o&&g?-1:1);break}return s}async function Pt(t,e){var o;e===void 0&&(e={});let{x:n,y:r,platform:a,rects:c,elements:f,strategy:m}=t,{boundary:g="clippingAncestors",rootBoundary:h="viewport",elementContext:i="floating",altBoundary:l=!1,padding:s=0}=X(e,t),u=Ct(s),y=f[l?i==="floating"?"reference":"floating":i],p=I(await a.getClippingRect({element:(o=await(a.isElement==null?void 0:a.isElement(y)))==null||o?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(f.floating)),boundary:g,rootBoundary:h,strategy:m})),v=i==="floating"?{x:n,y:r,width:c.floating.width,height:c.floating.height}:c.reference,d=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f.floating)),w=await(a.isElement==null?void 0:a.isElement(d))?await(a.getScale==null?void 0:a.getScale(d))||{x:1,y:1}:{x:1,y:1},O=I(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:v,offsetParent:d,strategy:m}):v);return{top:(p.top-O.top+u.top)/w.y,bottom:(O.bottom-p.bottom+u.bottom)/w.y,left:(p.left-O.left+u.left)/w.x,right:(O.right-p.right+u.right)/w.x}}var re=50,Dt=async(t,e,o)=>{let{placement:n="bottom",strategy:r="absolute",middleware:a=[],platform:c}=o,f=c.detectOverflow?c:{...c,detectOverflow:Pt},m=await(c.isRTL==null?void 0:c.isRTL(e)),g=await c.getElementRects({reference:t,floating:e,strategy:r}),{x:h,y:i}=Lt(g,n,m),l=n,s=0,u={};for(let b=0;b<a.length;b++){let y=a[b];if(!y)continue;let{name:p,fn:v}=y,{x:d,y:w,data:O,reset:T}=await v({x:h,y:i,initialPlacement:n,placement:l,strategy:r,middlewareData:u,rects:g,platform:f,elements:{reference:t,floating:e}});h=d??h,i=w??i,u[p]={...u[p],...O},T&&s<re&&(s++,typeof T=="object"&&(T.placement&&(l=T.placement),T.rects&&(g=T.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:r}):T.rects),{x:h,y:i}=Lt(g,l,m)),b=-1)}return{x:h,y:i,placement:l,strategy:r,middlewareData:u}};var Mt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;let{placement:r,middlewareData:a,rects:c,initialPlacement:f,platform:m,elements:g}=e,{mainAxis:h=!0,crossAxis:i=!0,fallbackPlacements:l,fallbackStrategy:s="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:b=!0,...y}=X(t,e);if((o=a.arrow)!=null&&o.alignmentOffset)return{};let p=$(r),v=V(f),d=$(f)===f,w=await(m.isRTL==null?void 0:m.isRTL(g.floating)),O=l||(d||!b?[it(f)]:St(f)),T=u!=="none";!l&&T&&O.push(...Ft(f,b,u,w));let x=[f,...O],S=await m.detectOverflow(e,y),A=[],E=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&A.push(S[p]),i){let K=Rt(r,c,w);A.push(S[K[0]],S[K[1]])}if(E=[...E,{placement:r,overflows:A}],!A.every(K=>K<=0)){var C,L;let K=(((C=a.flip)==null?void 0:C.index)||0)+1,ht=x[K];if(ht&&(!(i==="alignment"?v!==V(ht):!1)||E.every(M=>V(M.placement)===v?M.overflows[0]>0:!0)))return{data:{index:K,overflows:E},reset:{placement:ht}};let et=(L=E.filter(z=>z.overflows[0]<=0).sort((z,M)=>z.overflows[1]-M.overflows[1])[0])==null?void 0:L.placement;if(!et)switch(s){case"bestFit":{var tt;let z=(tt=E.filter(M=>{if(T){let N=V(M.placement);return N===v||N==="y"}return!0}).map(M=>[M.placement,M.overflows.Line truncated
@@ -1 +1 @@
function d({isSkippable:n,isStepPersistedInQueryString:i,key:h,livewireId:l,schemaKey:c,startStep:r,stepQueryStringKey:o}){return{boundResetHandler:null,step:null,init(){let t=this.getSteps(),e=new URLSearchParams(window.location.search).get(o);this.step=i&&t.includes(e)?e:t.at(r-1),this.$watch("step",()=>{this.updateQueryString(),this.autofocusFields()}),this.autofocusFields(!0),this.boundResetHandler=s=>{s.detail.livewireId!==l||s.detail.schemaKey!==c||i||this.$nextTick(()=>{this.step=this.getSteps().at(r-1)??this.step})},window.addEventListener("reset-schema-component-state",this.boundResetHandler)},async requestNextStep(){await this.$wire.callSchemaComponentMethod(h,"nextStep",{currentStepIndex:this.getStepIndex(this.step),currentStepKey:this.step})},goToNextStep(t=null,e=null){if(!(e!==null&&this.step!==e)){if(t===null){let s=this.getStepIndex(this.step);if(s===-1)return;t=this.getSteps()[s+1]}this.getSteps().includes(t)&&(this.step=t,this.scroll())}},goToPreviousStep(){let t=this.getStepIndex(this.step)-1;t<0||(this.step=this.getSteps()[t],this.scroll())},goToStep(t){let e=this.getStepIndex(t);e<=-1||!n&&e>this.getStepIndex(this.step)||(this.step=t,this.scroll())},scroll(){this.$nextTick(()=>{this.$refs.header?.children[this.getStepIndex(this.step)].scrollIntoView({behavior:"smooth",block:"start"})})},autofocusFields(t=!1){this.$nextTick(()=>{if(t&&document.activeElement&&document.activeElement!==document.body&&this.$el.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_PRECEDING)return;let e=this.$refs[`step-${this.step}`]?.querySelectorAll("[autofocus]")??[];for(let s of e)if(s.focus(),document.activeElement===s)break})},getStepIndex(t){return this.getSteps().findIndex(e=>e===t)},getSteps(){return JSON.parse(this.$refs.stepsData.value)},isFirstStep(){return this.getStepIndex(this.step)<=0},isLastStep(){return this.getStepIndex(this.step)+1>=this.getSteps().length},isStepAccessible(t){return this.getStepIndex(t)!==-1&&(n||this.getStepIndex(this.step)>this.getStepIndex(t))},updateQueryString(){if(!i)return;let t=new URL(window.location.href);t.searchParams.set(o,this.step),history.replaceState(null,document.title,t.toString())},destroy(){this.boundResetHandler&&window.removeEventListener("reset-schema-component-state",this.boundResetHandler)}}}export{d as default}; function u({isSkippable:r,isStepPersistedInQueryString:n,livewireId:d,schemaKey:c,startStep:o,stepQueryStringKey:h}){let l;return{boundResetHandler:null,step:null,init(){l=this.$nextStep;let t=this.getSteps(),e=new URLSearchParams(window.location.search).get(h);this.step=n&&t.includes(e)?e:t.at(o-1),this.$watch("step",()=>{this.updateQueryString(),this.autofocusFields()}),this.autofocusFields(!0),this.boundResetHandler=s=>{s.detail.livewireId!==d||s.detail.schemaKey!==c||n||this.$nextTick(()=>{this.step=this.getSteps().at(o-1)??this.step})},window.addEventListener("reset-schema-component-state",this.boundResetHandler)},async requestNextStep(){await l({currentStepIndex:this.getStepIndex(this.step),currentStepKey:this.step})},goToNextStep(t=null,e=null){if(!(e!==null&&this.step!==e)){if(t===null){let s=this.getStepIndex(this.step);if(s===-1)return;t=this.getSteps()[s+1]}this.getSteps().includes(t)&&(this.step=t,this.scroll())}},goToPreviousStep(){let t=this.getStepIndex(this.step)-1;t<0||(this.step=this.getSteps()[t],this.scroll())},goToStep(t){let e=this.getStepIndex(t);e<=-1||!r&&e>this.getStepIndex(this.step)||(this.step=t,this.scroll())},scroll(){this.$nextTick(()=>{this.$refs.header?.children[this.getStepIndex(this.step)].scrollIntoView({behavior:"smooth",block:"start"})})},autofocusFields(t=!1){this.$nextTick(()=>{let e=this.$el.closest(".fi-sc-wizard");if(t&&document.activeElement&&document.activeElement!==document.body&&e.compareDocumentPosition(document.activeElement)&Node.DOCUMENT_POSITION_PRECEDING)return;let s=Array.from(e.children).find(i=>i.getAttribute("x-ref")===`step-${this.step}`)?.querySelectorAll("[autofocus]")??[];for(let i of s)if(i.focus(),document.activeElement===i)break})},getStepIndex(t){return this.getSteps().findIndex(e=>e===t)},getSteps(){return JSON.parse(this.$refs.stepsData.value)},isFirstStep(){return this.getStepIndex(this.step)<=0},isLastStep(){return this.getStepIndex(this.step)+1>=this.getSteps().length},isStepAccessible(t){return this.getStepIndex(t)!==-1&&(r||this.getStepIndex(this.step)>this.getStepIndex(t))},updateQueryString(){if(!n)return;let t=new URL(window.location.href);t.searchParams.set(h,this.step),history.replaceState(null,document.title,t.toString())},destroy(){this.boundResetHandler&&window.removeEventListener("reset-schema-component-state",this.boundResetHandler)}}}export{u as default};
+1 -1
View File
@@ -1 +1 @@
(()=>{var f=()=>({isSticky:!1,width:0,resizeObserver:null,boundUpdateWidth:null,init(){let i=this.$el.parentElement;i&&(this.updateWidth(),this.resizeObserver=new ResizeObserver(()=>this.updateWidth()),this.resizeObserver.observe(i),this.boundUpdateWidth=this.updateWidth.bind(this),window.addEventListener("resize",this.boundUpdateWidth))},enableSticky(){this.isSticky=this.$el.getBoundingClientRect().top>0},disableSticky(){this.isSticky=!1},updateWidth(){let i=this.$el.parentElement;if(!i)return;let e=getComputedStyle(this.$root.querySelector(".fi-ac"));this.width=i.offsetWidth+parseInt(e.marginInlineStart,10)*-1+parseInt(e.marginInlineEnd,10)*-1},destroy(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.boundUpdateWidth&&(window.removeEventListener("resize",this.boundUpdateWidth),this.boundUpdateWidth=null)}});var h=function(i,e,n){let t=i;if(e.startsWith("/")&&(n=!0,e=e.slice(1)),n)return e;for(;e.startsWith("../");)t=t.includes(".")?t.slice(0,t.lastIndexOf(".")):null,e=e.slice(3);return["",null,void 0].includes(t)?e:["",null,void 0].includes(e)?t:`${t}.${e}`},p=i=>{let e=Alpine.findClosest(i,n=>n.__livewire);if(!e)throw"Could not find Livewire component in DOM tree.";return e.__livewire},l=!1;document.addEventListener("invalid",i=>{let e=i.target;if(!e.closest("[data-field-wrapper]")||e.offsetParent!==null&&getComputedStyle(e).visibility!=="hidden"||(i.preventDefault(),l)||Array.from(e.form?.elements??[]).some(t=>t.willValidate&&!t.validity.valid&&t.offsetParent!==null&&getComputedStyle(t).visibility!=="hidden"))return;l=!0;let n=e;for(;n;)n.dispatchEvent(new CustomEvent("expand")),n=n.parentNode;requestAnimationFrame(()=>requestAnimationFrame(()=>{e.form?.reportValidity(),setTimeout(()=>l=!1,100)}))},!0);document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentSchema",({livewireId:i,schemaKey:e,isLoadingDeferred:n=!1})=>({intersectionObserver:null,isLoadingDeferredSchema:!1,init(){n&&(this.intersectionObserver=new IntersectionObserver(async t=>{if(!(!t[0]?.isIntersecting||this.isLoadingDeferredSchema)){this.isLoadingDeferredSchema=!0;try{await this.$wire.loadDeferredSchema(e),this.intersectionObserver?.disconnect()}catch{}finally{this.isLoadingDeferredSchema=!1}}}),this.intersectionObserver.observe(this.$el))},handleFormValidationError(t){t.detail.livewireId===i&&this.$nextTick(()=>{let r=this.$el.querySelector("[data-validation-error]");if(!r)return;let s=r;for(;s;)s.dispatchEvent(new CustomEvent("expand")),s=s.parentNode;setTimeout(()=>{r.isConnected&&r.closest("[data-field-wrapper]")?.scrollIntoView({behavior:"smooth",block:"start",inline:"start"})},200)})},handleClientSideStateReset(t){t.detail.livewireId!==i||t.detail.schemaKey!==e||this.$nextTick(()=>{let r=this.$el.querySelectorAll("[autofocus]");for(let s of r)if(s.offsetParent!==null&&(s.focus(),document.activeElement===s))break})},isStateChanged(t,r){if(t===void 0)return!1;try{return JSON.stringify(t)!==JSON.stringify(r)}catch{return t!==r}},destroy(){this.intersectionObserver?.disconnect()}})),window.Alpine.data("filamentSchemaComponent",({path:i,containerPath:e,$wire:n})=>({$statePath:i,$get:(t,r)=>n.$get(h(e,t,r)),$set:(t,r,s,o=!1)=>n.$set(h(e,t,s),r,o),get $state(){return n.$get(i)}})),window.Alpine.data("filamentActionsSchemaComponent",f),Livewire.hook("commit",({component:i,commit:e,respond:n,succeed:t,fail:r})=>{t(({snapshot:s,effects:o})=>{i.el.isConnected&&o.dispatches?.forEach(a=>{if(!a.params?.awaitSchemaComponent)return;let d=Array.from(i.el.querySelectorAll(`[wire\\:partial="schema-component::${a.params.awaitSchemaComponent}"]`)).filter(m=>p(m)===i);if(d.length===1)return;if(d.length>1)throw`Multiple schema components found with key [${a.params.awaitSchemaComponent}].`;let u=`schema-component-${i.id}-${a.params.awaitSchemaComponent}-loaded`,c=()=>{window.dispatchEvent(new CustomEvent(a.name,{detail:a.params}))};window.addEventListener(u,c,{once:!0}),i.addCleanup(()=>window.removeEventListener(u,c))})})})});})(); (()=>{var f=()=>({isSticky:!1,width:0,resizeObserver:null,boundUpdateWidth:null,init(){let i=this.$el.parentElement;i&&(this.updateWidth(),this.resizeObserver=new ResizeObserver(()=>this.updateWidth()),this.resizeObserver.observe(i),this.boundUpdateWidth=this.updateWidth.bind(this),window.addEventListener("resize",this.boundUpdateWidth))},enableSticky(){this.isSticky=this.$el.getBoundingClientRect().top>0},disableSticky(){this.isSticky=!1},updateWidth(){let i=this.$el.parentElement;if(!i)return;let e=getComputedStyle(this.$root.querySelector(".fi-ac"));this.width=i.offsetWidth+parseInt(e.marginInlineStart,10)*-1+parseInt(e.marginInlineEnd,10)*-1},destroy(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.boundUpdateWidth&&(window.removeEventListener("resize",this.boundUpdateWidth),this.boundUpdateWidth=null)}});var m=function(i,e,r){let t=i;if(e.startsWith("/")&&(r=!0,e=e.slice(1)),r)return e;for(;e.startsWith("../");)t=t.includes(".")?t.slice(0,t.lastIndexOf(".")):null,e=e.slice(3);return["",null,void 0].includes(t)?e:["",null,void 0].includes(e)?t:`${t}.${e}`},$=new Set(["$el","$refs","$store","$watch","$dispatch","$nextTick","$root","$data","$id","$event","$focus","$persist","$tooltip","$js","$anchor","$queryString","$wire","$get","$set","$state","$statePath","$callSchemaComponentMethod","$schemaComponentMethods"]);function h({key:i,exposedMethods:e=[],path:r,containerPath:t}){let s=this.$wire,o=(n,a={})=>s.callSchemaComponentMethod(i,n,a),l=Object.fromEntries(e.filter(n=>!$.has(`$${n}`)).map(n=>[`$${n}`,(a={})=>o(n,a)]));return{...l,$schemaComponentMethods:l,$callSchemaComponentMethod:o,$statePath:r,$get:(n,a)=>s.$get(m(t,n,a)),$set:(n,a,d,c=!1)=>s.$set(m(t,n,d),a,c),get $state(){return s.$get(r)}}}var w=i=>{let e=Alpine.findClosest(i,r=>r.__livewire);if(!e)throw"Could not find Livewire component in DOM tree.";return e.__livewire},u=!1;document.addEventListener("invalid",i=>{let e=i.target;if(!e.closest("[data-field-wrapper]")||e.offsetParent!==null&&getComputedStyle(e).visibility!=="hidden"||(i.preventDefault(),u)||Array.from(e.form?.elements??[]).some(t=>t.willValidate&&!t.validity.valid&&t.offsetParent!==null&&getComputedStyle(t).visibility!=="hidden"))return;u=!0;let r=e;for(;r;)r.dispatchEvent(new CustomEvent("expand")),r=r.parentNode;requestAnimationFrame(()=>requestAnimationFrame(()=>{e.form?.reportValidity(),setTimeout(()=>u=!1,100)}))},!0);document.addEventListener("alpine:init",()=>{window.Alpine.data("filamentSchema",({livewireId:i,schemaKey:e,isLoadingDeferred:r=!1})=>({intersectionObserver:null,isLoadingDeferredSchema:!1,init(){r&&(this.intersectionObserver=new IntersectionObserver(async t=>{if(!(!t[0]?.isIntersecting||this.isLoadingDeferredSchema)){this.isLoadingDeferredSchema=!0;try{await this.$wire.loadDeferredSchema(e),this.intersectionObserver?.disconnect()}catch{}finally{this.isLoadingDeferredSchema=!1}}}),this.intersectionObserver.observe(this.$el))},handleFormValidationError(t){t.detail.livewireId===i&&this.$nextTick(()=>{let s=this.$el.querySelector("[data-validation-error]");if(!s)return;let o=s;for(;o;)o.dispatchEvent(new CustomEvent("expand")),o=o.parentNode;setTimeout(()=>{s.isConnected&&s.closest("[data-field-wrapper]")?.scrollIntoView({behavior:"smooth",block:"start",inline:"start"})},200)})},handleClientSideStateReset(t){t.detail.livewireId!==i||t.detail.schemaKey!==e||this.$nextTick(()=>{let s=this.$el.querySelectorAll("[autofocus]");for(let o of s)if(o.offsetParent!==null&&(o.focus(),document.activeElement===o))break})},isStateChanged(t,s){if(t===void 0)return!1;try{return JSON.stringify(t)!==JSON.stringify(s)}catch{return t!==s}},destroy(){this.intersectionObserver?.disconnect()}})),window.Alpine.data("filamentSchemaComponent",h),window.Alpine.data("filamentActionsSchemaComponent",f),Livewire.hook("commit",({component:i,commit:e,respond:r,succeed:t,fail:s})=>{t(({snapshot:o,effects:l})=>{i.el.isConnected&&l.dispatches?.forEach(n=>{if(!n.params?.awaitSchemaComponent)return;let a=Array.from(i.el.querySelectorAll(`[wire\\:partial="schema-component::${n.params.awaitSchemaComponent}"]`)).filter(p=>w(p)===i);if(a.length===1)return;if(a.length>1)throw`Multiple schema components found with key [${n.params.awaitSchemaComponent}].`;let d=`schema-component-${i.id}-${n.params.awaitSchemaComponent}-loaded`,c=()=>{window.dispatchEvent(new CustomEvent(n.name,{detail:n.params}))};window.addEventListener(d,c,{once:!0}),i.addCleanup(()=>window.removeEventListener(d,c))})})})});})();
+6 -6
View File
@@ -1,28 +1,28 @@
(()=>{var al=Object.create;var ta=Object.defineProperty;var sl=Object.getOwnPropertyDescriptor;var ll=Object.getOwnPropertyNames;var ul=Object.getPrototypeOf,cl=Object.prototype.hasOwnProperty;var Zi=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var fl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ll(e))!cl.call(t,i)&&i!==r&&ta(t,i,{get:()=>e[i],enumerable:!(n=sl(e,i))||n.enumerable});return t};var pl=(t,e,r)=>(r=t!=null?al(ul(t)):{},fl(e||!t||!t.__esModule?ta(r,"default",{value:t,enumerable:!0}):r,t));var Na=Zi(()=>{});var ja=Zi(()=>{});var Ba=Zi((af,Si)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var a=!n.JS_MD5_NO_COMMON_JS&&typeof Si=="object"&&Si.exports,l=typeof define=="function"&&define.amd,s=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],g=[0,8,16,24],O=["hex","array","digest","buffer","arrayBuffer","base64"],y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),E=[],D;if(s){var T=new ArrayBuffer(68);D=new Uint8Array(T),E=new Uint32Array(T)}var N=Array.isArray;(n.JS_MD5_NO_NODE_JS||!N)&&(N=function(c){return Object.prototype.toString.call(c)==="[object Array]"});var S=ArrayBuffer.isView;s&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!S)&&(S=function(c){return typeof c=="object"&&c.buffer&&c.buffer.constructor===ArrayBuffer});var j=function(c){var d=typeof c;if(d==="string")return[c,!0];if(d!=="object"||c===null)throw new Error(t);if(s&&c.constructor===ArrayBuffer)return[new Uint8Array(c),!1];if(!N(c)&&!S(c))throw new Error(t);return[c,!1]},b=function(c){return function(d){return new H(!0).update(d)[c]()}},U=function(){var c=b("hex");o&&(c=k(c)),c.create=function(){return new H},c.update=function(m){return c.create().update(m)};for(var d=0;d<O.length;++d){var v=O[d];c[v]=b(v)}return c},k=function(c){var d=Na(),v=ja().Buffer,m;v.from&&!n.JS_MD5_NO_BUFFER_FROM?m=v.from:m=function(P){return new v(P)};var B=function(P){if(typeof P=="string")return d.createHash("md5").update(P,"utf8").digest("hex");if(P==null)throw new Error(t);return P.constructor===ArrayBuffer&&(P=new Uint8Array(P)),N(P)||S(P)||P.constructor===v?d.createHash("md5").update(m(P)).digest("hex"):c(P)};return B},$=function(c){return function(d,v){return new X(d,!0).update(v)[c]()}},ee=function(){var c=$("hex");c.create=function(m){return new X(m)},c.update=function(m,B){return c.create(m).update(B)};for(var d=0;d<O.length;++d){var v=O[d];c[v]=$(v)}return c};function H(c){if(c)E[0]=E[16]=E[1]=E[2]=E[3]=E[4]=E[5]=E[6]=E[7]=E[8]=E[9]=E[10]=E[11]=E[12]=E[13]=E[14]=E[15]=0,this.blocks=E,this.buffer8=D;else if(s){var d=new ArrayBuffer(68);this.buffer8=new Uint8Array(d),this.blocks=new Uint32Array(d)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}H.prototype.update=function(c){if(this.finalized)throw new Error(e);var d=j(c);c=d[0];for(var v=d[1],m,B=0,P,I=c.length,Q=this.blocks,Me=this.buffer8;B<I;){if(this.hashed&&(this.hashed=!1,Q[0]=Q[16],Q[16]=Q[1]=Q[2]=Q[3]=Q[4]=Q[5]=Q[6]=Q[7]=Q[8]=Q[9]=Q[10]=Q[11]=Q[12]=Q[13]=Q[14]=Q[15]=0),v)if(s)for(P=this.start;B<I&&P<64;++B)m=c.charCodeAt(B),m<128?Me[P++]=m:m<2048?(Me[P++]=192|m>>>6,Me[P++]=128|m&63):m<55296||m>=57344?(Me[P++]=224|m>>>12,Me[P++]=128|m>>>6&63,Me[P++]=128|m&63):(m=65536+((m&1023)<<10|c.charCodeAt(++B)&1023),Me[P++]=240|m>>>18,Me[P++]=128|m>>>12&63,Me[P++]=128|m>>>6&63,Me[P++]=128|m&63);else for(P=this.start;B<I&&P<64;++B)m=c.charCodeAt(B),m<128?Q[P>>>2]|=m<<g[P++&3]:m<2048?(Q[P>>>2]|=(192|m>>>6)<<g[P++&3],Q[P>>>2]|=(128|m&63)<<g[P++&3]):m<55296||m>=57344?(Q[P>>>2]|=(224|m>>>12)<<g[P++&3],Q[P>>>2]|=(128|m>>>6&63)<<g[P++&3],Q[P>>>2]|=(128|m&63)<<g[P++&3]):(m=65536+((m&1023)<<10|c.charCodeAt(++B)&1023),Q[P>>>2]|=(240|m>>>18)<<g[P++&3],Q[P>>>2]|=(128|m>>>12&63)<<g[P++&3],Q[P>>>2]|=(128|m>>>6&63)<<g[P++&3],Q[P>>>2]|=(128|m&63)<<g[P++&3]);else if(s)for(P=this.start;B<I&&P<64;++B)Me[P++]=c[B];else for(P=this.start;B<I&&P<64;++B)Q[P>>>2]|=c[B]<<g[P++&3];this.lastByteIndex=P,this.bytes+=P-this.start,P>=64?(this.start=P-64,this.hash(),this.hashed=!0):this.start=P}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},H.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var c=this.blocks,d=this.lastByteIndex;c[d>>>2]|=p[d&3],d>=56&&(this.hashed||this.hash(),c[0]=c[16],c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),c[14]=this.bytes<<3,c[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},H.prototype.hash=function(){var c,d,v,m,B,P,I=this.blocks;this.first?(c=I[0]-680876937,c=(cLine truncated (()=>{var al=Object.create;var ta=Object.defineProperty;var sl=Object.getOwnPropertyDescriptor;var ll=Object.getOwnPropertyNames;var ul=Object.getPrototypeOf,cl=Object.prototype.hasOwnProperty;var Zi=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var fl=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ll(e))!cl.call(t,i)&&i!==r&&ta(t,i,{get:()=>e[i],enumerable:!(n=sl(e,i))||n.enumerable});return t};var pl=(t,e,r)=>(r=t!=null?al(ul(t)):{},fl(e||!t||!t.__esModule?ta(r,"default",{value:t,enumerable:!0}):r,t));var Na=Zi(()=>{});var ja=Zi(()=>{});var Ba=Zi((af,Si)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_MD5_NO_WINDOW&&(r=!1);var i=!r&&typeof self=="object",o=!n.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?n=global:i&&(n=self);var a=!n.JS_MD5_NO_COMMON_JS&&typeof Si=="object"&&Si.exports,l=typeof define=="function"&&define.amd,s=!n.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],g=[0,8,16,24],O=["hex","array","digest","buffer","arrayBuffer","base64"],y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),E=[],D;if(s){var T=new ArrayBuffer(68);D=new Uint8Array(T),E=new Uint32Array(T)}var N=Array.isArray;(n.JS_MD5_NO_NODE_JS||!N)&&(N=function(c){return Object.prototype.toString.call(c)==="[object Array]"});var S=ArrayBuffer.isView;s&&(n.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!S)&&(S=function(c){return typeof c=="object"&&c.buffer&&c.buffer.constructor===ArrayBuffer});var j=function(c){var d=typeof c;if(d==="string")return[c,!0];if(d!=="object"||c===null)throw new Error(t);if(s&&c.constructor===ArrayBuffer)return[new Uint8Array(c),!1];if(!N(c)&&!S(c))throw new Error(t);return[c,!1]},b=function(c){return function(d){return new H(!0).update(d)[c]()}},U=function(){var c=b("hex");o&&(c=k(c)),c.create=function(){return new H},c.update=function(m){return c.create().update(m)};for(var d=0;d<O.length;++d){var v=O[d];c[v]=b(v)}return c},k=function(c){var d=Na(),v=ja().Buffer,m;v.from&&!n.JS_MD5_NO_BUFFER_FROM?m=v.from:m=function(P){return new v(P)};var B=function(P){if(typeof P=="string")return d.createHash("md5").update(P,"utf8").digest("hex");if(P==null)throw new Error(t);return P.constructor===ArrayBuffer&&(P=new Uint8Array(P)),N(P)||S(P)||P.constructor===v?d.createHash("md5").update(m(P)).digest("hex"):c(P)};return B},$=function(c){return function(d,v){return new X(d,!0).update(v)[c]()}},ee=function(){var c=$("hex");c.create=function(m){return new X(m)},c.update=function(m,B){return c.create(m).update(B)};for(var d=0;d<O.length;++d){var v=O[d];c[v]=$(v)}return c};function H(c){if(c)E[0]=E[16]=E[1]=E[2]=E[3]=E[4]=E[5]=E[6]=E[7]=E[8]=E[9]=E[10]=E[11]=E[12]=E[13]=E[14]=E[15]=0,this.blocks=E,this.buffer8=D;else if(s){var d=new ArrayBuffer(68);this.buffer8=new Uint8Array(d),this.blocks=new Uint32Array(d)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}H.prototype.update=function(c){if(this.finalized)throw new Error(e);var d=j(c);c=d[0];for(var v=d[1],m,B=0,P,I=c.length,Q=this.blocks,Me=this.buffer8;B<I;){if(this.hashed&&(this.hashed=!1,Q[0]=Q[16],Q[16]=Q[1]=Q[2]=Q[3]=Q[4]=Q[5]=Q[6]=Q[7]=Q[8]=Q[9]=Q[10]=Q[11]=Q[12]=Q[13]=Q[14]=Q[15]=0),v)if(s)for(P=this.start;B<I&&P<64;++B)m=c.charCodeAt(B),m<128?Me[P++]=m:m<2048?(Me[P++]=192|m>>>6,Me[P++]=128|m&63):m<55296||m>=57344?(Me[P++]=224|m>>>12,Me[P++]=128|m>>>6&63,Me[P++]=128|m&63):(m=65536+((m&1023)<<10|c.charCodeAt(++B)&1023),Me[P++]=240|m>>>18,Me[P++]=128|m>>>12&63,Me[P++]=128|m>>>6&63,Me[P++]=128|m&63);else for(P=this.start;B<I&&P<64;++B)m=c.charCodeAt(B),m<128?Q[P>>>2]|=m<<g[P++&3]:m<2048?(Q[P>>>2]|=(192|m>>>6)<<g[P++&3],Q[P>>>2]|=(128|m&63)<<g[P++&3]):m<55296||m>=57344?(Q[P>>>2]|=(224|m>>>12)<<g[P++&3],Q[P>>>2]|=(128|m>>>6&63)<<g[P++&3],Q[P>>>2]|=(128|m&63)<<g[P++&3]):(m=65536+((m&1023)<<10|c.charCodeAt(++B)&1023),Q[P>>>2]|=(240|m>>>18)<<g[P++&3],Q[P>>>2]|=(128|m>>>12&63)<<g[P++&3],Q[P>>>2]|=(128|m>>>6&63)<<g[P++&3],Q[P>>>2]|=(128|m&63)<<g[P++&3]);else if(s)for(P=this.start;B<I&&P<64;++B)Me[P++]=c[B];else for(P=this.start;B<I&&P<64;++B)Q[P>>>2]|=c[B]<<g[P++&3];this.lastByteIndex=P,this.bytes+=P-this.start,P>=64?(this.start=P-64,this.hash(),this.hashed=!0):this.start=P}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this},H.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var c=this.blocks,d=this.lastByteIndex;c[d>>>2]|=p[d&3],d>=56&&(this.hashed||this.hash(),c[0]=c[16],c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),c[14]=this.bytes<<3,c[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},H.prototype.hash=function(){var c,d,v,m,B,P,I=this.blocks;this.first?(c=I[0]-680876937,c=(cLine truncated
`,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",` `,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var J={placement:Ve(f.placement),popper:f.elements.popper,popperRect:f.rects.popper,gpuAcceleration:F};f.modifiersData.popperOffsets!=null&&(f.styles.popper=Object.assign({},f.styles.popper,Yn(Object.assign({},J,{offsets:f.modifiersData.popperOffsets,position:f.options.strategy,adaptive:G,roundOffsets:re})))),f.modifiersData.arrow!=null&&(f.styles.arrow=Object.assign({},f.styles.arrow,Yn(Object.assign({},J,{offsets:f.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:re})))),f.attributes.popper=Object.assign({},f.attributes.popper,{"data-popper-placement":f.placement})}var A={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:w,data:{}};function _(h){var f=h.state;Object.keys(f.elements).forEach(function(x){var R=f.styles[x]||{},F=f.attributes[x]||{},V=f.elements[x];!o(V)||!u(V)||(Object.assign(V.style,R),Object.keys(F).forEach(function(G){var Y=F[G];Y===!1?V.removeAttribute(G):V.setAttribute(G,Y===!0?"":Y)}))})}function W(h){var f=h.state,x={popper:{position:f.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(f.elements.popper.style,x.popper),f.styles=x,f.elements.arrow&&Object.assign(f.elements.arrow.style,x.arrow),function(){Object.keys(f.elements).forEach(function(R){var F=f.elements[R],V=f.attributes[R]||{},G=Object.keys(f.styles.hasOwnProperty(R)?f.styles[R]:x[R]),Y=G.reduce(function(re,ce){return re[ce]="",re},{});!o(F)||!u(F)||(Object.assign(F.style,Y),Object.keys(V).forEach(function(re){F.removeAttribute(re)}))})}}var te={name:"applyStyles",enabled:!0,phase:"write",fn:_,effect:W,requires:["computeStyles"]};function K(h,f,x){var R=Ve(h),F=[X,$].indexOf(R)>=0?-1:1,V=typeof x=="function"?x(Object.assign({},f,{placement:h})):x,G=V[0],Y=V[1];return G=G||0,Y=(Y||0)*F,[X,H].indexOf(R)>=0?{x:Y,y:G}:{x:G,y:Y}}function q(h){var f=h.state,x=h.options,R=h.name,F=x.offset,V=F===void 0?[0,0]:F,G=Me.reduce(function(J,Re){return J[Re]=K(Re,f.rects,V),J},{}),Y=G[f.placement],re=Y.x,ce=Y.y;f.modifiersData.popperOffsets!=null&&(f.modifiersData.popperOffsets.x+=re,f.modifiersData.popperOffsets.y+=ce),f.modifiersData[R]=G}var xe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:q},de={left:"right",right:"left",bottom:"top",top:"bottom"};function ge(h){return h.replace(/left|right|bottom|top/g,function(f){return de[f]})}var Oe={start:"end",end:"start"};function Ie(h){return h.replace(/start|end/g,function(f){return Oe[f]})}function Ye(h,f){f===void 0&&(f={});var x=f,R=x.placement,F=x.boundary,V=x.rootBoundary,G=x.padding,Y=x.flipVariations,re=x.allowedAutoPlacements,ce=re===void 0?Me:re,J=Dr(R),Re=J?Y?Q:Q.filter(function(Se){return Dr(Se)===J}):c,He=Re.filter(function(Se){return ce.indexOf(Se)>=0});He.length===0&&(He=Re,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var Le=He.reduce(function(Se,Ne){return Se[Ne]=Ue(h,{placement:Ne,boundary:F,rootBoundary:V,padding:G})[Ve(Ne)],Se},{});return Object.keys(Le).sort(function(Se,Ne){return Le[Se]-Le[Ne]})}function _e(h){if(Ve(h)===ie)return[];var f=ge(h);return[Ie(h),f,Ie(f)]}function Be(h){var f=h.state,x=h.options,R=h.name;if(!f.modifiersData[R]._skip){for(var F=x.mainAxis,V=F===void 0?!0:F,G=x.altAxis,Y=G===void 0?!0:G,re=x.fallbackPlacements,ce=x.padding,J=x.boundary,Re=x.rootBoundary,He=x.altBoundary,Le=x.flipVariations,Se=Le===void 0?!0:Le,Ne=x.allowedAutoPlacements,Pe=f.options.placement,Xe=Ve(Pe),je=Xe===Pe,Ke=re||(je||!Se?[ge(Pe)]:_e(Pe)),he=[Pe].concat(Ke).reduce(function(ae,we){return ae.concat(Ve(we)===ie?Ye(f,{placement:we,boundary:J,rootBoundary:Re,padding:ce,flipVariations:Se,allowedAutoPlacements:Ne}):we)},[]),Fe=f.rects.reference,ke=f.rects.popper,We=new Map,$e=!0,rt=he[0],Ge=0;Ge<he.length;Ge++){var Ze=he[Ge],ir=Ve(Ze),Ot=Dr(Ze)===d,_r=[$,ee].indexOf(ir)>=0,cn=_r?"width":"height",Kr=Ue(f,{placement:Ze,boundary:J,rootBoundary:Re,altBoundary:He,padding:ce}),Lr=_r?Ot?H:X:Ot?ee:$;Fe[cn]>ke[cn]&&(Lr=ge(Lr));var Xn=ge(Lr),Gr=[];if(V&&Gr.push(Kr[ir]<=0),Y&&Gr.push(Kr[Lr]<=0,Kr[Xn]<=0),Gr.every(function(ae){return ae})){rt=Ze,$e=!1;break}We.set(Ze,Gr)}if($e)for(var Dn=Se?3:1,Kn=function(we){var Ae=he.find(function(ct){var ft=We.get(ct);if(ft)return ft.slice(0,we).every(function(wr){return wr})});if(Ae)return rt=Ae,"break"},L=Dn;L>0;L--){var ne=Kn(L);if(ne==="break")break}f.placement!==rt&&(f.modifiersData[R]._skip=!0,f.placement=rt,f.reset=!0)}}var le={name:"flip",enabled:!0,phase:"main",fn:Be,requiresIfExists:["offset"],data:{_skip:!1}};function be(h){return h==="x"?"y":"x"}function ye(h,f,x){return lt(h,jt(f,x))}function oe(h){var f=h.state,x=h.options,R=h.name,F=x.mainAxis,V=F===void 0?!0:F,G= Line truncated `,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "));var J={placement:We(f.placement),popper:f.elements.popper,popperRect:f.rects.popper,gpuAcceleration:F};f.modifiersData.popperOffsets!=null&&(f.styles.popper=Object.assign({},f.styles.popper,Yn(Object.assign({},J,{offsets:f.modifiersData.popperOffsets,position:f.options.strategy,adaptive:G,roundOffsets:re})))),f.modifiersData.arrow!=null&&(f.styles.arrow=Object.assign({},f.styles.arrow,Yn(Object.assign({},J,{offsets:f.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:re})))),f.attributes.popper=Object.assign({},f.attributes.popper,{"data-popper-placement":f.placement})}var A={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:w,data:{}};function _(h){var f=h.state;Object.keys(f.elements).forEach(function(x){var R=f.styles[x]||{},F=f.attributes[x]||{},W=f.elements[x];!o(W)||!u(W)||(Object.assign(W.style,R),Object.keys(F).forEach(function(G){var Y=F[G];Y===!1?W.removeAttribute(G):W.setAttribute(G,Y===!0?"":Y)}))})}function V(h){var f=h.state,x={popper:{position:f.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(f.elements.popper.style,x.popper),f.styles=x,f.elements.arrow&&Object.assign(f.elements.arrow.style,x.arrow),function(){Object.keys(f.elements).forEach(function(R){var F=f.elements[R],W=f.attributes[R]||{},G=Object.keys(f.styles.hasOwnProperty(R)?f.styles[R]:x[R]),Y=G.reduce(function(re,ce){return re[ce]="",re},{});!o(F)||!u(F)||(Object.assign(F.style,Y),Object.keys(W).forEach(function(re){F.removeAttribute(re)}))})}}var te={name:"applyStyles",enabled:!0,phase:"write",fn:_,effect:V,requires:["computeStyles"]};function K(h,f,x){var R=We(h),F=[X,$].indexOf(R)>=0?-1:1,W=typeof x=="function"?x(Object.assign({},f,{placement:h})):x,G=W[0],Y=W[1];return G=G||0,Y=(Y||0)*F,[X,H].indexOf(R)>=0?{x:Y,y:G}:{x:G,y:Y}}function q(h){var f=h.state,x=h.options,R=h.name,F=x.offset,W=F===void 0?[0,0]:F,G=Me.reduce(function(J,Re){return J[Re]=K(Re,f.rects,W),J},{}),Y=G[f.placement],re=Y.x,ce=Y.y;f.modifiersData.popperOffsets!=null&&(f.modifiersData.popperOffsets.x+=re,f.modifiersData.popperOffsets.y+=ce),f.modifiersData[R]=G}var xe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:q},de={left:"right",right:"left",bottom:"top",top:"bottom"};function ge(h){return h.replace(/left|right|bottom|top/g,function(f){return de[f]})}var Oe={start:"end",end:"start"};function Ie(h){return h.replace(/start|end/g,function(f){return Oe[f]})}function Ye(h,f){f===void 0&&(f={});var x=f,R=x.placement,F=x.boundary,W=x.rootBoundary,G=x.padding,Y=x.flipVariations,re=x.allowedAutoPlacements,ce=re===void 0?Me:re,J=Dr(R),Re=J?Y?Q:Q.filter(function(Se){return Dr(Se)===J}):c,He=Re.filter(function(Se){return ce.indexOf(Se)>=0});He.length===0&&(He=Re,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var Le=He.reduce(function(Se,Ne){return Se[Ne]=Ue(h,{placement:Ne,boundary:F,rootBoundary:W,padding:G})[We(Ne)],Se},{});return Object.keys(Le).sort(function(Se,Ne){return Le[Se]-Le[Ne]})}function _e(h){if(We(h)===ie)return[];var f=ge(h);return[Ie(h),f,Ie(f)]}function Be(h){var f=h.state,x=h.options,R=h.name;if(!f.modifiersData[R]._skip){for(var F=x.mainAxis,W=F===void 0?!0:F,G=x.altAxis,Y=G===void 0?!0:G,re=x.fallbackPlacements,ce=x.padding,J=x.boundary,Re=x.rootBoundary,He=x.altBoundary,Le=x.flipVariations,Se=Le===void 0?!0:Le,Ne=x.allowedAutoPlacements,Pe=f.options.placement,Xe=We(Pe),je=Xe===Pe,Ke=re||(je||!Se?[ge(Pe)]:_e(Pe)),he=[Pe].concat(Ke).reduce(function(ae,we){return ae.concat(We(we)===ie?Ye(f,{placement:we,boundary:J,rootBoundary:Re,padding:ce,flipVariations:Se,allowedAutoPlacements:Ne}):we)},[]),Fe=f.rects.reference,ke=f.rects.popper,Ve=new Map,$e=!0,rt=he[0],Ge=0;Ge<he.length;Ge++){var Ze=he[Ge],ir=We(Ze),Ot=Dr(Ze)===d,_r=[$,ee].indexOf(ir)>=0,cn=_r?"width":"height",Kr=Ue(f,{placement:Ze,boundary:J,rootBoundary:Re,altBoundary:He,padding:ce}),Lr=_r?Ot?H:X:Ot?ee:$;Fe[cn]>ke[cn]&&(Lr=ge(Lr));var Xn=ge(Lr),Gr=[];if(W&&Gr.push(Kr[ir]<=0),Y&&Gr.push(Kr[Lr]<=0,Kr[Xn]<=0),Gr.every(function(ae){return ae})){rt=Ze,$e=!1;break}Ve.set(Ze,Gr)}if($e)for(var Dn=Se?3:1,Kn=function(we){var Ae=he.find(function(ct){var ft=Ve.get(ct);if(ft)return ft.slice(0,we).every(function(wr){return wr})});if(Ae)return rt=Ae,"break"},L=Dn;L>0;L--){var ne=Kn(L);if(ne==="break")break}f.placement!==rt&&(f.modifiersData[R]._skip=!0,f.placement=rt,f.reset=!0)}}var le={name:"flip",enabled:!0,phase:"main",fn:Be,requiresIfExists:["offset"],data:{_skip:!1}};function be(h){return h==="x"?"y":"x"}function ye(h,f,x){return lt(h,jt(f,x))}function oe(h){var f=h.state,x=h.options,R=h.name,F=x.mainAxis,W=F===void 0?!0:F,G= Line truncated
%ctippy.js %ctippy.js
%c`+Zt(w)+` %c`+Zt(w)+`
%c\u{1F477}\u200D This is a development-only message. It will be removed in production. %c\u{1F477}\u200D This is a development-only message. It will be removed in production.
`)}function er(w){return[Nt(w),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var mt;dr();function dr(){mt=new Set}function Et(w,A){if(w&&!mt.has(A)){var _;mt.add(A),(_=console).warn.apply(_,er(A))}}function Rt(w,A){if(w&&!mt.has(A)){var _;mt.add(A),(_=console).error.apply(_,er(A))}}function Tt(w){var A=!w,_=Object.prototype.toString.call(w)==="[object Object]"&&!w.addEventListener;Rt(A,["tippy() was passed","`"+String(w)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Rt(_,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Dt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Cr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Qe=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Dt,{},Cr),Wr=Object.keys(Qe),Vr=function(A){lt(A,[]);var _=Object.keys(A);_.forEach(function(W){Qe[W]=A[W]})};function Ve(w){var A=w.plugins||[],_=A.reduce(function(W,te){var K=te.name,q=te.defaultValue;return K&&(W[K]=w[K]!==void 0?w[K]:q),W},{});return Object.assign({},w,{},_)}function zt(w,A){var _=A?Object.keys(Ve(Object.assign({},Qe,{plugins:A}))):Wr,W=_.reduce(function(te,K){var q=(w.getAttribute("data-tippy-"+K)||"").trim();if(!q)return te;if(K==="content")te[K]=q;else try{te[K]=JSON.parse(q)}catch{te[K]=q}return te},{});return W}function hr(w,A){var _=Object.assign({},A,{content:O(A.content,[w])},A.ignoreAttributes?{}:zt(w,A.plugins));return _.aria=Object.assign({},Qe.aria,{},_.aria),_.aria={expanded:_.aria.expanded==="auto"?A.interactive:_.aria.expanded,content:_.aria.content==="auto"?A.interactive?null:"describedby":_.aria.content},_}function lt(w,A){w===void 0&&(w={}),A===void 0&&(A=[]);var _=Object.keys(w);_.forEach(function(W){var te=E(Qe,Object.keys(Dt)),K=!u(te,W);K&&(K=A.filter(function(q){return q.name===W}).length===0),Et(K,["`"+W+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",` `)}function er(w){return[Nt(w),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var mt;dr();function dr(){mt=new Set}function Et(w,A){if(w&&!mt.has(A)){var _;mt.add(A),(_=console).warn.apply(_,er(A))}}function Rt(w,A){if(w&&!mt.has(A)){var _;mt.add(A),(_=console).error.apply(_,er(A))}}function Tt(w){var A=!w,_=Object.prototype.toString.call(w)==="[object Object]"&&!w.addEventListener;Rt(A,["tippy() was passed","`"+String(w)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),Rt(_,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Dt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Cr={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Qe=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Dt,{},Cr),Vr=Object.keys(Qe),Wr=function(A){lt(A,[]);var _=Object.keys(A);_.forEach(function(V){Qe[V]=A[V]})};function We(w){var A=w.plugins||[],_=A.reduce(function(V,te){var K=te.name,q=te.defaultValue;return K&&(V[K]=w[K]!==void 0?w[K]:q),V},{});return Object.assign({},w,{},_)}function zt(w,A){var _=A?Object.keys(We(Object.assign({},Qe,{plugins:A}))):Vr,V=_.reduce(function(te,K){var q=(w.getAttribute("data-tippy-"+K)||"").trim();if(!q)return te;if(K==="content")te[K]=q;else try{te[K]=JSON.parse(q)}catch{te[K]=q}return te},{});return V}function hr(w,A){var _=Object.assign({},A,{content:O(A.content,[w])},A.ignoreAttributes?{}:zt(w,A.plugins));return _.aria=Object.assign({},Qe.aria,{},_.aria),_.aria={expanded:_.aria.expanded==="auto"?A.interactive:_.aria.expanded,content:_.aria.content==="auto"?A.interactive?null:"describedby":_.aria.content},_}function lt(w,A){w===void 0&&(w={}),A===void 0&&(A=[]);var _=Object.keys(w);_.forEach(function(V){var te=E(Qe,Object.keys(Dt)),K=!u(te,V);K&&(K=A.filter(function(q){return q.name===V}).length===0),Et(K,["`"+V+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/ `,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var jt=function(){return"innerHTML"};function Bt(w,A){w[jt()]=A}function Tr(w){var A=k();return w===!0?A.className=a:(A.className=l,$(w)?A.appendChild(w):Bt(A,w)),A}function mr(w,A){$(A.content)?(Bt(w,""),w.appendChild(A.content)):typeof A.content!="function"&&(A.allowHTML?Bt(w,A.content):w.textContent=A.content)}function $t(w){var A=w.firstElementChild,_=b(A.children);return{box:A,content:_.find(function(W){return W.classList.contains(i)}),arrow:_.find(function(W){return W.classList.contains(a)||W.classList.contains(l)}),backdrop:_.find(function(W){return W.classList.contains(o)})}}function Cn(w){var A=k(),_=k();_.className=n,_.setAttribute("data-state","hidden"),_.setAttribute("tabindex","-1");var W=k();W.className=i,W.setAttribute("data-state","hidden"),mr(W,w.props),A.appendChild(_),_.appendChild(W),te(w.props,w.props);function te(K,q){var xe=$t(A),de=xe.box,ge=xe.content,Oe=xe.arrow;q.theme?de.setAttribute("data-theme",q.theme):de.removeAttribute("data-theme"),typeof q.animation=="string"?de.setAttribute("data-animation",q.animation):de.removeAttribute("data-animation"),q.inertia?de.setAttribute("data-inertia",""):de.removeAttribute("data-inertia"),de.style.maxWidth=typeof q.maxWidth=="number"?q.maxWidth+"px":q.maxWidth,q.role?de.setAttribute("role",q.role):de.removeAttribute("role"),(K.content!==q.content||K.allowHTML!==q.allowHTML)&&mr(ge,w.props),q.arrow?Oe?K.arrow!==q.arrow&&(de.removeChild(Oe),de.appendChild(Tr(q.arrow))):de.appendChild(Tr(q.arrow)):Oe&&de.removeChild(Oe)}return{popper:A,onUpdate:te}}Cn.$$tippy=!0;var Tn=1,Ur=[],zr=[];function Dr(w,A){var _=hr(w,Object.assign({},Qe,{},Ve(U(A)))),W,te,K,q=!1,xe=!1,de=!1,ge=!1,Oe,Ie,Ye,_e=[],Be=y(je,_.interactiveDebounce),le,be=Tn++,ye=null,oe=S(_.plugins),ue={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:be,reference:w,popper:k(),popperInstance:ye,props:_,state:ue,plugins:oe,clearDelayTimeouts:_r,setProps:cn,setContent:Kr,show:Lr,hide:Xn,hideWithInteractivity:Gr,enable:ir,disable:Ot,unmount:Dn,destroy:Kn};if(!_.render)return Rt(!0,"render() function has not been supplied."),C;var ut=_.render(C),me=ut.popper,Mr=ut.onUpdate;me.setAttribute("data-tippy-root",""),me.id="tippy-"+C.id,C.popper=me,w._tippy=C,me._tippy=C;var rr=oe.map(function(L){return L.fn(C)}),qr=w.hasAttribute("aria-expanded");return Ne(),F(),f(),x("onCreate",[C]),_.showOnCreate&&Ge(),me.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),me.addEventListener("mouseleave",function(L){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&(nr().addEventListener("mousemove",Be),Be(L))}),C;function Yr(){var L=C.props.touch;return Array.isArray(L)?L:[L,0]}function Xr(){return Yr()[0]==="hold"}function Mt(){var L;return!!((L=C.props.render)!=null&&L.$$tippy)}function Ht(){return le||w}function nr(){var L=Ht().parentNode;return L?v(L):document}function un(){return $t(me)}function h(L){return C.state.isMounted&&!C.state.isVisible||P.isTouch||Oe&&Oe.type==="focus"?0:p(C.props.delay,L?0:1,Qe.delay)}function f(){me.style.pointerEvents=C.props.interactive&&C.state.isVisible?"":"none",me.style.zIndex=""+C.props.zIndex}function x(L,ne,ae){if(ae===void 0&&(ae=!0),rr.forEach(function(Ae){Ae[L]&&Ae[L].apply(void 0,ne)}),ae){var we;(we=C.props)[L].apply(we,ne)}}function R(){var L=C.props.aria;if(L.content){var ne="aria-"+L.content,ae=me.id,we=T(C.props.triggerTarget||w);we.forEach(function(Ae){var ct=Ae.getAttribute(ne);if(C.state.isVisible)Ae.setAttribute(ne,ct?ct+" "+ae:ae);else{var ft=ct&&ct.replace(ae,"").trim();ft?Ae.setAttribute(ne,ft):Ae.removeAttribute(ne)}})}}function F(){if(!(qr||!C.props.aria.expanded)){var L=T(C.props.triggerTarget||w);L.forEach(function(ne){C.props.interactive?ne.setAttribute("aria-expanded",C.state.isVisible&&ne===Ht()?"true":"false"):ne.removeAttribute("aria-expanded")})}}function V(){nr().removeEventListener("mousemove",Be),Ur=Ur.filter(function(L){return L!==Be})}function G(L){if(!(P.isTouch&&(de||L.type==="mousedown"))&&!(C.props.interactive&&me.contains(L.target))){if(Ht().contains(L.target)){if(P.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else x("onClickOutside",[C,L]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),xe=!0,setTimeout(function(){xe=!1}),C.state.isMounted||J())}}function Y(){de=!0}function re(){de=!1}function ce(){var L=nr();L.addEventListener("mousedown",G,!0),L.addEventListener("touchend",G,s),L.addEventListener("touchstart",re,s),L.addEventListener("touchmove",Y,s)}function J(){var L=nr();L.removeEventListener("mousedown",G,!0),L.removeEventListener("touchend",G,s),L.removeEventListener("touchstart",re,s),L.removeEventListener("touchmove",Y,s)}function Re(L,ne){Le(L,function(){!C.state.isVisible&&me.parentNode&&me.parentNode.contains(me)&&ne()})}function He(L,ne){Le(L,ne)}function Le(L,ne){var ae=un().box;function we(Ae){Ae.target===ae&&(B(ae,"remove",w Line truncated `,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var jt=function(){return"innerHTML"};function Bt(w,A){w[jt()]=A}function Tr(w){var A=k();return w===!0?A.className=a:(A.className=l,$(w)?A.appendChild(w):Bt(A,w)),A}function mr(w,A){$(A.content)?(Bt(w,""),w.appendChild(A.content)):typeof A.content!="function"&&(A.allowHTML?Bt(w,A.content):w.textContent=A.content)}function $t(w){var A=w.firstElementChild,_=b(A.children);return{box:A,content:_.find(function(V){return V.classList.contains(i)}),arrow:_.find(function(V){return V.classList.contains(a)||V.classList.contains(l)}),backdrop:_.find(function(V){return V.classList.contains(o)})}}function Cn(w){var A=k(),_=k();_.className=n,_.setAttribute("data-state","hidden"),_.setAttribute("tabindex","-1");var V=k();V.className=i,V.setAttribute("data-state","hidden"),mr(V,w.props),A.appendChild(_),_.appendChild(V),te(w.props,w.props);function te(K,q){var xe=$t(A),de=xe.box,ge=xe.content,Oe=xe.arrow;q.theme?de.setAttribute("data-theme",q.theme):de.removeAttribute("data-theme"),typeof q.animation=="string"?de.setAttribute("data-animation",q.animation):de.removeAttribute("data-animation"),q.inertia?de.setAttribute("data-inertia",""):de.removeAttribute("data-inertia"),de.style.maxWidth=typeof q.maxWidth=="number"?q.maxWidth+"px":q.maxWidth,q.role?de.setAttribute("role",q.role):de.removeAttribute("role"),(K.content!==q.content||K.allowHTML!==q.allowHTML)&&mr(ge,w.props),q.arrow?Oe?K.arrow!==q.arrow&&(de.removeChild(Oe),de.appendChild(Tr(q.arrow))):de.appendChild(Tr(q.arrow)):Oe&&de.removeChild(Oe)}return{popper:A,onUpdate:te}}Cn.$$tippy=!0;var Tn=1,Ur=[],zr=[];function Dr(w,A){var _=hr(w,Object.assign({},Qe,{},We(U(A)))),V,te,K,q=!1,xe=!1,de=!1,ge=!1,Oe,Ie,Ye,_e=[],Be=y(je,_.interactiveDebounce),le,be=Tn++,ye=null,oe=S(_.plugins),ue={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},C={id:be,reference:w,popper:k(),popperInstance:ye,props:_,state:ue,plugins:oe,clearDelayTimeouts:_r,setProps:cn,setContent:Kr,show:Lr,hide:Xn,hideWithInteractivity:Gr,enable:ir,disable:Ot,unmount:Dn,destroy:Kn};if(!_.render)return Rt(!0,"render() function has not been supplied."),C;var ut=_.render(C),me=ut.popper,Mr=ut.onUpdate;me.setAttribute("data-tippy-root",""),me.id="tippy-"+C.id,C.popper=me,w._tippy=C,me._tippy=C;var rr=oe.map(function(L){return L.fn(C)}),qr=w.hasAttribute("aria-expanded");return Ne(),F(),f(),x("onCreate",[C]),_.showOnCreate&&Ge(),me.addEventListener("mouseenter",function(){C.props.interactive&&C.state.isVisible&&C.clearDelayTimeouts()}),me.addEventListener("mouseleave",function(L){C.props.interactive&&C.props.trigger.indexOf("mouseenter")>=0&&(nr().addEventListener("mousemove",Be),Be(L))}),C;function Yr(){var L=C.props.touch;return Array.isArray(L)?L:[L,0]}function Xr(){return Yr()[0]==="hold"}function Mt(){var L;return!!((L=C.props.render)!=null&&L.$$tippy)}function Ht(){return le||w}function nr(){var L=Ht().parentNode;return L?v(L):document}function un(){return $t(me)}function h(L){return C.state.isMounted&&!C.state.isVisible||P.isTouch||Oe&&Oe.type==="focus"?0:p(C.props.delay,L?0:1,Qe.delay)}function f(){me.style.pointerEvents=C.props.interactive&&C.state.isVisible?"":"none",me.style.zIndex=""+C.props.zIndex}function x(L,ne,ae){if(ae===void 0&&(ae=!0),rr.forEach(function(Ae){Ae[L]&&Ae[L].apply(void 0,ne)}),ae){var we;(we=C.props)[L].apply(we,ne)}}function R(){var L=C.props.aria;if(L.content){var ne="aria-"+L.content,ae=me.id,we=T(C.props.triggerTarget||w);we.forEach(function(Ae){var ct=Ae.getAttribute(ne);if(C.state.isVisible)Ae.setAttribute(ne,ct?ct+" "+ae:ae);else{var ft=ct&&ct.replace(ae,"").trim();ft?Ae.setAttribute(ne,ft):Ae.removeAttribute(ne)}})}}function F(){if(!(qr||!C.props.aria.expanded)){var L=T(C.props.triggerTarget||w);L.forEach(function(ne){C.props.interactive?ne.setAttribute("aria-expanded",C.state.isVisible&&ne===Ht()?"true":"false"):ne.removeAttribute("aria-expanded")})}}function W(){nr().removeEventListener("mousemove",Be),Ur=Ur.filter(function(L){return L!==Be})}function G(L){if(!(P.isTouch&&(de||L.type==="mousedown"))&&!(C.props.interactive&&me.contains(L.target))){if(Ht().contains(L.target)){if(P.isTouch||C.state.isVisible&&C.props.trigger.indexOf("click")>=0)return}else x("onClickOutside",[C,L]);C.props.hideOnClick===!0&&(C.clearDelayTimeouts(),C.hide(),xe=!0,setTimeout(function(){xe=!1}),C.state.isMounted||J())}}function Y(){de=!0}function re(){de=!1}function ce(){var L=nr();L.addEventListener("mousedown",G,!0),L.addEventListener("touchend",G,s),L.addEventListener("touchstart",re,s),L.addEventListener("touchmove",Y,s)}function J(){var L=nr();L.removeEventListener("mousedown",G,!0),L.removeEventListener("touchend",G,s),L.removeEventListener("touchstart",re,s),L.removeEventListener("touchmove",Y,s)}function Re(L,ne){Le(L,function(){!C.state.isVisible&&me.parentNode&&me.parentNode.contains(me)&&ne()})}function He(L,ne){Le(L,ne)}function Le(L,ne){var ae=un().box;function we(Ae){Ae.target===ae&&(B(ae,"remove",w Line truncated
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",` `,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",` `,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function rt(){return b(me.querySelectorAll("[data-tippy-root]"))}function Ge(L){C.clearDelayTimeouts(),L&&x("onTrigger",[C,L]),ce();var ne=h(!0),ae=Yr(),we=ae[0],Ae=ae[1];P.isTouch&&we==="hold"&&Ae&&(ne=Ae),ne?W=setTimeout(function(){C.show()},ne):C.show()}function Ze(L){if(C.clearDelayTimeouts(),x("onUntrigger",[C,L]),!C.state.isVisible){J();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(L.type)>=0&&q)){var ne=h(!1);ne?te=setTimeout(function(){C.state.isVisible&&C.hide()},ne):K=requestAnimationFrame(function(){C.hide()})}}function ir(){C.state.isEnabled=!0}function Ot(){C.hide(),C.state.isEnabled=!1}function _r(){clearTimeout(W),clearTimeout(te),cancelAnimationFrame(K)}function cn(L){if(Et(C.state.isDestroyed,ht("setProps")),!C.state.isDestroyed){x("onBeforeUpdate",[C,L]),Pe();var ne=C.props,ae=hr(w,Object.assign({},C.props,{},L,{ignoreAttributes:!0}));C.props=ae,Ne(),ne.interactiveDebounce!==ae.interactiveDebounce&&(V(),Be=y(je,ae.interactiveDebounce)),ne.triggerTarget&&!ae.triggerTarget?T(ne.triggerTarget).forEach(function(we){we.removeAttribute("aria-expanded")}):ae.triggerTarget&&w.removeAttribute("aria-expanded"),F(),f(),Mr&&Mr(ne,ae),C.popperInstance&&(ke(),rt().forEach(function(we){requestAnimationFrame(we._tippy.popperInstance.forceUpdate)})),x("onAfterUpdate",[C,L])}}function Kr(L){C.setProps({content:L})}function Lr(){Et(C.state.isDestroyed,ht("show"));var L=C.state.isVisible,ne=C.state.isDestroyed,ae=!C.state.isEnabled,we=P.isTouch&&!C.props.touch,Ae=p(C.props.duration,0,Qe.duration);if(!(L||ne||ae||we)&&!Ht().hasAttribute("disabled")&&(x("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,Mt()&&(me.style.visibility="visible"),f(),ce(),C.state.isMounted||(me.style.transition="none"),Mt()){var ct=un(),ft=ct.box,wr=ct.content;c([ft,wr],0)}Ye=function(){var xr;if(!(!C.state.isVisible||ge)){if(ge=!0,me.offsetHeight,me.style.transition=C.props.moveTransition,Mt()&&C.props.animation){var Pn=un(),fn=Pn.box,Jr=Pn.content;c([fn,Jr],Ae),d([fn,Jr],"visible")}R(),F(),N(zr,C),(xr=C.popperInstance)==null||xr.forceUpdate(),C.state.isMounted=!0,x("onMount",[C]),C.props.animation&&Mt()&&He(Ae,function(){C.state.isShown=!0,x("onShown",[C])})}},$e()}}function Xn(){Et(C.state.isDestroyed,ht("hide"));var L=!C.state.isVisible,ne=C.state.isDestroyed,ae=!C.state.isEnabled,we=p(C.props.duration,1,Qe.duration);if(!(L||ne||ae)&&(x("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,ge=!1,q=!1,Mt()&&(me.style.visibility="hidden"),V(),J(),f(),Mt()){var Ae=un(),ct=Ae.box,ft=Ae.content;C.props.animation&&(c([ct,ft],we),d([ct,ft],"hidden"))}R(),F(),C.props.animation?Mt()&&Re(we,C.unmount):C.unmount()}}function Gr(L){Et(C.state.isDestroyed,ht("hideWithInteractivity")),nr().addEventListener("mousemove",Be),N(Ur,Be),Be(L)}function Dn(){Et(C.state.isDestroyed,ht("unmount")),C.state.isVisible&&C.hide(),C.state.isMounted&&(We(),rt().forEach(function(L){L._tippy.unmount()}),me.parentNode&&me.parentNode.removeChild(me),zr=zr.filter(function(L){return L!==C}),C.state.isMounted=!1,x("onHidden",[C]))}function Kn(){Et(C.state.isDestroyed,ht("destroy")),!C.state.isDestroyed&&(C.clearDelayTimeouts(),C.unmount(),Pe(),delete w._tippy,C.state.isDestroyed=!0,x("onDestroy",[C]))}}function M(w,A){A===void 0&&(A={});var _=Qe.plugins.concat(A.plugins||[]);Tt(w),lt(A,_),st();var W=Object.assign({},A,{plugins:_}),te=ie(w),K=$(W.content),q=te.length>1;Et(K&&q,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",` `,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function rt(){return b(me.querySelectorAll("[data-tippy-root]"))}function Ge(L){C.clearDelayTimeouts(),L&&x("onTrigger",[C,L]),ce();var ne=h(!0),ae=Yr(),we=ae[0],Ae=ae[1];P.isTouch&&we==="hold"&&Ae&&(ne=Ae),ne?V=setTimeout(function(){C.show()},ne):C.show()}function Ze(L){if(C.clearDelayTimeouts(),x("onUntrigger",[C,L]),!C.state.isVisible){J();return}if(!(C.props.trigger.indexOf("mouseenter")>=0&&C.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(L.type)>=0&&q)){var ne=h(!1);ne?te=setTimeout(function(){C.state.isVisible&&C.hide()},ne):K=requestAnimationFrame(function(){C.hide()})}}function ir(){C.state.isEnabled=!0}function Ot(){C.hide(),C.state.isEnabled=!1}function _r(){clearTimeout(V),clearTimeout(te),cancelAnimationFrame(K)}function cn(L){if(Et(C.state.isDestroyed,ht("setProps")),!C.state.isDestroyed){x("onBeforeUpdate",[C,L]),Pe();var ne=C.props,ae=hr(w,Object.assign({},C.props,{},L,{ignoreAttributes:!0}));C.props=ae,Ne(),ne.interactiveDebounce!==ae.interactiveDebounce&&(W(),Be=y(je,ae.interactiveDebounce)),ne.triggerTarget&&!ae.triggerTarget?T(ne.triggerTarget).forEach(function(we){we.removeAttribute("aria-expanded")}):ae.triggerTarget&&w.removeAttribute("aria-expanded"),F(),f(),Mr&&Mr(ne,ae),C.popperInstance&&(ke(),rt().forEach(function(we){requestAnimationFrame(we._tippy.popperInstance.forceUpdate)})),x("onAfterUpdate",[C,L])}}function Kr(L){C.setProps({content:L})}function Lr(){Et(C.state.isDestroyed,ht("show"));var L=C.state.isVisible,ne=C.state.isDestroyed,ae=!C.state.isEnabled,we=P.isTouch&&!C.props.touch,Ae=p(C.props.duration,0,Qe.duration);if(!(L||ne||ae||we)&&!Ht().hasAttribute("disabled")&&(x("onShow",[C],!1),C.props.onShow(C)!==!1)){if(C.state.isVisible=!0,Mt()&&(me.style.visibility="visible"),f(),ce(),C.state.isMounted||(me.style.transition="none"),Mt()){var ct=un(),ft=ct.box,wr=ct.content;c([ft,wr],0)}Ye=function(){var xr;if(!(!C.state.isVisible||ge)){if(ge=!0,me.offsetHeight,me.style.transition=C.props.moveTransition,Mt()&&C.props.animation){var Pn=un(),fn=Pn.box,Jr=Pn.content;c([fn,Jr],Ae),d([fn,Jr],"visible")}R(),F(),N(zr,C),(xr=C.popperInstance)==null||xr.forceUpdate(),C.state.isMounted=!0,x("onMount",[C]),C.props.animation&&Mt()&&He(Ae,function(){C.state.isShown=!0,x("onShown",[C])})}},$e()}}function Xn(){Et(C.state.isDestroyed,ht("hide"));var L=!C.state.isVisible,ne=C.state.isDestroyed,ae=!C.state.isEnabled,we=p(C.props.duration,1,Qe.duration);if(!(L||ne||ae)&&(x("onHide",[C],!1),C.props.onHide(C)!==!1)){if(C.state.isVisible=!1,C.state.isShown=!1,ge=!1,q=!1,Mt()&&(me.style.visibility="hidden"),W(),J(),f(),Mt()){var Ae=un(),ct=Ae.box,ft=Ae.content;C.props.animation&&(c([ct,ft],we),d([ct,ft],"hidden"))}R(),F(),C.props.animation?Mt()&&Re(we,C.unmount):C.unmount()}}function Gr(L){Et(C.state.isDestroyed,ht("hideWithInteractivity")),nr().addEventListener("mousemove",Be),N(Ur,Be),Be(L)}function Dn(){Et(C.state.isDestroyed,ht("unmount")),C.state.isVisible&&C.hide(),C.state.isMounted&&(Ve(),rt().forEach(function(L){L._tippy.unmount()}),me.parentNode&&me.parentNode.removeChild(me),zr=zr.filter(function(L){return L!==C}),C.state.isMounted=!1,x("onHidden",[C]))}function Kn(){Et(C.state.isDestroyed,ht("destroy")),!C.state.isDestroyed&&(C.clearDelayTimeouts(),C.unmount(),Pe(),delete w._tippy,C.state.isDestroyed=!0,x("onDestroy",[C]))}}function M(w,A){A===void 0&&(A={});var _=Qe.plugins.concat(A.plugins||[]);Tt(w),lt(A,_),st();var V=Object.assign({},A,{plugins:_}),te=ie(w),K=$(V.content),q=te.length>1;Et(K&&q,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",` `,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
`,`1) content: element.innerHTML `,`1) content: element.innerHTML
`,"2) content: () => element.cloneNode(true)"].join(" "));var xe=te.reduce(function(de,ge){var Oe=ge&&Dr(ge,W);return Oe&&de.push(Oe),de},[]);return $(w)?xe[0]:xe}M.defaultProps=Qe,M.setDefaultProps=Vr,M.currentInput=P;var Z=function(A){var _=A===void 0?{}:A,W=_.exclude,te=_.duration;zr.forEach(function(K){var q=!1;if(W&&(q=X(W)?K.reference===W:K.popper===W.popper),!q){var xe=K.props.duration;K.setProps({duration:te}),K.hide(),K.state.isDestroyed||K.setProps({duration:xe})}})},se=Object.assign({},e.applyStyles,{effect:function(A){var _=A.state,W={popper:{position:_.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(_.elements.popper.style,W.popper),_.styles=W,_.elements.arrow&&Object.assign(_.elements.arrow.style,W.arrow)}}),De=function(A,_){var W;_===void 0&&(_={}),Rt(!Array.isArray(A),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(A)].join(" "));var te=A,K=[],q,xe=_.overrides,de=[],ge=!1;function Oe(){K=te.map(function(oe){return oe.reference})}function Ie(oe){te.forEach(function(ue){oe?ue.enable():ue.disable()})}function Ye(oe){return te.map(function(ue){var C=ue.setProps;return ue.setProps=function(ut){C(ut),ue.reference===q&&oe.setProps(ut)},function(){ue.setProps=C}})}function _e(oe,ue){var C=K.indexOf(ue);if(ue!==q){q=ue;var ut=(xe||[]).concat("content").reduce(function(me,Mr){return me[Mr]=te[C].props[Mr],me},{});oe.setProps(Object.assign({},ut,{getReferenceClientRect:typeof ut.getReferenceClientRect=="function"?ut.getReferenceClientRect:function(){return ue.getBoundingClientRect()}}))}}Ie(!1),Oe();var Be={fn:function(){return{onDestroy:function(){Ie(!0)},onHidden:function(){q=null},onClickOutside:function(C){C.props.showOnCreate&&!ge&&(ge=!0,q=null)},onShow:function(C){C.props.showOnCreate&&!ge&&(ge=!0,_e(C,K[0]))},onTrigger:function(C,ut){_e(C,ut.currentTarget)}}}},le=M(k(),Object.assign({},E(_,["overrides"]),{plugins:[Be].concat(_.plugins||[]),triggerTarget:K,popperOptions:Object.assign({},_.popperOptions,{modifiers:[].concat(((W=_.popperOptions)==null?void 0:W.modifiers)||[],[se])})})),be=le.show;le.show=function(oe){if(be(),!q&&oe==null)return _e(le,K[0]);if(!(q&&oe==null)){if(typeof oe=="number")return K[oe]&&_e(le,K[oe]);if(te.includes(oe)){var ue=oe.reference;return _e(le,ue)}if(K.includes(oe))return _e(le,oe)}},le.showNext=function(){var oe=K[0];if(!q)return le.show(0);var ue=K.indexOf(q);le.show(K[ue+1]||oe)},le.showPrevious=function(){var oe=K[K.length-1];if(!q)return le.show(oe);var ue=K.indexOf(q),C=K[ue-1]||oe;le.show(C)};var ye=le.setProps;return le.setProps=function(oe){xe=oe.overrides||xe,ye(oe)},le.setInstances=function(oe){Ie(!0),de.forEach(function(ue){return ue()}),te=oe,Ie(!1),Oe(),Ye(le),le.setProps({triggerTarget:K})},de=Ye(le),le},Ee={mouseover:"mouseenter",focusin:"focus",click:"click"};function Ue(w,A){Rt(!(A&&A.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var _=[],W=[],te=!1,K=A.target,q=E(A,["target"]),xe=Object.assign({},q,{trigger:"manual",touch:!1}),de=Object.assign({},q,{showOnCreate:!0}),ge=M(w,xe),Oe=T(ge);function Ie(be){if(!(!be.target||te)){var ye=be.target.closest(K);if(ye){var oe=ye.getAttribute("data-tippy-trigger")||A.trigger||Qe.trigger;if(!ye._tippy&&!(be.type==="touchstart"&&typeof de.touch=="boolean")&&!(be.type!=="touchstart"&&oe.indexOf(Ee[be.type])<0)){var ue=M(ye,de);ue&&(W=W.concat(ue))}}}}function Ye(be,ye,oe,ue){ue===void 0&&(ue=!1),be.addEventListener(ye,oe,ue),_.push({node:be,eventType:ye,handler:oe,options:ue})}function _e(be){var ye=be.reference;Ye(ye,"touchstart",Ie,s),Ye(ye,"mouseover",Ie),Ye(ye,"focusin",Ie),Ye(ye,"click",Ie)}function Be(){_.forEach(function(be){var ye=be.node,oe=be.eventType,ue=be.handler,C=be.options;ye.removeEventListener(oe,ue,C)}),_=[]}function le(be){var ye=be.destroy,oe=be.enable,ue=be.disable;be.destroy=function(C){C===void 0&&(C=!0),C&&W.forEach(function(ut){ut.destroy()}),W=[],Be(),ye()},be.enable=function(){oe(),W.forEach(function(C){return C.enable()}),te=!1},be.disable=function(){ue(),W.forEach(function(C){return C.disable()}),te=!0},_e(be)}return Oe.forEach(le),ge}var yt={name:"animateFill",defaultValue:!1,fn:function(A){var _;if(!((_=A.props.render)!=null&&_.$$tippy))return Rt(A.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var W=$t(A.popper),te=W.box,K=W.content,q=A.props.animateFill?vr():null;return{onCreate:function(){q&&(te.insertBefore(q,te.firstElementChild),te.setAttribute("data-animatefill",""),te.style.overflow="hidden",A.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(q){var de=te.style.transitionDuration,ge=Number(de.replace("ms",""));K.style.transitionDelay=Math.round(ge/10)+"ms",q.style.transitionDuration=de,d([q],"visible")}},onShow:function(){q&&(q.style.transitionDuration="0ms")},onHide:function(){q&&d([q],"hidd Line truncated `,"2) content: () => element.cloneNode(true)"].join(" "));var xe=te.reduce(function(de,ge){var Oe=ge&&Dr(ge,V);return Oe&&de.push(Oe),de},[]);return $(w)?xe[0]:xe}M.defaultProps=Qe,M.setDefaultProps=Wr,M.currentInput=P;var Z=function(A){var _=A===void 0?{}:A,V=_.exclude,te=_.duration;zr.forEach(function(K){var q=!1;if(V&&(q=X(V)?K.reference===V:K.popper===V.popper),!q){var xe=K.props.duration;K.setProps({duration:te}),K.hide(),K.state.isDestroyed||K.setProps({duration:xe})}})},se=Object.assign({},e.applyStyles,{effect:function(A){var _=A.state,V={popper:{position:_.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(_.elements.popper.style,V.popper),_.styles=V,_.elements.arrow&&Object.assign(_.elements.arrow.style,V.arrow)}}),De=function(A,_){var V;_===void 0&&(_={}),Rt(!Array.isArray(A),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(A)].join(" "));var te=A,K=[],q,xe=_.overrides,de=[],ge=!1;function Oe(){K=te.map(function(oe){return oe.reference})}function Ie(oe){te.forEach(function(ue){oe?ue.enable():ue.disable()})}function Ye(oe){return te.map(function(ue){var C=ue.setProps;return ue.setProps=function(ut){C(ut),ue.reference===q&&oe.setProps(ut)},function(){ue.setProps=C}})}function _e(oe,ue){var C=K.indexOf(ue);if(ue!==q){q=ue;var ut=(xe||[]).concat("content").reduce(function(me,Mr){return me[Mr]=te[C].props[Mr],me},{});oe.setProps(Object.assign({},ut,{getReferenceClientRect:typeof ut.getReferenceClientRect=="function"?ut.getReferenceClientRect:function(){return ue.getBoundingClientRect()}}))}}Ie(!1),Oe();var Be={fn:function(){return{onDestroy:function(){Ie(!0)},onHidden:function(){q=null},onClickOutside:function(C){C.props.showOnCreate&&!ge&&(ge=!0,q=null)},onShow:function(C){C.props.showOnCreate&&!ge&&(ge=!0,_e(C,K[0]))},onTrigger:function(C,ut){_e(C,ut.currentTarget)}}}},le=M(k(),Object.assign({},E(_,["overrides"]),{plugins:[Be].concat(_.plugins||[]),triggerTarget:K,popperOptions:Object.assign({},_.popperOptions,{modifiers:[].concat(((V=_.popperOptions)==null?void 0:V.modifiers)||[],[se])})})),be=le.show;le.show=function(oe){if(be(),!q&&oe==null)return _e(le,K[0]);if(!(q&&oe==null)){if(typeof oe=="number")return K[oe]&&_e(le,K[oe]);if(te.includes(oe)){var ue=oe.reference;return _e(le,ue)}if(K.includes(oe))return _e(le,oe)}},le.showNext=function(){var oe=K[0];if(!q)return le.show(0);var ue=K.indexOf(q);le.show(K[ue+1]||oe)},le.showPrevious=function(){var oe=K[K.length-1];if(!q)return le.show(oe);var ue=K.indexOf(q),C=K[ue-1]||oe;le.show(C)};var ye=le.setProps;return le.setProps=function(oe){xe=oe.overrides||xe,ye(oe)},le.setInstances=function(oe){Ie(!0),de.forEach(function(ue){return ue()}),te=oe,Ie(!1),Oe(),Ye(le),le.setProps({triggerTarget:K})},de=Ye(le),le},Ee={mouseover:"mouseenter",focusin:"focus",click:"click"};function Ue(w,A){Rt(!(A&&A.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var _=[],V=[],te=!1,K=A.target,q=E(A,["target"]),xe=Object.assign({},q,{trigger:"manual",touch:!1}),de=Object.assign({},q,{showOnCreate:!0}),ge=M(w,xe),Oe=T(ge);function Ie(be){if(!(!be.target||te)){var ye=be.target.closest(K);if(ye){var oe=ye.getAttribute("data-tippy-trigger")||A.trigger||Qe.trigger;if(!ye._tippy&&!(be.type==="touchstart"&&typeof de.touch=="boolean")&&!(be.type!=="touchstart"&&oe.indexOf(Ee[be.type])<0)){var ue=M(ye,de);ue&&(V=V.concat(ue))}}}}function Ye(be,ye,oe,ue){ue===void 0&&(ue=!1),be.addEventListener(ye,oe,ue),_.push({node:be,eventType:ye,handler:oe,options:ue})}function _e(be){var ye=be.reference;Ye(ye,"touchstart",Ie,s),Ye(ye,"mouseover",Ie),Ye(ye,"focusin",Ie),Ye(ye,"click",Ie)}function Be(){_.forEach(function(be){var ye=be.node,oe=be.eventType,ue=be.handler,C=be.options;ye.removeEventListener(oe,ue,C)}),_=[]}function le(be){var ye=be.destroy,oe=be.enable,ue=be.disable;be.destroy=function(C){C===void 0&&(C=!0),C&&V.forEach(function(ut){ut.destroy()}),V=[],Be(),ye()},be.enable=function(){oe(),V.forEach(function(C){return C.enable()}),te=!1},be.disable=function(){ue(),V.forEach(function(C){return C.disable()}),te=!0},_e(be)}return Oe.forEach(le),ge}var yt={name:"animateFill",defaultValue:!1,fn:function(A){var _;if(!((_=A.props.render)!=null&&_.$$tippy))return Rt(A.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var V=$t(A.popper),te=V.box,K=V.content,q=A.props.animateFill?vr():null;return{onCreate:function(){q&&(te.insertBefore(q,te.firstElementChild),te.setAttribute("data-animatefill",""),te.style.overflow="hidden",A.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(q){var de=te.style.transitionDuration,ge=Number(de.replace("ms",""));K.style.transitionDelay=Math.round(ge/10)+"ms",q.style.transitionDuration=de,d([q],"visible")}},onShow:function(){q&&(q.style.transitionDuration="0ms")},onHide:function(){q&&d([q],"hidd Line truncated
/*! Bundled license information: /*! Bundled license information:
js-md5/src/md5.js: js-md5/src/md5.js:
@@ -1 +1 @@
function h({name:r,recordKey:u,state:f,messages:a}){let d=e=>e.method==="updateTableColumnState"&&e.params[0]===r&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.hook("commit",({component:e,commit:t,succeed:o,fail:i})=>{if(e.id!==this.$wire.$id)return;let n=t.calls.some(d),s=this.isRefreshing;(n||s)&&i(()=>this.handleSaveFailure()),o(({effects:l})=>{(n||s)&&(this.hasRenderedState=!!l.html),s&&(this.isRefreshing=!1),l.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})})}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=a?.saving,this.unsubscribeRequestHook=Livewire.hook("request",({payload:t,respond:o})=>{JSON.parse(t).components.some(i=>JSON.parse(i.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||i.calls.some(d)))&&o(({response:i})=>{let n=i.text.bind(i);i.text=async()=>{try{return await n()}catch(s){throw this.handleSaveFailure(),s}}})});try{let t=await this.$wire.updateTableColumnState(r,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=t?.error??void 0,this.status=this.error??a?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=a?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},blockEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&a?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(r){return{...h(r),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)}}}export{c as default}; function h({name:r,recordKey:u,state:f,messages:a}){let d=e=>e.method==="updateTableColumnState"&&e.params[0]===r&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.hook("commit",({component:e,commit:t,succeed:o,fail:i})=>{if(e.id!==this.$wire.$id)return;let n=t.calls.some(d),s=this.isRefreshing;(n||s)&&i(()=>this.handleSaveFailure()),o(({effects:l})=>{(n||s)&&(this.hasRenderedState=!!l.html),s&&(this.isRefreshing=!1),l.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})})}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=a?.saving,this.unsubscribeRequestHook=Livewire.hook("request",({payload:t,respond:o})=>{JSON.parse(t).components.some(i=>JSON.parse(i.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||i.calls.some(d)))&&o(({response:i})=>{let n=i.text.bind(i);i.text=async()=>{try{return await n()}catch(s){throw this.handleSaveFailure(),s}}})});try{let t=await this.$wire.updateTableColumnState(r,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=t?.error??void 0,this.status=this.error??a?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=a?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&a?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(r){return{...h(r),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)}}}export{c as default};
@@ -1,4 +1,4 @@
var Vt=Math.min,vt=Math.max,Wt=Math.round;var ot=n=>({x:n,y:n}),rn={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(n,t,e){return vt(n,Vt(t,e))}function zt(n,t){return typeof n=="function"?n(t):n}function yt(n){return n.split("-")[0]}function Xt(n){return n.split("-")[1]}function Re(n){return n==="x"?"y":"x"}function Te(n){return n==="y"?"height":"width"}function ft(n){let t=n[0];return t==="t"||t==="b"?"y":"x"}function Ie(n){return Re(ft(n))}function ei(n,t,e){e===void 0&&(e=!1);let i=Xt(n),s=Ie(n),o=Te(s),r=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=$t(r)),[r,$t(r)]}function ii(n){let t=$t(n);return[oe(n),t,oe(t)]}function oe(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var Ze=["left","right"],ti=["right","left"],an=["top","bottom"],ln=["bottom","top"];function cn(n,t,e){switch(n){case"top":case"bottom":return e?t?ti:Ze:t?Ze:ti;case"left":case"right":return t?an:ln;default:return[]}}function ni(n,t,e,i){let s=Xt(n),o=cn(yt(n),e==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(oe)))),o}function $t(n){let t=yt(n);return rn[t]+n.slice(t.length)}function un(n){return{top:0,right:0,bottom:0,left:0,...n}}function si(n){return typeof n!="number"?un(n):{top:n,right:n,bottom:n,left:n}}function Ot(n){let{x:t,y:e,width:i,height:s}=n;return{width:i,height:s,top:e,left:t,right:t+i,bottom:e+s,x:t,y:e}}function oi(n,t,e){let{reference:i,floating:s}=n,o=ft(t),r=Ie(t),a=Te(r),l=yt(t),c=o==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,p=i[a]/2-s[a]/2,f;switch(l){case"top":f={x:h,y:i.y-s.height};break;case"bottom":f={x:h,y:i.y+i.height};break;case"right":f={x:i.x+i.width,y:u};break;case"left":f={x:i.x-s.width,y:u};break;default:f={x:i.x,y:i.y}}switch(Xt(t)){case"start":f[r]-=p*(e&&c?-1:1);break;case"end":f[r]+=p*(e&&c?-1:1);break}return f}async function ri(n,t){var e;t===void 0&&(t={});let{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=zt(t,n),m=si(f),S=a[p?u==="floating"?"reference":"floating":u],E=Ot(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(S)))==null||e?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),w=u==="floating"?{x:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},_=Ot(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return{top:(E.top-_.top+m.top)/A.y,bottom:(_.bottom-E.bottom+m.bottom)/A.y,left:(E.left-_.left+m.left)/A.x,right:(_.right-E.right+m.right)/A.x}}var hn=50,ai=async(n,t,e)=>{let{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ri},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:u}=oi(c,i,l),p=i,f=0,m={};for(let g=0;g<o.length;g++){let S=o[g];if(!S)continue;let{name:E,fn:w}=S,{x,y:A,data:_,reset:C}=await w({x:h,y:u,initialPlacement:i,placement:p,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:n,floating:t}});h=x??h,u=A??u,m[E]={...m[E],..._},C&&f<hn&&(f++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await r.getElementRects({reference:n,floating:t,strategy:s}):C.rects),{x:h,y:u}=oi(c,p,l)),g=-1)}return{x:h,y:u,placement:p,strategy:s,middlewareData:m}};var li=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...S}=zt(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let E=yt(s),w=ft(a),x=yt(a)===a,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=p||(x||!g?[$t(a)]:ii(a)),C=m!=="none";!p&&C&&_.push(...ni(a,g,m,A));let G=[a,..._],J=await l.detectOverflow(t,S),I=[],W=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&I.push(J[E]),u){let B=ei(s,r,A);I.push(J[B[0]],J[B[1]])}if(W=[...W,{placement:s,overflows:I}],!I.every(B=>B<=0)){var Y,et;let B=(((Y=o.flip)==null?void 0:Y.index)||0)+1,Q=G[B];if(Q&&(!(u==="alignment"?w!==ft(Q):!1)||W.every(R=>ft(R.placement)===w?R.overflows[0]>0:!0)))return{data:{index:B,overflows:W},reset:{placement:Q}};let k=(et=W.filter(H=>H.overflows[0]<=0).sort((H,R)=>H.overflows[1]-R.overflows[1])[0])==null?void 0:et.placement;if(!k)switch(f){case"bestFit":{var z;let H=(z=W.filter(R=>{if(C){let $=ft(R.placement);return $===w||$==="y"}return!0}).map(R=>[R.placement,RLine truncated var $t=Math.min,vt=Math.max,Vt=Math.round;var ot=n=>({x:n,y:n}),rn={left:"right",right:"left",bottom:"top",top:"bottom"};function Le(n,t,e){return vt(n,$t(t,e))}function Wt(n,t){return typeof n=="function"?n(t):n}function yt(n){return n.split("-")[0]}function zt(n){return n.split("-")[1]}function Re(n){return n==="x"?"y":"x"}function Te(n){return n==="y"?"height":"width"}function ft(n){let t=n[0];return t==="t"||t==="b"?"y":"x"}function Ie(n){return Re(ft(n))}function ei(n,t,e){e===void 0&&(e=!1);let i=zt(n),s=Ie(n),o=Te(s),r=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=Ht(r)),[r,Ht(r)]}function ii(n){let t=Ht(n);return[oe(n),t,oe(t)]}function oe(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var Ze=["left","right"],ti=["right","left"],an=["top","bottom"],ln=["bottom","top"];function cn(n,t,e){switch(n){case"top":case"bottom":return e?t?ti:Ze:t?Ze:ti;case"left":case"right":return t?an:ln;default:return[]}}function ni(n,t,e,i){let s=zt(n),o=cn(yt(n),e==="start",i);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(oe)))),o}function Ht(n){let t=yt(n);return rn[t]+n.slice(t.length)}function un(n){return{top:0,right:0,bottom:0,left:0,...n}}function si(n){return typeof n!="number"?un(n):{top:n,right:n,bottom:n,left:n}}function Ot(n){let{x:t,y:e,width:i,height:s}=n;return{width:i,height:s,top:e,left:t,right:t+i,bottom:e+s,x:t,y:e}}function oi(n,t,e){let{reference:i,floating:s}=n,o=ft(t),r=Ie(t),a=Te(r),l=yt(t),c=o==="y",h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,f=i[a]/2-s[a]/2,p;switch(l){case"top":p={x:h,y:i.y-s.height};break;case"bottom":p={x:h,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:u};break;case"left":p={x:i.x-s.width,y:u};break;default:p={x:i.x,y:i.y}}switch(zt(t)){case"start":p[r]-=f*(e&&c?-1:1);break;case"end":p[r]+=f*(e&&c?-1:1);break}return p}async function ri(n,t){var e;t===void 0&&(t={});let{x:i,y:s,platform:o,rects:r,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Wt(t,n),m=si(p),w=a[f?u==="floating"?"reference":"floating":u],E=Ot(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(w)))==null||e?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),S=u==="floating"?{x:i,y:s,width:r.floating.width,height:r.floating.height}:r.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},P=Ot(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:x,strategy:l}):S);return{top:(E.top-P.top+m.top)/A.y,bottom:(P.bottom-E.bottom+m.bottom)/A.y,left:(E.left-P.left+m.left)/A.x,right:(P.right-E.right+m.right)/A.x}}var hn=50,ai=async(n,t,e)=>{let{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:r}=e,a=r.detectOverflow?r:{...r,detectOverflow:ri},l=await(r.isRTL==null?void 0:r.isRTL(t)),c=await r.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:u}=oi(c,i,l),f=i,p=0,m={};for(let g=0;g<o.length;g++){let w=o[g];if(!w)continue;let{name:E,fn:S}=w,{x,y:A,data:P,reset:L}=await S({x:h,y:u,initialPlacement:i,placement:f,strategy:s,middlewareData:m,rects:c,platform:a,elements:{reference:n,floating:t}});h=x??h,u=A??u,m[E]={...m[E],...P},L&&p<hn&&(p++,typeof L=="object"&&(L.placement&&(f=L.placement),L.rects&&(c=L.rects===!0?await r.getElementRects({reference:n,floating:t,strategy:s}):L.rects),{x:h,y:u}=oi(c,f,l)),g=-1)}return{x:h,y:u,placement:f,strategy:s,middlewareData:m}};var li=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;let{placement:s,middlewareData:o,rects:r,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...w}=Wt(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};let E=yt(s),S=ft(a),x=yt(a)===a,A=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=f||(x||!g?[Ht(a)]:ii(a)),L=m!=="none";!f&&L&&P.push(...ni(a,g,m,A));let V=[a,...P],J=await l.detectOverflow(t,w),M=[],W=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&M.push(J[E]),u){let N=ei(s,r,A);M.push(J[N[0]],J[N[1]])}if(W=[...W,{placement:s,overflows:M}],!M.every(N=>N<=0)){var Y,tt;let N=(((Y=o.flip)==null?void 0:Y.index)||0)+1,q=V[N];if(q&&(!(u==="alignment"?S!==ft(q):!1)||W.every(B=>ft(B.placement)===S?B.overflows[0]>0:!0)))return{data:{index:N,overflows:W},reset:{placement:q}};let C=(tt=W.filter(T=>T.overflows[0]<=0).sort((T,B)=>T.overflows[1]-B.overflows[1])[0])==null?void 0:tt.placement;if(!C)switch(p){case"bestFit":{var z;let T=(z=W.filter(B=>{if(L){let et=ft(B.placement);return et===S||et==="y"}return!0}).map(B=>[B.placemenLine truncated
/*! Bundled license information: /*! Bundled license information:
sortablejs/modular/sortable.esm.js: sortablejs/modular/sortable.esm.js:
@@ -1 +1 @@
function h({name:r,recordKey:u,state:f,messages:a}){let l=e=>e.method==="updateTableColumnState"&&e.params[0]===r&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.hook("commit",({component:e,commit:i,succeed:o,fail:t})=>{if(e.id!==this.$wire.$id)return;let n=i.calls.some(l),s=this.isRefreshing;(n||s)&&t(()=>this.handleSaveFailure()),o(({effects:d})=>{(n||s)&&(this.hasRenderedState=!!d.html),s&&(this.isRefreshing=!1),d.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})})}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=a?.saving,this.unsubscribeRequestHook=Livewire.hook("request",({payload:i,respond:o})=>{JSON.parse(i).components.some(t=>JSON.parse(t.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||t.calls.some(l)))&&o(({response:t})=>{let n=t.text.bind(t);t.text=async()=>{try{return await n()}catch(s){throw this.handleSaveFailure(),s}}})});try{let i=await this.$wire.updateTableColumnState(r,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=i?.error??void 0,this.status=this.error??a?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=a?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},blockEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&a?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(r){return{...h(r),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')}}}export{c as default}; function h({name:r,recordKey:u,state:f,messages:a}){let l=e=>e.method==="updateTableColumnState"&&e.params[0]===r&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.hook("commit",({component:e,commit:i,succeed:o,fail:t})=>{if(e.id!==this.$wire.$id)return;let n=i.calls.some(l),s=this.isRefreshing;(n||s)&&t(()=>this.handleSaveFailure()),o(({effects:d})=>{(n||s)&&(this.hasRenderedState=!!d.html),s&&(this.isRefreshing=!1),d.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})})}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=a?.saving,this.unsubscribeRequestHook=Livewire.hook("request",({payload:i,respond:o})=>{JSON.parse(i).components.some(t=>JSON.parse(t.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||t.calls.some(l)))&&o(({response:t})=>{let n=t.text.bind(t);t.text=async()=>{try{return await n()}catch(s){throw this.handleSaveFailure(),s}}})});try{let i=await this.$wire.updateTableColumnState(r,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=i?.error??void 0,this.status=this.error??a?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=a?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&a?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(r){return{...h(r),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[null,void 0].includes(this.$refs.serverState.value)?"":this.$refs.serverState.value.replaceAll('\\"','"')}}}export{c as default};
@@ -1 +1 @@
function h({name:r,recordKey:u,state:f,messages:a}){let l=e=>e.method==="updateTableColumnState"&&e.params[0]===r&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.hook("commit",({component:e,commit:t,succeed:o,fail:i})=>{if(e.id!==this.$wire.$id)return;let n=t.calls.some(l),s=this.isRefreshing;(n||s)&&i(()=>this.handleSaveFailure()),o(({effects:d})=>{(n||s)&&(this.hasRenderedState=!!d.html),s&&(this.isRefreshing=!1),d.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})})}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=a?.saving,this.unsubscribeRequestHook=Livewire.hook("request",({payload:t,respond:o})=>{JSON.parse(t).components.some(i=>JSON.parse(i.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||i.calls.some(l)))&&o(({response:i})=>{let n=i.text.bind(i);i.text=async()=>{try{return await n()}catch(s){throw this.handleSaveFailure(),s}}})});try{let t=await this.$wire.updateTableColumnState(r,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=t?.error??void 0,this.status=this.error??a?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=a?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},blockEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&a?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(r){return{...h(r),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)}}}export{c as default}; function h({name:r,recordKey:u,state:f,messages:a}){let d=e=>e.method==="updateTableColumnState"&&e.params[0]===r&&String(e.params[1])===String(u);return{error:void 0,isLoading:!1,isDestroyed:!1,isRefreshing:!1,hasRenderedState:!1,state:f,status:void 0,unsubscribeLivewireHook:null,unsubscribeRequestHook:null,initEditableColumn(){this.unsubscribeLivewireHook=Livewire.hook("commit",({component:e,commit:i,succeed:o,fail:t})=>{if(e.id!==this.$wire.$id)return;let n=i.calls.some(d),s=this.isRefreshing;(n||s)&&t(()=>this.handleSaveFailure()),o(({effects:l})=>{(n||s)&&(this.hasRenderedState=!!l.html),s&&(this.isRefreshing=!1),l.html&&this.$nextTick(()=>{!this.isDestroyed&&!this.isLoading&&this.syncServerState()})})}),this.$watch("state",async()=>{let e=this.getServerState();if(!(this.isDestroyed||this.isLoading||e===void 0||this.getNormalizedState()===e)){this.clearError(),this.isLoading=!0,this.hasRenderedState=!1,this.status=a?.saving,this.unsubscribeRequestHook=Livewire.hook("request",({payload:i,respond:o})=>{JSON.parse(i).components.some(t=>JSON.parse(t.snapshot).memo.id===this.$wire.$id&&(this.isRefreshing||t.calls.some(d)))&&o(({response:t})=>{let n=t.text.bind(t);t.text=async()=>{try{return await n()}catch(s){throw this.handleSaveFailure(),s}}})});try{let i=await this.$wire.updateTableColumnState(r,u,this.state);if(await this.$nextTick(),!this.isDestroyed&&!this.hasRenderedState&&(this.isRefreshing=!0,await this.$wire.$refresh(),await this.$nextTick(),!this.hasRenderedState)){this.handleSaveFailure();return}if(this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,this.isDestroyed)return;this.error=i?.error??void 0,this.status=this.error??a?.saved,this.isLoading=!1,this.syncServerState()}catch{this.handleSaveFailure()}}})},syncServerState(){let e=this.getServerState();e!==void 0&&(this.state=e)},getNormalizedState(){return Alpine.raw(this.state)??""},clearError(){this.isLoading||(this.error=void 0,this.status=void 0)},handleSaveFailure(){this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null,!this.isDestroyed&&(this.error=a?.failure??"The save could not be confirmed. Refresh the page before trying again.",this.status=this.error,this.isRefreshing=!1,this.isLoading=!1)},preventEdit(e){!this.isLoading||e.type==="keydown"&&["Tab","Escape"].includes(e.key)||(e.preventDefault(),e.stopImmediatePropagation())},getAccessibilityAttributes(e={}){return{...e,"aria-invalid":this.error?"true":e["aria-invalid"]??null,"aria-busy":this.isLoading?"true":e["aria-busy"]??null,"aria-describedby":[e["aria-describedby"],this.error&&a?this.$id("table-column-error"):null].filter(Boolean).join(" ")||null}},destroy(){this.isDestroyed=!0,this.unsubscribeLivewireHook?.(),this.unsubscribeRequestHook?.(),this.unsubscribeRequestHook=null}}}function c(r){return{...h(r),init(){this.initEditableColumn()},getServerState(){if(this.$refs.serverState)return[1,"1"].includes(this.$refs.serverState.value)}}}export{c as default};
+1 -1
View File
@@ -1 +1 @@
(()=>{var H=Math.min,k=Math.max,N=Math.round,I=Math.floor,A=e=>({x:e,y:e});function Z(e,t,o){return k(e,H(t,o))}function X(e,t){return typeof e=="function"?e(t):e}function K(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return e==="x"?"y":"x"}function re(e){return e==="y"?"height":"width"}function q(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function le(e){return te(q(e))}function $e(e){return{top:0,right:0,bottom:0,left:0,...e}}function ce(e){return typeof e!="number"?$e(e):{top:e,right:e,bottom:e,left:e}}function E(e){let{x:t,y:o,width:i,height:s}=e;return{width:i,height:s,top:o,left:t,right:t+i,bottom:o+s,x:t,y:o}}function ae(e,t,o){let{reference:i,floating:s}=e,c=q(t),l=le(t),n=re(l),r=K(t),a=c==="y",u=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,h=i[n]/2-s[n]/2,d;switch(r){case"top":d={x:u,y:i.y-s.height};break;case"bottom":d={x:u,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-s.width,y:f};break;default:d={x:i.x,y:i.y}}switch(ee(t)){case"start":d[l]-=h*(o&&a?-1:1);break;case"end":d[l]+=h*(o&&a?-1:1);break}return d}async function de(e,t){var o;t===void 0&&(t={});let{x:i,y:s,platform:c,rects:l,elements:n,strategy:r}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=X(t,e),m=ce(d),b=n[h?f==="floating"?"reference":"floating":f],g=E(await c.getClippingRect({element:(o=await(c.isElement==null?void 0:c.isElement(b)))==null||o?b:b.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(n.floating)),boundary:a,rootBoundary:u,strategy:r})),w=f==="floating"?{x:i,y:s,width:l.floating.width,height:l.floating.height}:l.reference,R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(n.floating)),x=await(c.isElement==null?void 0:c.isElement(R))?await(c.getScale==null?void 0:c.getScale(R))||{x:1,y:1}:{x:1,y:1},L=E(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:w,offsetParent:R,strategy:r}):w);return{top:(g.top-L.top+m.top)/x.y,bottom:(L.bottom-g.bottom+m.bottom)/x.y,left:(g.left-L.left+m.left)/x.x,right:(L.right-g.right+m.right)/x.x}}var Me=50,fe=async(e,t,o)=>{let{placement:i="bottom",strategy:s="absolute",middleware:c=[],platform:l}=o,n=l.detectOverflow?l:{...l,detectOverflow:de},r=await(l.isRTL==null?void 0:l.isRTL(t)),a=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=ae(a,i,r),h=i,d=0,m={};for(let p=0;p<c.length;p++){let b=c[p];if(!b)continue;let{name:g,fn:w}=b,{x:R,y:x,data:L,reset:T}=await w({x:u,y:f,initialPlacement:i,placement:h,strategy:s,middlewareData:m,rects:a,platform:n,elements:{reference:e,floating:t}});u=R??u,f=x??f,m[g]={...m[g],...L},T&&d<Me&&(d++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(a=T.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:u,y:f}=ae(a,h,r)),p=-1)}return{x:u,y:f,placement:h,strategy:s,middlewareData:m}};var He=new Set(["left","top"]);async function Ve(e,t){let{placement:o,platform:i,elements:s}=e,c=await(i.isRTL==null?void 0:i.isRTL(s.floating)),l=K(o),n=ee(o),r=q(o)==="y",a=He.has(l)?-1:1,u=c&&r?-1:1,f=X(t,e),{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return n&&typeof m=="number"&&(d=n==="end"?m*-1:m),r?{x:d*u,y:h*a}:{x:h*a,y:d*u}}var ue=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,i;let{x:s,y:c,placement:l,middlewareData:n}=t,r=await Ve(t,e);return l===((o=n.offset)==null?void 0:o.placement)&&(i=n.arrow)!=null&&i.alignmentOffset?{}:{x:s+r.x,y:c+r.y,data:{...r,placement:l}}}}},he=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:o,y:i,placement:s,platform:c}=t,{mainAxis:l=!0,crossAxis:n=!1,limiter:r={fn:g=>{let{x:w,y:R}=g;return{x:w,y:R}}},...a}=X(e,t),u={x:o,y:i},f=await c.detectOverflow(t,a),h=q(K(s)),d=te(h),m=u[d],p=u[h];if(l){let g=d==="y"?"top":"left",w=d==="y"?"bottom":"right",R=m+f[g],x=m-f[w];m=Z(R,m,x)}if(n){let g=h==="y"?"top":"left",w=h==="y"?"bottom":"right",R=p+f[g],x=p-f[w];p=Z(R,p,x)}let b=r.fn({...t,[d]:m,[h]:p});return{...b,data:{x:b.x-o,y:b.y-i,enabled:{[d]:l,[h]:n}}}}}};function j(){return typeof window<"u"}function D(e){return ge(e)?(e.nodeName||"").toLowerCase():"#document"}function y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function O(e){var t;return(t=(ge(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ge(e){return j()?e instanceof Node||e instanceof y(e).Node:!1}function v(e){return j()?e instanceof Element||e instanceof y(e).Element:!1}function S(e){return j()?e instanceof HTMLElement||e instanceof y(e).HTMLElement:!1}function me(e){return!j()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof y(e).ShadowRoot}function B(e){let{overflowLine truncated (()=>{var H=Math.min,k=Math.max,N=Math.round,I=Math.floor,A=e=>({x:e,y:e});function Z(e,t,i){return k(e,H(t,i))}function X(e,t){return typeof e=="function"?e(t):e}function j(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return e==="x"?"y":"x"}function le(e){return e==="y"?"height":"width"}function q(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function ce(e){return te(q(e))}function $e(e){return{top:0,right:0,bottom:0,left:0,...e}}function ae(e){return typeof e!="number"?$e(e):{top:e,right:e,bottom:e,left:e}}function E(e){let{x:t,y:i,width:o,height:s}=e;return{width:o,height:s,top:i,left:t,right:t+o,bottom:i+s,x:t,y:i}}function de(e,t,i){let{reference:o,floating:s}=e,c=q(t),l=ce(t),n=le(l),r=j(t),a=c==="y",u=o.x+o.width/2-s.width/2,f=o.y+o.height/2-s.height/2,h=o[n]/2-s[n]/2,d;switch(r){case"top":d={x:u,y:o.y-s.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-s.width,y:f};break;default:d={x:o.x,y:o.y}}switch(ee(t)){case"start":d[l]-=h*(i&&a?-1:1);break;case"end":d[l]+=h*(i&&a?-1:1);break}return d}async function fe(e,t){var i;t===void 0&&(t={});let{x:o,y:s,platform:c,rects:l,elements:n,strategy:r}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=X(t,e),m=ae(d),b=n[h?f==="floating"?"reference":"floating":f],g=E(await c.getClippingRect({element:(i=await(c.isElement==null?void 0:c.isElement(b)))==null||i?b:b.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(n.floating)),boundary:a,rootBoundary:u,strategy:r})),w=f==="floating"?{x:o,y:s,width:l.floating.width,height:l.floating.height}:l.reference,R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(n.floating)),y=await(c.isElement==null?void 0:c.isElement(R))?await(c.getScale==null?void 0:c.getScale(R))||{x:1,y:1}:{x:1,y:1},L=E(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:n,rect:w,offsetParent:R,strategy:r}):w);return{top:(g.top-L.top+m.top)/y.y,bottom:(L.bottom-g.bottom+m.bottom)/y.y,left:(g.left-L.left+m.left)/y.x,right:(L.right-g.right+m.right)/y.x}}var Me=50,ue=async(e,t,i)=>{let{placement:o="bottom",strategy:s="absolute",middleware:c=[],platform:l}=i,n=l.detectOverflow?l:{...l,detectOverflow:fe},r=await(l.isRTL==null?void 0:l.isRTL(t)),a=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=de(a,o,r),h=o,d=0,m={};for(let p=0;p<c.length;p++){let b=c[p];if(!b)continue;let{name:g,fn:w}=b,{x:R,y,data:L,reset:T}=await w({x:u,y:f,initialPlacement:o,placement:h,strategy:s,middlewareData:m,rects:a,platform:n,elements:{reference:e,floating:t}});u=R??u,f=y??f,m[g]={...m[g],...L},T&&d<Me&&(d++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(a=T.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):T.rects),{x:u,y:f}=de(a,h,r)),p=-1)}return{x:u,y:f,placement:h,strategy:s,middlewareData:m}};var He=new Set(["left","top"]);async function Ve(e,t){let{placement:i,platform:o,elements:s}=e,c=await(o.isRTL==null?void 0:o.isRTL(s.floating)),l=j(i),n=ee(i),r=q(i)==="y",a=He.has(l)?-1:1,u=c&&r?-1:1,f=X(t,e),{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return n&&typeof m=="number"&&(d=n==="end"?m*-1:m),r?{x:d*u,y:h*a}:{x:h*a,y:d*u}}var he=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,o;let{x:s,y:c,placement:l,middlewareData:n}=t,r=await Ve(t,e);return l===((i=n.offset)==null?void 0:i.placement)&&(o=n.arrow)!=null&&o.alignmentOffset?{}:{x:s+r.x,y:c+r.y,data:{...r,placement:l}}}}},me=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:i,y:o,placement:s,platform:c}=t,{mainAxis:l=!0,crossAxis:n=!1,limiter:r={fn:g=>{let{x:w,y:R}=g;return{x:w,y:R}}},...a}=X(e,t),u={x:i,y:o},f=await c.detectOverflow(t,a),h=q(j(s)),d=te(h),m=u[d],p=u[h];if(l){let g=d==="y"?"top":"left",w=d==="y"?"bottom":"right",R=m+f[g],y=m-f[w];m=Z(R,m,y)}if(n){let g=h==="y"?"top":"left",w=h==="y"?"bottom":"right",R=p+f[g],y=p-f[w];p=Z(R,p,y)}let b=r.fn({...t,[d]:m,[h]:p});return{...b,data:{x:b.x-i,y:b.y-o,enabled:{[d]:l,[h]:n}}}}}};function K(){return typeof window<"u"}function D(e){return pe(e)?(e.nodeName||"").toLowerCase():"#document"}function v(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function O(e){var t;return(t=(pe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pe(e){return K()?e instanceof Node||e instanceof v(e).Node:!1}function x(e){return K()?e instanceof Element||e instanceof v(e).Element:!1}function S(e){return K()?e instanceof HTMLElement||e instanceof v(e).HTMLElement:!1}function ge(e){return!K()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof v(e).ShadowRoot}function W(e){let{overflow:tLine truncated
+10
View File
@@ -69,6 +69,16 @@ @layer base {
} }
} }
/* Cross-document View Transitions: page-to-page navigations cross-fade
instead of flashing white. Off for visitors who ask for less motion;
browsers without support just navigate normally. Turbo Frame updates
aren't document navigations, so they're unaffected. */
@media (prefers-reduced-motion: no-preference) {
@view-transition {
navigation: auto;
}
}
@keyframes spin { @keyframes spin {
from { from {
transform: rotate(0deg); transform: rotate(0deg);
@@ -0,0 +1,17 @@
import { Controller } from '@hotwired/stimulus'
// Moves focus into an element as soon as it lands in the DOM: only rendered
// on markup that arrives through a Turbo Stream (the review form's response),
// never on a normal page load. Focuses the first invalid field if there is
// one (or the first focusable thing inside it, e.g. the rating stars),
// otherwise the element itself (give it tabindex="-1").
export default class extends Controller {
connect() {
const invalid = this.element.querySelector('[aria-invalid="true"]')
const target = invalid?.matches(FOCUSABLE) ? invalid : invalid?.querySelector(FOCUSABLE)
;(target ?? this.element).focus()
}
}
const FOCUSABLE = 'input:not([type="hidden"]), textarea, select, button, [tabindex]'
+2
View File
@@ -10,6 +10,7 @@ import CartCountController from './cart-count-controller'
import CarouselController from './carousel-controller' import CarouselController from './carousel-controller'
import CustomFieldUploadController from './custom-field-upload-controller' import CustomFieldUploadController from './custom-field-upload-controller'
import DropdownController from './dropdown-controller' import DropdownController from './dropdown-controller'
import FocusOnConnectController from './focus-on-connect-controller'
import FrameScrollController from './frame-scroll-controller' import FrameScrollController from './frame-scroll-controller'
import NavSearchController from './nav-search-controller' import NavSearchController from './nav-search-controller'
import ProductFormController from './product-form-controller' import ProductFormController from './product-form-controller'
@@ -28,6 +29,7 @@ export function registerControllers(application) {
application.register('carousel', CarouselController) application.register('carousel', CarouselController)
application.register('custom-field-upload', CustomFieldUploadController) application.register('custom-field-upload', CustomFieldUploadController)
application.register('dropdown', DropdownController) application.register('dropdown', DropdownController)
application.register('focus-on-connect', FocusOnConnectController)
application.register('frame-scroll', FrameScrollController) application.register('frame-scroll', FrameScrollController)
application.register('nav-search', NavSearchController) application.register('nav-search', NavSearchController)
application.register('product-form', ProductFormController) application.register('product-form', ProductFormController)
+1 -1
View File
@@ -2,7 +2,7 @@ base_path: /stoic
auth: auth:
mode: session mode: session
validate_url: http://nginx/validate validate_url: http://caddy/validate
cookie: laravel_session cookie: laravel_session
content_path: /content content_path: /content
+19 -8
View File
@@ -45,9 +45,10 @@
</a> </a>
@endforeach @endforeach
{{-- Wishlist — the account page, or the cookie-based guest page --}} {{-- Wishlist — always the guest page, which sends logged-in users on
to the account version, so the header doesn't depend on login --}}
<a <a
href="{{ auth()->check() ? route('account.wishlist') : route('wishlist') }}" href="{{ route('wishlist') }}"
class="hidden lg:flex items-center justify-center w-10 h-10 hover:opacity-70 transition-opacity" class="hidden lg:flex items-center justify-center w-10 h-10 hover:opacity-70 transition-opacity"
aria-label="{{ __('storefront.account.nav_wishlist') }}" aria-label="{{ __('storefront.account.nav_wishlist') }}"
@if (request()->routeIs('account.wishlist', 'wishlist')) aria-current="page" @endif @if (request()->routeIs('account.wishlist', 'wishlist')) aria-current="page" @endif
@@ -55,11 +56,14 @@ class="hidden lg:flex items-center justify-center w-10 h-10 hover:opacity-70 tra
<x-ui.icon name="heart" :size="40" /> <x-ui.icon name="heart" :size="40" />
</a> </a>
{{-- Account — the account page, or login for guests --}} {{-- Account — always the account page; the auth middleware sends
guests to login. [data-account-link] is the island target shared
with the mobile menu's link. --}}
<a <a
href="{{ auth()->check() ? route('account') : route('login') }}" data-account-link
href="{{ route('account') }}"
class="hidden lg:flex items-center justify-center w-10 h-10 hover:opacity-70 transition-opacity" class="hidden lg:flex items-center justify-center w-10 h-10 hover:opacity-70 transition-opacity"
aria-label="{{ auth()->check() ? __('storefront.nav.account') : __('storefront.auth.login') }}" aria-label="{{ __('storefront.nav.account') }}"
> >
<x-ui.icon name="user" :size="40" /> <x-ui.icon name="user" :size="40" />
</a> </a>
@@ -74,7 +78,13 @@ class="relative flex items-center justify-center w-10 h-10 hover:opacity-70 tran
data-action="cart-count#open" data-action="cart-count#open"
> >
<x-ui.icon name="bag" :size="40" /> <x-ui.icon name="bag" :size="40" />
{{-- Island target: the count will come from the islands request
(Turbo Stream on #cart-badge). It's absolute inside the
fixed-size button, so showing it or going from 1 to 2 digits
never moves the header. Rule for every island: it may never
change the size of its container. --}}
<span <span
id="cart-badge"
data-cart-count-target="badge" data-cart-count-target="badge"
class="absolute -top-1 -right-2 text-sm font-bold leading-none" class="absolute -top-1 -right-2 text-sm font-bold leading-none"
hidden hidden
@@ -172,7 +182,7 @@ class="mobile-menu fixed inset-x-0 top-20 bottom-auto m-0 max-h-[calc(100dvh-5re
<ul class="flex flex-col gap-4 border-t border-black pt-6"> <ul class="flex flex-col gap-4 border-t border-black pt-6">
<li> <li>
<a <a
href="{{ auth()->check() ? route('account.wishlist') : route('wishlist') }}" href="{{ route('wishlist') }}"
class="inline-flex items-center gap-3 hover:opacity-70 transition-opacity" class="inline-flex items-center gap-3 hover:opacity-70 transition-opacity"
@if (request()->routeIs('account.wishlist', 'wishlist')) aria-current="page" @endif @if (request()->routeIs('account.wishlist', 'wishlist')) aria-current="page" @endif
> >
@@ -182,11 +192,12 @@ class="inline-flex items-center gap-3 hover:opacity-70 transition-opacity"
</li> </li>
<li> <li>
<a <a
href="{{ auth()->check() ? route('account') : route('login') }}" data-account-link
href="{{ route('account') }}"
class="inline-flex items-center gap-3 hover:opacity-70 transition-opacity" class="inline-flex items-center gap-3 hover:opacity-70 transition-opacity"
> >
<x-ui.icon name="user" :size="28" /> <x-ui.icon name="user" :size="28" />
<span>{{ auth()->check() ? __('storefront.nav.account') : __('storefront.auth.login') }}</span> <span>{{ __('storefront.nav.account') }}</span>
</a> </a>
</li> </li>
@foreach ($altLocales ?? [] as $altLocale) @foreach ($altLocales ?? [] as $altLocale)
@@ -1,28 +1,47 @@
@props(['product']) {{--
Review form. Submitted through Turbo (data-turbo="true", Drive stays off
elsewhere): ProductController::storeReview() answers with Turbo Streams.
On a validation error it replaces this form (#product-review-form) with a
copy rendered with `messages` and the entered `values`, and `focus` so
focus-on-connect moves focus to the first invalid field. Never reads the
session (no old() or $errors), so the product page stays cacheable.
--}}
@props([
'productId',
'messages' => null, // Illuminate\Support\MessageBag of validation errors
'values' => [],
'focus' => false,
])
@php $oldRating = (int) old('rating', 0); @endphp @php
$rating = (int) ($values['rating'] ?? 0);
$error = fn (string $field) => $messages?->first($field);
@endphp
<form <form
id="product-review-form"
method="POST" method="POST"
action="{{ route('product.reviews.store', ['locale' => app()->getLocale(), 'product' => $product['id']]) }}" action="{{ route('product.reviews.store', ['locale' => app()->getLocale(), 'product' => $productId]) }}"
class="flex flex-col gap-8 mt-10" class="flex flex-col gap-8 mt-10"
data-controller="star-rating" data-turbo="true"
data-star-rating-rating-value="{{ $oldRating }}" data-controller="star-rating{{ $focus ? ' focus-on-connect' : '' }}"
data-star-rating-rating-value="{{ $rating }}"
data-action="submit->star-rating#validate" data-action="submit->star-rating#validate"
> >
@csrf @csrf
{{-- Rating --}} {{-- Rating --}}
<x-ui.field :label="__('storefront.review.rating')" for="rating" :required="true" :error="$errors->first('rating')"> <x-ui.field :label="__('storefront.review.rating')" for="rating" :required="true" :error="$error('rating')">
<div <div
id="rating" id="rating"
class="flex items-center gap-1.5 text-brand" class="flex items-center gap-1.5 text-brand"
role="radiogroup" role="radiogroup"
aria-label="{{ __('storefront.review.rating') }}" aria-label="{{ __('storefront.review.rating') }}"
aria-required="true" aria-required="true"
aria-describedby="rating-client-error" aria-describedby="rating-client-error{{ $error('rating') ? ' rating-error' : '' }}"
@if ($error('rating')) aria-invalid="true" @endif
> >
<input type="hidden" name="rating" value="{{ $oldRating }}" data-star-rating-target="input"> <input type="hidden" name="rating" value="{{ $rating }}" data-star-rating-target="input">
@for($i = 1; $i <= 5; $i++) @for($i = 1; $i <= 5; $i++)
<button <button
type="button" type="button"
@@ -30,7 +49,7 @@ class="flex items-center gap-1.5 text-brand"
data-value="{{ $i }}" data-value="{{ $i }}"
data-action="click->star-rating#select mouseenter->star-rating#hover mouseleave->star-rating#leave" data-action="click->star-rating#select mouseenter->star-rating#hover mouseleave->star-rating#leave"
aria-label="{{ trans_choice('storefront.review.stars_count', $i, ['count' => $i]) }}" aria-label="{{ trans_choice('storefront.review.stars_count', $i, ['count' => $i]) }}"
aria-pressed="{{ $i === $oldRating ? 'true' : 'false' }}" aria-pressed="{{ $i === $rating ? 'true' : 'false' }}"
> >
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
@@ -49,16 +68,39 @@ class="w-6 h-6"
<p id="rating-client-error" data-star-rating-target="error" class="text-sm text-red-600" role="alert" hidden>{{ __('storefront.review.rating_required') }}</p> <p id="rating-client-error" data-star-rating-target="error" class="text-sm text-red-600" role="alert" hidden>{{ __('storefront.review.rating_required') }}</p>
</x-ui.field> </x-ui.field>
<x-ui.field :label="__('storefront.review.write_label')" for="review-content" :required="true" :error="$errors->first('content')"> <x-ui.field :label="__('storefront.review.write_label')" for="review-content" :required="true" :error="$error('content')">
<x-ui.textarea id="review-content" name="content" :required="true" :rows="6">{{ old('content') }}</x-ui.textarea> <x-ui.textarea
id="review-content"
name="content"
:required="true"
:rows="6"
:aria-invalid="$error('content') ? 'true' : null"
:aria-describedby="$error('content') ? 'review-content-error' : null"
>{{ $values['content'] ?? '' }}</x-ui.textarea>
</x-ui.field> </x-ui.field>
<x-ui.field :label="__('storefront.review.name')" for="review-name" :labelDescription="__('storefront.review.name_optional')" :error="$errors->first('name')"> <x-ui.field :label="__('storefront.review.name')" for="review-name" :labelDescription="__('storefront.review.name_optional')" :error="$error('name')">
<x-ui.input id="review-name" name="name" autocomplete="name" :value="old('name')" /> <x-ui.input
id="review-name"
name="name"
autocomplete="name"
:value="$values['name'] ?? null"
:aria-invalid="$error('name') ? 'true' : null"
:aria-describedby="$error('name') ? 'review-name-error' : null"
/>
</x-ui.field> </x-ui.field>
<x-ui.field :label="__('storefront.review.email')" for="review-email" :required="true" :labelDescription="__('storefront.review.email_not_published')" :error="$errors->first('email')"> <x-ui.field :label="__('storefront.review.email')" for="review-email" :required="true" :labelDescription="__('storefront.review.email_not_published')" :error="$error('email')">
<x-ui.input id="review-email" name="email" type="email" :required="true" autocomplete="email" :value="old('email')" /> <x-ui.input
id="review-email"
name="email"
type="email"
:required="true"
autocomplete="email"
:value="$values['email'] ?? null"
:aria-invalid="$error('email') ? 'true' : null"
:aria-describedby="$error('email') ? 'review-email-error' : null"
/>
</x-ui.field> </x-ui.field>
<div> <div>
@@ -3,6 +3,10 @@
`wishlist` Stimulus controller turns the submit into a fetch and flips `wishlist` Stimulus controller turns the submit into a fetch and flips
aria-pressed, which the CSS (group-aria-pressed) uses to swap the icons. aria-pressed, which the CSS (group-aria-pressed) uses to swap the icons.
[data-wishlist-product] is the island target: the heart state will come
from the islands request. aria-pressed is still rendered server-side for
now.
Usage: <x-wishlist-button :product-id="$product['id']" class="absolute top-4 right-4" /> Usage: <x-wishlist-button :product-id="$product['id']" class="absolute top-4 right-4" />
--}} --}}
@props(['productId']) @props(['productId'])
@@ -16,6 +20,7 @@
<form <form
method="POST" method="POST"
action="{{ route('wishlist.toggle', ['productId' => $productId]) }}" action="{{ route('wishlist.toggle', ['productId' => $productId]) }}"
data-wishlist-product="{{ $productId }}"
data-controller="wishlist" data-controller="wishlist"
data-action="submit->wishlist#toggle" data-action="submit->wishlist#toggle"
data-wishlist-add-label-value="{{ $addLabel }}" data-wishlist-add-label-value="{{ $addLabel }}"
+37 -1
View File
@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}"> <meta id="csrf-token" name="csrf-token" content="{{ csrf_token() }}">
{{-- Favicons --}} {{-- Favicons --}}
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" /> <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
@@ -45,6 +45,42 @@
@vite(['node_modules/@boboko/core/resources/css/checkout.css', 'resources/css/app.css', 'resources/js/app.js']) @vite(['node_modules/@boboko/core/resources/css/checkout.css', 'resources/css/app.css', 'resources/js/app.js'])
{{-- Speculation Rules: prerender same-origin pages on hover or press.
Excluded: personal/session pages (cart, checkout, account, login,
logout, wishlist, contact, the future /islands), the admin and Stoic,
rel=nofollow, anything marked data-no-prerender, and listing controls
(filters, sort, pagination) that load into a Turbo Frame instead of
navigating — i.e. links inside a <turbo-frame> or pointing at one,
unless they break out with data-turbo-frame="_top" (product cards). --}}
@verbatim
<script type="speculationrules">
{
"prerender": [{
"where": {
"and": [
{ "href_matches": "/*" },
{ "not": { "href_matches": [
"/:locale/cart{/*}?",
"/:locale/checkout{/*}?",
"/:locale/account{/*}?",
"/:locale/login{/*}?",
"/:locale/logout",
"/:locale/wishlist{/*}?",
"/:locale/contact{/*}?",
"/:locale/islands{/*}?",
"/islands{/*}?",
"/boboko{/*}?",
"/stoic{/*}?"
] } },
{ "not": { "selector_matches": "[rel~=nofollow], [data-no-prerender], turbo-frame a:not([data-turbo-frame=\"_top\"]), a[data-turbo-frame]:not([data-turbo-frame=\"_top\"])" } }
]
},
"eagerness": "moderate"
}]
}
</script>
@endverbatim
@auth('staff') @auth('staff')
@php($stoicToken = \App\Services\Stoic::token(auth('staff')->user()->email)) @php($stoicToken = \App\Services\Stoic::token(auth('staff')->user()->email))
<script> <script>
@@ -0,0 +1,12 @@
{{-- Average stars + review count under the product title. Shared by the
product page and the review-stored Turbo Stream (#product-rating-summary). --}}
<x-reviews-stars
id="product-rating-summary"
:rating="$rating ?? 0"
:count="$count"
:showCount="true"
:linkable="true"
data-controller="tab-link"
data-tab-link-tabs-outlet="#product-tabs"
data-tab-link-panel-value="reviews"
/>
@@ -0,0 +1,11 @@
{{-- One review, from its index-shaped array (ProductIndexer::mapReview()).
Shared by the product page's list and the review-stored Turbo Stream. --}}
<x-review-card :review="[
'rating' => $review['rating'],
'name' => $review['reviewer_name'],
'date' => $review['reviewed_at'] ? \Illuminate\Support\Carbon::createFromTimestamp($review['reviewed_at'])->translatedFormat('d M Y') : '',
'text' => $review['body'],
'image' => $review['media'][0]['url'] ?? null,
'reply' => $review['reply'] ?? null,
'replyDate' => ($review['replied_at'] ?? null) ? \Illuminate\Support\Carbon::createFromTimestamp($review['replied_at'])->translatedFormat('d M Y') : null,
]" />
+19 -27
View File
@@ -154,15 +154,10 @@ class="absolute bottom-8 left-1/2 -translate-x-1/2 text-white text-sm lg:left-au
{{ $product['name'] }} {{ $product['name'] }}
</h1> </h1>
<x-reviews-stars @include('product.partials.rating-summary', [
:rating="$product['reviews']['average_rating'] ?? 0" 'rating' => $product['reviews']['average_rating'],
:count="$product['reviews']['count']" 'count' => $product['reviews']['count'],
:showCount="true" ])
:linkable="true"
data-controller="tab-link"
data-tab-link-tabs-outlet="#product-tabs"
data-tab-link-panel-value="reviews"
/>
@if($product['price'] !== null) @if($product['price'] !== null)
<p class="text-2xl font-bold" data-product-form-target="price"> <p class="text-2xl font-bold" data-product-form-target="price">
@@ -237,34 +232,31 @@ class="flex flex-col gap-6"
</div> </div>
</x-slot> </x-slot>
<x-slot name="reviews"> <x-slot name="reviews">
@if(session('reviewSubmitted')) {{-- Stream targets for ProductController::storeReview(): the new
<p class="mb-8 text-sm font-semibold" role="status">{{ __('storefront.review.thank_you') }}</p> review is prepended to #product-reviews-list, the empty
@endif message and #product-review-section removed, and the thank-you
put in the #product-review-status live region. The list hides
itself while it has no reviews. --}}
<div id="product-review-status" role="status"></div>
@if(!empty($product['reviews']['items'])) <div id="product-reviews-list" class="mb-10 [&:not(:has(>*))]:hidden">
<div class="mb-10"> @foreach($product['reviews']['items'] ?? [] as $review)
@foreach($product['reviews']['items'] as $review) @include('product.partials.review', ['review' => $review])
<x-review-card :review="[
'rating' => $review['rating'],
'name' => $review['reviewer_name'],
'date' => $review['reviewed_at'] ? \Illuminate\Support\Carbon::createFromTimestamp($review['reviewed_at'])->translatedFormat('d M Y') : '',
'text' => $review['body'],
'image' => $review['media'][0]['url'] ?? null,
'reply' => $review['reply'] ?? null,
'replyDate' => $review['replied_at'] ? \Illuminate\Support\Carbon::createFromTimestamp($review['replied_at'])->translatedFormat('d M Y') : null,
]" />
@endforeach @endforeach
</div> </div>
@else
<p class="text-neutral-500 mb-10">{{ __('storefront.review.no_reviews_yet') }}</p> @if(empty($product['reviews']['items']))
<p id="product-reviews-empty" class="text-neutral-500 mb-10">{{ __('storefront.review.no_reviews_yet') }}</p>
@endif @endif
<div id="product-review-section">
<h3 class="text-h4 font-bold"> <h3 class="text-h4 font-bold">
{{ $product['reviews']['count'] > 0 ? __('storefront.review.write_new') : __('storefront.review.write_first') }} {{ $product['reviews']['count'] > 0 ? __('storefront.review.write_new') : __('storefront.review.write_first') }}
{{ __('storefront.review.for_product', ['name' => $product['name']]) }} {{ __('storefront.review.for_product', ['name' => $product['name']]) }}
</h3> </h3>
<x-review-form :product="$product" /> <x-review-form :product-id="$product['id']" />
</div>
</x-slot> </x-slot>
</x-ui.tabs> </x-ui.tabs>
@@ -0,0 +1,8 @@
{{-- Turbo Stream answer to a review that failed validation
(ProductController::storeReview(), status 422): the form again, with
inline errors and the entered values, focus on the first invalid field. --}}
<turbo-stream action="replace" target="product-review-form">
<template>
<x-review-form :product-id="$productId" :messages="$messages" :values="$values" :focus="true" />
</template>
</turbo-stream>
@@ -0,0 +1,30 @@
{{-- Turbo Stream answer to a successful review submission
(ProductController::storeReview()). Targets live in product/show.blade.php. --}}
<turbo-stream action="prepend" target="product-reviews-list">
<template>
@include('product.partials.review', ['review' => $review])
</template>
</turbo-stream>
<turbo-stream action="remove" target="product-reviews-empty"></turbo-stream>
<turbo-stream action="replace" target="product-rating-summary">
<template>
@include('product.partials.rating-summary', ['rating' => $averageRating, 'count' => $count])
</template>
</turbo-stream>
<turbo-stream action="update" target="tab-btn-reviews">
<template>{{ __('storefront.product.reviews') . ' (' . $count . ')' }}</template>
</turbo-stream>
<turbo-stream action="remove" target="product-review-section"></turbo-stream>
{{-- Into the live region that's already on the page, so it's announced;
focus moves to it too, since the form (and the focused submit button)
just went away. --}}
<turbo-stream action="update" target="product-review-status">
<template>
<p class="mb-8 text-sm font-semibold" tabindex="-1" data-controller="focus-on-connect">{{ __('storefront.review.thank_you') }}</p>
</template>
</turbo-stream>